@agentconnect.md/daemon 1.0.0-rc.248 → 1.0.0-rc.249
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-CUct-2CR.js → acp-host-hnOn2UR9.js} +2 -2
- package/dist/{acp-host-CUct-2CR.js.map → acp-host-hnOn2UR9.js.map} +1 -1
- package/dist/{agent-list-CpvraCfQ.js → agent-list-7JSTLtcu.js} +2 -2
- package/dist/{agent-list-CpvraCfQ.js.map → agent-list-7JSTLtcu.js.map} +1 -1
- package/dist/{chat-B8Z_78R2.js → chat-DJDh08Id.js} +3 -3
- package/dist/{chat-B8Z_78R2.js.map → chat-DJDh08Id.js.map} +1 -1
- package/dist/index.js +4 -4
- package/dist/{load-agents-NvLpcg5H.js → load-agents-DspcHKeP.js} +71 -4
- package/dist/load-agents-DspcHKeP.js.map +1 -0
- package/dist/{login-CodLtz77.js → login-CJcnOzvD.js} +3 -3
- package/dist/{login-CodLtz77.js.map → login-CJcnOzvD.js.map} +1 -1
- package/dist/run-foreground-4Igsx-jy.js +2 -0
- package/dist/{run-foreground-K9FNooBp.js → run-foreground-CN7_7yMq.js} +240 -33
- package/dist/{run-foreground-K9FNooBp.js.map → run-foreground-CN7_7yMq.js.map} +1 -1
- package/package.json +1 -1
- package/dist/load-agents-NvLpcg5H.js.map +0 -1
- package/dist/run-foreground-BlMl7cqk.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-DspcHKeP.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-7JSTLtcu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-list-
|
|
1
|
+
{"version":3,"file":"agent-list-7JSTLtcu.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-DspcHKeP.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-hnOn2UR9.js";
|
|
4
4
|
import { createInterface } from "node:readline";
|
|
5
5
|
//#region src/cli/chat.ts
|
|
6
6
|
function renderUpdate(out) {
|
|
@@ -79,4 +79,4 @@ async function runChat(opts) {
|
|
|
79
79
|
//#endregion
|
|
80
80
|
export { renderUpdate, runChat };
|
|
81
81
|
|
|
82
|
-
//# sourceMappingURL=chat-
|
|
82
|
+
//# sourceMappingURL=chat-DJDh08Id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-
|
|
1
|
+
{"version":3,"file":"chat-DJDh08Id.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 await host.start()\n try {\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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M,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,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-DJDh08Id.js"),
|
|
68496
|
+
import("./login-CJcnOzvD.js"),
|
|
68497
|
+
import("./run-foreground-4Igsx-jy.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-7JSTLtcu.js");
|
|
68656
68656
|
await runAgentList({
|
|
68657
68657
|
agentsDir: opts.agentsDir,
|
|
68658
68658
|
configPath: opts.config,
|
|
@@ -84,7 +84,8 @@ const Platform = _enum([
|
|
|
84
84
|
"slack",
|
|
85
85
|
"telegram",
|
|
86
86
|
"webchat",
|
|
87
|
-
"discord"
|
|
87
|
+
"discord",
|
|
88
|
+
"hook"
|
|
88
89
|
]);
|
|
89
90
|
const SessionKey = object({
|
|
90
91
|
platform: Platform,
|
|
@@ -519,6 +520,59 @@ const RegisterOk = object({
|
|
|
519
520
|
})
|
|
520
521
|
});
|
|
521
522
|
//#endregion
|
|
523
|
+
//#region ../protocol/dist/frames/hook.js
|
|
524
|
+
/**
|
|
525
|
+
* Hook (inbound-webhook trigger) frames — webhook-triggers-and-github-events.md.
|
|
526
|
+
*
|
|
527
|
+
* A hook maps an inbound webhook delivery to ONE AGENT turn. The CP owns the
|
|
528
|
+
* definition (`HookDef`) and compiles it into relay-side rules
|
|
529
|
+
* (`rc/hook-assign`, frames/relay-cp.ts); the relay pool is the public ingress
|
|
530
|
+
* that verifies + matches + dispatches the trigger to the target daemon as an
|
|
531
|
+
* `rd/msg` `hook` member (frames/relay-daemon.ts). Event payloads never touch
|
|
532
|
+
* the CP — the only hook frame on the daemon↔CP control WS is the completion
|
|
533
|
+
* report below (pure metadata, mirroring `cron/report`).
|
|
534
|
+
*/
|
|
535
|
+
/**
|
|
536
|
+
* The trimmed event envelope a fire carries — bounded excerpts only; the full
|
|
537
|
+
* payload lives in relay/daemon memory for the duration of the dispatch and the
|
|
538
|
+
* agent pulls source-of-truth content itself (gh / API) when it needs more.
|
|
539
|
+
* The whole frame rides under the 256 KiB frame cap; these excerpt caps are far
|
|
540
|
+
* below it. Trust differs by kind (design 安全边界 1): a webhook `body` IS the
|
|
541
|
+
* caller's message (the URL is a capability credential), while github excerpts
|
|
542
|
+
* (P2) are untrusted third-party content the daemon fences in the prompt.
|
|
543
|
+
*/
|
|
544
|
+
const HookContext = object({
|
|
545
|
+
source: _enum(["webhook", "github"]),
|
|
546
|
+
event: string().optional(),
|
|
547
|
+
action: string().optional(),
|
|
548
|
+
repo: string().optional(),
|
|
549
|
+
number: number().int().optional(),
|
|
550
|
+
title: string().optional(),
|
|
551
|
+
senderLogin: string().optional(),
|
|
552
|
+
authorAssociation: string().optional(),
|
|
553
|
+
labels: array(string()).optional(),
|
|
554
|
+
htmlUrl: string().optional(),
|
|
555
|
+
bodyExcerpt: string().optional(),
|
|
556
|
+
body: string().optional(),
|
|
557
|
+
truncated: boolean().optional()
|
|
558
|
+
});
|
|
559
|
+
/**
|
|
560
|
+
* `hook/report` (D→C EVT, fire-and-forget) — the dispatched turn ended; closes
|
|
561
|
+
* the `HookRun` row the relay's `rc/run-report` opened. Same discipline as
|
|
562
|
+
* `cron/report`: scoped (the agent must be placed on the reporting daemon),
|
|
563
|
+
* latest-wins, lost reports harvested by the HookRunReaper (late arrivals may
|
|
564
|
+
* still overwrite `orphaned`). Keyed by `(hookId, deliveryKey)`.
|
|
565
|
+
*/
|
|
566
|
+
const HookReport = object({
|
|
567
|
+
hookId: string().uuid(),
|
|
568
|
+
agentId: string().uuid(),
|
|
569
|
+
deliveryKey: string().min(1),
|
|
570
|
+
status: _enum(["success", "failed"]),
|
|
571
|
+
durationMs: number().int().nonnegative().optional(),
|
|
572
|
+
sessionId: string().optional(),
|
|
573
|
+
reason: string().optional()
|
|
574
|
+
});
|
|
575
|
+
//#endregion
|
|
522
576
|
//#region ../protocol/dist/frames/gitcred.js
|
|
523
577
|
/**
|
|
524
578
|
* Git credentials (github-app workspaces) — daemon-pulled, CP-minted.
|
|
@@ -1172,6 +1226,7 @@ const FRAME_SCHEMAS = {
|
|
|
1172
1226
|
"cron/remove": CronRemove,
|
|
1173
1227
|
"cron/report": CronReport,
|
|
1174
1228
|
"cron/run": CronRunNow,
|
|
1229
|
+
"hook/report": HookReport,
|
|
1175
1230
|
"integration/upsert": IntegrationUpsert,
|
|
1176
1231
|
"integration/remove": IntegrationRemove,
|
|
1177
1232
|
"integration/channels": IntegrationChannels,
|
|
@@ -1263,6 +1318,7 @@ discriminatedUnion("type", [
|
|
|
1263
1318
|
frame("cron/remove", FRAME_SCHEMAS["cron/remove"]),
|
|
1264
1319
|
frame("cron/report", FRAME_SCHEMAS["cron/report"]),
|
|
1265
1320
|
frame("cron/run", FRAME_SCHEMAS["cron/run"]),
|
|
1321
|
+
frame("hook/report", FRAME_SCHEMAS["hook/report"]),
|
|
1266
1322
|
frame("integration/upsert", FRAME_SCHEMAS["integration/upsert"]),
|
|
1267
1323
|
frame("integration/remove", FRAME_SCHEMAS["integration/remove"]),
|
|
1268
1324
|
frame("integration/channels", FRAME_SCHEMAS["integration/channels"]),
|
|
@@ -1425,8 +1481,9 @@ function encode(frame) {
|
|
|
1425
1481
|
* browser (webchat is the one BIDIRECTIONAL
|
|
1426
1482
|
* source: its far end hangs off the relay)
|
|
1427
1483
|
*
|
|
1428
|
-
* Milestone A
|
|
1429
|
-
* (webhook)
|
|
1484
|
+
* Milestone A carried the webchat slice; milestone B-github adds the `hook`
|
|
1485
|
+
* member (webhook-triggers-and-github-events.md). The `im` (shared bot) member
|
|
1486
|
+
* joins the `rd/msg` union with milestone B-slack.
|
|
1430
1487
|
*/
|
|
1431
1488
|
/** Subprotocol negotiated on the relay↔daemon socket. */
|
|
1432
1489
|
const RELAY_DAEMON_SUBPROTOCOL = "agentconnect.rd.v1";
|
|
@@ -1472,6 +1529,16 @@ const RdMsg = discriminatedUnion("source", [object({
|
|
|
1472
1529
|
msgId: string().min(1),
|
|
1473
1530
|
chatId: string().uuid(),
|
|
1474
1531
|
payload: RelayWebchatOp
|
|
1532
|
+
}), object({
|
|
1533
|
+
source: literal("hook"),
|
|
1534
|
+
agentId: string().uuid(),
|
|
1535
|
+
sessionKey: string().min(1),
|
|
1536
|
+
msgId: string().min(1),
|
|
1537
|
+
hookId: string().uuid(),
|
|
1538
|
+
deliveryKey: string().min(1),
|
|
1539
|
+
firedAt: string().datetime(),
|
|
1540
|
+
context: HookContext.optional(),
|
|
1541
|
+
target: CronTarget.optional()
|
|
1475
1542
|
})]);
|
|
1476
1543
|
const RdAck = object({
|
|
1477
1544
|
msgId: string(),
|
|
@@ -1950,4 +2017,4 @@ function selectAgent(agentsDir, name) {
|
|
|
1950
2017
|
//#endregion
|
|
1951
2018
|
export { decodeEnvelope as _, agentChildEnv as a, MEMORY_INDEX as b, persistRelays as c, normalizeGitUrl as d, RELAY_DAEMON_SUBPROTOCOL as f, buildEnvelope 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, encode as v, RESERVED_MCP_SERVER_NAME as x, MAX_FRAME_BYTES as y };
|
|
1952
2019
|
|
|
1953
|
-
//# sourceMappingURL=load-agents-
|
|
2020
|
+
//# sourceMappingURL=load-agents-DspcHKeP.js.map
|