yaml-flow 5.4.2 → 7.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 +6 -6
- package/browser/asset-integrity.json +10 -0
- package/browser/board-livecards-client.js +2 -0
- package/browser/board-livecards-client.js.map +1 -0
- package/browser/board-livecards-localstorage.js +10 -0
- package/browser/board-livecards-localstorage.js.map +1 -0
- package/browser/board-livegraph-engine.js +2 -1676
- package/browser/board-livegraph-engine.js.map +1 -1
- package/browser/card-compute.js +28 -28
- package/browser/compute-jsonata.js +5 -0
- package/browser/compute-jsonata.js.map +1 -0
- package/browser/live-cards.js +561 -129
- 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-CW5074xr.d.cts +318 -0
- package/dist/board-live-cards-public-hnZo0mAf.d.ts +318 -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 +12 -11
- package/dist/board-livegraph-runtime/index.d.ts +12 -11
- 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 +7623 -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 +27 -1
- package/dist/card-compute/index.d.ts +27 -1
- package/dist/card-compute/index.js +9 -7145
- package/dist/card-compute/index.js.map +1 -1
- package/dist/card-compute/jsonata-sync.cjs +7623 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +3 -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 +37 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.d.ts +37 -0
- package/dist/cli/browser-api/board-live-cards-browser-adapter.js +3 -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 +7623 -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/execution-adapter.cjs +3 -0
- package/dist/cli/node/execution-adapter.cjs.map +1 -0
- package/dist/cli/node/execution-adapter.d.cts +174 -0
- package/dist/cli/node/execution-adapter.d.ts +174 -0
- package/dist/cli/node/execution-adapter.js +3 -0
- package/dist/cli/node/execution-adapter.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 +7623 -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 +7623 -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 +3 -0
- package/dist/execution-refs.cjs.map +1 -0
- package/dist/execution-refs.d.cts +260 -0
- package/dist/execution-refs.d.ts +260 -0
- package/dist/execution-refs.js +3 -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 +7623 -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/server-runtime/index.cjs +9 -0
- package/dist/server-runtime/index.cjs.map +1 -0
- package/dist/server-runtime/index.d.cts +31 -0
- package/dist/server-runtime/index.d.ts +31 -0
- package/dist/server-runtime/index.js +9 -0
- package/dist/server-runtime/index.js.map +1 -0
- package/dist/server-runtime/jsonata-sync.cjs +7623 -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/step-machine-public/index.cjs +2 -0
- package/dist/step-machine-public/index.cjs.map +1 -0
- package/dist/step-machine-public/index.d.cts +159 -0
- package/dist/step-machine-public/index.d.ts +159 -0
- package/dist/step-machine-public/index.js +2 -0
- package/dist/step-machine-public/index.js.map +1 -0
- package/dist/step-machine-public/jsonata-sync.cjs +7623 -0
- package/dist/storage-refs.cjs +10 -0
- package/dist/storage-refs.cjs.map +1 -0
- package/dist/storage-refs.d.cts +93 -0
- package/dist/storage-refs.d.ts +93 -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/dist/types-B1ZRa4aI.d.ts +147 -0
- package/dist/types-BxEFcVK9.d.cts +147 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-t4.js +291 -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-http-test.js +357 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +25 -16
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-public.js +552 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.js +300 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-server.py +617 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-sse-worker.js +48 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +366 -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 +70 -3
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +16 -11
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +9 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +49 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/reset-board-dir-cli.js +2 -6
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +4 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +3 -7
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +9 -8
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +12 -17
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers/write-prices-cli.js +2 -6
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +107 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +51 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +45 -0
- package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +71 -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 +36 -187
- 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 +43 -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/cli/step-machine-demo/jsonata-init-board-cli.js +8 -13
- package/examples/cli/step-machine-demo/jsonata-init-board.flow.yaml +33 -9
- package/examples/cli/step-machine-demo/one-step-cli-only.flow.yaml +3 -1
- package/examples/cli/step-machine-demo/step2-double-cli.js +6 -12
- package/examples/cli/step-machine-demo/two-step-math.flow.yaml +66 -4
- package/examples/cli/step-machine-demo/two-step-mixed.flow.yaml +13 -5
- package/examples/example-board/agent-instructions.md +11 -5
- package/examples/example-board/cards/_index.json +47 -0
- package/examples/example-board/cards/card-market-prices.json +33 -9
- package/examples/example-board/cards/card-my-identity.json +30 -6
- package/examples/example-board/cards/card-portfolio-action.json +24 -6
- package/examples/example-board/cards/card-portfolio-intelligence.json +97 -0
- package/examples/example-board/cards/card-portfolio-risks.json +24 -6
- package/examples/example-board/cards/card-portfolio-value.json +38 -10
- package/examples/example-board/cards/card-portfolio.json +57 -13
- package/examples/example-board/cards/card-rebalance-impact.json +22 -6
- package/examples/example-board/cards/card-rebalance-sim.json +66 -15
- 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 +366 -68
- package/examples/example-board/demo-shell-localstorage.html +774 -0
- package/examples/example-board/demo-shell-with-server.html +20 -37
- package/examples/example-board/demo-shell.html +5 -4
- package/examples/example-board/demo-task-executor.js +273 -275
- 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 +46 -8
- package/schema/live-cards.schema.json +418 -132
- package/step-machine-cli.js +43 -310
- package/board-livecards-server-runtime.js +0 -1574
- package/browser/board-livecards-runtime-client.js +0 -263
- package/dist/cli/board-live-cards-cli.cjs +0 -10650
- 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 -10598
- 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
- package/examples/cli/step-machine-demo/two-step-math-handlers.js +0 -32
- package/examples/cli/step-machine-demo/two-step-mixed-handlers.js +0 -24
- package/examples/example-board/demo-shell-browser.html +0 -674
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { f as GraphEvent } from './types-BBhqYGhE.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Continuous Event Graph — Journal
|
|
5
|
-
*
|
|
6
|
-
* Append-only event log for the reactive layer.
|
|
7
|
-
* Handlers append events here; drain() reads and clears atomically.
|
|
8
|
-
*
|
|
9
|
-
* Adapter:
|
|
10
|
-
* - MemoryJournal: in-process array (default)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
interface Journal {
|
|
14
|
-
/** Append an event to the journal. Safe to call from concurrent callbacks. */
|
|
15
|
-
append(event: GraphEvent): void;
|
|
16
|
-
/** Read all pending events and clear the journal atomically. */
|
|
17
|
-
drain(): GraphEvent[];
|
|
18
|
-
/** Number of pending events (for observability). */
|
|
19
|
-
readonly size: number;
|
|
20
|
-
}
|
|
21
|
-
declare class MemoryJournal implements Journal {
|
|
22
|
-
private buffer;
|
|
23
|
-
append(event: GraphEvent): void;
|
|
24
|
-
drain(): GraphEvent[];
|
|
25
|
-
get size(): number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { type Journal as J, MemoryJournal as M };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { f as GraphEvent } from './types-BBhqYGhE.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Continuous Event Graph — Journal
|
|
5
|
-
*
|
|
6
|
-
* Append-only event log for the reactive layer.
|
|
7
|
-
* Handlers append events here; drain() reads and clears atomically.
|
|
8
|
-
*
|
|
9
|
-
* Adapter:
|
|
10
|
-
* - MemoryJournal: in-process array (default)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
interface Journal {
|
|
14
|
-
/** Append an event to the journal. Safe to call from concurrent callbacks. */
|
|
15
|
-
append(event: GraphEvent): void;
|
|
16
|
-
/** Read all pending events and clear the journal atomically. */
|
|
17
|
-
drain(): GraphEvent[];
|
|
18
|
-
/** Number of pending events (for observability). */
|
|
19
|
-
readonly size: number;
|
|
20
|
-
}
|
|
21
|
-
declare class MemoryJournal implements Journal {
|
|
22
|
-
private buffer;
|
|
23
|
-
append(event: GraphEvent): void;
|
|
24
|
-
drain(): GraphEvent[];
|
|
25
|
-
get size(): number;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { type Journal as J, MemoryJournal as M };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { L as LiveGraph, S as ScheduleResult } from './types-CoW0gQl3.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Continuous Event Graph — Schedule
|
|
5
|
-
*
|
|
6
|
-
* Pure read-only projection: LiveGraph → ScheduleResult
|
|
7
|
-
*
|
|
8
|
-
* Classifies every non-terminal task into one of:
|
|
9
|
-
* - eligible: all requires satisfied, ready to dispatch
|
|
10
|
-
* - pending: requires not yet met, but a viable producer exists (normal waiting)
|
|
11
|
-
* - unresolved: requires not met, NO task in the graph can produce them (caller's problem)
|
|
12
|
-
* - blocked: requires not met because the producing task FAILED (caller's problem)
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Compute the scheduling status of every task in the live graph.
|
|
17
|
-
* Pure function — no side effects.
|
|
18
|
-
*/
|
|
19
|
-
declare function schedule(live: LiveGraph): ScheduleResult;
|
|
20
|
-
|
|
21
|
-
export { schedule as s };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { L as LiveGraph, S as ScheduleResult } from './types-CHSdoAAA.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Continuous Event Graph — Schedule
|
|
5
|
-
*
|
|
6
|
-
* Pure read-only projection: LiveGraph → ScheduleResult
|
|
7
|
-
*
|
|
8
|
-
* Classifies every non-terminal task into one of:
|
|
9
|
-
* - eligible: all requires satisfied, ready to dispatch
|
|
10
|
-
* - pending: requires not yet met, but a viable producer exists (normal waiting)
|
|
11
|
-
* - unresolved: requires not met, NO task in the graph can produce them (caller's problem)
|
|
12
|
-
* - blocked: requires not met because the producing task FAILED (caller's problem)
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Compute the scheduling status of every task in the live graph.
|
|
17
|
-
* Pure function — no side effects.
|
|
18
|
-
*/
|
|
19
|
-
declare function schedule(live: LiveGraph): ScheduleResult;
|
|
20
|
-
|
|
21
|
-
export { schedule as s };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "holdings-table",
|
|
3
|
-
"meta": { "title": "Holdings Table" },
|
|
4
|
-
"requires": ["holdings", "prices"],
|
|
5
|
-
"provides": [{ "bindTo": "table", "ref": "computed_values.table" }],
|
|
6
|
-
"card_data": {},
|
|
7
|
-
"compute": [
|
|
8
|
-
{
|
|
9
|
-
"bindTo": "table",
|
|
10
|
-
"expr": "{ \"rows\": $map(requires.holdings, function($h) { { \"symbol\": $h.symbol, \"qty\": $h.qty, \"price\": $lookup(requires.prices, $h.symbol), \"value\": $h.qty * $lookup(requires.prices, $h.symbol) } }) }"
|
|
11
|
-
}
|
|
12
|
-
],
|
|
13
|
-
"view": {
|
|
14
|
-
"elements": [
|
|
15
|
-
{
|
|
16
|
-
"kind": "table",
|
|
17
|
-
"label": "Portfolio Positions",
|
|
18
|
-
"data": { "bind": "computed_values.table.rows", "columns": ["symbol", "qty", "price", "value"] }
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "portfolio-form",
|
|
3
|
-
"meta": { "title": "Portfolio Holdings Form" },
|
|
4
|
-
"provides": [{ "bindTo": "holdings", "ref": "card_data.holdings" }],
|
|
5
|
-
"card_data": {
|
|
6
|
-
"holdings": [
|
|
7
|
-
{ "symbol": "AAPL", "qty": 50 },
|
|
8
|
-
{ "symbol": "MSFT", "qty": 30 }
|
|
9
|
-
]
|
|
10
|
-
},
|
|
11
|
-
"view": {
|
|
12
|
-
"elements": [
|
|
13
|
-
{ "kind": "table", "label": "Holdings", "data": { "bind": "card_data.holdings", "columns": ["symbol", "qty"] } }
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "portfolio-risk-assessment",
|
|
3
|
-
"meta": { "title": "Portfolio Risk Assessment" },
|
|
4
|
-
"requires": ["table", "totalValue"],
|
|
5
|
-
"provides": [
|
|
6
|
-
{ "bindTo": "riskAssessment", "ref": "card_data.llm_task_completion_inference.reason" }
|
|
7
|
-
],
|
|
8
|
-
"card_data": {
|
|
9
|
-
"llm_task_completion_inference": {
|
|
10
|
-
"sync_tmp_file": "tmp_file2"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"when_is_task_completed": "Complete this task only when the portfolio has at least 3 positions and no single holding exceeds 60 percent of the total portfolio value.",
|
|
14
|
-
"view": {
|
|
15
|
-
"elements": [
|
|
16
|
-
{
|
|
17
|
-
"kind": "text",
|
|
18
|
-
"label": "Risk Assessment",
|
|
19
|
-
"data": { "bind": "card_data.llm_task_completion_inference.reason" }
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"kind": "text",
|
|
23
|
-
"label": "Risk Evidence",
|
|
24
|
-
"data": { "bind": "card_data.llm_task_completion_inference.evidence" }
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "portfolio-value",
|
|
3
|
-
"meta": { "title": "Portfolio Total Value" },
|
|
4
|
-
"requires": ["table"],
|
|
5
|
-
"provides": [{ "bindTo": "totalValue", "ref": "computed_values.totalValue" }],
|
|
6
|
-
"card_data": {},
|
|
7
|
-
"compute": [
|
|
8
|
-
{ "bindTo": "totalValue", "expr": "$sum(requires.table.rows.value)" }
|
|
9
|
-
],
|
|
10
|
-
"view": {
|
|
11
|
-
"elements": [
|
|
12
|
-
{ "kind": "metric", "label": "Total Portfolio Value", "data": { "bind": "computed_values.totalValue" } }
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "price-fetch",
|
|
3
|
-
"meta": { "title": "Fetch Market Prices" },
|
|
4
|
-
"requires": ["holdings"],
|
|
5
|
-
"provides": [{ "bindTo": "prices", "ref": "fetched_sources.prices" }],
|
|
6
|
-
"card_data": {},
|
|
7
|
-
"source_defs": [
|
|
8
|
-
{ "cli": "node ../fetch-prices.js", "bindTo": "prices", "outputFile": "prices.json" }
|
|
9
|
-
],
|
|
10
|
-
"view": {
|
|
11
|
-
"elements": [
|
|
12
|
-
{ "kind": "table", "label": "Market Prices", "data": { "bind": "fetched_sources.prices" } }
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "rebalancing-strategy",
|
|
3
|
-
"meta": { "title": "Rebalancing Strategy" },
|
|
4
|
-
"requires": ["table", "totalValue", "riskAssessment"],
|
|
5
|
-
"provides": [
|
|
6
|
-
{ "bindTo": "rebalancingPlan", "ref": "card_data.llm_task_completion_inference.reason" }
|
|
7
|
-
],
|
|
8
|
-
"card_data": {
|
|
9
|
-
"llm_task_completion_inference": {
|
|
10
|
-
"sync_tmp_file": "tmp_file3"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"when_is_task_completed": "Complete this task when a concrete rebalancing recommendation can be produced from the current holdings table, total value, and risk assessment.",
|
|
14
|
-
"view": {
|
|
15
|
-
"elements": [
|
|
16
|
-
{
|
|
17
|
-
"kind": "text",
|
|
18
|
-
"label": "Rebalancing Recommendation",
|
|
19
|
-
"data": { "bind": "card_data.llm_task_completion_inference.reason" }
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"kind": "text",
|
|
23
|
-
"label": "Suggested Moves",
|
|
24
|
-
"data": { "bind": "card_data.llm_task_completion_inference.evidence" }
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* fetch-prices.js
|
|
3
|
-
* Polls for tmp_file1 payload and outputs JSON to stdout once available.
|
|
4
|
-
*/
|
|
5
|
-
import * as fs from 'node:fs';
|
|
6
|
-
import * as path from 'node:path';
|
|
7
|
-
|
|
8
|
-
const envBoardDir = (process.env.BOARD_DIR ?? '').trim();
|
|
9
|
-
const tmpFileCandidates = [
|
|
10
|
-
envBoardDir ? path.join(envBoardDir, 'tmp_file1') : '',
|
|
11
|
-
path.join(process.cwd(), 'tmp_file1'),
|
|
12
|
-
path.join(process.cwd(), 'board-runtime', 'tmp_file1'),
|
|
13
|
-
path.join(process.cwd(), '..', 'board-runtime', 'tmp_file1'),
|
|
14
|
-
].filter(Boolean);
|
|
15
|
-
|
|
16
|
-
function getReadableTmpFile() {
|
|
17
|
-
for (const tmpFile of tmpFileCandidates) {
|
|
18
|
-
if (!fs.existsSync(tmpFile)) continue;
|
|
19
|
-
const content = fs.readFileSync(tmpFile, 'utf-8').trim();
|
|
20
|
-
if (content) return { tmpFile, content };
|
|
21
|
-
}
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function waitForFile(timeoutMs = 120000) {
|
|
26
|
-
const started = Date.now();
|
|
27
|
-
const interval = setInterval(() => {
|
|
28
|
-
if (Date.now() - started > timeoutMs) {
|
|
29
|
-
clearInterval(interval);
|
|
30
|
-
console.error('Timed out waiting for tmp_file1 market prices input.');
|
|
31
|
-
process.exit(1);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const ready = getReadableTmpFile();
|
|
35
|
-
if (!ready) return;
|
|
36
|
-
|
|
37
|
-
clearInterval(interval);
|
|
38
|
-
fs.writeFileSync(ready.tmpFile, '', 'utf-8');
|
|
39
|
-
process.stdout.write(`${ready.content}\n`);
|
|
40
|
-
}, 250);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
waitForFile();
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Portfolio Tracker Task-Executor
|
|
4
|
-
*
|
|
5
|
-
* Implements the run-source-fetch protocol for board-live-cards.
|
|
6
|
-
* This script acts as an external task-executor that can be registered via .task-executor file.
|
|
7
|
-
*
|
|
8
|
-
* Contract:
|
|
9
|
-
* portfolio-tracker-task-executor.js run-source-fetch --in <defFile> --out <resultFile> --err <errFile>
|
|
10
|
-
*
|
|
11
|
-
* Input (--in file):
|
|
12
|
-
* JSON source definition with { cli: "...", bindTo: "...", outputFile: "...", ... }
|
|
13
|
-
*
|
|
14
|
-
* Output (on success):
|
|
15
|
-
* --out file contains the execution result
|
|
16
|
-
* Exit code: 0
|
|
17
|
-
*
|
|
18
|
-
* Output (on error):
|
|
19
|
-
* --err file contains error message
|
|
20
|
-
* Exit code: 1
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const fs = require('fs');
|
|
24
|
-
const path = require('path');
|
|
25
|
-
const { execSync } = require('child_process');
|
|
26
|
-
|
|
27
|
-
// Parse command line arguments
|
|
28
|
-
const args = process.argv.slice(2);
|
|
29
|
-
let subcommand = '';
|
|
30
|
-
let inFile = '';
|
|
31
|
-
let outFile = '';
|
|
32
|
-
let errFile = '';
|
|
33
|
-
|
|
34
|
-
for (let i = 0; i < args.length; i++) {
|
|
35
|
-
if (args[i] === 'run-source-fetch') {
|
|
36
|
-
subcommand = 'run-source-fetch';
|
|
37
|
-
} else if (args[i] === '--in' && i + 1 < args.length) {
|
|
38
|
-
inFile = args[i + 1];
|
|
39
|
-
} else if (args[i] === '--out' && i + 1 < args.length) {
|
|
40
|
-
outFile = args[i + 1];
|
|
41
|
-
} else if (args[i] === '--err' && i + 1 < args.length) {
|
|
42
|
-
errFile = args[i + 1];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (subcommand !== 'run-source-fetch' || !inFile || !outFile || !errFile) {
|
|
47
|
-
console.error('Usage: portfolio-tracker-task-executor.js run-source-fetch --in <defFile> --out <resultFile> --err <errFile>');
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
try {
|
|
52
|
-
// 1. Read source definition from --in file
|
|
53
|
-
console.log(`[portfolio-tracker-task-executor] Reading source definition from ${inFile}`);
|
|
54
|
-
const sourceDefStr = fs.readFileSync(inFile, 'utf-8');
|
|
55
|
-
const sourceDef = JSON.parse(sourceDefStr);
|
|
56
|
-
|
|
57
|
-
// 2. Extract cli command from source definition
|
|
58
|
-
const { cli: sourceCliCommand } = sourceDef;
|
|
59
|
-
if (!sourceCliCommand) {
|
|
60
|
-
throw new Error('cli is required in source definition');
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
console.log(`[portfolio-tracker-task-executor] Executing: ${sourceCliCommand}`);
|
|
64
|
-
|
|
65
|
-
// 3. Execute source.cli synchronously and capture output
|
|
66
|
-
let output;
|
|
67
|
-
try {
|
|
68
|
-
output = execSync(sourceCliCommand, {
|
|
69
|
-
encoding: 'utf-8',
|
|
70
|
-
timeout: (sourceDef.timeout ?? 120) * 1000, // Convert to ms
|
|
71
|
-
cwd: sourceDef.cwd,
|
|
72
|
-
shell: true,
|
|
73
|
-
stdio: ['pipe', 'pipe', 'pipe'], // Capture stdout/stderr
|
|
74
|
-
});
|
|
75
|
-
} catch (execErr) {
|
|
76
|
-
// Even on error, try to use what output we got
|
|
77
|
-
output = execErr.stdout || '';
|
|
78
|
-
if (!output) {
|
|
79
|
-
throw new Error(`Command execution failed: ${execErr.message}`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// 4. Write output to --out file
|
|
84
|
-
console.log(`[portfolio-tracker-task-executor] Writing result to ${outFile}`);
|
|
85
|
-
fs.writeFileSync(outFile, output.trim(), 'utf-8');
|
|
86
|
-
|
|
87
|
-
console.log(`[portfolio-tracker-task-executor] Success`);
|
|
88
|
-
process.exit(0);
|
|
89
|
-
} catch (error) {
|
|
90
|
-
// 3a. On error: write error message to --err file and exit non-zero
|
|
91
|
-
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
92
|
-
console.error(`[portfolio-tracker-task-executor] Error:`, errorMsg);
|
|
93
|
-
|
|
94
|
-
fs.writeFileSync(errFile, errorMsg, 'utf-8');
|
|
95
|
-
process.exit(1);
|
|
96
|
-
}
|