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,4 +1,326 @@
|
|
|
1
|
-
import './storage-interface-
|
|
2
|
-
|
|
3
|
-
import './execution-refs.cjs';
|
|
1
|
+
import { K as KVStorage, B as BlobStorage, S as ScratchStorage, A as ArchiveFactory, Q as QueueStorage, g as AtomicRelayLock, a as KindValueRef } from './storage-interface-DogVPooM.cjs';
|
|
2
|
+
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-kP0K6UMq.cjs';
|
|
3
|
+
import { ExecutionRef } from './execution-refs.cjs';
|
|
4
|
+
import { k as BoardStatusObject, L as LiveCard, h as NotificationEmitter, J as JournalStorageAdapter, B as BoardChangeNotification } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
5
|
+
export { l as BOARD_GRAPH_KEY, E as EMPTY_CONFIG, S as SNAPSHOT_SCHEMA_VERSION_V1 } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
4
6
|
import './types-BBhqYGhE.cjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* board-live-cards-public.ts
|
|
10
|
+
*
|
|
11
|
+
* Platform-free public API layer for the board-live-cards system.
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
* LAYER DIAGRAM
|
|
15
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
*
|
|
17
|
+
* board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
|
|
18
|
+
* ↓ calls
|
|
19
|
+
* board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
|
|
20
|
+
* ↓ depends on injected
|
|
21
|
+
* board-live-cards-lib.ts (pure domain — stores, graph, codecs)
|
|
22
|
+
*
|
|
23
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
* PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
|
|
25
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
|
|
28
|
+
* Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
|
|
29
|
+
* Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
|
|
30
|
+
* In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
|
|
31
|
+
*
|
|
32
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
* USAGE
|
|
34
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
35
|
+
*
|
|
36
|
+
* const board = createBoardLiveCardsPublic(baseRef, adapter);
|
|
37
|
+
* const status = board.status();
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
type CommandInput = {
|
|
41
|
+
params?: Record<string, string | number | boolean>;
|
|
42
|
+
body?: unknown;
|
|
43
|
+
};
|
|
44
|
+
type CommandResult<T = undefined> = (T extends undefined ? {
|
|
45
|
+
status: 'success';
|
|
46
|
+
} : {
|
|
47
|
+
status: 'success';
|
|
48
|
+
data: T;
|
|
49
|
+
}) | {
|
|
50
|
+
status: 'fail';
|
|
51
|
+
error: string;
|
|
52
|
+
} | {
|
|
53
|
+
status: 'error';
|
|
54
|
+
error: string;
|
|
55
|
+
};
|
|
56
|
+
interface BoardPlatformAdapter {
|
|
57
|
+
/**
|
|
58
|
+
* KV storage factory — scoped by namespace.
|
|
59
|
+
* Namespaces used by the public layer:
|
|
60
|
+
* 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
|
|
61
|
+
* 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
|
|
62
|
+
* 'card-upsert' — card upsert dedup index
|
|
63
|
+
* 'execution-requests' — queued execution requests (keyed by journalId)
|
|
64
|
+
* 'card-runtime' — card runtime state snapshots
|
|
65
|
+
* 'output' — published board status + card computed outputs
|
|
66
|
+
*/
|
|
67
|
+
kvStorage(namespace: string): KVStorage;
|
|
68
|
+
/**
|
|
69
|
+
* Build a KVStorage rooted at the given ref.
|
|
70
|
+
* Used by the public layer for both card store and outputs store routing.
|
|
71
|
+
* FS: createFsKvStorage(parseRef(ref).value)
|
|
72
|
+
* localStorage: createLocalStorageKvStorage(parseRef(ref).value)
|
|
73
|
+
*/
|
|
74
|
+
kvStorageForRef(ref: string): KVStorage;
|
|
75
|
+
/**
|
|
76
|
+
* Blob storage factory — scoped by namespace.
|
|
77
|
+
* Namespaces used by the public layer:
|
|
78
|
+
* '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
|
|
79
|
+
*/
|
|
80
|
+
blobStorage(namespace: string): BlobStorage;
|
|
81
|
+
blobStorageForRef(ref: string): BlobStorage;
|
|
82
|
+
chatStorageForRef(ref: string): ChatStorage;
|
|
83
|
+
/**
|
|
84
|
+
* Ephemeral scratch store for transient I/O staging (probe in/out/err,
|
|
85
|
+
* dispatchExecution argv/out/err). Default scope is board-local; if the
|
|
86
|
+
* config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
|
|
87
|
+
* instead.
|
|
88
|
+
*/
|
|
89
|
+
scratchStorage(): ScratchStorage;
|
|
90
|
+
scratchStorageForRef(ref: string): ScratchStorage;
|
|
91
|
+
/**
|
|
92
|
+
* Archive factory — long-lived tracking / audit store. Default scope is
|
|
93
|
+
* board-local; if the config has an 'archive-store-ref' set,
|
|
94
|
+
* archiveFactoryForRef(ref) is used instead so archives can live on a
|
|
95
|
+
* different backend / path than the main board runtime.
|
|
96
|
+
*/
|
|
97
|
+
archiveFactory(): ArchiveFactory;
|
|
98
|
+
archiveFactoryForRef(ref: string): ArchiveFactory;
|
|
99
|
+
/**
|
|
100
|
+
* Journal storage adapter (append-only log).
|
|
101
|
+
* Uses the lib's JournalStorageAdapter interface.
|
|
102
|
+
* One journal per board — no namespace parameter needed.
|
|
103
|
+
*/
|
|
104
|
+
journalAdapter(): JournalStorageAdapter;
|
|
105
|
+
journalAdapterForRef(ref: string): JournalStorageAdapter;
|
|
106
|
+
/**
|
|
107
|
+
* Queue storage lane resolved from an explicit queue store ref.
|
|
108
|
+
* The adapter chooses the backend from the ref; lane chooses the internal queue.
|
|
109
|
+
*/
|
|
110
|
+
queueStorageForRef(ref: string, lane: string): QueueStorage;
|
|
111
|
+
/**
|
|
112
|
+
* AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
|
|
113
|
+
* Guards processAccumulatedEvents drain cycle.
|
|
114
|
+
* FS: proper-lockfile (createFsAtomicRelayLock)
|
|
115
|
+
* Azure: blob lease
|
|
116
|
+
* Firestore: Firestore transaction + sentinel document
|
|
117
|
+
*/
|
|
118
|
+
lock: AtomicRelayLock;
|
|
119
|
+
/**
|
|
120
|
+
* Adapter-owned callback transport used to build worker callback payloads.
|
|
121
|
+
* The board core treats callback delivery as a platform concern.
|
|
122
|
+
*/
|
|
123
|
+
callbackTransport?: BoardCallbackTransport;
|
|
124
|
+
/**
|
|
125
|
+
* Generic execution dispatch — platform adapts ExecutionRef → actual transport.
|
|
126
|
+
* Public layer constructs fully-formed semantic args (source def, base_ref,
|
|
127
|
+
* callback token with selfRef baked in). Platform handles transport:
|
|
128
|
+
* Node host adapter: may write args to temp file and may spawn a detached process
|
|
129
|
+
* Azure: HTTP POST args as JSON body
|
|
130
|
+
* Firebase: publishes args as pubsub message
|
|
131
|
+
*/
|
|
132
|
+
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
133
|
+
dispatched: boolean;
|
|
134
|
+
error?: string;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* Whether dispatchExecution can accept a board-owned staged source output ref
|
|
138
|
+
* for this executor. When false/absent, the adapter keeps its legacy staging
|
|
139
|
+
* protocol such as scratch in/out refs for local process launch.
|
|
140
|
+
*/
|
|
141
|
+
supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Resolve a blob ref to its string contents.
|
|
144
|
+
* The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
|
|
145
|
+
* Throws if the blob does not exist.
|
|
146
|
+
*/
|
|
147
|
+
resolveBlob(ref: KindValueRef): string;
|
|
148
|
+
/**
|
|
149
|
+
* Compute a stable, deterministic content hash for any JSON-serializable value.
|
|
150
|
+
* Used for dedup indexes and snapshot versioning.
|
|
151
|
+
* Node/FS: computeStableJsonHash (storage-fs-adapters)
|
|
152
|
+
* Browser: Web Crypto subtle.digest or equivalent
|
|
153
|
+
*/
|
|
154
|
+
hashFn(value: unknown): string;
|
|
155
|
+
/**
|
|
156
|
+
* Generate a random short ID (32 hex chars).
|
|
157
|
+
* Used for commit IDs and delivery tokens.
|
|
158
|
+
* Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
|
|
159
|
+
* Browser: crypto.randomUUID().replace(/-/g, '')
|
|
160
|
+
*/
|
|
161
|
+
genId(): string;
|
|
162
|
+
/**
|
|
163
|
+
* Request an additional drain pass asynchronously (e.g. spawn a background process).
|
|
164
|
+
* Called as the relay continuation after each drain cycle so that events written
|
|
165
|
+
* during the cycle (e.g. task-completed appended by the card handler) are eventually
|
|
166
|
+
* processed even when the current process exits immediately after returning.
|
|
167
|
+
* Optional — if absent, no continuation is scheduled.
|
|
168
|
+
*/
|
|
169
|
+
requestProcessAccumulated?(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
|
|
172
|
+
* Called once per drain cycle with the complete batch of notifications produced in that cycle.
|
|
173
|
+
*/
|
|
174
|
+
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
175
|
+
/** Optional warn sink — defaults to no-op. */
|
|
176
|
+
onWarn?(msg: string): void;
|
|
177
|
+
}
|
|
178
|
+
interface BoardLiveCardsPublic {
|
|
179
|
+
init(input: CommandInput): CommandResult;
|
|
180
|
+
status(input: CommandInput): CommandResult<BoardStatusObject>;
|
|
181
|
+
getBoardRuntimeStoreRef(input: CommandInput): CommandResult<{
|
|
182
|
+
storeRef: string | null;
|
|
183
|
+
}>;
|
|
184
|
+
getCardStoreRef(input: CommandInput): CommandResult<{
|
|
185
|
+
storeRef: string;
|
|
186
|
+
}>;
|
|
187
|
+
getOutputsStoreRef(input: CommandInput): CommandResult<{
|
|
188
|
+
storeRef: string;
|
|
189
|
+
}>;
|
|
190
|
+
getScratchStoreRef(input: CommandInput): CommandResult<{
|
|
191
|
+
storeRef: string | null;
|
|
192
|
+
}>;
|
|
193
|
+
getChatStoreRef(input: CommandInput): CommandResult<{
|
|
194
|
+
storeRef: string | null;
|
|
195
|
+
}>;
|
|
196
|
+
getArtifactsStoreRef(input: CommandInput): CommandResult<{
|
|
197
|
+
storeRef: string | null;
|
|
198
|
+
}>;
|
|
199
|
+
getFetchedSourcesStoreRef(input: CommandInput): CommandResult<{
|
|
200
|
+
storeRef: string | null;
|
|
201
|
+
}>;
|
|
202
|
+
getConfig(input: CommandInput): CommandResult<{
|
|
203
|
+
value: unknown;
|
|
204
|
+
}>;
|
|
205
|
+
getOutputsDataObject(input: CommandInput): CommandResult;
|
|
206
|
+
getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
207
|
+
getOutputsComputedValues(input: CommandInput): CommandResult;
|
|
208
|
+
getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
209
|
+
getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
|
|
210
|
+
getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
|
|
211
|
+
buildSseOneShotPayload(input: CommandInput): CommandResult<BoardSseOneShotPayload>;
|
|
212
|
+
removeCard(input: CommandInput): CommandResult;
|
|
213
|
+
addCardFiles(input: CommandInput): CommandResult<{
|
|
214
|
+
cardId: string;
|
|
215
|
+
files_added: Array<{
|
|
216
|
+
idx: number;
|
|
217
|
+
entry: unknown;
|
|
218
|
+
}>;
|
|
219
|
+
notified: true;
|
|
220
|
+
}>;
|
|
221
|
+
retrigger(input: CommandInput): CommandResult;
|
|
222
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
223
|
+
upsertCard(input: CommandInput): CommandResult;
|
|
224
|
+
taskFailed(input: CommandInput): CommandResult;
|
|
225
|
+
taskProgress(input: CommandInput): CommandResult;
|
|
226
|
+
sourceDataFetched(input: CommandInput): CommandResult;
|
|
227
|
+
sourceDataFetchFailure(input: CommandInput): CommandResult;
|
|
228
|
+
}
|
|
229
|
+
interface BoardSseOneShotPayload {
|
|
230
|
+
cardDefinitions: Array<Record<string, unknown>>;
|
|
231
|
+
statusSnapshot: BoardStatusObject;
|
|
232
|
+
dataObjectsByToken: Record<string, unknown>;
|
|
233
|
+
cardRuntimeById: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
interface BoardLiveCardsPublicOptions {
|
|
236
|
+
boardRuntimeStoreRef?: string;
|
|
237
|
+
scratchStoreRef?: string;
|
|
238
|
+
taskExecutorRef?: ExecutionRef;
|
|
239
|
+
chatHandlerFlow?: unknown;
|
|
240
|
+
emitNotification?: NotificationEmitter;
|
|
241
|
+
}
|
|
242
|
+
declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter, options?: BoardLiveCardsPublicOptions): BoardLiveCardsPublic;
|
|
243
|
+
interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
244
|
+
/**
|
|
245
|
+
* Invoke a task executor subcommand and return stdout.
|
|
246
|
+
* Throws on transport failure, non-zero exit, or timeout.
|
|
247
|
+
*/
|
|
248
|
+
invokeExecutor(ref: ExecutionRef, subcommand: string, opts?: {
|
|
249
|
+
timeout?: number;
|
|
250
|
+
input?: string;
|
|
251
|
+
}): Promise<string>;
|
|
252
|
+
/** Schema-only card validator (no executor invocation). */
|
|
253
|
+
validateSchema(card: Record<string, unknown>): {
|
|
254
|
+
ok: boolean;
|
|
255
|
+
errors: string[];
|
|
256
|
+
};
|
|
257
|
+
/** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
|
|
258
|
+
absoluteBlob: BlobStorage;
|
|
259
|
+
/**
|
|
260
|
+
* Default timeouts (ms) for executor request/response calls.
|
|
261
|
+
* Each field can also be overridden per-source via source_def.timeout.
|
|
262
|
+
*
|
|
263
|
+
* validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
|
|
264
|
+
* preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
|
|
265
|
+
* probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
|
|
266
|
+
* describeMs — describe-capabilities introspection. Default: 10_000.
|
|
267
|
+
*/
|
|
268
|
+
executorTimeouts?: {
|
|
269
|
+
validationMs?: number;
|
|
270
|
+
preflightMs?: number;
|
|
271
|
+
probeMs?: number;
|
|
272
|
+
describeMs?: number;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
interface BoardLiveCardsNonCorePublic {
|
|
276
|
+
/** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
|
|
277
|
+
validateCardPreflight(input: CommandInput): Promise<CommandResult<{
|
|
278
|
+
cardId: string;
|
|
279
|
+
isValid: boolean;
|
|
280
|
+
issues: string[];
|
|
281
|
+
}>>;
|
|
282
|
+
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
|
|
283
|
+
probeSourcePreflight(input: CommandInput): Promise<CommandResult>;
|
|
284
|
+
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
|
|
285
|
+
runSourcePreflight(input: CommandInput): Promise<CommandResult<{
|
|
286
|
+
bindTo: string;
|
|
287
|
+
ok: boolean;
|
|
288
|
+
result: unknown;
|
|
289
|
+
issues: string[];
|
|
290
|
+
}>>;
|
|
291
|
+
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
|
|
292
|
+
evalCardCompute(input: CommandInput): CommandResult<{
|
|
293
|
+
cardId: string;
|
|
294
|
+
ok: boolean;
|
|
295
|
+
computed_values: Record<string, unknown>;
|
|
296
|
+
errors: Array<{
|
|
297
|
+
bindTo: string;
|
|
298
|
+
error: string;
|
|
299
|
+
}>;
|
|
300
|
+
}>;
|
|
301
|
+
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
|
|
302
|
+
simulateCardCycle(input: CommandInput): Promise<CommandResult>;
|
|
303
|
+
/** no params needed */
|
|
304
|
+
describeTaskExecutorCapabilities(input: CommandInput): Promise<CommandResult>;
|
|
305
|
+
/**
|
|
306
|
+
* Write/update cards in the configured card store.
|
|
307
|
+
* body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
|
|
308
|
+
*/
|
|
309
|
+
updatesInCardStore(input: CommandInput): CommandResult;
|
|
310
|
+
/**
|
|
311
|
+
* Read cards from the configured card store by id.
|
|
312
|
+
* body: { ids: string[] }
|
|
313
|
+
*/
|
|
314
|
+
readFromCardStore(input: CommandInput): CommandResult<{
|
|
315
|
+
cards: Array<{
|
|
316
|
+
id: string;
|
|
317
|
+
'card-content': LiveCard | null;
|
|
318
|
+
}>;
|
|
319
|
+
}>;
|
|
320
|
+
}
|
|
321
|
+
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter, opts?: {
|
|
322
|
+
boardRuntimeStoreRef?: string;
|
|
323
|
+
taskExecutorRef?: ExecutionRef;
|
|
324
|
+
}): BoardLiveCardsNonCorePublic;
|
|
325
|
+
|
|
326
|
+
export { BoardChangeNotification, type BoardLiveCardsNonCorePublic, type BoardLiveCardsPublic, type BoardLiveCardsPublicOptions, type BoardNonCorePlatformAdapter, type BoardPlatformAdapter, type BoardSseOneShotPayload, type CommandInput, type CommandResult, createBoardLiveCardsNonCorePublic, createBoardLiveCardsPublic };
|
|
@@ -1,4 +1,326 @@
|
|
|
1
|
-
import './storage-interface-
|
|
2
|
-
|
|
3
|
-
import './execution-refs.js';
|
|
1
|
+
import { K as KVStorage, B as BlobStorage, S as ScratchStorage, A as ArchiveFactory, Q as QueueStorage, g as AtomicRelayLock, a as KindValueRef } from './storage-interface-DogVPooM.js';
|
|
2
|
+
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-Bekq8Gp-.js';
|
|
3
|
+
import { ExecutionRef } from './execution-refs.js';
|
|
4
|
+
import { k as BoardStatusObject, L as LiveCard, h as NotificationEmitter, J as JournalStorageAdapter, B as BoardChangeNotification } from './board-live-cards-lib-iU8xOwNp.js';
|
|
5
|
+
export { l as BOARD_GRAPH_KEY, E as EMPTY_CONFIG, S as SNAPSHOT_SCHEMA_VERSION_V1 } from './board-live-cards-lib-iU8xOwNp.js';
|
|
4
6
|
import './types-BBhqYGhE.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* board-live-cards-public.ts
|
|
10
|
+
*
|
|
11
|
+
* Platform-free public API layer for the board-live-cards system.
|
|
12
|
+
*
|
|
13
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
* LAYER DIAGRAM
|
|
15
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
16
|
+
*
|
|
17
|
+
* board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
|
|
18
|
+
* ↓ calls
|
|
19
|
+
* board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
|
|
20
|
+
* ↓ depends on injected
|
|
21
|
+
* board-live-cards-lib.ts (pure domain — stores, graph, codecs)
|
|
22
|
+
*
|
|
23
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
* PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
|
|
25
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
*
|
|
27
|
+
* Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
|
|
28
|
+
* Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
|
|
29
|
+
* Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
|
|
30
|
+
* In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
|
|
31
|
+
*
|
|
32
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
* USAGE
|
|
34
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
35
|
+
*
|
|
36
|
+
* const board = createBoardLiveCardsPublic(baseRef, adapter);
|
|
37
|
+
* const status = board.status();
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
type CommandInput = {
|
|
41
|
+
params?: Record<string, string | number | boolean>;
|
|
42
|
+
body?: unknown;
|
|
43
|
+
};
|
|
44
|
+
type CommandResult<T = undefined> = (T extends undefined ? {
|
|
45
|
+
status: 'success';
|
|
46
|
+
} : {
|
|
47
|
+
status: 'success';
|
|
48
|
+
data: T;
|
|
49
|
+
}) | {
|
|
50
|
+
status: 'fail';
|
|
51
|
+
error: string;
|
|
52
|
+
} | {
|
|
53
|
+
status: 'error';
|
|
54
|
+
error: string;
|
|
55
|
+
};
|
|
56
|
+
interface BoardPlatformAdapter {
|
|
57
|
+
/**
|
|
58
|
+
* KV storage factory — scoped by namespace.
|
|
59
|
+
* Namespaces used by the public layer:
|
|
60
|
+
* 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
|
|
61
|
+
* 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
|
|
62
|
+
* 'card-upsert' — card upsert dedup index
|
|
63
|
+
* 'execution-requests' — queued execution requests (keyed by journalId)
|
|
64
|
+
* 'card-runtime' — card runtime state snapshots
|
|
65
|
+
* 'output' — published board status + card computed outputs
|
|
66
|
+
*/
|
|
67
|
+
kvStorage(namespace: string): KVStorage;
|
|
68
|
+
/**
|
|
69
|
+
* Build a KVStorage rooted at the given ref.
|
|
70
|
+
* Used by the public layer for both card store and outputs store routing.
|
|
71
|
+
* FS: createFsKvStorage(parseRef(ref).value)
|
|
72
|
+
* localStorage: createLocalStorageKvStorage(parseRef(ref).value)
|
|
73
|
+
*/
|
|
74
|
+
kvStorageForRef(ref: string): KVStorage;
|
|
75
|
+
/**
|
|
76
|
+
* Blob storage factory — scoped by namespace.
|
|
77
|
+
* Namespaces used by the public layer:
|
|
78
|
+
* '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
|
|
79
|
+
*/
|
|
80
|
+
blobStorage(namespace: string): BlobStorage;
|
|
81
|
+
blobStorageForRef(ref: string): BlobStorage;
|
|
82
|
+
chatStorageForRef(ref: string): ChatStorage;
|
|
83
|
+
/**
|
|
84
|
+
* Ephemeral scratch store for transient I/O staging (probe in/out/err,
|
|
85
|
+
* dispatchExecution argv/out/err). Default scope is board-local; if the
|
|
86
|
+
* config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
|
|
87
|
+
* instead.
|
|
88
|
+
*/
|
|
89
|
+
scratchStorage(): ScratchStorage;
|
|
90
|
+
scratchStorageForRef(ref: string): ScratchStorage;
|
|
91
|
+
/**
|
|
92
|
+
* Archive factory — long-lived tracking / audit store. Default scope is
|
|
93
|
+
* board-local; if the config has an 'archive-store-ref' set,
|
|
94
|
+
* archiveFactoryForRef(ref) is used instead so archives can live on a
|
|
95
|
+
* different backend / path than the main board runtime.
|
|
96
|
+
*/
|
|
97
|
+
archiveFactory(): ArchiveFactory;
|
|
98
|
+
archiveFactoryForRef(ref: string): ArchiveFactory;
|
|
99
|
+
/**
|
|
100
|
+
* Journal storage adapter (append-only log).
|
|
101
|
+
* Uses the lib's JournalStorageAdapter interface.
|
|
102
|
+
* One journal per board — no namespace parameter needed.
|
|
103
|
+
*/
|
|
104
|
+
journalAdapter(): JournalStorageAdapter;
|
|
105
|
+
journalAdapterForRef(ref: string): JournalStorageAdapter;
|
|
106
|
+
/**
|
|
107
|
+
* Queue storage lane resolved from an explicit queue store ref.
|
|
108
|
+
* The adapter chooses the backend from the ref; lane chooses the internal queue.
|
|
109
|
+
*/
|
|
110
|
+
queueStorageForRef(ref: string, lane: string): QueueStorage;
|
|
111
|
+
/**
|
|
112
|
+
* AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
|
|
113
|
+
* Guards processAccumulatedEvents drain cycle.
|
|
114
|
+
* FS: proper-lockfile (createFsAtomicRelayLock)
|
|
115
|
+
* Azure: blob lease
|
|
116
|
+
* Firestore: Firestore transaction + sentinel document
|
|
117
|
+
*/
|
|
118
|
+
lock: AtomicRelayLock;
|
|
119
|
+
/**
|
|
120
|
+
* Adapter-owned callback transport used to build worker callback payloads.
|
|
121
|
+
* The board core treats callback delivery as a platform concern.
|
|
122
|
+
*/
|
|
123
|
+
callbackTransport?: BoardCallbackTransport;
|
|
124
|
+
/**
|
|
125
|
+
* Generic execution dispatch — platform adapts ExecutionRef → actual transport.
|
|
126
|
+
* Public layer constructs fully-formed semantic args (source def, base_ref,
|
|
127
|
+
* callback token with selfRef baked in). Platform handles transport:
|
|
128
|
+
* Node host adapter: may write args to temp file and may spawn a detached process
|
|
129
|
+
* Azure: HTTP POST args as JSON body
|
|
130
|
+
* Firebase: publishes args as pubsub message
|
|
131
|
+
*/
|
|
132
|
+
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
133
|
+
dispatched: boolean;
|
|
134
|
+
error?: string;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* Whether dispatchExecution can accept a board-owned staged source output ref
|
|
138
|
+
* for this executor. When false/absent, the adapter keeps its legacy staging
|
|
139
|
+
* protocol such as scratch in/out refs for local process launch.
|
|
140
|
+
*/
|
|
141
|
+
supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Resolve a blob ref to its string contents.
|
|
144
|
+
* The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
|
|
145
|
+
* Throws if the blob does not exist.
|
|
146
|
+
*/
|
|
147
|
+
resolveBlob(ref: KindValueRef): string;
|
|
148
|
+
/**
|
|
149
|
+
* Compute a stable, deterministic content hash for any JSON-serializable value.
|
|
150
|
+
* Used for dedup indexes and snapshot versioning.
|
|
151
|
+
* Node/FS: computeStableJsonHash (storage-fs-adapters)
|
|
152
|
+
* Browser: Web Crypto subtle.digest or equivalent
|
|
153
|
+
*/
|
|
154
|
+
hashFn(value: unknown): string;
|
|
155
|
+
/**
|
|
156
|
+
* Generate a random short ID (32 hex chars).
|
|
157
|
+
* Used for commit IDs and delivery tokens.
|
|
158
|
+
* Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
|
|
159
|
+
* Browser: crypto.randomUUID().replace(/-/g, '')
|
|
160
|
+
*/
|
|
161
|
+
genId(): string;
|
|
162
|
+
/**
|
|
163
|
+
* Request an additional drain pass asynchronously (e.g. spawn a background process).
|
|
164
|
+
* Called as the relay continuation after each drain cycle so that events written
|
|
165
|
+
* during the cycle (e.g. task-completed appended by the card handler) are eventually
|
|
166
|
+
* processed even when the current process exits immediately after returning.
|
|
167
|
+
* Optional — if absent, no continuation is scheduled.
|
|
168
|
+
*/
|
|
169
|
+
requestProcessAccumulated?(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
|
|
172
|
+
* Called once per drain cycle with the complete batch of notifications produced in that cycle.
|
|
173
|
+
*/
|
|
174
|
+
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
175
|
+
/** Optional warn sink — defaults to no-op. */
|
|
176
|
+
onWarn?(msg: string): void;
|
|
177
|
+
}
|
|
178
|
+
interface BoardLiveCardsPublic {
|
|
179
|
+
init(input: CommandInput): CommandResult;
|
|
180
|
+
status(input: CommandInput): CommandResult<BoardStatusObject>;
|
|
181
|
+
getBoardRuntimeStoreRef(input: CommandInput): CommandResult<{
|
|
182
|
+
storeRef: string | null;
|
|
183
|
+
}>;
|
|
184
|
+
getCardStoreRef(input: CommandInput): CommandResult<{
|
|
185
|
+
storeRef: string;
|
|
186
|
+
}>;
|
|
187
|
+
getOutputsStoreRef(input: CommandInput): CommandResult<{
|
|
188
|
+
storeRef: string;
|
|
189
|
+
}>;
|
|
190
|
+
getScratchStoreRef(input: CommandInput): CommandResult<{
|
|
191
|
+
storeRef: string | null;
|
|
192
|
+
}>;
|
|
193
|
+
getChatStoreRef(input: CommandInput): CommandResult<{
|
|
194
|
+
storeRef: string | null;
|
|
195
|
+
}>;
|
|
196
|
+
getArtifactsStoreRef(input: CommandInput): CommandResult<{
|
|
197
|
+
storeRef: string | null;
|
|
198
|
+
}>;
|
|
199
|
+
getFetchedSourcesStoreRef(input: CommandInput): CommandResult<{
|
|
200
|
+
storeRef: string | null;
|
|
201
|
+
}>;
|
|
202
|
+
getConfig(input: CommandInput): CommandResult<{
|
|
203
|
+
value: unknown;
|
|
204
|
+
}>;
|
|
205
|
+
getOutputsDataObject(input: CommandInput): CommandResult;
|
|
206
|
+
getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
207
|
+
getOutputsComputedValues(input: CommandInput): CommandResult;
|
|
208
|
+
getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
209
|
+
getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
|
|
210
|
+
getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
|
|
211
|
+
buildSseOneShotPayload(input: CommandInput): CommandResult<BoardSseOneShotPayload>;
|
|
212
|
+
removeCard(input: CommandInput): CommandResult;
|
|
213
|
+
addCardFiles(input: CommandInput): CommandResult<{
|
|
214
|
+
cardId: string;
|
|
215
|
+
files_added: Array<{
|
|
216
|
+
idx: number;
|
|
217
|
+
entry: unknown;
|
|
218
|
+
}>;
|
|
219
|
+
notified: true;
|
|
220
|
+
}>;
|
|
221
|
+
retrigger(input: CommandInput): CommandResult;
|
|
222
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
223
|
+
upsertCard(input: CommandInput): CommandResult;
|
|
224
|
+
taskFailed(input: CommandInput): CommandResult;
|
|
225
|
+
taskProgress(input: CommandInput): CommandResult;
|
|
226
|
+
sourceDataFetched(input: CommandInput): CommandResult;
|
|
227
|
+
sourceDataFetchFailure(input: CommandInput): CommandResult;
|
|
228
|
+
}
|
|
229
|
+
interface BoardSseOneShotPayload {
|
|
230
|
+
cardDefinitions: Array<Record<string, unknown>>;
|
|
231
|
+
statusSnapshot: BoardStatusObject;
|
|
232
|
+
dataObjectsByToken: Record<string, unknown>;
|
|
233
|
+
cardRuntimeById: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
interface BoardLiveCardsPublicOptions {
|
|
236
|
+
boardRuntimeStoreRef?: string;
|
|
237
|
+
scratchStoreRef?: string;
|
|
238
|
+
taskExecutorRef?: ExecutionRef;
|
|
239
|
+
chatHandlerFlow?: unknown;
|
|
240
|
+
emitNotification?: NotificationEmitter;
|
|
241
|
+
}
|
|
242
|
+
declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter, options?: BoardLiveCardsPublicOptions): BoardLiveCardsPublic;
|
|
243
|
+
interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
244
|
+
/**
|
|
245
|
+
* Invoke a task executor subcommand and return stdout.
|
|
246
|
+
* Throws on transport failure, non-zero exit, or timeout.
|
|
247
|
+
*/
|
|
248
|
+
invokeExecutor(ref: ExecutionRef, subcommand: string, opts?: {
|
|
249
|
+
timeout?: number;
|
|
250
|
+
input?: string;
|
|
251
|
+
}): Promise<string>;
|
|
252
|
+
/** Schema-only card validator (no executor invocation). */
|
|
253
|
+
validateSchema(card: Record<string, unknown>): {
|
|
254
|
+
ok: boolean;
|
|
255
|
+
errors: string[];
|
|
256
|
+
};
|
|
257
|
+
/** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
|
|
258
|
+
absoluteBlob: BlobStorage;
|
|
259
|
+
/**
|
|
260
|
+
* Default timeouts (ms) for executor request/response calls.
|
|
261
|
+
* Each field can also be overridden per-source via source_def.timeout.
|
|
262
|
+
*
|
|
263
|
+
* validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
|
|
264
|
+
* preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
|
|
265
|
+
* probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
|
|
266
|
+
* describeMs — describe-capabilities introspection. Default: 10_000.
|
|
267
|
+
*/
|
|
268
|
+
executorTimeouts?: {
|
|
269
|
+
validationMs?: number;
|
|
270
|
+
preflightMs?: number;
|
|
271
|
+
probeMs?: number;
|
|
272
|
+
describeMs?: number;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
interface BoardLiveCardsNonCorePublic {
|
|
276
|
+
/** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
|
|
277
|
+
validateCardPreflight(input: CommandInput): Promise<CommandResult<{
|
|
278
|
+
cardId: string;
|
|
279
|
+
isValid: boolean;
|
|
280
|
+
issues: string[];
|
|
281
|
+
}>>;
|
|
282
|
+
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
|
|
283
|
+
probeSourcePreflight(input: CommandInput): Promise<CommandResult>;
|
|
284
|
+
/** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
|
|
285
|
+
runSourcePreflight(input: CommandInput): Promise<CommandResult<{
|
|
286
|
+
bindTo: string;
|
|
287
|
+
ok: boolean;
|
|
288
|
+
result: unknown;
|
|
289
|
+
issues: string[];
|
|
290
|
+
}>>;
|
|
291
|
+
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
|
|
292
|
+
evalCardCompute(input: CommandInput): CommandResult<{
|
|
293
|
+
cardId: string;
|
|
294
|
+
ok: boolean;
|
|
295
|
+
computed_values: Record<string, unknown>;
|
|
296
|
+
errors: Array<{
|
|
297
|
+
bindTo: string;
|
|
298
|
+
error: string;
|
|
299
|
+
}>;
|
|
300
|
+
}>;
|
|
301
|
+
/** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
|
|
302
|
+
simulateCardCycle(input: CommandInput): Promise<CommandResult>;
|
|
303
|
+
/** no params needed */
|
|
304
|
+
describeTaskExecutorCapabilities(input: CommandInput): Promise<CommandResult>;
|
|
305
|
+
/**
|
|
306
|
+
* Write/update cards in the configured card store.
|
|
307
|
+
* body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
|
|
308
|
+
*/
|
|
309
|
+
updatesInCardStore(input: CommandInput): CommandResult;
|
|
310
|
+
/**
|
|
311
|
+
* Read cards from the configured card store by id.
|
|
312
|
+
* body: { ids: string[] }
|
|
313
|
+
*/
|
|
314
|
+
readFromCardStore(input: CommandInput): CommandResult<{
|
|
315
|
+
cards: Array<{
|
|
316
|
+
id: string;
|
|
317
|
+
'card-content': LiveCard | null;
|
|
318
|
+
}>;
|
|
319
|
+
}>;
|
|
320
|
+
}
|
|
321
|
+
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter, opts?: {
|
|
322
|
+
boardRuntimeStoreRef?: string;
|
|
323
|
+
taskExecutorRef?: ExecutionRef;
|
|
324
|
+
}): BoardLiveCardsNonCorePublic;
|
|
325
|
+
|
|
326
|
+
export { BoardChangeNotification, type BoardLiveCardsNonCorePublic, type BoardLiveCardsPublic, type BoardLiveCardsPublicOptions, type BoardNonCorePlatformAdapter, type BoardPlatformAdapter, type BoardSseOneShotPayload, type CommandInput, type CommandResult, createBoardLiveCardsNonCorePublic, createBoardLiveCardsPublic };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-
|
|
1
|
+
export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-P3R6TXII.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-7QNEV5S3.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-public.js.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-public.js.map
|