refactor: move inbound config

This commit is contained in:
Peter Steinberger
2025-12-24 00:22:52 +00:00
parent 5e07400cd1
commit 93af424ce5
34 changed files with 283 additions and 243 deletions

View File

@@ -39,10 +39,10 @@ function makeCfg(home: string) {
model: "claude-opus-4-5",
workspace: join(home, "clawd"),
},
inbound: {
routing: {
allowFrom: ["*"],
session: { store: join(home, "sessions.json") },
},
session: { store: join(home, "sessions.json") },
};
}
@@ -119,7 +119,7 @@ describe("trigger handling", () => {
const text = Array.isArray(res) ? res[0]?.text : res?.text;
expect(text).toContain("Group activation set to always");
const store = JSON.parse(
await fs.readFile(cfg.inbound.session.store, "utf-8"),
await fs.readFile(cfg.session.store, "utf-8"),
) as Record<string, { groupActivation?: string }>;
expect(store["group:123@g.us"]?.groupActivation).toBe("always");
expect(runEmbeddedPiAgent).not.toHaveBeenCalled();
@@ -172,11 +172,11 @@ describe("trigger handling", () => {
model: "claude-opus-4-5",
workspace: join(home, "clawd"),
},
inbound: {
routing: {
allowFrom: ["*"],
session: { store: join(home, "sessions.json") },
groupChat: { requireMention: false },
},
session: { store: join(home, "sessions.json") },
},
);
@@ -214,11 +214,11 @@ describe("trigger handling", () => {
model: "claude-opus-4-5",
workspace: join(home, "clawd"),
},
inbound: {
routing: {
allowFrom: ["*"],
session: {
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
},
},
session: {
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
},
},
);
@@ -254,11 +254,11 @@ describe("trigger handling", () => {
model: "claude-opus-4-5",
workspace: join(home, "clawd"),
},
inbound: {
routing: {
allowFrom: ["*"],
session: {
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
},
},
session: {
store: join(tmpdir(), `clawdis-session-test-${Date.now()}.json`),
},
},
);