@agentconnect.md/daemon 1.0.0-rc.234 → 1.0.0-rc.236
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-D_V0pKJA.js} +187 -34
- package/dist/acp-host-D_V0pKJA.js.map +1 -0
- package/dist/{agent-list-BAjZvFsO.js → agent-list-LnizWro3.js} +2 -2
- package/dist/{agent-list-BAjZvFsO.js.map → agent-list-LnizWro3.js.map} +1 -1
- package/dist/{bridge-DXIVgEzf.js → bridge-e0ZVvjJV.js} +2 -2
- package/dist/{bridge-DXIVgEzf.js.map → bridge-e0ZVvjJV.js.map} +1 -1
- package/dist/{chat-CGFDCD-I.js → chat-vW2um2DS.js} +3 -3
- package/dist/{chat-CGFDCD-I.js.map → chat-vW2um2DS.js.map} +1 -1
- package/dist/esm-shims-DxGcm4Hw.js +14 -0
- package/dist/esm-shims-DxGcm4Hw.js.map +1 -0
- package/dist/index.js +37 -46
- package/dist/index.js.map +1 -1
- package/dist/{load-agents-tb8Rcwan.js → load-agents-C3pJSVeT.js} +30 -11
- package/dist/load-agents-C3pJSVeT.js.map +1 -0
- package/dist/{login-Bchp4kkl.js → login-fEVCtx9V.js} +8 -5
- package/dist/login-fEVCtx9V.js.map +1 -0
- package/dist/{run-foreground-DrL_bDro.js → run-foreground-DKdGzA2H.js} +89526 -12398
- package/dist/run-foreground-DKdGzA2H.js.map +1 -0
- package/dist/run-foreground-zCnpcNs6.js +2 -0
- package/dist/{stdio-CwrB9yrX.js → stdio-DnS8WcXi.js} +2 -2
- package/dist/{stdio-CwrB9yrX.js.map → stdio-DnS8WcXi.js.map} +1 -1
- package/package.json +1 -1
- package/dist/acp-host-CF3j4yST.js.map +0 -1
- package/dist/load-agents-tb8Rcwan.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
|
/**
|
|
@@ -235,7 +252,8 @@ const AuthOk = object({
|
|
|
235
252
|
const Platform = _enum([
|
|
236
253
|
"slack",
|
|
237
254
|
"telegram",
|
|
238
|
-
"webchat"
|
|
255
|
+
"webchat",
|
|
256
|
+
"discord"
|
|
239
257
|
]);
|
|
240
258
|
const SessionKey = object({
|
|
241
259
|
platform: Platform,
|
|
@@ -308,7 +326,11 @@ const DrainDone = object({ released: array(SessionKey) });
|
|
|
308
326
|
* platform output).
|
|
309
327
|
*/
|
|
310
328
|
const CronTarget = object({
|
|
311
|
-
platform: _enum([
|
|
329
|
+
platform: _enum([
|
|
330
|
+
"slack",
|
|
331
|
+
"telegram",
|
|
332
|
+
"discord"
|
|
333
|
+
]).default("slack"),
|
|
312
334
|
channel: string(),
|
|
313
335
|
integrationId: string().uuid().optional()
|
|
314
336
|
});
|
|
@@ -548,22 +570,43 @@ const IntegrationTelegramConfig = object({
|
|
|
548
570
|
bindRules: array(IntegrationBindRule).default([])
|
|
549
571
|
});
|
|
550
572
|
/**
|
|
573
|
+
* The Discord config the daemon needs to open the Gateway + route (discord.js).
|
|
574
|
+
* Discord authenticates the Gateway with a SINGLE bot token — no Slack-style
|
|
575
|
+
* app-level token and no signing secret. `applicationId` is public metadata (the
|
|
576
|
+
* client id for the OAuth2 bot-invite URL); it is not secret material.
|
|
577
|
+
*/
|
|
578
|
+
const IntegrationDiscordConfig = object({
|
|
579
|
+
botToken: string(),
|
|
580
|
+
applicationId: string().optional(),
|
|
581
|
+
allowedUserIds: array(string()).default([]),
|
|
582
|
+
bindRules: array(IntegrationBindRule).default([])
|
|
583
|
+
});
|
|
584
|
+
/**
|
|
551
585
|
* One platform integration, owned by exactly one agent. Also the element type of
|
|
552
586
|
* `RegisterOk.integrations[]` (the per-daemon reconcile set). Discriminated on
|
|
553
|
-
* `platform`: the daemon opens a Slack Socket Mode connection
|
|
554
|
-
* long-poll from whichever variant is delivered.
|
|
587
|
+
* `platform`: the daemon opens a Slack Socket Mode connection, a Telegram
|
|
588
|
+
* long-poll, or a Discord Gateway from whichever variant is delivered.
|
|
555
589
|
*/
|
|
556
|
-
const IntegrationSpec = discriminatedUnion("platform", [
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
590
|
+
const IntegrationSpec = discriminatedUnion("platform", [
|
|
591
|
+
object({
|
|
592
|
+
integrationId: string().uuid(),
|
|
593
|
+
agentId: string().uuid(),
|
|
594
|
+
platform: literal("slack"),
|
|
595
|
+
slack: IntegrationSlackConfig
|
|
596
|
+
}),
|
|
597
|
+
object({
|
|
598
|
+
integrationId: string().uuid(),
|
|
599
|
+
agentId: string().uuid(),
|
|
600
|
+
platform: literal("telegram"),
|
|
601
|
+
telegram: IntegrationTelegramConfig
|
|
602
|
+
}),
|
|
603
|
+
object({
|
|
604
|
+
integrationId: string().uuid(),
|
|
605
|
+
agentId: string().uuid(),
|
|
606
|
+
platform: literal("discord"),
|
|
607
|
+
discord: IntegrationDiscordConfig
|
|
608
|
+
})
|
|
609
|
+
]);
|
|
567
610
|
/** C→D EVT — install/update an integration on the owning agent's daemon. */
|
|
568
611
|
const IntegrationUpsert = IntegrationSpec;
|
|
569
612
|
/** C→D EVT — remove an integration from the daemon. */
|
|
@@ -1246,6 +1289,23 @@ const WebchatStatus = object({
|
|
|
1246
1289
|
fastModeAvailable: boolean().optional(),
|
|
1247
1290
|
sessionId: string().optional()
|
|
1248
1291
|
});
|
|
1292
|
+
const WebchatOutput = object({
|
|
1293
|
+
conversationId: string().uuid(),
|
|
1294
|
+
turnId: string().uuid(),
|
|
1295
|
+
index: number().int(),
|
|
1296
|
+
event: WebchatEvent.optional(),
|
|
1297
|
+
status: WebchatStatus.optional()
|
|
1298
|
+
}).refine((o) => o.event !== void 0 || o.status !== void 0, { message: "WebchatOutput must carry event and/or status" });
|
|
1299
|
+
const WebchatDone = object({
|
|
1300
|
+
conversationId: string().uuid(),
|
|
1301
|
+
turnId: string().uuid(),
|
|
1302
|
+
stopReason: string().optional(),
|
|
1303
|
+
usage: object({
|
|
1304
|
+
used: number().int().optional(),
|
|
1305
|
+
cost: number().optional()
|
|
1306
|
+
}).optional(),
|
|
1307
|
+
error: string().optional()
|
|
1308
|
+
});
|
|
1249
1309
|
//#endregion
|
|
1250
1310
|
//#region ../protocol/dist/frame.js
|
|
1251
1311
|
/**
|
|
@@ -1275,23 +1335,8 @@ const FRAME_SCHEMAS = {
|
|
|
1275
1335
|
"agent/scope-denied": AgentScopeDenied,
|
|
1276
1336
|
"webchat/message": WebchatMessage,
|
|
1277
1337
|
"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
|
-
}),
|
|
1338
|
+
"webchat/output": WebchatOutput,
|
|
1339
|
+
"webchat/done": WebchatDone,
|
|
1295
1340
|
"webchat/close": object({ conversationId: string().uuid() }),
|
|
1296
1341
|
"webchat/set-model": object({
|
|
1297
1342
|
conversationId: string().uuid(),
|
|
@@ -1571,6 +1616,114 @@ function encode(frame) {
|
|
|
1571
1616
|
return JSON.stringify(frame);
|
|
1572
1617
|
}
|
|
1573
1618
|
//#endregion
|
|
1619
|
+
//#region ../protocol/dist/frames/relay-daemon.js
|
|
1620
|
+
/**
|
|
1621
|
+
* relay↔daemon frames (`rd/*`) — shared-bot-relay.md §7.2.
|
|
1622
|
+
*
|
|
1623
|
+
* The daemon dials OUT to every relay in its roster (one WS per (daemon, relay)
|
|
1624
|
+
* pair, multiplexing every source). This wire CARRIES MESSAGE CONTENT — it is
|
|
1625
|
+
* the ingress data plane — so nothing on it is ever logged with its payload.
|
|
1626
|
+
*
|
|
1627
|
+
* Direction per frame:
|
|
1628
|
+
* - `rd/hello` (+ `rd/hello/ok`) D→R REQ / R→D REP — authenticate the dial-in
|
|
1629
|
+
* - `rd/msg` R→D REQ — one inbound item, already routed
|
|
1630
|
+
* - `rd/ack` D→R REP — receipt (+ webchat turn verdict)
|
|
1631
|
+
* - `rd/chat` D→R EVT — webchat output stream back to the
|
|
1632
|
+
* browser (webchat is the one BIDIRECTIONAL
|
|
1633
|
+
* source: its far end hangs off the relay)
|
|
1634
|
+
*
|
|
1635
|
+
* Milestone A carries the webchat slice only; `im` (shared bot) and `hook`
|
|
1636
|
+
* (webhook) members join the `rd/msg` union with milestone B.
|
|
1637
|
+
*/
|
|
1638
|
+
/** Subprotocol negotiated on the relay↔daemon socket. */
|
|
1639
|
+
const RELAY_DAEMON_SUBPROTOCOL = "agentconnect.rd.v1";
|
|
1640
|
+
/** The canonical path the relay mounts its daemon-facing `rd/*` server at, and
|
|
1641
|
+
* the daemon appends to a roster `daemonUrl` origin when dialing (mirrors the
|
|
1642
|
+
* daemon↔CP `/daemon/ws` convention). A roster url already ending in it is used
|
|
1643
|
+
* verbatim. */
|
|
1644
|
+
const RELAY_DAEMON_WS_PATH = "/rd/ws";
|
|
1645
|
+
const RdHello = object({
|
|
1646
|
+
apiKey: string().min(1),
|
|
1647
|
+
daemonId: string().uuid()
|
|
1648
|
+
});
|
|
1649
|
+
const RdHelloOk = object({ relayId: string().uuid() });
|
|
1650
|
+
const RelayWebchatOp = discriminatedUnion("op", [
|
|
1651
|
+
object({
|
|
1652
|
+
op: literal("turn"),
|
|
1653
|
+
text: string(),
|
|
1654
|
+
user: string().optional()
|
|
1655
|
+
}),
|
|
1656
|
+
object({
|
|
1657
|
+
op: literal("set_model"),
|
|
1658
|
+
model: string()
|
|
1659
|
+
}),
|
|
1660
|
+
object({
|
|
1661
|
+
op: literal("set_effort"),
|
|
1662
|
+
effort: string()
|
|
1663
|
+
}),
|
|
1664
|
+
object({
|
|
1665
|
+
op: literal("set_permission_mode"),
|
|
1666
|
+
permissionMode: string()
|
|
1667
|
+
}),
|
|
1668
|
+
object({
|
|
1669
|
+
op: literal("set_fast"),
|
|
1670
|
+
fastMode: boolean()
|
|
1671
|
+
}),
|
|
1672
|
+
object({ op: literal("cancel") }),
|
|
1673
|
+
object({ op: literal("close") })
|
|
1674
|
+
]);
|
|
1675
|
+
const RdMsg = discriminatedUnion("source", [object({
|
|
1676
|
+
source: literal("webchat"),
|
|
1677
|
+
agentId: string().uuid(),
|
|
1678
|
+
sessionKey: string().min(1),
|
|
1679
|
+
msgId: string().min(1),
|
|
1680
|
+
chatId: string().uuid(),
|
|
1681
|
+
payload: RelayWebchatOp
|
|
1682
|
+
})]);
|
|
1683
|
+
const RdAck = object({
|
|
1684
|
+
msgId: string(),
|
|
1685
|
+
accepted: boolean(),
|
|
1686
|
+
turnId: string().uuid().optional(),
|
|
1687
|
+
reason: string().optional()
|
|
1688
|
+
});
|
|
1689
|
+
const RdChatEvent = discriminatedUnion("kind", [object({
|
|
1690
|
+
kind: literal("output"),
|
|
1691
|
+
output: WebchatOutput
|
|
1692
|
+
}), object({
|
|
1693
|
+
kind: literal("done"),
|
|
1694
|
+
done: WebchatDone
|
|
1695
|
+
})]);
|
|
1696
|
+
/** `type` string → payload schema for the relay↔daemon wire. */
|
|
1697
|
+
const RELAY_DAEMON_SCHEMAS = {
|
|
1698
|
+
"rd/hello": RdHello,
|
|
1699
|
+
"rd/hello/ok": RdHelloOk,
|
|
1700
|
+
"rd/msg": RdMsg,
|
|
1701
|
+
"rd/ack": RdAck,
|
|
1702
|
+
"rd/chat": object({
|
|
1703
|
+
chatId: string().uuid(),
|
|
1704
|
+
seq: number().int(),
|
|
1705
|
+
event: RdChatEvent
|
|
1706
|
+
}),
|
|
1707
|
+
error: ErrorFrame
|
|
1708
|
+
};
|
|
1709
|
+
Object.keys(RELAY_DAEMON_SCHEMAS);
|
|
1710
|
+
discriminatedUnion("type", [
|
|
1711
|
+
frameSchema("rd/hello", RELAY_DAEMON_SCHEMAS["rd/hello"]),
|
|
1712
|
+
frameSchema("rd/hello/ok", RELAY_DAEMON_SCHEMAS["rd/hello/ok"]),
|
|
1713
|
+
frameSchema("rd/msg", RELAY_DAEMON_SCHEMAS["rd/msg"]),
|
|
1714
|
+
frameSchema("rd/ack", RELAY_DAEMON_SCHEMAS["rd/ack"]),
|
|
1715
|
+
frameSchema("rd/chat", RELAY_DAEMON_SCHEMAS["rd/chat"]),
|
|
1716
|
+
frameSchema("error", RELAY_DAEMON_SCHEMAS["error"])
|
|
1717
|
+
]);
|
|
1718
|
+
/** Decode one relay↔daemon wire frame (envelope + typed payload). */
|
|
1719
|
+
function decodeRelayDaemonFrame(text) {
|
|
1720
|
+
return decodeEnvelopeWith(RELAY_DAEMON_SCHEMAS, text);
|
|
1721
|
+
}
|
|
1722
|
+
/** Build a relay↔daemon frame with a compile-time-typed payload. */
|
|
1723
|
+
function buildRelayDaemonFrame(type, payload, opts = {}) {
|
|
1724
|
+
return buildEnvelopeRaw(type, payload, opts);
|
|
1725
|
+
}
|
|
1726
|
+
//#endregion
|
|
1574
1727
|
//#region ../protocol/dist/git-url.js
|
|
1575
1728
|
/**
|
|
1576
1729
|
* Git repo address helpers, shared by the CP (normalize on write) and the
|
|
@@ -10694,6 +10847,6 @@ var AcpHost = class {
|
|
|
10694
10847
|
}
|
|
10695
10848
|
};
|
|
10696
10849
|
//#endregion
|
|
10697
|
-
export {
|
|
10850
|
+
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
10851
|
|
|
10699
|
-
//# sourceMappingURL=acp-host-
|
|
10852
|
+
//# sourceMappingURL=acp-host-D_V0pKJA.js.map
|