@byok-sdk/client 0.8.0 → 0.8.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 +15 -0
- package/dist/agent-home.d.ts +24 -4
- package/dist/bin/byok-agent.js +2432 -1716
- package/dist/bin/byok-agent.js.map +1 -1
- package/dist/bin/byok-approval-mcp.js.map +1 -1
- package/dist/bin/commands/pair.d.ts +3 -0
- package/dist/daemon/auth-manager.d.ts +8 -0
- package/dist/daemon/control-protocol.d.ts +11 -0
- package/dist/daemon/create-daemon.d.ts +19 -2
- package/dist/daemon/daemon-owner.d.ts +9 -0
- package/dist/daemon/device-credential-store.d.ts +58 -0
- package/dist/daemon/device-proof-signer.d.ts +5 -4
- package/dist/daemon/path-mutation-gate.d.ts +25 -0
- package/dist/daemon/store.d.ts +45 -24
- package/dist/daemon/task-runner.d.ts +9 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3888 -2981
- package/dist/index.js.map +1 -1
- package/dist/local-state-relocation.d.ts +24 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -108,6 +108,14 @@ createDaemon({
|
|
|
108
108
|
});
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
+
For task-free desired-state projection, use
|
|
112
|
+
`createAgentHomeProjectionConsumer`. Its hook must atomically and idempotently
|
|
113
|
+
ensure its opaque product bytes. BYOK may invoke it again under the same
|
|
114
|
+
canonical-home writer lease when a new request carries the exact current
|
|
115
|
+
revision/hash; the terminal outcome remains `idempotent`. This permits repair
|
|
116
|
+
of locally lost derived files without giving the SDK product path or schema
|
|
117
|
+
knowledge. Stale and same-revision/different-hash requests do not invoke it.
|
|
118
|
+
|
|
111
119
|
Startup materializes and write-probes the canonical root before publishing
|
|
112
120
|
`agent-home-contract`. `agentHome` and `gitWorkspace` are mutually exclusive;
|
|
113
121
|
strict Agent execution has one workspace authority and never falls back to a
|
|
@@ -131,6 +139,13 @@ keeps runtime activity metadata/status-only; enabling it is an explicit product
|
|
|
131
139
|
decision and requires the server capability. Reliable events are fsynced under
|
|
132
140
|
the canonical Agent home and retire only after an exact ack.
|
|
133
141
|
|
|
142
|
+
Hosts that need cold setup or diagnostic state use
|
|
143
|
+
`readDeviceEnrollmentStatus({ productId, storeDir })`. It validates the
|
|
144
|
+
complete SDK-owned record but returns only `unpaired`, `paired` with
|
|
145
|
+
`deviceId`, or `re_pair_required`; tenant, token, expiry and device keys are
|
|
146
|
+
never projected. Only explicit pairing may replace `re_pair_required` state,
|
|
147
|
+
while filesystem-safety failures remain errors.
|
|
148
|
+
|
|
134
149
|
```ts
|
|
135
150
|
createDaemon({
|
|
136
151
|
// ...normal device, transport and agentHome configuration
|
package/dist/agent-home.d.ts
CHANGED
|
@@ -48,7 +48,11 @@ export interface AgentHomeProjectionApplyInput extends AgentHomeProjectionInput
|
|
|
48
48
|
export interface AgentHomeProjection {
|
|
49
49
|
/** Optional creation/task-time host preparation retained as a distinct lifecycle. */
|
|
50
50
|
prepare?(input: AgentHomeProjectionInput): void | Promise<void>;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Task-free opaque desired-state consumer. It must atomically and
|
|
53
|
+
* idempotently ensure its own durable bytes because exact revision/hash
|
|
54
|
+
* requests may replay after local derived-file loss or transport failure.
|
|
55
|
+
*/
|
|
52
56
|
apply?(input: AgentHomeProjectionApplyInput): void | Promise<void>;
|
|
53
57
|
}
|
|
54
58
|
export type AgentHomeProjectionFunction = (input: AgentHomeProjectionInput) => void | Promise<void>;
|
|
@@ -82,7 +86,15 @@ export declare class AgentHomeLayout {
|
|
|
82
86
|
* file is created by this preflight.
|
|
83
87
|
*/
|
|
84
88
|
preflight(): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Construction-time validation is deliberately non-mutating. The actual
|
|
91
|
+
* writable preflight runs asynchronously after daemon ownership is acquired
|
|
92
|
+
* and before transport/capability publication, where it can participate in
|
|
93
|
+
* the cross-process relocation gate without a sync shadow lock.
|
|
94
|
+
*/
|
|
95
|
+
preflightSync(): void;
|
|
85
96
|
private resolveRoot;
|
|
97
|
+
private acquireRootMutationGate;
|
|
86
98
|
}
|
|
87
99
|
export declare function stableAgentHomeOwnerId(storeDir: string, productId: string): string;
|
|
88
100
|
/** One-writer lease backed by both a process registry and an exclusive marker. */
|
|
@@ -108,6 +120,8 @@ export declare class AgentHomeManager {
|
|
|
108
120
|
prepare(agentRef: AgentRef): Promise<AgentHomeBinding>;
|
|
109
121
|
/** Validate the configured root before capability publication. */
|
|
110
122
|
preflight(): Promise<void>;
|
|
123
|
+
/** Synchronous construction-time preflight for strict Agent-only admission. */
|
|
124
|
+
preflightSync(): void;
|
|
111
125
|
/** Resolve and lease without applying downstream projection side effects. */
|
|
112
126
|
acquire(agentRef: AgentRef): Promise<AgentHomeBinding>;
|
|
113
127
|
/** Initialize only after any requested session exact-match has succeeded. */
|
|
@@ -115,11 +129,17 @@ export declare class AgentHomeManager {
|
|
|
115
129
|
supportsTaskFreeProjection(): boolean;
|
|
116
130
|
/**
|
|
117
131
|
* Apply one task-free projection under the same canonical-home writer lease
|
|
118
|
-
* used by Agent execution.
|
|
119
|
-
*
|
|
132
|
+
* used by Agent execution. The host hook owns an atomic/idempotent ensure of
|
|
133
|
+
* its opaque product bytes, so an exact desired-state replay invokes it again
|
|
134
|
+
* before returning `idempotent`. Only a successful new-state hook followed
|
|
135
|
+
* by the SDK-owned fsynced ordering record can return `applied`.
|
|
120
136
|
*/
|
|
121
137
|
project(input: AgentHomeProjectionPayload): Promise<AgentHomeProjectionOutcome>;
|
|
122
138
|
}
|
|
123
139
|
export declare function createAgentHomeProjection(prepare: AgentHomeProjectionFunction): AgentHomeProjection;
|
|
124
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* Create the task-free atomic/idempotent opaque desired-state consumer.
|
|
142
|
+
* Exact revision/hash delivery may invoke it again before an idempotent receipt;
|
|
143
|
+
* no task-time fallback is inferred.
|
|
144
|
+
*/
|
|
125
145
|
export declare function createAgentHomeProjectionConsumer(apply: AgentHomeProjectionApplyFunction): AgentHomeProjection;
|