@leeoohoo/ui-apps-devkit 0.1.12 → 0.1.13
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/package.json +1 -1
- package/src/sandbox/server.js +6 -6
package/package.json
CHANGED
package/src/sandbox/server.js
CHANGED
|
@@ -1318,7 +1318,7 @@ const normalizeRequestId = (value) => (typeof value === 'string' ? value.trim()
|
|
|
1318
1318
|
const buildAsyncRequestIds = (taskId) => {
|
|
1319
1319
|
const id = normalizeRequestId(taskId);
|
|
1320
1320
|
if (!id) return [];
|
|
1321
|
-
return [id,
|
|
1321
|
+
return [id, 'mcp-task:' + id];
|
|
1322
1322
|
};
|
|
1323
1323
|
|
|
1324
1324
|
const extractAsyncResult = (list, requestIds) => {
|
|
@@ -1378,11 +1378,11 @@ const runMcpAsyncTest = async () => {
|
|
|
1378
1378
|
const taskId = 'task_' + uuid();
|
|
1379
1379
|
const callMeta = buildAsyncTaskCallMeta(taskId);
|
|
1380
1380
|
const ack = { status: 'accepted', taskId };
|
|
1381
|
-
const resultText =
|
|
1381
|
+
const resultText = 'AsyncTask result for ' + taskId;
|
|
1382
1382
|
|
|
1383
1383
|
appendMcpOutput('asyncTask.request', { message, callMeta });
|
|
1384
1384
|
appendMcpOutput('asyncTask.ack', ack);
|
|
1385
|
-
setMcpStatus(
|
|
1385
|
+
setMcpStatus('ACK: ' + taskId + ' (waiting for uiPrompts result)...');
|
|
1386
1386
|
|
|
1387
1387
|
const pollPromise = pollAsyncResult({ taskId, timeoutMs: 8000, intervalMs: 400 });
|
|
1388
1388
|
|
|
@@ -1391,7 +1391,7 @@ const runMcpAsyncTest = async () => {
|
|
|
1391
1391
|
try {
|
|
1392
1392
|
await host.uiPrompts.request({ requestId: taskId, prompt });
|
|
1393
1393
|
appendMcpOutput('asyncTask.result', { requestId: taskId, prompt });
|
|
1394
|
-
setMcpStatus(
|
|
1394
|
+
setMcpStatus('Result stored in uiPrompts (taskId=' + taskId + ')');
|
|
1395
1395
|
} catch (err) {
|
|
1396
1396
|
appendMcpOutput('asyncTask.error', err?.message || String(err));
|
|
1397
1397
|
setMcpStatus(err?.message || String(err), true);
|
|
@@ -1401,10 +1401,10 @@ const runMcpAsyncTest = async () => {
|
|
|
1401
1401
|
const pollResult = await pollPromise;
|
|
1402
1402
|
if (pollResult.found) {
|
|
1403
1403
|
appendMcpOutput('asyncTask.polled', pollResult.text);
|
|
1404
|
-
setMcpStatus(
|
|
1404
|
+
setMcpStatus('Polled result (taskId=' + taskId + ')');
|
|
1405
1405
|
} else {
|
|
1406
1406
|
appendMcpOutput('asyncTask.timeout', { taskId });
|
|
1407
|
-
setMcpStatus(
|
|
1407
|
+
setMcpStatus('Polling timeout (taskId=' + taskId + ')', true);
|
|
1408
1408
|
}
|
|
1409
1409
|
} catch (err) {
|
|
1410
1410
|
setMcpStatus(err?.message || String(err), true);
|