yaml-flow 5.1.0 → 5.2.1

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.
Files changed (105) hide show
  1. package/{examples/example-board/reusable-server-runtime.js → board-livecards-server-runtime.js} +42 -20
  2. package/{examples/example-board/reusable-board-runtime-client.js → browser/board-livecards-runtime-client.js} +6 -2
  3. package/browser/{board-livegraph-runtime.js → board-livegraph-engine.js} +212 -16
  4. package/browser/board-livegraph-engine.js.map +1 -0
  5. package/browser/live-cards.js +362 -38
  6. package/browser/live-cards.schema.json +20 -4
  7. package/dist/board-livegraph-runtime/index.cjs +210 -14
  8. package/dist/board-livegraph-runtime/index.cjs.map +1 -1
  9. package/dist/board-livegraph-runtime/index.d.cts +49 -5
  10. package/dist/board-livegraph-runtime/index.d.ts +49 -5
  11. package/dist/board-livegraph-runtime/index.js +209 -15
  12. package/dist/board-livegraph-runtime/index.js.map +1 -1
  13. package/dist/card-compute/index.cjs +63 -7
  14. package/dist/card-compute/index.cjs.map +1 -1
  15. package/dist/card-compute/index.d.cts +2 -2
  16. package/dist/card-compute/index.d.ts +2 -2
  17. package/dist/card-compute/index.js +63 -7
  18. package/dist/card-compute/index.js.map +1 -1
  19. package/dist/cli/board-live-cards-cli.cjs +664 -75
  20. package/dist/cli/board-live-cards-cli.cjs.map +1 -1
  21. package/dist/cli/board-live-cards-cli.d.cts +33 -5
  22. package/dist/cli/board-live-cards-cli.d.ts +33 -5
  23. package/dist/cli/board-live-cards-cli.js +661 -76
  24. package/dist/cli/board-live-cards-cli.js.map +1 -1
  25. package/dist/{constants-ozjf1Ejw.d.cts → constants-BzZUyYlp.d.cts} +1 -1
  26. package/dist/{constants-DuzE5n03.d.ts → constants-oCEbNpul.d.ts} +1 -1
  27. package/dist/continuous-event-graph/index.cjs +47 -14
  28. package/dist/continuous-event-graph/index.cjs.map +1 -1
  29. package/dist/continuous-event-graph/index.d.cts +9 -9
  30. package/dist/continuous-event-graph/index.d.ts +9 -9
  31. package/dist/continuous-event-graph/index.js +47 -14
  32. package/dist/continuous-event-graph/index.js.map +1 -1
  33. package/dist/event-graph/index.cjs +29 -12
  34. package/dist/event-graph/index.cjs.map +1 -1
  35. package/dist/event-graph/index.d.cts +5 -5
  36. package/dist/event-graph/index.d.ts +5 -5
  37. package/dist/event-graph/index.js +29 -12
  38. package/dist/event-graph/index.js.map +1 -1
  39. package/dist/index.cjs +93 -20
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +7 -7
  42. package/dist/index.d.ts +7 -7
  43. package/dist/index.js +93 -20
  44. package/dist/index.js.map +1 -1
  45. package/dist/inference/index.cjs +29 -12
  46. package/dist/inference/index.cjs.map +1 -1
  47. package/dist/inference/index.d.cts +2 -2
  48. package/dist/inference/index.d.ts +2 -2
  49. package/dist/inference/index.js +29 -12
  50. package/dist/inference/index.js.map +1 -1
  51. package/dist/{journal-NLYuqege.d.ts → journal-9HEgs7dU.d.ts} +1 -1
  52. package/dist/{journal-DRfJiheM.d.cts → journal-B-JCfQnh.d.cts} +1 -1
  53. package/dist/{live-cards-bridge-Or7fdEJV.d.ts → live-cards-bridge-CeNxiVcm.d.ts} +6 -2
  54. package/dist/{live-cards-bridge-vGJ6tMzN.d.cts → live-cards-bridge-z_rJCSbi.d.cts} +6 -2
  55. package/dist/{schedule-CMcZe5Ny.d.ts → schedule-Cszq9LYY.d.ts} +1 -1
  56. package/dist/{schedule-CiucyCan.d.cts → schedule-qWNL0RQh.d.cts} +1 -1
  57. package/dist/{types-CMFSIjpc.d.cts → types-BBhqYGhE.d.cts} +4 -0
  58. package/dist/{types-CMFSIjpc.d.ts → types-BBhqYGhE.d.ts} +4 -0
  59. package/dist/{types-BzLD8bjb.d.cts → types-CHSdoAAA.d.cts} +1 -1
  60. package/dist/{types-C2eJ7DAV.d.ts → types-CoW0gQl3.d.ts} +1 -1
  61. package/dist/{validate-DJQTQ6bP.d.ts → validate-BAVzUJWa.d.ts} +1 -1
  62. package/dist/{validate-ke92Cleg.d.cts → validate-Dbu7ygys.d.cts} +1 -1
  63. package/examples/browser/boards/portfolio-tracker/cards/portfolio-risk-assessment.json +28 -0
  64. package/examples/browser/boards/portfolio-tracker/cards/rebalancing-strategy.json +28 -0
  65. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +187 -0
  66. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +139 -5
  67. package/examples/example-board/agent-instructions-cardlayout.md +28 -0
  68. package/examples/example-board/agent-instructions.md +603 -0
  69. package/examples/example-board/cards/card-concentration.json +42 -0
  70. package/examples/example-board/cards/card-market-prices.json +51 -0
  71. package/examples/example-board/cards/card-portfolio-action.json +19 -0
  72. package/examples/example-board/cards/card-portfolio-risks.json +19 -0
  73. package/examples/example-board/cards/card-portfolio-value.json +62 -0
  74. package/examples/example-board/cards/card-portfolio.json +44 -0
  75. package/examples/example-board/demo-chat-handler.js +373 -33
  76. package/examples/example-board/demo-server-config.json +0 -2
  77. package/examples/example-board/demo-server.js +46 -7
  78. package/examples/example-board/demo-shell-browser.html +75 -207
  79. package/examples/example-board/demo-shell-with-server.html +15 -9
  80. package/examples/example-board/demo-shell.html +1 -1
  81. package/examples/example-board/demo-task-executor.js +259 -41
  82. package/package.json +6 -2
  83. package/schema/live-cards.schema.json +20 -4
  84. package/browser/board-livegraph-runtime.js.map +0 -1
  85. package/examples/example-board/board.yaml +0 -23
  86. package/examples/example-board/bootstrap_payload.json +0 -1
  87. package/examples/example-board/cards/card-chain-region-alert.json +0 -39
  88. package/examples/example-board/cards/card-chain-region-totals.json +0 -26
  89. package/examples/example-board/cards/card-chain-top-region.json +0 -24
  90. package/examples/example-board/cards/card-ex-actions.json +0 -32
  91. package/examples/example-board/cards/card-ex-chart.json +0 -30
  92. package/examples/example-board/cards/card-ex-filter.json +0 -36
  93. package/examples/example-board/cards/card-ex-filtered-by-preference.json +0 -59
  94. package/examples/example-board/cards/card-ex-form.json +0 -91
  95. package/examples/example-board/cards/card-ex-list.json +0 -22
  96. package/examples/example-board/cards/card-ex-markdown.json +0 -17
  97. package/examples/example-board/cards/card-ex-metric.json +0 -19
  98. package/examples/example-board/cards/card-ex-narrative.json +0 -36
  99. package/examples/example-board/cards/card-ex-source-http.json +0 -28
  100. package/examples/example-board/cards/card-ex-source.json +0 -21
  101. package/examples/example-board/cards/card-ex-status.json +0 -35
  102. package/examples/example-board/cards/card-ex-table.json +0 -30
  103. package/examples/example-board/cards/card-ex-todo.json +0 -29
  104. package/examples/example-board/mock.db +0 -15
  105. package/examples/example-board/reusable-runtime-artifacts-adapter.js +0 -233
