@byok-sdk/protocol 0.30.1 → 0.30.2

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.
@@ -1907,8 +1907,8 @@ export type TaskCancelledPayload = z.infer<typeof TaskCancelledPayloadSchema>;
1907
1907
  * resolves, `docs/protocol.md`): today the server only learns of a local
1908
1908
  * resolution IMPLICITLY, after the fact, once the daemon's next
1909
1909
  * `task.progress`/`task.artifact`/`task.complete` proves the task already
1910
- * moved on (`ConnectionHub.resumeIfImplicitlyApproved`,
1911
- * `packages/server/src/hub.ts`) — a window in which a SaaS-side
1910
+ * moved on (the `relay.onTaskActivity` hook in
1911
+ * `packages/server/src/index.ts`) — a window in which a SaaS-side
1912
1912
  * `TaskHandle.approve()`/`.reject()` can independently decide (and win) the
1913
1913
  * server's own authoritative record before that evidence ever arrives. This
1914
1914
  * message lets the daemon report the local resolution explicitly and
@@ -2995,12 +2995,12 @@ export declare const MESSAGE_TYPES: MessageType[];
2995
2995
  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", "task.offer_prepared", "agent.egress.ack", "agent.message.disposition", "agent.content.read", "agent.home.projection", "agent.input.preparation", "provider.provisioning.available", "agent.memory.intent.available", "task.approve", "task.reject", "task.cancel", "task.steer", "task.offer_sealed", "task.offer_with_toolsets_sealed", "task.offer_for_agent_sealed", "task.offer_for_agent_with_egress_sealed", "task.offer_for_agent_with_egress_fresh_sealed", "task.steer_sealed", "e2ee.key_package.available"];
2996
2996
  /**
2997
2997
  * Message types the daemon sends to the server — the flip side of
2998
- * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
2999
- * only ever valid as the first frame of a WS handshake (`ws-server.ts`), not
3000
- * as ongoing inbound traffic through `ConnectionHub.handleInbound`.
2998
+ * {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: the
2999
+ * inbound gate handles a bearer-authenticated `conn.hello` as a capability
3000
+ * snapshot on its own, before the type-allow check.
3001
3001
  *
3002
- * Used by `handleInbound` (`@byok-sdk/server`'s `hub.ts`) as the type-allow gate
3003
- * for every inbound envelope, WS and `POST /byok/messages` alike (finding
3002
+ * Used by `handleInboundEnvelope` (`@byok-sdk/cloud`'s `inbound.ts`) as the
3003
+ * type-allow gate for every inbound `POST /byok/messages` envelope (finding
3004
3004
  * P2): a `type` outside this set — a server -> daemon type arriving inbound,
3005
3005
  * or anything unrecognized — is rejected before it's dispatched to any
3006
3006
  * handler or counted `accepted` on the `/byok/messages` wire.
package/dist/version.d.ts CHANGED
@@ -43,9 +43,10 @@ export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
43
43
  */
44
44
  export declare const AGENT_HOME_READERS_CAPABILITY: 'agent-home-readers';
45
45
  /**
46
- * Capability flags exchanged during the connection handshake (`conn.hello` /
47
- * `conn.ack`). Additional flags may be introduced without a protocol version
48
- * bump; unrecognized flags must be ignored by both sides.
46
+ * Capability flags. The daemon sends its flags in `conn.hello`; the server
47
+ * sends its own on every long-poll response (`EventsPollResponse`). Additional
48
+ * flags may be introduced without a protocol version bump; unrecognized flags
49
+ * must be ignored by both sides.
49
50
  *
50
51
  * `interactive-approval` is RESERVED as of this addition: it gates the
51
52
  * (currently unexercised) approval seam — a server must not route an
@@ -56,11 +57,10 @@ export declare const AGENT_HOME_READERS_CAPABILITY: 'agent-home-readers';
56
57
  * `approval_resolved` (additive-minor): a SERVER-advertised flag meaning
57
58
  * "I understand the `task.approval_resolved` message" (`messages.ts`). This
58
59
  * is the N/N-1 answer for that new daemon -> server message: an old server's
59
- * `CAPABILITY_FLAGS`/`conn.ack.capabilities` never includes it, so a new
60
- * daemon talking to an old server never sends `task.approval_resolved` at
61
- * all (see `packages/client`'s `task-runner.ts`) and falls back to the
62
- * pre-existing implicit-resume inference
63
- * (`ConnectionHub.resumeIfImplicitlyApproved`, `packages/server/src/hub.ts`)
60
+ * advertised capabilities never include it, so a new daemon talking to an old
61
+ * server never sends `task.approval_resolved` at all (see `packages/client`'s
62
+ * `task-runner.ts`) and falls back to the pre-existing implicit-resume inference
63
+ * (the `relay.onTaskActivity` hook in `packages/server/src/index.ts`)
64
64
  * unconditionally, exactly as before this flag existed. Unlike
65
65
  * `interactive-approval`, this one IS exercised the moment both sides
66
66
  * support it — there is no reserved/dormant period for it.
@@ -77,13 +77,14 @@ export declare const AGENT_HOME_READERS_CAPABILITY: 'agent-home-readers';
77
77
  * by FIELD PRESENCE on the specific message at hand (does this particular
78
78
  * `task.approve`/`task.reject`/`onApprovalResolved` payload carry an
79
79
  * `approvalId`, and does a stored one exist to compare it against?), never
80
- * by checking this flag -- see `ConnectionHub.approveTask`/`rejectTask`/
81
- * `onApprovalResolved` and `TaskRunner.handleApprove`/`handleReject`
82
- * (`packages/client`'s `task-runner.ts`). This flag exists only so each side
83
- * can advertise, and an embedder/operator can observe (`ConnectionHub.
84
- * getDeviceCapabilities`), whether the OTHER side is new enough to
85
- * participate in targeting at all -- the same N/N-1-safe shape as every
86
- * other flag here, just consumed for observability instead of gating.
80
+ * by checking this flag -- see `approveTask`/`rejectTask` (`@byok-sdk/cloud`)
81
+ * and `TaskRunner.handleApprove`/`handleReject` (`packages/client`'s
82
+ * `task-runner.ts`). This flag exists only so each side can advertise
83
+ * whether the OTHER side is new enough to participate in targeting at all (an
84
+ * embedder could observe it through the old
85
+ * reference server's `ConnectionHub.getDeviceCapabilities`; `@byok-sdk/server`
86
+ * now reads it only internally) -- the same N/N-1-safe shape as every other
87
+ * flag here, just consumed for observability instead of gating.
87
88
  */
88
89
  /**
89
90
  * `dispatch-selection` (additive-minor) is a correctness gate for the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byok-sdk/protocol",
3
- "version": "0.30.1",
3
+ "version": "0.30.2",
4
4
  "description": "BYOK SDK wire protocol: envelope schema, message types, and codec helpers",
5
5
  "type": "module",
6
6
  "license": "MIT",