yaml-flow 5.4.0 → 6.0.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/board-live-cards-cli.js +2 -2
- package/board-livecards-server-runtime.js +488 -551
- package/browser/asset-integrity.json +10 -0
- package/browser/board-livecards-runtime-client.js +0 -6
- package/browser/board-livegraph-engine.js +2 -1676
- package/browser/board-livegraph-engine.js.map +1 -1
- package/browser/live-cards.js +347 -26
- package/browser/live-cards.schema.json +418 -132
- package/card-store.js +37 -0
- package/dist/batch/index.cjs +1 -108
- package/dist/batch/index.cjs.map +1 -1
- package/dist/batch/index.js +1 -106
- package/dist/batch/index.js.map +1 -1
- package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +136 -0
- package/dist/board-live-cards-lib-jM2uYG1v.d.ts +136 -0
- package/dist/board-live-cards-public-CltXYgaY.d.cts +314 -0
- package/dist/board-live-cards-public-f-E-FAyp.d.ts +314 -0
- package/dist/board-livegraph-runtime/index.cjs +2 -1671
- package/dist/board-livegraph-runtime/index.cjs.map +1 -1
- package/dist/board-livegraph-runtime/index.d.cts +1 -2
- package/dist/board-livegraph-runtime/index.d.ts +1 -2
- package/dist/board-livegraph-runtime/index.js +2 -1662
- package/dist/board-livegraph-runtime/index.js.map +1 -1
- package/dist/board-livegraph-runtime/jsonata-sync.cjs +7587 -0
- package/dist/card-compute/index.cjs +9 -7159
- package/dist/card-compute/index.cjs.map +1 -1
- package/dist/card-compute/index.d.cts +22 -0
- package/dist/card-compute/index.d.ts +22 -0
- package/dist/card-compute/index.js +9 -7145
- package/dist/card-compute/index.js.map +1 -1
- package/dist/card-compute/jsonata-sync.cjs +7587 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +2 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +1 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +24 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.ts +24 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js +2 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +1 -0
- package/dist/cli/browser-api/card-store-browser-api.cjs +2 -0
- package/dist/cli/browser-api/card-store-browser-api.cjs.map +1 -0
- package/dist/cli/browser-api/card-store-browser-api.d.cts +26 -0
- package/dist/cli/browser-api/card-store-browser-api.d.ts +26 -0
- package/dist/cli/browser-api/card-store-browser-api.js +2 -0
- package/dist/cli/browser-api/card-store-browser-api.js.map +1 -0
- package/dist/cli/browser-api/jsonata-sync.cjs +7587 -0
- package/dist/cli/node/artifacts-store-cli.cjs +11 -0
- package/dist/cli/node/artifacts-store-cli.cjs.map +1 -0
- package/dist/cli/node/artifacts-store-cli.d.cts +8 -0
- package/dist/cli/node/artifacts-store-cli.d.ts +8 -0
- package/dist/cli/node/artifacts-store-cli.js +11 -0
- package/dist/cli/node/artifacts-store-cli.js.map +1 -0
- package/dist/cli/node/board-live-cards-cli.cjs +15 -0
- package/dist/cli/node/board-live-cards-cli.cjs.map +1 -0
- package/dist/cli/node/board-live-cards-cli.d.cts +20 -0
- package/dist/cli/node/board-live-cards-cli.d.ts +20 -0
- package/dist/cli/node/board-live-cards-cli.js +15 -0
- package/dist/cli/node/board-live-cards-cli.js.map +1 -0
- package/dist/cli/node/card-store-cli.cjs +8 -0
- package/dist/cli/node/card-store-cli.cjs.map +1 -0
- package/dist/cli/node/card-store-cli.d.cts +15 -0
- package/dist/cli/node/card-store-cli.d.ts +15 -0
- package/dist/cli/node/card-store-cli.js +8 -0
- package/dist/cli/node/card-store-cli.js.map +1 -0
- package/dist/cli/node/fs-board-adapter.cjs +14 -0
- package/dist/cli/node/fs-board-adapter.cjs.map +1 -0
- package/dist/cli/node/fs-board-adapter.d.cts +204 -0
- package/dist/cli/node/fs-board-adapter.d.ts +204 -0
- package/dist/cli/node/fs-board-adapter.js +14 -0
- package/dist/cli/node/fs-board-adapter.js.map +1 -0
- package/dist/cli/node/jsonata-sync.cjs +7587 -0
- package/dist/cli/node/source-cli-task-executor.cjs +11 -0
- package/dist/cli/node/source-cli-task-executor.cjs.map +1 -0
- package/dist/cli/node/source-cli-task-executor.d.cts +1 -0
- package/dist/cli/node/source-cli-task-executor.d.ts +1 -0
- package/dist/cli/node/source-cli-task-executor.js +11 -0
- package/dist/cli/node/source-cli-task-executor.js.map +1 -0
- package/dist/config/index.cjs +1 -79
- package/dist/config/index.cjs.map +1 -1
- package/dist/config/index.js +1 -76
- package/dist/config/index.js.map +1 -1
- package/dist/continuous-event-graph/index.cjs +2 -2129
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.d.cts +81 -5
- package/dist/continuous-event-graph/index.d.ts +81 -5
- package/dist/continuous-event-graph/index.js +2 -2088
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/continuous-event-graph/jsonata-sync.cjs +7587 -0
- package/dist/event-graph/index.cjs +22 -8292
- package/dist/event-graph/index.cjs.map +1 -1
- package/dist/event-graph/index.js +22 -8237
- package/dist/event-graph/index.js.map +1 -1
- package/dist/execution-refs.cjs +2 -0
- package/dist/execution-refs.cjs.map +1 -0
- package/dist/execution-refs.d.cts +222 -0
- package/dist/execution-refs.d.ts +222 -0
- package/dist/execution-refs.js +2 -0
- package/dist/execution-refs.js.map +1 -0
- package/dist/index.cjs +29 -13221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +29 -13112
- package/dist/index.js.map +1 -1
- package/dist/inference/index.cjs +5 -617
- package/dist/inference/index.cjs.map +1 -1
- package/dist/inference/index.js +5 -610
- package/dist/inference/index.js.map +1 -1
- package/dist/jsonata-sync.cjs +7587 -0
- package/dist/{live-cards-bridge-x5XREkXm.d.cts → live-cards-bridge-BXbVTsna.d.cts} +27 -4
- package/dist/{live-cards-bridge-EQjytzI_.d.ts → live-cards-bridge-Ds28XR15.d.ts} +27 -4
- package/dist/pycli/quickjs-board-runtime.global.js +9 -0
- package/dist/pycli/quickjs-board-runtime.global.js.map +1 -0
- package/dist/pycli/quickjs-step-machine-runtime.global.js +5 -0
- package/dist/pycli/quickjs-step-machine-runtime.global.js.map +1 -0
- package/dist/step-machine/index.cjs +11 -7129
- package/dist/step-machine/index.cjs.map +1 -1
- package/dist/step-machine/index.js +11 -7113
- package/dist/step-machine/index.js.map +1 -1
- package/dist/storage-refs.cjs +10 -0
- package/dist/storage-refs.cjs.map +1 -0
- package/dist/storage-refs.d.cts +92 -0
- package/dist/storage-refs.d.ts +92 -0
- package/dist/storage-refs.js +10 -0
- package/dist/storage-refs.js.map +1 -0
- package/dist/stores/file.cjs +1 -114
- package/dist/stores/file.cjs.map +1 -1
- package/dist/stores/file.js +1 -112
- package/dist/stores/file.js.map +1 -1
- package/dist/stores/index.cjs +1 -231
- package/dist/stores/index.cjs.map +1 -1
- package/dist/stores/index.js +1 -227
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/localStorage.cjs +1 -76
- package/dist/stores/localStorage.cjs.map +1 -1
- package/dist/stores/localStorage.js +1 -74
- package/dist/stores/localStorage.js.map +1 -1
- package/dist/stores/memory.cjs +1 -47
- package/dist/stores/memory.cjs.map +1 -1
- package/dist/stores/memory.js +1 -45
- package/dist/stores/memory.js.map +1 -1
- package/examples/browser/boards/portfolio-tracker/portfolio-t4.js +292 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.js +218 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +201 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +25 -16
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-public.js +553 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +365 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +1 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +32 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +53 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +15 -6
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +6 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +57 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +1 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +1 -1
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +7 -2
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +6 -2
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +97 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +50 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +44 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +70 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +36 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +26 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +39 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +80 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +25 -172
- package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +40 -34
- package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +46 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +77 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +1 -2
- package/examples/example-board/agent-instructions.md +11 -5
- package/examples/example-board/demo-chat-handler.js +14 -4
- package/examples/example-board/demo-server-config.json +1 -0
- package/examples/example-board/demo-server.js +19 -34
- package/examples/example-board/demo-shell-browser.html +5 -4
- package/examples/example-board/demo-shell-with-server.html +10 -6
- package/examples/example-board/demo-task-executor.js +81 -35
- package/examples/index.html +0 -14
- package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -1
- package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +1 -2
- package/package.json +39 -3
- package/schema/live-cards.schema.json +418 -132
- package/dist/cli/board-live-cards-cli.cjs +0 -10644
- package/dist/cli/board-live-cards-cli.cjs.map +0 -1
- package/dist/cli/board-live-cards-cli.d.cts +0 -179
- package/dist/cli/board-live-cards-cli.d.ts +0 -179
- package/dist/cli/board-live-cards-cli.js +0 -10592
- package/dist/cli/board-live-cards-cli.js.map +0 -1
- package/dist/journal-9HEgs7dU.d.ts +0 -28
- package/dist/journal-B-JCfQnh.d.cts +0 -28
- package/dist/schedule-Cszq9LYY.d.ts +0 -21
- package/dist/schedule-qWNL0RQh.d.cts +0 -21
- package/examples/browser/boards/portfolio-tracker/cards/holdings-table.json +0 -22
- package/examples/browser/boards/portfolio-tracker/cards/portfolio-form.json +0 -16
- package/examples/browser/boards/portfolio-tracker/cards/portfolio-risk-assessment.json +0 -28
- package/examples/browser/boards/portfolio-tracker/cards/portfolio-value.json +0 -15
- package/examples/browser/boards/portfolio-tracker/cards/price-fetch.json +0 -15
- package/examples/browser/boards/portfolio-tracker/cards/rebalancing-strategy.json +0 -28
- package/examples/browser/boards/portfolio-tracker/fetch-prices.js +0 -43
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.bat +0 -7
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +0 -351
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { ExecutionRef } from './execution-refs.cjs';
|
|
2
|
+
import { L as LiveCard, B as BoardStatusObject, J as JournalStorageAdapter, O as OutputStoreEvent } from './board-live-cards-lib-Bg6EvCo5.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* storage-interface.ts
|
|
6
|
+
*
|
|
7
|
+
* Three minimal storage primitives that together cover all persistence needs
|
|
8
|
+
* of the board-live-cards system. Any backend (Node fs, CosmosDB, Azure Blob,
|
|
9
|
+
* browser localStorage, in-memory test double) implements these three interfaces.
|
|
10
|
+
*
|
|
11
|
+
* The pure-logic stores in board-live-cards-all-stores.ts depend only on these
|
|
12
|
+
* interfaces — never on Node built-ins.
|
|
13
|
+
*
|
|
14
|
+
* Blob — raw string content at a logical, backend-neutral key
|
|
15
|
+
* Journal — append-only log with cursor-based reads
|
|
16
|
+
* KV — key-value store with list/delete
|
|
17
|
+
*
|
|
18
|
+
* Mapping to existing storage adapters:
|
|
19
|
+
*
|
|
20
|
+
* CardStorageAdapter
|
|
21
|
+
* inventory (cardId → { blobRef, checksum, fileMetadata? }) → KV
|
|
22
|
+
* card JSON files → Blob
|
|
23
|
+
* source output files → Blob
|
|
24
|
+
*
|
|
25
|
+
* JournalStorageAdapter → Journal (board-journal.jsonl)
|
|
26
|
+
*
|
|
27
|
+
* ExecutionRequestStore → KV (keyed by journalId, via createFsKvStorage)
|
|
28
|
+
*
|
|
29
|
+
* StateSnapshotStorageAdapter
|
|
30
|
+
* board-graph.json (packed single JSON, written atomically) → Blob
|
|
31
|
+
* per-card sidecars (cards/<id>/runtime, fetched-sources-manifest) → KV
|
|
32
|
+
*/
|
|
33
|
+
interface BlobStat {
|
|
34
|
+
key: string;
|
|
35
|
+
size: number;
|
|
36
|
+
updatedAt?: string;
|
|
37
|
+
contentType?: string;
|
|
38
|
+
}
|
|
39
|
+
interface BlobStorage {
|
|
40
|
+
/** Returns raw content string, or null if the blob does not exist. */
|
|
41
|
+
read(key: string): string | null;
|
|
42
|
+
/** Write content at key. Implementations should be atomic (write-rename). */
|
|
43
|
+
write(key: string, content: string): void;
|
|
44
|
+
/** Returns true if a blob exists at key. */
|
|
45
|
+
exists(key: string): boolean;
|
|
46
|
+
/** Delete the blob at key. No-op if it does not exist. */
|
|
47
|
+
remove(key: string): void;
|
|
48
|
+
/** Optional binary read for file-like artifacts. */
|
|
49
|
+
readBytes?(key: string): Uint8Array | null;
|
|
50
|
+
/** Optional binary write for file-like artifacts. */
|
|
51
|
+
writeBytes?(key: string, content: Uint8Array): void;
|
|
52
|
+
/** Optional key listing by prefix. */
|
|
53
|
+
listKeys?(prefix?: string): string[];
|
|
54
|
+
/** Optional metadata lookup. */
|
|
55
|
+
stat?(key: string): BlobStat | null;
|
|
56
|
+
}
|
|
57
|
+
interface KindValueRef {
|
|
58
|
+
readonly kind: string;
|
|
59
|
+
readonly value: string;
|
|
60
|
+
}
|
|
61
|
+
/** Serialize a KindValueRef to the wire format: ::kind::value */
|
|
62
|
+
declare function serializeRef(ref: KindValueRef): string;
|
|
63
|
+
/** Parse a wire-format ref string (::kind::value) into a KindValueRef. */
|
|
64
|
+
declare function parseRef(s: string): KindValueRef;
|
|
65
|
+
interface KVStorage {
|
|
66
|
+
/** Returns the stored value, or null if the key does not exist. */
|
|
67
|
+
read(key: string): unknown | null;
|
|
68
|
+
/** Write value at key. Overwrites any existing value. */
|
|
69
|
+
write(key: string, value: unknown): void;
|
|
70
|
+
/** Delete the key. No-op if it does not exist. */
|
|
71
|
+
delete(key: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* List all keys, optionally filtered to those starting with prefix.
|
|
74
|
+
* Order is implementation-defined.
|
|
75
|
+
*/
|
|
76
|
+
listKeys(prefix?: string): string[];
|
|
77
|
+
}
|
|
78
|
+
interface AtomicRelayLock {
|
|
79
|
+
/**
|
|
80
|
+
* Attempt to acquire the lock without blocking.
|
|
81
|
+
* Returns a `release` function if successful, or `null` if the lock is
|
|
82
|
+
* already held by another actor (relay: that actor will complete the work).
|
|
83
|
+
*/
|
|
84
|
+
tryAcquire(): (() => void) | null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* board-live-cards-public.ts
|
|
89
|
+
*
|
|
90
|
+
* Platform-free public API layer for the board-live-cards system.
|
|
91
|
+
*
|
|
92
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
93
|
+
* LAYER DIAGRAM
|
|
94
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
95
|
+
*
|
|
96
|
+
* board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
|
|
97
|
+
* ↓ calls
|
|
98
|
+
* board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
|
|
99
|
+
* ↓ depends on injected
|
|
100
|
+
* board-live-cards-lib.ts (pure domain — stores, graph, codecs)
|
|
101
|
+
*
|
|
102
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
* PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
|
|
104
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
105
|
+
*
|
|
106
|
+
* Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
|
|
107
|
+
* Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
|
|
108
|
+
* Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
|
|
109
|
+
* In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
|
|
110
|
+
*
|
|
111
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
112
|
+
* USAGE
|
|
113
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
114
|
+
*
|
|
115
|
+
* const board = createBoardLiveCardsPublic(baseRef, adapter);
|
|
116
|
+
* const result = await board.processAccumulatedEvents();
|
|
117
|
+
* const status = board.status();
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
type CommandInput = {
|
|
121
|
+
params?: Record<string, string | number | boolean>;
|
|
122
|
+
body?: unknown;
|
|
123
|
+
};
|
|
124
|
+
type CommandResult<T = undefined> = (T extends undefined ? {
|
|
125
|
+
status: 'success';
|
|
126
|
+
} : {
|
|
127
|
+
status: 'success';
|
|
128
|
+
data: T;
|
|
129
|
+
}) | {
|
|
130
|
+
status: 'fail';
|
|
131
|
+
error: string;
|
|
132
|
+
} | {
|
|
133
|
+
status: 'error';
|
|
134
|
+
error: string;
|
|
135
|
+
};
|
|
136
|
+
interface BoardPlatformAdapter {
|
|
137
|
+
/**
|
|
138
|
+
* KV storage factory — scoped by namespace.
|
|
139
|
+
* Namespaces used by the public layer:
|
|
140
|
+
* 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
|
|
141
|
+
* 'config' — board configuration (.task-executor, .chat-handler, .card-store-ref)
|
|
142
|
+
* 'card-upsert' — card upsert dedup index
|
|
143
|
+
* 'execution-requests' — queued execution requests (keyed by journalId)
|
|
144
|
+
* 'card-runtime' — card runtime state snapshots
|
|
145
|
+
* 'output' — published board status + card computed outputs
|
|
146
|
+
*/
|
|
147
|
+
kvStorage(namespace: string): KVStorage;
|
|
148
|
+
/**
|
|
149
|
+
* Build a KVStorage rooted at the given ref.
|
|
150
|
+
* Used by the public layer for both card store and outputs store routing.
|
|
151
|
+
* FS: createFsKvStorage(parseRef(ref).value)
|
|
152
|
+
* localStorage: createLocalStorageKvStorage(parseRef(ref).value)
|
|
153
|
+
*/
|
|
154
|
+
kvStorageForRef(ref: string): KVStorage;
|
|
155
|
+
/**
|
|
156
|
+
* Blob storage factory — scoped by namespace.
|
|
157
|
+
* Namespaces used by the public layer:
|
|
158
|
+
* 'sources' — fetched source data files (keyed by cardId/outputFile)
|
|
159
|
+
* '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
|
|
160
|
+
*/
|
|
161
|
+
blobStorage(namespace: string): BlobStorage;
|
|
162
|
+
/**
|
|
163
|
+
* Journal storage adapter (append-only log).
|
|
164
|
+
* Uses the lib's JournalStorageAdapter interface.
|
|
165
|
+
* One journal per board — no namespace parameter needed.
|
|
166
|
+
*/
|
|
167
|
+
journalAdapter(): JournalStorageAdapter;
|
|
168
|
+
/**
|
|
169
|
+
* AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
|
|
170
|
+
* Guards processAccumulatedEvents drain cycle.
|
|
171
|
+
* FS: proper-lockfile (createFsAtomicRelayLock)
|
|
172
|
+
* Azure: blob lease
|
|
173
|
+
* Firestore: Firestore transaction + sentinel document
|
|
174
|
+
*/
|
|
175
|
+
lock: AtomicRelayLock;
|
|
176
|
+
/**
|
|
177
|
+
* Self-identity ExecutionRef — how to invoke THIS board instance.
|
|
178
|
+
* Embedded in source callback tokens so executors know where to report back.
|
|
179
|
+
* Node/FS: { howToRun: 'local-node', whatToRun: '::fs-path::/path/to/cli.js' }
|
|
180
|
+
* Azure Fn: { howToRun: 'http:post', whatToRun: '::http-url::https://…/api/board' }
|
|
181
|
+
*/
|
|
182
|
+
selfRef: ExecutionRef;
|
|
183
|
+
/**
|
|
184
|
+
* Generic execution dispatch — platform adapts ExecutionRef → actual transport.
|
|
185
|
+
* Public layer constructs fully-formed semantic args (source def, base_ref,
|
|
186
|
+
* callback token with selfRef baked in). Platform handles transport:
|
|
187
|
+
* Node: writes args to temp file, spawns detached process
|
|
188
|
+
* Azure: HTTP POST args as JSON body
|
|
189
|
+
* Firebase: publishes args as pubsub message
|
|
190
|
+
*/
|
|
191
|
+
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
192
|
+
dispatched: boolean;
|
|
193
|
+
error?: string;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve a blob ref to its string contents.
|
|
197
|
+
* The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
|
|
198
|
+
* Throws if the blob does not exist.
|
|
199
|
+
*/
|
|
200
|
+
resolveBlob(ref: KindValueRef): string;
|
|
201
|
+
/**
|
|
202
|
+
* Compute a stable, deterministic content hash for any JSON-serializable value.
|
|
203
|
+
* Used for dedup indexes and snapshot versioning.
|
|
204
|
+
* Node/FS: computeStableJsonHash (storage-fs-adapters)
|
|
205
|
+
* Browser: Web Crypto subtle.digest or equivalent
|
|
206
|
+
*/
|
|
207
|
+
hashFn(value: unknown): string;
|
|
208
|
+
/**
|
|
209
|
+
* Generate a random short ID (32 hex chars).
|
|
210
|
+
* Used for commit IDs and delivery tokens.
|
|
211
|
+
* Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
|
|
212
|
+
* Browser: crypto.randomUUID().replace(/-/g, '')
|
|
213
|
+
*/
|
|
214
|
+
genId(): string;
|
|
215
|
+
/**
|
|
216
|
+
* Request an additional drain pass asynchronously (e.g. spawn a background process).
|
|
217
|
+
* Called as the relay continuation after each drain cycle so that events written
|
|
218
|
+
* during the cycle (e.g. task-completed appended by the card handler) are eventually
|
|
219
|
+
* processed even when the current process exits immediately after returning.
|
|
220
|
+
* Optional — if absent, no continuation is scheduled.
|
|
221
|
+
*/
|
|
222
|
+
requestProcessAccumulated?(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
|
|
225
|
+
* Called once per drain cycle with the complete batch of notifications produced in that cycle.
|
|
226
|
+
*/
|
|
227
|
+
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
228
|
+
/** Optional warn sink — defaults to no-op. */
|
|
229
|
+
onWarn?(msg: string): void;
|
|
230
|
+
}
|
|
231
|
+
interface BoardLiveCardsPublic {
|
|
232
|
+
init(input: CommandInput): CommandResult;
|
|
233
|
+
status(input: CommandInput): CommandResult<BoardStatusObject>;
|
|
234
|
+
getCardStoreRef(input: CommandInput): CommandResult<{
|
|
235
|
+
storeRef: string;
|
|
236
|
+
}>;
|
|
237
|
+
getOutputsStoreRef(input: CommandInput): CommandResult<{
|
|
238
|
+
storeRef: string;
|
|
239
|
+
}>;
|
|
240
|
+
getOutputsDataObject(input: CommandInput): CommandResult;
|
|
241
|
+
getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
242
|
+
getOutputsComputedValues(input: CommandInput): CommandResult;
|
|
243
|
+
getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
244
|
+
removeCard(input: CommandInput): CommandResult;
|
|
245
|
+
retrigger(input: CommandInput): CommandResult;
|
|
246
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
247
|
+
upsertCard(input: CommandInput): CommandResult;
|
|
248
|
+
taskFailed(input: CommandInput): CommandResult;
|
|
249
|
+
taskProgress(input: CommandInput): CommandResult;
|
|
250
|
+
sourceDataFetched(input: CommandInput): CommandResult;
|
|
251
|
+
sourceDataFetchFailure(input: CommandInput): CommandResult;
|
|
252
|
+
}
|
|
253
|
+
type BoardChangeNotification = OutputStoreEvent | {
|
|
254
|
+
kind: 'card_refreshed';
|
|
255
|
+
cardId: string;
|
|
256
|
+
card: LiveCard;
|
|
257
|
+
};
|
|
258
|
+
declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter): BoardLiveCardsPublic;
|
|
259
|
+
interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
260
|
+
/**
|
|
261
|
+
* Synchronously invoke a task executor subcommand and return stdout.
|
|
262
|
+
* Throws on non-zero exit or timeout.
|
|
263
|
+
*/
|
|
264
|
+
invokeExecutorSync(ref: ExecutionRef, subcommand: string, args: string[], opts?: {
|
|
265
|
+
timeout?: number;
|
|
266
|
+
}): string;
|
|
267
|
+
/** Schema-only card validator (no executor invocation). */
|
|
268
|
+
validateSchema(card: Record<string, unknown>): {
|
|
269
|
+
ok: boolean;
|
|
270
|
+
errors: string[];
|
|
271
|
+
};
|
|
272
|
+
/** Create a temp file path for I/O staging — absolute, board-scoped. */
|
|
273
|
+
makeTempFilePath(label: string, ext?: string): string;
|
|
274
|
+
/** Absolute-path blob I/O for temp files and card file references. */
|
|
275
|
+
absoluteBlob: BlobStorage;
|
|
276
|
+
}
|
|
277
|
+
interface BoardLiveCardsNonCorePublic {
|
|
278
|
+
/** params: cardId? or all?; returns array even for single card */
|
|
279
|
+
validateCard(input: CommandInput): CommandResult<Array<{
|
|
280
|
+
cardId: string;
|
|
281
|
+
isValid: boolean;
|
|
282
|
+
issues: string[];
|
|
283
|
+
}>>;
|
|
284
|
+
/** body: { "card-content": <card> } — card JSON arrives via stdin */
|
|
285
|
+
validateTmpCard(input: CommandInput): CommandResult<{
|
|
286
|
+
cardId: string;
|
|
287
|
+
isValid: boolean;
|
|
288
|
+
issues: string[];
|
|
289
|
+
}>;
|
|
290
|
+
/** params: cardId, sourceIdx, outRef?; body — mockProjections object */
|
|
291
|
+
probeSource(input: CommandInput): CommandResult;
|
|
292
|
+
/** body: { sourceDef, mockProjections }; params: outRef? */
|
|
293
|
+
probeTmpSource(input: CommandInput): CommandResult;
|
|
294
|
+
/** no params needed */
|
|
295
|
+
describeTaskExecutorCapabilities(input: CommandInput): CommandResult;
|
|
296
|
+
/**
|
|
297
|
+
* Write/update cards in the configured card store.
|
|
298
|
+
* body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
|
|
299
|
+
*/
|
|
300
|
+
updatesInCardStore(input: CommandInput): CommandResult;
|
|
301
|
+
/**
|
|
302
|
+
* Read cards from the configured card store by id.
|
|
303
|
+
* body: { ids: string[] }
|
|
304
|
+
*/
|
|
305
|
+
readFromCardStore(input: CommandInput): CommandResult<{
|
|
306
|
+
cards: Array<{
|
|
307
|
+
id: string;
|
|
308
|
+
'card-content': LiveCard | null;
|
|
309
|
+
}>;
|
|
310
|
+
}>;
|
|
311
|
+
}
|
|
312
|
+
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
|
|
313
|
+
|
|
314
|
+
export { type BoardPlatformAdapter as B, type CommandInput as C, type KindValueRef as K, type CommandResult as a, type BlobStorage as b, type BoardNonCorePlatformAdapter as c, type BoardLiveCardsNonCorePublic as d, type BoardLiveCardsPublic as e, createBoardLiveCardsNonCorePublic as f, createBoardLiveCardsPublic as g, parseRef as p, serializeRef as s };
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { ExecutionRef } from './execution-refs.js';
|
|
2
|
+
import { L as LiveCard, B as BoardStatusObject, J as JournalStorageAdapter, O as OutputStoreEvent } from './board-live-cards-lib-jM2uYG1v.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* storage-interface.ts
|
|
6
|
+
*
|
|
7
|
+
* Three minimal storage primitives that together cover all persistence needs
|
|
8
|
+
* of the board-live-cards system. Any backend (Node fs, CosmosDB, Azure Blob,
|
|
9
|
+
* browser localStorage, in-memory test double) implements these three interfaces.
|
|
10
|
+
*
|
|
11
|
+
* The pure-logic stores in board-live-cards-all-stores.ts depend only on these
|
|
12
|
+
* interfaces — never on Node built-ins.
|
|
13
|
+
*
|
|
14
|
+
* Blob — raw string content at a logical, backend-neutral key
|
|
15
|
+
* Journal — append-only log with cursor-based reads
|
|
16
|
+
* KV — key-value store with list/delete
|
|
17
|
+
*
|
|
18
|
+
* Mapping to existing storage adapters:
|
|
19
|
+
*
|
|
20
|
+
* CardStorageAdapter
|
|
21
|
+
* inventory (cardId → { blobRef, checksum, fileMetadata? }) → KV
|
|
22
|
+
* card JSON files → Blob
|
|
23
|
+
* source output files → Blob
|
|
24
|
+
*
|
|
25
|
+
* JournalStorageAdapter → Journal (board-journal.jsonl)
|
|
26
|
+
*
|
|
27
|
+
* ExecutionRequestStore → KV (keyed by journalId, via createFsKvStorage)
|
|
28
|
+
*
|
|
29
|
+
* StateSnapshotStorageAdapter
|
|
30
|
+
* board-graph.json (packed single JSON, written atomically) → Blob
|
|
31
|
+
* per-card sidecars (cards/<id>/runtime, fetched-sources-manifest) → KV
|
|
32
|
+
*/
|
|
33
|
+
interface BlobStat {
|
|
34
|
+
key: string;
|
|
35
|
+
size: number;
|
|
36
|
+
updatedAt?: string;
|
|
37
|
+
contentType?: string;
|
|
38
|
+
}
|
|
39
|
+
interface BlobStorage {
|
|
40
|
+
/** Returns raw content string, or null if the blob does not exist. */
|
|
41
|
+
read(key: string): string | null;
|
|
42
|
+
/** Write content at key. Implementations should be atomic (write-rename). */
|
|
43
|
+
write(key: string, content: string): void;
|
|
44
|
+
/** Returns true if a blob exists at key. */
|
|
45
|
+
exists(key: string): boolean;
|
|
46
|
+
/** Delete the blob at key. No-op if it does not exist. */
|
|
47
|
+
remove(key: string): void;
|
|
48
|
+
/** Optional binary read for file-like artifacts. */
|
|
49
|
+
readBytes?(key: string): Uint8Array | null;
|
|
50
|
+
/** Optional binary write for file-like artifacts. */
|
|
51
|
+
writeBytes?(key: string, content: Uint8Array): void;
|
|
52
|
+
/** Optional key listing by prefix. */
|
|
53
|
+
listKeys?(prefix?: string): string[];
|
|
54
|
+
/** Optional metadata lookup. */
|
|
55
|
+
stat?(key: string): BlobStat | null;
|
|
56
|
+
}
|
|
57
|
+
interface KindValueRef {
|
|
58
|
+
readonly kind: string;
|
|
59
|
+
readonly value: string;
|
|
60
|
+
}
|
|
61
|
+
/** Serialize a KindValueRef to the wire format: ::kind::value */
|
|
62
|
+
declare function serializeRef(ref: KindValueRef): string;
|
|
63
|
+
/** Parse a wire-format ref string (::kind::value) into a KindValueRef. */
|
|
64
|
+
declare function parseRef(s: string): KindValueRef;
|
|
65
|
+
interface KVStorage {
|
|
66
|
+
/** Returns the stored value, or null if the key does not exist. */
|
|
67
|
+
read(key: string): unknown | null;
|
|
68
|
+
/** Write value at key. Overwrites any existing value. */
|
|
69
|
+
write(key: string, value: unknown): void;
|
|
70
|
+
/** Delete the key. No-op if it does not exist. */
|
|
71
|
+
delete(key: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* List all keys, optionally filtered to those starting with prefix.
|
|
74
|
+
* Order is implementation-defined.
|
|
75
|
+
*/
|
|
76
|
+
listKeys(prefix?: string): string[];
|
|
77
|
+
}
|
|
78
|
+
interface AtomicRelayLock {
|
|
79
|
+
/**
|
|
80
|
+
* Attempt to acquire the lock without blocking.
|
|
81
|
+
* Returns a `release` function if successful, or `null` if the lock is
|
|
82
|
+
* already held by another actor (relay: that actor will complete the work).
|
|
83
|
+
*/
|
|
84
|
+
tryAcquire(): (() => void) | null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* board-live-cards-public.ts
|
|
89
|
+
*
|
|
90
|
+
* Platform-free public API layer for the board-live-cards system.
|
|
91
|
+
*
|
|
92
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
93
|
+
* LAYER DIAGRAM
|
|
94
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
95
|
+
*
|
|
96
|
+
* board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
|
|
97
|
+
* ↓ calls
|
|
98
|
+
* board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
|
|
99
|
+
* ↓ depends on injected
|
|
100
|
+
* board-live-cards-lib.ts (pure domain — stores, graph, codecs)
|
|
101
|
+
*
|
|
102
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
* PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
|
|
104
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
105
|
+
*
|
|
106
|
+
* Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
|
|
107
|
+
* Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
|
|
108
|
+
* Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
|
|
109
|
+
* In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
|
|
110
|
+
*
|
|
111
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
112
|
+
* USAGE
|
|
113
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
114
|
+
*
|
|
115
|
+
* const board = createBoardLiveCardsPublic(baseRef, adapter);
|
|
116
|
+
* const result = await board.processAccumulatedEvents();
|
|
117
|
+
* const status = board.status();
|
|
118
|
+
*/
|
|
119
|
+
|
|
120
|
+
type CommandInput = {
|
|
121
|
+
params?: Record<string, string | number | boolean>;
|
|
122
|
+
body?: unknown;
|
|
123
|
+
};
|
|
124
|
+
type CommandResult<T = undefined> = (T extends undefined ? {
|
|
125
|
+
status: 'success';
|
|
126
|
+
} : {
|
|
127
|
+
status: 'success';
|
|
128
|
+
data: T;
|
|
129
|
+
}) | {
|
|
130
|
+
status: 'fail';
|
|
131
|
+
error: string;
|
|
132
|
+
} | {
|
|
133
|
+
status: 'error';
|
|
134
|
+
error: string;
|
|
135
|
+
};
|
|
136
|
+
interface BoardPlatformAdapter {
|
|
137
|
+
/**
|
|
138
|
+
* KV storage factory — scoped by namespace.
|
|
139
|
+
* Namespaces used by the public layer:
|
|
140
|
+
* 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
|
|
141
|
+
* 'config' — board configuration (.task-executor, .chat-handler, .card-store-ref)
|
|
142
|
+
* 'card-upsert' — card upsert dedup index
|
|
143
|
+
* 'execution-requests' — queued execution requests (keyed by journalId)
|
|
144
|
+
* 'card-runtime' — card runtime state snapshots
|
|
145
|
+
* 'output' — published board status + card computed outputs
|
|
146
|
+
*/
|
|
147
|
+
kvStorage(namespace: string): KVStorage;
|
|
148
|
+
/**
|
|
149
|
+
* Build a KVStorage rooted at the given ref.
|
|
150
|
+
* Used by the public layer for both card store and outputs store routing.
|
|
151
|
+
* FS: createFsKvStorage(parseRef(ref).value)
|
|
152
|
+
* localStorage: createLocalStorageKvStorage(parseRef(ref).value)
|
|
153
|
+
*/
|
|
154
|
+
kvStorageForRef(ref: string): KVStorage;
|
|
155
|
+
/**
|
|
156
|
+
* Blob storage factory — scoped by namespace.
|
|
157
|
+
* Namespaces used by the public layer:
|
|
158
|
+
* 'sources' — fetched source data files (keyed by cardId/outputFile)
|
|
159
|
+
* '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
|
|
160
|
+
*/
|
|
161
|
+
blobStorage(namespace: string): BlobStorage;
|
|
162
|
+
/**
|
|
163
|
+
* Journal storage adapter (append-only log).
|
|
164
|
+
* Uses the lib's JournalStorageAdapter interface.
|
|
165
|
+
* One journal per board — no namespace parameter needed.
|
|
166
|
+
*/
|
|
167
|
+
journalAdapter(): JournalStorageAdapter;
|
|
168
|
+
/**
|
|
169
|
+
* AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
|
|
170
|
+
* Guards processAccumulatedEvents drain cycle.
|
|
171
|
+
* FS: proper-lockfile (createFsAtomicRelayLock)
|
|
172
|
+
* Azure: blob lease
|
|
173
|
+
* Firestore: Firestore transaction + sentinel document
|
|
174
|
+
*/
|
|
175
|
+
lock: AtomicRelayLock;
|
|
176
|
+
/**
|
|
177
|
+
* Self-identity ExecutionRef — how to invoke THIS board instance.
|
|
178
|
+
* Embedded in source callback tokens so executors know where to report back.
|
|
179
|
+
* Node/FS: { howToRun: 'local-node', whatToRun: '::fs-path::/path/to/cli.js' }
|
|
180
|
+
* Azure Fn: { howToRun: 'http:post', whatToRun: '::http-url::https://…/api/board' }
|
|
181
|
+
*/
|
|
182
|
+
selfRef: ExecutionRef;
|
|
183
|
+
/**
|
|
184
|
+
* Generic execution dispatch — platform adapts ExecutionRef → actual transport.
|
|
185
|
+
* Public layer constructs fully-formed semantic args (source def, base_ref,
|
|
186
|
+
* callback token with selfRef baked in). Platform handles transport:
|
|
187
|
+
* Node: writes args to temp file, spawns detached process
|
|
188
|
+
* Azure: HTTP POST args as JSON body
|
|
189
|
+
* Firebase: publishes args as pubsub message
|
|
190
|
+
*/
|
|
191
|
+
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
192
|
+
dispatched: boolean;
|
|
193
|
+
error?: string;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve a blob ref to its string contents.
|
|
197
|
+
* The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
|
|
198
|
+
* Throws if the blob does not exist.
|
|
199
|
+
*/
|
|
200
|
+
resolveBlob(ref: KindValueRef): string;
|
|
201
|
+
/**
|
|
202
|
+
* Compute a stable, deterministic content hash for any JSON-serializable value.
|
|
203
|
+
* Used for dedup indexes and snapshot versioning.
|
|
204
|
+
* Node/FS: computeStableJsonHash (storage-fs-adapters)
|
|
205
|
+
* Browser: Web Crypto subtle.digest or equivalent
|
|
206
|
+
*/
|
|
207
|
+
hashFn(value: unknown): string;
|
|
208
|
+
/**
|
|
209
|
+
* Generate a random short ID (32 hex chars).
|
|
210
|
+
* Used for commit IDs and delivery tokens.
|
|
211
|
+
* Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
|
|
212
|
+
* Browser: crypto.randomUUID().replace(/-/g, '')
|
|
213
|
+
*/
|
|
214
|
+
genId(): string;
|
|
215
|
+
/**
|
|
216
|
+
* Request an additional drain pass asynchronously (e.g. spawn a background process).
|
|
217
|
+
* Called as the relay continuation after each drain cycle so that events written
|
|
218
|
+
* during the cycle (e.g. task-completed appended by the card handler) are eventually
|
|
219
|
+
* processed even when the current process exits immediately after returning.
|
|
220
|
+
* Optional — if absent, no continuation is scheduled.
|
|
221
|
+
*/
|
|
222
|
+
requestProcessAccumulated?(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
|
|
225
|
+
* Called once per drain cycle with the complete batch of notifications produced in that cycle.
|
|
226
|
+
*/
|
|
227
|
+
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
228
|
+
/** Optional warn sink — defaults to no-op. */
|
|
229
|
+
onWarn?(msg: string): void;
|
|
230
|
+
}
|
|
231
|
+
interface BoardLiveCardsPublic {
|
|
232
|
+
init(input: CommandInput): CommandResult;
|
|
233
|
+
status(input: CommandInput): CommandResult<BoardStatusObject>;
|
|
234
|
+
getCardStoreRef(input: CommandInput): CommandResult<{
|
|
235
|
+
storeRef: string;
|
|
236
|
+
}>;
|
|
237
|
+
getOutputsStoreRef(input: CommandInput): CommandResult<{
|
|
238
|
+
storeRef: string;
|
|
239
|
+
}>;
|
|
240
|
+
getOutputsDataObject(input: CommandInput): CommandResult;
|
|
241
|
+
getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
242
|
+
getOutputsComputedValues(input: CommandInput): CommandResult;
|
|
243
|
+
getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
|
|
244
|
+
removeCard(input: CommandInput): CommandResult;
|
|
245
|
+
retrigger(input: CommandInput): CommandResult;
|
|
246
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
247
|
+
upsertCard(input: CommandInput): CommandResult;
|
|
248
|
+
taskFailed(input: CommandInput): CommandResult;
|
|
249
|
+
taskProgress(input: CommandInput): CommandResult;
|
|
250
|
+
sourceDataFetched(input: CommandInput): CommandResult;
|
|
251
|
+
sourceDataFetchFailure(input: CommandInput): CommandResult;
|
|
252
|
+
}
|
|
253
|
+
type BoardChangeNotification = OutputStoreEvent | {
|
|
254
|
+
kind: 'card_refreshed';
|
|
255
|
+
cardId: string;
|
|
256
|
+
card: LiveCard;
|
|
257
|
+
};
|
|
258
|
+
declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter): BoardLiveCardsPublic;
|
|
259
|
+
interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
|
|
260
|
+
/**
|
|
261
|
+
* Synchronously invoke a task executor subcommand and return stdout.
|
|
262
|
+
* Throws on non-zero exit or timeout.
|
|
263
|
+
*/
|
|
264
|
+
invokeExecutorSync(ref: ExecutionRef, subcommand: string, args: string[], opts?: {
|
|
265
|
+
timeout?: number;
|
|
266
|
+
}): string;
|
|
267
|
+
/** Schema-only card validator (no executor invocation). */
|
|
268
|
+
validateSchema(card: Record<string, unknown>): {
|
|
269
|
+
ok: boolean;
|
|
270
|
+
errors: string[];
|
|
271
|
+
};
|
|
272
|
+
/** Create a temp file path for I/O staging — absolute, board-scoped. */
|
|
273
|
+
makeTempFilePath(label: string, ext?: string): string;
|
|
274
|
+
/** Absolute-path blob I/O for temp files and card file references. */
|
|
275
|
+
absoluteBlob: BlobStorage;
|
|
276
|
+
}
|
|
277
|
+
interface BoardLiveCardsNonCorePublic {
|
|
278
|
+
/** params: cardId? or all?; returns array even for single card */
|
|
279
|
+
validateCard(input: CommandInput): CommandResult<Array<{
|
|
280
|
+
cardId: string;
|
|
281
|
+
isValid: boolean;
|
|
282
|
+
issues: string[];
|
|
283
|
+
}>>;
|
|
284
|
+
/** body: { "card-content": <card> } — card JSON arrives via stdin */
|
|
285
|
+
validateTmpCard(input: CommandInput): CommandResult<{
|
|
286
|
+
cardId: string;
|
|
287
|
+
isValid: boolean;
|
|
288
|
+
issues: string[];
|
|
289
|
+
}>;
|
|
290
|
+
/** params: cardId, sourceIdx, outRef?; body — mockProjections object */
|
|
291
|
+
probeSource(input: CommandInput): CommandResult;
|
|
292
|
+
/** body: { sourceDef, mockProjections }; params: outRef? */
|
|
293
|
+
probeTmpSource(input: CommandInput): CommandResult;
|
|
294
|
+
/** no params needed */
|
|
295
|
+
describeTaskExecutorCapabilities(input: CommandInput): CommandResult;
|
|
296
|
+
/**
|
|
297
|
+
* Write/update cards in the configured card store.
|
|
298
|
+
* body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
|
|
299
|
+
*/
|
|
300
|
+
updatesInCardStore(input: CommandInput): CommandResult;
|
|
301
|
+
/**
|
|
302
|
+
* Read cards from the configured card store by id.
|
|
303
|
+
* body: { ids: string[] }
|
|
304
|
+
*/
|
|
305
|
+
readFromCardStore(input: CommandInput): CommandResult<{
|
|
306
|
+
cards: Array<{
|
|
307
|
+
id: string;
|
|
308
|
+
'card-content': LiveCard | null;
|
|
309
|
+
}>;
|
|
310
|
+
}>;
|
|
311
|
+
}
|
|
312
|
+
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
|
|
313
|
+
|
|
314
|
+
export { type BoardPlatformAdapter as B, type CommandInput as C, type KindValueRef as K, type CommandResult as a, type BlobStorage as b, type BoardNonCorePlatformAdapter as c, type BoardLiveCardsNonCorePublic as d, type BoardLiveCardsPublic as e, createBoardLiveCardsNonCorePublic as f, createBoardLiveCardsPublic as g, parseRef as p, serializeRef as s };
|