@agent-native/core 0.84.12 → 0.84.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.
Files changed (83) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +11 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/agent/durable-background.ts +30 -0
  5. package/corpus/core/src/agent/production-agent.ts +34 -6
  6. package/corpus/core/src/agent/run-manager.ts +45 -2
  7. package/corpus/core/src/chat-threads/store.ts +2 -0
  8. package/corpus/core/src/cli/skills.ts +10 -6
  9. package/corpus/core/src/client/AssistantChat.tsx +40 -9
  10. package/corpus/core/src/client/agent-chat-adapter.ts +23 -2
  11. package/corpus/core/src/client/chat/run-recovery.tsx +52 -44
  12. package/corpus/core/src/client/chat/tool-call-display.tsx +7 -2
  13. package/corpus/core/src/server/agent-chat-plugin.ts +1 -0
  14. package/corpus/core/src/shared/streaming-text-smoothing.ts +10 -5
  15. package/corpus/templates/clips/app/components/library/recording-card.tsx +14 -4
  16. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +10 -12
  17. package/corpus/templates/clips/app/hooks/use-library.ts +7 -4
  18. package/corpus/templates/clips/app/lib/recording-status.ts +32 -0
  19. package/corpus/templates/clips/changelog/2026-07-01-dictation-keeps-listening-through-natural-pauses-and-gives-c.md +6 -0
  20. package/corpus/templates/clips/changelog/2026-07-01-redoing-a-paused-desktop-recording-no-longer-leaves-the-recording-controls-disabled.md +6 -0
  21. package/corpus/templates/clips/changelog/2026-07-01-stalled-clip-uploads-now-update-in-the-library-and-surface-as-failed.md +6 -0
  22. package/corpus/templates/clips/desktop/src/lib/recorder.ts +36 -18
  23. package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +99 -27
  24. package/corpus/templates/clips/desktop/src/overlays/flow-bar.tsx +4 -43
  25. package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +3 -0
  26. package/corpus/templates/clips/desktop/src/styles.css +5 -48
  27. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +4 -5
  28. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +15 -6
  29. package/corpus/templates/design/AGENTS.md +8 -4
  30. package/corpus/templates/design/actions/create-design.ts +1 -0
  31. package/corpus/templates/design/actions/duplicate-design.ts +3 -1
  32. package/corpus/templates/design/actions/edit-design.ts +43 -13
  33. package/corpus/templates/design/actions/generate-design.ts +5 -1
  34. package/corpus/templates/design/actions/present-design-variants.ts +17 -12
  35. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  36. package/corpus/templates/design/app/pages/DesignEditor.tsx +2 -2
  37. package/corpus/templates/design/changelog/2026-07-01-org-members-can-see-design-projects-created-in-their-workspace.md +6 -0
  38. package/corpus/templates/design/server/plugins/db.ts +9 -0
  39. package/dist/agent/durable-background.d.ts +3 -0
  40. package/dist/agent/durable-background.d.ts.map +1 -1
  41. package/dist/agent/durable-background.js +19 -0
  42. package/dist/agent/durable-background.js.map +1 -1
  43. package/dist/agent/production-agent.d.ts +1 -0
  44. package/dist/agent/production-agent.d.ts.map +1 -1
  45. package/dist/agent/production-agent.js +29 -6
  46. package/dist/agent/production-agent.js.map +1 -1
  47. package/dist/agent/run-manager.d.ts.map +1 -1
  48. package/dist/agent/run-manager.js +40 -2
  49. package/dist/agent/run-manager.js.map +1 -1
  50. package/dist/chat-threads/store.d.ts +1 -0
  51. package/dist/chat-threads/store.d.ts.map +1 -1
  52. package/dist/chat-threads/store.js +2 -0
  53. package/dist/chat-threads/store.js.map +1 -1
  54. package/dist/cli/skills.d.ts.map +1 -1
  55. package/dist/cli/skills.js +10 -6
  56. package/dist/cli/skills.js.map +1 -1
  57. package/dist/client/AssistantChat.d.ts +10 -0
  58. package/dist/client/AssistantChat.d.ts.map +1 -1
  59. package/dist/client/AssistantChat.js +26 -8
  60. package/dist/client/AssistantChat.js.map +1 -1
  61. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  62. package/dist/client/agent-chat-adapter.js +21 -2
  63. package/dist/client/agent-chat-adapter.js.map +1 -1
  64. package/dist/client/chat/run-recovery.d.ts.map +1 -1
  65. package/dist/client/chat/run-recovery.js +15 -10
  66. package/dist/client/chat/run-recovery.js.map +1 -1
  67. package/dist/client/chat/tool-call-display.d.ts +1 -0
  68. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  69. package/dist/client/chat/tool-call-display.js +3 -2
  70. package/dist/client/chat/tool-call-display.js.map +1 -1
  71. package/dist/collab/routes.d.ts +2 -2
  72. package/dist/notifications/routes.d.ts +2 -2
  73. package/dist/observability/routes.d.ts +3 -3
  74. package/dist/progress/routes.d.ts +1 -1
  75. package/dist/resources/handlers.d.ts +1 -1
  76. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  77. package/dist/server/agent-chat-plugin.js +1 -1
  78. package/dist/server/agent-chat-plugin.js.map +1 -1
  79. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  80. package/dist/shared/streaming-text-smoothing.d.ts.map +1 -1
  81. package/dist/shared/streaming-text-smoothing.js +8 -5
  82. package/dist/shared/streaming-text-smoothing.js.map +1 -1
  83. 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,MA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AAM,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,CA2+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,6 +1125,7 @@ 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;
@@ -1139,6 +1153,9 @@ export function createAgentChatAdapter(options) {
1139
1153
  lastPreparingToolName
1140
1154
  ? `last_preparing_tool: ${lastPreparingToolName}`
1141
1155
  : "",
1156
+ formatActivityTrail(lastActivityTrail)
1157
+ ? `activity_trail: ${formatActivityTrail(lastActivityTrail)}`
1158
+ : "",
1142
1159
  `total_transient_continuations: ${totalTransientContinuationAttempts}`,
1143
1160
  attemptedRunIds.length > 0
1144
1161
  ? `attempted_runs: ${attemptedRunIds.join(", ")}`
@@ -1217,6 +1234,7 @@ export function createAgentChatAdapter(options) {
1217
1234
  lastSeq,
1218
1235
  contentParts: content.length,
1219
1236
  attemptedRunIds: [...attemptedRunIds],
1237
+ activityTrail: [...lastActivityTrail],
1220
1238
  startupRecoveryAttempts,
1221
1239
  staleRunContinuationAttempts,
1222
1240
  stalledTransientContinuationAttempts,
@@ -1465,6 +1483,7 @@ export function createAgentChatAdapter(options) {
1465
1483
  };
1466
1484
  const prepareAutoContinuation = (signal) => {
1467
1485
  lastAutoContinueReason = signal.reason;
1486
+ lastActivityTrail = [...signal.activityTrail];
1468
1487
  if (signal.errorInfo) {
1469
1488
  lastRecoverableRunError = signal.errorInfo;
1470
1489
  }