yaml-flow 5.4.0 → 5.4.2

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.
@@ -113,7 +113,7 @@ function statusText() {
113
113
  return runCli(['status', '--rg', BOARD], true) ?? '';
114
114
  }
115
115
 
116
- async function waitForAllCompleted(label, timeoutMs = 30000, pollMs = 500) {
116
+ async function waitForAllCompleted(label, timeoutMs = 90000, pollMs = 500) {
117
117
  const start = Date.now();
118
118
  const includeInferenceCards = fs.existsSync(path.join(CARDS, 'portfolio-risk-assessment.json'))
119
119
  && fs.existsSync(path.join(CARDS, 'rebalancing-strategy.json'));
@@ -128,44 +128,22 @@ function jsonReply(res, status, payload) {
128
128
 
129
129
  // ---------------------------------------------------------------------------
130
130
  // Card preparation — host-level concern, not a reusable runtime concern.
131
- // Copies source card JSON files into the runtime's tmpCardsDir and writes
132
- // the concatenated copilot-instructions.md at the board setup root.
133
- // The runtime's bootstrap operations assume cards are already in tmpCardsDir;
134
- // the host (this file) decides how and when they get there.
131
+ // Writes the concatenated copilot-instructions.md at the board setup root.
132
+ // Cards are served directly from cardsDir (no tmp copy needed).
135
133
  // ---------------------------------------------------------------------------
136
134
 
137
135
  const _demoPrepSetupDone = new Map(); // boardId → true
138
136
 
139
137
  function isDemoSetupDone(boardId, service) {
140
- return _demoPrepSetupDone.get(boardId) === true && fs.existsSync(service.tmpCardsDir);
138
+ return _demoPrepSetupDone.get(boardId) === true && fs.existsSync(service.cardsDir);
141
139
  }
142
140
 
143
141
  function demoPrepSetup(boardId, service) {
144
- const { tmpSurfaceDir, tmpCardsDir, cardsDir, gandalfCardsDir, tmpGandalfCardsDir, boardDir } = service;
145
-
146
- fs.mkdirSync(tmpSurfaceDir, { recursive: true });
147
- fs.rmSync(tmpCardsDir, { recursive: true, force: true });
148
- fs.mkdirSync(tmpCardsDir, { recursive: true });
149
-
150
- const entries = fs.readdirSync(cardsDir, { withFileTypes: true });
151
- for (const entry of entries) {
152
- if (!entry.isFile()) continue;
153
- if (!entry.name.toLowerCase().endsWith('.json')) continue;
154
- fs.copyFileSync(path.join(cardsDir, entry.name), path.join(tmpCardsDir, entry.name));
155
- }
156
-
157
- // Copy gandalf-card templates if gandalfCardsDir is configured.
158
- if (gandalfCardsDir && fs.existsSync(gandalfCardsDir)) {
159
- fs.rmSync(tmpGandalfCardsDir, { recursive: true, force: true });
160
- fs.mkdirSync(tmpGandalfCardsDir, { recursive: true });
161
- for (const entry of fs.readdirSync(gandalfCardsDir, { withFileTypes: true })) {
162
- if (!entry.isFile() || !entry.name.toLowerCase().endsWith('.json')) continue;
163
- fs.copyFileSync(path.join(gandalfCardsDir, entry.name), path.join(tmpGandalfCardsDir, entry.name));
164
- }
165
- }
142
+ const { cardsDir, gandalfCardsDir, boardDir } = service;
166
143
 
167
144
  // Concatenate agent-instructions*.md into copilot-instructions.md at boardSetupRoot.
168
145
  const boardSetupRoot = path.dirname(boardDir);
146
+ fs.mkdirSync(boardSetupRoot, { recursive: true });
169
147
  const srcDir = path.dirname(cardsDir);
170
148
  const agentInstructionFiles = ['agent-instructions.md', 'agent-instructions-cardlayout.md'];
171
149
  const parts = [];
@@ -6,9 +6,9 @@
6
6
  <title>Example Board Demo (Browser Runtime)</title>
7
7
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
8
8
  <script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
9
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/card-compute.js"></script>
10
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/live-cards.js"></script>
11
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/board-livegraph-engine.js"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/card-compute.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/live-cards.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/board-livegraph-engine.js"></script>
12
12
  </head>
13
13
  <body class="bg-light">
14
14
  <div class="container-fluid py-3">
@@ -16,10 +16,10 @@
16
16
  </style>
17
17
  <script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
18
18
  <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
19
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/card-compute.js"></script>
20
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/live-cards.js"></script>
21
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/board-livegraph-engine.js"></script>
22
- <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.0/browser/board-livecards-runtime-client.js"></script>
19
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/card-compute.js"></script>
20
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/live-cards.js"></script>
21
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/board-livegraph-engine.js"></script>
22
+ <script src="https://cdn.jsdelivr.net/npm/yaml-flow@5.4.2/browser/board-livecards-runtime-client.js"></script>
23
23
  </head>
24
24
  <body class="bg-light">
25
25
  <div class="container-fluid py-3">
@@ -192,11 +192,14 @@
192
192
  document.getElementById('boardTitle').textContent = bid + ' (Server Runtime)';
193
193
  document.getElementById('boardDesc').textContent = '';
194
194
 
195
+ // Demo-setup is a host-level concern; call it explicitly before bootstrapping.
196
+ const setupRes = await fetch(boardPaths(bid).demoSetup);
197
+ if (!setupRes.ok) throw new Error(`demo-setup failed (${setupRes.status})`);
198
+
195
199
  await runtimeClient.bootstrapBoard({
196
200
  boardId: bid,
197
201
  taskExecutorPath: resolveTaskExecutorPathParam(),
198
202
  rootElement: document.getElementById('boardRoot'),
199
- runDemoSetup: true,
200
203
  mode: currentMode,
201
204
  });
202
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-flow",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Unified workflow engine: step-machine (sequential) + event-graph (stateless DAG) with pluggable storage",
5
5
  "author": "",
6
6
  "license": "MIT",