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.
- package/{examples/example-board/reusable-server-runtime.js → board-livecards-server-runtime.js} +42 -20
- package/{examples/example-board/reusable-board-runtime-client.js → browser/board-livecards-runtime-client.js} +6 -2
- package/browser/{board-livegraph-runtime.js → board-livegraph-engine.js} +212 -16
- package/browser/board-livegraph-engine.js.map +1 -0
- package/browser/live-cards.js +362 -38
- package/browser/live-cards.schema.json +20 -4
- package/dist/board-livegraph-runtime/index.cjs +210 -14
- package/dist/board-livegraph-runtime/index.cjs.map +1 -1
- package/dist/board-livegraph-runtime/index.d.cts +49 -5
- package/dist/board-livegraph-runtime/index.d.ts +49 -5
- package/dist/board-livegraph-runtime/index.js +209 -15
- package/dist/board-livegraph-runtime/index.js.map +1 -1
- package/dist/card-compute/index.cjs +63 -7
- package/dist/card-compute/index.cjs.map +1 -1
- package/dist/card-compute/index.d.cts +2 -2
- package/dist/card-compute/index.d.ts +2 -2
- package/dist/card-compute/index.js +63 -7
- package/dist/card-compute/index.js.map +1 -1
- package/dist/cli/board-live-cards-cli.cjs +664 -75
- package/dist/cli/board-live-cards-cli.cjs.map +1 -1
- package/dist/cli/board-live-cards-cli.d.cts +33 -5
- package/dist/cli/board-live-cards-cli.d.ts +33 -5
- package/dist/cli/board-live-cards-cli.js +661 -76
- package/dist/cli/board-live-cards-cli.js.map +1 -1
- package/dist/{constants-ozjf1Ejw.d.cts → constants-BzZUyYlp.d.cts} +1 -1
- package/dist/{constants-DuzE5n03.d.ts → constants-oCEbNpul.d.ts} +1 -1
- package/dist/continuous-event-graph/index.cjs +47 -14
- package/dist/continuous-event-graph/index.cjs.map +1 -1
- package/dist/continuous-event-graph/index.d.cts +9 -9
- package/dist/continuous-event-graph/index.d.ts +9 -9
- package/dist/continuous-event-graph/index.js +47 -14
- package/dist/continuous-event-graph/index.js.map +1 -1
- package/dist/event-graph/index.cjs +29 -12
- package/dist/event-graph/index.cjs.map +1 -1
- package/dist/event-graph/index.d.cts +5 -5
- package/dist/event-graph/index.d.ts +5 -5
- package/dist/event-graph/index.js +29 -12
- package/dist/event-graph/index.js.map +1 -1
- package/dist/index.cjs +93 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +93 -20
- package/dist/index.js.map +1 -1
- package/dist/inference/index.cjs +29 -12
- package/dist/inference/index.cjs.map +1 -1
- package/dist/inference/index.d.cts +2 -2
- package/dist/inference/index.d.ts +2 -2
- package/dist/inference/index.js +29 -12
- package/dist/inference/index.js.map +1 -1
- package/dist/{journal-NLYuqege.d.ts → journal-9HEgs7dU.d.ts} +1 -1
- package/dist/{journal-DRfJiheM.d.cts → journal-B-JCfQnh.d.cts} +1 -1
- package/dist/{live-cards-bridge-Or7fdEJV.d.ts → live-cards-bridge-CeNxiVcm.d.ts} +6 -2
- package/dist/{live-cards-bridge-vGJ6tMzN.d.cts → live-cards-bridge-z_rJCSbi.d.cts} +6 -2
- package/dist/{schedule-CMcZe5Ny.d.ts → schedule-Cszq9LYY.d.ts} +1 -1
- package/dist/{schedule-CiucyCan.d.cts → schedule-qWNL0RQh.d.cts} +1 -1
- package/dist/{types-CMFSIjpc.d.cts → types-BBhqYGhE.d.cts} +4 -0
- package/dist/{types-CMFSIjpc.d.ts → types-BBhqYGhE.d.ts} +4 -0
- package/dist/{types-BzLD8bjb.d.cts → types-CHSdoAAA.d.cts} +1 -1
- package/dist/{types-C2eJ7DAV.d.ts → types-CoW0gQl3.d.ts} +1 -1
- package/dist/{validate-DJQTQ6bP.d.ts → validate-BAVzUJWa.d.ts} +1 -1
- package/dist/{validate-ke92Cleg.d.cts → validate-Dbu7ygys.d.cts} +1 -1
- package/examples/browser/boards/portfolio-tracker/cards/portfolio-risk-assessment.json +28 -0
- package/examples/browser/boards/portfolio-tracker/cards/rebalancing-strategy.json +28 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +187 -0
- package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +139 -5
- package/examples/example-board/agent-instructions-cardlayout.md +28 -0
- package/examples/example-board/agent-instructions.md +603 -0
- package/examples/example-board/cards/card-concentration.json +42 -0
- package/examples/example-board/cards/card-market-prices.json +51 -0
- package/examples/example-board/cards/card-portfolio-action.json +19 -0
- package/examples/example-board/cards/card-portfolio-risks.json +19 -0
- package/examples/example-board/cards/card-portfolio-value.json +62 -0
- package/examples/example-board/cards/card-portfolio.json +44 -0
- package/examples/example-board/demo-chat-handler.js +373 -33
- package/examples/example-board/demo-server-config.json +0 -2
- package/examples/example-board/demo-server.js +46 -7
- package/examples/example-board/demo-shell-browser.html +75 -207
- package/examples/example-board/demo-shell-with-server.html +14 -9
- package/examples/example-board/demo-shell.html +1 -1
- package/examples/example-board/demo-task-executor.js +259 -41
- package/package.json +6 -2
- package/schema/live-cards.schema.json +20 -4
- package/browser/board-livegraph-runtime.js.map +0 -1
- package/examples/example-board/board.yaml +0 -23
- package/examples/example-board/bootstrap_payload.json +0 -1
- package/examples/example-board/cards/card-chain-region-alert.json +0 -39
- package/examples/example-board/cards/card-chain-region-totals.json +0 -26
- package/examples/example-board/cards/card-chain-top-region.json +0 -24
- package/examples/example-board/cards/card-ex-actions.json +0 -32
- package/examples/example-board/cards/card-ex-chart.json +0 -30
- package/examples/example-board/cards/card-ex-filter.json +0 -36
- package/examples/example-board/cards/card-ex-filtered-by-preference.json +0 -59
- package/examples/example-board/cards/card-ex-form.json +0 -91
- package/examples/example-board/cards/card-ex-list.json +0 -22
- package/examples/example-board/cards/card-ex-markdown.json +0 -17
- package/examples/example-board/cards/card-ex-metric.json +0 -19
- package/examples/example-board/cards/card-ex-narrative.json +0 -36
- package/examples/example-board/cards/card-ex-source-http.json +0 -28
- package/examples/example-board/cards/card-ex-source.json +0 -21
- package/examples/example-board/cards/card-ex-status.json +0 -35
- package/examples/example-board/cards/card-ex-table.json +0 -30
- package/examples/example-board/cards/card-ex-todo.json +0 -29
- package/examples/example-board/mock.db +0 -15
- package/examples/example-board/reusable-runtime-artifacts-adapter.js +0 -233
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as COMPLETION_STRATEGIES, a as CONFLICT_STRATEGIES, b as CompletionResult, D as DEFAULTS, E as EXECUTION_MODES, c as EXECUTION_STATUS, d as ExecutionPlan, e as ExportOptions, M as MermaidOptions, T as TASK_STATUS, f as addDynamicTask, L as addKeyToProvides, N as addKeyToRequires, g as apply, h as applyAll, i as computeAvailableOutputs, j as createDefaultGraphEngineStore, k as createInitialExecutionState, l as detectStuckState, m as exportGraphConfig, n as exportGraphConfigToFile, o as flowToMermaid, p as getAllTasks, q as getCandidateTasks, r as getMaxExecutions, s as getProvides, t as getRefreshStrategy, u as getRequires, v as getTask, w as graphToMermaid, O as groupTasksByProvides, P as hasOutputConflict, x as hasTask, y as isExecutionComplete, z as isNonActiveTask, A as isRerunnable, B as isTaskCompleted, F as isTaskRunning, G as loadGraphConfig, H as next, I as planExecution, Q as removeKeyFromProvides, R as removeKeyFromRequires, J as validateGraphConfig, K as validateGraphSchema } from '../constants-
|
|
2
|
-
export { G as GraphIssue, a as GraphValidationResult, I as IssueSeverity, v as validateGraph } from '../validate-
|
|
3
|
-
import { T as TaskConfig, c as ExecutionState, a as ConflictStrategy, G as GraphConfig } from '../types-
|
|
4
|
-
export { A as AgentActionEvent, C as CompletionStrategy, E as ExecutionConfig, b as ExecutionMode, d as ExecutionStatus, e as GraphEngineStore, f as GraphEvent, g as GraphSettings, I as InjectTokensEvent, R as RefreshStrategy, S as SchedulerResult, h as StuckDetection, m as TaskCircuitBreakerConfig, i as TaskCompletedEvent, j as TaskFailedEvent, n as TaskMessage, o as TaskProgressEvent, p as TaskRestartEvent, q as TaskRetryConfig, k as TaskStartedEvent, l as TaskStatus } from '../types-
|
|
1
|
+
export { C as COMPLETION_STRATEGIES, a as CONFLICT_STRATEGIES, b as CompletionResult, D as DEFAULTS, E as EXECUTION_MODES, c as EXECUTION_STATUS, d as ExecutionPlan, e as ExportOptions, M as MermaidOptions, T as TASK_STATUS, f as addDynamicTask, L as addKeyToProvides, N as addKeyToRequires, g as apply, h as applyAll, i as computeAvailableOutputs, j as createDefaultGraphEngineStore, k as createInitialExecutionState, l as detectStuckState, m as exportGraphConfig, n as exportGraphConfigToFile, o as flowToMermaid, p as getAllTasks, q as getCandidateTasks, r as getMaxExecutions, s as getProvides, t as getRefreshStrategy, u as getRequires, v as getTask, w as graphToMermaid, O as groupTasksByProvides, P as hasOutputConflict, x as hasTask, y as isExecutionComplete, z as isNonActiveTask, A as isRerunnable, B as isTaskCompleted, F as isTaskRunning, G as loadGraphConfig, H as next, I as planExecution, Q as removeKeyFromProvides, R as removeKeyFromRequires, J as validateGraphConfig, K as validateGraphSchema } from '../constants-BzZUyYlp.cjs';
|
|
2
|
+
export { G as GraphIssue, a as GraphValidationResult, I as IssueSeverity, v as validateGraph } from '../validate-Dbu7ygys.cjs';
|
|
3
|
+
import { T as TaskConfig, c as ExecutionState, a as ConflictStrategy, G as GraphConfig } from '../types-BBhqYGhE.cjs';
|
|
4
|
+
export { A as AgentActionEvent, C as CompletionStrategy, E as ExecutionConfig, b as ExecutionMode, d as ExecutionStatus, e as GraphEngineStore, f as GraphEvent, g as GraphSettings, I as InjectTokensEvent, R as RefreshStrategy, S as SchedulerResult, h as StuckDetection, m as TaskCircuitBreakerConfig, i as TaskCompletedEvent, j as TaskFailedEvent, n as TaskMessage, o as TaskProgressEvent, p as TaskRestartEvent, q as TaskRetryConfig, k as TaskStartedEvent, l as TaskStatus } from '../types-BBhqYGhE.cjs';
|
|
5
5
|
import '../types-ycun84cq.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -35,7 +35,7 @@ declare function selectRandomTasks(candidates: string[], graphTasks: Record<stri
|
|
|
35
35
|
/**
|
|
36
36
|
* Apply task start to execution state. Pure function.
|
|
37
37
|
*/
|
|
38
|
-
declare function applyTaskStart(state: ExecutionState, taskName: string): ExecutionState;
|
|
38
|
+
declare function applyTaskStart(state: ExecutionState, taskName: string, graph?: GraphConfig): ExecutionState;
|
|
39
39
|
/**
|
|
40
40
|
* Apply task completion to execution state.
|
|
41
41
|
* Handles: default provides, conditional provides (on), refresh strategy, data hash tracking.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { C as COMPLETION_STRATEGIES, a as CONFLICT_STRATEGIES, b as CompletionResult, D as DEFAULTS, E as EXECUTION_MODES, c as EXECUTION_STATUS, d as ExecutionPlan, e as ExportOptions, M as MermaidOptions, T as TASK_STATUS, f as addDynamicTask, L as addKeyToProvides, N as addKeyToRequires, g as apply, h as applyAll, i as computeAvailableOutputs, j as createDefaultGraphEngineStore, k as createInitialExecutionState, l as detectStuckState, m as exportGraphConfig, n as exportGraphConfigToFile, o as flowToMermaid, p as getAllTasks, q as getCandidateTasks, r as getMaxExecutions, s as getProvides, t as getRefreshStrategy, u as getRequires, v as getTask, w as graphToMermaid, O as groupTasksByProvides, P as hasOutputConflict, x as hasTask, y as isExecutionComplete, z as isNonActiveTask, A as isRerunnable, B as isTaskCompleted, F as isTaskRunning, G as loadGraphConfig, H as next, I as planExecution, Q as removeKeyFromProvides, R as removeKeyFromRequires, J as validateGraphConfig, K as validateGraphSchema } from '../constants-
|
|
2
|
-
export { G as GraphIssue, a as GraphValidationResult, I as IssueSeverity, v as validateGraph } from '../validate-
|
|
3
|
-
import { T as TaskConfig, c as ExecutionState, a as ConflictStrategy, G as GraphConfig } from '../types-
|
|
4
|
-
export { A as AgentActionEvent, C as CompletionStrategy, E as ExecutionConfig, b as ExecutionMode, d as ExecutionStatus, e as GraphEngineStore, f as GraphEvent, g as GraphSettings, I as InjectTokensEvent, R as RefreshStrategy, S as SchedulerResult, h as StuckDetection, m as TaskCircuitBreakerConfig, i as TaskCompletedEvent, j as TaskFailedEvent, n as TaskMessage, o as TaskProgressEvent, p as TaskRestartEvent, q as TaskRetryConfig, k as TaskStartedEvent, l as TaskStatus } from '../types-
|
|
1
|
+
export { C as COMPLETION_STRATEGIES, a as CONFLICT_STRATEGIES, b as CompletionResult, D as DEFAULTS, E as EXECUTION_MODES, c as EXECUTION_STATUS, d as ExecutionPlan, e as ExportOptions, M as MermaidOptions, T as TASK_STATUS, f as addDynamicTask, L as addKeyToProvides, N as addKeyToRequires, g as apply, h as applyAll, i as computeAvailableOutputs, j as createDefaultGraphEngineStore, k as createInitialExecutionState, l as detectStuckState, m as exportGraphConfig, n as exportGraphConfigToFile, o as flowToMermaid, p as getAllTasks, q as getCandidateTasks, r as getMaxExecutions, s as getProvides, t as getRefreshStrategy, u as getRequires, v as getTask, w as graphToMermaid, O as groupTasksByProvides, P as hasOutputConflict, x as hasTask, y as isExecutionComplete, z as isNonActiveTask, A as isRerunnable, B as isTaskCompleted, F as isTaskRunning, G as loadGraphConfig, H as next, I as planExecution, Q as removeKeyFromProvides, R as removeKeyFromRequires, J as validateGraphConfig, K as validateGraphSchema } from '../constants-oCEbNpul.js';
|
|
2
|
+
export { G as GraphIssue, a as GraphValidationResult, I as IssueSeverity, v as validateGraph } from '../validate-BAVzUJWa.js';
|
|
3
|
+
import { T as TaskConfig, c as ExecutionState, a as ConflictStrategy, G as GraphConfig } from '../types-BBhqYGhE.js';
|
|
4
|
+
export { A as AgentActionEvent, C as CompletionStrategy, E as ExecutionConfig, b as ExecutionMode, d as ExecutionStatus, e as GraphEngineStore, f as GraphEvent, g as GraphSettings, I as InjectTokensEvent, R as RefreshStrategy, S as SchedulerResult, h as StuckDetection, m as TaskCircuitBreakerConfig, i as TaskCompletedEvent, j as TaskFailedEvent, n as TaskMessage, o as TaskProgressEvent, p as TaskRestartEvent, q as TaskRetryConfig, k as TaskStartedEvent, l as TaskStatus } from '../types-BBhqYGhE.js';
|
|
5
5
|
import '../types-ycun84cq.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -35,7 +35,7 @@ declare function selectRandomTasks(candidates: string[], graphTasks: Record<stri
|
|
|
35
35
|
/**
|
|
36
36
|
* Apply task start to execution state. Pure function.
|
|
37
37
|
*/
|
|
38
|
-
declare function applyTaskStart(state: ExecutionState, taskName: string): ExecutionState;
|
|
38
|
+
declare function applyTaskStart(state: ExecutionState, taskName: string, graph?: GraphConfig): ExecutionState;
|
|
39
39
|
/**
|
|
40
40
|
* Apply task completion to execution state.
|
|
41
41
|
* Handles: default provides, conditional provides (on), refresh strategy, data hash tracking.
|
|
@@ -7093,15 +7093,30 @@ function selectOptimalTasks(candidates, graph, state, conflictStrategy) {
|
|
|
7093
7093
|
}
|
|
7094
7094
|
|
|
7095
7095
|
// src/event-graph/task-transitions.ts
|
|
7096
|
-
function applyTaskStart(state, taskName) {
|
|
7096
|
+
function applyTaskStart(state, taskName, graph) {
|
|
7097
7097
|
const existingTask = state.tasks[taskName] ?? createDefaultGraphEngineStore2();
|
|
7098
|
+
const startConsumedHashes = {};
|
|
7099
|
+
if (graph) {
|
|
7100
|
+
const taskConfig = graph.tasks[taskName];
|
|
7101
|
+
const requires = getRequires(taskConfig);
|
|
7102
|
+
for (const token of requires) {
|
|
7103
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
7104
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
7105
|
+
const otherState = state.tasks[otherName];
|
|
7106
|
+
if (otherState?.lastDataHash) startConsumedHashes[token] = otherState.lastDataHash;
|
|
7107
|
+
break;
|
|
7108
|
+
}
|
|
7109
|
+
}
|
|
7110
|
+
}
|
|
7111
|
+
}
|
|
7098
7112
|
const updatedTask = {
|
|
7099
7113
|
...existingTask,
|
|
7100
7114
|
status: "running",
|
|
7101
7115
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7102
7116
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7103
7117
|
progress: 0,
|
|
7104
|
-
error: void 0
|
|
7118
|
+
error: void 0,
|
|
7119
|
+
startConsumedHashes
|
|
7105
7120
|
};
|
|
7106
7121
|
return {
|
|
7107
7122
|
...state,
|
|
@@ -7121,16 +7136,18 @@ function applyTaskCompletion(state, graph, taskName, result, dataHash, data) {
|
|
|
7121
7136
|
} else {
|
|
7122
7137
|
outputTokens = getProvides(taskConfig);
|
|
7123
7138
|
}
|
|
7124
|
-
const lastConsumedHashes = { ...existingTask.lastConsumedHashes };
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
for (const
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7139
|
+
const lastConsumedHashes = existingTask.startConsumedHashes ? { ...existingTask.startConsumedHashes } : { ...existingTask.lastConsumedHashes };
|
|
7140
|
+
if (!existingTask.startConsumedHashes) {
|
|
7141
|
+
const requires = taskConfig.requires ?? [];
|
|
7142
|
+
for (const token of requires) {
|
|
7143
|
+
for (const [otherName, otherConfig] of Object.entries(graph.tasks)) {
|
|
7144
|
+
if (getProvides(otherConfig).includes(token)) {
|
|
7145
|
+
const otherState = state.tasks[otherName];
|
|
7146
|
+
if (otherState?.lastDataHash) {
|
|
7147
|
+
lastConsumedHashes[token] = otherState.lastDataHash;
|
|
7148
|
+
}
|
|
7149
|
+
break;
|
|
7132
7150
|
}
|
|
7133
|
-
break;
|
|
7134
7151
|
}
|
|
7135
7152
|
}
|
|
7136
7153
|
}
|
|
@@ -7252,7 +7269,7 @@ function apply(state, event, graph) {
|
|
|
7252
7269
|
}
|
|
7253
7270
|
switch (event.type) {
|
|
7254
7271
|
case "task-started":
|
|
7255
|
-
return applyTaskStart(state, event.taskName);
|
|
7272
|
+
return applyTaskStart(state, event.taskName, graph);
|
|
7256
7273
|
case "task-completed":
|
|
7257
7274
|
return applyTaskCompletion(state, graph, event.taskName, event.result, event.dataHash, event.data);
|
|
7258
7275
|
case "task-failed":
|