@byok-sdk/protocol 0.8.0 → 0.9.0-rc.1
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 +27 -0
- package/dist/agent-memory-projection.d.ts +110 -0
- package/dist/codec.d.ts +8 -0
- package/dist/envelope.d.ts +87 -0
- package/dist/http-api.d.ts +232 -0
- package/dist/index.d.ts +11 -7
- package/dist/index.js +173 -27
- package/dist/index.js.map +1 -1
- package/dist/messages.d.ts +147 -2
- package/dist/terminal-projection.d.ts +12 -0
- package/dist/version.d.ts +3 -1
- package/package.json +1 -1
package/dist/messages.d.ts
CHANGED
|
@@ -316,6 +316,12 @@ export declare const TaskOfferForAgentPayloadSchema: z.ZodObject<{
|
|
|
316
316
|
providerId: z.ZodString;
|
|
317
317
|
modelId: z.ZodString;
|
|
318
318
|
}, z.core.$strict>], "lane">>;
|
|
319
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
320
|
+
mode: z.ZodLiteral<"none">;
|
|
321
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
322
|
+
mode: z.ZodLiteral<"result-document">;
|
|
323
|
+
contract: z.ZodString;
|
|
324
|
+
}, z.core.$strict>], "mode">>;
|
|
319
325
|
sessionRef: z.ZodOptional<z.ZodString>;
|
|
320
326
|
limits: z.ZodOptional<z.ZodObject<{
|
|
321
327
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -374,6 +380,12 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
|
|
|
374
380
|
providerId: z.ZodString;
|
|
375
381
|
modelId: z.ZodString;
|
|
376
382
|
}, z.core.$strict>], "lane">>;
|
|
383
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
384
|
+
mode: z.ZodLiteral<"none">;
|
|
385
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
386
|
+
mode: z.ZodLiteral<"result-document">;
|
|
387
|
+
contract: z.ZodString;
|
|
388
|
+
}, z.core.$strict>], "mode">>;
|
|
377
389
|
limits: z.ZodOptional<z.ZodObject<{
|
|
378
390
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
379
391
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -410,6 +422,15 @@ export declare const TaskOfferForAgentWithEgressPayloadSchema: z.ZodObject<{
|
|
|
410
422
|
}, z.core.$strict>]>;
|
|
411
423
|
}, z.core.$strict>;
|
|
412
424
|
}, z.core.$strict>;
|
|
425
|
+
messageEgress: z.ZodOptional<z.ZodObject<{
|
|
426
|
+
mode: z.ZodLiteral<"required">;
|
|
427
|
+
contract: z.ZodString;
|
|
428
|
+
contentType: z.ZodEnum<{
|
|
429
|
+
"text/markdown": "text/markdown";
|
|
430
|
+
"text/plain": "text/plain";
|
|
431
|
+
}>;
|
|
432
|
+
maxBytes: z.ZodNumber;
|
|
433
|
+
}, z.core.$strict>>;
|
|
413
434
|
}, z.core.$strict>;
|
|
414
435
|
export type TaskOfferForAgentWithEgressPayload = z.infer<typeof TaskOfferForAgentWithEgressPayloadSchema>;
|
|
415
436
|
/**
|
|
@@ -464,6 +485,12 @@ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<
|
|
|
464
485
|
providerId: z.ZodString;
|
|
465
486
|
modelId: z.ZodString;
|
|
466
487
|
}, z.core.$strict>], "lane">>;
|
|
488
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
489
|
+
mode: z.ZodLiteral<"none">;
|
|
490
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
491
|
+
mode: z.ZodLiteral<"result-document">;
|
|
492
|
+
contract: z.ZodString;
|
|
493
|
+
}, z.core.$strict>], "mode">>;
|
|
467
494
|
limits: z.ZodOptional<z.ZodObject<{
|
|
468
495
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
469
496
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -499,6 +526,15 @@ export declare const TaskOfferForAgentWithEgressFreshPayloadSchema: z.ZodObject<
|
|
|
499
526
|
}, z.core.$strict>]>;
|
|
500
527
|
}, z.core.$strict>;
|
|
501
528
|
}, z.core.$strict>;
|
|
529
|
+
messageEgress: z.ZodOptional<z.ZodObject<{
|
|
530
|
+
mode: z.ZodLiteral<"required">;
|
|
531
|
+
contract: z.ZodString;
|
|
532
|
+
contentType: z.ZodEnum<{
|
|
533
|
+
"text/markdown": "text/markdown";
|
|
534
|
+
"text/plain": "text/plain";
|
|
535
|
+
}>;
|
|
536
|
+
maxBytes: z.ZodNumber;
|
|
537
|
+
}, z.core.$strict>>;
|
|
502
538
|
}, z.core.$strict>;
|
|
503
539
|
export type TaskOfferForAgentWithEgressFreshPayload = z.infer<typeof TaskOfferForAgentWithEgressFreshPayloadSchema>;
|
|
504
540
|
/** Daemon -> cloud: one durable reliable-lane item after local sanitization. */
|
|
@@ -529,6 +565,44 @@ export declare const AgentEgressAckPayloadSchema: z.ZodObject<{
|
|
|
529
565
|
receiptId: z.ZodUUID;
|
|
530
566
|
}, z.core.$strict>;
|
|
531
567
|
export type AgentEgressAckPayload = z.infer<typeof AgentEgressAckPayloadSchema>;
|
|
568
|
+
/** Daemon -> server: one Agent-authored message, independent from task activity. */
|
|
569
|
+
export declare const AgentMessagePublishPayloadSchema: z.ZodObject<{
|
|
570
|
+
agentRef: z.ZodObject<{
|
|
571
|
+
agentId: z.ZodString;
|
|
572
|
+
profileRevision: z.ZodString;
|
|
573
|
+
}, z.core.$strict>;
|
|
574
|
+
sessionRef: z.ZodString;
|
|
575
|
+
contract: z.ZodString;
|
|
576
|
+
messageId: z.ZodUUID;
|
|
577
|
+
cursor: z.ZodNumber;
|
|
578
|
+
contentType: z.ZodEnum<{
|
|
579
|
+
"text/markdown": "text/markdown";
|
|
580
|
+
"text/plain": "text/plain";
|
|
581
|
+
}>;
|
|
582
|
+
body: z.ZodString;
|
|
583
|
+
contentHash: z.ZodString;
|
|
584
|
+
byteCount: z.ZodNumber;
|
|
585
|
+
}, z.core.$strict>;
|
|
586
|
+
export type AgentMessagePublishPayload = z.infer<typeof AgentMessagePublishPayloadSchema>;
|
|
587
|
+
export declare const AgentMessageDispositionPayloadSchema: z.ZodObject<{
|
|
588
|
+
agentRef: z.ZodObject<{
|
|
589
|
+
agentId: z.ZodString;
|
|
590
|
+
profileRevision: z.ZodString;
|
|
591
|
+
}, z.core.$strict>;
|
|
592
|
+
sessionRef: z.ZodString;
|
|
593
|
+
contract: z.ZodString;
|
|
594
|
+
messageId: z.ZodUUID;
|
|
595
|
+
cursor: z.ZodNumber;
|
|
596
|
+
contentHash: z.ZodString;
|
|
597
|
+
outcome: z.ZodEnum<{
|
|
598
|
+
accepted: "accepted";
|
|
599
|
+
held: "held";
|
|
600
|
+
refused: "refused";
|
|
601
|
+
}>;
|
|
602
|
+
receiptId: z.ZodUUID;
|
|
603
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
604
|
+
}, z.core.$strict>;
|
|
605
|
+
export type AgentMessageDispositionPayload = z.infer<typeof AgentMessageDispositionPayloadSchema>;
|
|
532
606
|
/** Server -> daemon: one exact, independently-capability-gated content read. */
|
|
533
607
|
export declare const AgentContentReadPayloadSchema: z.ZodObject<{
|
|
534
608
|
requestId: z.ZodUUID;
|
|
@@ -1395,6 +1469,12 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1395
1469
|
providerId: z.ZodString;
|
|
1396
1470
|
modelId: z.ZodString;
|
|
1397
1471
|
}, z.core.$strict>], "lane">>;
|
|
1472
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1473
|
+
mode: z.ZodLiteral<"none">;
|
|
1474
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1475
|
+
mode: z.ZodLiteral<"result-document">;
|
|
1476
|
+
contract: z.ZodString;
|
|
1477
|
+
}, z.core.$strict>], "mode">>;
|
|
1398
1478
|
sessionRef: z.ZodOptional<z.ZodString>;
|
|
1399
1479
|
limits: z.ZodOptional<z.ZodObject<{
|
|
1400
1480
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1447,6 +1527,12 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1447
1527
|
providerId: z.ZodString;
|
|
1448
1528
|
modelId: z.ZodString;
|
|
1449
1529
|
}, z.core.$strict>], "lane">>;
|
|
1530
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1531
|
+
mode: z.ZodLiteral<"none">;
|
|
1532
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1533
|
+
mode: z.ZodLiteral<"result-document">;
|
|
1534
|
+
contract: z.ZodString;
|
|
1535
|
+
}, z.core.$strict>], "mode">>;
|
|
1450
1536
|
limits: z.ZodOptional<z.ZodObject<{
|
|
1451
1537
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1452
1538
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1483,6 +1569,15 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1483
1569
|
}, z.core.$strict>]>;
|
|
1484
1570
|
}, z.core.$strict>;
|
|
1485
1571
|
}, z.core.$strict>;
|
|
1572
|
+
messageEgress: z.ZodOptional<z.ZodObject<{
|
|
1573
|
+
mode: z.ZodLiteral<"required">;
|
|
1574
|
+
contract: z.ZodString;
|
|
1575
|
+
contentType: z.ZodEnum<{
|
|
1576
|
+
"text/markdown": "text/markdown";
|
|
1577
|
+
"text/plain": "text/plain";
|
|
1578
|
+
}>;
|
|
1579
|
+
maxBytes: z.ZodNumber;
|
|
1580
|
+
}, z.core.$strict>>;
|
|
1486
1581
|
}, z.core.$strict>;
|
|
1487
1582
|
readonly 'task.offer_for_agent_with_egress_fresh': z.ZodObject<{
|
|
1488
1583
|
instruction: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -1530,6 +1625,12 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1530
1625
|
providerId: z.ZodString;
|
|
1531
1626
|
modelId: z.ZodString;
|
|
1532
1627
|
}, z.core.$strict>], "lane">>;
|
|
1628
|
+
terminalProjection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1629
|
+
mode: z.ZodLiteral<"none">;
|
|
1630
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1631
|
+
mode: z.ZodLiteral<"result-document">;
|
|
1632
|
+
contract: z.ZodString;
|
|
1633
|
+
}, z.core.$strict>], "mode">>;
|
|
1533
1634
|
limits: z.ZodOptional<z.ZodObject<{
|
|
1534
1635
|
maxDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
1535
1636
|
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1565,6 +1666,15 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1565
1666
|
}, z.core.$strict>]>;
|
|
1566
1667
|
}, z.core.$strict>;
|
|
1567
1668
|
}, z.core.$strict>;
|
|
1669
|
+
messageEgress: z.ZodOptional<z.ZodObject<{
|
|
1670
|
+
mode: z.ZodLiteral<"required">;
|
|
1671
|
+
contract: z.ZodString;
|
|
1672
|
+
contentType: z.ZodEnum<{
|
|
1673
|
+
"text/markdown": "text/markdown";
|
|
1674
|
+
"text/plain": "text/plain";
|
|
1675
|
+
}>;
|
|
1676
|
+
maxBytes: z.ZodNumber;
|
|
1677
|
+
}, z.core.$strict>>;
|
|
1568
1678
|
}, z.core.$strict>;
|
|
1569
1679
|
readonly 'agent.egress.reliable': z.ZodObject<{
|
|
1570
1680
|
agentRef: z.ZodObject<{
|
|
@@ -1590,6 +1700,41 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
1590
1700
|
cursor: z.ZodNumber;
|
|
1591
1701
|
receiptId: z.ZodUUID;
|
|
1592
1702
|
}, z.core.$strict>;
|
|
1703
|
+
readonly 'agent.message.publish': z.ZodObject<{
|
|
1704
|
+
agentRef: z.ZodObject<{
|
|
1705
|
+
agentId: z.ZodString;
|
|
1706
|
+
profileRevision: z.ZodString;
|
|
1707
|
+
}, z.core.$strict>;
|
|
1708
|
+
sessionRef: z.ZodString;
|
|
1709
|
+
contract: z.ZodString;
|
|
1710
|
+
messageId: z.ZodUUID;
|
|
1711
|
+
cursor: z.ZodNumber;
|
|
1712
|
+
contentType: z.ZodEnum<{
|
|
1713
|
+
"text/markdown": "text/markdown";
|
|
1714
|
+
"text/plain": "text/plain";
|
|
1715
|
+
}>;
|
|
1716
|
+
body: z.ZodString;
|
|
1717
|
+
contentHash: z.ZodString;
|
|
1718
|
+
byteCount: z.ZodNumber;
|
|
1719
|
+
}, z.core.$strict>;
|
|
1720
|
+
readonly 'agent.message.disposition': z.ZodObject<{
|
|
1721
|
+
agentRef: z.ZodObject<{
|
|
1722
|
+
agentId: z.ZodString;
|
|
1723
|
+
profileRevision: z.ZodString;
|
|
1724
|
+
}, z.core.$strict>;
|
|
1725
|
+
sessionRef: z.ZodString;
|
|
1726
|
+
contract: z.ZodString;
|
|
1727
|
+
messageId: z.ZodUUID;
|
|
1728
|
+
cursor: z.ZodNumber;
|
|
1729
|
+
contentHash: z.ZodString;
|
|
1730
|
+
outcome: z.ZodEnum<{
|
|
1731
|
+
accepted: "accepted";
|
|
1732
|
+
held: "held";
|
|
1733
|
+
refused: "refused";
|
|
1734
|
+
}>;
|
|
1735
|
+
receiptId: z.ZodUUID;
|
|
1736
|
+
reasonCode: z.ZodOptional<z.ZodString>;
|
|
1737
|
+
}, z.core.$strict>;
|
|
1593
1738
|
readonly 'agent.content.read': z.ZodObject<{
|
|
1594
1739
|
requestId: z.ZodUUID;
|
|
1595
1740
|
surface: z.ZodEnum<{
|
|
@@ -1930,7 +2075,7 @@ export declare const MESSAGE_TYPES: MessageType[];
|
|
|
1930
2075
|
* (`envelope.ts`) to decide which branches require envelope `seq` (M1
|
|
1931
2076
|
* redelivery cursor).
|
|
1932
2077
|
*/
|
|
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"];
|
|
2078
|
+
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.message.disposition", "agent.content.read", "agent.home.projection", "task.approve", "task.reject", "task.cancel", "task.steer"];
|
|
1934
2079
|
/**
|
|
1935
2080
|
* Message types the daemon sends to the server — the flip side of
|
|
1936
2081
|
* {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
|
|
@@ -1943,4 +2088,4 @@ export declare const SERVER_TO_DAEMON_TYPES: readonly ["conn.ack", "task.offer",
|
|
|
1943
2088
|
* or anything unrecognized — is rejected before it's dispatched to any
|
|
1944
2089
|
* handler or counted `accepted` on the `/byok/messages` wire.
|
|
1945
2090
|
*/
|
|
1946
|
-
export declare const DAEMON_TO_SERVER_TYPES: readonly ["task.claim", "task.started", "task.decline", "task.progress", "task.artifact", "task.await_approval", "task.complete", "task.fail", "task.cancelled", "task.approval_resolved", "agent.egress.reliable", "agent.content.receipt"];
|
|
2091
|
+
export declare const DAEMON_TO_SERVER_TYPES: readonly ["task.claim", "task.started", "task.decline", "task.progress", "task.artifact", "task.await_approval", "task.complete", "task.fail", "task.cancelled", "task.approval_resolved", "agent.egress.reliable", "agent.message.publish", "agent.content.receipt"];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Capability required before an offer may select terminal projection behavior. */
|
|
3
|
+
export declare const TERMINAL_PROJECTION_SELECTION_CAPABILITY: 'terminal-projection-selection';
|
|
4
|
+
export declare const TerminalProjectionContractSchema: z.ZodString;
|
|
5
|
+
/** Offer-scoped authority: explicit bypass or one required structured result. */
|
|
6
|
+
export declare const TerminalProjectionSelectionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
mode: z.ZodLiteral<"none">;
|
|
8
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
9
|
+
mode: z.ZodLiteral<"result-document">;
|
|
10
|
+
contract: z.ZodString;
|
|
11
|
+
}, z.core.$strict>], "mode">;
|
|
12
|
+
export type TerminalProjectionSelection = z.infer<typeof TerminalProjectionSelectionSchema>;
|
package/dist/version.d.ts
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
* silent edit to either file to make the test pass.
|
|
24
24
|
*/
|
|
25
25
|
export declare const PROTOCOL_VERSION = 1;
|
|
26
|
+
/** Host declares that this device accepts only Agent-bound offer variants. */
|
|
27
|
+
export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
|
|
26
28
|
/**
|
|
27
29
|
* Capability flags exchanged during the connection handshake (`conn.hello` /
|
|
28
30
|
* `conn.ack`). Additional flags may be introduced without a protocol version
|
|
@@ -101,5 +103,5 @@ export declare const PROTOCOL_VERSION = 1;
|
|
|
101
103
|
* boundary for long-poll: an older daemon skips it as unknown and therefore
|
|
102
104
|
* cannot accidentally execute the instruction without the required tools.
|
|
103
105
|
*/
|
|
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"];
|
|
106
|
+
export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', 'toolset-selection', 'agent-home-contract', "strict-agent-only", "agent-egress-policy", "agent-egress-reliable-ack", "agent-message-egress", "agent-egress-fresh-session", "agent-content-workspace-read", "agent-content-transcript-read", "agent-content-artifact-read", "agent-home-projection", "terminal-projection-selection"];
|
|
105
107
|
export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];
|