@byok-sdk/server 0.8.0-beta.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/dist/hub.d.ts +15 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +2012 -1899
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/package.json +3 -3
package/dist/hub.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WebSocket } from 'ws';
|
|
2
|
-
import { type Envelope, type RuntimeId, type RuntimeInfo, type TaskState, type ToolsetId } from '@byok-sdk/protocol';
|
|
2
|
+
import { type Envelope, type AgentHomeProjectionCompletionRequest, type AgentHomeProjectionReadback, type RuntimeId, type RuntimeInfo, type TaskState, type ToolsetId } from '@byok-sdk/protocol';
|
|
3
3
|
import type { DeviceRegistry } from './auth';
|
|
4
4
|
import { RateLimiter } from './rate-limiter';
|
|
5
5
|
import type { TaskStore } from './task-store';
|
|
6
|
-
import type { ByokServerEvent, AgentContentReadRequest, AgentEgressReceipt, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, TaskHandle, TaskSnapshot } from './types';
|
|
6
|
+
import type { ByokServerEvent, AgentContentReadRequest, AgentHomeProjectionRequest, AgentEgressReceipt, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, TaskHandle, TaskSnapshot } from './types';
|
|
7
7
|
/**
|
|
8
8
|
* The connection hub: tracks each device's live transport (WS or long-poll —
|
|
9
9
|
* never both at once, see {@link takeOverAsLongPoll}), routes `dispatch()`'d
|
|
@@ -189,6 +189,11 @@ export declare class SteerRejectedError extends Error {
|
|
|
189
189
|
/** `TaskSnapshot.claimedRuntime` — `undefined` when nothing was ever recorded (which is itself a reason `steer_unsupported_runtime` can fire). */
|
|
190
190
|
runtime: RuntimeId | undefined);
|
|
191
191
|
}
|
|
192
|
+
export type AgentHomeProjectionCompletionErrorCode = 'not_found' | 'conflict' | 'invalid';
|
|
193
|
+
export declare class AgentHomeProjectionCompletionError extends Error {
|
|
194
|
+
readonly code: AgentHomeProjectionCompletionErrorCode;
|
|
195
|
+
constructor(code: AgentHomeProjectionCompletionErrorCode, message: string);
|
|
196
|
+
}
|
|
192
197
|
export declare class ConnectionHub {
|
|
193
198
|
private readonly taskStore;
|
|
194
199
|
private readonly devices;
|
|
@@ -217,6 +222,10 @@ export declare class ConnectionHub {
|
|
|
217
222
|
private readonly agentContentReadRequests;
|
|
218
223
|
/** Content-free explicit-read audit facts keyed by exact authenticated device/request identity. */
|
|
219
224
|
private readonly agentContentReceipts;
|
|
225
|
+
/** Immutable requested projection facts, keyed by authenticated device/request. */
|
|
226
|
+
private readonly agentHomeProjectionRequests;
|
|
227
|
+
/** First terminal completion for each exact projection request. */
|
|
228
|
+
private readonly agentHomeProjectionCompletions;
|
|
220
229
|
/**
|
|
221
230
|
* Per-task last-inbound-activity timestamp (epoch ms) — the task-lease
|
|
222
231
|
* reaper's condition (c), see the "task-lease reaper" section below. Reset
|
|
@@ -753,6 +762,10 @@ export declare class ConnectionHub {
|
|
|
753
762
|
private dispatchInternal;
|
|
754
763
|
/** Capability-gated control-plane read request; no request enters the outbox on omission. */
|
|
755
764
|
requestAgentContentRead(input: AgentContentReadRequest): Promise<void>;
|
|
765
|
+
/** Task-free exact-device projection; no task record, runtime or session is created. */
|
|
766
|
+
enqueueAgentHomeProjection(input: AgentHomeProjectionRequest): Promise<AgentHomeProjectionReadback>;
|
|
767
|
+
readAgentHomeProjection(deviceId: string, requestId: string): AgentHomeProjectionReadback | undefined;
|
|
768
|
+
completeAgentHomeProjection(deviceId: string, input: AgentHomeProjectionCompletionRequest): AgentHomeProjectionReadback;
|
|
756
769
|
private buildTaskHandle;
|
|
757
770
|
/** Idempotent: cancelling an already-terminal task is a no-op, not an error. */
|
|
758
771
|
private cancelTask;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Server as HttpServer } from 'node:http';
|
|
|
2
2
|
import type { Hono } from 'hono';
|
|
3
3
|
import { type TenantId } from './auth';
|
|
4
4
|
import { type PairingCodeClaims, type PairingCodeInfo } from './pairing';
|
|
5
|
-
import type { ByokServerEvent, AgentContentReadRequest, AgentEgressReceipt, CreateByokServerOptions, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, TaskHandle, TaskSnapshot } from './types';
|
|
6
|
-
export type { ByokServerEvent, AgentContentReadRequest, AgentEgressReceipt, CreateByokServerOptions, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, ServerTaskEvent, TaskHandle, TaskResult, TaskSnapshot, } from './types';
|
|
5
|
+
import type { ByokServerEvent, AgentContentReadRequest, AgentHomeProjectionRequest, AgentHomeProjectionStatusReadback, AgentEgressReceipt, CreateByokServerOptions, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, TaskHandle, TaskSnapshot } from './types';
|
|
6
|
+
export type { ByokServerEvent, AgentContentReadRequest, AgentHomeProjectionRequest, AgentHomeProjectionStatusReadback, AgentEgressReceipt, CreateByokServerOptions, DispatchInput, FreshAgentEgressDispatchInput, HubStats, MachineInfo, ServerTaskEvent, TaskHandle, TaskResult, TaskSnapshot, } from './types';
|
|
7
7
|
export type { CreateTaskInput, TaskRecord, TaskStore } from './task-store';
|
|
8
8
|
export { IllegalTaskTransitionError, InMemoryTaskStore } from './task-store';
|
|
9
9
|
/**
|
|
@@ -24,6 +24,8 @@ export { StaleApprovalError } from './hub';
|
|
|
24
24
|
*/
|
|
25
25
|
export { SteerRejectedError } from './hub';
|
|
26
26
|
export type { SteerRejectionCode } from './hub';
|
|
27
|
+
export { AgentHomeProjectionCompletionError } from './hub';
|
|
28
|
+
export type { AgentHomeProjectionCompletionErrorCode } from './hub';
|
|
27
29
|
export { PairingCodeInvalidError } from './pairing';
|
|
28
30
|
export type { PairingCodeClaims, PairingCodeInfo } from './pairing';
|
|
29
31
|
export type { AccessTokenClaims, AuthenticatedDevice, DeviceRecord, TenantId, TokenSigner, } from './auth';
|
|
@@ -64,6 +66,10 @@ export interface ByokServer {
|
|
|
64
66
|
dispatchFreshAgentEgress(input: FreshAgentEgressDispatchInput): Promise<TaskHandle>;
|
|
65
67
|
/** Enqueue one capability-gated, exact-identity content-read request. */
|
|
66
68
|
requestAgentContentRead(input: AgentContentReadRequest): Promise<void>;
|
|
69
|
+
/** Enqueue one task-free, exact-device Agent-home projection. */
|
|
70
|
+
enqueueAgentHomeProjection(input: AgentHomeProjectionRequest): Promise<AgentHomeProjectionStatusReadback>;
|
|
71
|
+
/** Reference-only in-process status readback; production durability belongs to @byok-sdk/cloud stores. */
|
|
72
|
+
readAgentHomeProjection(deviceId: string, requestId: string): AgentHomeProjectionStatusReadback | undefined;
|
|
67
73
|
tasks: {
|
|
68
74
|
get(taskId: string): TaskSnapshot | undefined;
|
|
69
75
|
list(): TaskSnapshot[];
|