@agent-native/core 0.84.12 → 0.84.14

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.
Files changed (112) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +19 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/agent/durable-background.ts +42 -5
  5. package/corpus/core/src/agent/production-agent.ts +72 -10
  6. package/corpus/core/src/agent/run-manager.ts +84 -4
  7. package/corpus/core/src/agent/run-store.ts +55 -11
  8. package/corpus/core/src/chat-threads/store.ts +2 -0
  9. package/corpus/core/src/cli/skills.ts +10 -6
  10. package/corpus/core/src/client/AssistantChat.tsx +40 -9
  11. package/corpus/core/src/client/agent-chat-adapter.ts +44 -5
  12. package/corpus/core/src/client/blocks/library/diagram.tsx +3 -3
  13. package/corpus/core/src/client/chat/message-components.tsx +17 -0
  14. package/corpus/core/src/client/chat/run-recovery.tsx +52 -44
  15. package/corpus/core/src/client/chat/tool-call-display.tsx +7 -2
  16. package/corpus/core/src/observability/traces.ts +17 -3
  17. package/corpus/core/src/server/agent-chat-plugin.ts +12 -1
  18. package/corpus/core/src/shared/streaming-text-smoothing.ts +10 -5
  19. package/corpus/core/src/styles/blocks.css +44 -1
  20. package/corpus/templates/clips/app/components/library/recording-card.tsx +14 -4
  21. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +10 -12
  22. package/corpus/templates/clips/app/hooks/use-library.ts +7 -4
  23. package/corpus/templates/clips/app/lib/recording-status.ts +32 -0
  24. package/corpus/templates/clips/changelog/2026-07-01-chrome-extension-recordings-stream-uploads-while-recording.md +6 -0
  25. package/corpus/templates/clips/changelog/2026-07-01-dictation-keeps-listening-through-natural-pauses-and-gives-c.md +6 -0
  26. package/corpus/templates/clips/changelog/2026-07-01-redoing-a-paused-desktop-recording-no-longer-leaves-the-recording-controls-disabled.md +6 -0
  27. package/corpus/templates/clips/changelog/2026-07-01-stalled-clip-uploads-now-update-in-the-library-and-surface-as-failed.md +6 -0
  28. package/corpus/templates/clips/chrome-extension/src/background.ts +8 -0
  29. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +61 -16
  30. package/corpus/templates/clips/desktop/src/lib/recorder.ts +36 -18
  31. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +99 -27
  32. package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +4 -43
  33. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +3 -0
  34. package/corpus/templates/clips/desktop/src/styles.css +5 -48
  35. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +4 -5
  36. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +15 -6
  37. package/corpus/templates/design/AGENTS.md +8 -4
  38. package/corpus/templates/design/actions/create-design.ts +1 -0
  39. package/corpus/templates/design/actions/duplicate-design.ts +3 -1
  40. package/corpus/templates/design/actions/edit-design.ts +43 -13
  41. package/corpus/templates/design/actions/generate-design.ts +5 -1
  42. package/corpus/templates/design/actions/present-design-variants.ts +17 -12
  43. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  44. package/corpus/templates/design/app/pages/DesignEditor.tsx +2 -2
  45. package/corpus/templates/design/changelog/2026-07-01-org-members-can-see-design-projects-created-in-their-workspace.md +6 -0
  46. package/corpus/templates/design/server/plugins/db.ts +9 -0
  47. package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +44 -1
  48. package/corpus/templates/plan/changelog/2026-07-01-visual-plan-and-recap-diagram-labels-now-wrap-inside-their-b.md +6 -0
  49. package/dist/agent/durable-background.d.ts +3 -0
  50. package/dist/agent/durable-background.d.ts.map +1 -1
  51. package/dist/agent/durable-background.js +33 -3
  52. package/dist/agent/durable-background.js.map +1 -1
  53. package/dist/agent/production-agent.d.ts +1 -0
  54. package/dist/agent/production-agent.d.ts.map +1 -1
  55. package/dist/agent/production-agent.js +55 -9
  56. package/dist/agent/production-agent.js.map +1 -1
  57. package/dist/agent/run-manager.d.ts +2 -0
  58. package/dist/agent/run-manager.d.ts.map +1 -1
  59. package/dist/agent/run-manager.js +68 -5
  60. package/dist/agent/run-manager.js.map +1 -1
  61. package/dist/agent/run-store.d.ts +9 -0
  62. package/dist/agent/run-store.d.ts.map +1 -1
  63. package/dist/agent/run-store.js +47 -11
  64. package/dist/agent/run-store.js.map +1 -1
  65. package/dist/chat-threads/store.d.ts +1 -0
  66. package/dist/chat-threads/store.d.ts.map +1 -1
  67. package/dist/chat-threads/store.js +2 -0
  68. package/dist/chat-threads/store.js.map +1 -1
  69. package/dist/cli/skills.d.ts.map +1 -1
  70. package/dist/cli/skills.js +10 -6
  71. package/dist/cli/skills.js.map +1 -1
  72. package/dist/client/AssistantChat.d.ts +10 -0
  73. package/dist/client/AssistantChat.d.ts.map +1 -1
  74. package/dist/client/AssistantChat.js +26 -8
  75. package/dist/client/AssistantChat.js.map +1 -1
  76. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  77. package/dist/client/agent-chat-adapter.js +40 -5
  78. package/dist/client/agent-chat-adapter.js.map +1 -1
  79. package/dist/client/blocks/library/diagram.js +3 -3
  80. package/dist/client/blocks/library/diagram.js.map +1 -1
  81. package/dist/client/chat/message-components.d.ts +3 -1
  82. package/dist/client/chat/message-components.d.ts.map +1 -1
  83. package/dist/client/chat/message-components.js +16 -2
  84. package/dist/client/chat/message-components.js.map +1 -1
  85. package/dist/client/chat/run-recovery.d.ts.map +1 -1
  86. package/dist/client/chat/run-recovery.js +15 -10
  87. package/dist/client/chat/run-recovery.js.map +1 -1
  88. package/dist/client/chat/tool-call-display.d.ts +1 -0
  89. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  90. package/dist/client/chat/tool-call-display.js +3 -2
  91. package/dist/client/chat/tool-call-display.js.map +1 -1
  92. package/dist/collab/awareness.d.ts +2 -2
  93. package/dist/collab/awareness.d.ts.map +1 -1
  94. package/dist/collab/routes.d.ts +1 -1
  95. package/dist/notifications/routes.d.ts +3 -3
  96. package/dist/observability/routes.d.ts +6 -6
  97. package/dist/observability/traces.d.ts +5 -0
  98. package/dist/observability/traces.d.ts.map +1 -1
  99. package/dist/observability/traces.js +9 -3
  100. package/dist/observability/traces.js.map +1 -1
  101. package/dist/resources/handlers.d.ts +2 -2
  102. package/dist/server/agent-chat-plugin.d.ts +2 -1
  103. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  104. package/dist/server/agent-chat-plugin.js +8 -3
  105. package/dist/server/agent-chat-plugin.js.map +1 -1
  106. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  107. package/dist/server/transcribe-voice.d.ts +1 -1
  108. package/dist/shared/streaming-text-smoothing.d.ts.map +1 -1
  109. package/dist/shared/streaming-text-smoothing.js +8 -5
  110. package/dist/shared/streaming-text-smoothing.js.map +1 -1
  111. package/dist/styles/blocks.css +44 -1
  112. 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;AAmrChB;;;;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,EA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A;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,CA6/ClB"}
