@byok-sdk/protocol 0.7.0 → 0.8.0
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/agent-egress.d.ts +2 -0
- package/dist/agent-home-projection.d.ts +38 -0
- package/dist/codec.d.ts +8 -0
- package/dist/envelope.d.ts +107 -0
- package/dist/http-api.d.ts +260 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +64 -2
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +204 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/messages.d.ts
CHANGED
|
@@ -82,6 +82,12 @@ export declare const AgentRefSchema: z.ZodObject<{
|
|
|
82
82
|
profileRevision: z.ZodString;
|
|
83
83
|
}, z.core.$strict>;
|
|
84
84
|
export type AgentRef = z.infer<typeof AgentRefSchema>;
|
|
85
|
+
/** AgentRef constrained to the canonical Profile revision required by projection control. */
|
|
86
|
+
export declare const AgentHomeProjectionAgentRefSchema: z.ZodObject<{
|
|
87
|
+
agentId: z.ZodString;
|
|
88
|
+
profileRevision: z.ZodString;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
export type AgentHomeProjectionAgentRef = z.infer<typeof AgentHomeProjectionAgentRefSchema>;
|
|
85
91
|
/**
|
|
86
92
|
* Device-local inventory projected for discovery. IDs only: executable MCP
|
|
87
93
|
* definitions, arguments, environment and credentials never enter this shape.
|
|
@@ -406,6 +412,95 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
|
|
|
406
412
|
}, z.core.$strict>;
|
|
407
413
|
}, z.core.$strict>;
|
|
408
414
|
export type TaskOfferForAgentWithEgressPayload = z.infer<typeof TaskOfferForAgentWithEgressPayloadSchema>;
|
|
415
|
+
/**
|
|
416
|
+
* Strict fresh-session Agent egress offer. It deliberately omits `sessionRef`:
|
|
417
|
+
* the selected runtime is the sole authority that can mint that identity after
|
|
418
|
+
* start. This distinct message prevents a missing resume reference from being
|
|
419
|
+
* interpreted as a fresh execution by an older daemon.
|
|
420
|
+
*/
|
|
421
|
+
export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<{
|
|
422
|
+
instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
423
|
+
blobRef: z.ZodObject<{
|
|
424
|
+
blobId: z.ZodString;
|
|
425
|
+
contentHash: z.ZodString;
|
|
426
|
+
size: z.ZodNumber;
|
|
427
|
+
contentType: z.ZodString;
|
|
428
|
+
url: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
}, z.core.$strict>]>;
|
|
431
|
+
policy: z.ZodObject<{
|
|
432
|
+
mode: z.ZodEnum<{
|
|
433
|
+
auto: "auto";
|
|
434
|
+
confirm: "confirm";
|
|
435
|
+
plan: "plan";
|
|
436
|
+
readonly: "readonly";
|
|
437
|
+
}>;
|
|
438
|
+
allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
439
|
+
denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
440
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
441
|
+
network: z.ZodOptional<z.ZodBoolean>;
|
|
442
|
+
}, z.core.$strict>;
|
|
443
|
+
agentRef: z.ZodObject<{
|
|
444
|
+
agentId: z.ZodString;
|
|
445
|
+
profileRevision: z.ZodString;
|
|
446
|
+
}, z.core.$strict>;
|
|
447
|
+
requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
448
|
+
runtime: z.ZodOptional<z.ZodEnum<{
|
|
449
|
+
claude: "claude";
|
|
450
|
+
codex: "codex";
|
|
451
|
+
pi: "pi";
|
|
452
|
+
}>>;
|
|
453
|
+
dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
454
|
+
lane: z.ZodLiteral<"subscription">;
|
|
455
|
+
runtimeId: z.ZodEnum<{
|
|
456
|
+
claude: "claude";
|
|
457
|
+
codex: "codex";
|
|
458
|
+
}>;
|
|
459
|
+
providerId: z.ZodNull;
|
|
460
|
+
modelId: z.ZodString;
|
|
461
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
462
|
+
lane: z.ZodLiteral<"byok">;
|
|
463
|
+
runtimeId: z.ZodLiteral<"pi">;
|
|
464
|
+
providerId: z.ZodString;
|
|
465
|
+
modelId: z.ZodString;
|
|
466
|
+
}, z.core.$strict>], "lane">>;
|
|
467
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
468
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
470
|
+
}, z.core.$strip>>;
|
|
471
|
+
egressPolicy: z.ZodObject<{
|
|
472
|
+
policyRevision: z.ZodString;
|
|
473
|
+
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
474
|
+
mode: z.ZodLiteral<"metadata-status">;
|
|
475
|
+
delivery: z.ZodLiteral<"latest-value">;
|
|
476
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
477
|
+
mode: z.ZodLiteral<"contentful-trajectory">;
|
|
478
|
+
delivery: z.ZodLiteral<"latest-value">;
|
|
479
|
+
maxCoalesceMs: z.ZodNumber;
|
|
480
|
+
maxEventBytes: z.ZodNumber;
|
|
481
|
+
}, z.core.$strict>], "mode">;
|
|
482
|
+
reliable: z.ZodObject<{
|
|
483
|
+
maxPendingEventsPerAgent: z.ZodNumber;
|
|
484
|
+
maxPendingBytesPerAgent: z.ZodNumber;
|
|
485
|
+
maxPendingBytesPerTenant: z.ZodNumber;
|
|
486
|
+
}, z.core.$strict>;
|
|
487
|
+
transfers: z.ZodObject<{
|
|
488
|
+
workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
489
|
+
maxBytes: z.ZodNumber;
|
|
490
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
491
|
+
}, z.core.$strict>]>;
|
|
492
|
+
transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
493
|
+
maxBytes: z.ZodNumber;
|
|
494
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
495
|
+
}, z.core.$strict>]>;
|
|
496
|
+
artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
497
|
+
maxBytes: z.ZodNumber;
|
|
498
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
499
|
+
}, z.core.$strict>]>;
|
|
500
|
+
}, z.core.$strict>;
|
|
501
|
+
}, z.core.$strict>;
|
|
502
|
+
}, z.core.$strict>;
|
|
503
|
+
export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferForAgentWithEgressFreshPayloadSchema>;
|
|
409
504
|
/** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
|
|
410
505
|
export declare const AgentEgressReliablePayloadSchema: z.ZodObject<{
|
|
411
506
|
agentRef: z.ZodObject<{
|
|
@@ -580,6 +675,23 @@ export declare const AgentContentReceiptPayloadSchema: z.ZodDiscriminatedUnion<[
|
|
|
580
675
|
}>;
|
|
581
676
|
}, z.core.$strict>], "decision">;
|
|
582
677
|
export type AgentContentReceiptPayload = z.infer<typeof AgentContentReceiptPayloadSchema>;
|
|
678
|
+
/**
|
|
679
|
+
* Server -> daemon: one task-free exact-device Agent-home projection.
|
|
680
|
+
*
|
|
681
|
+
* `agentRef.profileRevision` is the projection contract's canonical comparable
|
|
682
|
+
* revision. It is validated without interpreting the opaque product
|
|
683
|
+
* projection, whose fields are never inspected for product semantics.
|
|
684
|
+
*/
|
|
685
|
+
export declare const AgentHomeProjectionPayloadSchema: z.ZodObject<{
|
|
686
|
+
requestId: z.ZodUUID;
|
|
687
|
+
agentRef: z.ZodObject<{
|
|
688
|
+
agentId: z.ZodString;
|
|
689
|
+
profileRevision: z.ZodString;
|
|
690
|
+
}, z.core.$strict>;
|
|
691
|
+
projectionHash: z.ZodString;
|
|
692
|
+
projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
|
|
693
|
+
}, z.core.$strict>;
|
|
694
|
+
export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPayloadSchema>;
|
|
583
695
|
/**
|
|
584
696
|
* server -> daemon: approve a pending `task.await_approval` request.
|
|
585
697
|
*
|
|
@@ -1372,6 +1484,88 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1372
1484
|
}, z.core.$strict>;
|
|
1373
1485
|
}, z.core.$strict>;
|
|
1374
1486
|
}, z.core.$strict>;
|
|
1487
|
+
readonly 'task.offer_for_agent_with_egress_fresh': z.ZodObject<{
|
|
1488
|
+
instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1489
|
+
blobRef: z.ZodObject<{
|
|
1490
|
+
blobId: z.ZodString;
|
|
1491
|
+
contentHash: z.ZodString;
|
|
1492
|
+
size: z.ZodNumber;
|
|
1493
|
+
contentType: z.ZodString;
|
|
1494
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1495
|
+
}, z.core.$strip>;
|
|
1496
|
+
}, z.core.$strict>]>;
|
|
1497
|
+
policy: z.ZodObject<{
|
|
1498
|
+
mode: z.ZodEnum<{
|
|
1499
|
+
auto: "auto";
|
|
1500
|
+
confirm: "confirm";
|
|
1501
|
+
plan: "plan";
|
|
1502
|
+
readonly: "readonly";
|
|
1503
|
+
}>;
|
|
1504
|
+
allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1505
|
+
denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1506
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
1507
|
+
network: z.ZodOptional<z.ZodBoolean>;
|
|
1508
|
+
}, z.core.$strict>;
|
|
1509
|
+
agentRef: z.ZodObject<{
|
|
1510
|
+
agentId: z.ZodString;
|
|
1511
|
+
profileRevision: z.ZodString;
|
|
1512
|
+
}, z.core.$strict>;
|
|
1513
|
+
requiredToolsets: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1514
|
+
runtime: z.ZodOptional<z.ZodEnum<{
|
|
1515
|
+
claude: "claude";
|
|
1516
|
+
codex: "codex";
|
|
1517
|
+
pi: "pi";
|
|
1518
|
+
}>>;
|
|
1519
|
+
dispatchSelection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1520
|
+
lane: z.ZodLiteral<"subscription">;
|
|
1521
|
+
runtimeId: z.ZodEnum<{
|
|
1522
|
+
claude: "claude";
|
|
1523
|
+
codex: "codex";
|
|
1524
|
+
}>;
|
|
1525
|
+
providerId: z.ZodNull;
|
|
1526
|
+
modelId: z.ZodString;
|
|
1527
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1528
|
+
lane: z.ZodLiteral<"byok">;
|
|
1529
|
+
runtimeId: z.ZodLiteral<"pi">;
|
|
1530
|
+
providerId: z.ZodString;
|
|
1531
|
+
modelId: z.ZodString;
|
|
1532
|
+
}, z.core.$strict>], "lane">>;
|
|
1533
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
1534
|
+
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1535
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
1536
|
+
}, z.core.$strip>>;
|
|
1537
|
+
egressPolicy: z.ZodObject<{
|
|
1538
|
+
policyRevision: z.ZodString;
|
|
1539
|
+
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1540
|
+
mode: z.ZodLiteral<"metadata-status">;
|
|
1541
|
+
delivery: z.ZodLiteral<"latest-value">;
|
|
1542
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1543
|
+
mode: z.ZodLiteral<"contentful-trajectory">;
|
|
1544
|
+
delivery: z.ZodLiteral<"latest-value">;
|
|
1545
|
+
maxCoalesceMs: z.ZodNumber;
|
|
1546
|
+
maxEventBytes: z.ZodNumber;
|
|
1547
|
+
}, z.core.$strict>], "mode">;
|
|
1548
|
+
reliable: z.ZodObject<{
|
|
1549
|
+
maxPendingEventsPerAgent: z.ZodNumber;
|
|
1550
|
+
maxPendingBytesPerAgent: z.ZodNumber;
|
|
1551
|
+
maxPendingBytesPerTenant: z.ZodNumber;
|
|
1552
|
+
}, z.core.$strict>;
|
|
1553
|
+
transfers: z.ZodObject<{
|
|
1554
|
+
workspace: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
1555
|
+
maxBytes: z.ZodNumber;
|
|
1556
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
1557
|
+
}, z.core.$strict>]>;
|
|
1558
|
+
transcript: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
1559
|
+
maxBytes: z.ZodNumber;
|
|
1560
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
1561
|
+
}, z.core.$strict>]>;
|
|
1562
|
+
artifact: z.ZodUnion<readonly [z.ZodLiteral<"disabled">, z.ZodObject<{
|
|
1563
|
+
maxBytes: z.ZodNumber;
|
|
1564
|
+
allowedMimeTypes: z.ZodArray<z.ZodString>;
|
|
1565
|
+
}, z.core.$strict>]>;
|
|
1566
|
+
}, z.core.$strict>;
|
|
1567
|
+
}, z.core.$strict>;
|
|
1568
|
+
}, z.core.$strict>;
|
|
1375
1569
|
readonly 'agent.egress.reliable': z.ZodObject<{
|
|
1376
1570
|
agentRef: z.ZodObject<{
|
|
1377
1571
|
agentId: z.ZodString;
|
|
@@ -1538,6 +1732,15 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1538
1732
|
"text-not-allowlisted": "text-not-allowlisted";
|
|
1539
1733
|
}>;
|
|
1540
1734
|
}, z.core.$strict>], "decision">;
|
|
1735
|
+
readonly 'agent.home.projection': z.ZodObject<{
|
|
1736
|
+
requestId: z.ZodUUID;
|
|
1737
|
+
agentRef: z.ZodObject<{
|
|
1738
|
+
agentId: z.ZodString;
|
|
1739
|
+
profileRevision: z.ZodString;
|
|
1740
|
+
}, z.core.$strict>;
|
|
1741
|
+
projectionHash: z.ZodString;
|
|
1742
|
+
projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
|
|
1743
|
+
}, z.core.$strict>;
|
|
1541
1744
|
readonly 'task.approve': z.ZodObject<{
|
|
1542
1745
|
approvalId: z.ZodOptional<z.ZodString>;
|
|
1543
1746
|
}, z.core.$strip>;
|
|
@@ -1727,7 +1930,7 @@ export declare const MESSAGE_TYPES: MessageType[];
|
|
|
1727
1930
|
* (`envelope.ts`) to decide which branches require envelope `seq` (M1
|
|
1728
1931
|
* redelivery cursor).
|
|
1729
1932
|
*/
|
|
1730
|
-
export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.offer_for_agent", "task.offer_for_agent_with_egress", "agent.egress.ack", "agent.content.read", "task.approve", "task.reject", "task.cancel", "task.steer"];
|
|
1933
|
+
export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer", "task.offer_with_toolsets", "task.offer_for_agent", "task.offer_for_agent_with_egress", "task.offer_for_agent_with_egress_fresh", "agent.egress.ack", "agent.content.read", "agent.home.projection", "task.approve", "task.reject", "task.cancel", "task.steer"];
|
|
1731
1934
|
/**
|
|
1732
1935
|
* Message types the daemon sends to the server — the flip side of
|
|
1733
1936
|
* {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
|
package/dist/version.d.ts
CHANGED
|
@@ -101,5 +101,5 @@ export declare const PROTOCOL_VERSION = 1;
|
|
|
101
101
|
* boundary for long-poll: an older daemon skips it as unknown and therefore
|
|
102
102
|
* cannot accidentally execute the instruction without the required tools.
|
|
103
103
|
*/
|
|
104
|
-
export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', 'toolset-selection', 'agent-home-contract', "agent-egress-policy", "agent-egress-reliable-ack", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read"];
|
|
104
|
+
export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', 'toolset-selection', 'agent-home-contract', "agent-egress-policy", "agent-egress-reliable-ack", "agent-egress-fresh-session", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read", "agent-home-projection"];
|
|
105
105
|
export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];
|