@@ -1,7 +1,7 @@
1
- import { b as LiveGraphSnapshot, L as LiveGraph } from '../types-BzLD8bjb.cjs';
2
- import { a as LiveCard, R as ReactiveGraph } from '../live-cards-bridge-vGJ6tMzN.cjs';
3
- import { f as GraphEvent, T as TaskConfig } from '../types-CMFSIjpc.cjs';
4
- import { J as Journal } from '../journal-DRfJiheM.cjs';
1
+ import { b as LiveGraphSnapshot, L as LiveGraph } from '../types-CHSdoAAA.cjs';
2
+ import { a as LiveCard, R as ReactiveGraph } from '../live-cards-bridge-z_rJCSbi.cjs';
3
+ import { f as GraphEvent, T as TaskConfig } from '../types-BBhqYGhE.cjs';
4
+ import { J as Journal } from '../journal-B-JCfQnh.cjs';
5
5
 
6
6
  /**
7
7
  * Board Live Cards — Disk persistence + CLI for ReactiveGraph.
@@ -64,6 +64,8 @@ interface SourceTokenPayload {
64
64
  b: string;
65
65
  /** sources[].outputFile (relative to boardDir) */
66
66
  d: string;
67
+ /** Per-source invocation checksum */
68
+ cs?: string;
67
69
  }
68
70
  declare function encodeSourceToken(payload: SourceTokenPayload): string;
69
71
  declare function decodeSourceToken(token: string): SourceTokenPayload | null;
