yaml-flow 8.4.25 → 8.5.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/browser/asset-integrity.json +3 -3
- package/cli/browser-api/board-live-cards-browser-adapter.d.ts +1 -1
- package/cli/browser-api/board-live-cards-browser-adapter.js +1 -1
- package/cli/bundled/board-live-cards-cli.mjs +14 -14
- package/cli/bundled/chat-store-cli.mjs +6 -6
- package/cli/{types-juH2nFpz.d.ts → types-D2s3VzyY.d.ts} +3 -2
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-server.js +4 -0
- package/examples/board/server/chat-flow/copilot-chat/assistant.js +4 -2
- package/examples/board/server/chat-flow/flow-steps.json +9 -8
- package/examples/board/test/server-http-mcp-test.js +791 -0
- package/examples/board/test/server-http-test.js +7 -7
- package/examples/board-local/demo-shell-localstorage.html +3 -3
- package/lib/artifacts-store-public.d.cts +1 -1
- package/lib/artifacts-store-public.d.ts +1 -1
- package/lib/board-live-cards-mcp.cjs +2 -0
- package/lib/board-live-cards-mcp.d.cts +259 -0
- package/lib/board-live-cards-mcp.d.ts +259 -0
- package/lib/board-live-cards-mcp.js +2 -0
- package/lib/board-live-cards-node.cjs +14 -14
- package/lib/board-live-cards-node.d.cts +8 -6
- package/lib/board-live-cards-node.d.ts +8 -6
- package/lib/board-live-cards-node.js +14 -14
- package/lib/{board-live-cards-public-B4RcYPC_.d.cts → board-live-cards-public-CvkDfZQ7.d.cts} +1 -1
- package/lib/{board-live-cards-public-ydXuA4zh.d.ts → board-live-cards-public-DdVhH4M-.d.ts} +1 -1
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +1 -1
- package/lib/board-live-cards-public.d.ts +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +5 -4
- package/lib/board-live-cards-server-runtime.d.cts +3 -3
- package/lib/board-live-cards-server-runtime.d.ts +3 -3
- package/lib/board-live-cards-server-runtime.js +5 -4
- package/lib/card-store-public.d.cts +1 -1
- package/lib/card-store-public.d.ts +1 -1
- package/lib/{chat-storage-lib-B1wU27y3.d.cts → chat-storage-lib-0imhRX3l.d.cts} +2 -1
- package/lib/{chat-storage-lib-DsF4kPon.d.ts → chat-storage-lib-CJn7a6OH.d.ts} +2 -1
- package/lib/chat-store-public.cjs +1 -1
- package/lib/chat-store-public.d.cts +2 -2
- package/lib/chat-store-public.d.ts +2 -2
- package/lib/chat-store-public.js +1 -1
- package/lib/server-runtime/index.cjs +5 -4
- package/lib/server-runtime/index.d.cts +4 -4
- package/lib/server-runtime/index.d.ts +4 -4
- package/lib/server-runtime/index.js +5 -4
- package/lib/{types-BpfMamGs.d.cts → types-NM_d_1oZ.d.cts} +3 -2
- package/lib/{types-DwPRb-PY.d.ts → types-QNI__eAf.d.ts} +3 -2
- package/package.json +10 -2
- package/browser/board-livecards-localstorage.js +0 -10
|
@@ -318,6 +318,7 @@ interface ChatRecord {
|
|
|
318
318
|
role: string;
|
|
319
319
|
text: string;
|
|
320
320
|
files: unknown[];
|
|
321
|
+
turn: string;
|
|
321
322
|
updated_at: string;
|
|
322
323
|
}
|
|
323
324
|
interface ChatConfig {
|
|
@@ -330,7 +331,7 @@ interface ChatReadAfterResult {
|
|
|
330
331
|
}
|
|
331
332
|
interface ChatStorage {
|
|
332
333
|
/** Append a message; returns the new entry id (usable as a cursor). */
|
|
333
|
-
append(cardId: string, role: string, text: string, files?: unknown[]): string;
|
|
334
|
+
append(cardId: string, role: string, text: string, files?: unknown[], turn?: string): string;
|
|
334
335
|
/** Read all messages in insertion order. */
|
|
335
336
|
readAll(cardId: string): ChatRecord[];
|
|
336
337
|
/**
|
|
@@ -389,4 +390,4 @@ interface DescribeEnvelope {
|
|
|
389
390
|
supports?: string[];
|
|
390
391
|
}
|
|
391
392
|
|
|
392
|
-
export { type BoardPlatformAdapter as B, type ChatStorage as C, type DescribeEnvelope as D, type InvocationAdapter as I, type NotificationTransport as N, type CommandInput as a, type CommandResult as b, type
|
|
393
|
+
export { type BoardPlatformAdapter as B, type ChatStorage as C, type DescribeEnvelope as D, type InvocationAdapter as I, type NotificationTransport as N, type CommandInput as a, type CommandResult as b, type ChatRecord as c, type ChatReadAfterResult as d, type ChatConfig as e, type BoardNonCorePlatformAdapter as f, type BoardLiveCardsNonCorePublic as g, type BoardLiveCardsPublic as h, createBoardLiveCardsNonCorePublic as i, createBoardLiveCardsPublic as j, createChatStorage as k, createInMemoryChatStorage as l };
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
20
20
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
21
21
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
22
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
23
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
22
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.5.0/browser/live-cards.js"></script>
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.5.0/browser/board-livecards-client.js"></script>
|
|
24
24
|
</head>
|
|
25
25
|
<body class="bg-light">
|
|
26
26
|
<div class="container-fluid py-3">
|
package/examples/board/doc.html
CHANGED
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
38
38
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
39
39
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
40
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
41
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
40
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.5.0/browser/live-cards.js"></script>
|
|
41
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.5.0/browser/board-livecards-client.js"></script>
|
|
42
42
|
</head>
|
|
43
43
|
<body class="bg-light">
|
|
44
44
|
<div class="container-fluid py-3">
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
buildLocalBaseSpec,
|
|
18
18
|
createFsBoardPlatformAdapter,
|
|
19
|
+
createFsBoardNonCorePlatformAdapter,
|
|
19
20
|
createFsBoardChatStorage,
|
|
20
21
|
createNodeSpawnInvocationAdapter,
|
|
21
22
|
createArtifactsStore,
|
|
@@ -301,7 +302,9 @@ function buildBoardContextConfig(label, boardDir, taskExecPath, chatHandlerFlow,
|
|
|
301
302
|
const notifyChannel = `yaml-flow-server-${label}-${boardId}-${process.pid}`;
|
|
302
303
|
const baseRef = parseRef(serializeRef({ kind: 'fs-path', value: boardDir }));
|
|
303
304
|
const boardAdapter = createFsBoardPlatformAdapter(baseRef, { notifyChannel });
|
|
305
|
+
const nonCoreAdapter = createFsBoardNonCorePlatformAdapter(baseRef, { notifyChannel });
|
|
304
306
|
boardAdapter.requestProcessAccumulated = () => {};
|
|
307
|
+
nonCoreAdapter.requestProcessAccumulated = () => {};
|
|
305
308
|
|
|
306
309
|
const artifactsRef = parseRef(serializeRef({ kind: 'fs-path', value: runtimeCardsDir }));
|
|
307
310
|
const artifactsAdapter = createFsBoardPlatformAdapter(artifactsRef, { suppressSpawn: true });
|
|
@@ -313,6 +316,7 @@ function buildBoardContextConfig(label, boardDir, taskExecPath, chatHandlerFlow,
|
|
|
313
316
|
return {
|
|
314
317
|
label,
|
|
315
318
|
boardAdapter,
|
|
319
|
+
nonCoreAdapter,
|
|
316
320
|
artifactsAdapter,
|
|
317
321
|
baseRef,
|
|
318
322
|
cardStoreRef,
|
|
@@ -30,6 +30,7 @@ const {
|
|
|
30
30
|
cardsDir = '',
|
|
31
31
|
chatMessages: rawChatMessages = [],
|
|
32
32
|
userText = 'what is two plus two?',
|
|
33
|
+
turnId = '',
|
|
33
34
|
chatCopilotTimeoutMs: rawChatCopilotTimeoutMs = 300000,
|
|
34
35
|
} = extra;
|
|
35
36
|
|
|
@@ -39,7 +40,7 @@ const chatCopilotTimeoutMs = Number.isFinite(Number(rawChatCopilotTimeoutMs)) &&
|
|
|
39
40
|
: 300000;
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
function buildPrompt(cId, historyDump, currentUserText) {
|
|
43
|
+
function buildPrompt(cId, historyDump, currentUserText, currentTurnId) {
|
|
43
44
|
const cardSetupDirRel = path.join(cardsDir, cId).replace(/\\/g, '/');
|
|
44
45
|
const runtimeDirRel = boardRuntimeDir;
|
|
45
46
|
const statusDirRel = runtimeStatusDir;
|
|
@@ -53,6 +54,7 @@ function buildPrompt(cId, historyDump, currentUserText) {
|
|
|
53
54
|
'The user sees the data available in cards which is rendered, and the status from ' + statusDirRel + '.',
|
|
54
55
|
'Everything else is internal detail not to be exposed to the user.',
|
|
55
56
|
'The conversation history is provided below exactly as received from the runtime API as a string dump.',
|
|
57
|
+
...(currentTurnId ? ['The current conversation turn id is: ' + currentTurnId] : []),
|
|
56
58
|
'The current user query is: ' + currentUserText,
|
|
57
59
|
'Return only the assistant response text for the user.',
|
|
58
60
|
'Do not write files, and do not include any internal notes, logs, or orchestration details in the response.',
|
|
@@ -98,7 +100,7 @@ function runCopilot(prompt, workingDir) {
|
|
|
98
100
|
|
|
99
101
|
const historyDump = JSON.stringify(chatMessages, null, 2);
|
|
100
102
|
const workingDir = boardSetupRoot;
|
|
101
|
-
const prompt = buildPrompt(cardId, historyDump, userText.trim());
|
|
103
|
+
const prompt = buildPrompt(cardId, historyDump, userText.trim(), String(turnId || '').trim());
|
|
102
104
|
|
|
103
105
|
try {
|
|
104
106
|
const replyText = runCopilot(prompt, workingDir).trim();
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"open_turn": {
|
|
40
40
|
"description": "Resolve the current user turn from flow-provided chat messages and parse any chat envelope options",
|
|
41
|
-
"produces_data": ["boardId", "cardId", "boardSetupRoot", "boardBaseRef", "boardRuntimeDir", "runtimeStatusDir", "cardsDir", "projectRoot", "chatFlowRoot", "chatMessages", "userText", "lastChatEntryId", "probe", "chatHandlerMode", "chatCopilotTimeoutMs", "probeAttachmentFileIdx"],
|
|
41
|
+
"produces_data": ["boardId", "cardId", "boardSetupRoot", "boardBaseRef", "boardRuntimeDir", "runtimeStatusDir", "cardsDir", "projectRoot", "chatFlowRoot", "chatMessages", "userText", "lastChatEntryId", "turnId", "probe", "chatHandlerMode", "chatCopilotTimeoutMs", "probeAttachmentFileIdx"],
|
|
42
42
|
"input_validations": [
|
|
43
43
|
"$type(cardId) = \"string\" and $length(cardId) > 0",
|
|
44
44
|
"$type(chatMessages) = \"array\"",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"data.chatMessages = expects_data.chatMessages",
|
|
61
61
|
"data.lastChatEntryId = expects_data.lastChatEntryId",
|
|
62
62
|
"data._currentUserMessage = $filter(expects_data.chatMessages, function($message) { $message.id = expects_data.lastChatEntryId and $message.role = \"user\" })[0]",
|
|
63
|
+
"data.turnId = ($type(expects_data.turnId) = \"string\") ? expects_data.turnId : (($type(data._currentUserMessage.turn) = \"string\") ? data._currentUserMessage.turn : \"\")",
|
|
63
64
|
"data._rawMessageText = $trim($string(data._currentUserMessage.text))",
|
|
64
65
|
"data.probeAttachmentFileIdx = ($type(data._currentUserMessage.files) = \"array\" and $count(data._currentUserMessage.files) > 0) ? 0 : null",
|
|
65
66
|
"data._marker = \"__probe__echo__probe__\"",
|
|
@@ -129,7 +130,7 @@
|
|
|
129
130
|
"meta": "chat-handler",
|
|
130
131
|
"argsMassaging": {
|
|
131
132
|
"cmdTemplate": ["'--stdin'"],
|
|
132
|
-
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'system', 'text': 'in-progress', 'files': [] }] }"
|
|
133
|
+
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'system', 'text': 'in-progress', 'files': [], 'turn': turnId }] }"
|
|
133
134
|
}
|
|
134
135
|
},
|
|
135
136
|
"transitions": {
|
|
@@ -178,7 +179,7 @@
|
|
|
178
179
|
},
|
|
179
180
|
"copilot_assistant": {
|
|
180
181
|
"description": "Run the Copilot-backed assistant logic to generate the reply from the resolved chat history",
|
|
181
|
-
"expects_data": ["userText", "chatMessages", "boardId", "cardId", "boardSetupRoot", "boardRuntimeDir", "runtimeStatusDir", "cardsDir", "projectRoot", "chatFlowRoot", "chatCopilotTimeoutMs"],
|
|
182
|
+
"expects_data": ["userText", "chatMessages", "boardId", "cardId", "boardSetupRoot", "boardRuntimeDir", "runtimeStatusDir", "cardsDir", "projectRoot", "chatFlowRoot", "chatCopilotTimeoutMs", "turnId"],
|
|
182
183
|
"produces_data": ["replyText"],
|
|
183
184
|
"input_validations": [
|
|
184
185
|
"$type(userText) = \"string\"",
|
|
@@ -193,7 +194,7 @@
|
|
|
193
194
|
},
|
|
194
195
|
"argsMassaging": {
|
|
195
196
|
"cmdTemplate": ["chatFlowRoot & '/copilot-chat/assistant.js'"],
|
|
196
|
-
"stdinTemplate": "{ 'cardId': cardId, 'boardSetupRoot': boardSetupRoot, 'boardRuntimeDir': boardRuntimeDir, 'runtimeStatusDir': runtimeStatusDir, 'cardsDir': cardsDir, 'chatMessages': chatMessages, 'userText': userText, 'chatCopilotTimeoutMs': chatCopilotTimeoutMs }"
|
|
197
|
+
"stdinTemplate": "{ 'cardId': cardId, 'boardSetupRoot': boardSetupRoot, 'boardRuntimeDir': boardRuntimeDir, 'runtimeStatusDir': runtimeStatusDir, 'cardsDir': cardsDir, 'chatMessages': chatMessages, 'userText': userText, 'chatCopilotTimeoutMs': chatCopilotTimeoutMs, 'turnId': turnId }"
|
|
197
198
|
},
|
|
198
199
|
"meta": "chat-handler"
|
|
199
200
|
},
|
|
@@ -225,7 +226,7 @@
|
|
|
225
226
|
},
|
|
226
227
|
"write_reply": {
|
|
227
228
|
"description": "Append the assistant reply and clear processing via one chat-store-cli command envelope",
|
|
228
|
-
"expects_data": ["boardSetupRoot", "boardRuntimeDir", "cardId", "replyText"],
|
|
229
|
+
"expects_data": ["boardSetupRoot", "boardRuntimeDir", "cardId", "replyText", "turnId"],
|
|
229
230
|
"produces_data": ["replyId"],
|
|
230
231
|
"input_validations": [
|
|
231
232
|
"$type(boardSetupRoot) = \"string\" and $length(boardSetupRoot) > 0",
|
|
@@ -242,7 +243,7 @@
|
|
|
242
243
|
"meta": "chat-handler",
|
|
243
244
|
"argsMassaging": {
|
|
244
245
|
"cmdTemplate": ["'--stdin'"],
|
|
245
|
-
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'assistant', 'text': replyText, 'files': [] }, { 'command': 'set-processing', 'active': false }] }"
|
|
246
|
+
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'assistant', 'text': replyText, 'files': [], 'turn': turnId }, { 'command': 'set-processing', 'active': false }] }"
|
|
246
247
|
},
|
|
247
248
|
"outputTransforms": {
|
|
248
249
|
"dataTemplate": "{ 'replyId': output.data.results[0].data.id }"
|
|
@@ -256,7 +257,7 @@
|
|
|
256
257
|
},
|
|
257
258
|
"cleanup_failure": {
|
|
258
259
|
"description": "Write a failure system message and clear processing via one chat-store-cli command envelope",
|
|
259
|
-
"expects_data": ["boardSetupRoot", "boardRuntimeDir", "cardId"],
|
|
260
|
+
"expects_data": ["boardSetupRoot", "boardRuntimeDir", "cardId", "turnId"],
|
|
260
261
|
"input_validations": [
|
|
261
262
|
"$type(boardSetupRoot) = \"string\" and $length(boardSetupRoot) > 0",
|
|
262
263
|
"$type(cardId) = \"string\" and $length(cardId) > 0"
|
|
@@ -271,7 +272,7 @@
|
|
|
271
272
|
"meta": "chat-handler",
|
|
272
273
|
"argsMassaging": {
|
|
273
274
|
"cmdTemplate": ["'--stdin'"],
|
|
274
|
-
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'system', 'text': 'AI response failed - the assistant could not generate a reply. Check server configuration and logs.', 'files': [] }, { 'command': 'set-processing', 'active': false }] }"
|
|
275
|
+
"stdinTemplate": "{ 'storeRef': $fsPathRef(boardSetupRoot & '/' & boardRuntimeDir), 'cardId': cardId, 'commands': [{ 'command': 'append', 'role': 'system', 'text': 'AI response failed - the assistant could not generate a reply. Check server configuration and logs.', 'files': [], 'turn': turnId }, { 'command': 'set-processing', 'active': false }] }"
|
|
275
276
|
}
|
|
276
277
|
},
|
|
277
278
|
"transitions": {
|