@byok-sdk/protocol 0.21.0 → 0.23.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/codec.d.ts +4 -0
- package/dist/envelope.d.ts +21 -0
- package/dist/http-api.d.ts +58 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.js +154 -26
- package/dist/index.js.map +1 -1
- package/dist/input-preparation.d.ts +31 -99
- package/dist/messages.d.ts +29 -1
- package/dist/provider-provisioning.d.ts +372 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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: 6;
|
|
|
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
|
|
@@ -296,77 +303,9 @@ export declare const InputPreparationSelectionSchema: z.ZodObject<{
|
|
|
296
303
|
}, z.core.$strict>;
|
|
297
304
|
}, z.core.$strict>;
|
|
298
305
|
export type InputPreparationSelection = z.infer<typeof InputPreparationSelectionSchema>;
|
|
299
|
-
|
|
300
|
-
path: z.ZodString;
|
|
301
|
-
content: z.ZodString;
|
|
302
|
-
}, z.core.$strict>;
|
|
303
|
-
/**
|
|
304
|
-
* The three documentation locations the native prompt renderer names.
|
|
305
|
-
*
|
|
306
|
-
* The wire field names are this SDK's own and do not track upstream Pi's
|
|
307
|
-
* (`readme`/`docs`/`examples`): the contract a Host integrates against is this
|
|
308
|
-
* one, and renaming a frozen wire field because a runtime renamed a parameter
|
|
309
|
-
* would be a breaking change to every Host for no gain. The device adapter maps
|
|
310
|
-
* these onto whatever the pinned runtime calls them.
|
|
311
|
-
*/
|
|
312
|
-
export declare const InputPreparationDocsPathsSchema: z.ZodObject<{
|
|
313
|
-
readmePath: z.ZodString;
|
|
314
|
-
docsPath: z.ZodString;
|
|
315
|
-
examplesPath: z.ZodString;
|
|
316
|
-
}, z.core.$strict>;
|
|
317
|
-
/**
|
|
318
|
-
* One skill the system prompt renders, stated as the closed set of fields the
|
|
319
|
-
* renderer actually reads.
|
|
320
|
-
*
|
|
321
|
-
* Not a preformatted string: the native renderer owns the skill block's
|
|
322
|
-
* markup, and a Host-rendered one would be a second renderer that could drift
|
|
323
|
-
* from what a live session emits. Loader bookkeeping the prompt never reads
|
|
324
|
-
* (`baseDir`, source info) is deliberately absent — the Host cannot know it and
|
|
325
|
-
* the device must never invent it.
|
|
326
|
-
*/
|
|
327
|
-
export declare const InputPreparationSkillSchema: z.ZodObject<{
|
|
328
|
-
name: z.ZodString;
|
|
329
|
-
description: z.ZodString;
|
|
330
|
-
filePath: z.ZodString;
|
|
331
|
-
disableModelInvocation: z.ZodBoolean;
|
|
332
|
-
}, z.core.$strict>;
|
|
333
|
-
export type InputPreparationSkill = z.infer<typeof InputPreparationSkillSchema>;
|
|
334
|
-
/**
|
|
335
|
-
* Explicit, already-authorized inputs for the native system prompt renderer.
|
|
336
|
-
*
|
|
337
|
-
* `toolSnippets` is PROMPT TEXT the Host authored — it is not the
|
|
338
|
-
* model-visible tool schemas, which the device observes locally and the Host
|
|
339
|
-
* never states (see this module's rule 1). `toolGuidelines` is the same kind of
|
|
340
|
-
* value one level down: the guideline bullets a tool contributes, keyed by tool
|
|
341
|
-
* name and bounded exactly like `toolSnippets` and `promptGuidelines`.
|
|
342
|
-
*
|
|
343
|
-
* `selectedTools` is deliberately absent for the same reason one level up: the
|
|
344
|
-
* native contract requires that list to equal the model-visible manifest
|
|
345
|
-
* exactly, so a Host stating it would be stating the manifest. The device
|
|
346
|
-
* fills it from its own assembled tool surface.
|
|
347
|
-
*/
|
|
306
|
+
/** Complete Host-authored prompt. No Pi renderer or device-local input is consulted. */
|
|
348
307
|
export declare const InputPreparationPromptSnapshotSchema: z.ZodObject<{
|
|
349
|
-
|
|
350
|
-
appendSystemPrompt: z.ZodOptional<z.ZodString>;
|
|
351
|
-
cwd: z.ZodString;
|
|
352
|
-
toolSnippets: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
353
|
-
toolGuidelines: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
354
|
-
promptGuidelines: z.ZodArray<z.ZodString>;
|
|
355
|
-
contextFiles: z.ZodArray<z.ZodObject<{
|
|
356
|
-
path: z.ZodString;
|
|
357
|
-
content: z.ZodString;
|
|
358
|
-
}, z.core.$strict>>;
|
|
359
|
-
skills: z.ZodArray<z.ZodObject<{
|
|
360
|
-
name: z.ZodString;
|
|
361
|
-
description: z.ZodString;
|
|
362
|
-
filePath: z.ZodString;
|
|
363
|
-
disableModelInvocation: z.ZodBoolean;
|
|
364
|
-
}, z.core.$strict>>;
|
|
365
|
-
docsPaths: z.ZodObject<{
|
|
366
|
-
readmePath: z.ZodString;
|
|
367
|
-
docsPath: z.ZodString;
|
|
368
|
-
examplesPath: z.ZodString;
|
|
369
|
-
}, z.core.$strict>;
|
|
308
|
+
systemPrompt: z.ZodString;
|
|
370
309
|
}, z.core.$strict>;
|
|
371
310
|
/**
|
|
372
311
|
* One model-visible user message. Text-only: multimodal content and any extra
|
|
@@ -423,27 +362,7 @@ export type InputPreparationMessage = z.infer<typeof InputPreparationMessageSche
|
|
|
423
362
|
*/
|
|
424
363
|
export declare const InputPreparationContextDocumentSchema: z.ZodObject<{
|
|
425
364
|
prompt: z.ZodObject<{
|
|
426
|
-
|
|
427
|
-
appendSystemPrompt: z.ZodOptional<z.ZodString>;
|
|
428
|
-
cwd: z.ZodString;
|
|
429
|
-
toolSnippets: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
430
|
-
toolGuidelines: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
431
|
-
promptGuidelines: z.ZodArray<z.ZodString>;
|
|
432
|
-
contextFiles: z.ZodArray<z.ZodObject<{
|
|
433
|
-
path: z.ZodString;
|
|
434
|
-
content: z.ZodString;
|
|
435
|
-
}, z.core.$strict>>;
|
|
436
|
-
skills: z.ZodArray<z.ZodObject<{
|
|
437
|
-
name: z.ZodString;
|
|
438
|
-
description: z.ZodString;
|
|
439
|
-
filePath: z.ZodString;
|
|
440
|
-
disableModelInvocation: z.ZodBoolean;
|
|
441
|
-
}, z.core.$strict>>;
|
|
442
|
-
docsPaths: z.ZodObject<{
|
|
443
|
-
readmePath: z.ZodString;
|
|
444
|
-
docsPath: z.ZodString;
|
|
445
|
-
examplesPath: z.ZodString;
|
|
446
|
-
}, z.core.$strict>;
|
|
365
|
+
systemPrompt: z.ZodString;
|
|
447
366
|
}, z.core.$strict>;
|
|
448
367
|
messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
449
368
|
role: z.ZodLiteral<"user">;
|
|
@@ -513,9 +432,10 @@ export type InputPreparationReadinessReason = z.infer<typeof InputPreparationRea
|
|
|
513
432
|
export declare const InputPreparationRuntimeIdentitySchema: z.ZodObject<{
|
|
514
433
|
packageName: z.ZodString;
|
|
515
434
|
packageVersion: z.ZodString;
|
|
516
|
-
|
|
435
|
+
tarballIntegrity: z.ZodString;
|
|
436
|
+
provenanceDigest: z.ZodString;
|
|
437
|
+
closureDigest: z.ZodString;
|
|
517
438
|
upstreamCommit: z.ZodString;
|
|
518
|
-
forkBuild: z.ZodNumber;
|
|
519
439
|
envelopeFormat: z.ZodString;
|
|
520
440
|
requestFormat: z.ZodString;
|
|
521
441
|
compilerVersion: z.ZodNumber;
|
|
@@ -728,6 +648,11 @@ export declare const InputPreparationArtifactSummarySchema: z.ZodObject<{
|
|
|
728
648
|
}, z.core.$strict>;
|
|
729
649
|
/** The immutable binding a receipt carries and a later consumer must re-present. */
|
|
730
650
|
export declare const InputPreparationBindingSchema: z.ZodObject<{
|
|
651
|
+
agentMemory: z.ZodEnum<{
|
|
652
|
+
none: "none";
|
|
653
|
+
read: "read";
|
|
654
|
+
"read-write": "read-write";
|
|
655
|
+
}>;
|
|
731
656
|
scopeId: z.ZodString;
|
|
732
657
|
deviceId: z.ZodString;
|
|
733
658
|
agentRef: z.ZodString;
|
|
@@ -751,9 +676,10 @@ export declare const InputPreparationBindingSchema: z.ZodObject<{
|
|
|
751
676
|
runtime: z.ZodObject<{
|
|
752
677
|
packageName: z.ZodString;
|
|
753
678
|
packageVersion: z.ZodString;
|
|
754
|
-
|
|
679
|
+
tarballIntegrity: z.ZodString;
|
|
680
|
+
provenanceDigest: z.ZodString;
|
|
681
|
+
closureDigest: z.ZodString;
|
|
755
682
|
upstreamCommit: z.ZodString;
|
|
756
|
-
forkBuild: z.ZodNumber;
|
|
757
683
|
envelopeFormat: z.ZodString;
|
|
758
684
|
requestFormat: z.ZodString;
|
|
759
685
|
compilerVersion: z.ZodNumber;
|
|
@@ -787,6 +713,11 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
|
|
|
787
713
|
reserved: "reserved";
|
|
788
714
|
}>;
|
|
789
715
|
binding: z.ZodObject<{
|
|
716
|
+
agentMemory: z.ZodEnum<{
|
|
717
|
+
none: "none";
|
|
718
|
+
read: "read";
|
|
719
|
+
"read-write": "read-write";
|
|
720
|
+
}>;
|
|
790
721
|
scopeId: z.ZodString;
|
|
791
722
|
deviceId: z.ZodString;
|
|
792
723
|
agentRef: z.ZodString;
|
|
@@ -810,9 +741,10 @@ export declare const InputPreparationReceiptSummarySchema: z.ZodObject<{
|
|
|
810
741
|
runtime: z.ZodObject<{
|
|
811
742
|
packageName: z.ZodString;
|
|
812
743
|
packageVersion: z.ZodString;
|
|
813
|
-
|
|
744
|
+
tarballIntegrity: z.ZodString;
|
|
745
|
+
provenanceDigest: z.ZodString;
|
|
746
|
+
closureDigest: z.ZodString;
|
|
814
747
|
upstreamCommit: z.ZodString;
|
|
815
|
-
forkBuild: z.ZodNumber;
|
|
816
748
|
envelopeFormat: z.ZodString;
|
|
817
749
|
requestFormat: z.ZodString;
|
|
818
750
|
compilerVersion: z.ZodNumber;
|
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<{
|
|
@@ -1038,6 +1043,11 @@ export type AgentHomeProjectionPayload = z.infer<typeof AgentHomeProjectionPaylo
|
|
|
1038
1043
|
* in the artifact binding; it is not a grant, and it authorizes nothing.
|
|
1039
1044
|
*/
|
|
1040
1045
|
export declare const AgentInputPreparationPayloadSchema: z.ZodObject<{
|
|
1046
|
+
agentMemory: z.ZodEnum<{
|
|
1047
|
+
none: "none";
|
|
1048
|
+
read: "read";
|
|
1049
|
+
"read-write": "read-write";
|
|
1050
|
+
}>;
|
|
1041
1051
|
requestId: z.ZodUUID;
|
|
1042
1052
|
agentRef: z.ZodObject<{
|
|
1043
1053
|
agentId: z.ZodString;
|
|
@@ -2247,6 +2257,11 @@ declare const TASK_OFFER_PAYLOAD_SCHEMAS: {
|
|
|
2247
2257
|
requestDigest: z.ZodString;
|
|
2248
2258
|
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
2249
2259
|
}, z.core.$strict>;
|
|
2260
|
+
agentMemory: z.ZodEnum<{
|
|
2261
|
+
none: "none";
|
|
2262
|
+
read: "read";
|
|
2263
|
+
"read-write": "read-write";
|
|
2264
|
+
}>;
|
|
2250
2265
|
egressPolicy: z.ZodObject<{
|
|
2251
2266
|
policyRevision: z.ZodString;
|
|
2252
2267
|
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2774,6 +2789,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
2774
2789
|
requestDigest: z.ZodString;
|
|
2775
2790
|
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
2776
2791
|
}, z.core.$strict>;
|
|
2792
|
+
agentMemory: z.ZodEnum<{
|
|
2793
|
+
none: "none";
|
|
2794
|
+
read: "read";
|
|
2795
|
+
"read-write": "read-write";
|
|
2796
|
+
}>;
|
|
2777
2797
|
egressPolicy: z.ZodObject<{
|
|
2778
2798
|
policyRevision: z.ZodString;
|
|
2779
2799
|
activity: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3067,6 +3087,11 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
3067
3087
|
projection: z.ZodType<import("./agent-home-projection").AgentHomeProjectionValue, unknown, z.core.$ZodTypeInternals<import("./agent-home-projection").AgentHomeProjectionValue, unknown>>;
|
|
3068
3088
|
}, z.core.$strict>;
|
|
3069
3089
|
readonly 'agent.input.preparation': z.ZodObject<{
|
|
3090
|
+
agentMemory: z.ZodEnum<{
|
|
3091
|
+
none: "none";
|
|
3092
|
+
read: "read";
|
|
3093
|
+
"read-write": "read-write";
|
|
3094
|
+
}>;
|
|
3070
3095
|
requestId: z.ZodUUID;
|
|
3071
3096
|
agentRef: z.ZodObject<{
|
|
3072
3097
|
agentId: z.ZodString;
|
|
@@ -3184,6 +3209,9 @@ export declare const MESSAGE_PAYLOAD_SCHEMAS: {
|
|
|
3184
3209
|
ruledResidualKeys: z.ZodArray<z.ZodString>;
|
|
3185
3210
|
}, z.core.$strict>>;
|
|
3186
3211
|
}, z.core.$strict>;
|
|
3212
|
+
readonly 'provider.provisioning.available': z.ZodObject<{
|
|
3213
|
+
requestId: z.ZodUUID;
|
|
3214
|
+
}, z.core.$strict>;
|
|
3187
3215
|
readonly 'task.approve': z.ZodObject<{
|
|
3188
3216
|
approvalId: z.ZodOptional<z.ZodString>;
|
|
3189
3217
|
}, z.core.$strip>;
|
|
@@ -3425,7 +3453,7 @@ export declare const MESSAGE_TYPES: MessageType[];
|
|
|
3425
3453
|
* (`envelope.ts`) to decide which branches require envelope `seq` (M1
|
|
3426
3454
|
* redelivery cursor).
|
|
3427
3455
|
*/
|
|
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"];
|
|
3456
|
+
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", "task.approve", "task.reject", "task.cancel", "task.steer"];
|
|
3429
3457
|
/**
|
|
3430
3458
|
* Message types the daemon sends to the server — the flip side of
|
|
3431
3459
|
* {@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"];
|
|
111
111
|
export type CapabilityFlag = (typeof CAPABILITY_FLAGS)[number];
|