@byok-sdk/protocol 0.23.0 → 0.25.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/README.md +1 -1
- package/dist/agent-egress.d.ts +13 -16
- package/dist/agent-event.d.ts +13 -1
- package/dist/agent-memory-intent.d.ts +717 -0
- package/dist/codec.d.ts +4 -0
- package/dist/envelope.d.ts +27 -99
- package/dist/http-api.d.ts +56 -218
- package/dist/index.d.ts +6 -6
- package/dist/index.js +223 -97
- package/dist/index.js.map +1 -1
- package/dist/input-preparation.d.ts +15 -64
- package/dist/messages.d.ts +58 -314
- package/dist/version.d.ts +20 -11
- package/package.json +2 -2
- package/dist/permission.d.ts +0 -39
package/dist/version.d.ts
CHANGED
|
@@ -7,25 +7,34 @@ export declare const MAILBOX_READ_AHEAD_CAPABILITY = "mailbox-read-ahead";
|
|
|
7
7
|
* do not require a bump — servers negotiate the highest common version and
|
|
8
8
|
* daemons/servers must ignore unknown fields and unknown message types.
|
|
9
9
|
*
|
|
10
|
-
* FROZEN
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* FROZEN (see docs/protocol.md "Freeze rule"): `PROTOCOL_VERSION` does not
|
|
11
|
+
* bump for additive changes (new optional fields, new message types, new
|
|
12
|
+
* `AgentEvent` variants, new capability flags) — only for a breaking one
|
|
13
|
+
* (changing, removing, or retyping anything that already exists).
|
|
14
|
+
*
|
|
15
|
+
* v2 removed the task offer's `policy` (`PermissionPolicy`), the runtime
|
|
16
|
+
* capability `permissionModes` and the input-preparation `permissionMode`.
|
|
17
|
+
* Sessions run without an SDK permission gate; each local agent keeps its
|
|
18
|
+
* own guardrails. A v1 envelope is rejected; there is no v1 reader.
|
|
19
|
+
* v2 also removed the egress policy's `metadata-status` activity mode, its
|
|
20
|
+
* `activity.mode` field and the `sanitizer_rejected` drop reason. Agent
|
|
21
|
+
* egress goes to the Host as the runtime produced it.
|
|
22
|
+
* v2 also removed the input-preparation artifact's `toolImplementationKinds`
|
|
23
|
+
* and the readiness reason `executor_identity_unproven`. The SDK does not
|
|
24
|
+
* attest tool executables. The artifact names its counted tools in
|
|
25
|
+
* `toolNames`.
|
|
17
26
|
*
|
|
18
27
|
* IMPORTANT: changing this constant, or changing/removing/retyping any
|
|
19
28
|
* already-frozen schema in this package, requires a DELIBERATE update to the
|
|
20
|
-
* committed golden fixtures in `src/__tests__/golden/` (`
|
|
21
|
-
* `
|
|
29
|
+
* committed golden fixtures in `src/__tests__/golden/` (`v<N>.frozen.json`,
|
|
30
|
+
* `v<N>.envelopes.ndjson`) — see `src/__tests__/freeze-guard.test.ts`, which
|
|
22
31
|
* fails loudly on exactly that kind of drift. A passing freeze-guard run
|
|
23
32
|
* after such a change means either (a) the change was genuinely additive and
|
|
24
33
|
* the golden was regenerated with justification, or (b) this constant was
|
|
25
34
|
* bumped alongside a new golden generation for the new version — never a
|
|
26
35
|
* silent edit to either file to make the test pass.
|
|
27
36
|
*/
|
|
28
|
-
export declare const PROTOCOL_VERSION =
|
|
37
|
+
export declare const PROTOCOL_VERSION = 2;
|
|
29
38
|
/** Host declares that this device accepts only Agent-bound offer variants. */
|
|
30
39
|
export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
|
|
31
40
|
/**
|
|
@@ -107,5 +116,5 @@ export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
|
|
|
107
116
|
* cannot accidentally execute the instruction without the required tools.
|
|
108
117
|
*/
|
|
109
118
|
export declare const CUSTOM_HARNESS_CAPABILITY: 'custom-harness';
|
|
110
|
-
export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', "provider-profile-binding", '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", "agent-input-preparation-
|
|
119
|
+
export declare const CAPABILITY_FLAGS: readonly ['steer', 'blob-upload', 'interactive-approval', 'approval_resolved', 'approval-targeting', 'result-document', 'dispatch-selection', "provider-profile-binding", '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", "agent-input-preparation-v9", "terminal-projection-selection", "host-mcp-task-context", "custom-harness", "mailbox-read-ahead", "provider-provisioning.v1", "agent-memory-intent.v1"];
|
|
111
120
|
export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byok-sdk/protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0-rc.1",
|
|
4
4
|
"description": "BYOK SDK wire protocol: envelope schema, message types, and codec helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"homepage": "https://github.com/Ancienttwo/byok-sdk#readme",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=24.15.0"
|
|
18
18
|
},
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"main": "./dist/index.js",
|
package/dist/permission.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const PERMISSION_MODES: readonly ['auto', 'confirm', 'readonly', 'plan'];
|
|
3
|
-
export type PermissionMode = (typeof PERMISSION_MODES)[number];
|
|
4
|
-
/**
|
|
5
|
-
* Policy the server proposes for a task. The daemon/runtime adapter maps this
|
|
6
|
-
* onto the concrete runtime's flags; anything that can't be expressed exactly
|
|
7
|
-
* must fail closed (deny) rather than silently widen the grant.
|
|
8
|
-
*
|
|
9
|
-
* `.strict()`: this is control/security data, so per the freeze rule's
|
|
10
|
-
* observability-vs-control asymmetry (docs/protocol.md "Freeze rule") an
|
|
11
|
-
* unrecognized field must be REJECTED, not silently stripped-and-ignored the
|
|
12
|
-
* way an ordinary payload's unknown field is (plain `z.object()`'s default
|
|
13
|
-
* behavior). Without `.strict()`, a policy carrying a future constraint this
|
|
14
|
-
* schema doesn't know about yet would parse successfully with that
|
|
15
|
-
* constraint silently discarded — exactly the silent-widening failure mode
|
|
16
|
-
* this type's own doc comment above warns against, since a stripped
|
|
17
|
-
* constraint is indistinguishable from a constraint that was never sent.
|
|
18
|
-
*
|
|
19
|
-
* Consequence: adding a new field to this schema post-freeze is therefore a
|
|
20
|
-
* BREAKING change requiring a `PROTOCOL_VERSION` bump — unlike the general
|
|
21
|
-
* "a new optional field on an existing payload is non-breaking" rule the
|
|
22
|
-
* freeze rule grants every other schema. That's intentional: a new
|
|
23
|
-
* security/control constraint must force a conscious version bump so an
|
|
24
|
-
* unupgraded peer can never silently ignore it, rather than being added the
|
|
25
|
-
* same low-friction way a harmless observability field would be.
|
|
26
|
-
*/
|
|
27
|
-
export declare const PermissionPolicySchema: z.ZodObject<{
|
|
28
|
-
mode: z.ZodEnum<{
|
|
29
|
-
auto: "auto";
|
|
30
|
-
confirm: "confirm";
|
|
31
|
-
plan: "plan";
|
|
32
|
-
readonly: "readonly";
|
|
33
|
-
}>;
|
|
34
|
-
allowTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
-
denyTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
-
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
37
|
-
network: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
-
}, z.core.$strict>;
|
|
39
|
-
export type PermissionPolicy = z.infer<typeof PermissionPolicySchema>;
|