@agent-native/core 0.84.37 → 0.84.39
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +2 -0
- package/corpus/core/src/client/agent-chat-adapter.ts +20 -0
- package/corpus/core/src/client/sse-event-processor.ts +31 -6
- package/corpus/core/src/server/agent-chat-plugin.ts +8 -0
- package/corpus/templates/design/app/components/design/CodeWorkbenchHost.tsx +486 -341
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +13 -0
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +76 -58
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +6 -0
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +80 -8
- package/corpus/templates/design/app/i18n/zh-TW.ts +2 -2
- package/corpus/templates/design/app/i18n-data.ts +22 -30
- package/corpus/templates/design/app/lib/design-import.ts +42 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +180 -109
- package/corpus/templates/design/changelog/2026-07-01-code-workspace-now-opens-a-vs-code-like-editor-with-real-cod.md +6 -0
- package/corpus/templates/design/changelog/2026-07-01-import-is-more-compact-local-app-setup-is-clearer-and-figma.md +6 -0
- package/corpus/templates/design/package.json +1 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +2 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +17 -2
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +11 -2
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +15 -10
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +2 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-chat-adapter.d.ts","sourceRoot":"","sources":["../../src/client/agent-chat-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAC;AAMhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAkBrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,oBAAoB;AAC9B;;;;GAIG;AACD,KAAK;AACP,0EAA0E;GACxE,WAAW,CAAC;AAssChB;;;;GAIG;AACH;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAC3C,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAC5C,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,GAAG,SAAS,CAAA;KAAE,CAAC;IACrD,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IAC3D,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,6BAA6B,GACtC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"agent-chat-adapter.d.ts","sourceRoot":"","sources":["../../src/client/agent-chat-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,qBAAqB,CAAC;AAMhF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAkBrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,oBAAoB;AAC9B;;;;GAIG;AACD,KAAK;AACP,0EAA0E;GACxE,WAAW,CAAC;AAssChB;;;;GAIG;AACH;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAC3C,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IAC5C,SAAS,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,GAAG,SAAS,CAAA;KAAE,CAAC;IACrD,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IAC3D,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;AAED,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,6BAA6B,GACtC,gBAAgB,CAihDlB"}
|
|
@@ -1092,6 +1092,7 @@ export function createAgentChatAdapter(options) {
|
|
|
1092
1092
|
const turnId = generateTurnId();
|
|
1093
1093
|
let runId = null;
|
|
1094
1094
|
let lastSeq = -1;
|
|
1095
|
+
let currentRunDispatchMode = null;
|
|
1095
1096
|
let currentMessageText = normalizeMentions(recoveryMessageText.trim() || userMessageText);
|
|
1096
1097
|
let currentHistory = history;
|
|
1097
1098
|
let currentStructuredHistory = structuredHistory;
|
|
@@ -1237,6 +1238,16 @@ export function createAgentChatAdapter(options) {
|
|
|
1237
1238
|
return false;
|
|
1238
1239
|
}
|
|
1239
1240
|
};
|
|
1241
|
+
const updateCurrentRunDispatchMode = (value) => {
|
|
1242
|
+
if (typeof value !== "string")
|
|
1243
|
+
return;
|
|
1244
|
+
const mode = value.trim();
|
|
1245
|
+
if (mode)
|
|
1246
|
+
currentRunDispatchMode = mode;
|
|
1247
|
+
};
|
|
1248
|
+
const currentSSEOptions = () => ({
|
|
1249
|
+
durableBackgroundRun: currentRunDispatchMode?.startsWith("background") === true,
|
|
1250
|
+
});
|
|
1240
1251
|
const captureChatClientError = (error, phase, extra = {}) => {
|
|
1241
1252
|
captureError(error, {
|
|
1242
1253
|
tags: {
|
|
@@ -1329,11 +1340,12 @@ export function createAgentChatAdapter(options) {
|
|
|
1329
1340
|
reconnectErrorCaptured = true;
|
|
1330
1341
|
break;
|
|
1331
1342
|
}
|
|
1343
|
+
updateCurrentRunDispatchMode(reconnectRes.headers.get("X-Dispatch-Mode"));
|
|
1332
1344
|
for await (const result of readSSEStream(reconnectRes.body, content, toolCallCounter, tabId, (seq) => {
|
|
1333
1345
|
lastSeq = seq;
|
|
1334
1346
|
if (threadId)
|
|
1335
1347
|
updateActiveRunSeq(seq);
|
|
1336
|
-
}, runId)) {
|
|
1348
|
+
}, runId, currentSSEOptions())) {
|
|
1337
1349
|
yield withRequestModeMetadata(result);
|
|
1338
1350
|
}
|
|
1339
1351
|
clearActiveRun();
|
|
@@ -1398,6 +1410,7 @@ export function createAgentChatAdapter(options) {
|
|
|
1398
1410
|
}
|
|
1399
1411
|
const active = await activeRes.json();
|
|
1400
1412
|
if (active?.active && active.runId) {
|
|
1413
|
+
updateCurrentRunDispatchMode(active.dispatchMode);
|
|
1401
1414
|
const activeStatus = typeof active.status === "string" ? active.status : "";
|
|
1402
1415
|
const activeTurnId = typeof active.turnId === "string" ? active.turnId : "";
|
|
1403
1416
|
if (activeStatus !== "running" && activeTurnId !== turnId) {
|
|
@@ -1458,6 +1471,7 @@ export function createAgentChatAdapter(options) {
|
|
|
1458
1471
|
const dispatchMode = typeof active.dispatchMode === "string"
|
|
1459
1472
|
? active.dispatchMode
|
|
1460
1473
|
: "";
|
|
1474
|
+
updateCurrentRunDispatchMode(dispatchMode);
|
|
1461
1475
|
if (activeRunId === interruptedRunId) {
|
|
1462
1476
|
if (dispatchMode.startsWith("background"))
|
|
1463
1477
|
continue;
|
|
@@ -1974,6 +1988,7 @@ export function createAgentChatAdapter(options) {
|
|
|
1974
1988
|
}
|
|
1975
1989
|
// Track the run ID for reconnection
|
|
1976
1990
|
runId = res.headers.get("X-Run-Id");
|
|
1991
|
+
updateCurrentRunDispatchMode(res.headers.get("X-Dispatch-Mode"));
|
|
1977
1992
|
if (runId && !attemptedRunIds.includes(runId)) {
|
|
1978
1993
|
attemptedRunIds.push(runId);
|
|
1979
1994
|
}
|
|
@@ -1985,7 +2000,7 @@ export function createAgentChatAdapter(options) {
|
|
|
1985
2000
|
if (runId && threadId) {
|
|
1986
2001
|
updateActiveRunSeq(seq);
|
|
1987
2002
|
}
|
|
1988
|
-
}, runId)) {
|
|
2003
|
+
}, runId, currentSSEOptions())) {
|
|
1989
2004
|
yield withRequestModeMetadata(result);
|
|
1990
2005
|
}
|
|
1991
2006
|
// Run completed normally — clear active run state
|