@byok-sdk/server 0.23.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 +32 -22
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/stores/sqlite/index.d.ts +3 -2
- package/dist/types.d.ts +11 -4
- package/package.json +5 -5
|
@@ -5,7 +5,7 @@ import type { DatabaseSync } from 'node:sqlite';
|
|
|
5
5
|
export interface SqliteEmbeddedStoreOptions {
|
|
6
6
|
readonly path: string;
|
|
7
7
|
readonly urlTtlMs?: number;
|
|
8
|
-
readonly migration?: 'v1-to-
|
|
8
|
+
readonly migration?: 'v1-to-v4' | 'v2-to-v4' | 'v3-to-v4';
|
|
9
9
|
}
|
|
10
10
|
export interface SqliteEmbeddedStores {
|
|
11
11
|
readonly core: CoreStores;
|
|
@@ -17,7 +17,7 @@ export interface SqliteEmbeddedStores {
|
|
|
17
17
|
declare class SqliteCoordinator {
|
|
18
18
|
#private;
|
|
19
19
|
readonly db: DatabaseSync;
|
|
20
|
-
constructor(path: string, migration?: 'v1-to-
|
|
20
|
+
constructor(path: string, migration?: 'v1-to-v4' | 'v2-to-v4' | 'v3-to-v4');
|
|
21
21
|
run<T>(operation: (db: DatabaseSync) => T | Promise<T>): Promise<T>;
|
|
22
22
|
transaction<T>(operation: (db: DatabaseSync) => T | Promise<T>): Promise<T>;
|
|
23
23
|
close(): Promise<void>;
|
|
@@ -70,6 +70,7 @@ export declare class SqliteTaskAttemptStore implements TaskAttemptStore {
|
|
|
70
70
|
taskId: string;
|
|
71
71
|
deviceId: string;
|
|
72
72
|
runtime?: RuntimeId;
|
|
73
|
+
harnessId?: string;
|
|
73
74
|
capabilities?: RuntimeCapabilities;
|
|
74
75
|
}): Promise<TaskAttempt | undefined>;
|
|
75
76
|
recordStatus(tenant: TenantId, input: {
|
package/dist/types.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ export type ByokServerStorage = {
|
|
|
11
11
|
readonly path: string;
|
|
12
12
|
/** Lifetime of signed blob upload/download URLs. Default 15 minutes. */
|
|
13
13
|
readonly urlTtlMs?: number;
|
|
14
|
-
/** One-shot adoption
|
|
15
|
-
readonly migration?: 'v1-to-
|
|
14
|
+
/** One-shot schema adoption: v1/v2 require no task history; v3 requires no ambiguous claimed identity. Stop all writers and back up first; old builds cannot reopen v4. */
|
|
15
|
+
readonly migration?: 'v1-to-v4' | 'v2-to-v4' | 'v3-to-v4';
|
|
16
16
|
};
|
|
17
17
|
/** Options for {@link createByokServer}. */
|
|
18
18
|
export interface CreateByokServerOptions {
|
|
@@ -48,8 +48,9 @@ export interface CreateByokServerOptions {
|
|
|
48
48
|
/**
|
|
49
49
|
* How long after a task reaches a terminal its relay buffer and terminal
|
|
50
50
|
* promise are RETAINED before being reclaimed, ms. A late `events()` reader
|
|
51
|
-
* within this window still replays the
|
|
52
|
-
*
|
|
51
|
+
* within this window still replays the retained feed; past it, new event
|
|
52
|
+
* reads complete empty. Use the durable read model (`tasks.get`, `result()`)
|
|
53
|
+
* for terminal facts after expiry. Default 5 minutes.
|
|
53
54
|
*
|
|
54
55
|
* Retention never decides when a feed ENDS: {@link TaskHandle.events}
|
|
55
56
|
* completes at the terminal event itself, whenever that happens, so a
|
|
@@ -238,6 +239,12 @@ export type ServerTaskEvent = {
|
|
|
238
239
|
/** Handle returned by {@link ByokServer.dispatch} for one in-flight task. */
|
|
239
240
|
export interface TaskHandle {
|
|
240
241
|
readonly taskId: string;
|
|
242
|
+
/**
|
|
243
|
+
* Replay retained notifications and follow live updates until terminal.
|
|
244
|
+
* New reads after terminal retention expires or the server stops complete
|
|
245
|
+
* empty; they never reopen a feed. Durable terminal facts remain available
|
|
246
|
+
* through `result()` and `ByokServer.tasks.get`.
|
|
247
|
+
*/
|
|
241
248
|
events(): AsyncIterable<ServerTaskEvent>;
|
|
242
249
|
cancel(reason?: string): Promise<void>;
|
|
243
250
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byok-sdk/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "BYOK SDK server: in-memory M0 reference implementation of the SaaS-side coordinator",
|
|
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",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"clean": "rm -rf dist"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@byok-sdk/cloud": "0.
|
|
48
|
-
"@byok-sdk/core": "0.
|
|
49
|
-
"@byok-sdk/protocol": "0.
|
|
47
|
+
"@byok-sdk/cloud": "0.24.0",
|
|
48
|
+
"@byok-sdk/core": "0.24.0",
|
|
49
|
+
"@byok-sdk/protocol": "0.24.0",
|
|
50
50
|
"@hono/node-server": "^2.0.10",
|
|
51
51
|
"hono": "^4.12.30"
|
|
52
52
|
},
|