@agentconnect.md/daemon 1.0.0-rc.233 → 1.0.0-rc.235
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-CF3j4yST.js → acp-host-D9z7hKHJ.js} +146 -19
- package/dist/acp-host-D9z7hKHJ.js.map +1 -0
- package/dist/{chat-CGFDCD-I.js → chat-ca2lVcnb.js} +2 -2
- package/dist/{chat-CGFDCD-I.js.map → chat-ca2lVcnb.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/{login-Bchp4kkl.js → login-UiyjTM47.js} +7 -4
- package/dist/login-UiyjTM47.js.map +1 -0
- package/dist/{run-foreground-DrL_bDro.js → run-foreground-B5RyE_L1.js} +1265 -1042
- package/dist/run-foreground-B5RyE_L1.js.map +1 -0
- package/dist/run-foreground-CSpqnnI0.js +2 -0
- package/package.json +1 -1
- package/dist/acp-host-CF3j4yST.js.map +0 -1
- package/dist/login-Bchp4kkl.js.map +0 -1
- package/dist/run-foreground-CgCBnrA0.js +0 -2
- package/dist/run-foreground-DrL_bDro.js.map +0 -1
|
@@ -197,6 +197,23 @@ object({
|
|
|
197
197
|
});
|
|
198
198
|
/** The all-zero UUID used when a frame is malformed past the point of reading `id`. */
|
|
199
199
|
const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
200
|
+
/**
|
|
201
|
+
* Builds the envelope schema for one frame `type` — the `type` literal plus the
|
|
202
|
+
* typed payload — so a wire's discriminated union infers `payload` precisely.
|
|
203
|
+
* Shared by the daemon↔CP union (`frame.ts`) and the relay wire unions
|
|
204
|
+
* (`frames/relay-cp.ts` / `frames/relay-daemon.ts`), which are deliberately
|
|
205
|
+
* SEPARATE unions over the same envelope shape (shared-bot-relay.md §8).
|
|
206
|
+
*/
|
|
207
|
+
function frameSchema(type, payload) {
|
|
208
|
+
return object({
|
|
209
|
+
v: literal(1),
|
|
210
|
+
id: string().uuid(),
|
|
211
|
+
ts: string().datetime(),
|
|
212
|
+
type: literal(type),
|
|
213
|
+
corr: string().uuid().optional(),
|
|
214
|
+
payload
|
|
215
|
+
});
|
|
216
|
+
}
|
|
200
217
|
//#endregion
|
|
201
218
|
//#region ../protocol/dist/frames/auth.js
|
|
202
219
|
/**
|
|
@@ -1246,6 +1263,23 @@ const WebchatStatus = object({
|
|
|
1246
1263
|
fastModeAvailable: boolean().optional(),
|
|
1247
1264
|
sessionId: string().optional()
|
|
1248
1265
|
});
|
|
1266
|
+
const WebchatOutput = object({
|
|
1267
|
+
conversationId: string().uuid(),
|
|
1268
|
+
turnId: string().uuid(),
|
|
1269
|
+
index: number().int(),
|
|
1270
|
+
event: WebchatEvent.optional(),
|
|
1271
|
+
status: WebchatStatus.optional()
|
|
1272
|
+
}).refine((o) => o.event !== void 0 || o.status !== void 0, { message: "WebchatOutput must carry event and/or status" });
|
|
1273
|
+
const WebchatDone = object({
|
|
1274
|
+
conversationId: string().uuid(),
|
|
1275
|
+
turnId: string().uuid(),
|
|
1276
|
+
stopReason: string().optional(),
|
|
1277
|
+
usage: object({
|
|
1278
|
+
used: number().int().optional(),
|
|
1279
|
+
cost: number().optional()
|
|
1280
|
+
}).optional(),
|
|
1281
|
+
error: string().optional()
|
|
1282
|
+
});
|
|
1249
1283
|
//#endregion
|
|
1250
1284
|
//#region ../protocol/dist/frame.js
|
|
1251
1285
|
/**
|
|
@@ -1275,23 +1309,8 @@ const FRAME_SCHEMAS = {
|
|
|
1275
1309
|
"agent/scope-denied": AgentScopeDenied,
|
|
1276
1310
|
"webchat/message": WebchatMessage,
|
|
1277
1311
|
"webchat/ack": WebchatAck,
|
|
1278
|
-
"webchat/output":
|
|
1279
|
-
|
|
1280
|
-
turnId: string().uuid(),
|
|
1281
|
-
index: number().int(),
|
|
1282
|
-
event: WebchatEvent.optional(),
|
|
1283
|
-
status: WebchatStatus.optional()
|
|
1284
|
-
}).refine((o) => o.event !== void 0 || o.status !== void 0, { message: "WebchatOutput must carry event and/or status" }),
|
|
1285
|
-
"webchat/done": object({
|
|
1286
|
-
conversationId: string().uuid(),
|
|
1287
|
-
turnId: string().uuid(),
|
|
1288
|
-
stopReason: string().optional(),
|
|
1289
|
-
usage: object({
|
|
1290
|
-
used: number().int().optional(),
|
|
1291
|
-
cost: number().optional()
|
|
1292
|
-
}).optional(),
|
|
1293
|
-
error: string().optional()
|
|
1294
|
-
}),
|
|
1312
|
+
"webchat/output": WebchatOutput,
|
|
1313
|
+
"webchat/done": WebchatDone,
|
|
1295
1314
|
"webchat/close": object({ conversationId: string().uuid() }),
|
|
1296
1315
|
"webchat/set-model": object({
|
|
1297
1316
|
conversationId: string().uuid(),
|
|
@@ -1571,6 +1590,114 @@ function encode(frame) {
|
|
|
1571
1590
|
return JSON.stringify(frame);
|
|
1572
1591
|
}
|
|
1573
1592
|
//#endregion
|
|
1593
|
+
//#region ../protocol/dist/frames/relay-daemon.js
|
|
1594
|
+
/**
|
|
1595
|
+
* relay↔daemon frames (`rd/*`) — shared-bot-relay.md §7.2.
|
|
1596
|
+
*
|
|
1597
|
+
* The daemon dials OUT to every relay in its roster (one WS per (daemon, relay)
|
|
1598
|
+
* pair, multiplexing every source). This wire CARRIES MESSAGE CONTENT — it is
|
|
1599
|
+
* the ingress data plane — so nothing on it is ever logged with its payload.
|
|
1600
|
+
*
|
|
1601
|
+
* Direction per frame:
|
|
1602
|
+
* - `rd/hello` (+ `rd/hello/ok`) D→R REQ / R→D REP — authenticate the dial-in
|
|
1603
|
+
* - `rd/msg` R→D REQ — one inbound item, already routed
|
|
1604
|
+
* - `rd/ack` D→R REP — receipt (+ webchat turn verdict)
|
|
1605
|
+
* - `rd/chat` D→R EVT — webchat output stream back to the
|
|
1606
|
+
* browser (webchat is the one BIDIRECTIONAL
|
|
1607
|
+
* source: its far end hangs off the relay)
|
|
1608
|
+
*
|
|
1609
|
+
* Milestone A carries the webchat slice only; `im` (shared bot) and `hook`
|
|
1610
|
+
* (webhook) members join the `rd/msg` union with milestone B.
|
|
1611
|
+
*/
|
|
1612
|
+
/** Subprotocol negotiated on the relay↔daemon socket. */
|
|
1613
|
+
const RELAY_DAEMON_SUBPROTOCOL = "agentconnect.rd.v1";
|
|
1614
|
+
/** The canonical path the relay mounts its daemon-facing `rd/*` server at, and
|
|
1615
|
+
* the daemon appends to a roster `daemonUrl` origin when dialing (mirrors the
|
|
1616
|
+
* daemon↔CP `/daemon/ws` convention). A roster url already ending in it is used
|
|
1617
|
+
* verbatim. */
|
|
1618
|
+
const RELAY_DAEMON_WS_PATH = "/rd/ws";
|
|
1619
|
+
const RdHello = object({
|
|
1620
|
+
apiKey: string().min(1),
|
|
1621
|
+
daemonId: string().uuid()
|
|
1622
|
+
});
|
|
1623
|
+
const RdHelloOk = object({ relayId: string().uuid() });
|
|
1624
|
+
const RelayWebchatOp = discriminatedUnion("op", [
|
|
1625
|
+
object({
|
|
1626
|
+
op: literal("turn"),
|
|
1627
|
+
text: string(),
|
|
1628
|
+
user: string().optional()
|
|
1629
|
+
}),
|
|
1630
|
+
object({
|
|
1631
|
+
op: literal("set_model"),
|
|
1632
|
+
model: string()
|
|
1633
|
+
}),
|
|
1634
|
+
object({
|
|
1635
|
+
op: literal("set_effort"),
|
|
1636
|
+
effort: string()
|
|
1637
|
+
}),
|
|
1638
|
+
object({
|
|
1639
|
+
op: literal("set_permission_mode"),
|
|
1640
|
+
permissionMode: string()
|
|
1641
|
+
}),
|
|
1642
|
+
object({
|
|
1643
|
+
op: literal("set_fast"),
|
|
1644
|
+
fastMode: boolean()
|
|
1645
|
+
}),
|
|
1646
|
+
object({ op: literal("cancel") }),
|
|
1647
|
+
object({ op: literal("close") })
|
|
1648
|
+
]);
|
|
1649
|
+
const RdMsg = discriminatedUnion("source", [object({
|
|
1650
|
+
source: literal("webchat"),
|
|
1651
|
+
agentId: string().uuid(),
|
|
1652
|
+
sessionKey: string().min(1),
|
|
1653
|
+
msgId: string().min(1),
|
|
1654
|
+
chatId: string().uuid(),
|
|
1655
|
+
payload: RelayWebchatOp
|
|
1656
|
+
})]);
|
|
1657
|
+
const RdAck = object({
|
|
1658
|
+
msgId: string(),
|
|
1659
|
+
accepted: boolean(),
|
|
1660
|
+
turnId: string().uuid().optional(),
|
|
1661
|
+
reason: string().optional()
|
|
1662
|
+
});
|
|
1663
|
+
const RdChatEvent = discriminatedUnion("kind", [object({
|
|
1664
|
+
kind: literal("output"),
|
|
1665
|
+
output: WebchatOutput
|
|
1666
|
+
}), object({
|
|
1667
|
+
kind: literal("done"),
|
|
1668
|
+
done: WebchatDone
|
|
1669
|
+
})]);
|
|
1670
|
+
/** `type` string → payload schema for the relay↔daemon wire. */
|
|
1671
|
+
const RELAY_DAEMON_SCHEMAS = {
|
|
1672
|
+
"rd/hello": RdHello,
|
|
1673
|
+
"rd/hello/ok": RdHelloOk,
|
|
1674
|
+
"rd/msg": RdMsg,
|
|
1675
|
+
"rd/ack": RdAck,
|
|
1676
|
+
"rd/chat": object({
|
|
1677
|
+
chatId: string().uuid(),
|
|
1678
|
+
seq: number().int(),
|
|
1679
|
+
event: RdChatEvent
|
|
1680
|
+
}),
|
|
1681
|
+
error: ErrorFrame
|
|
1682
|
+
};
|
|
1683
|
+
Object.keys(RELAY_DAEMON_SCHEMAS);
|
|
1684
|
+
discriminatedUnion("type", [
|
|
1685
|
+
frameSchema("rd/hello", RELAY_DAEMON_SCHEMAS["rd/hello"]),
|
|
1686
|
+
frameSchema("rd/hello/ok", RELAY_DAEMON_SCHEMAS["rd/hello/ok"]),
|
|
1687
|
+
frameSchema("rd/msg", RELAY_DAEMON_SCHEMAS["rd/msg"]),
|
|
1688
|
+
frameSchema("rd/ack", RELAY_DAEMON_SCHEMAS["rd/ack"]),
|
|
1689
|
+
frameSchema("rd/chat", RELAY_DAEMON_SCHEMAS["rd/chat"]),
|
|
1690
|
+
frameSchema("error", RELAY_DAEMON_SCHEMAS["error"])
|
|
1691
|
+
]);
|
|
1692
|
+
/** Decode one relay↔daemon wire frame (envelope + typed payload). */
|
|
1693
|
+
function decodeRelayDaemonFrame(text) {
|
|
1694
|
+
return decodeEnvelopeWith(RELAY_DAEMON_SCHEMAS, text);
|
|
1695
|
+
}
|
|
1696
|
+
/** Build a relay↔daemon frame with a compile-time-typed payload. */
|
|
1697
|
+
function buildRelayDaemonFrame(type, payload, opts = {}) {
|
|
1698
|
+
return buildEnvelopeRaw(type, payload, opts);
|
|
1699
|
+
}
|
|
1700
|
+
//#endregion
|
|
1574
1701
|
//#region ../protocol/dist/git-url.js
|
|
1575
1702
|
/**
|
|
1576
1703
|
* Git repo address helpers, shared by the CP (normalize on write) and the
|
|
@@ -10694,6 +10821,6 @@ var AcpHost = class {
|
|
|
10694
10821
|
}
|
|
10695
10822
|
};
|
|
10696
10823
|
//#endregion
|
|
10697
|
-
export {
|
|
10824
|
+
export { resolveRuntimes as C, cachedRuntimeVersions as S, encode as _, initGitInjection as a, RESERVED_MCP_SERVER_NAME as b, simpleGit as c, RELAY_DAEMON_SUBPROTOCOL as d, RELAY_DAEMON_WS_PATH as f, decodeEnvelope as g, buildEnvelope as h, prepareWorkspace as i, isFrame as l, decodeRelayDaemonFrame as m, installedRuntimes as n, probeGitVersion as o, buildRelayDaemonFrame as p, prefetchWorkspace as r, sessionGitEnv as s, AcpHost as t, normalizeGitUrl as u, MAX_FRAME_BYTES as v, cachedRuntimeNames as x, MEMORY_INDEX as y };
|
|
10698
10825
|
|
|
10699
|
-
//# sourceMappingURL=acp-host-
|
|
10826
|
+
//# sourceMappingURL=acp-host-D9z7hKHJ.js.map
|