@@ -621,6 +621,19 @@ function lastActivityTool(trail) {
621
621
  }
622
622
  return undefined;
623
623
  }
624
+ function formatActivityTrail(trail) {
625
+ const items = trail
626
+ .slice(-8)
627
+ .map((entry) => {
628
+ const label = entry.label.replace(/\s+/g, " ").trim();
629
+ const tool = entry.tool?.replace(/\s+/g, " ").trim();
630
+ if (label && tool && label !== tool)
631
+ return `${label} (${tool})`;
632
+ return label || tool || "";
633
+ })
634
+ .filter(Boolean);
635
+ return items.length > 0 ? items.join(" > ") : undefined;
636
+ }
624
637
  function lastUnresolvedToolActivity(content) {
625
638
  for (let i = content.length - 1; i >= 0; i--) {
626
639
  const part = content[i];
@@ -717,9 +730,9 @@ function incrementalActionGuidance(tool) {
717
730
  return "create a compact working v1 with `create-extension`, then use focused `update-extension` edits for refinements";
718
731
  case "generate-design":
719
732
  case "update-design":
720
- return "persist a minimal first version (fewer files) with `generate-design`, then refine individual files with `edit-design` search/replace instead of resending everything";
733
+ return 'if an existing design file or snapshot is already in history, especially after a Design variant pick, stop retrying `generate-design`: call `get-design-snapshot` for the selected file, then call `edit-design` once on that same `fileId` (`mode: "replace-file"` for a compact full-file replacement, or search/replace for smaller edits). Use `generate-design` only for a brand-new compact first file when no target file exists yet';
721
734
  case "present-design-variants":
722
- return "call `present-design-variants` with concise labels, descriptions, accent colors, and feature bullets; omit large `content` HTML when needed so the action can render compact representative screens, then refine the chosen direction with `generate-design` or `edit-design`";
735
+ return 'call `present-design-variants` with concise labels, descriptions, accent colors, and feature bullets; omit large `content` HTML when needed so the action can render compact representative screens. After the user picks a direction, delete unchosen screens, snapshot the selected `fileId`, and refine that same file with `edit-design` (`mode: "replace-file"` for placeholder expansion). Do not call `generate-design` after the variant pick';
723
736
  case "create-visual-plan":
724
737
  case "create-ui-plan":
725
738
  case "create-plan-design":
@@ -1112,12 +1125,32 @@ export function createAgentChatAdapter(options) {
1112
1125
  let visibleContinuationPrefix = [];
1113
1126
  let lastAutoContinueReason = null;
1114
1127
  let lastRecoverableRunError = null;
1128
+ let lastActivityTrail = [];
1115
1129
  const attemptedRunIds = [];
1116
1130
  let authRecoveryAttempted = false;
1117
1131
  let continuationToolCallCounter = 0;
1118
1132
  const nextContinuationToolCallId = () => `continuation_tc_${++continuationToolCallCounter}`;
1133
+ const runDebugContextDetails = () => {
1134
+ const pageOrigin = typeof window !== "undefined" && window.location?.origin
1135
+ ? window.location.origin
1136
+ : "";
1137
+ return [
1138
+ `api_url: ${apiUrl}`,
1139
+ pageOrigin ? `page_origin: ${pageOrigin}` : "",
1140
+ tabId ? `tab_id: ${tabId}` : "",
1141
+ threadId ? `thread_id: ${threadId}` : "",
1142
+ `turn_id: ${turnId}`,
1143
+ runId ? `current_run: ${runId}` : "",
1144
+ attemptedRunIds.length > 0
1145
+ ? `attempted_runs: ${attemptedRunIds.join(", ")}`
1146
+ : "",
1147
+ ]
1148
+ .filter(Boolean)
1149
+ .join("\n");
1150
+ };
1119
1151
  const connectionRecoveryDetails = () => {
1120
1152
  return [
1153
+ runDebugContextDetails(),
1121
1154
  lastAutoContinueReason
1122
1155
  ? `last_auto_continue_reason: ${lastAutoContinueReason}`
1123
1156
  : "",
@@ -1139,10 +1172,10 @@ export function createAgentChatAdapter(options) {
1139
1172
  lastPreparingToolName
1140
1173
  ? `last_preparing_tool: ${lastPreparingToolName}`
1141
1174
  : "",
1142
- `total_transient_continuations: ${totalTransientContinuationAttempts}`,
1143
- attemptedRunIds.length > 0
1144
- ? `attempted_runs: ${attemptedRunIds.join(", ")}`
1175
+ formatActivityTrail(lastActivityTrail)
1176
+ ? `activity_trail: ${formatActivityTrail(lastActivityTrail)}`
1145
1177
  : "",
1178
+ `total_transient_continuations: ${totalTransientContinuationAttempts}`,
1146
1179
  ]
1147
1180
  .filter(Boolean)
1148
1181
  .join("\n");
@@ -1217,6 +1250,7 @@ export function createAgentChatAdapter(options) {
1217
1250
  lastSeq,
1218
1251
  contentParts: content.length,
1219
1252
  attemptedRunIds: [...attemptedRunIds],
1253
+ activityTrail: [...lastActivityTrail],
1220
1254
  startupRecoveryAttempts,
1221
1255
  staleRunContinuationAttempts,
1222
1256
  stalledTransientContinuationAttempts,
@@ -1465,6 +1499,7 @@ export function createAgentChatAdapter(options) {
1465
1499
  };
1466
1500
  const prepareAutoContinuation = (signal) => {
1467
1501
  lastAutoContinueReason = signal.reason;
1502
+ lastActivityTrail = [...signal.activityTrail];
1468
1503
  if (signal.errorInfo) {
1469
1504
  lastRecoverableRunError = signal.errorInfo;
1470
1505
  }