@@ -71,9 +73,35 @@ interface SourceRuntimeEntry {
71
73
  lastRequestedAt?: string;
72
74
  lastFetchedAt?: string;
73
75
  lastError?: string;
76
+ /** Timestamp of the most recent card-handler dispatch — updated on every fresh invocation.
77
+ * Replaces checksum-based gating: a source fetch is needed whenever
78
+ * lastFetchedAt is absent or older than queueRequestedAt. */
79
+ queueRequestedAt?: string;
74
80
  }
81
+ interface InferenceRuntimeEntry {
82
+ lastRequestedAt?: string;
83
+ lastFetchedAt?: string;
84
+ lastError?: string;
85
+ /** Same semantics as SourceRuntimeEntry.queueRequestedAt. */
86
+ queueRequestedAt?: string;
87
+ }
88
+ type FetchRuntimeEntry = SourceRuntimeEntry | InferenceRuntimeEntry;
89
+ declare function isSourceInFlight(entry: FetchRuntimeEntry | undefined): boolean;
90
+ /**
91
+ * Decide what to do with a source/inference fetch given the current runtime entry
92
+ * and the timestamp of the latest card-handler dispatch (queueRequestedAt).
93
+ *
94
+ * - 'dispatch' : fetch not yet started for this run, or previous fetch predates the request
95
+ * - 'in-flight': fetch is already running for this run — update queueRequestedAt and wait
96
+ * - 'idle' : fetch already completed for this run — nothing to do
97
+ */
98
+ declare function decideSourceAction(entry: FetchRuntimeEntry | undefined, queueRequestedAt: string): 'dispatch' | 'in-flight' | 'idle';
99
+ declare function nextEntryAfterFetchDelivery<T extends FetchRuntimeEntry>(entry: T, fetchedAt: string): T;
100
+ declare function nextEntryAfterFetchFailure<T extends FetchRuntimeEntry>(entry: T, reason: string): T;
75
101
  interface CardRuntimeState {
76
102
  _sources: Record<string, SourceRuntimeEntry>;
103
+ _inferenceEntry?: InferenceRuntimeEntry;
104
+ _lastExecutionCount?: number;
77
105
  }
78
106
  /**
79
107
  * Append a raw event to the journal file. No lock, no file read.
@@ -202,4 +230,4 @@ interface BoardStatusObject {
202
230
  }
203
231
  declare function cli(argv: string[]): Promise<void>;
204
232
 
205
- export { type BoardEnvelope, BoardJournal, type BoardLiveCard, type BoardReactiveGraph, type BoardStatusCard, type BoardStatusObject, type CardInventoryEntry, type CardInventoryIndex, type CardRuntimeState, type JournalEntry, type SourceRuntimeEntry, type SourceTokenPayload, appendCardInventory, appendEventToJournal, buildCardInventoryIndex, cli, createBoardReactiveGraph, decodeSourceToken, encodeSourceToken, getUndrainedEntries, initBoard, liveCardToTaskConfig, loadBoard, loadBoardEnvelope, lookupCardPath, processAccumulatedEvents, processAccumulatedEventsForced, processAccumulatedEventsInfinitePass, readCardInventory, saveBoard, withBoardLock };
233
+ export { type BoardEnvelope, BoardJournal, type BoardLiveCard, type BoardReactiveGraph, type BoardStatusCard, type BoardStatusObject, type CardInventoryEntry, type CardInventoryIndex, type CardRuntimeState, type InferenceRuntimeEntry, type JournalEntry, type SourceRuntimeEntry, type SourceTokenPayload, appendCardInventory, appendEventToJournal, buildCardInventoryIndex, cli, createBoardReactiveGraph, decideSourceAction, decodeSourceToken, encodeSourceToken, getUndrainedEntries, initBoard, isSourceInFlight, liveCardToTaskConfig, loadBoard, loadBoardEnvelope, lookupCardPath, nextEntryAfterFetchDelivery, nextEntryAfterFetchFailure, processAccumulatedEvents, processAccumulatedEventsForced, processAccumulatedEventsInfinitePass, readCardInventory, saveBoard, withBoardLock };
@@ -1,7 +1,7 @@
1
- import { b as LiveGraphSnapshot, L as LiveGraph } from '../types-C2eJ7DAV.js';
2
- import { a as LiveCard, R as ReactiveGraph } from '../live-cards-bridge-Or7fdEJV.js';
3
- import { f as GraphEvent, T as TaskConfig } from '../types-CMFSIjpc.js';
4
- import { J as Journal } from '../journal-NLYuqege.js';
1
+ import { b as LiveGraphSnapshot, L as LiveGraph } from '../types-CoW0gQl3.js';
2
+ import { a as LiveCard, R as ReactiveGraph } from '../live-cards-bridge-CeNxiVcm.js';
3
+ import { f as GraphEvent, T as TaskConfig } from '../types-BBhqYGhE.js';
4
+ import { J as Journal } from '../journal-9HEgs7dU.js';
5
5
 
6
6
  /**
7
7
  * Board Live Cards — Disk persistence + CLI for ReactiveGraph.
@@ -64,6 +64,8 @@ interface SourceTokenPayload {
64
64
  b: string;
65
65
  /** sources[].outputFile (relative to boardDir) */
