@agentconnect.md/daemon 1.0.0-rc.289 → 1.0.0-rc.290
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/dist/{acp-host-BlkeNrQB.js → acp-host-B91pZ6PG.js} +2 -2
- package/dist/{acp-host-BlkeNrQB.js.map → acp-host-B91pZ6PG.js.map} +1 -1
- package/dist/{agent-list-DS3NGUJO.js → agent-list-jSv0GQn-.js} +2 -2
- package/dist/{agent-list-DS3NGUJO.js.map → agent-list-jSv0GQn-.js.map} +1 -1
- package/dist/{chat-Nq98n5LI.js → chat-DRFrVRfQ.js} +3 -3
- package/dist/{chat-Nq98n5LI.js.map → chat-DRFrVRfQ.js.map} +1 -1
- package/dist/index.js +4 -4
- package/dist/{load-agents-BLNSM987.js → load-agents-CZJD_fRG.js} +139 -112
- package/dist/load-agents-CZJD_fRG.js.map +1 -0
- package/dist/{login-B4KagoWu.js → login-DP6dWldB.js} +3 -3
- package/dist/{login-B4KagoWu.js.map → login-DP6dWldB.js.map} +1 -1
- package/dist/{run-foreground-D4TMcwTn.js → run-foreground-BMjqIzg4.js} +663 -55
- package/dist/{run-foreground-D4TMcwTn.js.map → run-foreground-BMjqIzg4.js.map} +1 -1
- package/dist/run-foreground-B_jAVnV3.js +2 -0
- package/package.json +1 -1
- package/dist/load-agents-BLNSM987.js.map +0 -1
- package/dist/run-foreground-COW0zak6.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as loadConfig, t as discoverAgents } from "./load-agents-
|
|
1
|
+
import { o as loadConfig, t as discoverAgents } from "./load-agents-CZJD_fRG.js";
|
|
2
2
|
//#region src/cli/agent-list.ts
|
|
3
3
|
async function runAgentList(opts) {
|
|
4
4
|
const out = opts.out ?? process.stdout;
|
|
@@ -18,4 +18,4 @@ async function runAgentList(opts) {
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { runAgentList };
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=agent-list-
|
|
21
|
+
//# sourceMappingURL=agent-list-jSv0GQn-.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-list-
|
|
1
|
+
{"version":3,"file":"agent-list-jSv0GQn-.js","names":[],"sources":["../src/cli/agent-list.ts"],"sourcesContent":["import { loadConfig } from '../config/load-config.js'\nimport { discoverAgents } from '../agents/load-agents.js'\n\nexport interface RunAgentListOpts {\n agentsDir?: string\n configPath?: string\n root?: string\n out?: NodeJS.WritableStream\n}\n\n// Read-only view of the local agent directory. Mutating agents (add/remove/\n// enable/disable) is intentionally not a CLI command — agent business config is\n// owned by the Control Plane (agent/upsert + register/ok roster, see\n// cp/cp-agent-registry.ts) or by hand-editing agent.json; the daemon only\n// reconciles what it finds on disk. This lists what that discovery sees.\nexport async function runAgentList(opts: RunAgentListOpts): Promise<void> {\n const out = opts.out ?? process.stdout\n const cfg = loadConfig({\n root: opts.root,\n configPath: opts.configPath,\n optional: true,\n overrides: { agentsDir: opts.agentsDir }\n })\n const agentsDir = cfg.agentsDir!\n const discovered = discoverAgents(agentsDir)\n if (discovered.length === 0) {\n out.write(`no agents found under ${agentsDir}\\n`)\n return\n }\n for (const { agent, dir } of discovered) {\n out.write(`${agent.id}\\t${agent.status}\\t${agent.runtime}\\t${agent.name}\\t${dir}\\n`)\n }\n}\n"],"mappings":";;AAeA,eAAsB,aAAa,MAAuC;CACxE,MAAM,MAAM,KAAK,OAAO,QAAQ;CAOhC,MAAM,YANM,WAAW;EACrB,MAAM,KAAK;EACX,YAAY,KAAK;EACjB,UAAU;EACV,WAAW,EAAE,WAAW,KAAK,UAAU;CACzC,CACoB,CAAC,CAAC;CACtB,MAAM,aAAa,eAAe,SAAS;CAC3C,IAAI,WAAW,WAAW,GAAG;EAC3B,IAAI,MAAM,yBAAyB,UAAU,GAAG;EAChD;CACF;CACA,KAAK,MAAM,EAAE,OAAO,SAAS,YAC3B,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI,MAAM,OAAO,IAAI,MAAM,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,GAAG;AAEvF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as agentChildEnv, i as selectAgent, o as loadConfig } from "./load-agents-
|
|
1
|
+
import { a as agentChildEnv, i as selectAgent, o as loadConfig } from "./load-agents-CZJD_fRG.js";
|
|
2
2
|
import { l as resolveRoot } from "./paths-DEcUO8lC.js";
|
|
3
|
-
import { S as resolveRuntimes, d as memoryProviderFor, i as prepareWorkspace, t as AcpHost } from "./acp-host-
|
|
3
|
+
import { S as resolveRuntimes, d as memoryProviderFor, i as prepareWorkspace, t as AcpHost } from "./acp-host-B91pZ6PG.js";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
//#region src/cli/chat.ts
|
|
6
6
|
function renderUpdate(out) {
|
|
@@ -84,4 +84,4 @@ async function runChat(opts) {
|
|
|
84
84
|
//#endregion
|
|
85
85
|
export { renderUpdate, runChat };
|
|
86
86
|
|
|
87
|
-
//# sourceMappingURL=chat-
|
|
87
|
+
//# sourceMappingURL=chat-DRFrVRfQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-
|
|
1
|
+
{"version":3,"file":"chat-DRFrVRfQ.js","names":[],"sources":["../src/cli/chat.ts"],"sourcesContent":["import { createInterface } from 'node:readline'\nimport type { ContentBlock, SessionUpdate } from '@agentclientprotocol/sdk'\nimport { loadConfig } from '../config/load-config.js'\nimport { resolveRuntimes } from '../runtimes/registry.js'\nimport { selectAgent } from '../agents/load-agents.js'\nimport { agentChildEnv } from '../agents/agent-env.js'\nimport { memoryProviderFor } from '../agents/memory-provider.js'\nimport { prepareWorkspace } from '../workspace/workspace-manager.js'\nimport { AcpHost } from '../acp/acp-host.js'\nimport { resolveRoot } from '../paths.js'\n\nexport function renderUpdate(out: NodeJS.WritableStream) {\n return (_sessionId: string, update: SessionUpdate): void => {\n if (update.sessionUpdate === 'agent_message_chunk' && update.content.type === 'text') {\n out.write(update.content.text)\n } else if (update.sessionUpdate === 'tool_call') {\n const title = ('title' in update && update.title) || update.toolCallId || 'tool'\n out.write(`\\n[tool] ${title}\\n`)\n }\n }\n}\n\nexport interface RunChatOpts {\n agentsDir?: string\n agentName?: string\n message?: string\n configPath?: string\n root?: string\n out?: NodeJS.WritableStream\n input?: NodeJS.ReadableStream\n}\n\nexport async function runChat(opts: RunChatOpts): Promise<void> {\n const out = opts.out ?? process.stdout\n const root = resolveRoot(opts.root)\n const cfg = loadConfig({\n root: opts.root,\n configPath: opts.configPath,\n optional: true,\n overrides: { agentsDir: opts.agentsDir }\n })\n const agent = selectAgent(cfg.agentsDir!, opts.agentName)\n\n const runtimes = await resolveRuntimes(cfg, root, { neededRuntimes: [agent.runtime], mode: 'cache-first' })\n const runtime = runtimes[agent.runtime]\n if (!runtime) {\n const available = Object.keys(runtimes).sort().join(', ') || '(none)'\n throw new Error(`runtime \"${agent.runtime}\" not found. Available: ${available}`)\n }\n\n const host = new AcpHost(runtime, {\n onUpdate: renderUpdate(out),\n // Memory-backend env for parity with the daemon (managed disables the runtime's\n // own memory; native redirects it under the agent root).\n env: { ...agentChildEnv(agent), ...memoryProviderFor(agent, runtime).runtimeEnv() },\n configPrefs: {\n model: agent.runtimeOverrides?.model,\n permissionMode: agent.permissionMode,\n reasoningEffort: agent.reasoningEffort,\n fastMode: agent.fastMode\n }\n })\n // The adapter child runs in its own process group (see AcpHost.start), so a\n // terminal Ctrl-C no longer kills it as a side effect — Node's default SIGINT\n // exit would skip the finally below and leak it. Stop the host, then re-exit.\n // Registered BEFORE start(): a first-run `npx -y` runtime download takes long\n // enough that Ctrl-C mid-start is common, and the spawn happens early in start().\n const onSigint = () => {\n void host.stop().finally(() => process.exit(130))\n }\n process.once('SIGINT', onSigint)\n try {\n await host.start()\n const cwd = await prepareWorkspace(agent)\n const sessionId = await host.newSession(cwd)\n\n const send = async (text: string) => {\n const blocks: ContentBlock[] = [{ type: 'text', text }]\n await host.prompt(sessionId, blocks)\n out.write('\\n')\n }\n\n if (typeof opts.message === 'string' && opts.message.length > 0) {\n await send(opts.message)\n return\n }\n\n const rl = createInterface({ input: opts.input ?? process.stdin })\n out.write(`Chatting with ${agent.name} (${agent.id}). Type .exit to quit.\\n> `)\n try {\n for await (const line of rl) {\n const text = line.trim()\n if (text === '.exit' || text === '.quit') break\n if (text.length > 0) await send(text)\n out.write('> ')\n }\n } finally {\n rl.close()\n }\n } finally {\n process.removeListener('SIGINT', onSigint)\n await host.stop()\n }\n}\n"],"mappings":";;;;;AAWA,SAAgB,aAAa,KAA4B;CACvD,QAAQ,YAAoB,WAAgC;EAC1D,IAAI,OAAO,kBAAkB,yBAAyB,OAAO,QAAQ,SAAS,QAC5E,IAAI,MAAM,OAAO,QAAQ,IAAI;OACxB,IAAI,OAAO,kBAAkB,aAAa;GAC/C,MAAM,QAAS,WAAW,UAAU,OAAO,SAAU,OAAO,cAAc;GAC1E,IAAI,MAAM,YAAY,MAAM,GAAG;EACjC;CACF;AACF;AAYA,eAAsB,QAAQ,MAAkC;CAC9D,MAAM,MAAM,KAAK,OAAO,QAAQ;CAChC,MAAM,OAAO,YAAY,KAAK,IAAI;CAClC,MAAM,MAAM,WAAW;EACrB,MAAM,KAAK;EACX,YAAY,KAAK;EACjB,UAAU;EACV,WAAW,EAAE,WAAW,KAAK,UAAU;CACzC,CAAC;CACD,MAAM,QAAQ,YAAY,IAAI,WAAY,KAAK,SAAS;CAExD,MAAM,WAAW,MAAM,gBAAgB,KAAK,MAAM;EAAE,gBAAgB,CAAC,MAAM,OAAO;EAAG,MAAM;CAAc,CAAC;CAC1G,MAAM,UAAU,SAAS,MAAM;CAC/B,IAAI,CAAC,SAAS;EACZ,MAAM,YAAY,OAAO,KAAK,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,KAAK;EAC7D,MAAM,IAAI,MAAM,YAAY,MAAM,QAAQ,0BAA0B,WAAW;CACjF;CAEA,MAAM,OAAO,IAAI,QAAQ,SAAS;EAChC,UAAU,aAAa,GAAG;EAG1B,KAAK;GAAE,GAAG,cAAc,KAAK;GAAG,GAAG,kBAAkB,OAAO,OAAO,CAAC,CAAC,WAAW;EAAE;EAClF,aAAa;GACX,OAAO,MAAM,kBAAkB;GAC/B,gBAAgB,MAAM;GACtB,iBAAiB,MAAM;GACvB,UAAU,MAAM;EAClB;CACF,CAAC;CAMD,MAAM,iBAAiB;EACrB,KAAU,KAAK,CAAC,CAAC,cAAc,QAAQ,KAAK,GAAG,CAAC;CAClD;CACA,QAAQ,KAAK,UAAU,QAAQ;CAC/B,IAAI;EACF,MAAM,KAAK,MAAM;EACjB,MAAM,MAAM,MAAM,iBAAiB,KAAK;EACxC,MAAM,YAAY,MAAM,KAAK,WAAW,GAAG;EAE3C,MAAM,OAAO,OAAO,SAAiB;GACnC,MAAM,SAAyB,CAAC;IAAE,MAAM;IAAQ;GAAK,CAAC;GACtD,MAAM,KAAK,OAAO,WAAW,MAAM;GACnC,IAAI,MAAM,IAAI;EAChB;EAEA,IAAI,OAAO,KAAK,YAAY,YAAY,KAAK,QAAQ,SAAS,GAAG;GAC/D,MAAM,KAAK,KAAK,OAAO;GACvB;EACF;EAEA,MAAM,KAAK,gBAAgB,EAAE,OAAO,KAAK,SAAS,QAAQ,MAAM,CAAC;EACjE,IAAI,MAAM,iBAAiB,MAAM,KAAK,IAAI,MAAM,GAAG,2BAA2B;EAC9E,IAAI;GACF,WAAW,MAAM,QAAQ,IAAI;IAC3B,MAAM,OAAO,KAAK,KAAK;IACvB,IAAI,SAAS,WAAW,SAAS,SAAS;IAC1C,IAAI,KAAK,SAAS,GAAG,MAAM,KAAK,IAAI;IACpC,IAAI,MAAM,IAAI;GAChB;EACF,UAAU;GACR,GAAG,MAAM;EACX;CACF,UAAU;EACR,QAAQ,eAAe,UAAU,QAAQ;EACzC,MAAM,KAAK,KAAK;CAClB;AACF"}
|
package/dist/index.js
CHANGED
|
@@ -68492,9 +68492,9 @@ const telemetry = startDaemonOpenTelemetry({ serviceVersion: DAEMON_VERSION });
|
|
|
68492
68492
|
const [{ Command }, { fileURLToPath }, { runChat }, { runLogin }, { runForeground }, { resolveController }, { acquireSingletonLock }, { resolveRoot }] = await Promise.all([
|
|
68493
68493
|
import("./commander-B5QVEFzH.js"),
|
|
68494
68494
|
import("node:url"),
|
|
68495
|
-
import("./chat-
|
|
68496
|
-
import("./login-
|
|
68497
|
-
import("./run-foreground-
|
|
68495
|
+
import("./chat-DRFrVRfQ.js"),
|
|
68496
|
+
import("./login-DP6dWldB.js"),
|
|
68497
|
+
import("./run-foreground-B_jAVnV3.js"),
|
|
68498
68498
|
import("./service-6w0WKhdx.js"),
|
|
68499
68499
|
import("./lock-CA9Bm8_s.js"),
|
|
68500
68500
|
import("./paths-CcRUjFjy.js")
|
|
@@ -68652,7 +68652,7 @@ program.command("git-credential").description("Git credential helper backed by t
|
|
|
68652
68652
|
program.command("agent").description("Inspect local agent directories").command("list").description("List agents discovered under --agents-dir (id, status, runtime, name, dir)").action(async () => {
|
|
68653
68653
|
const opts = program.opts();
|
|
68654
68654
|
try {
|
|
68655
|
-
const { runAgentList } = await import("./agent-list-
|
|
68655
|
+
const { runAgentList } = await import("./agent-list-jSv0GQn-.js");
|
|
68656
68656
|
await runAgentList({
|
|
68657
68657
|
agentsDir: opts.agentsDir,
|
|
68658
68658
|
configPath: opts.config,
|
|
@@ -264,117 +264,6 @@ const ScopeAttestation = object({
|
|
|
264
264
|
exp: string().datetime()
|
|
265
265
|
});
|
|
266
266
|
//#endregion
|
|
267
|
-
//#region ../protocol/dist/frames/agent.js
|
|
268
|
-
/**
|
|
269
|
-
* Agent lifecycle (protocol §4.4, §7.4, §8).
|
|
270
|
-
*
|
|
271
|
-
* There is no CP→daemon prompt-delivery frame: the daemon prompts an agent from
|
|
272
|
-
* its own ingress (platform adapters, and webchat over its own `webchat/*`
|
|
273
|
-
* frames), never the CP. The old `agent/prompt` + per-agent `seq` machinery was
|
|
274
|
-
* reserved infrastructure with no live caller and has been removed.
|
|
275
|
-
*/
|
|
276
|
-
/**
|
|
277
|
-
* Where the agent runs. Two modes; the **path is always daemon-generated** —
|
|
278
|
-
* never specified by the caller (UX picks the mode, the machine owns the dir).
|
|
279
|
-
*
|
|
280
|
-
* - `scratch`: a fresh empty working dir on the machine, no repo.
|
|
281
|
-
* - `github`: the daemon clones `gitRepo` @ `branch` and runs the agent in
|
|
282
|
-
* `agentDir` (a subdir of the repo, repo-root if omitted). **Multiple agents
|
|
283
|
-
* may share one repo** — they differ by `agentDir`, so the repo is not an
|
|
284
|
-
* owned entity, just shared config on each agent.
|
|
285
|
-
*/
|
|
286
|
-
const AgentWorkspace = discriminatedUnion("mode", [object({ mode: literal("scratch") }), object({
|
|
287
|
-
mode: literal("github"),
|
|
288
|
-
gitRepo: string(),
|
|
289
|
-
branch: string().default("main"),
|
|
290
|
-
agentDir: string().optional(),
|
|
291
|
-
gitCredential: _enum(["github-app"]).optional()
|
|
292
|
-
})]);
|
|
293
|
-
/**
|
|
294
|
-
* MCP-server name reserved for the daemon's own injected stdio bridge (its
|
|
295
|
-
* platform tools). A config-defined or agent-enabled server under this name
|
|
296
|
-
* would collide with the bridge entry at ACP `session/new`, so the daemon
|
|
297
|
-
* strips it and the CP rejects it in `AgentSpec.mcpServers` at the API edge.
|
|
298
|
-
*/
|
|
299
|
-
const RESERVED_MCP_SERVER_NAME = "agentconnect";
|
|
300
|
-
/**
|
|
301
|
-
* The editable agent definition the CP owns and the daemon needs to run it:
|
|
302
|
-
* prompt + runtime selection. Raft ships this in the launch config and the
|
|
303
|
-
* daemon synthesizes the system prompt locally; `description` IS the prompt.
|
|
304
|
-
*/
|
|
305
|
-
const AgentSpec = object({
|
|
306
|
-
name: string(),
|
|
307
|
-
description: string().optional(),
|
|
308
|
-
runtime: string().optional(),
|
|
309
|
-
model: string().nullable().optional(),
|
|
310
|
-
reasoningEffort: string().nullable().optional(),
|
|
311
|
-
executionMode: string().optional(),
|
|
312
|
-
outputMode: _enum([
|
|
313
|
-
"low",
|
|
314
|
-
"medium",
|
|
315
|
-
"high"
|
|
316
|
-
]).optional(),
|
|
317
|
-
fastMode: boolean().optional(),
|
|
318
|
-
permissionMode: string().nullable().optional(),
|
|
319
|
-
pause: boolean().optional(),
|
|
320
|
-
workspace: AgentWorkspace.optional(),
|
|
321
|
-
env: record(string(), string()).optional(),
|
|
322
|
-
memory: object({ provider: _enum([
|
|
323
|
-
"native",
|
|
324
|
-
"managed",
|
|
325
|
-
"external"
|
|
326
|
-
]) }).optional(),
|
|
327
|
-
mcpServers: array(string()).default([]),
|
|
328
|
-
callPolicy: _enum(["all", "selected"]).optional(),
|
|
329
|
-
allowedCallerAgentIds: array(string()).default([])
|
|
330
|
-
});
|
|
331
|
-
const AgentLaunch = object({
|
|
332
|
-
agentId: string().uuid(),
|
|
333
|
-
runtime: string(),
|
|
334
|
-
workspaceId: string().uuid(),
|
|
335
|
-
capabilities: array(string()),
|
|
336
|
-
spec: AgentSpec,
|
|
337
|
-
mode: _enum(["long_lived", "per_turn"]).default("long_lived")
|
|
338
|
-
});
|
|
339
|
-
/**
|
|
340
|
-
* Live agent CRUD (C→D): the console edited an agent's spec; push it so a
|
|
341
|
-
* running daemon reloads without waiting for the next launch. `agent/remove`
|
|
342
|
-
* tears the agent down. Deleting an agent never relaunches it.
|
|
343
|
-
*/
|
|
344
|
-
const AgentUpsert = object({
|
|
345
|
-
agentId: string().uuid(),
|
|
346
|
-
spec: AgentSpec
|
|
347
|
-
});
|
|
348
|
-
const AgentRemove = object({ agentId: string().uuid() });
|
|
349
|
-
const AgentLaunched = object({
|
|
350
|
-
agentId: string().uuid(),
|
|
351
|
-
launchId: string().uuid(),
|
|
352
|
-
acpSessionId: string().optional(),
|
|
353
|
-
startedAt: string().datetime(),
|
|
354
|
-
runtime: string()
|
|
355
|
-
});
|
|
356
|
-
const AgentStop = object({
|
|
357
|
-
agentId: string().uuid(),
|
|
358
|
-
launchId: string().uuid(),
|
|
359
|
-
reason: string()
|
|
360
|
-
});
|
|
361
|
-
const AgentActivity = object({
|
|
362
|
-
agentId: string().uuid(),
|
|
363
|
-
launchId: string().uuid(),
|
|
364
|
-
state: _enum([
|
|
365
|
-
"thinking",
|
|
366
|
-
"tool_call",
|
|
367
|
-
"awaiting_permission",
|
|
368
|
-
"idle"
|
|
369
|
-
]),
|
|
370
|
-
ts: string().datetime()
|
|
371
|
-
});
|
|
372
|
-
const AgentScopeDenied = object({
|
|
373
|
-
agentId: string().uuid(),
|
|
374
|
-
launchId: string().uuid(),
|
|
375
|
-
capability: string()
|
|
376
|
-
});
|
|
377
|
-
//#endregion
|
|
378
267
|
//#region ../protocol/dist/frames/integration.js
|
|
379
268
|
/**
|
|
380
269
|
* Platform integration distribution (C→D) — the Slack "install" flow.
|
|
@@ -512,6 +401,140 @@ const IntegrationChannels = object({
|
|
|
512
401
|
channels: array(IntegrationChannel)
|
|
513
402
|
});
|
|
514
403
|
//#endregion
|
|
404
|
+
//#region ../protocol/dist/frames/agent.js
|
|
405
|
+
/**
|
|
406
|
+
* Agent lifecycle (protocol §4.4, §7.4, §8).
|
|
407
|
+
*
|
|
408
|
+
* There is no CP→daemon prompt-delivery frame: the daemon prompts an agent from
|
|
409
|
+
* its own ingress (platform adapters, and webchat over its own `webchat/*`
|
|
410
|
+
* frames), never the CP. The old `agent/prompt` + per-agent `seq` machinery was
|
|
411
|
+
* reserved infrastructure with no live caller and has been removed.
|
|
412
|
+
*/
|
|
413
|
+
/**
|
|
414
|
+
* Where the agent runs. Two modes; the **path is always daemon-generated** —
|
|
415
|
+
* never specified by the caller (UX picks the mode, the machine owns the dir).
|
|
416
|
+
*
|
|
417
|
+
* - `scratch`: a fresh empty working dir on the machine, no repo.
|
|
418
|
+
* - `github`: the daemon clones `gitRepo` @ `branch` and runs the agent in
|
|
419
|
+
* `agentDir` (a subdir of the repo, repo-root if omitted). **Multiple agents
|
|
420
|
+
* may share one repo** — they differ by `agentDir`, so the repo is not an
|
|
421
|
+
* owned entity, just shared config on each agent.
|
|
422
|
+
*/
|
|
423
|
+
const AgentWorkspace = discriminatedUnion("mode", [object({ mode: literal("scratch") }), object({
|
|
424
|
+
mode: literal("github"),
|
|
425
|
+
gitRepo: string(),
|
|
426
|
+
branch: string().default("main"),
|
|
427
|
+
agentDir: string().optional(),
|
|
428
|
+
gitCredential: _enum(["github-app"]).optional()
|
|
429
|
+
})]);
|
|
430
|
+
/**
|
|
431
|
+
* MCP-server name reserved for the daemon's own injected stdio bridge (its
|
|
432
|
+
* platform tools). A config-defined or agent-enabled server under this name
|
|
433
|
+
* would collide with the bridge entry at ACP `session/new`, so the daemon
|
|
434
|
+
* strips it and the CP rejects it in `AgentSpec.mcpServers` at the API edge.
|
|
435
|
+
*/
|
|
436
|
+
const RESERVED_MCP_SERVER_NAME = "agentconnect";
|
|
437
|
+
/**
|
|
438
|
+
* The editable agent definition the CP owns and the daemon needs to run it:
|
|
439
|
+
* prompt + runtime selection. Raft ships this in the launch config and the
|
|
440
|
+
* daemon synthesizes the system prompt locally; `description` IS the prompt.
|
|
441
|
+
*/
|
|
442
|
+
const AgentSpec = object({
|
|
443
|
+
name: string(),
|
|
444
|
+
description: string().optional(),
|
|
445
|
+
runtime: string().optional(),
|
|
446
|
+
model: string().nullable().optional(),
|
|
447
|
+
reasoningEffort: string().nullable().optional(),
|
|
448
|
+
executionMode: string().optional(),
|
|
449
|
+
outputMode: _enum([
|
|
450
|
+
"low",
|
|
451
|
+
"medium",
|
|
452
|
+
"high"
|
|
453
|
+
]).optional(),
|
|
454
|
+
fastMode: boolean().optional(),
|
|
455
|
+
permissionMode: string().nullable().optional(),
|
|
456
|
+
pause: boolean().optional(),
|
|
457
|
+
workspace: AgentWorkspace.optional(),
|
|
458
|
+
env: record(string(), string()).optional(),
|
|
459
|
+
memory: object({ provider: _enum([
|
|
460
|
+
"native",
|
|
461
|
+
"managed",
|
|
462
|
+
"external"
|
|
463
|
+
]) }).optional(),
|
|
464
|
+
mcpServers: array(string()).default([]),
|
|
465
|
+
callPolicy: _enum(["all", "selected"]).optional(),
|
|
466
|
+
allowedCallerAgentIds: array(string()).default([])
|
|
467
|
+
});
|
|
468
|
+
const AgentLaunch = object({
|
|
469
|
+
agentId: string().uuid(),
|
|
470
|
+
runtime: string(),
|
|
471
|
+
workspaceId: string().uuid(),
|
|
472
|
+
capabilities: array(string()),
|
|
473
|
+
spec: AgentSpec,
|
|
474
|
+
mode: _enum(["long_lived", "per_turn"]).default("long_lived")
|
|
475
|
+
});
|
|
476
|
+
/**
|
|
477
|
+
* Live agent CRUD (C→D): the console edited an agent's spec; push it so a
|
|
478
|
+
* running daemon reloads without waiting for the next launch. `agent/remove`
|
|
479
|
+
* tears the agent down. Deleting an agent never relaunches it.
|
|
480
|
+
*/
|
|
481
|
+
const AgentUpsert = object({
|
|
482
|
+
agentId: string().uuid(),
|
|
483
|
+
spec: AgentSpec
|
|
484
|
+
});
|
|
485
|
+
const AgentRemove = object({ agentId: string().uuid() });
|
|
486
|
+
/**
|
|
487
|
+
* Safe cold-move lifecycle (C→D REQ → generic `ack`). `agent/detach`
|
|
488
|
+
* quiesces the agent and archives its daemon-local root; `agent/activate`
|
|
489
|
+
* atomically applies the authoritative spec/integration/cron bundle, restores
|
|
490
|
+
* and exact-prunes an archive when present, then makes the agent servable.
|
|
491
|
+
*/
|
|
492
|
+
const AgentDetach = object({
|
|
493
|
+
agentId: string().uuid(),
|
|
494
|
+
/** Fences late lifecycle retries from a superseded move operation. */
|
|
495
|
+
moveId: string().uuid()
|
|
496
|
+
});
|
|
497
|
+
const AgentActivate = object({
|
|
498
|
+
agentId: string().uuid(),
|
|
499
|
+
moveId: string().uuid(),
|
|
500
|
+
/**
|
|
501
|
+
* One authoritative, acknowledged bootstrap bundle. Unlike the live CRUD
|
|
502
|
+
* EVTs, these definitions are synchronously persisted under the staging gate
|
|
503
|
+
* before activation can ACK, so a same-id stale secret/spec cannot survive.
|
|
504
|
+
*/
|
|
505
|
+
spec: AgentSpec,
|
|
506
|
+
integrations: array(IntegrationSpec),
|
|
507
|
+
crons: array(CronUpsert)
|
|
508
|
+
});
|
|
509
|
+
const AgentLaunched = object({
|
|
510
|
+
agentId: string().uuid(),
|
|
511
|
+
launchId: string().uuid(),
|
|
512
|
+
acpSessionId: string().optional(),
|
|
513
|
+
startedAt: string().datetime(),
|
|
514
|
+
runtime: string()
|
|
515
|
+
});
|
|
516
|
+
const AgentStop = object({
|
|
517
|
+
agentId: string().uuid(),
|
|
518
|
+
launchId: string().uuid(),
|
|
519
|
+
reason: string()
|
|
520
|
+
});
|
|
521
|
+
const AgentActivity = object({
|
|
522
|
+
agentId: string().uuid(),
|
|
523
|
+
launchId: string().uuid(),
|
|
524
|
+
state: _enum([
|
|
525
|
+
"thinking",
|
|
526
|
+
"tool_call",
|
|
527
|
+
"awaiting_permission",
|
|
528
|
+
"idle"
|
|
529
|
+
]),
|
|
530
|
+
ts: string().datetime()
|
|
531
|
+
});
|
|
532
|
+
const AgentScopeDenied = object({
|
|
533
|
+
agentId: string().uuid(),
|
|
534
|
+
launchId: string().uuid(),
|
|
535
|
+
capability: string()
|
|
536
|
+
});
|
|
537
|
+
//#endregion
|
|
515
538
|
//#region ../protocol/dist/frames/collab.js
|
|
516
539
|
/**
|
|
517
540
|
* Bot-AGNOSTIC agent-collaboration routing snapshot (agent-collaboration §2.3 / §6.2 / §6.5).
|
|
@@ -1349,6 +1372,8 @@ const FRAME_SCHEMAS = {
|
|
|
1349
1372
|
"agent/stop": AgentStop,
|
|
1350
1373
|
"agent/upsert": AgentUpsert,
|
|
1351
1374
|
"agent/remove": AgentRemove,
|
|
1375
|
+
"agent/detach": AgentDetach,
|
|
1376
|
+
"agent/activate": AgentActivate,
|
|
1352
1377
|
"agent/activity": AgentActivity,
|
|
1353
1378
|
"agent/scope-denied": AgentScopeDenied,
|
|
1354
1379
|
"route/assign": RouteAssign,
|
|
@@ -1442,6 +1467,8 @@ discriminatedUnion("type", [
|
|
|
1442
1467
|
frame("agent/stop", FRAME_SCHEMAS["agent/stop"]),
|
|
1443
1468
|
frame("agent/upsert", FRAME_SCHEMAS["agent/upsert"]),
|
|
1444
1469
|
frame("agent/remove", FRAME_SCHEMAS["agent/remove"]),
|
|
1470
|
+
frame("agent/detach", FRAME_SCHEMAS["agent/detach"]),
|
|
1471
|
+
frame("agent/activate", FRAME_SCHEMAS["agent/activate"]),
|
|
1445
1472
|
frame("agent/activity", FRAME_SCHEMAS["agent/activity"]),
|
|
1446
1473
|
frame("agent/scope-denied", FRAME_SCHEMAS["agent/scope-denied"]),
|
|
1447
1474
|
frame("route/assign", FRAME_SCHEMAS["route/assign"]),
|
|
@@ -2468,4 +2495,4 @@ function selectAgent(agentsDir, name) {
|
|
|
2468
2495
|
//#endregion
|
|
2469
2496
|
export { ZodIssueCode as C, RESERVED_MCP_SERVER_NAME as S, buildEnvelope as _, agentChildEnv as a, MAX_FRAME_BYTES as b, persistRelays as c, normalizeGitUrl as d, RELAY_DAEMON_SUBPROTOCOL as f, SHARED_CONFIG_ACTION_ID as g, decodeRelayDaemonFrame as h, selectAgent as i, ConfigSchema as l, buildRelayDaemonFrame as m, findAgentFiles as n, loadConfig as o, RELAY_DAEMON_WS_PATH as p, loadAgents as r, persistDaemonId as s, discoverAgents as t, isFrame as u, decodeEnvelope as v, MEMORY_INDEX as x, encode as y };
|
|
2470
2497
|
|
|
2471
|
-
//# sourceMappingURL=load-agents-
|
|
2498
|
+
//# sourceMappingURL=load-agents-CZJD_fRG.js.map
|