@byok-sdk/protocol 0.22.0 → 0.24.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/README.md +1 -1
- package/dist/agent-event.d.ts +12 -0
- package/dist/agent-memory-intent.d.ts +717 -0
- package/dist/codec.d.ts +8 -0
- package/dist/envelope.d.ts +42 -0
- package/dist/http-api.d.ts +94 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +358 -36
- package/dist/index.js.map +1 -1
- package/dist/input-preparation.d.ts +19 -2
- package/dist/messages.d.ts +66 -1
- package/dist/provider-provisioning.d.ts +372 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@ import { z } from 'zod';
|
|
|
36
36
|
* below. See `INPUT_PREPARATION_VERSION` in the client for what each version
|
|
37
37
|
* changed.
|
|
38
38
|
*/
|
|
39
|
-
export declare const INPUT_PREPARATION_WIRE_VERSION:
|
|
39
|
+
export declare const INPUT_PREPARATION_WIRE_VERSION: 8;
|
|
40
40
|
/**
|
|
41
41
|
* Capability required before a task-free remote input preparation — or a
|
|
42
42
|
* prepared Execution — is admitted: `agent-input-preparation-v<N>`, where
|
|
@@ -59,7 +59,7 @@ export declare const INPUT_PREPARATION_WIRE_VERSION: 7;
|
|
|
59
59
|
* devices as a pair is the operator precondition for the cut (`docs/spec.md`,
|
|
60
60
|
* bounded admission); nothing here parses an older receipt.
|
|
61
61
|
*/
|
|
62
|
-
export declare const AGENT_INPUT_PREPARATION_CAPABILITY: "agent-input-preparation-
|
|
62
|
+
export declare const AGENT_INPUT_PREPARATION_CAPABILITY: "agent-input-preparation-v8";
|
|
63
63
|
/** The preparation surface uses the package-wide lowercase `sha256:<hex>` transport form. */
|
|
64
64
|
export declare const InputPreparationContentHashSchema: z.ZodString;
|
|
65
65
|
/**
|
|
@@ -98,6 +98,13 @@ export declare const InputPreparationPermissionModeSchema: z.ZodEnum<{
|
|
|
98
98
|
readonly: "readonly";
|
|
99
99
|
}>;
|
|
100
100
|
export type InputPreparationPermissionMode = z.infer<typeof InputPreparationPermissionModeSchema>;
|
|
101
|
+
/** Explicit prepared SDK memory selection; never defaulted. */
|
|
102
|
+
export declare const PreparedAgentMemoryModeSchema: z.ZodEnum<{
|
|
103
|
+
none: "none";
|
|
104
|
+
read: "read";
|
|
105
|
+
"read-write": "read-write";
|
|
106
|
+
}>;
|
|
107
|
+
export type PreparedAgentMemoryMode = z.infer<typeof PreparedAgentMemoryModeSchema>;
|
|
101
108
|
/**
|
|
102
109
|
* The canonical Host source snapshot this input was assembled from. Both
|
|
103
110
|
* values are Host authority carried verbatim so the receipt binds the exact
|
|
@@ -641,6 +648,11 @@ export declare const InputPreparationArtifactSummarySchema: z.ZodObject<{
|
|
|
641
648
|
}, z.core.$strict>;
|
|
642
649
|
/** The immutable binding a receipt carries and a later consumer must re-present. */
|
|
643
650
|
export declare const InputPreparationBindingSchema: z.ZodObject<{
|
|
651
|
+
agentMemory: z.ZodEnum<{
|
|
652
|
+
none: "none";
|
|
653
|
+
read: "read";
|
|
654
|
+
"read-write": "read-write";
|
|
655
|
+
}>;
|
|
644
656
|
scopeId: z.ZodString;
|
|
645
657
|
deviceId: z.ZodString;
|
|
646
658
|
agentRef: z.ZodString;
|
|
@@ -701,6 +713,11 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
|
|
|
701
713
|
reserved: "reserved";
|
|
702
714
|
}>;
|
|
703
715
|
binding: z.ZodObject<{
|
|
716
|
+
agentMemory: z.ZodEnum<{
|
|
717
|
+
none: "none";
|
|
718
|
+
read: "read";
|
|
719
|
+
"read-write": "read-write";
|
|
720
|
+
}>;
|
|
704
721
|
scopeId: z.ZodString;
|
|
705
722
|
deviceId: z.ZodString;
|
|
706
723
|
agentRef: z.ZodString;
|
package/dist/messages.d.ts
CHANGED
|
@@ -737,6 +737,11 @@ export declare const TaskOfferPreparedPayloadSchema: z.ZodObject<{
|
|
|
737
737
|
requestDigest: z.ZodString;
|
|
738
738
|
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
739
739
|
}, z.core.$strict>;
|
|
740
|
+
agentMemory: z.ZodEnum<{
|
|
741
|
+
none: "none";
|
|
742
|
+
read: "read";
|
|
743
|
+
"read-write": "read-write";
|
|
744
|
+
}>;
|
|
740
745
|
egressPolicy: z.ZodObject<{
|
|
741
746
|
policyRevision: z.ZodString;
|
|
742
747
|
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1008,6 +1013,24 @@ export declare const AgentHomeProjectionPayloadSchema: z.ZodObject<{
|
|
|
1008
1013
|
projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
|
|
1009
1014
|
}, z.core.$strict>;
|
|
1010
1015
|
export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPayloadSchema>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Server -> daemon: a Host-approved Agent memory intent is waiting for this
|
|
1018
|
+
* device (capability `agent-memory-intent.v1`, see `agent-memory-intent.ts`).
|
|
1019
|
+
*
|
|
1020
|
+
* `.strict()` and exactly two fields. There is deliberately no path, operation,
|
|
1021
|
+
* revision or content: the device fetches the immutable intent from the Host
|
|
1022
|
+
* under its own device authentication, so a mailbox row or journal line never
|
|
1023
|
+
* holds memory content. `agentRef` routes the home lease and the local ledger
|
|
1024
|
+
* and must equal the fetched intent's `agentRef`.
|
|
1025
|
+
*/
|
|
1026
|
+
export declare const AgentMemoryIntentAvailablePayloadSchema: z.ZodObject<{
|
|
1027
|
+
intentId: z.ZodUUID;
|
|
1028
|
+
agentRef: z.ZodObject<{
|
|
1029
|
+
agentId: z.ZodString;
|
|
1030
|
+
profileRevision: z.ZodString;
|
|
1031
|
+
}, z.core.$strict>;
|
|
1032
|
+
}, z.core.$strict>;
|
|
1033
|
+
export type AgentMemoryIntentAvailablePayload = z.infer<typeof AgentMemoryIntentAvailablePayloadSchema>;
|
|
1011
1034
|
/**
|
|
1012
1035
|
* Server -> daemon: one task-free, exact-device remote input preparation.
|
|
1013
1036
|
*
|
|
@@ -1038,6 +1061,11 @@ export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPaylo
|
|
|
1038
1061
|
* in the artifact binding; it is not a grant, and it authorizes nothing.
|
|
1039
1062
|
*/
|
|
1040
1063
|
export declare const AgentInputPreparationPayloadSchema: z.ZodObject<{
|
|
1064
|
+
agentMemory: z.ZodEnum<{
|
|
1065
|
+
none: "none";
|
|
1066
|
+
read: "read";
|
|
1067
|
+
"read-write": "read-write";
|
|
1068
|
+
}>;
|
|
1041
1069
|
requestId: z.ZodUUID;
|
|
1042
1070
|
agentRef: z.ZodObject<{
|
|
1043
1071
|
agentId: z.ZodString;
|
|
@@ -1388,6 +1416,12 @@ export declare const TaskProgressPayloadSchema: z.ZodObject<{
|
|
|
1388
1416
|
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1389
1417
|
reasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
1390
1418
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
1419
|
+
contextTokens: z.ZodOptional<z.ZodNumber>;
|
|
1420
|
+
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
1421
|
+
contextSource: z.ZodOptional<z.ZodEnum<{
|
|
1422
|
+
estimate: "estimate";
|
|
1423
|
+
provider: "provider";
|
|
1424
|
+
}>>;
|
|
1391
1425
|
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
1392
1426
|
type: z.ZodString;
|
|
1393
1427
|
}, z.core.$loose>]>>;
|
|
@@ -2247,6 +2281,11 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
|
|
|
2247
2281
|
requestDigest: z.ZodString;
|
|
2248
2282
|
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
2249
2283
|
}, z.core.$strict>;
|
|
2284
|
+
agentMemory: z.ZodEnum<{
|
|
2285
|
+
none: "none";
|
|
2286
|
+
read: "read";
|
|
2287
|
+
"read-write": "read-write";
|
|
2288
|
+
}>;
|
|
2250
2289
|
egressPolicy: z.ZodObject<{
|
|
2251
2290
|
policyRevision: z.ZodString;
|
|
2252
2291
|
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2774,6 +2813,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
2774
2813
|
requestDigest: z.ZodString;
|
|
2775
2814
|
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
2776
2815
|
}, z.core.$strict>;
|
|
2816
|
+
agentMemory: z.ZodEnum<{
|
|
2817
|
+
none: "none";
|
|
2818
|
+
read: "read";
|
|
2819
|
+
"read-write": "read-write";
|
|
2820
|
+
}>;
|
|
2777
2821
|
egressPolicy: z.ZodObject<{
|
|
2778
2822
|
policyRevision: z.ZodString;
|
|
2779
2823
|
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3067,6 +3111,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
3067
3111
|
projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
|
|
3068
3112
|
}, z.core.$strict>;
|
|
3069
3113
|
readonly 'agent.input.preparation': z.ZodObject<{
|
|
3114
|
+
agentMemory: z.ZodEnum<{
|
|
3115
|
+
none: "none";
|
|
3116
|
+
read: "read";
|
|
3117
|
+
"read-write": "read-write";
|
|
3118
|
+
}>;
|
|
3070
3119
|
requestId: z.ZodUUID;
|
|
3071
3120
|
agentRef: z.ZodObject<{
|
|
3072
3121
|
agentId: z.ZodString;
|
|
@@ -3184,6 +3233,16 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
3184
3233
|
ruledResidualKeys: z.ZodArray<z.ZodString>;
|
|
3185
3234
|
}, z.core.$strict>>;
|
|
3186
3235
|
}, z.core.$strict>;
|
|
3236
|
+
readonly 'provider.provisioning.available': z.ZodObject<{
|
|
3237
|
+
requestId: z.ZodUUID;
|
|
3238
|
+
}, z.core.$strict>;
|
|
3239
|
+
readonly 'agent.memory.intent.available': z.ZodObject<{
|
|
3240
|
+
intentId: z.ZodUUID;
|
|
3241
|
+
agentRef: z.ZodObject<{
|
|
3242
|
+
agentId: z.ZodString;
|
|
3243
|
+
profileRevision: z.ZodString;
|
|
3244
|
+
}, z.core.$strict>;
|
|
3245
|
+
}, z.core.$strict>;
|
|
3187
3246
|
readonly 'task.approve': z.ZodObject<{
|
|
3188
3247
|
approvalId: z.ZodOptional<z.ZodString>;
|
|
3189
3248
|
}, z.core.$strip>;
|
|
@@ -3296,6 +3355,12 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
3296
3355
|
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3297
3356
|
reasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
3298
3357
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
3358
|
+
contextTokens: z.ZodOptional<z.ZodNumber>;
|
|
3359
|
+
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
3360
|
+
contextSource: z.ZodOptional<z.ZodEnum<{
|
|
3361
|
+
estimate: "estimate";
|
|
3362
|
+
provider: "provider";
|
|
3363
|
+
}>>;
|
|
3299
3364
|
}, z.core.$strip>], "type">, z.ZodObject<{
|
|
3300
3365
|
type: z.ZodString;
|
|
3301
3366
|
}, z.core.$loose>]>>;
|
|
@@ -3425,7 +3490,7 @@ export declare const MESSAGE_TYPES: MessageType[];
|
|
|
3425
3490
|
* (`envelope.ts`) to decide which branches require envelope `seq` (M1
|
|
3426
3491
|
* redelivery cursor).
|
|
3427
3492
|
*/
|
|
3428
|
-
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", "task.approve", "task.reject", "task.cancel", "task.steer"];
|
|
3493
|
+
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"];
|
|
3429
3494
|
/**
|
|
3430
3495
|
* Message types the daemon sends to the server — the flip side of
|
|
3431
3496
|
* {@link SERVER_TO_DAEMON_TYPES}. `conn.hello` is deliberately excluded: it's
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Sealed provider provisioning — the wire half.
|
|
4
|
+
*
|
|
5
|
+
* A Host provisions a device-local provider profile (and its API key) without
|
|
6
|
+
* the key ever crossing this SDK's wire. The ciphertext, its configuration and
|
|
7
|
+
* the device's pull of both travel over the HOST's own authenticated device
|
|
8
|
+
* routes; this package defines only:
|
|
9
|
+
*
|
|
10
|
+
* - the task-free server -> daemon notice `provider.provisioning.available`,
|
|
11
|
+
* whose payload is exactly `{ requestId }` (see `messages.ts`);
|
|
12
|
+
* - the device capability that gates that notice;
|
|
13
|
+
* - the credential-free completion a device reports and the durable readback a
|
|
14
|
+
* Host returns for it;
|
|
15
|
+
* - the device-proof operation name a device signs when it registers its
|
|
16
|
+
* provider-secret sealing key.
|
|
17
|
+
*
|
|
18
|
+
* Notice-and-fetch is the point: the daemon journals mailbox rows before they
|
|
19
|
+
* are acknowledged and a mailbox never deletes an unacknowledged row, so a
|
|
20
|
+
* ciphertext carried inside the envelope would outlive the provisioning window
|
|
21
|
+
* in two places. The strict one-field payload makes that unrepresentable.
|
|
22
|
+
*
|
|
23
|
+
* Audiences, route paths and product names are Host vocabulary and stay out of
|
|
24
|
+
* this package.
|
|
25
|
+
*/
|
|
26
|
+
/** Device capability required before a Host may enqueue `provider.provisioning.available`. */
|
|
27
|
+
export declare const PROVIDER_PROVISIONING_CAPABILITY: 'provider-provisioning.v1';
|
|
28
|
+
/**
|
|
29
|
+
* Device-proof `operation` for the signed claim that registers the device's
|
|
30
|
+
* provider-secret sealing public key (`{ keyId, epoch, publicJwk }`).
|
|
31
|
+
*/
|
|
32
|
+
export declare const PROVIDER_SECRET_SEALING_KEY_REGISTER_OPERATION: 'provider-secret-sealing-key.register';
|
|
33
|
+
/**
|
|
34
|
+
* Server -> daemon: a provisioning request is waiting for this device.
|
|
35
|
+
*
|
|
36
|
+
* `.strict()` and exactly one field. There is deliberately no configuration,
|
|
37
|
+
* no ciphertext, no provider identity and no Agent identity: the device fetches
|
|
38
|
+
* all of that from the Host under its own device authentication, so a mailbox
|
|
39
|
+
* row or journal line never holds more than an opaque request id.
|
|
40
|
+
*/
|
|
41
|
+
export declare const ProviderProvisioningAvailablePayloadSchema: z.ZodObject<{
|
|
42
|
+
requestId: z.ZodUUID;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type ProviderProvisioningAvailablePayload = z.infer<typeof ProviderProvisioningAvailablePayloadSchema>;
|
|
45
|
+
export declare const PROVIDER_PROVISIONING_OPERATIONS: readonly ['configure', 'update_model', 'replace_secret', 'delete'];
|
|
46
|
+
export declare const ProviderProvisioningOperationSchema: z.ZodEnum<{
|
|
47
|
+
configure: "configure";
|
|
48
|
+
delete: "delete";
|
|
49
|
+
replace_secret: "replace_secret";
|
|
50
|
+
update_model: "update_model";
|
|
51
|
+
}>;
|
|
52
|
+
export type ProviderProvisioningOperation = z.infer<typeof ProviderProvisioningOperationSchema>;
|
|
53
|
+
/** PostgreSQL BIGINT maximum, carried as decimal text to avoid JavaScript precision loss. */
|
|
54
|
+
export declare const PROVIDER_PROVISIONING_OPERATION_GENERATION_MAXIMUM: '9223372036854775807';
|
|
55
|
+
/**
|
|
56
|
+
* Non-secret, monotonic per-profile operation generation. It is bound into the
|
|
57
|
+
* sealed request's associated data and into the device's local state, so an
|
|
58
|
+
* older generation is always refused. Canonical positive decimal text.
|
|
59
|
+
*/
|
|
60
|
+
export declare const ProviderProvisioningOperationGenerationSchema: z.ZodString;
|
|
61
|
+
export type ProviderProvisioningOperationGeneration = z.infer<typeof ProviderProvisioningOperationGenerationSchema>;
|
|
62
|
+
/**
|
|
63
|
+
* SHA-256 of the canonical non-secret operation the device evaluated. Two
|
|
64
|
+
* completions for one request id are the same result only when this digest
|
|
65
|
+
* (and the rest of the completion) is identical. Pinned to `@byok-sdk/core`
|
|
66
|
+
* `providerProvisioningRequestDigest(request)` (the value `@byok-sdk/keys`
|
|
67
|
+
* returns as `result.requestDigest`); see docs/protocol.md §2.3.
|
|
68
|
+
*/
|
|
69
|
+
export declare const ProviderProvisioningOperationDigestSchema: z.ZodString;
|
|
70
|
+
export type ProviderProvisioningOperationDigest = z.infer<typeof ProviderProvisioningOperationDigestSchema>;
|
|
71
|
+
/**
|
|
72
|
+
* Closed rejection set. Codes name a failed check, never a value: no plaintext,
|
|
73
|
+
* no ciphertext, no OS error detail. `local_commit_interrupted` also covers a
|
|
74
|
+
* request that finds the same or another operation still pending locally.
|
|
75
|
+
*
|
|
76
|
+
* `request_expired` and `sealing_key_rotated` may also be decided by the Host
|
|
77
|
+
* before the device ever completes the request (see
|
|
78
|
+
* {@link PROVIDER_PROVISIONING_HOST_TERMINAL_CODES}).
|
|
79
|
+
*/
|
|
80
|
+
export declare const PROVIDER_PROVISIONING_REJECTION_CODES: readonly ['request_invalid', 'request_conflict', 'request_expired', 'request_not_yet_valid', 'request_window_invalid', 'sealing_key_rotated', 'enrollment_mismatch', 'agent_not_placed', 'config_digest_mismatch', 'operation_generation_stale', 'profile_changed', 'profile_not_found', 'credential_scope_mismatch', 'provider_kind_unsupported', 'pi_model_invalid', 'capabilities_invalid', 'seal_open_failed', 'secret_invalid', 'local_commit_interrupted', 'secret_store_unavailable'];
|
|
81
|
+
export declare const ProviderProvisioningRejectionCodeSchema: z.ZodEnum<{
|
|
82
|
+
agent_not_placed: "agent_not_placed";
|
|
83
|
+
capabilities_invalid: "capabilities_invalid";
|
|
84
|
+
config_digest_mismatch: "config_digest_mismatch";
|
|
85
|
+
credential_scope_mismatch: "credential_scope_mismatch";
|
|
86
|
+
enrollment_mismatch: "enrollment_mismatch";
|
|
87
|
+
local_commit_interrupted: "local_commit_interrupted";
|
|
88
|
+
operation_generation_stale: "operation_generation_stale";
|
|
89
|
+
pi_model_invalid: "pi_model_invalid";
|
|
90
|
+
profile_changed: "profile_changed";
|
|
91
|
+
profile_not_found: "profile_not_found";
|
|
92
|
+
provider_kind_unsupported: "provider_kind_unsupported";
|
|
93
|
+
request_conflict: "request_conflict";
|
|
94
|
+
request_expired: "request_expired";
|
|
95
|
+
request_invalid: "request_invalid";
|
|
96
|
+
request_not_yet_valid: "request_not_yet_valid";
|
|
97
|
+
request_window_invalid: "request_window_invalid";
|
|
98
|
+
seal_open_failed: "seal_open_failed";
|
|
99
|
+
sealing_key_rotated: "sealing_key_rotated";
|
|
100
|
+
secret_invalid: "secret_invalid";
|
|
101
|
+
secret_store_unavailable: "secret_store_unavailable";
|
|
102
|
+
}>;
|
|
103
|
+
export type ProviderProvisioningRejectionCode = z.infer<typeof ProviderProvisioningRejectionCodeSchema>;
|
|
104
|
+
/** Rejections a Host may record on its own authority, without a device completion. */
|
|
105
|
+
export declare const PROVIDER_PROVISIONING_HOST_TERMINAL_CODES: readonly ["request_expired", "sealing_key_rotated"];
|
|
106
|
+
/**
|
|
107
|
+
* Credential-free projection of the device's provider status after an applied
|
|
108
|
+
* operation. It reports WHETHER a secret is configured, never the secret, and
|
|
109
|
+
* carries no endpoint or auth material: those stay device-local.
|
|
110
|
+
*/
|
|
111
|
+
export declare const ProviderProvisioningProviderStatusSchema: z.ZodObject<{
|
|
112
|
+
profileRef: z.ZodString;
|
|
113
|
+
providerKind: z.ZodString;
|
|
114
|
+
modelId: z.ZodString;
|
|
115
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
116
|
+
"image-input": "image-input";
|
|
117
|
+
}>>;
|
|
118
|
+
secretConfigured: z.ZodBoolean;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
export type ProviderProvisioningProviderStatus = z.infer<typeof ProviderProvisioningProviderStatusSchema>;
|
|
121
|
+
/**
|
|
122
|
+
* Closed outcome set of the device's one post-apply check of the stored key
|
|
123
|
+
* against its vendor. It is a HINT for the Host UI, never a readiness input:
|
|
124
|
+
* a saved key is not a validated key, and a network failure does not block
|
|
125
|
+
* provisioning.
|
|
126
|
+
*
|
|
127
|
+
* - `credential_rejected`: the vendor explicitly refused the credential.
|
|
128
|
+
* - `rate_limited`, `quota_or_billing`, `model_not_permitted`: the credential
|
|
129
|
+
* was accepted but the call could not be served for that reason.
|
|
130
|
+
* - `provider_error`: the vendor answered with an error that is none of the
|
|
131
|
+
* classes above.
|
|
132
|
+
* - `unreachable`, `timeout`: no vendor answer within the device's bounds.
|
|
133
|
+
* - `not_run`: no check was made (for example `delete`, or an endpoint without
|
|
134
|
+
* credential auth).
|
|
135
|
+
*
|
|
136
|
+
* No vendor text, status body or error detail crosses this boundary.
|
|
137
|
+
*/
|
|
138
|
+
export declare const PROVIDER_PROVISIONING_KEY_CHECK_RESULTS: readonly ['ok', 'credential_rejected', 'rate_limited', 'quota_or_billing', 'model_not_permitted', 'provider_error', 'unreachable', 'timeout', 'not_run'];
|
|
139
|
+
export declare const ProviderProvisioningKeyCheckResultSchema: z.ZodEnum<{
|
|
140
|
+
credential_rejected: "credential_rejected";
|
|
141
|
+
model_not_permitted: "model_not_permitted";
|
|
142
|
+
not_run: "not_run";
|
|
143
|
+
ok: "ok";
|
|
144
|
+
provider_error: "provider_error";
|
|
145
|
+
quota_or_billing: "quota_or_billing";
|
|
146
|
+
rate_limited: "rate_limited";
|
|
147
|
+
timeout: "timeout";
|
|
148
|
+
unreachable: "unreachable";
|
|
149
|
+
}>;
|
|
150
|
+
export type ProviderProvisioningKeyCheckResult = z.infer<typeof ProviderProvisioningKeyCheckResultSchema>;
|
|
151
|
+
export declare const ProviderProvisioningKeyCheckSchema: z.ZodObject<{
|
|
152
|
+
result: z.ZodEnum<{
|
|
153
|
+
credential_rejected: "credential_rejected";
|
|
154
|
+
model_not_permitted: "model_not_permitted";
|
|
155
|
+
not_run: "not_run";
|
|
156
|
+
ok: "ok";
|
|
157
|
+
provider_error: "provider_error";
|
|
158
|
+
quota_or_billing: "quota_or_billing";
|
|
159
|
+
rate_limited: "rate_limited";
|
|
160
|
+
timeout: "timeout";
|
|
161
|
+
unreachable: "unreachable";
|
|
162
|
+
}>;
|
|
163
|
+
}, z.core.$strict>;
|
|
164
|
+
export type ProviderProvisioningKeyCheck = z.infer<typeof ProviderProvisioningKeyCheckSchema>;
|
|
165
|
+
/**
|
|
166
|
+
* The terminal, credential-free result of one provisioning request, reported
|
|
167
|
+
* by the device to the Host.
|
|
168
|
+
*
|
|
169
|
+
* `applied` carries the post-operation status and exact binding — both absent
|
|
170
|
+
* (`null`) for `delete` and only for `delete`. `configure` and
|
|
171
|
+
* `replace_secret` write a secret, so an applied result for either must report
|
|
172
|
+
* `secretConfigured: true`. `replace_secret` leaves the profile revision and
|
|
173
|
+
* hash unchanged; the binding it reports is the same exact binding as before.
|
|
174
|
+
* Every applied result carries the required `keyCheck` hint; a `delete` has no
|
|
175
|
+
* key left to check and must report `not_run`.
|
|
176
|
+
*/
|
|
177
|
+
export declare const ProviderProvisioningCompletionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
178
|
+
requestId: z.ZodUUID;
|
|
179
|
+
operation: z.ZodEnum<{
|
|
180
|
+
configure: "configure";
|
|
181
|
+
delete: "delete";
|
|
182
|
+
replace_secret: "replace_secret";
|
|
183
|
+
update_model: "update_model";
|
|
184
|
+
}>;
|
|
185
|
+
operationGeneration: z.ZodString;
|
|
186
|
+
operationDigest: z.ZodString;
|
|
187
|
+
outcome: z.ZodLiteral<"applied">;
|
|
188
|
+
providerStatus: z.ZodNullable<z.ZodObject<{
|
|
189
|
+
profileRef: z.ZodString;
|
|
190
|
+
providerKind: z.ZodString;
|
|
191
|
+
modelId: z.ZodString;
|
|
192
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
193
|
+
"image-input": "image-input";
|
|
194
|
+
}>>;
|
|
195
|
+
secretConfigured: z.ZodBoolean;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
binding: z.ZodNullable<z.ZodObject<{
|
|
198
|
+
profileRef: z.ZodString;
|
|
199
|
+
profileRevision: z.ZodString;
|
|
200
|
+
profileHash: z.ZodString;
|
|
201
|
+
modelId: z.ZodString;
|
|
202
|
+
requiredCapabilities: z.ZodArray<z.ZodEnum<{
|
|
203
|
+
"image-input": "image-input";
|
|
204
|
+
}>>;
|
|
205
|
+
}, z.core.$strict>>;
|
|
206
|
+
keyCheck: z.ZodObject<{
|
|
207
|
+
result: z.ZodEnum<{
|
|
208
|
+
credential_rejected: "credential_rejected";
|
|
209
|
+
model_not_permitted: "model_not_permitted";
|
|
210
|
+
not_run: "not_run";
|
|
211
|
+
ok: "ok";
|
|
212
|
+
provider_error: "provider_error";
|
|
213
|
+
quota_or_billing: "quota_or_billing";
|
|
214
|
+
rate_limited: "rate_limited";
|
|
215
|
+
timeout: "timeout";
|
|
216
|
+
unreachable: "unreachable";
|
|
217
|
+
}>;
|
|
218
|
+
}, z.core.$strict>;
|
|
219
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
220
|
+
requestId: z.ZodUUID;
|
|
221
|
+
operation: z.ZodEnum<{
|
|
222
|
+
configure: "configure";
|
|
223
|
+
delete: "delete";
|
|
224
|
+
replace_secret: "replace_secret";
|
|
225
|
+
update_model: "update_model";
|
|
226
|
+
}>;
|
|
227
|
+
operationGeneration: z.ZodString;
|
|
228
|
+
operationDigest: z.ZodString;
|
|
229
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
230
|
+
code: z.ZodEnum<{
|
|
231
|
+
agent_not_placed: "agent_not_placed";
|
|
232
|
+
capabilities_invalid: "capabilities_invalid";
|
|
233
|
+
config_digest_mismatch: "config_digest_mismatch";
|
|
234
|
+
credential_scope_mismatch: "credential_scope_mismatch";
|
|
235
|
+
enrollment_mismatch: "enrollment_mismatch";
|
|
236
|
+
local_commit_interrupted: "local_commit_interrupted";
|
|
237
|
+
operation_generation_stale: "operation_generation_stale";
|
|
238
|
+
pi_model_invalid: "pi_model_invalid";
|
|
239
|
+
profile_changed: "profile_changed";
|
|
240
|
+
profile_not_found: "profile_not_found";
|
|
241
|
+
provider_kind_unsupported: "provider_kind_unsupported";
|
|
242
|
+
request_conflict: "request_conflict";
|
|
243
|
+
request_expired: "request_expired";
|
|
244
|
+
request_invalid: "request_invalid";
|
|
245
|
+
request_not_yet_valid: "request_not_yet_valid";
|
|
246
|
+
request_window_invalid: "request_window_invalid";
|
|
247
|
+
seal_open_failed: "seal_open_failed";
|
|
248
|
+
sealing_key_rotated: "sealing_key_rotated";
|
|
249
|
+
secret_invalid: "secret_invalid";
|
|
250
|
+
secret_store_unavailable: "secret_store_unavailable";
|
|
251
|
+
}>;
|
|
252
|
+
}, z.core.$strict>], "outcome">;
|
|
253
|
+
export type ProviderProvisioningCompletion = z.infer<typeof ProviderProvisioningCompletionSchema>;
|
|
254
|
+
/**
|
|
255
|
+
* How the Host's durable record relates to the completion it was handed:
|
|
256
|
+
*
|
|
257
|
+
* - `recorded`: this completion became the request's first terminal fact.
|
|
258
|
+
* - `idempotent`: an identical completion (same operation digest and result)
|
|
259
|
+
* was already recorded; the stored result is returned and nothing is
|
|
260
|
+
* rewritten.
|
|
261
|
+
* - `conflict`: a different completion (different operation digest or result)
|
|
262
|
+
* is already recorded; the stored one is returned unchanged.
|
|
263
|
+
* - `host_terminal`: the Host had already terminated the request on its own
|
|
264
|
+
* authority ({@link PROVIDER_PROVISIONING_HOST_TERMINAL_CODES}), for example
|
|
265
|
+
* because it expired before the device fetched it.
|
|
266
|
+
*/
|
|
267
|
+
export declare const PROVIDER_PROVISIONING_DISPOSITIONS: readonly ['recorded', 'idempotent', 'conflict', 'host_terminal'];
|
|
268
|
+
export declare const ProviderProvisioningDispositionSchema: z.ZodEnum<{
|
|
269
|
+
conflict: "conflict";
|
|
270
|
+
host_terminal: "host_terminal";
|
|
271
|
+
idempotent: "idempotent";
|
|
272
|
+
recorded: "recorded";
|
|
273
|
+
}>;
|
|
274
|
+
export type ProviderProvisioningDisposition = z.infer<typeof ProviderProvisioningDispositionSchema>;
|
|
275
|
+
/**
|
|
276
|
+
* The Host's durable terminal readback for one provisioning request.
|
|
277
|
+
*
|
|
278
|
+
* `completion` is the terminal fact the Host has STORED, which on `conflict`
|
|
279
|
+
* is not the one the device submitted. Every readback is terminal — there is
|
|
280
|
+
* no `pending` — so a daemon that holds one may acknowledge the notice: an
|
|
281
|
+
* expired, rotated, rejected or conflicting request is a deterministic end
|
|
282
|
+
* state that no redelivery can change.
|
|
283
|
+
*/
|
|
284
|
+
export declare const ProviderProvisioningReadbackSchema: z.ZodObject<{
|
|
285
|
+
tenantId: z.ZodString;
|
|
286
|
+
deviceId: z.ZodString;
|
|
287
|
+
requestId: z.ZodUUID;
|
|
288
|
+
disposition: z.ZodEnum<{
|
|
289
|
+
conflict: "conflict";
|
|
290
|
+
host_terminal: "host_terminal";
|
|
291
|
+
idempotent: "idempotent";
|
|
292
|
+
recorded: "recorded";
|
|
293
|
+
}>;
|
|
294
|
+
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
295
|
+
requestId: z.ZodUUID;
|
|
296
|
+
operation: z.ZodEnum<{
|
|
297
|
+
configure: "configure";
|
|
298
|
+
delete: "delete";
|
|
299
|
+
replace_secret: "replace_secret";
|
|
300
|
+
update_model: "update_model";
|
|
301
|
+
}>;
|
|
302
|
+
operationGeneration: z.ZodString;
|
|
303
|
+
operationDigest: z.ZodString;
|
|
304
|
+
outcome: z.ZodLiteral<"applied">;
|
|
305
|
+
providerStatus: z.ZodNullable<z.ZodObject<{
|
|
306
|
+
profileRef: z.ZodString;
|
|
307
|
+
providerKind: z.ZodString;
|
|
308
|
+
modelId: z.ZodString;
|
|
309
|
+
capabilities: z.ZodArray<z.ZodEnum<{
|
|
310
|
+
"image-input": "image-input";
|
|
311
|
+
}>>;
|
|
312
|
+
secretConfigured: z.ZodBoolean;
|
|
313
|
+
}, z.core.$strict>>;
|
|
314
|
+
binding: z.ZodNullable<z.ZodObject<{
|
|
315
|
+
profileRef: z.ZodString;
|
|
316
|
+
profileRevision: z.ZodString;
|
|
317
|
+
profileHash: z.ZodString;
|
|
318
|
+
modelId: z.ZodString;
|
|
319
|
+
requiredCapabilities: z.ZodArray<z.ZodEnum<{
|
|
320
|
+
"image-input": "image-input";
|
|
321
|
+
}>>;
|
|
322
|
+
}, z.core.$strict>>;
|
|
323
|
+
keyCheck: z.ZodObject<{
|
|
324
|
+
result: z.ZodEnum<{
|
|
325
|
+
credential_rejected: "credential_rejected";
|
|
326
|
+
model_not_permitted: "model_not_permitted";
|
|
327
|
+
not_run: "not_run";
|
|
328
|
+
ok: "ok";
|
|
329
|
+
provider_error: "provider_error";
|
|
330
|
+
quota_or_billing: "quota_or_billing";
|
|
331
|
+
rate_limited: "rate_limited";
|
|
332
|
+
timeout: "timeout";
|
|
333
|
+
unreachable: "unreachable";
|
|
334
|
+
}>;
|
|
335
|
+
}, z.core.$strict>;
|
|
336
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
337
|
+
requestId: z.ZodUUID;
|
|
338
|
+
operation: z.ZodEnum<{
|
|
339
|
+
configure: "configure";
|
|
340
|
+
delete: "delete";
|
|
341
|
+
replace_secret: "replace_secret";
|
|
342
|
+
update_model: "update_model";
|
|
343
|
+
}>;
|
|
344
|
+
operationGeneration: z.ZodString;
|
|
345
|
+
operationDigest: z.ZodString;
|
|
346
|
+
outcome: z.ZodLiteral<"rejected">;
|
|
347
|
+
code: z.ZodEnum<{
|
|
348
|
+
agent_not_placed: "agent_not_placed";
|
|
349
|
+
capabilities_invalid: "capabilities_invalid";
|
|
350
|
+
config_digest_mismatch: "config_digest_mismatch";
|
|
351
|
+
credential_scope_mismatch: "credential_scope_mismatch";
|
|
352
|
+
enrollment_mismatch: "enrollment_mismatch";
|
|
353
|
+
local_commit_interrupted: "local_commit_interrupted";
|
|
354
|
+
operation_generation_stale: "operation_generation_stale";
|
|
355
|
+
pi_model_invalid: "pi_model_invalid";
|
|
356
|
+
profile_changed: "profile_changed";
|
|
357
|
+
profile_not_found: "profile_not_found";
|
|
358
|
+
provider_kind_unsupported: "provider_kind_unsupported";
|
|
359
|
+
request_conflict: "request_conflict";
|
|
360
|
+
request_expired: "request_expired";
|
|
361
|
+
request_invalid: "request_invalid";
|
|
362
|
+
request_not_yet_valid: "request_not_yet_valid";
|
|
363
|
+
request_window_invalid: "request_window_invalid";
|
|
364
|
+
seal_open_failed: "seal_open_failed";
|
|
365
|
+
sealing_key_rotated: "sealing_key_rotated";
|
|
366
|
+
secret_invalid: "secret_invalid";
|
|
367
|
+
secret_store_unavailable: "secret_store_unavailable";
|
|
368
|
+
}>;
|
|
369
|
+
}, z.core.$strict>], "outcome">;
|
|
370
|
+
completedAt: z.ZodISODateTime;
|
|
371
|
+
}, z.core.$strict>;
|
|
372
|
+
export type ProviderProvisioningReadback = z.infer<typeof ProviderProvisioningReadbackSchema>;
|
package/dist/version.d.ts
CHANGED
|
@@ -107,5 +107,5 @@ export declare const STRICT_AGENT_ONLY_CAPABILITY: 'strict-agent-only';
|
|
|
107
107
|
* cannot accidentally execute the instruction without the required tools.
|
|
108
108
|
*/
|
|
109
109
|
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-
|
|
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-v8", "terminal-projection-selection", "host-mcp-task-context", "custom-harness", "mailbox-read-ahead", "provider-provisioning.v1", "agent-memory-intent.v1"];
|
|
111
111
|
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.24.0",
|
|
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",
|