yaml-flow 8.4.25 → 8.5.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.
- package/browser/asset-integrity.json +3 -3
- package/browser/board-livecards-client.js +1 -1
- 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 +13 -13
- package/cli/{types-juH2nFpz.d.ts → types-H3EMBPY2.d.ts} +10 -4
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/README-mcp-api.md +680 -0
- 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 +1148 -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 +296 -0
- package/lib/board-live-cards-mcp.d.ts +296 -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-B13InXhC.d.cts} +8 -3
- package/lib/{board-live-cards-public-ydXuA4zh.d.ts → board-live-cards-public-BGS22cMb.d.ts} +8 -3
- 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 +7 -2
- package/lib/chat-store-public.d.ts +7 -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-DwPRb-PY.d.ts → types-30R357js.d.ts} +3 -2
- package/lib/{types-BpfMamGs.d.cts → types-CIgsh56O.d.cts} +3 -2
- package/package.json +10 -2
- package/browser/board-livecards-localstorage.js +0 -10
|
@@ -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": {
|