@agent-native/core 0.122.0 → 0.122.2

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 (187) hide show
  1. package/README.md +5 -25
  2. package/corpus/README.md +1 -1
  3. package/corpus/core/CHANGELOG.md +15 -0
  4. package/corpus/core/package.json +1 -1
  5. package/corpus/core/src/a2a/client.ts +57 -4
  6. package/corpus/core/src/agent/production-agent.ts +65 -1
  7. package/corpus/core/src/agent/run-store.ts +61 -1
  8. package/corpus/core/src/client/settings/SettingsPanel.tsx +9 -9
  9. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +12 -2
  10. package/corpus/core/src/extensions/url-safety.ts +67 -4
  11. package/corpus/core/src/server/builder-design-systems.ts +1 -1
  12. package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  13. package/corpus/core/src/templates/default/app/root.tsx +1 -1
  14. package/corpus/core/src/templates/default/public/manifest.json +2 -2
  15. package/corpus/core/src/vite/client.ts +64 -3
  16. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +15 -0
  17. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -23
  18. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/report-panel-window.ts +3 -3
  19. package/corpus/templates/analytics/app/routes/_index.tsx +1 -1
  20. package/corpus/templates/analytics/changelog/2026-07-25-analytics-dashboards-and-scheduled-reports-are-faster-and-mo.md +6 -0
  21. package/corpus/templates/analytics/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  22. package/corpus/templates/analytics/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  23. package/corpus/templates/analytics/package.json +1 -1
  24. package/corpus/templates/analytics/public/manifest.json +1 -1
  25. package/corpus/templates/analytics/server/db/schema.ts +12 -0
  26. package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +8 -4
  27. package/corpus/templates/analytics/server/lib/dashboard-report.ts +136 -5
  28. package/corpus/templates/analytics/server/lib/dashboard-time-scope.ts +250 -1
  29. package/corpus/templates/analytics/server/lib/first-party-analytics-cache.ts +167 -0
  30. package/corpus/templates/analytics/server/lib/first-party-analytics.ts +34 -9
  31. package/corpus/templates/analytics/server/lib/first-party-dashboard-repair.ts +105 -23
  32. package/corpus/templates/analytics/server/lib/first-party-unbounded-panel-repair.ts +169 -0
  33. package/corpus/templates/analytics/server/plugins/auth.ts +1 -1
  34. package/corpus/templates/analytics/server/plugins/db.ts +41 -1
  35. package/corpus/templates/analytics/shared/dashboard-report-timeouts.ts +6 -3
  36. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +0 -2
  37. package/corpus/templates/assets/app/routes/_index.tsx +1 -1
  38. package/corpus/templates/assets/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  39. package/corpus/templates/assets/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  40. package/corpus/templates/assets/server/plugins/auth.ts +1 -1
  41. package/corpus/templates/brain/app/lib/brain.ts +0 -7
  42. package/corpus/templates/brain/app/routes/_index.tsx +1 -2
  43. package/corpus/templates/brain/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  44. package/corpus/templates/brain/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  45. package/corpus/templates/brain/package.json +1 -1
  46. package/corpus/templates/brain/public/manifest.json +1 -1
  47. package/corpus/templates/brain/server/plugins/auth.ts +1 -1
  48. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +0 -6
  49. package/corpus/templates/calendar/app/routes/_app._index.tsx +1 -1
  50. package/corpus/templates/calendar/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  51. package/corpus/templates/calendar/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  52. package/corpus/templates/calendar/package.json +1 -1
  53. package/corpus/templates/calendar/public/manifest.json +1 -1
  54. package/corpus/templates/calendar/server/plugins/auth.ts +1 -1
  55. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  56. package/corpus/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  57. package/corpus/templates/clips/actions/import-loom-recording.ts +53 -98
  58. package/corpus/templates/clips/actions/lib/loom-import-job.ts +260 -0
  59. package/corpus/templates/clips/app/components/library/library-layout.tsx +0 -7
  60. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  61. package/corpus/templates/clips/app/routes/_index.tsx +1 -1
  62. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +6 -0
  63. package/corpus/templates/clips/app/routes/record.tsx +5 -0
  64. package/corpus/templates/clips/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  65. package/corpus/templates/clips/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  66. package/corpus/templates/clips/server/db/schema.ts +2 -0
  67. package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -1
  68. package/corpus/templates/clips/server/plugins/auth.ts +1 -1
  69. package/corpus/templates/clips/server/plugins/db.ts +8 -0
  70. package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +56 -3
  71. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -39
  72. package/corpus/templates/content/app/routes/_app._index.tsx +1 -2
  73. package/corpus/templates/content/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  74. package/corpus/templates/content/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  75. package/corpus/templates/content/package.json +1 -1
  76. package/corpus/templates/content/public/manifest.json +1 -1
  77. package/corpus/templates/content/server/plugins/auth.ts +1 -1
  78. package/corpus/templates/design/actions/edit-design.ts +66 -27
  79. package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
  80. package/corpus/templates/design/app/routes/_index.tsx +1 -1
  81. package/corpus/templates/design/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  82. package/corpus/templates/design/changelog/2026-07-25-design-edits-retry-concurrent-changes.md +6 -0
  83. package/corpus/templates/design/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  84. package/corpus/templates/design/server/plugins/auth.ts +1 -1
  85. package/corpus/templates/design/server/source-workspace.ts +5 -1
  86. package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -10
  87. package/corpus/templates/dispatch/app/routes/overview.tsx +1 -1
  88. package/corpus/templates/dispatch/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  89. package/corpus/templates/dispatch/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  90. package/corpus/templates/dispatch/package.json +1 -1
  91. package/corpus/templates/dispatch/public/manifest.json +1 -1
  92. package/corpus/templates/forms/.agents/skills/form-responses/SKILL.md +6 -4
  93. package/corpus/templates/forms/actions/create-form.ts +5 -1
  94. package/corpus/templates/forms/actions/export-responses.ts +22 -11
  95. package/corpus/templates/forms/actions/update-form.ts +5 -1
  96. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +0 -35
  97. package/corpus/templates/forms/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  98. package/corpus/templates/forms/changelog/2026-07-25-fields-can-be-created-without-ids.md +6 -0
  99. package/corpus/templates/forms/changelog/2026-07-25-response-exports-use-file-storage.md +6 -0
  100. package/corpus/templates/forms/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  101. package/corpus/templates/forms/package.json +1 -1
  102. package/corpus/templates/forms/public/manifest.json +1 -1
  103. package/corpus/templates/forms/server/lib/validate-fields.ts +43 -0
  104. package/corpus/templates/forms/server/plugins/auth.ts +1 -1
  105. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -2
  106. package/corpus/templates/macros/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  107. package/corpus/templates/macros/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  108. package/corpus/templates/macros/package.json +1 -1
  109. package/corpus/templates/macros/server/plugins/auth.ts +2 -2
  110. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -39
  111. package/corpus/templates/mail/app/routes/$view.$threadId.tsx +1 -1
  112. package/corpus/templates/mail/app/routes/$view.tsx +1 -1
  113. package/corpus/templates/mail/app/routes/_index.tsx +1 -1
  114. package/corpus/templates/mail/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  115. package/corpus/templates/mail/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  116. package/corpus/templates/mail/package.json +1 -1
  117. package/corpus/templates/mail/public/manifest.json +1 -1
  118. package/corpus/templates/mail/server/plugins/auth.ts +1 -1
  119. package/corpus/templates/plan/agent-native.app-skill.json +1 -1
  120. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +4 -9
  121. package/corpus/templates/plan/app/lib/app-config.ts +1 -1
  122. package/corpus/templates/plan/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  123. package/corpus/templates/plan/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  124. package/corpus/templates/plan/package.json +1 -1
  125. package/corpus/templates/plan/public/manifest.json +1 -1
  126. package/corpus/templates/plan/server/plugins/auth.ts +1 -1
  127. package/corpus/templates/slides/actions/extract-pdf.ts +4 -4
  128. package/corpus/templates/slides/actions/import-file.ts +3 -4
  129. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -2
  130. package/corpus/templates/slides/app/routes/_index.tsx +1 -1
  131. package/corpus/templates/slides/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  132. package/corpus/templates/slides/changelog/2026-07-25-gemini-image-models-updated.md +6 -0
  133. package/corpus/templates/slides/changelog/2026-07-25-pdf-imports-tolerate-missing-canvas.md +6 -0
  134. package/corpus/templates/slides/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  135. package/corpus/templates/slides/package.json +1 -1
  136. package/corpus/templates/slides/public/manifest.json +1 -1
  137. package/corpus/templates/slides/server/handlers/image-providers/gemini.ts +5 -2
  138. package/corpus/templates/slides/server/lib/pdf-parse-setup.ts +150 -0
  139. package/corpus/templates/slides/server/plugins/auth.ts +1 -1
  140. package/dist/a2a/client.d.ts.map +1 -1
  141. package/dist/a2a/client.js +58 -4
  142. package/dist/a2a/client.js.map +1 -1
  143. package/dist/agent/production-agent.d.ts.map +1 -1
  144. package/dist/agent/production-agent.js +63 -1
  145. package/dist/agent/production-agent.js.map +1 -1
  146. package/dist/agent/run-store.d.ts.map +1 -1
  147. package/dist/agent/run-store.js +49 -0
  148. package/dist/agent/run-store.js.map +1 -1
  149. package/dist/client/settings/SettingsPanel.js +9 -9
  150. package/dist/client/settings/SettingsPanel.js.map +1 -1
  151. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  152. package/dist/client/settings/SettingsTabsPage.js +7 -4
  153. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  154. package/dist/collab/awareness.d.ts +2 -2
  155. package/dist/collab/awareness.d.ts.map +1 -1
  156. package/dist/collab/routes.d.ts +1 -1
  157. package/dist/extensions/url-safety.d.ts +9 -16
  158. package/dist/extensions/url-safety.d.ts.map +1 -1
  159. package/dist/extensions/url-safety.js +48 -4
  160. package/dist/extensions/url-safety.js.map +1 -1
  161. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  162. package/dist/notifications/routes.d.ts +3 -3
  163. package/dist/observability/routes.d.ts +3 -3
  164. package/dist/secrets/routes.d.ts +9 -9
  165. package/dist/server/builder-design-systems.js +1 -1
  166. package/dist/server/builder-design-systems.js.map +1 -1
  167. package/dist/server/transcribe-voice.d.ts +1 -1
  168. package/dist/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  169. package/dist/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  170. package/dist/templates/default/app/root.tsx +1 -1
  171. package/dist/templates/default/public/manifest.json +2 -2
  172. package/dist/vite/client.d.ts.map +1 -1
  173. package/dist/vite/client.js +64 -1
  174. package/dist/vite/client.js.map +1 -1
  175. package/package.json +3 -3
  176. package/src/a2a/client.ts +57 -4
  177. package/src/agent/production-agent.ts +65 -1
  178. package/src/agent/run-store.ts +61 -1
  179. package/src/client/settings/SettingsPanel.tsx +9 -9
  180. package/src/client/settings/SettingsTabsPage.tsx +12 -2
  181. package/src/extensions/url-safety.ts +67 -4
  182. package/src/server/builder-design-systems.ts +1 -1
  183. package/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  184. package/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  185. package/src/templates/default/app/root.tsx +1 -1
  186. package/src/templates/default/public/manifest.json +2 -2
  187. package/src/vite/client.ts +64 -3
