@agentconnect.md/daemon 1.0.0-rc.35 → 1.0.0-rc.37

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/index.js CHANGED
@@ -17338,6 +17338,91 @@ const AgentScopeDenied = object({
17338
17338
  capability: string()
17339
17339
  });
17340
17340
  //#endregion
17341
+ //#region ../protocol/dist/frames/register.js
17342
+ /**
17343
+ * Capability upload + the reconcile snapshot — protocol §3.3.
17344
+ *
17345
+ * `register/ok` is the authoritative source of truth: the daemon converges its
17346
+ * local cache to it. CP wins all conflicts, so re-issuing the same snapshot is
17347
+ * idempotent.
17348
+ */
17349
+ const RegisterReq = object({
17350
+ host: string(),
17351
+ capabilities: object({
17352
+ platforms: array(Platform),
17353
+ runtimes: array(string()),
17354
+ acp: boolean(),
17355
+ features: array(string()).default([])
17356
+ }),
17357
+ maxAgents: number().int(),
17358
+ localState: object({
17359
+ assignments: array(string()),
17360
+ crons: array(string()),
17361
+ leases: array(string())
17362
+ })
17363
+ });
17364
+ const RegisterOk = object({
17365
+ routingEpoch: number().int(),
17366
+ assignments: array(RouteAssign),
17367
+ agents: array(AgentSpec.extend({ agentId: string().uuid() })).default([]),
17368
+ crons: array(CronUpsert),
17369
+ leases: array(SecretsGrant),
17370
+ drop: object({
17371
+ assignments: array(string()),
17372
+ crons: array(string())
17373
+ })
17374
+ });
17375
+ //#endregion
17376
+ //#region ../protocol/dist/frames/session.js
17377
+ /**
17378
+ * Session read-back (C→D REQ → REP) — the console's on-demand pulls.
17379
+ *
17380
+ * The CP stores NO session data — neither the list nor the bodies. Sessions are
17381
+ * created on the Slack→daemon path and live solely in the daemon's local store
17382
+ * (body-locality, §1/§12). So both the session **list** and a session's chat
17383
+ * **history** are pulled live from the owning daemon(s) and proxied to the
17384
+ * console — never persisted on the CP, never on the orchestration hot path.
17385
+ *
17386
+ * - `session/list`: the daemon's live sessions (CP fans this out to all the org's
17387
+ * online daemons and merges, for "all sessions across the workspace").
17388
+ * - `session/history`: one cursor-paginated page of a session's transcript.
17389
+ */
17390
+ /** One row in the session list (metadata + console metrics; NOT the transcript). */
17391
+ const SessionListItem = object({
17392
+ sessionId: string().uuid(),
17393
+ sessionKey: SessionKey,
17394
+ agentId: string().uuid(),
17395
+ title: string().optional(),
17396
+ status: string().optional(),
17397
+ lastActivityAt: string().optional(),
17398
+ tokenUsage: number().int().optional(),
17399
+ triggeredBy: string().optional()
17400
+ });
17401
+ /** C→D REQ: list the daemon's sessions (optionally just one agent's). */
17402
+ const SessionListReq = object({ agentId: string().uuid().optional() });
17403
+ /** D→C REP (corr = req id): the daemon's current sessions. */
17404
+ const SessionListPage = object({ sessions: array(SessionListItem) });
17405
+ /** One message in a session transcript page (a body — returned only for display). */
17406
+ const SessionMessage = object({
17407
+ seq: number().int(),
17408
+ sender: string(),
17409
+ ts: string(),
17410
+ kind: string(),
17411
+ text: string()
17412
+ });
17413
+ /** C→D REQ: fetch one page of a session's history from the owning daemon. */
17414
+ const SessionHistoryReq = object({
17415
+ sessionId: string().uuid(),
17416
+ cursor: string().optional(),
17417
+ limit: number().int().positive().max(200).default(50)
17418
+ });
17419
+ /** D→C REP (corr = the req id): a page of messages + the cursor for the next page. */
17420
+ const SessionHistoryPage = object({
17421
+ sessionId: string().uuid(),
17422
+ messages: array(SessionMessage),
17423
+ nextCursor: string().optional()
17424
+ });
17425
+ //#endregion
17341
17426
  //#region ../protocol/dist/frame.js
17342
17427
  /**
17343
17428
  * The single source of truth for the wire: `type` string → payload zod schema.
@@ -17353,32 +17438,8 @@ const AgentScopeDenied = object({
17353
17438
  const FRAME_SCHEMAS = {
17354
17439
  auth: AuthReq,
17355
17440
  "auth/ok": AuthOk,
17356
- register: object({
17357
- host: string(),
17358
- capabilities: object({
17359
- platforms: array(Platform),
17360
- runtimes: array(string()),
17361
- acp: boolean(),
17362
- features: array(string()).default([])
17363
- }),
17364
- maxAgents: number().int(),
17365
- localState: object({
17366
- assignments: array(string()),
17367
- crons: array(string()),
17368
- leases: array(string())
17369
- })
17370
- }),
17371
- "register/ok": object({
17372
- routingEpoch: number().int(),
17373
- assignments: array(RouteAssign),
17374
- agents: array(AgentSpec.extend({ agentId: string().uuid() })).default([]),
17375
- crons: array(CronUpsert),
17376
- leases: array(SecretsGrant),
17377
- drop: object({
17378
- assignments: array(string()),
17379
- crons: array(string())
17380
- })
17381
- }),
17441
+ register: RegisterReq,
17442
+ "register/ok": RegisterOk,
17382
17443
  heartbeat: object({
17383
17444
  load: object({
17384
17445
  cpu: number(),
@@ -17437,6 +17498,10 @@ const FRAME_SCHEMAS = {
17437
17498
  ]),
17438
17499
  toolCalling: boolean()
17439
17500
  }),
17501
+ "session/list": SessionListReq,
17502
+ "session/list/page": SessionListPage,
17503
+ "session/history": SessionHistoryReq,
17504
+ "session/history/page": SessionHistoryPage,
17440
17505
  "config/push": object({ keys: record(string(), unknown()) }),
17441
17506
  "daemon/restart": object({
17442
17507
  reason: string(),
@@ -17523,6 +17588,10 @@ discriminatedUnion("type", [
17523
17588
  frame("scope-attestation", FRAME_SCHEMAS["scope-attestation"]),
17524
17589
  frame("event/session", FRAME_SCHEMAS["event/session"]),
17525
17590
  frame("facts/runtime-profile", FRAME_SCHEMAS["facts/runtime-profile"]),
17591
+ frame("session/list", FRAME_SCHEMAS["session/list"]),
17592
+ frame("session/list/page", FRAME_SCHEMAS["session/list/page"]),
17593
+ frame("session/history", FRAME_SCHEMAS["session/history"]),
17594
+ frame("session/history/page", FRAME_SCHEMAS["session/history/page"]),
17526
17595
  frame("config/push", FRAME_SCHEMAS["config/push"]),
17527
17596
  frame("daemon/restart", FRAME_SCHEMAS["daemon/restart"]),
17528
17597
  frame("daemon/upgrade", FRAME_SCHEMAS["daemon/upgrade"]),