@spinabot/brigade 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/convex/logs.d.ts +3 -3
- package/convex/memory.d.ts +21 -21
- package/convex/schema.d.ts +9 -9
- package/convex/skills.d.ts +3 -3
- package/dist/buildstamp.json +1 -1
- package/dist/cli/commands/config-cmd.d.ts +12 -19
- package/dist/cli/commands/config-cmd.d.ts.map +1 -1
- package/dist/cli/commands/config-cmd.js +14 -197
- package/dist/cli/commands/config-cmd.js.map +1 -1
- package/dist/core/agents-crud-ops.d.ts +15 -0
- package/dist/core/agents-crud-ops.d.ts.map +1 -0
- package/dist/core/agents-crud-ops.js +27 -0
- package/dist/core/agents-crud-ops.js.map +1 -0
- package/dist/core/agents-ops.d.ts +43 -0
- package/dist/core/agents-ops.d.ts.map +1 -0
- package/dist/core/agents-ops.js +117 -0
- package/dist/core/agents-ops.js.map +1 -0
- package/dist/core/channels-ops.d.ts +30 -0
- package/dist/core/channels-ops.d.ts.map +1 -0
- package/dist/core/channels-ops.js +52 -0
- package/dist/core/channels-ops.js.map +1 -0
- package/dist/core/config-ops.d.ts +77 -0
- package/dist/core/config-ops.d.ts.map +1 -0
- package/dist/core/config-ops.js +241 -0
- package/dist/core/config-ops.js.map +1 -0
- package/dist/core/exec-ops.d.ts +48 -0
- package/dist/core/exec-ops.d.ts.map +1 -0
- package/dist/core/exec-ops.js +101 -0
- package/dist/core/exec-ops.js.map +1 -0
- package/dist/core/integrations-ops.d.ts +25 -0
- package/dist/core/integrations-ops.d.ts.map +1 -0
- package/dist/core/integrations-ops.js +40 -0
- package/dist/core/integrations-ops.js.map +1 -0
- package/dist/core/memory-ops.d.ts +20 -0
- package/dist/core/memory-ops.d.ts.map +1 -0
- package/dist/core/memory-ops.js +40 -0
- package/dist/core/memory-ops.js.map +1 -0
- package/dist/core/pairing-ops.d.ts +33 -0
- package/dist/core/pairing-ops.d.ts.map +1 -0
- package/dist/core/pairing-ops.js +78 -0
- package/dist/core/pairing-ops.js.map +1 -0
- package/dist/core/provider-ops.d.ts +17 -0
- package/dist/core/provider-ops.d.ts.map +1 -0
- package/dist/core/provider-ops.js +29 -0
- package/dist/core/provider-ops.js.map +1 -0
- package/dist/core/server.d.ts.map +1 -1
- package/dist/core/server.js +91 -0
- package/dist/core/server.js.map +1 -1
- package/dist/core/sessions-ops.d.ts +25 -0
- package/dist/core/sessions-ops.d.ts.map +1 -0
- package/dist/core/sessions-ops.js +77 -0
- package/dist/core/sessions-ops.js.map +1 -0
- package/dist/core/skills-ops.d.ts +14 -0
- package/dist/core/skills-ops.d.ts.map +1 -0
- package/dist/core/skills-ops.js +28 -0
- package/dist/core/skills-ops.js.map +1 -0
- package/dist/protocol/methods.d.ts +478 -0
- package/dist/protocol/methods.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-transcript hygiene behind the `sessions.cleanup` gateway RPC — the
|
|
3
|
+
* `brigade sessions cleanup --older-than <duration>` surface, reachable from a
|
|
4
|
+
* remote client.
|
|
5
|
+
*
|
|
6
|
+
* OPERATOR-SCOPED maintenance: deletes an agent's OWN idle transcript files
|
|
7
|
+
* (`~/.brigade/agents/<id>/sessions/<sid>.jsonl`). It does NOT read or disclose
|
|
8
|
+
* another agent's session CONTENT (unlike sessions.list/history/send, which are
|
|
9
|
+
* guarded) — it only removes stale files the gateway regenerates on next
|
|
10
|
+
* access. So no per-session access guard (allowlisted by name in the
|
|
11
|
+
* guard-sweep).
|
|
12
|
+
*/
|
|
13
|
+
/** Parse a duration like "30d" / "12h" / "2w" into milliseconds. */
|
|
14
|
+
export declare function parseDuration(s: string): number | null;
|
|
15
|
+
export interface SessionsCleanupResult {
|
|
16
|
+
ok: boolean;
|
|
17
|
+
agentId: string;
|
|
18
|
+
candidates: number;
|
|
19
|
+
deleted: number;
|
|
20
|
+
dryRun: boolean;
|
|
21
|
+
wouldDelete?: string[];
|
|
22
|
+
reason?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function handleSessionsCleanup(params: unknown): SessionsCleanupResult;
|
|
25
|
+
//# sourceMappingURL=sessions-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions-ops.d.ts","sourceRoot":"","sources":["../../src/core/sessions-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA6BH,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOtD;AAED,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,qBAAqB,CA+B5E"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-transcript hygiene behind the `sessions.cleanup` gateway RPC — the
|
|
3
|
+
* `brigade sessions cleanup --older-than <duration>` surface, reachable from a
|
|
4
|
+
* remote client.
|
|
5
|
+
*
|
|
6
|
+
* OPERATOR-SCOPED maintenance: deletes an agent's OWN idle transcript files
|
|
7
|
+
* (`~/.brigade/agents/<id>/sessions/<sid>.jsonl`). It does NOT read or disclose
|
|
8
|
+
* another agent's session CONTENT (unlike sessions.list/history/send, which are
|
|
9
|
+
* guarded) — it only removes stale files the gateway regenerates on next
|
|
10
|
+
* access. So no per-session access guard (allowlisted by name in the
|
|
11
|
+
* guard-sweep).
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { DEFAULT_AGENT_ID, resolveSessionsDir } from "../config/paths.js";
|
|
16
|
+
function listSessionFiles(agentId) {
|
|
17
|
+
const dir = resolveSessionsDir(agentId);
|
|
18
|
+
if (!existsSync(dir))
|
|
19
|
+
return [];
|
|
20
|
+
const rows = [];
|
|
21
|
+
for (const name of readdirSync(dir)) {
|
|
22
|
+
if (!name.endsWith(".jsonl"))
|
|
23
|
+
continue;
|
|
24
|
+
try {
|
|
25
|
+
const st = statSync(path.join(dir, name));
|
|
26
|
+
rows.push({ sessionId: name.replace(/\.jsonl$/, ""), bytes: st.size, mtimeMs: st.mtimeMs });
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
/* ignore unreadable entries */
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return rows;
|
|
33
|
+
}
|
|
34
|
+
/** Parse a duration like "30d" / "12h" / "2w" into milliseconds. */
|
|
35
|
+
export function parseDuration(s) {
|
|
36
|
+
const m = s.match(/^(\d+)\s*(s|m|h|d|w)$/i);
|
|
37
|
+
if (!m)
|
|
38
|
+
return null;
|
|
39
|
+
const n = Number(m[1]);
|
|
40
|
+
const u = m[2]?.toLowerCase() ?? "d";
|
|
41
|
+
const mul = { s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000, w: 604_800_000 }[u] ?? 0;
|
|
42
|
+
return n * mul;
|
|
43
|
+
}
|
|
44
|
+
export function handleSessionsCleanup(params) {
|
|
45
|
+
const p = (params ?? {});
|
|
46
|
+
const agentId = (p.agentId ?? "").trim() || DEFAULT_AGENT_ID;
|
|
47
|
+
const dryRun = !!p.dryRun;
|
|
48
|
+
const ms = parseDuration((p.olderThan ?? "").trim());
|
|
49
|
+
if (ms == null) {
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
agentId,
|
|
53
|
+
candidates: 0,
|
|
54
|
+
deleted: 0,
|
|
55
|
+
dryRun,
|
|
56
|
+
reason: `'olderThan' must look like "30d" / "12h" / "2w"`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const cutoff = Date.now() - ms;
|
|
60
|
+
const stale = listSessionFiles(agentId).filter((r) => r.mtimeMs < cutoff);
|
|
61
|
+
if (dryRun) {
|
|
62
|
+
return { ok: true, agentId, candidates: stale.length, deleted: 0, dryRun: true, wouldDelete: stale.map((r) => r.sessionId) };
|
|
63
|
+
}
|
|
64
|
+
const dir = resolveSessionsDir(agentId);
|
|
65
|
+
let deleted = 0;
|
|
66
|
+
for (const r of stale) {
|
|
67
|
+
try {
|
|
68
|
+
rmSync(path.join(dir, `${r.sessionId}.jsonl`), { force: true });
|
|
69
|
+
deleted++;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
/* best-effort — skip individual delete failures */
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { ok: true, agentId, candidates: stale.length, deleted, dryRun: false };
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=sessions-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions-ops.js","sourceRoot":"","sources":["../../src/core/sessions-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQ1E,SAAS,gBAAgB,CAAC,OAAe;IACxC,MAAM,GAAG,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,MAAM,IAAI,GAAkB,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,C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AE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill authoring behind the `skills.create` / `skills.delete` /
|
|
3
|
+
* `skills.write-file` gateway RPCs — reachable from a remote client.
|
|
4
|
+
*
|
|
5
|
+
* Skills are SKILL.md files on disk (NOT config), so `config.set` can't author
|
|
6
|
+
* them; `skills.status`/`skills.install`/`skills.update` already cover read /
|
|
7
|
+
* install / enable. These close create/delete/support-file. Reuses the
|
|
8
|
+
* `manage_skill` tool (ctx-free execute, owner-gated via wrapper). Operator-
|
|
9
|
+
* scoped (no per-session guard — allowlisted in the guard-sweep).
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleSkillsCreate(params: unknown): Promise<unknown>;
|
|
12
|
+
export declare function handleSkillsDelete(params: unknown): Promise<unknown>;
|
|
13
|
+
export declare function handleSkillsWriteFile(params: unknown): Promise<unknown>;
|
|
14
|
+
//# sourceMappingURL=skills-ops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-ops.d.ts","sourceRoot":"","sources":["../../src/core/skills-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE1E;AACD,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE1E;AACD,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill authoring behind the `skills.create` / `skills.delete` /
|
|
3
|
+
* `skills.write-file` gateway RPCs — reachable from a remote client.
|
|
4
|
+
*
|
|
5
|
+
* Skills are SKILL.md files on disk (NOT config), so `config.set` can't author
|
|
6
|
+
* them; `skills.status`/`skills.install`/`skills.update` already cover read /
|
|
7
|
+
* install / enable. These close create/delete/support-file. Reuses the
|
|
8
|
+
* `manage_skill` tool (ctx-free execute, owner-gated via wrapper). Operator-
|
|
9
|
+
* scoped (no per-session guard — allowlisted in the guard-sweep).
|
|
10
|
+
*/
|
|
11
|
+
import { DEFAULT_AGENT_ID } from "../agents/routing/session-key.js";
|
|
12
|
+
import { makeManageSkillTool } from "../agents/tools/manage-skill-tool.js";
|
|
13
|
+
async function runManageSkill(args) {
|
|
14
|
+
const requesterAgentId = typeof args.agentId === "string" && args.agentId.trim().length > 0 ? args.agentId : DEFAULT_AGENT_ID;
|
|
15
|
+
const tool = makeManageSkillTool({ requesterAgentId });
|
|
16
|
+
const res = await tool.execute("gateway", args);
|
|
17
|
+
return res.details;
|
|
18
|
+
}
|
|
19
|
+
export async function handleSkillsCreate(params) {
|
|
20
|
+
return runManageSkill({ ...(params ?? {}), action: "create" });
|
|
21
|
+
}
|
|
22
|
+
export async function handleSkillsDelete(params) {
|
|
23
|
+
return runManageSkill({ ...(params ?? {}), action: "delete" });
|
|
24
|
+
}
|
|
25
|
+
export async function handleSkillsWriteFile(params) {
|
|
26
|
+
return runManageSkill({ ...(params ?? {}), action: "write_file" });
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=skills-ops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-ops.js","sourceRoot":"","sources":["../../src/core/skills-ops.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,KAAK,UAAU,cAAc,CAAC,IAA6B;IAC1D,MAAM,gBAAgB,GACrB,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACtG,MAAM,IAAI,GAAG,mBAAmB,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;IACvD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAa,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAe;IACvD,OAAO,cAAc,CAAC,EAAE,GAAI,CAAC,MAAM,IAAI,EAAE,CAA6B,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7F,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAAe;IACvD,OAAO,cAAc,CAAC,EAAE,GAAI,CAAC,MAAM,IAAI,EAAE,CAA6B,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7F,CAAC;AACD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAe;IAC1D,OAAO,cAAc,CAAC,EAAE,GAAI,CAAC,MAAM,IAAI,EAAE,CAA6B,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -232,7 +232,485 @@ export type OrgSnapshotResult = {
|
|
|
232
232
|
reason: "flat-crew";
|
|
233
233
|
redirect: string;
|
|
234
234
|
};
|
|
235
|
+
export interface ConfigGetParams {
|
|
236
|
+
path: string;
|
|
237
|
+
}
|
|
238
|
+
export interface ConfigGetResult {
|
|
239
|
+
found: boolean;
|
|
240
|
+
value?: unknown;
|
|
241
|
+
}
|
|
242
|
+
export interface ConfigSetParams {
|
|
243
|
+
path: string;
|
|
244
|
+
value: unknown;
|
|
245
|
+
}
|
|
246
|
+
export interface ConfigSetResult {
|
|
247
|
+
ok: boolean;
|
|
248
|
+
path: string;
|
|
249
|
+
value: unknown;
|
|
250
|
+
}
|
|
251
|
+
export interface ConfigUnsetParams {
|
|
252
|
+
path: string;
|
|
253
|
+
}
|
|
254
|
+
export interface ConfigUnsetResult {
|
|
255
|
+
ok: boolean;
|
|
256
|
+
path: string;
|
|
257
|
+
removed: boolean;
|
|
258
|
+
}
|
|
259
|
+
export interface ConfigListParams {
|
|
260
|
+
/** Pass `false` to include raw secret values. Default redacts. */
|
|
261
|
+
redact?: boolean;
|
|
262
|
+
}
|
|
263
|
+
export interface ConfigListResult {
|
|
264
|
+
config: unknown;
|
|
265
|
+
}
|
|
266
|
+
export type ConfigSchemaParams = Record<string, never> | undefined;
|
|
267
|
+
export interface ConfigSchemaResult {
|
|
268
|
+
schema: unknown;
|
|
269
|
+
}
|
|
270
|
+
export type ConfigValidateParams = Record<string, never> | undefined;
|
|
271
|
+
export interface ConfigValidateResult {
|
|
272
|
+
valid: boolean;
|
|
273
|
+
issues: Array<{
|
|
274
|
+
path: string;
|
|
275
|
+
message: string;
|
|
276
|
+
}>;
|
|
277
|
+
}
|
|
278
|
+
export interface ExecListParams {
|
|
279
|
+
agentId?: string;
|
|
280
|
+
}
|
|
281
|
+
export interface ExecListResult {
|
|
282
|
+
agentId: string;
|
|
283
|
+
filePath: string;
|
|
284
|
+
commands: string[];
|
|
285
|
+
patterns: string[];
|
|
286
|
+
}
|
|
287
|
+
export interface ExecAllowParams {
|
|
288
|
+
command: string;
|
|
289
|
+
agentId?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface ExecAllowPatternParams {
|
|
292
|
+
pattern: string;
|
|
293
|
+
agentId?: string;
|
|
294
|
+
}
|
|
295
|
+
export interface ExecMutateResult {
|
|
296
|
+
ok: boolean;
|
|
297
|
+
agentId: string;
|
|
298
|
+
kind?: "exact" | "pattern";
|
|
299
|
+
value?: string;
|
|
300
|
+
reason?: string;
|
|
301
|
+
}
|
|
302
|
+
export interface ExecRemoveParams {
|
|
303
|
+
value: string;
|
|
304
|
+
agentId?: string;
|
|
305
|
+
}
|
|
306
|
+
export interface ExecRemoveResult {
|
|
307
|
+
ok: boolean;
|
|
308
|
+
agentId: string;
|
|
309
|
+
removedCommands: number;
|
|
310
|
+
removedPatterns: number;
|
|
311
|
+
reason?: string;
|
|
312
|
+
}
|
|
313
|
+
export interface ExecDenyTestParams {
|
|
314
|
+
command: string;
|
|
315
|
+
agentId?: string;
|
|
316
|
+
}
|
|
317
|
+
export interface ExecDenyTestResult {
|
|
318
|
+
agentId: string;
|
|
319
|
+
command: string;
|
|
320
|
+
decision: "allow" | "deny" | "prompt";
|
|
321
|
+
}
|
|
322
|
+
export interface AgentsBindingsParams {
|
|
323
|
+
agentId?: string;
|
|
324
|
+
}
|
|
325
|
+
export interface AgentsBindingsResult {
|
|
326
|
+
bindings: Array<{
|
|
327
|
+
agentId: string;
|
|
328
|
+
description: string;
|
|
329
|
+
}>;
|
|
330
|
+
}
|
|
331
|
+
export interface AgentsBindParams {
|
|
332
|
+
agentId?: string;
|
|
333
|
+
/** Binding specs, e.g. `["whatsapp", "slack:T123"]`. */
|
|
334
|
+
specs: string[];
|
|
335
|
+
}
|
|
336
|
+
export interface AgentsBindResult {
|
|
337
|
+
ok: boolean;
|
|
338
|
+
agentId: string;
|
|
339
|
+
added: string[];
|
|
340
|
+
updated: string[];
|
|
341
|
+
skipped: string[];
|
|
342
|
+
conflicts: string[];
|
|
343
|
+
errors?: string[];
|
|
344
|
+
}
|
|
345
|
+
export interface AgentsUnbindParams {
|
|
346
|
+
agentId?: string;
|
|
347
|
+
specs?: string[];
|
|
348
|
+
/** Remove every binding owned by the agent. */
|
|
349
|
+
all?: boolean;
|
|
350
|
+
}
|
|
351
|
+
export interface AgentsUnbindResult {
|
|
352
|
+
ok: boolean;
|
|
353
|
+
agentId: string;
|
|
354
|
+
removed: string[];
|
|
355
|
+
missing: string[];
|
|
356
|
+
conflicts: string[];
|
|
357
|
+
errors?: string[];
|
|
358
|
+
}
|
|
359
|
+
export interface PairingPendingEntry {
|
|
360
|
+
code: string;
|
|
361
|
+
senderId: string;
|
|
362
|
+
senderName?: string;
|
|
363
|
+
createdAt: string;
|
|
364
|
+
}
|
|
365
|
+
export interface PairingListParams {
|
|
366
|
+
channel: string;
|
|
367
|
+
}
|
|
368
|
+
export interface PairingListResult {
|
|
369
|
+
channel: string;
|
|
370
|
+
pending: PairingPendingEntry[];
|
|
371
|
+
}
|
|
372
|
+
export interface PairingApproveParams {
|
|
373
|
+
channel: string;
|
|
374
|
+
code: string;
|
|
375
|
+
}
|
|
376
|
+
export interface PairingApproveResult {
|
|
377
|
+
ok: boolean;
|
|
378
|
+
channel: string;
|
|
379
|
+
sender?: string;
|
|
380
|
+
owner?: boolean;
|
|
381
|
+
reason?: string;
|
|
382
|
+
}
|
|
383
|
+
export interface PairingRevokeParams {
|
|
384
|
+
channel: string;
|
|
385
|
+
code: string;
|
|
386
|
+
}
|
|
387
|
+
export interface PairingRevokeResult {
|
|
388
|
+
ok: boolean;
|
|
389
|
+
channel: string;
|
|
390
|
+
reason?: string;
|
|
391
|
+
}
|
|
392
|
+
export interface SessionsCleanupParams {
|
|
393
|
+
agentId?: string;
|
|
394
|
+
/** Duration like "30d" / "12h" / "2w". */
|
|
395
|
+
olderThan: string;
|
|
396
|
+
dryRun?: boolean;
|
|
397
|
+
}
|
|
398
|
+
export interface SessionsCleanupResult {
|
|
399
|
+
ok: boolean;
|
|
400
|
+
agentId: string;
|
|
401
|
+
candidates: number;
|
|
402
|
+
deleted: number;
|
|
403
|
+
dryRun: boolean;
|
|
404
|
+
wouldDelete?: string[];
|
|
405
|
+
reason?: string;
|
|
406
|
+
}
|
|
407
|
+
export interface AgentsAddParams {
|
|
408
|
+
id: string;
|
|
409
|
+
provider?: string;
|
|
410
|
+
model?: string;
|
|
411
|
+
department?: string;
|
|
412
|
+
reportsTo?: string;
|
|
413
|
+
role?: string;
|
|
414
|
+
bio?: string;
|
|
415
|
+
displayName?: string;
|
|
416
|
+
[key: string]: unknown;
|
|
417
|
+
}
|
|
418
|
+
export interface AgentsDeleteParams {
|
|
419
|
+
id: string;
|
|
420
|
+
}
|
|
421
|
+
export interface AgentsSetIdentityParams {
|
|
422
|
+
id: string;
|
|
423
|
+
displayName?: string;
|
|
424
|
+
emoji?: string;
|
|
425
|
+
theme?: string;
|
|
426
|
+
avatar?: string;
|
|
427
|
+
[key: string]: unknown;
|
|
428
|
+
}
|
|
429
|
+
export interface AgentsManageResult {
|
|
430
|
+
action: string;
|
|
431
|
+
id: string;
|
|
432
|
+
ok: boolean;
|
|
433
|
+
exitCode?: number;
|
|
434
|
+
stdout?: string;
|
|
435
|
+
stderr?: string;
|
|
436
|
+
[key: string]: unknown;
|
|
437
|
+
}
|
|
438
|
+
export interface SkillsCreateParams {
|
|
439
|
+
name: string;
|
|
440
|
+
scope?: "agent" | "managed";
|
|
441
|
+
agentId?: string;
|
|
442
|
+
body?: string;
|
|
443
|
+
description?: string;
|
|
444
|
+
[key: string]: unknown;
|
|
445
|
+
}
|
|
446
|
+
export interface SkillsDeleteParams {
|
|
447
|
+
name: string;
|
|
448
|
+
scope?: "agent" | "managed";
|
|
449
|
+
agentId?: string;
|
|
450
|
+
}
|
|
451
|
+
export interface SkillsWriteFileParams {
|
|
452
|
+
name: string;
|
|
453
|
+
filePath: string;
|
|
454
|
+
content?: string;
|
|
455
|
+
scope?: "agent" | "managed";
|
|
456
|
+
agentId?: string;
|
|
457
|
+
[key: string]: unknown;
|
|
458
|
+
}
|
|
459
|
+
export interface SkillsManageResult {
|
|
460
|
+
action: string;
|
|
461
|
+
name: string;
|
|
462
|
+
ok: boolean;
|
|
463
|
+
message?: string;
|
|
464
|
+
[key: string]: unknown;
|
|
465
|
+
}
|
|
466
|
+
export interface MemoryWriteParams {
|
|
467
|
+
content: string;
|
|
468
|
+
/** identity | preference | fact | correction | context | project … */
|
|
469
|
+
segment: string;
|
|
470
|
+
importance?: number;
|
|
471
|
+
supersedes?: string[];
|
|
472
|
+
subjectKey?: string;
|
|
473
|
+
agentId?: string;
|
|
474
|
+
}
|
|
475
|
+
export interface MemoryWriteResult {
|
|
476
|
+
memoryId?: string;
|
|
477
|
+
segment?: string;
|
|
478
|
+
importance?: number;
|
|
479
|
+
backend?: string;
|
|
480
|
+
[key: string]: unknown;
|
|
481
|
+
}
|
|
482
|
+
export interface MemoryManageParams {
|
|
483
|
+
action: "dream" | "purge" | "inspect" | "export" | "retention" | "vault" | "propose" | "retract" | "restore" | "relink";
|
|
484
|
+
memory_id?: string;
|
|
485
|
+
ttl_days?: number;
|
|
486
|
+
agentId?: string;
|
|
487
|
+
}
|
|
488
|
+
export interface MemoryManageResult {
|
|
489
|
+
action: string;
|
|
490
|
+
ok: boolean;
|
|
491
|
+
message: string;
|
|
492
|
+
[key: string]: unknown;
|
|
493
|
+
}
|
|
494
|
+
export interface ChannelsConnectParams {
|
|
495
|
+
channel: string;
|
|
496
|
+
/** Token for token channels (e.g. Telegram); omit for QR channels. */
|
|
497
|
+
token?: string;
|
|
498
|
+
accountId?: string;
|
|
499
|
+
}
|
|
500
|
+
export interface ChannelsDisconnectParams {
|
|
501
|
+
channel: string;
|
|
502
|
+
accountId?: string;
|
|
503
|
+
}
|
|
504
|
+
export interface ChannelsActionResult {
|
|
505
|
+
action?: string;
|
|
506
|
+
ok: boolean;
|
|
507
|
+
message?: string;
|
|
508
|
+
[key: string]: unknown;
|
|
509
|
+
}
|
|
510
|
+
export interface ChannelsAllowParams {
|
|
511
|
+
channel: string;
|
|
512
|
+
senderId: string;
|
|
513
|
+
accountId?: string;
|
|
514
|
+
}
|
|
515
|
+
export interface ChannelsAllowResult {
|
|
516
|
+
ok: boolean;
|
|
517
|
+
channel: string;
|
|
518
|
+
senderId: string;
|
|
519
|
+
changed: boolean;
|
|
520
|
+
reason?: string;
|
|
521
|
+
}
|
|
522
|
+
export interface ChannelsAllowListParams {
|
|
523
|
+
channel: string;
|
|
524
|
+
accountId?: string;
|
|
525
|
+
}
|
|
526
|
+
export interface ChannelsAllowListResult {
|
|
527
|
+
channel: string;
|
|
528
|
+
senders: string[];
|
|
529
|
+
}
|
|
530
|
+
export interface ProviderRemoveParams {
|
|
531
|
+
providerId: string;
|
|
532
|
+
agentId?: string;
|
|
533
|
+
}
|
|
534
|
+
export interface ProviderRemoveResult {
|
|
535
|
+
ok: boolean;
|
|
536
|
+
providerId: string;
|
|
537
|
+
agentId: string;
|
|
538
|
+
removed: number;
|
|
539
|
+
reason?: string;
|
|
540
|
+
}
|
|
541
|
+
export interface ComposioParams {
|
|
542
|
+
action: "set-key" | "apps" | "connect" | "status" | "search" | "execute" | "disconnect" | "refresh";
|
|
543
|
+
key?: string;
|
|
544
|
+
app?: string;
|
|
545
|
+
query?: string;
|
|
546
|
+
tool?: string;
|
|
547
|
+
arguments?: Record<string, unknown>;
|
|
548
|
+
connectionId?: string;
|
|
549
|
+
all?: boolean;
|
|
550
|
+
agentId?: string;
|
|
551
|
+
[key: string]: unknown;
|
|
552
|
+
}
|
|
553
|
+
export interface ComposioResult {
|
|
554
|
+
action: string;
|
|
555
|
+
ok: boolean;
|
|
556
|
+
message: string;
|
|
557
|
+
[key: string]: unknown;
|
|
558
|
+
}
|
|
559
|
+
export interface OauthParams {
|
|
560
|
+
action: "start" | "await" | "cancel" | "status" | "token";
|
|
561
|
+
clientId?: string;
|
|
562
|
+
clientSecret?: string;
|
|
563
|
+
authorizeUrl?: string;
|
|
564
|
+
tokenUrl?: string;
|
|
565
|
+
scopes?: string[];
|
|
566
|
+
port?: number;
|
|
567
|
+
waitSeconds?: number;
|
|
568
|
+
connectionId?: string;
|
|
569
|
+
agentId?: string;
|
|
570
|
+
[key: string]: unknown;
|
|
571
|
+
}
|
|
572
|
+
export interface OauthResult {
|
|
573
|
+
action?: string;
|
|
574
|
+
ok?: boolean;
|
|
575
|
+
[key: string]: unknown;
|
|
576
|
+
}
|
|
235
577
|
export interface GatewayMethodSignatures {
|
|
578
|
+
"memory.write": {
|
|
579
|
+
params: MemoryWriteParams;
|
|
580
|
+
result: MemoryWriteResult;
|
|
581
|
+
};
|
|
582
|
+
"memory.manage": {
|
|
583
|
+
params: MemoryManageParams;
|
|
584
|
+
result: MemoryManageResult;
|
|
585
|
+
};
|
|
586
|
+
"agents.add": {
|
|
587
|
+
params: AgentsAddParams;
|
|
588
|
+
result: AgentsManageResult;
|
|
589
|
+
};
|
|
590
|
+
"agents.delete": {
|
|
591
|
+
params: AgentsDeleteParams;
|
|
592
|
+
result: AgentsManageResult;
|
|
593
|
+
};
|
|
594
|
+
"agents.set-identity": {
|
|
595
|
+
params: AgentsSetIdentityParams;
|
|
596
|
+
result: AgentsManageResult;
|
|
597
|
+
};
|
|
598
|
+
"skills.create": {
|
|
599
|
+
params: SkillsCreateParams;
|
|
600
|
+
result: SkillsManageResult;
|
|
601
|
+
};
|
|
602
|
+
"skills.delete": {
|
|
603
|
+
params: SkillsDeleteParams;
|
|
604
|
+
result: SkillsManageResult;
|
|
605
|
+
};
|
|
606
|
+
"skills.write-file": {
|
|
607
|
+
params: SkillsWriteFileParams;
|
|
608
|
+
result: SkillsManageResult;
|
|
609
|
+
};
|
|
610
|
+
"channels.connect": {
|
|
611
|
+
params: ChannelsConnectParams;
|
|
612
|
+
result: ChannelsActionResult;
|
|
613
|
+
};
|
|
614
|
+
"channels.disconnect": {
|
|
615
|
+
params: ChannelsDisconnectParams;
|
|
616
|
+
result: ChannelsActionResult;
|
|
617
|
+
};
|
|
618
|
+
"channels.allow-add": {
|
|
619
|
+
params: ChannelsAllowParams;
|
|
620
|
+
result: ChannelsAllowResult;
|
|
621
|
+
};
|
|
622
|
+
"channels.allow-remove": {
|
|
623
|
+
params: ChannelsAllowParams;
|
|
624
|
+
result: ChannelsAllowResult;
|
|
625
|
+
};
|
|
626
|
+
"channels.allow-list": {
|
|
627
|
+
params: ChannelsAllowListParams;
|
|
628
|
+
result: ChannelsAllowListResult;
|
|
629
|
+
};
|
|
630
|
+
"provider.remove": {
|
|
631
|
+
params: ProviderRemoveParams;
|
|
632
|
+
result: ProviderRemoveResult;
|
|
633
|
+
};
|
|
634
|
+
composio: {
|
|
635
|
+
params: ComposioParams;
|
|
636
|
+
result: ComposioResult;
|
|
637
|
+
};
|
|
638
|
+
oauth: {
|
|
639
|
+
params: OauthParams;
|
|
640
|
+
result: OauthResult;
|
|
641
|
+
};
|
|
642
|
+
"config.get": {
|
|
643
|
+
params: ConfigGetParams;
|
|
644
|
+
result: ConfigGetResult;
|
|
645
|
+
};
|
|
646
|
+
"config.set": {
|
|
647
|
+
params: ConfigSetParams;
|
|
648
|
+
result: ConfigSetResult;
|
|
649
|
+
};
|
|
650
|
+
"config.unset": {
|
|
651
|
+
params: ConfigUnsetParams;
|
|
652
|
+
result: ConfigUnsetResult;
|
|
653
|
+
};
|
|
654
|
+
"config.list": {
|
|
655
|
+
params: ConfigListParams;
|
|
656
|
+
result: ConfigListResult;
|
|
657
|
+
};
|
|
658
|
+
"config.schema": {
|
|
659
|
+
params: ConfigSchemaParams;
|
|
660
|
+
result: ConfigSchemaResult;
|
|
661
|
+
};
|
|
662
|
+
"config.validate": {
|
|
663
|
+
params: ConfigValidateParams;
|
|
664
|
+
result: ConfigValidateResult;
|
|
665
|
+
};
|
|
666
|
+
"exec.list": {
|
|
667
|
+
params: ExecListParams;
|
|
668
|
+
result: ExecListResult;
|
|
669
|
+
};
|
|
670
|
+
"exec.allow": {
|
|
671
|
+
params: ExecAllowParams;
|
|
672
|
+
result: ExecMutateResult;
|
|
673
|
+
};
|
|
674
|
+
"exec.allow-pattern": {
|
|
675
|
+
params: ExecAllowPatternParams;
|
|
676
|
+
result: ExecMutateResult;
|
|
677
|
+
};
|
|
678
|
+
"exec.remove": {
|
|
679
|
+
params: ExecRemoveParams;
|
|
680
|
+
result: ExecRemoveResult;
|
|
681
|
+
};
|
|
682
|
+
"exec.deny-test": {
|
|
683
|
+
params: ExecDenyTestParams;
|
|
684
|
+
result: ExecDenyTestResult;
|
|
685
|
+
};
|
|
686
|
+
"agents.bindings": {
|
|
687
|
+
params: AgentsBindingsParams;
|
|
688
|
+
result: AgentsBindingsResult;
|
|
689
|
+
};
|
|
690
|
+
"agents.bind": {
|
|
691
|
+
params: AgentsBindParams;
|
|
692
|
+
result: AgentsBindResult;
|
|
693
|
+
};
|
|
694
|
+
"agents.unbind": {
|
|
695
|
+
params: AgentsUnbindParams;
|
|
696
|
+
result: AgentsUnbindResult;
|
|
697
|
+
};
|
|
698
|
+
"pairing.list": {
|
|
699
|
+
params: PairingListParams;
|
|
700
|
+
result: PairingListResult;
|
|
701
|
+
};
|
|
702
|
+
"pairing.approve": {
|
|
703
|
+
params: PairingApproveParams;
|
|
704
|
+
result: PairingApproveResult;
|
|
705
|
+
};
|
|
706
|
+
"pairing.revoke": {
|
|
707
|
+
params: PairingRevokeParams;
|
|
708
|
+
result: PairingRevokeResult;
|
|
709
|
+
};
|
|
710
|
+
"sessions.cleanup": {
|
|
711
|
+
params: SessionsCleanupParams;
|
|
712
|
+
result: SessionsCleanupResult;
|
|
713
|
+
};
|
|
236
714
|
"sessions.send": {
|
|
237
715
|
params: SessionsSendParams;
|
|
238
716
|
result: SessionsSendResult;
|