@@ -2393,6 +2393,61 @@ function normalizeOptionalToolPlaceholders(schema, input) {
2393
2393
  delete normalized[key];
2394
2394
  return { input: normalized, changed: true };
2395
2395
  }
2396
+ /**
2397
+ * Models routinely JSON-encode a field's value into a string when the tool
2398
+ * schema wants an object/array — e.g. `config: "{\"name\":...}"` instead of
2399
+ * `config: {name:...}`, or `operations: "[...]"` instead of `operations: [...]`.
2400
+ * Seen across every app profiled in the 2026-07-25 reliability sweep
2401
+ * (brain's `update-source` config, analytics' `mutate-dashboard`/
2402
+ * `update-dashboard` operations/ops/config) and the model does NOT
2403
+ * self-correct across repeated identical retries — it burns the full
2404
+ * `MAX_IDENTICAL_TOOL_ERRORS` retry budget on the same wrong shape every
2405
+ * time. Evidence-gated exactly like `normalizeOptionalToolPlaceholders`:
2406
+ * only coerce a field whose CURRENT value fails schema validation (so a
2407
+ * legitimate string value is never touched — a field schema-valid as a
2408
+ * string is never also schema-valid as object/array) and whose parsed form
2409
+ * passes. Never touches values that are already the right shape.
2410
+ */
2411
+ function coerceStringifiedJsonToolValues(schema, input) {
2412
+ if (!schema?.properties || !input || typeof input !== "object") {
2413
+ return { input, changed: false };
2414
+ }
2415
+ if (Array.isArray(input))
2416
+ return { input, changed: false };
2417
+ let normalized = null;
2418
+ for (const [key, value] of Object.entries(input)) {
2419
+ if (typeof value !== "string" || value.trim().length === 0)
2420
+ continue;
2421
+ const propertySchema = schema.properties[key];
2422
+ if (!propertySchema || typeof propertySchema !== "object")
2423
+ continue;
2424
+ const expectedType = propertySchema.type;
2425
+ const expectsObjectOrArray = expectedType === "object" ||
2426
+ expectedType === "array" ||
2427
+ (Array.isArray(expectedType) &&
2428
+ (expectedType.includes("object") || expectedType.includes("array")));
2429
+ if (!expectsObjectOrArray)
2430
+ continue;
2431
+ if (schemaAcceptsToolValue(propertySchema, value))
2432
+ continue;
2433
+ let parsed;
2434
+ try {
2435
+ parsed = JSON.parse(value);
2436
+ }
2437
+ catch {
2438
+ continue;
2439
+ }
2440
+ if (typeof parsed !== "object" || parsed === null)
2441
+ continue;
2442
+ if (!schemaAcceptsToolValue(propertySchema, parsed))
2443
+ continue;
2444
+ normalized ??= { ...input };
2445
+ normalized[key] = parsed;
2446
+ }
2447
+ return normalized
2448
+ ? { input: normalized, changed: true }
2449
+ : { input, changed: false };
2450
+ }
2396
2451
  function getRawToolInputValidator(schema) {
2397
2452
  const cached = rawToolInputValidatorCache.get(schema);
2398
2453
  if (cached)
@@ -3169,6 +3224,13 @@ export async function runAgentLoop(opts) {
3169
3224
  if (placeholderNormalization.changed) {
3170
3225
  toolCall = { ...toolCall, input: placeholderNormalization.input };
3171
3226
  }
3227
+ const jsonStringCoercion = actionEntry
3228
+ ? coerceStringifiedJsonToolValues(actionEntry.tool.parameters, toolCall.input)
3229
+ : { input: toolCall.input, changed: false };
3230
+ if (jsonStringCoercion.changed) {
3231
+ toolCall = { ...toolCall, input: jsonStringCoercion.input };
3232
+ }
3233
+ const toolInputNormalized = placeholderNormalization.changed || jsonStringCoercion.changed;
3172
3234
  const wireToolInput = JSON.stringify(toolCall.input ?? {});
3173
3235
  const normalizedToolInput = normalizeToolCallInputForHistory(toolCall.input);
3174
3236
  const sourceSweepGuard = shouldGuardRepeatedSourceSweep({
@@ -3556,7 +3618,7 @@ export async function runAgentLoop(opts) {
3556
3618
  input: toolCall.input,
3557
3619
  });
3558
3620
  const toolCallSchemaError = toolCallErrors.get(toolCall.id);
3559
- if (toolCallSchemaError && !placeholderNormalization.changed) {
3621
+ if (toolCallSchemaError && !toolInputNormalized) {
3560
3622
  const result = finalizeToolErrorResult(toolInputSchemaErrorResult(toolCall.name, toolCallSchemaError.input, toolCallSchemaError.error));
3561
3623
  send({
3562
3624
  type: "tool_done",