66
66
  d: string;
67
+ /** Per-source invocation checksum */
68
+ cs?: string;
67
69
  }
68
70
  declare function encodeSourceToken(payload: SourceTokenPayload): string;
69
71
  declare function decodeSourceToken(token: string): SourceTokenPayload | null;
@@ -71,9 +73,35 @@ interface SourceRuntimeEntry {
71
73
  lastRequestedAt?: string;
72
74
  lastFetchedAt?: string;
73
75
  lastError?: string;
76
+ /** Timestamp of the most recent card-handler dispatch — updated on every fresh invocation.
77
+ * Replaces checksum-based gating: a source fetch is needed whenever
78
+ * lastFetchedAt is absent or older than queueRequestedAt. */
79
+ queueRequestedAt?: string;
74
80
  }
81
+ interface InferenceRuntimeEntry {
82
+ lastRequestedAt?: string;
83
+ lastFetchedAt?: string;
84
+ lastError?: string;
85
+ /** Same semantics as SourceRuntimeEntry.queueRequestedAt. */
86
+ queueRequestedAt?: string;
87
+ }
88
+ type FetchRuntimeEntry = SourceRuntimeEntry | InferenceRuntimeEntry;
89
+ declare function isSourceInFlight(entry: FetchRuntimeEntry | undefined): boolean;
90
+ /**
91
+ * Decide what to do with a source/inference fetch given the current runtime entry
92
+ * and the timestamp of the latest card-handler dispatch (queueRequestedAt).
93
+ *
94
+ * - 'dispatch' : fetch not yet started for this run, or previous fetch predates the request
95
+ * - 'in-flight': fetch is already running for this run — update queueRequestedAt and wait
96
+ * - 'idle' : fetch already completed for this run — nothing to do
97
+ */
98
+ declare function decideSourceAction(entry: FetchRuntimeEntry | undefined, queueRequestedAt: string): 'dispatch' | 'in-flight' | 'idle';
99
+ declare function nextEntryAfterFetchDelivery<T extends FetchRuntimeEntry>(entry: T, fetchedAt: string): T;
100
+ declare function nextEntryAfterFetchFailure<T extends FetchRuntimeEntry>(entry: T, reason: string): T;
75
101
  interface CardRuntimeState {
76
102
  _sources: Record<string, SourceRuntimeEntry>;
103
+ _inferenceEntry?: InferenceRuntimeEntry;
104
+ _lastExecutionCount?: number;
77
105
  }
78
106
  /**
79
107
  * Append a raw event to the journal file. No lock, no file read.
@@ -202,4 +230,4 @@ interface BoardStatusObject {
202
230
  }
203
231
  declare function cli(argv: string[]): Promise<void>;
204
232
 
205
- export { type BoardEnvelope, BoardJournal, type BoardLiveCard, type BoardReactiveGraph, type BoardStatusCard, type BoardStatusObject, type CardInventoryEntry, type CardInventoryIndex, type CardRuntimeState, type JournalEntry, type SourceRuntimeEntry, type SourceTokenPayload, appendCardInventory, appendEventToJournal, buildCardInventoryIndex, cli, createBoardReactiveGraph, decodeSourceToken, encodeSourceToken, getUndrainedEntries, initBoard, liveCardToTaskConfig, loadBoard, loadBoardEnvelope, lookupCardPath, processAccumulatedEvents, processAccumulatedEventsForced, processAccumulatedEventsInfinitePass, readCardInventory, saveBoard, withBoardLock };
233
+ export { type BoardEnvelope, BoardJournal, type BoardLiveCard, type BoardReactiveGraph, type BoardStatusCard, type BoardStatusObject, type CardInventoryEntry, type CardInventoryIndex, type CardRuntimeState, type InferenceRuntimeEntry, type JournalEntry, type SourceRuntimeEntry, type SourceTokenPayload, appendCardInventory, appendEventToJournal, buildCardInventoryIndex, cli, createBoardReactiveGraph, decideSourceAction, decodeSourceToken, encodeSourceToken, getUndrainedEntries, initBoard, isSourceInFlight, liveCardToTaskConfig, loadBoard, loadBoardEnvelope, lookupCardPath, nextEntryAfterFetchDelivery, nextEntryAfterFetchFailure, processAccumulatedEvents, processAccumulatedEventsForced, processAccumulatedEventsInfinitePass, readCardInventory, saveBoard, withBoardLock };