yaml-flow 5.1.0 → 5.2.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.
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 +14 -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
@@ -58,10 +58,10 @@ declare function validateLiveCardDefinition(node: unknown): ValidationResult;
58
58
  * Expressions are evaluated against { card_data, requires, fetched_sources, computed_values }.
59
59
  * computed_values is ephemeral — never persisted to disk.
60
60
  */
61
- /** A source definition: cli writes to outputFile; bindTo names the fetched_sources.* key in compute context. */
61
+ /** A source definition: cli writes to outputFile; bindTo names the fetched_sources.* key in compute context. Both bindTo and outputFile must be unique across sources in a card. */
62
62
  interface ComputeSource {
63
63
  bindTo: string;
64
- outputFile?: string;
64
+ outputFile: string;
65
65
  cli?: string;
66
66
  script?: string;
67
67
  optionalForCompletionGating?: boolean;
@@ -58,10 +58,10 @@ declare function validateLiveCardDefinition(node: unknown): ValidationResult;
58
58
  * Expressions are evaluated against { card_data, requires, fetched_sources, computed_values }.
59
59
  * computed_values is ephemeral — never persisted to disk.
60
60
  */
61
- /** A source definition: cli writes to outputFile; bindTo names the fetched_sources.* key in compute context. */
61
+ /** A source definition: cli writes to outputFile; bindTo names the fetched_sources.* key in compute context. Both bindTo and outputFile must be unique across sources in a card. */
62
62
  interface ComputeSource {
63
63
  bindTo: string;
64
- outputFile?: string;
64
+ outputFile: string;
65
65
  cli?: string;
66
66
  script?: string;
67
67
  optionalForCompletionGating?: boolean;
@@ -6540,9 +6540,9 @@ var live_cards_schema_default = {
6540
6540
  }
6541
6541
  },
6542
6542
  source_def: {
6543
- description: "One source entry. The engine only cares about 'bindTo' (compute namespace key) and 'outputFile' (delivery signal). Every other property is yours \u2014 add whatever your task-executor needs: kind, url, headers, mailbox, channel, model, query, etc. The full object is passed verbatim as the --in JSON to the executor.",
6543
+ description: "One source entry. The engine requires 'bindTo' (compute namespace key) and 'outputFile' (delivery signal path). bindTo and outputFile must be unique across all sources in a card. Every other property is yours \u2014 add whatever your task-executor needs: kind, url, headers, mailbox, channel, model, query, etc. The full object is passed verbatim as the --in JSON to the executor.",
6544
6544
  type: "object",
6545
- required: ["bindTo"],
6545
+ required: ["bindTo", "outputFile"],
6546
6546
  additionalProperties: true,
6547
6547
  properties: {
6548
6548
  bindTo: { type: "string", description: "Key under fetched_sources.* available in compute expressions" },
@@ -6561,6 +6561,7 @@ var live_cards_schema_default = {
6561
6561
  enum: [
6562
6562
  "metric",
6563
6563
  "table",
6564
+ "editable-table",
6564
6565
  "chart",
6565
6566
  "form",
6566
6567
  "filter",
@@ -6678,7 +6679,7 @@ var live_cards_schema_default = {
6678
6679
  view: { $ref: "#/definitions/view" },
6679
6680
  card_data: {
6680
6681
  type: "object",
6681
- description: "Authored card data supplied in the card definition",
6682
+ description: "Authored card data and runtime metadata. Includes uploaded-file metadata maintained by host handlers and inference evaluation results.",
6682
6683
  properties: {
6683
6684
  files: {
6684
6685
  type: "array",
@@ -6706,6 +6707,18 @@ var live_cards_schema_default = {
6706
6707
  },
6707
6708
  additionalProperties: false
6708
6709
  }
6710
+ },
6711
+ llm_task_completion_inference: {
6712
+ type: "object",
6713
+ description: "Runtime state written by the inference adapter (advanced/undocumented). Prefer the standard sources \u2192 compute \u2192 provides pattern for LLM-based signals.",
6714
+ properties: {
6715
+ inferenceRequested: { type: "string", format: "date-time", description: "Timestamp when the latest inference request was initiated" },
6716
+ inferenceCompletedAt: { type: "string", format: "date-time", description: "Timestamp when the latest inference request completed" },
6717
+ isTaskCompleted: { type: "boolean", description: "Whether the task is considered complete by the adapter" },
6718
+ reasoning: { type: "string", description: "Explanation of completion decision" },
6719
+ evidence: { type: "array", description: "Supporting evidence from sources/compute" }
6720
+ },
6721
+ additionalProperties: true
6709
6722
  }
6710
6723
  },
6711
6724
  additionalProperties: true
@@ -6719,6 +6732,10 @@ var live_cards_schema_default = {
6719
6732
  type: "array",
6720
6733
  description: "Ordered array of compute steps. Each reads card_data.*/requires.*/fetched_sources.*/computed_values.* and writes to ephemeral computed_values[bindTo].",
6721
6734
  items: { $ref: "#/definitions/compute_step" }
6735
+ },
6736
+ when_is_task_completed: {
6737
+ type: "string",
6738
+ description: "Advanced/undocumented: invokes a registered inference adapter instead of the default source-delivery completion gate. Prefer the standard pattern: use an LLM-backed source, compute a verdict token, and publish it via provides."
6722
6739
  }
6723
6740
  }
6724
6741
  };
@@ -6787,12 +6804,35 @@ function getValidator() {
6787
6804
  function validateLiveCardSchema(node) {
6788
6805
  const validate = getValidator();
6789
6806
  const valid = validate(node);
6790
- if (valid) return { ok: true, errors: [] };
6791
6807
  const errors = (validate.errors ?? []).map((e) => {
6792
6808
  const path = e.instancePath || "/";
6793
6809
  return `${path}: ${e.message ?? "unknown error"}`;
6794
6810
  });
6795
- return { ok: false, errors };
6811
+ if (node && typeof node === "object" && !Array.isArray(node)) {
6812
+ const sources = node.sources;
6813
+ if (Array.isArray(sources)) {
6814
+ const bindTos = /* @__PURE__ */ new Set();
6815
+ const outputFiles = /* @__PURE__ */ new Set();
6816
+ sources.forEach((src, i) => {
6817
+ if (!src || typeof src !== "object" || Array.isArray(src)) return;
6818
+ const s = src;
6819
+ if (typeof s.bindTo === "string" && s.bindTo) {
6820
+ if (bindTos.has(s.bindTo)) {
6821
+ errors.push(`/sources/${i}/bindTo: bindTo "${s.bindTo}" must be unique across all sources`);
6822
+ }
6823
+ bindTos.add(s.bindTo);
6824
+ }
6825
+ if (typeof s.outputFile === "string" && s.outputFile) {
6826
+ if (outputFiles.has(s.outputFile)) {
6827
+ errors.push(`/sources/${i}/outputFile: outputFile "${s.outputFile}" must be unique across all sources`);
6828
+ }
6829
+ outputFiles.add(s.outputFile);
6830
+ }
6831
+ });
6832
+ }
6833
+ }
6834
+ if (!valid || errors.length > 0) return { ok: false, errors };
6835
+ return { ok: true, errors: [] };
6796
6836
  }
6797
6837
  function validateLiveCardRuntimeExpressions(node) {
6798
6838
  const errors = [];
@@ -6962,13 +7002,29 @@ function validateNode(node) {
6962
7002
  if (!Array.isArray(n.sources)) {
6963
7003
  errors.push("sources: must be an array");
6964
7004
  } else {
7005
+ const bindTos = /* @__PURE__ */ new Set();
7006
+ const outputFiles = /* @__PURE__ */ new Set();
6965
7007
  n.sources.forEach((src, i) => {
6966
7008
  if (!src || typeof src !== "object" || Array.isArray(src)) {
6967
7009
  errors.push(`sources[${i}]: must be an object`);
6968
7010
  } else {
6969
7011
  const s = src;
6970
- if (typeof s.bindTo !== "string" || !s.bindTo) errors.push(`sources[${i}]: missing required "bindTo" property`);
6971
- if (s.outputFile != null && typeof s.outputFile !== "string") errors.push(`sources[${i}]: outputFile must be a string`);
7012
+ if (typeof s.bindTo !== "string" || !s.bindTo) {
7013
+ errors.push(`sources[${i}]: missing required "bindTo" property`);
7014
+ } else {
7015
+ if (bindTos.has(s.bindTo)) {
7016
+ errors.push(`sources[${i}]: bindTo "${s.bindTo}" is not unique across sources`);
7017
+ }
7018
+ bindTos.add(s.bindTo);
7019
+ }
7020
+ if (typeof s.outputFile !== "string" || !s.outputFile) {
7021
+ errors.push(`sources[${i}]: missing required "outputFile" property`);
7022
+ } else {
7023
+ if (outputFiles.has(s.outputFile)) {
7024
+ errors.push(`sources[${i}]: outputFile "${s.outputFile}" is not unique across sources`);
7025
+ }
7026
+ outputFiles.add(s.outputFile);
7027
+ }
6972
7028
  if (s.optionalForCompletionGating != null && typeof s.optionalForCompletionGating !== "boolean") {
6973
7029
  errors.push(`sources[${i}]: optionalForCompletionGating must be a boolean`);
6974
7030
  }