yaml-flow 8.8.7 → 8.9.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/browser/adapters/firestore-storage.js +2 -2
- package/browser/adapters/localstorage-storage.js +3 -3
- package/browser/asset-integrity.json +7 -7
- package/browser/server-runtime-controlface.js +5 -5
- package/examples/board/test/server-http-test-browser.ts +2394 -0
- package/examples/board/test/server-http-test.js +44 -35
- package/lib/{artifacts-store-lib-C6qBpMfU.d.cts → artifacts-store-lib-CqkJEgbx.d.cts} +1 -1
- package/lib/{artifacts-store-lib-D4qf7Q-7.d.ts → artifacts-store-lib-D6Bo4yFN.d.ts} +1 -1
- package/lib/artifacts-store-public.d.cts +5 -3
- package/lib/artifacts-store-public.d.ts +5 -3
- package/lib/board-callback-transport-Bekq8Gp-.d.ts +71 -0
- package/lib/board-callback-transport-kP0K6UMq.d.cts +71 -0
- package/lib/board-live-cards-lib-DVh3t9NT.d.cts +222 -0
- package/lib/board-live-cards-lib-iU8xOwNp.d.ts +222 -0
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.d.cts +4 -8
- package/lib/board-live-cards-mcp.d.ts +4 -8
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +7 -7
- package/lib/board-live-cards-node.d.cts +15 -11
- package/lib/board-live-cards-node.d.ts +15 -11
- package/lib/board-live-cards-node.js +7 -7
- package/lib/{board-live-cards-public-async-CYjr4mgX.d.cts → board-live-cards-public-async-Cl0M3j5P.d.cts} +6 -4
- package/lib/{board-live-cards-public-async-DlyC3PgC.d.ts → board-live-cards-public-async-U98IXUBx.d.ts} +6 -4
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +325 -3
- package/lib/board-live-cards-public.d.ts +325 -3
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +1 -1
- package/lib/board-live-cards-server-runtime.d.cts +8 -6
- package/lib/board-live-cards-server-runtime.d.ts +8 -6
- package/lib/board-live-cards-server-runtime.js +1 -1
- package/lib/{board-platform-adapter-async-JP9V-U5E.d.ts → board-platform-adapter-async-ByBRFn1G.d.ts} +4 -3
- package/lib/{board-platform-adapter-async-BZIftm36.d.cts → board-platform-adapter-async-DjBwE0m9.d.cts} +4 -3
- package/lib/board-state-reducer.cjs +2 -0
- package/lib/board-state-reducer.d.cts +53 -0
- package/lib/board-state-reducer.d.ts +53 -0
- package/lib/board-state-reducer.js +2 -0
- package/lib/card-store-public.cjs +1 -1
- package/lib/card-store-public.d.cts +11 -4
- package/lib/card-store-public.d.ts +11 -4
- package/lib/card-store-public.js +1 -1
- package/lib/chat-store-public.cjs +1 -1
- package/lib/chat-store-public.d.cts +15 -4
- package/lib/chat-store-public.d.ts +15 -4
- package/lib/chat-store-public.js +1 -1
- package/lib/chunk-2RIHC5TZ.cjs +2 -0
- package/lib/chunk-37FDOKDK.js +3 -0
- package/lib/chunk-3S7LV2HZ.cjs +2 -0
- package/lib/chunk-3T5TMAWG.cjs +3 -0
- package/lib/chunk-5XLFPPTY.cjs +2 -0
- package/lib/{chunk-R44X3RQB.cjs → chunk-6EJRZHFP.cjs} +2 -2
- package/lib/{chunk-NNSBBO5R.js → chunk-6MD6FVE3.js} +2 -2
- package/lib/chunk-7QNEV5S3.js +2 -0
- package/lib/{chunk-6OPXQPSC.js → chunk-7UJQMFVS.js} +2 -2
- package/lib/chunk-BJGK5FNL.js +2 -0
- package/lib/{chunk-ETW3BXHD.cjs → chunk-BQJVCCFU.cjs} +2 -2
- package/lib/chunk-DQPBAB5Z.cjs +2 -0
- package/lib/chunk-JB4Q2W7I.js +7 -0
- package/lib/chunk-JYVYAAXT.js +3 -0
- package/lib/chunk-LFVMX23W.cjs +7 -0
- package/lib/chunk-NIBLKYXN.js +2 -0
- package/lib/chunk-OF4FPYNI.cjs +2 -0
- package/lib/chunk-P3R6TXII.js +3 -0
- package/lib/{chunk-7BTZCOT5.js → chunk-QLB6PKOT.js} +2 -2
- package/lib/chunk-R4YASXSJ.js +2 -0
- package/lib/chunk-RZRIXQ6A.cjs +3 -0
- package/lib/chunk-SDJ3747Q.cjs +2 -0
- package/lib/chunk-SJANU3PL.cjs +3 -0
- package/lib/chunk-UGB7PC4P.js +2 -0
- package/lib/chunk-VBYNMTWC.js +2 -0
- package/lib/{chunk-37HDEW26.cjs → chunk-WRMOGPRG.cjs} +2 -2
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.d.cts +44 -8
- package/lib/cloud-storage.d.ts +44 -8
- package/lib/cloud-storage.js +1 -1
- package/lib/firebase-storage/index.d.cts +2 -2
- package/lib/firebase-storage/index.d.ts +2 -2
- package/lib/firestore-storage/index.cjs +2 -2
- package/lib/firestore-storage/index.d.cts +6 -5
- package/lib/firestore-storage/index.d.ts +6 -5
- package/lib/firestore-storage/index.js +2 -2
- package/lib/index.cjs +2 -2
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +1 -1
- package/lib/localstorage-storage/index.d.cts +6 -5
- package/lib/localstorage-storage/index.d.ts +6 -5
- package/lib/localstorage-storage/index.js +1 -1
- package/lib/notification-consumer/index.cjs +2 -0
- package/lib/notification-consumer/index.d.cts +17 -0
- package/lib/notification-consumer/index.d.ts +17 -0
- package/lib/notification-consumer/index.js +2 -0
- package/lib/queue-storage-public.cjs +2 -0
- package/lib/queue-storage-public.d.cts +13 -0
- package/lib/queue-storage-public.d.ts +13 -0
- package/lib/queue-storage-public.js +2 -0
- package/lib/server-jobs-queue-runner/index.cjs +1 -1
- package/lib/server-jobs-queue-runner/index.d.cts +9 -7
- package/lib/server-jobs-queue-runner/index.d.ts +9 -7
- package/lib/server-jobs-queue-runner/index.js +1 -1
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +9 -7
- package/lib/server-runtime/index.d.ts +9 -7
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.d.cts +8 -6
- package/lib/server-runtime-agentface/index.d.ts +8 -6
- package/lib/server-runtime-controlface/index.cjs +1 -1
- package/lib/server-runtime-controlface/index.d.cts +8 -6
- package/lib/server-runtime-controlface/index.d.ts +8 -6
- package/lib/server-runtime-controlface/index.js +1 -1
- package/lib/server-runtime-core/index.cjs +1 -1
- package/lib/server-runtime-core/index.d.cts +16 -37
- package/lib/server-runtime-core/index.d.ts +16 -37
- package/lib/server-runtime-core/index.js +1 -1
- package/lib/server-runtime-watchers/index.cjs +1 -1
- package/lib/server-runtime-watchers/index.d.cts +11 -8
- package/lib/server-runtime-watchers/index.d.ts +11 -8
- package/lib/server-runtime-watchers/index.js +1 -1
- package/lib/server-runtime-webhooks/index.d.cts +8 -6
- package/lib/server-runtime-webhooks/index.d.ts +8 -6
- package/lib/{sse-hub-DM8bw-dO.d.ts → sse-hub-BRBvymHR.d.cts} +18 -15
- package/lib/{sse-hub-BDjWI7JR.d.cts → sse-hub-D_94fV87.d.ts} +18 -15
- package/lib/step-machine-public/index.d.cts +1 -1
- package/lib/step-machine-public/index.d.ts +1 -1
- package/lib/{storage-async-interface-CyO-zwVQ.d.cts → storage-async-interface-CLOXiqwC.d.cts} +2 -2
- package/lib/{storage-async-interface-CG0bMqvE.d.ts → storage-async-interface-Cb-SULrI.d.ts} +2 -2
- package/lib/{storage-interface-D-iEiTJA.d.cts → storage-interface-DogVPooM.d.cts} +1 -1
- package/lib/{storage-interface-D-iEiTJA.d.ts → storage-interface-DogVPooM.d.ts} +1 -1
- package/lib/stores/index.d.cts +1 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/kv.d.cts +1 -1
- package/lib/stores/kv.d.ts +1 -1
- package/lib/{types-BsfXZyI3.d.ts → types-BsqzUZNl.d.ts} +6 -4
- package/lib/{types-CPnYv7RC.d.cts → types-DxhB6Toz.d.cts} +6 -4
- package/package.json +16 -1
- package/lib/board-live-cards-public-BT5HrgqZ.d.cts +0 -529
- package/lib/board-live-cards-public-DSRamFm8.d.ts +0 -529
- package/lib/chunk-35N7ONTH.js +0 -2
- package/lib/chunk-36QUKFL7.cjs +0 -3
- package/lib/chunk-3MMTBEAO.js +0 -2
- package/lib/chunk-7QQFDYBM.js +0 -3
- package/lib/chunk-7QZ267XP.cjs +0 -2
- package/lib/chunk-ABAVFLDP.js +0 -7
- package/lib/chunk-EPCJYP4N.js +0 -3
- package/lib/chunk-H22NK6KH.cjs +0 -7
- package/lib/chunk-KBELAKIY.js +0 -2
- package/lib/chunk-OJ2CAQ4C.cjs +0 -2
- package/lib/chunk-Q3OTUDIE.js +0 -2
- package/lib/chunk-QG6ERLZQ.cjs +0 -3
- package/lib/chunk-UB54HZA4.cjs +0 -2
- package/lib/chunk-YMEIPKLW.cjs +0 -2
- package/lib/chunk-ZENTBLLA.cjs +0 -3
- package/lib/chunk-ZWVT24YW.js +0 -3
|
@@ -1,529 +0,0 @@
|
|
|
1
|
-
import { g as JournalStorage, K as KVStorage, B as BlobStorage, S as ScratchStorage, A as ArchiveFactory, f as QueueStorage, h as AtomicRelayLock, a as KindValueRef } from './storage-interface-D-iEiTJA.cjs';
|
|
2
|
-
import { ExecutionRef } from './execution-refs.cjs';
|
|
3
|
-
import { f as GraphEvent, G as GraphConfig } from './types-BBhqYGhE.cjs';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* board-live-cards-lib — Pure logic library for the board-live-cards CLI.
|
|
7
|
-
*
|
|
8
|
-
* Merged from:
|
|
9
|
-
* board-live-cards-all-stores.ts
|
|
10
|
-
* board-live-cards-lib-types.ts
|
|
11
|
-
* board-live-cards-lib-board-status.ts
|
|
12
|
-
* board-live-cards-lib-card-handler.ts
|
|
13
|
-
* board-live-cards-cli-board-commands.ts
|
|
14
|
-
* board-live-cards-cli-card-commands.ts
|
|
15
|
-
* board-live-cards-cli-callbacks.ts
|
|
16
|
-
*
|
|
17
|
-
* Zero platform imports. All storage is injected via adapter interfaces.
|
|
18
|
-
* Safe for Node, browser, and neutral (V8/PyMiniRacer) bundles.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
interface LiveCard {
|
|
22
|
-
id: string;
|
|
23
|
-
[key: string]: unknown;
|
|
24
|
-
}
|
|
25
|
-
interface CardIndexEntry {
|
|
26
|
-
/** Storage-specific address (file path, Cosmos doc id, localStorage key). */
|
|
27
|
-
key: string;
|
|
28
|
-
/** Checksum of card content — computed by the adapter at write time. */
|
|
29
|
-
checksum: string;
|
|
30
|
-
updatedAt: string;
|
|
31
|
-
}
|
|
32
|
-
type CardIndex = Record<string, CardIndexEntry>;
|
|
33
|
-
type CardChecksumIndex = Record<string, string>;
|
|
34
|
-
interface CardStorageAdapter {
|
|
35
|
-
readIndex(): CardIndex | null;
|
|
36
|
-
writeIndex(index: CardIndex): void;
|
|
37
|
-
readCard(key: string): LiveCard | null;
|
|
38
|
-
/** Write card content; returns checksum of what was written. */
|
|
39
|
-
writeCard(key: string, card: LiveCard): string;
|
|
40
|
-
removeCard(key: string): void;
|
|
41
|
-
cardExists(key: string): boolean;
|
|
42
|
-
defaultCardKey(cardId: string): string;
|
|
43
|
-
}
|
|
44
|
-
interface CardStore {
|
|
45
|
-
readCard(id: string): LiveCard | null;
|
|
46
|
-
readCardKey(id: string): string | null;
|
|
47
|
-
readAllCards(): LiveCard[];
|
|
48
|
-
readChecksumIndex(): CardChecksumIndex;
|
|
49
|
-
changedSince(snapshotChecksumIndex: CardChecksumIndex): string[];
|
|
50
|
-
}
|
|
51
|
-
interface CardUpsertValidation {
|
|
52
|
-
ok: boolean;
|
|
53
|
-
error?: string;
|
|
54
|
-
}
|
|
55
|
-
interface CardAdminStore extends CardStore {
|
|
56
|
-
validateUpsert(id: string, cardKey: string): CardUpsertValidation;
|
|
57
|
-
writeCard(id: string, card: LiveCard, cardKey?: string): void;
|
|
58
|
-
patchCard(id: string, jsonPath: string, value: unknown): void;
|
|
59
|
-
removeCard(id: string): void;
|
|
60
|
-
readIndex(): CardIndex;
|
|
61
|
-
}
|
|
62
|
-
declare function createCardStore(adapter: CardStorageAdapter, onWarn?: (msg: string) => void): CardAdminStore;
|
|
63
|
-
interface JournalEntry {
|
|
64
|
-
id: string;
|
|
65
|
-
event: GraphEvent;
|
|
66
|
-
}
|
|
67
|
-
interface JournalStorageAdapter {
|
|
68
|
-
readAllEntries(): JournalEntry[];
|
|
69
|
-
appendEntry(entry: JournalEntry): void;
|
|
70
|
-
generateId(): string;
|
|
71
|
-
}
|
|
72
|
-
declare const SNAPSHOT_SCHEMA_VERSION_V1 = "v1";
|
|
73
|
-
declare const BOARD_GRAPH_KEY = "board/graph";
|
|
74
|
-
interface StateSnapshotReadView {
|
|
75
|
-
version: string | null;
|
|
76
|
-
values: Record<string, unknown>;
|
|
77
|
-
}
|
|
78
|
-
type OutputStoreEvent = {
|
|
79
|
-
kind: 'computed_values';
|
|
80
|
-
cardId: string;
|
|
81
|
-
values: Record<string, unknown>;
|
|
82
|
-
} | {
|
|
83
|
-
kind: 'data_object';
|
|
84
|
-
key: string;
|
|
85
|
-
payload: unknown;
|
|
86
|
-
} | {
|
|
87
|
-
kind: 'status';
|
|
88
|
-
status: unknown;
|
|
89
|
-
};
|
|
90
|
-
interface BoardStatusCard {
|
|
91
|
-
name: string;
|
|
92
|
-
status: string;
|
|
93
|
-
error?: {
|
|
94
|
-
message: string;
|
|
95
|
-
code?: string;
|
|
96
|
-
at?: string;
|
|
97
|
-
source?: 'task-runtime' | 'source-fetch' | 'timeout' | 'unknown';
|
|
98
|
-
};
|
|
99
|
-
requires: string[];
|
|
100
|
-
requires_satisfied: string[];
|
|
101
|
-
requires_missing: string[];
|
|
102
|
-
provides_declared: string[];
|
|
103
|
-
provides_runtime: string[];
|
|
104
|
-
blocked_by: string[];
|
|
105
|
-
unblocks: string[];
|
|
106
|
-
runtime: {
|
|
107
|
-
attempt_count: number;
|
|
108
|
-
restart_count: number;
|
|
109
|
-
in_progress_since: string | null;
|
|
110
|
-
last_transition_at: string | null;
|
|
111
|
-
last_completed_at: string | null;
|
|
112
|
-
last_restarted_at: string | null;
|
|
113
|
-
status_age_ms: number | null;
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
interface BoardStatusObject {
|
|
117
|
-
schema_version: 'v1';
|
|
118
|
-
meta: {
|
|
119
|
-
board: {
|
|
120
|
-
path: string;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
summary: {
|
|
124
|
-
card_count: number;
|
|
125
|
-
completed: number;
|
|
126
|
-
eligible: number;
|
|
127
|
-
pending: number;
|
|
128
|
-
blocked: number;
|
|
129
|
-
unresolved: number;
|
|
130
|
-
failed?: number;
|
|
131
|
-
in_progress?: number;
|
|
132
|
-
orphan_cards?: number;
|
|
133
|
-
topology?: {
|
|
134
|
-
edge_count: number;
|
|
135
|
-
max_fan_out_card: string | null;
|
|
136
|
-
max_fan_out: number;
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
cards: BoardStatusCard[];
|
|
140
|
-
}
|
|
141
|
-
declare const EMPTY_CONFIG: GraphConfig;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* chat-storage-lib.ts
|
|
145
|
-
*
|
|
146
|
-
* ChatStorage interface + factories backed by JournalStorage (history) and
|
|
147
|
-
* KVStorage (processing state and config).
|
|
148
|
-
*
|
|
149
|
-
* Platform-free — no node:fs or node:crypto imports.
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
type Awaitable<T> = T | Promise<T>;
|
|
153
|
-
interface ChatRecord {
|
|
154
|
-
/** Journal entry id — also used as SSE cursor. */
|
|
155
|
-
id: string;
|
|
156
|
-
role: string;
|
|
157
|
-
text: string;
|
|
158
|
-
files: unknown[];
|
|
159
|
-
turn: string;
|
|
160
|
-
updated_at: string;
|
|
161
|
-
}
|
|
162
|
-
interface ChatConfig {
|
|
163
|
-
systemPrompt?: string;
|
|
164
|
-
}
|
|
165
|
-
interface ChatReadAfterResult {
|
|
166
|
-
records: ChatRecord[];
|
|
167
|
-
/** Pass as cursor on the next call. Null when the journal is empty. */
|
|
168
|
-
cursor: string | null;
|
|
169
|
-
}
|
|
170
|
-
interface ChatStorage {
|
|
171
|
-
/** Append a message; returns the new entry id (usable as a cursor). */
|
|
172
|
-
append(cardId: string, role: string, text: string, files?: unknown[], turn?: string): Awaitable<string>;
|
|
173
|
-
/** Read all messages in insertion order. */
|
|
174
|
-
readAll(cardId: string): Awaitable<ChatRecord[]>;
|
|
175
|
-
/**
|
|
176
|
-
* Read messages appended after cursor.
|
|
177
|
-
* Pass null to read from the beginning.
|
|
178
|
-
*/
|
|
179
|
-
readAfter(cardId: string, cursor: string | null): Awaitable<ChatReadAfterResult>;
|
|
180
|
-
/** Remove all messages for this card. */
|
|
181
|
-
clear(cardId: string): Awaitable<void>;
|
|
182
|
-
setProcessing(cardId: string, active: boolean): Awaitable<void>;
|
|
183
|
-
isProcessing(cardId: string): Awaitable<boolean>;
|
|
184
|
-
getConfig(cardId: string): Awaitable<ChatConfig>;
|
|
185
|
-
setConfig(cardId: string, patch: Partial<ChatConfig>): Awaitable<void>;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Create a ChatStorage backed by:
|
|
189
|
-
* - journalFactory(cardId) → JournalStorage (one per-card journal for history)
|
|
190
|
-
* - kv → KVStorage (shared processing flags + config)
|
|
191
|
-
*/
|
|
192
|
-
declare function createChatStorage(journalFactory: (cardId: string) => JournalStorage, kv: KVStorage): ChatStorage;
|
|
193
|
-
declare function createInMemoryChatStorage(): ChatStorage;
|
|
194
|
-
|
|
195
|
-
interface BoardTaskCallback {
|
|
196
|
-
token: string;
|
|
197
|
-
via: ExecutionRef;
|
|
198
|
-
}
|
|
199
|
-
interface BoardCallbackTransport {
|
|
200
|
-
createCallback(token: string): BoardTaskCallback;
|
|
201
|
-
}
|
|
202
|
-
declare function createHttpBoardCallbackTransport(baseUrl: string): BoardCallbackTransport;
|
|
203
|
-
declare function createInProcessBoardCallbackTransport(handlerKey: string): BoardCallbackTransport;
|
|
204
|
-
declare function createLocalNodeBoardCallbackTransport(opts?: string | {
|
|
205
|
-
notifyChannel?: string;
|
|
206
|
-
boardRuntimeStoreRef?: string;
|
|
207
|
-
queueStoreRef?: string;
|
|
208
|
-
}): BoardCallbackTransport;
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* board-live-cards-public.ts
|
|
212
|
-
*
|
|
213
|
-
* Platform-free public API layer for the board-live-cards system.
|
|
214
|
-
*
|
|
215
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
216
|
-
* LAYER DIAGRAM
|
|
217
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
218
|
-
*
|
|
219
|
-
* board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
|
|
220
|
-
* ↓ calls
|
|
221
|
-
* board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
|
|
222
|
-
* ↓ depends on injected
|
|
223
|
-
* board-live-cards-lib.ts (pure domain — stores, graph, codecs)
|
|
224
|
-
*
|
|
225
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
226
|
-
* PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
|
|
227
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
228
|
-
*
|
|
229
|
-
* Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
|
|
230
|
-
* Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
|
|
231
|
-
* Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
|
|
232
|
-
* In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
|
|
233
|
-
*
|
|
234
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
235
|
-
* USAGE
|
|
236
|
-
* ─────────────────────────────────────────────────────────────────────────────
|
|
237
|
-
*
|
|
238
|
-
* const board = createBoardLiveCardsPublic(baseRef, adapter);
|
|
239
|
-
* const status = board.status();
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
type CommandInput = {
|
|
243
|
-
params?: Record<string, string | number | boolean>;
|
|
244
|
-
body?: unknown;
|
|
245
|
-
};
|
|
246
|
-
type CommandResult<T = undefined> = (T extends undefined ? {
|
|
247
|
-
status: 'success';
|
|
248
|
-
} : {
|
|
249
|
-
status: 'success';
|
|
250
|
-
data: T;
|
|
251
|
-
}) | {
|
|
252
|
-
status: 'fail';
|
|
253
|
-
error: string;
|
|
254
|
-
} | {
|
|
255
|
-
status: 'error';
|
|
256
|
-
error: string;
|
|
257
|
-
};
|
|
258
|
-
interface BoardPlatformAdapter {
|
|
259
|
-
/**
|
|
260
|
-
* KV storage factory — scoped by namespace.
|
|
261
|
-
* Namespaces used by the public layer:
|
|
262
|
-
* 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
|
|
263
|
-
* 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
|
|
264
|
-
* 'card-upsert' — card upsert dedup index
|
|
265
|
-
* 'execution-requests' — queued execution requests (keyed by journalId)
|
|
266
|
-
* 'card-runtime' — card runtime state snapshots
|
|
267
|
-
* 'output' — published board status + card computed outputs
|
|
268
|
-
*/
|
|
269
|
-
kvStorage(namespace: string): KVStorage;
|
|
270
|
-
/**
|
|
271
|
-
* Build a KVStorage rooted at the given ref.
|
|
272
|
-
* Used by the public layer for both card store and outputs store routing.
|
|
273
|
-
* FS: createFsKvStorage(parseRef(ref).value)
|
|
274
|
-
* localStorage: createLocalStorageKvStorage(parseRef(ref).value)
|
|
275
|
-
*/
|
|
276
|
-
kvStorageForRef(ref: string): KVStorage;
|
|
277
|
-
/**
|
|
278
|
-
* Blob storage factory — scoped by namespace.
|
|
279
|
-
* Namespaces used by the public layer:
|
|
280
|
-
* '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
|
|
281
|
-
*/
|
|
282
|
-
blobStorage(namespace: string): BlobStorage;
|
|
283
|
-
blobStorageForRef(ref: string): BlobStorage;
|
|
284
|
-
chatStorageForRef(ref: string): ChatStorage;
|
|
285
|
-
/**
|
|
286
|
-
* Ephemeral scratch store for transient I/O staging (probe in/out/err,
|
|
287
|
-
* dispatchExecution argv/out/err). Default scope is board-local; if the
|
|
288
|
-
* config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
|
|
289
|
-
* instead.
|
|
290
|
-
*/
|
|
291
|
-
scratchStorage(): ScratchStorage;
|
|
292
|
-
scratchStorageForRef(ref: string): ScratchStorage;
|
|
293
|
-
/**
|
|
294
|
-
* Archive factory — long-lived tracking / audit store. Default scope is
|
|
295
|
-
* board-local; if the config has an 'archive-store-ref' set,
|
|
296
|
-
* archiveFactoryForRef(ref) is used instead so archives can live on a
|
|
297
|
-
* different backend / path than the main board runtime.
|
|
298
|
-
*/
|
|
299
|
-
archiveFactory(): ArchiveFactory;
|
|
300
|
-
archiveFactoryForRef(ref: string): ArchiveFactory;
|
|
301
|
-
/**
|
|
302
|
-
* Journal storage adapter (append-only log).
|
|
303
|
-
* Uses the lib's JournalStorageAdapter interface.
|
|
304
|
-
* One journal per board — no namespace parameter needed.
|
|
305
|
-
*/
|
|
306
|
-
journalAdapter(): JournalStorageAdapter;
|
|
307
|
-
journalAdapterForRef(ref: string): JournalStorageAdapter;
|
|
308
|
-
/**
|
|
309
|
-
* Queue storage lane resolved from an explicit queue store ref.
|
|
310
|
-
* The adapter chooses the backend from the ref; lane chooses the internal queue.
|
|
311
|
-
*/
|
|
312
|
-
queueStorageForRef(ref: string, lane: string): QueueStorage;
|
|
313
|
-
/**
|
|
314
|
-
* AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
|
|
315
|
-
* Guards processAccumulatedEvents drain cycle.
|
|
316
|
-
* FS: proper-lockfile (createFsAtomicRelayLock)
|
|
317
|
-
* Azure: blob lease
|
|
318
|
-
* Firestore: Firestore transaction + sentinel document
|
|
319
|
-
*/
|
|
320
|
-
lock: AtomicRelayLock;
|
|
321
|
-
/**
|
|
322
|
-
* Adapter-owned callback transport used to build worker callback payloads.
|
|
323
|
-
* The board core treats callback delivery as a platform concern.
|
|
324
|
-
*/
|
|
325
|
-
callbackTransport?: BoardCallbackTransport;
|
|
326
|
-
/**
|
|
327
|
-
* Generic execution dispatch — platform adapts ExecutionRef → actual transport.
|
|
328
|
-
* Public layer constructs fully-formed semantic args (source def, base_ref,
|
|
329
|
-
* callback token with selfRef baked in). Platform handles transport:
|
|
330
|
-
* Node host adapter: may write args to temp file and may spawn a detached process
|
|
331
|
-
* Azure: HTTP POST args as JSON body
|
|
332
|
-
* Firebase: publishes args as pubsub message
|
|
333
|
-
*/
|
|
334
|
-
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
335
|
-
dispatched: boolean;
|
|
336
|
-
error?: string;
|
|
337
|
-
}>;
|
|
338
|
-
/**
|
|
339
|
-
* Whether dispatchExecution can accept a board-owned staged source output ref
|
|
340
|
-
* for this executor. When false/absent, the adapter keeps its legacy staging
|
|
341
|
-
* protocol such as scratch in/out refs for local process launch.
|
|
342
|
-
*/
|
|
343
|
-
supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
|
|
344
|
-
/**
|
|
345
|
-
* Resolve a blob ref to its string contents.
|
|
346
|
-
* The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
|
|
347
|
-
* Throws if the blob does not exist.
|
|
348
|
-
*/
|
|
349
|
-
resolveBlob(ref: KindValueRef): string;
|
|
350
|
-
/**
|
|
351
|
-
* Compute a stable, deterministic content hash for any JSON-serializable value.
|
|
352
|
-
* Used for dedup indexes and snapshot versioning.
|
|
353
|
-
* Node/FS: computeStableJsonHash (storage-fs-adapters)
|
|
354
|
-
* Browser: Web Crypto subtle.digest or equivalent
|
|
355
|
-
*/
|
|
356
|
-
hashFn(value: unknown): string;
|
|
357
|
-
/**
|
|
358
|
-
* Generate a random short ID (32 hex chars).
|
|
359
|
-
* Used for commit IDs and delivery tokens.
|
|
360
|
-
* Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
|
|
361
|
-
* Browser: crypto.randomUUID().replace(/-/g, '')
|
|
362
|
-
*/
|
|
363
|
-
genId(): string;
|
|
364
|
-
/**
|
|
365
|
-
* Request an additional drain pass asynchronously (e.g. spawn a background process).
|
|
366
|
-
* Called as the relay continuation after each drain cycle so that events written
|
|
367
|
-
* during the cycle (e.g. task-completed appended by the card handler) are eventually
|
|
368
|
-
* processed even when the current process exits immediately after returning.
|
|
369
|
-
* Optional — if absent, no continuation is scheduled.
|
|
370
|
-
*/
|
|
371
|
-
requestProcessAccumulated?(): void;
|
|
372
|
-
/**
|
|
373
|
-
* Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
|
|
374
|
-
* Called once per drain cycle with the complete batch of notifications produced in that cycle.
|
|
375
|
-
*/
|
|
376
|
-
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
377
|
-
/** Optional warn sink — defaults to no-op. */
|
|
378
|
-
onWarn?(msg: string): void;
|
|
379
|
-
}
|
|
380
|
-
interface BoardLiveCardsPublic {
|
|
381
|
-
init(input: CommandInput): CommandResult;
|
|
382
|
-
status(input: CommandInput): CommandResult<BoardStatusObject>;
|
|
383
|
-
getBoardRuntimeStoreRef(input: CommandInput): CommandResult<{
|
|
384
|
-
storeRef: string | null;
|
|
385
|
-
}>;
|
|
386
|
-
getCardStoreRef(input: CommandInput): CommandResult<{
|
|
387
|
-
storeRef: string;
|
|
388
|
-
}>;
|
|
389
|
-
getOutputsStoreRef(input: CommandInput): CommandResult<{
|
|
390
|
-
storeRef: string;
|
|
391
|
-
}>;
|
|
392
|
-
getScratchStoreRef(input: CommandInput): CommandResult<{
|
|
393
|
-
storeRef: string | null;
|
|
394
|
-
}>;
|
|
395
|
-
getChatStoreRef(input: CommandInput): CommandResult<{
|
|
396
|
-
storeRef: string | null;
|
|
397
|
-
}>;
|
|
398
|
-
getArtifactsStoreRef(input: CommandInput): CommandResult<{
|
|
399
|
-
storeRef: string | null;
|
|
400
|
-
}>;
|
|
401
|
-
getFetchedSourcesStoreRef(input: CommandInput): CommandResult<{
|
|
402
|
-
storeRef: string | null;
|
|
403
|
-
}>;
|
|
404
|
-
getConfig(input: CommandInput): CommandResult<{
|
|
405
|
-
value: unknown;
|
|
406
|
-
}>;
|
|
407
|
-
getOutputsDataObject(input: CommandInput): CommandResult;
|
|
408
|
-
getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
409
|
-
getOutputsComputedValues(input: CommandInput): CommandResult;
|
|
410
|
-
getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
411
|
-
getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
|
|
412
|
-
getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
|
|
413
|
-
removeCard(input: CommandInput): CommandResult;
|
|
414
|
-
addCardFiles(input: CommandInput): CommandResult<{
|
|
415
|
-
cardId: string;
|
|
416
|
-
files_added: Array<{
|
|
417
|
-
idx: number;
|
|
418
|
-
entry: unknown;
|
|
419
|
-
}>;
|
|
420
|
-
notified: true;
|
|
421
|
-
}>;
|
|
422
|
-
cardRefreshedNotify(input: CommandInput): CommandResult;
|
|
423
|
-
retrigger(input: CommandInput): CommandResult;
|
|
424
|
-
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
425
|
-
upsertCard(input: CommandInput): CommandResult;
|
|
426
|
-
taskFailed(input: CommandInput): CommandResult;
|
|
427
|
-
taskProgress(input: CommandInput): CommandResult;
|
|
428
|
-
sourceDataFetched(input: CommandInput): CommandResult;
|
|
429
|
-
sourceDataFetchFailure(input: CommandInput): CommandResult;
|
|
430
|
-
}
|
|
431
|
-
type BoardChangeNotification = OutputStoreEvent | {
|
|
432
|
-
kind: 'card_refreshed';
|
|
433
|
-
cardId: string;
|
|
434
|
-
card: LiveCard;
|
|
435
|
-
} | {
|
|
436
|
-
kind: 'card_removed';
|
|
437
|
-
cardId: string;
|
|
438
|
-
};
|
|
439
|
-
interface BoardLiveCardsPublicOptions {
|
|
440
|
-
boardRuntimeStoreRef?: string;
|
|
441
|
-
scratchStoreRef?: string;
|
|
442
|
-
taskExecutorRef?: ExecutionRef;
|
|
443
|
-
chatHandlerFlow?: unknown;
|
|
444
|
-
}
|
|
445
|
-
declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter, options?: BoardLiveCardsPublicOptions): BoardLiveCardsPublic;
|
|
446
|
-
interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
447
|
-
/**
|
|
448
|
-
* Invoke a task executor subcommand and return stdout.
|
|
449
|
-
* Throws on transport failure, non-zero exit, or timeout.
|
|
450
|
-
*/
|
|
451
|
-
invokeExecutor(ref: ExecutionRef, subcommand: string, opts?: {
|
|
452
|
-
timeout?: number;
|
|
453
|
-
input?: string;
|
|
454
|
-
}): Promise<string>;
|
|
455
|
-
/** Schema-only card validator (no executor invocation). */
|
|
456
|
-
validateSchema(card: Record<string, unknown>): {
|
|
457
|
-
ok: boolean;
|
|
458
|
-
errors: string[];
|
|
459
|
-
};
|
|
460
|
-
/** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
|
|
461
|
-
absoluteBlob: BlobStorage;
|
|
462
|
-
/**
|
|
463
|
-
* Default timeouts (ms) for executor request/response calls.
|
|
464
|
-
* Each field can also be overridden per-source via source_def.timeout.
|
|
465
|
-
*
|
|
466
|
-
* validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
|
|
467
|
-
* preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
|
|
468
|
-
* probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
|
|
469
|
-
* describeMs — describe-capabilities introspection. Default: 10_000.
|
|
470
|
-
*/
|
|
471
|
-
executorTimeouts?: {
|
|
472
|
-
validationMs?: number;
|
|
473
|
-
preflightMs?: number;
|
|
474
|
-
probeMs?: number;
|
|
475
|
-
describeMs?: number;
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
interface BoardLiveCardsNonCorePublic {
|
|
479
|
-
/** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
|
|
480
|
-
validateCardPreflight(input: CommandInput): Promise<CommandResult<{
|
|
481
|
-
cardId: string;
|
|
482
|
-
isValid: boolean;
|
|
483
|
-
issues: string[];
|
|
484
|
-
}>>;
|
|
485
|
-
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
|
|
486
|
-
probeSourcePreflight(input: CommandInput): Promise<CommandResult>;
|
|
487
|
-
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
|
|
488
|
-
runSourcePreflight(input: CommandInput): Promise<CommandResult<{
|
|
489
|
-
bindTo: string;
|
|
490
|
-
ok: boolean;
|
|
491
|
-
result: unknown;
|
|
492
|
-
issues: string[];
|
|
493
|
-
}>>;
|
|
494
|
-
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
|
|
495
|
-
evalCardCompute(input: CommandInput): CommandResult<{
|
|
496
|
-
cardId: string;
|
|
497
|
-
ok: boolean;
|
|
498
|
-
computed_values: Record<string, unknown>;
|
|
499
|
-
errors: Array<{
|
|
500
|
-
bindTo: string;
|
|
501
|
-
error: string;
|
|
502
|
-
}>;
|
|
503
|
-
}>;
|
|
504
|
-
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
|
|
505
|
-
simulateCardCycle(input: CommandInput): Promise<CommandResult>;
|
|
506
|
-
/** no params needed */
|
|
507
|
-
describeTaskExecutorCapabilities(input: CommandInput): Promise<CommandResult>;
|
|
508
|
-
/**
|
|
509
|
-
* Write/update cards in the configured card store.
|
|
510
|
-
* body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
|
|
511
|
-
*/
|
|
512
|
-
updatesInCardStore(input: CommandInput): CommandResult;
|
|
513
|
-
/**
|
|
514
|
-
* Read cards from the configured card store by id.
|
|
515
|
-
* body: { ids: string[] }
|
|
516
|
-
*/
|
|
517
|
-
readFromCardStore(input: CommandInput): CommandResult<{
|
|
518
|
-
cards: Array<{
|
|
519
|
-
id: string;
|
|
520
|
-
'card-content': LiveCard | null;
|
|
521
|
-
}>;
|
|
522
|
-
}>;
|
|
523
|
-
}
|
|
524
|
-
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter, opts?: {
|
|
525
|
-
boardRuntimeStoreRef?: string;
|
|
526
|
-
taskExecutorRef?: ExecutionRef;
|
|
527
|
-
}): BoardLiveCardsNonCorePublic;
|
|
528
|
-
|
|
529
|
-
export { type BoardChangeNotification as B, type CommandInput as C, EMPTY_CONFIG as E, type LiveCard as L, type StateSnapshotReadView as S, type CommandResult as a, type CardAdminStore as b, type BoardLiveCardsPublic as c, type BoardNonCorePlatformAdapter as d, type BoardPlatformAdapter as e, type ChatStorage as f, type ChatRecord as g, type ChatReadAfterResult as h, type ChatConfig as i, type BoardStatusObject as j, type BoardCallbackTransport as k, type BoardLiveCardsNonCorePublic as l, type CardChecksumIndex as m, type CardUpsertValidation as n, type CardIndex as o, BOARD_GRAPH_KEY as p, SNAPSHOT_SCHEMA_VERSION_V1 as q, createBoardLiveCardsNonCorePublic as r, createBoardLiveCardsPublic as s, createCardStore as t, createChatStorage as u, createHttpBoardCallbackTransport as v, createInMemoryChatStorage as w, createInProcessBoardCallbackTransport as x, createLocalNodeBoardCallbackTransport as y, type BoardLiveCardsPublicOptions as z };
|