agentcorp-broker 0.1.0-alpha.1
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/CHANGELOG.md +52 -0
- package/CONTRIBUTING.md +20 -0
- package/LICENSE +201 -0
- package/README.md +250 -0
- package/SECURITY.md +23 -0
- package/dist/audit.d.ts +25 -0
- package/dist/audit.js +203 -0
- package/dist/audit.js.map +1 -0
- package/dist/broker.d.ts +103 -0
- package/dist/broker.js +805 -0
- package/dist/broker.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +712 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +41 -0
- package/dist/config.js.map +1 -0
- package/dist/console/console.css +794 -0
- package/dist/console/console.js +802 -0
- package/dist/console/index.html +309 -0
- package/dist/credentials.d.ts +16 -0
- package/dist/credentials.js +72 -0
- package/dist/credentials.js.map +1 -0
- package/dist/database.d.ts +119 -0
- package/dist/database.js +1356 -0
- package/dist/database.js.map +1 -0
- package/dist/diagnostics.d.ts +44 -0
- package/dist/diagnostics.js +357 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +14 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +3 -0
- package/dist/mcp.js +215 -0
- package/dist/mcp.js.map +1 -0
- package/dist/migrations.d.ts +13 -0
- package/dist/migrations.js +266 -0
- package/dist/migrations.js.map +1 -0
- package/dist/policy.d.ts +22 -0
- package/dist/policy.js +33 -0
- package/dist/policy.js.map +1 -0
- package/dist/server.d.ts +49 -0
- package/dist/server.js +529 -0
- package/dist/server.js.map +1 -0
- package/dist/stdio-adapter.d.ts +230 -0
- package/dist/stdio-adapter.js +406 -0
- package/dist/stdio-adapter.js.map +1 -0
- package/dist/tui.d.ts +26 -0
- package/dist/tui.js +291 -0
- package/dist/tui.js.map +1 -0
- package/dist/types.d.ts +355 -0
- package/dist/types.js +85 -0
- package/dist/types.js.map +1 -0
- package/docs/ARCHITECTURE.md +119 -0
- package/docs/README.md +37 -0
- package/docs/RELEASING.md +228 -0
- package/docs/ROADMAP.md +112 -0
- package/docs/cli-reference.md +133 -0
- package/docs/dogfooding-report.md +83 -0
- package/docs/getting-started.md +228 -0
- package/docs/guides/antigravity-setup.md +84 -0
- package/docs/guides/claude-cursor-setup.md +76 -0
- package/docs/guides/codex-setup.md +75 -0
- package/docs/guides/human-console.md +177 -0
- package/docs/mcp-tools-reference.md +235 -0
- package/docs/policy-guide.md +105 -0
- package/examples/org.toml +65 -0
- package/package.json +68 -0
package/dist/tui.js
ADDED
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { createInterface } from "node:readline/promises";
|
|
2
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
3
|
+
import { AgentCorpError } from "./errors.js";
|
|
4
|
+
// ANSI escape codes for slick terminal styling
|
|
5
|
+
const c = {
|
|
6
|
+
reset: "\x1b[0m",
|
|
7
|
+
bold: "\x1b[1m",
|
|
8
|
+
dim: "\x1b[2m",
|
|
9
|
+
cyan: "\x1b[36m",
|
|
10
|
+
green: "\x1b[32m",
|
|
11
|
+
yellow: "\x1b[33m",
|
|
12
|
+
red: "\x1b[31m",
|
|
13
|
+
magenta: "\x1b[35m",
|
|
14
|
+
blue: "\x1b[34m",
|
|
15
|
+
gray: "\x1b[90m",
|
|
16
|
+
bgCyan: "\x1b[46m\x1b[30m",
|
|
17
|
+
bgYellow: "\x1b[43m\x1b[30m",
|
|
18
|
+
};
|
|
19
|
+
export class AgentCorpTui {
|
|
20
|
+
daemonUrl;
|
|
21
|
+
adminToken;
|
|
22
|
+
broker;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.daemonUrl = options.daemonUrl;
|
|
25
|
+
this.adminToken = options.adminToken;
|
|
26
|
+
this.broker = options.broker;
|
|
27
|
+
}
|
|
28
|
+
async fetchApprovals() {
|
|
29
|
+
if (this.daemonUrl && this.adminToken) {
|
|
30
|
+
try {
|
|
31
|
+
const res = await fetch(`${this.daemonUrl}/api/approvals`, {
|
|
32
|
+
headers: { Authorization: `Bearer ${this.adminToken}` },
|
|
33
|
+
});
|
|
34
|
+
if (!res.ok) {
|
|
35
|
+
const body = await res.text().catch(() => "");
|
|
36
|
+
throw new AgentCorpError("DAEMON_ERROR", `Daemon returned HTTP ${res.status} (${res.statusText}): ${body || "Authentication or permission failure"}`);
|
|
37
|
+
}
|
|
38
|
+
return (await res.json());
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
if (err instanceof AgentCorpError)
|
|
42
|
+
throw err;
|
|
43
|
+
throw new AgentCorpError("DAEMON_UNREACHABLE", `Cannot reach AgentCorp daemon at ${this.daemonUrl}: ${String(err)}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (this.broker) {
|
|
47
|
+
return this.broker.listPendingApprovals();
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
async approve(id, note, payload) {
|
|
52
|
+
if (this.daemonUrl && this.adminToken) {
|
|
53
|
+
const res = await fetch(`${this.daemonUrl}/api/approvals/${encodeURIComponent(id)}/approve`, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
headers: {
|
|
56
|
+
Authorization: `Bearer ${this.adminToken}`,
|
|
57
|
+
"Content-Type": "application/json",
|
|
58
|
+
},
|
|
59
|
+
body: JSON.stringify({ note: note || "Approved via Terminal Console", payload }),
|
|
60
|
+
});
|
|
61
|
+
if (!res.ok) {
|
|
62
|
+
const body = await res.text().catch(() => "");
|
|
63
|
+
throw new AgentCorpError("APPROVE_FAILED", `Failed to approve ${id}: HTTP ${res.status} ${body}`);
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (this.broker) {
|
|
68
|
+
this.broker.approve(id, note, payload);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async reject(id, note) {
|
|
72
|
+
if (this.daemonUrl && this.adminToken) {
|
|
73
|
+
const res = await fetch(`${this.daemonUrl}/api/approvals/${encodeURIComponent(id)}/reject`, {
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: {
|
|
76
|
+
Authorization: `Bearer ${this.adminToken}`,
|
|
77
|
+
"Content-Type": "application/json",
|
|
78
|
+
},
|
|
79
|
+
body: JSON.stringify({ note: note || "Rejected via Terminal Console" }),
|
|
80
|
+
});
|
|
81
|
+
if (!res.ok) {
|
|
82
|
+
const body = await res.text().catch(() => "");
|
|
83
|
+
throw new AgentCorpError("REJECT_FAILED", `Failed to reject ${id}: HTTP ${res.status} ${body}`);
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (this.broker) {
|
|
88
|
+
this.broker.reject(id, note);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
printHeader() {
|
|
92
|
+
console.log(`
|
|
93
|
+
${c.cyan}┌─────────────────────────────────────────────────────────────┐${c.reset}
|
|
94
|
+
${c.cyan}│${c.reset} ${c.bold}AGENTCORP${c.reset} ${c.dim}::${c.reset} ${c.bold}Human Approval & Coordination Console${c.reset} ${c.cyan}│${c.reset}
|
|
95
|
+
${c.cyan}└─────────────────────────────────────────────────────────────┘${c.reset}
|
|
96
|
+
`);
|
|
97
|
+
}
|
|
98
|
+
async runReview() {
|
|
99
|
+
const rl = createInterface({ input, output });
|
|
100
|
+
let approved = 0;
|
|
101
|
+
let rejected = 0;
|
|
102
|
+
let skipped = 0;
|
|
103
|
+
try {
|
|
104
|
+
this.printHeader();
|
|
105
|
+
let pending = [];
|
|
106
|
+
try {
|
|
107
|
+
pending = await this.fetchApprovals();
|
|
108
|
+
}
|
|
109
|
+
catch (err) {
|
|
110
|
+
console.log(`\n ${c.red}${c.bold}✘ FAILED TO RETRIEVE APPROVALS:${c.reset} ${err instanceof Error ? err.message : String(err)}\n`);
|
|
111
|
+
return { approved: 0, rejected: 0, skipped: 0 };
|
|
112
|
+
}
|
|
113
|
+
if (pending.length === 0) {
|
|
114
|
+
console.log(` ${c.green}✔${c.reset} ${c.bold}All clear!${c.reset} No pending approvals requiring sign-off.`);
|
|
115
|
+
return { approved: 0, rejected: 0, skipped: 0 };
|
|
116
|
+
}
|
|
117
|
+
console.log(` Found ${c.yellow}${c.bold}${pending.length}${c.reset} item(s) awaiting human sign-off:\n`);
|
|
118
|
+
for (let i = 0; i < pending.length; i++) {
|
|
119
|
+
const item = pending[i];
|
|
120
|
+
const num = `[${i + 1}/${pending.length}]`;
|
|
121
|
+
const isMsg = item.subject === "message";
|
|
122
|
+
const subjectTag = isMsg
|
|
123
|
+
? `${c.cyan}[MESSAGE]${c.reset}`
|
|
124
|
+
: `${c.magenta}[TASK TRANSITION]${c.reset}`;
|
|
125
|
+
console.log(`${c.gray}──────────────────────────────────────────────────────────────${c.reset}`);
|
|
126
|
+
console.log(` ${c.bold}${num}${c.reset} ${subjectTag} ${c.bold}ID:${c.reset} ${item.approvalId}`);
|
|
127
|
+
console.log(` ${c.dim}Requested by:${c.reset} ${c.cyan}${item.requestedBy}${c.reset} ${c.dim}Target:${c.reset} ${item.subjectId}`);
|
|
128
|
+
console.log(` ${c.dim}Created at:${c.reset} ${item.createdAt}`);
|
|
129
|
+
if (item.context && typeof item.context === "object") {
|
|
130
|
+
const ctx = item.context;
|
|
131
|
+
if (ctx.toRole) {
|
|
132
|
+
console.log(` ${c.dim}Recipient:${c.reset} ${c.green}${ctx.toRole}${c.reset}`);
|
|
133
|
+
}
|
|
134
|
+
if (ctx.type) {
|
|
135
|
+
console.log(` ${c.dim}Message Type:${c.reset} ${c.blue}${ctx.type}${c.reset}`);
|
|
136
|
+
}
|
|
137
|
+
if (ctx.taskId) {
|
|
138
|
+
console.log(` ${c.dim}Task ID:${c.reset} ${ctx.taskId}`);
|
|
139
|
+
}
|
|
140
|
+
if (ctx.fromStatus && ctx.toStatus) {
|
|
141
|
+
console.log(` ${c.dim}Transition:${c.reset} ${ctx.fromStatus} ──> ${c.bold}${ctx.toStatus}${c.reset}`);
|
|
142
|
+
}
|
|
143
|
+
if (ctx.payload !== undefined) {
|
|
144
|
+
console.log(`\n ${c.bold}Proposed Message Payload:${c.reset}`);
|
|
145
|
+
const payloadStr = typeof ctx.payload === "object"
|
|
146
|
+
? JSON.stringify(ctx.payload, null, 2)
|
|
147
|
+
: String(ctx.payload);
|
|
148
|
+
const indented = payloadStr
|
|
149
|
+
.split("\n")
|
|
150
|
+
.map((line) => ` ${c.gray}│${c.reset} ${line}`)
|
|
151
|
+
.join("\n");
|
|
152
|
+
console.log(indented);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
console.log(`\n ${c.bold}Context / Details:${c.reset}`);
|
|
156
|
+
const contextStr = JSON.stringify(ctx, null, 2);
|
|
157
|
+
const indented = contextStr
|
|
158
|
+
.split("\n")
|
|
159
|
+
.map((line) => ` ${c.gray}│${c.reset} ${line}`)
|
|
160
|
+
.join("\n");
|
|
161
|
+
console.log(indented);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
console.log("");
|
|
165
|
+
let promptMore = true;
|
|
166
|
+
while (promptMore) {
|
|
167
|
+
const promptActions = isMsg
|
|
168
|
+
? ` Action ${c.bold}[${c.green}a${c.reset}${c.bold}]pprove, [${c.cyan}e${c.reset}${c.bold}]dit & approve, [${c.red}r${c.reset}${c.bold}]eject, [${c.yellow}s${c.reset}${c.bold}]kip, [${c.dim}q${c.reset}${c.bold}]uit:${c.reset} `
|
|
169
|
+
: ` Action ${c.bold}[${c.green}a${c.reset}${c.bold}]pprove, [${c.red}r${c.reset}${c.bold}]eject, [${c.yellow}s${c.reset}${c.bold}]kip, [${c.dim}q${c.reset}${c.bold}]uit:${c.reset} `;
|
|
170
|
+
const action = (await rl.question(promptActions)).trim().toLowerCase();
|
|
171
|
+
if (action === "a") {
|
|
172
|
+
const note = (await rl.question(` ${c.dim}Approval note (optional):${c.reset} `)).trim();
|
|
173
|
+
try {
|
|
174
|
+
await this.approve(item.approvalId, note || undefined);
|
|
175
|
+
console.log(` ${c.green}✔ Approved ${item.approvalId}${c.reset}\n`);
|
|
176
|
+
approved++;
|
|
177
|
+
promptMore = false;
|
|
178
|
+
}
|
|
179
|
+
catch (err) {
|
|
180
|
+
console.log(` ${c.red}✘ Approval Failed:${c.reset} ${err instanceof Error ? err.message : String(err)}\n`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else if (action === "e") {
|
|
184
|
+
if (!isMsg) {
|
|
185
|
+
console.log(` ${c.yellow}↷ Payload editing is only supported for messages.${c.reset}`);
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
console.log(`\n ${c.cyan}Enter revised JSON payload:${c.reset}`);
|
|
189
|
+
const inputJson = await rl.question(` ${c.dim}>${c.reset} `);
|
|
190
|
+
try {
|
|
191
|
+
const parsed = JSON.parse(inputJson.trim());
|
|
192
|
+
const note = (await rl.question(` ${c.dim}Modification note (optional):${c.reset} `)).trim();
|
|
193
|
+
await this.approve(item.approvalId, note || undefined, parsed);
|
|
194
|
+
console.log(` ${c.green}✔ Approved with modification ${item.approvalId}${c.reset}\n`);
|
|
195
|
+
approved++;
|
|
196
|
+
promptMore = false;
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
console.log(` ${c.red}✘ Error:${c.reset} ${err instanceof Error ? err.message : String(err)}\n`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
else if (action === "r") {
|
|
203
|
+
const note = (await rl.question(` ${c.dim}Rejection reason / feedback:${c.reset} `)).trim();
|
|
204
|
+
try {
|
|
205
|
+
await this.reject(item.approvalId, note || undefined);
|
|
206
|
+
console.log(` ${c.red}✘ Rejected ${item.approvalId}${c.reset}\n`);
|
|
207
|
+
rejected++;
|
|
208
|
+
promptMore = false;
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
console.log(` ${c.red}✘ Rejection Failed:${c.reset} ${err instanceof Error ? err.message : String(err)}\n`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else if (action === "s") {
|
|
215
|
+
console.log(` ${c.yellow}↷ Skipped${c.reset}\n`);
|
|
216
|
+
skipped++;
|
|
217
|
+
promptMore = false;
|
|
218
|
+
}
|
|
219
|
+
else if (action === "q") {
|
|
220
|
+
console.log(`\n ${c.dim}Review session cancelled.${c.reset}`);
|
|
221
|
+
return { approved, rejected, skipped };
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
console.log(` Invalid choice. Press 'a', 'e', 'r', 's', or 'q'.`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
console.log(`${c.gray}──────────────────────────────────────────────────────────────${c.reset}`);
|
|
229
|
+
console.log(` ${c.bold}Review Complete:${c.reset} ${c.green}${approved} approved${c.reset}, ${c.red}${rejected} rejected${c.reset}, ${c.yellow}${skipped} skipped${c.reset}.\n`);
|
|
230
|
+
return { approved, rejected, skipped };
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
rl.close();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async runDashboard() {
|
|
237
|
+
this.printHeader();
|
|
238
|
+
let pending = [];
|
|
239
|
+
try {
|
|
240
|
+
pending = await this.fetchApprovals();
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
console.log(` ${c.red}${c.bold}✘ FAILED TO CONNECT TO APPROVALS QUEUE:${c.reset}`);
|
|
244
|
+
console.log(` ${c.red}${err instanceof Error ? err.message : String(err)}${c.reset}\n`);
|
|
245
|
+
throw err;
|
|
246
|
+
}
|
|
247
|
+
let tasks = [];
|
|
248
|
+
let totalTasksCount = 0;
|
|
249
|
+
if (this.daemonUrl && this.adminToken) {
|
|
250
|
+
try {
|
|
251
|
+
const res = await fetch(`${this.daemonUrl}/api/tasks`, {
|
|
252
|
+
headers: { Authorization: `Bearer ${this.adminToken}` },
|
|
253
|
+
});
|
|
254
|
+
if (res.ok) {
|
|
255
|
+
tasks = (await res.json());
|
|
256
|
+
const totalHeader = res.headers.get("X-Total-Count");
|
|
257
|
+
totalTasksCount = totalHeader ? parseInt(totalHeader, 10) : tasks.length;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
catch { }
|
|
261
|
+
}
|
|
262
|
+
else if (this.broker) {
|
|
263
|
+
tasks = this.broker.database.listAllTasks();
|
|
264
|
+
totalTasksCount = this.broker.database.countTasks();
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
totalTasksCount = tasks.length;
|
|
268
|
+
}
|
|
269
|
+
const tasksLabel = totalTasksCount > tasks.length
|
|
270
|
+
? `${totalTasksCount} (Active Page: ${tasks.length})`
|
|
271
|
+
: `${totalTasksCount}`;
|
|
272
|
+
console.log(` ${c.bold}Status Summary:${c.reset}`);
|
|
273
|
+
console.log(` Pending Approvals: ${pending.length > 0 ? `${c.yellow}${c.bold}${pending.length}${c.reset}` : `${c.green}0 (Clean)${c.reset}`}`);
|
|
274
|
+
console.log(` Total Tasks: ${c.cyan}${tasksLabel}${c.reset}`);
|
|
275
|
+
if (this.daemonUrl) {
|
|
276
|
+
console.log(` Daemon URL: ${c.blue}${this.daemonUrl}${c.reset}`);
|
|
277
|
+
console.log(` Web Dashboard: ${c.blue}${this.daemonUrl}/console${c.reset}`);
|
|
278
|
+
}
|
|
279
|
+
console.log("");
|
|
280
|
+
if (pending.length > 0) {
|
|
281
|
+
console.log(` ${c.yellow}Pending Approvals Queue:${c.reset}`);
|
|
282
|
+
for (const p of pending) {
|
|
283
|
+
console.log(` ${c.yellow}•${c.reset} ${c.bold}${p.approvalId}${c.reset} (${p.subject}) by ${c.cyan}${p.requestedBy}${c.reset} [${p.createdAt}]`);
|
|
284
|
+
}
|
|
285
|
+
console.log(`\n Run ${c.bold}agentcorp approvals review${c.reset} to sign off interactively.`);
|
|
286
|
+
}
|
|
287
|
+
console.log("");
|
|
288
|
+
return { pendingCount: pending.length, tasksCount: tasks.length };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+
question: "question";
|
|
6
|
+
report: "report";
|
|
7
|
+
review: "review";
|
|
8
|
+
status_update: "status_update";
|
|
9
|
+
verdict: "verdict";
|
|
10
|
+
}>;
|
|
11
|
+
export type MessageType = z.infer<typeof MessageTypeSchema>;
|
|
12
|
+
export declare const MessageStatusSchema: z.ZodEnum<{
|
|
13
|
+
acknowledged: "acknowledged";
|
|
14
|
+
approved: "approved";
|
|
15
|
+
delivered: "delivered";
|
|
16
|
+
draft: "draft";
|
|
17
|
+
edited: "edited";
|
|
18
|
+
pending_approval: "pending_approval";
|
|
19
|
+
rejected: "rejected";
|
|
20
|
+
}>;
|
|
21
|
+
export type MessageStatus = z.infer<typeof MessageStatusSchema>;
|
|
22
|
+
export declare const TaskStatusSchema: z.ZodEnum<{
|
|
23
|
+
assigned: "assigned";
|
|
24
|
+
awaiting_review: "awaiting_review";
|
|
25
|
+
blocked: "blocked";
|
|
26
|
+
cancelled: "cancelled";
|
|
27
|
+
completed: "completed";
|
|
28
|
+
failed: "failed";
|
|
29
|
+
in_progress: "in_progress";
|
|
30
|
+
proposed: "proposed";
|
|
31
|
+
}>;
|
|
32
|
+
export type TaskStatus = z.infer<typeof TaskStatusSchema>;
|
|
33
|
+
export declare const PolicyActionSchema: z.ZodEnum<{
|
|
34
|
+
auto_approve: "auto_approve";
|
|
35
|
+
delegate_to_role: "delegate_to_role";
|
|
36
|
+
require_human: "require_human";
|
|
37
|
+
}>;
|
|
38
|
+
export type PolicyAction = z.infer<typeof PolicyActionSchema>;
|
|
39
|
+
export declare const PolicySubjectSchema: z.ZodEnum<{
|
|
40
|
+
message: "message";
|
|
41
|
+
task: "task";
|
|
42
|
+
}>;
|
|
43
|
+
export type PolicySubject = z.infer<typeof PolicySubjectSchema>;
|
|
44
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
display_name: z.ZodOptional<z.ZodString>;
|
|
47
|
+
model: z.ZodOptional<z.ZodString>;
|
|
48
|
+
interface: z.ZodDefault<z.ZodLiteral<"mcp">>;
|
|
49
|
+
capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
50
|
+
allowed_peers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
51
|
+
artifact_visibility: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type RoleDefinition = z.infer<typeof RoleSchema>;
|
|
54
|
+
export declare const InitialPolicySchema: z.ZodObject<{
|
|
55
|
+
id: z.ZodOptional<z.ZodString>;
|
|
56
|
+
subject: z.ZodEnum<{
|
|
57
|
+
message: "message";
|
|
58
|
+
task: "task";
|
|
59
|
+
}>;
|
|
60
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
61
|
+
from_role: z.ZodOptional<z.ZodString>;
|
|
62
|
+
to_role: z.ZodOptional<z.ZodString>;
|
|
63
|
+
message_type: z.ZodOptional<z.ZodEnum<{
|
|
64
|
+
answer: "answer";
|
|
65
|
+
proposal: "proposal";
|
|
66
|
+
question: "question";
|
|
67
|
+
report: "report";
|
|
68
|
+
review: "review";
|
|
69
|
+
status_update: "status_update";
|
|
70
|
+
verdict: "verdict";
|
|
71
|
+
}>>;
|
|
72
|
+
risk_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
from_status: z.ZodOptional<z.ZodEnum<{
|
|
74
|
+
assigned: "assigned";
|
|
75
|
+
awaiting_review: "awaiting_review";
|
|
76
|
+
blocked: "blocked";
|
|
77
|
+
cancelled: "cancelled";
|
|
78
|
+
completed: "completed";
|
|
79
|
+
failed: "failed";
|
|
80
|
+
in_progress: "in_progress";
|
|
81
|
+
proposed: "proposed";
|
|
82
|
+
}>>;
|
|
83
|
+
to_status: z.ZodOptional<z.ZodEnum<{
|
|
84
|
+
assigned: "assigned";
|
|
85
|
+
awaiting_review: "awaiting_review";
|
|
86
|
+
blocked: "blocked";
|
|
87
|
+
cancelled: "cancelled";
|
|
88
|
+
completed: "completed";
|
|
89
|
+
failed: "failed";
|
|
90
|
+
in_progress: "in_progress";
|
|
91
|
+
proposed: "proposed";
|
|
92
|
+
}>>;
|
|
93
|
+
action: z.ZodEnum<{
|
|
94
|
+
auto_approve: "auto_approve";
|
|
95
|
+
delegate_to_role: "delegate_to_role";
|
|
96
|
+
require_human: "require_human";
|
|
97
|
+
}>;
|
|
98
|
+
delegate_role: z.ZodOptional<z.ZodString>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
export type InitialPolicy = z.infer<typeof InitialPolicySchema>;
|
|
101
|
+
export declare const LimitsConfigSchema: z.ZodObject<{
|
|
102
|
+
max_request_body_bytes: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
max_message_payload_bytes: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
max_artifact_bytes: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
max_payload_size_bytes: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
max_artifact_size_bytes: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
default_page_size: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
max_page_size: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
max_audit_payload_bytes: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
}, z.core.$strip>;
|
|
111
|
+
export type LimitsConfig = z.infer<typeof LimitsConfigSchema>;
|
|
112
|
+
export declare const DEFAULT_MAX_AUDIT_PAYLOAD_BYTES = 65536;
|
|
113
|
+
/**
|
|
114
|
+
* RolePresence tracks agent connectivity and activity freshness.
|
|
115
|
+
* Note: lastSeenAt / lastActiveAt reflects when the role last performed an action (activity freshness),
|
|
116
|
+
* whereas status ("online" | "idle" | "offline") and activityFreshness ("fresh" | "idle" | "stale")
|
|
117
|
+
* provide temporal indicators for collaboration visibility.
|
|
118
|
+
*/
|
|
119
|
+
export interface RolePresence {
|
|
120
|
+
roleId: string;
|
|
121
|
+
agentId?: string | undefined;
|
|
122
|
+
lastSeenAt?: string | undefined;
|
|
123
|
+
lastActiveAt?: string | undefined;
|
|
124
|
+
connectedAt?: string | undefined;
|
|
125
|
+
status: "online" | "idle" | "offline";
|
|
126
|
+
activityFreshness?: "fresh" | "idle" | "stale" | undefined;
|
|
127
|
+
}
|
|
128
|
+
export interface IdempotencyRecord {
|
|
129
|
+
key: string;
|
|
130
|
+
roleId: string;
|
|
131
|
+
operation: string;
|
|
132
|
+
requestHash?: string | undefined;
|
|
133
|
+
responseJson: string;
|
|
134
|
+
createdAt: string;
|
|
135
|
+
}
|
|
136
|
+
export declare const OrgConfigSchema: z.ZodObject<{
|
|
137
|
+
company: z.ZodObject<{
|
|
138
|
+
name: z.ZodString;
|
|
139
|
+
}, z.core.$strip>;
|
|
140
|
+
roles: z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
display_name: z.ZodOptional<z.ZodString>;
|
|
143
|
+
model: z.ZodOptional<z.ZodString>;
|
|
144
|
+
interface: z.ZodDefault<z.ZodLiteral<"mcp">>;
|
|
145
|
+
capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
146
|
+
allowed_peers: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
147
|
+
artifact_visibility: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodArray<z.ZodString>]>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
150
|
+
id: z.ZodOptional<z.ZodString>;
|
|
151
|
+
subject: z.ZodEnum<{
|
|
152
|
+
message: "message";
|
|
153
|
+
task: "task";
|
|
154
|
+
}>;
|
|
155
|
+
priority: z.ZodDefault<z.ZodNumber>;
|
|
156
|
+
from_role: z.ZodOptional<z.ZodString>;
|
|
157
|
+
to_role: z.ZodOptional<z.ZodString>;
|
|
158
|
+
message_type: z.ZodOptional<z.ZodEnum<{
|
|
159
|
+
answer: "answer";
|
|
160
|
+
proposal: "proposal";
|
|
161
|
+
question: "question";
|
|
162
|
+
report: "report";
|
|
163
|
+
review: "review";
|
|
164
|
+
status_update: "status_update";
|
|
165
|
+
verdict: "verdict";
|
|
166
|
+
}>>;
|
|
167
|
+
risk_tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
168
|
+
from_status: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
assigned: "assigned";
|
|
170
|
+
awaiting_review: "awaiting_review";
|
|
171
|
+
blocked: "blocked";
|
|
172
|
+
cancelled: "cancelled";
|
|
173
|
+
completed: "completed";
|
|
174
|
+
failed: "failed";
|
|
175
|
+
in_progress: "in_progress";
|
|
176
|
+
proposed: "proposed";
|
|
177
|
+
}>>;
|
|
178
|
+
to_status: z.ZodOptional<z.ZodEnum<{
|
|
179
|
+
assigned: "assigned";
|
|
180
|
+
awaiting_review: "awaiting_review";
|
|
181
|
+
blocked: "blocked";
|
|
182
|
+
cancelled: "cancelled";
|
|
183
|
+
completed: "completed";
|
|
184
|
+
failed: "failed";
|
|
185
|
+
in_progress: "in_progress";
|
|
186
|
+
proposed: "proposed";
|
|
187
|
+
}>>;
|
|
188
|
+
action: z.ZodEnum<{
|
|
189
|
+
auto_approve: "auto_approve";
|
|
190
|
+
delegate_to_role: "delegate_to_role";
|
|
191
|
+
require_human: "require_human";
|
|
192
|
+
}>;
|
|
193
|
+
delegate_role: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$strip>>>;
|
|
195
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
max_request_body_bytes: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
max_message_payload_bytes: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
max_artifact_bytes: z.ZodOptional<z.ZodNumber>;
|
|
199
|
+
max_payload_size_bytes: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
max_artifact_size_bytes: z.ZodOptional<z.ZodNumber>;
|
|
201
|
+
default_page_size: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
max_page_size: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
max_audit_payload_bytes: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
}, z.core.$strip>>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type OrgConfig = z.infer<typeof OrgConfigSchema>;
|
|
207
|
+
export interface MessageRecord {
|
|
208
|
+
messageId: string;
|
|
209
|
+
taskId: string | null;
|
|
210
|
+
fromRole: string;
|
|
211
|
+
toRole: string;
|
|
212
|
+
type: MessageType;
|
|
213
|
+
payload: unknown;
|
|
214
|
+
references: string[];
|
|
215
|
+
inReplyTo: string | null;
|
|
216
|
+
status: MessageStatus;
|
|
217
|
+
riskTags: string[];
|
|
218
|
+
createdAt: string;
|
|
219
|
+
resolvedAt: string | null;
|
|
220
|
+
}
|
|
221
|
+
export interface TaskRecord {
|
|
222
|
+
taskId: string;
|
|
223
|
+
title: string;
|
|
224
|
+
description: string | null;
|
|
225
|
+
createdBy: string;
|
|
226
|
+
assignedTo: string | null;
|
|
227
|
+
status: TaskStatus;
|
|
228
|
+
createdAt: string;
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
}
|
|
231
|
+
export interface AuditTaskRecord extends TaskRecord {
|
|
232
|
+
descriptionClipped?: boolean | undefined;
|
|
233
|
+
descriptionByteLength?: number | undefined;
|
|
234
|
+
}
|
|
235
|
+
export type WorkQueueActionKind = "accept_handoff" | "acknowledge_message" | "start_task" | "continue_task" | "resolve_blocker" | "send_proposal" | "review_task";
|
|
236
|
+
export interface WorkQueueAction {
|
|
237
|
+
kind: WorkQueueActionKind;
|
|
238
|
+
priority: number;
|
|
239
|
+
reason: string;
|
|
240
|
+
messageId?: string;
|
|
241
|
+
taskId?: string;
|
|
242
|
+
suggestedTool?: {
|
|
243
|
+
name: string;
|
|
244
|
+
arguments: Record<string, unknown>;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
export interface RoleWorkQueue {
|
|
248
|
+
roleId: string;
|
|
249
|
+
generatedAt: string;
|
|
250
|
+
summary: {
|
|
251
|
+
unreadMessages: number;
|
|
252
|
+
activeTasks: number;
|
|
253
|
+
blockedTasks: number;
|
|
254
|
+
};
|
|
255
|
+
unreadMessages: MessageRecord[];
|
|
256
|
+
activeTasks: TaskRecord[];
|
|
257
|
+
nextActions: WorkQueueAction[];
|
|
258
|
+
presence?: RolePresence[] | undefined;
|
|
259
|
+
}
|
|
260
|
+
export interface ArtifactRecord {
|
|
261
|
+
artifactId: string;
|
|
262
|
+
type: string;
|
|
263
|
+
name: string;
|
|
264
|
+
producedBy: string;
|
|
265
|
+
content?: string;
|
|
266
|
+
contentUri?: string;
|
|
267
|
+
contentHash: string;
|
|
268
|
+
visibleToRoles: "all" | string[];
|
|
269
|
+
relatedTaskId: string | null;
|
|
270
|
+
createdAt: string;
|
|
271
|
+
}
|
|
272
|
+
export interface AuditArtifactRecord extends ArtifactRecord {
|
|
273
|
+
contentClipped?: boolean | undefined;
|
|
274
|
+
contentByteLength?: number | undefined;
|
|
275
|
+
}
|
|
276
|
+
export interface PolicyRule extends InitialPolicy {
|
|
277
|
+
id: string;
|
|
278
|
+
enabled: boolean;
|
|
279
|
+
createdAt: string;
|
|
280
|
+
updatedAt: string;
|
|
281
|
+
}
|
|
282
|
+
export interface PendingApproval {
|
|
283
|
+
approvalId: string;
|
|
284
|
+
subject: PolicySubject;
|
|
285
|
+
subjectId: string;
|
|
286
|
+
requestedBy: string;
|
|
287
|
+
status: "pending" | "approved" | "rejected";
|
|
288
|
+
context: unknown;
|
|
289
|
+
createdAt: string;
|
|
290
|
+
decidedAt: string | null;
|
|
291
|
+
decisionNote: string | null;
|
|
292
|
+
}
|
|
293
|
+
export interface PaginationOptions {
|
|
294
|
+
limit?: number | undefined;
|
|
295
|
+
cursor?: string | undefined;
|
|
296
|
+
}
|
|
297
|
+
export interface PaginatedResult<T> {
|
|
298
|
+
items: T[];
|
|
299
|
+
nextCursor: string | null;
|
|
300
|
+
total?: number | undefined;
|
|
301
|
+
}
|
|
302
|
+
export interface BrokerLimits {
|
|
303
|
+
maxPayloadSizeBytes?: number | undefined;
|
|
304
|
+
maxArtifactSizeBytes?: number | undefined;
|
|
305
|
+
}
|
|
306
|
+
export interface PruneOptions {
|
|
307
|
+
olderThanDays: number;
|
|
308
|
+
dryRun?: boolean | undefined;
|
|
309
|
+
deleteArtifacts?: boolean | undefined;
|
|
310
|
+
}
|
|
311
|
+
export interface PruneResult {
|
|
312
|
+
dryRun: boolean;
|
|
313
|
+
cutoffDate: string;
|
|
314
|
+
tasksCount: number;
|
|
315
|
+
messagesCount: number;
|
|
316
|
+
messageEventsCount: number;
|
|
317
|
+
taskTransitionsCount: number;
|
|
318
|
+
approvalsCount: number;
|
|
319
|
+
artifactsDetachedCount: number;
|
|
320
|
+
artifactsDeletedCount: number;
|
|
321
|
+
}
|
|
322
|
+
export interface MaintenanceLogRecord {
|
|
323
|
+
id: string;
|
|
324
|
+
action: "prune" | "prune_simulation" | "prune_execution" | "compact";
|
|
325
|
+
details: unknown;
|
|
326
|
+
createdAt: string;
|
|
327
|
+
}
|
|
328
|
+
export interface AuditExportOptions {
|
|
329
|
+
limit?: number | undefined;
|
|
330
|
+
since?: string | undefined;
|
|
331
|
+
maxPayloadBytes?: number | undefined;
|
|
332
|
+
}
|
|
333
|
+
export interface AuditSnapshotMetadata {
|
|
334
|
+
generatedAt: string;
|
|
335
|
+
since?: string | undefined;
|
|
336
|
+
limit?: number | undefined;
|
|
337
|
+
maxPayloadBytes?: number | undefined;
|
|
338
|
+
totalTasksAvailable: number;
|
|
339
|
+
totalMessagesAvailable: number;
|
|
340
|
+
totalApprovalsAvailable: number;
|
|
341
|
+
totalArtifactsAvailable: number;
|
|
342
|
+
matchingTasksCount?: number | undefined;
|
|
343
|
+
matchingMessagesCount?: number | undefined;
|
|
344
|
+
matchingApprovalsCount?: number | undefined;
|
|
345
|
+
matchingArtifactsCount?: number | undefined;
|
|
346
|
+
truncated: boolean;
|
|
347
|
+
rowLimitTruncated: boolean;
|
|
348
|
+
fieldClippingActive: boolean;
|
|
349
|
+
fieldClippedRecordsCount?: {
|
|
350
|
+
tasks: number;
|
|
351
|
+
messages: number;
|
|
352
|
+
approvals: number;
|
|
353
|
+
artifacts: number;
|
|
354
|
+
} | undefined;
|
|
355
|
+
}
|