@agent-native/core 0.165.4 → 0.167.1

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 (224) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/secrets/SKILL.md +5 -1
  3. package/corpus/templates/analytics/.agents/skills/workspace-conventions/SKILL.md +4 -1
  4. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +93 -56
  5. package/corpus/templates/analytics/app/i18n-data.ts +23 -20
  6. package/corpus/templates/analytics/app/pages/Settings.tsx +0 -1
  7. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +0 -1
  8. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  9. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +2 -1
  10. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +0 -1
  11. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +0 -32
  12. package/corpus/templates/analytics/server/lib/session-replay.ts +1 -5
  13. package/corpus/templates/assets/.agents/skills/secrets/SKILL.md +5 -1
  14. package/corpus/templates/assets/.agents/skills/workspace-conventions/SKILL.md +4 -1
  15. package/corpus/templates/assets/actions/navigate.ts +2 -2
  16. package/corpus/templates/assets/actions/save-generated-image.ts +0 -5
  17. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +2 -262
  18. package/corpus/templates/assets/app/routes/library.tsx +1 -1
  19. package/corpus/templates/assets/app/routes/settings.tsx +0 -3
  20. package/corpus/templates/brain/.agents/skills/secrets/SKILL.md +5 -1
  21. package/corpus/templates/brain/.agents/skills/workspace-conventions/SKILL.md +4 -1
  22. package/corpus/templates/brain/actions/ask-brain.ts +0 -1
  23. package/corpus/templates/brain/actions/navigate.ts +2 -2
  24. package/corpus/templates/brain/app/routes/sources.tsx +0 -4
  25. package/corpus/templates/brain/server/lib/capture-sanitization.ts +0 -11
  26. package/corpus/templates/calendar/.agents/skills/secrets/SKILL.md +5 -1
  27. package/corpus/templates/calendar/.agents/skills/workspace-conventions/SKILL.md +4 -1
  28. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -20
  29. package/corpus/templates/calendar/app/pages/CalendarView.tsx +0 -1
  30. package/corpus/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  31. package/corpus/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  32. package/corpus/templates/chat/actions/navigate.ts +2 -2
  33. package/corpus/templates/clips/.agents/skills/secrets/SKILL.md +5 -1
  34. package/corpus/templates/clips/.agents/skills/workspace-conventions/SKILL.md +4 -1
  35. package/corpus/templates/clips/CHANGELOG.md +2 -0
  36. package/corpus/templates/clips/actions/import-loom-recording.ts +16 -4
  37. package/corpus/templates/clips/actions/navigate.ts +2 -2
  38. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +0 -1
  39. package/corpus/templates/clips/app/components/library/space-dialogs.tsx +0 -1
  40. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +0 -1
  41. package/corpus/templates/clips/app/components/player/clips-share-trigger.tsx +17 -0
  42. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +3 -3
  43. package/corpus/templates/clips/app/components/player/video-player.tsx +2 -2
  44. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +0 -1
  45. package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +0 -1
  46. package/corpus/templates/clips/app/global.css +31 -0
  47. package/corpus/templates/clips/app/hooks/use-playback-position.ts +0 -2
  48. package/corpus/templates/clips/app/lib/download-release-channel.ts +10 -0
  49. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -3
  50. package/corpus/templates/clips/app/routes/download.tsx +67 -44
  51. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -12
  52. package/corpus/templates/clips/app/routes/record.tsx +6 -6
  53. package/corpus/templates/clips/app/routes/share.$shareId.tsx +26 -29
  54. package/corpus/templates/clips/changelog/2026-08-20-clip-viewer-share-actions.md +6 -0
  55. package/corpus/templates/clips/changelog/2026-08-20-preparing-recording-countdown-overlay.md +1 -0
  56. package/corpus/templates/clips/chrome-extension/src/background.ts +0 -13
  57. package/corpus/templates/clips/chrome-extension/src/overlay.ts +0 -1
  58. package/corpus/templates/clips/chrome-extension/src/popup.ts +0 -20
  59. package/corpus/templates/clips/desktop/src/app.tsx +6 -18
  60. package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +0 -1
  61. package/corpus/templates/clips/desktop/src/lib/recorder.ts +0 -8
  62. package/corpus/templates/content/.agents/skills/secrets/SKILL.md +5 -1
  63. package/corpus/templates/content/.agents/skills/workspace-conventions/SKILL.md +4 -1
  64. package/corpus/templates/content/actions/_database-source-utils.ts +0 -3
  65. package/corpus/templates/content/actions/attach-content-database-source.ts +1 -4
  66. package/corpus/templates/content/actions/navigate.ts +2 -2
  67. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +1 -1
  68. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +0 -6
  69. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +0 -580
  70. package/corpus/templates/content/app/components/editor/database/FormView.tsx +2 -2
  71. package/corpus/templates/content/app/components/editor/database/filter-sort.ts +1 -1
  72. package/corpus/templates/content/app/components/editor/database/settings.tsx +0 -23
  73. package/corpus/templates/content/app/components/editor/database/sidebar.tsx +0 -1
  74. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +8 -304
  75. package/corpus/templates/content/app/hooks/use-documents.ts +0 -1
  76. package/corpus/templates/content/shared/api.ts +0 -1
  77. package/corpus/templates/content/shared/builder-mdx.ts +0 -1
  78. package/corpus/templates/content/shared/nfm.ts +1 -7
  79. package/corpus/templates/crm/.agents/skills/secrets/SKILL.md +5 -1
  80. package/corpus/templates/crm/.agents/skills/workspace-conventions/SKILL.md +4 -1
  81. package/corpus/templates/crm/actions/merge-crm-records.ts +0 -4
  82. package/corpus/templates/crm/app/components/crm/record/RecordLists.tsx +0 -1
  83. package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1
  84. package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1
  85. package/corpus/templates/crm/server/db/crm-store.ts +1 -1
  86. package/corpus/templates/design/.agents/skills/secrets/SKILL.md +5 -1
  87. package/corpus/templates/design/.agents/skills/workspace-conventions/SKILL.md +4 -1
  88. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +1 -14
  89. package/corpus/templates/design/AGENTS.md +2 -1
  90. package/corpus/templates/design/actions/apply-component-prop-edit.ts +1 -5
  91. package/corpus/templates/design/actions/generate-design.ts +0 -1
  92. package/corpus/templates/design/actions/generate-screens.ts +5 -2
  93. package/corpus/templates/design/actions/go-to-main-component.ts +2 -2
  94. package/corpus/templates/design/actions/list-design-systems.ts +10 -0
  95. package/corpus/templates/design/actions/navigate.ts +2 -2
  96. package/corpus/templates/design/actions/open-component-source.ts +4 -4
  97. package/corpus/templates/design/actions/present-design-variants.ts +1 -2
  98. package/corpus/templates/design/actions/run-design-audit.ts +0 -22
  99. package/corpus/templates/design/actions/show-design-questions.ts +5 -2
  100. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +19 -8
  101. package/corpus/templates/design/app/components/design/EditPanel.tsx +11 -183
  102. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +21 -4
  103. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -5
  104. package/corpus/templates/design/app/components/design/bridge/codegen.ts +1 -1
  105. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +10 -19
  106. package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
  107. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +13 -3
  108. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +38 -32
  109. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -4
  110. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +0 -4
  111. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
  112. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +2 -2
  113. package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +0 -1
  114. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +1 -1
  115. package/corpus/templates/design/app/i18n-data.ts +122 -0
  116. package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +11 -1
  117. package/corpus/templates/design/app/pages/DesignEditor.tsx +50 -254
  118. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +163 -8
  119. package/corpus/templates/design/app/pages/Index.tsx +17 -0
  120. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +44 -32
  121. package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +10 -0
  122. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +49 -3
  123. package/corpus/templates/design/app/pages/design-editor/clone-idrefs.ts +31 -0
  124. package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +28 -0
  125. package/corpus/templates/design/app/pages/design-editor/commands/add-auto-layout.ts +3 -3
  126. package/corpus/templates/design/app/pages/design-editor/commands/align-selection.ts +44 -14
  127. package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +16 -5
  128. package/corpus/templates/design/app/pages/design-editor/commands/change-selected-z-index.ts +1 -1
  129. package/corpus/templates/design/app/pages/design-editor/commands/frame-selection.ts +1 -1
  130. package/corpus/templates/design/app/pages/design-editor/commands/group-selection.ts +1 -1
  131. package/corpus/templates/design/app/pages/design-editor/commands/nudge-selection.ts +1 -1
  132. package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +142 -17
  133. package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-duplicate-change.ts +1 -0
  134. package/corpus/templates/design/app/pages/design-editor/commands/ungroup-selection.ts +1 -1
  135. package/corpus/templates/design/app/pages/design-editor/commands/visual-duplicate-change.ts +1 -0
  136. package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +25 -9
  137. package/corpus/templates/design/app/pages/design-editor/editor-state.ts +1 -0
  138. package/corpus/templates/design/app/pages/design-editor/measure-child-rects.ts +83 -0
  139. package/corpus/templates/design/app/pages/design-editor/paste-placement.ts +66 -0
  140. package/corpus/templates/design/server/routes/[...page].get.ts +0 -1
  141. package/corpus/templates/design/shared/code-layer.ts +120 -70
  142. package/corpus/templates/design/shared/design-surface-index.ts +0 -1
  143. package/corpus/templates/design/shared/pen-path.ts +0 -4
  144. package/corpus/templates/dispatch/.agents/skills/secrets/SKILL.md +5 -1
  145. package/corpus/templates/dispatch/.agents/skills/workspace-conventions/SKILL.md +4 -1
  146. package/corpus/templates/dispatch/app/routes/integrations.tsx +0 -109
  147. package/corpus/templates/factory/.agents/skills/secrets/SKILL.md +5 -1
  148. package/corpus/templates/factory/.agents/skills/workspace-conventions/SKILL.md +4 -1
  149. package/corpus/templates/factory/actions/navigate.ts +2 -2
  150. package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +0 -13
  151. package/corpus/templates/factory/app/routes/factory.tsx +0 -1
  152. package/corpus/templates/factory/server/factory-graph/store.ts +0 -1
  153. package/corpus/templates/forms/.agents/skills/secrets/SKILL.md +5 -1
  154. package/corpus/templates/forms/.agents/skills/workspace-conventions/SKILL.md +4 -1
  155. package/corpus/templates/macros/.agents/skills/secrets/SKILL.md +5 -1
  156. package/corpus/templates/macros/.agents/skills/workspace-conventions/SKILL.md +4 -1
  157. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -1
  158. package/corpus/templates/mail/.agents/skills/secrets/SKILL.md +5 -1
  159. package/corpus/templates/mail/.agents/skills/workspace-conventions/SKILL.md +4 -1
  160. package/corpus/templates/mail/app/components/email/EmailList.tsx +0 -1
  161. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
  162. package/corpus/templates/mail/shared/markdown.ts +3 -0
  163. package/corpus/templates/plan/.agents/skills/secrets/SKILL.md +5 -1
  164. package/corpus/templates/plan/.agents/skills/workspace-conventions/SKILL.md +4 -1
  165. package/corpus/templates/slides/.agents/skills/secrets/SKILL.md +5 -1
  166. package/corpus/templates/slides/.agents/skills/workspace-conventions/SKILL.md +4 -1
  167. package/corpus/templates/slides/actions/add-slide.ts +0 -1
  168. package/corpus/templates/slides/actions/list-decks.ts +1 -1
  169. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -4
  170. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +0 -1
  171. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -1
  172. package/corpus/templates/slides/app/pages/DeckEditor.tsx +1 -6
  173. package/corpus/templates/tasks/.agents/skills/secrets/SKILL.md +5 -1
  174. package/corpus/templates/tasks/.agents/skills/workspace-conventions/SKILL.md +4 -1
  175. package/corpus/templates/tasks/app/components/layout/Layout.tsx +0 -1
  176. package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +1 -4
  177. package/corpus/templates/tasks/server/custom-fields/store.ts +1 -6
  178. package/corpus/templates/tasks/shared/list-screen-snapshot.ts +2 -2
  179. package/dist/agent/engine/registry.js +27 -14
  180. package/dist/agent/index.d.ts +1 -1
  181. package/dist/agent/production-agent.d.ts +19 -6
  182. package/dist/agent/production-agent.js +57 -16
  183. package/dist/agent/types.d.ts +3 -0
  184. package/dist/changelog/parse.js +219 -8
  185. package/dist/client/EnvironmentBadge.d.ts +1 -0
  186. package/dist/client/EnvironmentBadge.js +7 -0
  187. package/dist/collab/routes.d.ts +1 -1
  188. package/dist/collab/struct-routes.d.ts +1 -1
  189. package/dist/config.d.ts +11 -0
  190. package/dist/config.js +248 -0
  191. package/dist/deploy/build.js +12 -1
  192. package/dist/index.d.ts +1 -1
  193. package/dist/observability/routes.d.ts +3 -3
  194. package/dist/progress/routes.d.ts +1 -1
  195. package/dist/resources/handlers.d.ts +2 -2
  196. package/dist/secrets/routes.d.ts +9 -9
  197. package/dist/server/agent-chat/plugin-options.d.ts +3 -2
  198. package/dist/server/agent-chat-plugin.js +5 -2
  199. package/dist/server/index.d.ts +1 -1
  200. package/dist/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  201. package/dist/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  202. package/dist/templates/chat/actions/navigate.ts +2 -2
  203. package/dist/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  204. package/dist/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  205. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  206. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  207. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
  208. package/dist/vite/agent-native-config-loader.d.ts +1 -0
  209. package/dist/vite/agent-native-config-loader.js +3 -3
  210. package/dist/vite/agents-bundle-plugin.d.ts +1 -1
  211. package/dist/vite/agents-bundle-plugin.js +13 -1
  212. package/dist/vite/client.js +14 -14
  213. package/docs/content/agent-native-config.mdx +62 -11
  214. package/docs/content/agent-surfaces.mdx +6 -0
  215. package/docs/content/environment-variables.mdx +5 -2
  216. package/package.json +3 -3
  217. package/src/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  218. package/src/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  219. package/src/templates/chat/actions/navigate.ts +2 -2
  220. package/src/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  221. package/src/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  222. package/src/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  223. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  224. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
@@ -51,8 +51,8 @@ export declare function handleDeleteResource(event: any): Promise<{
51
51
  error: string;
52
52
  ok?: undefined;
53
53
  } | {
54
- ok: boolean;
55
54
  error?: undefined;
55
+ ok: boolean;
56
56
  }>;
57
57
  /** POST /_agent-native/resources/upload — upload a file as a resource */
58
58
  export declare function handleUploadResource(event: any): Promise<import("./store.js").Resource | {
@@ -73,10 +73,10 @@ export declare function handleUploadResource(event: any): Promise<import("./stor
73
73
  runId: string | null;
74
74
  expiresAt: number | null;
75
75
  metadata: string | null;
76
+ error?: undefined;
76
77
  url: string;
77
78
  provider: string;
78
79
  storageSetupRequired?: undefined;
79
- error?: undefined;
80
80
  } | {
81
81
  error: string;
82
82
  storageSetupRequired: boolean;
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
34
34
  /** POST /_agent-native/secrets/:key — write a secret. */
35
35
  export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
36
36
  error: string;
37
- ok?: undefined;
38
37
  status?: undefined;
38
+ ok?: undefined;
39
39
  } | {
40
- error?: undefined;
41
40
  ok: boolean;
42
41
  status: string;
42
+ error?: undefined;
43
43
  } | {
44
- ok?: undefined;
45
44
  error: string;
46
45
  removed?: undefined;
46
+ ok?: undefined;
47
47
  } | {
48
- error?: undefined;
49
48
  ok: boolean;
50
49
  removed: boolean;
50
+ error?: undefined;
51
51
  }>>;
52
52
  /**
53
53
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
54
54
  * or the current stored value without changing anything.
55
55
  */
56
56
  export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
57
- ok?: undefined;
58
57
  error: string;
59
58
  note?: undefined;
59
+ ok?: undefined;
60
60
  } | {
61
- error?: undefined;
62
61
  ok: boolean;
63
62
  note?: undefined;
64
- } | {
65
63
  error?: undefined;
64
+ } | {
66
65
  ok: boolean;
67
66
  note: string;
67
+ error?: undefined;
68
68
  } | {
69
69
  note?: undefined;
70
70
  ok: boolean;
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
95
95
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
96
96
  error: string;
97
97
  } | {
98
- error?: undefined;
99
98
  ok: boolean;
100
99
  key: string;
101
- } | {
102
100
  error?: undefined;
101
+ } | {
103
102
  ok: boolean;
104
103
  removed: boolean;
104
+ error?: undefined;
105
105
  }>>;
@@ -171,8 +171,9 @@ export interface AgentChatPluginOptions {
171
171
  }>;
172
172
  /**
173
173
  * Resolve the exact native action surface for each interactive chat request.
174
- * Omitted names are not sent to the model and are not discoverable through
175
- * tool-search. When configured, every allowed action is loaded directly.
174
+ * Omitted allowlist names are not sent to the model or discoverable through
175
+ * tool-search. Return `{ mode: "default" }` to keep the normal initial-tool
176
+ * and discovery behavior for a request instead.
176
177
  */
177
178
  resolveActionSurface?: ProductionAgentOptions["resolveActionSurface"];
178
179
  /**
@@ -13,7 +13,7 @@ import { resolveEngine, createAnthropicEngine, getStoredModelForEngine, normaliz
13
13
  import { SYSTEM_PROMPT_CACHE_SPLIT } from "../agent/engine/prompt-cache.js";
14
14
  import { PROVIDER_TO_ENV } from "../agent/engine/provider-env-vars.js";
15
15
  import { hostedHarnessSystemPrompt } from "../agent/harness/hosted.js";
16
- import { createProductionAgentHandler, actionsToEngineTools, executeAgentToolCall, filterActionsByAllowedNames, readPersistedActionSurface, toolCallCacheKey, getActiveRunForThreadAsync, abortRunDurably, abortTurnDurably, subscribeToRun, } from "../agent/production-agent.js";
16
+ import { createProductionAgentHandler, actionsToEngineTools, executeAgentToolCall, filterActionsByAllowedNames, normalizeAgentActionSurfaceResolution, readPersistedActionSurface, toolCallCacheKey, getActiveRunForThreadAsync, abortRunDurably, abortTurnDurably, subscribeToRun, } from "../agent/production-agent.js";
17
17
  import { callerHasRunAccess, callerHasThreadAccess, } from "../agent/run-ownership.js";
18
18
  import { markTurnAborted, readBackgroundRunClaim } from "../agent/run-store.js";
19
19
  import { buildCurrentTimeUserContext, buildRuntimeContextPrompt, } from "../agent/runtime-context.js";
@@ -2974,11 +2974,14 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
2974
2974
  ...details,
2975
2975
  availableActionNames: appActionNames,
2976
2976
  });
2977
+ const normalizedSurface = normalizeAgentActionSurfaceResolution(surface);
2978
+ if (normalizedSurface.mode === "default")
2979
+ return surface;
2977
2980
  const localActionNames = details.availableActionNames.filter((name) => localDevActionNames.has(name));
2978
2981
  return {
2979
2982
  allowedActionNames: [
2980
2983
  ...new Set([
2981
- ...surface.allowedActionNames,
2984
+ ...normalizedSurface.allowedActionNames,
2982
2985
  ...localActionNames,
2983
2986
  ]),
2984
2987
  ],
@@ -15,7 +15,7 @@ export { requireEnvKey, type MissingKeyResponse } from "./missing-key.js";
15
15
  export { assertCurrentRequestUserIsOrgAdmin, currentRequestUserIsOrgAdmin, } from "./org-admin.js";
16
16
  export { verifyCaptcha, type CaptchaVerifyResult } from "./captcha.js";
17
17
  export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, type LocaleInitScriptOptions, type ResolveLocaleFromRequestOptions, type ResolvedRequestLocale, } from "../localization/server.js";
18
- export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
18
+ export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type DefaultAgentActionSurface, type AgentActionSurfaceResolution, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
19
19
  export { actionsToEngineTools, executeAgentToolCall, getOwnerActiveApiKey, getOwnerApiKeyForEngine, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
20
20
  export { mountRealtimeVoiceRoutes, realtimeVoiceSafetyIdentifier, REALTIME_VOICE_MAX_SDP_BYTES, REALTIME_VOICE_MAX_TOOL_BODY_BYTES, REALTIME_VOICE_MAX_TOOL_OUTPUT_CHARS, REALTIME_VOICE_SESSION_PATH, REALTIME_VOICE_TOOL_PATH, type MountRealtimeVoiceRoutesOptions, type RealtimeVoiceRequestContext, type RealtimeVoiceToolExecutionRequest, type RealtimeVoiceToolExecutionResult, } from "./realtime-voice.js";
21
21
  export { getStoredModelForEngine, resolveEngine, } from "../agent/engine/index.js";
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import { defineAction } from "@agent-native/core/action";
17
- import { writeAppState } from "@agent-native/core/application-state";
17
+ import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
18
18
  import { z } from "zod";
19
19
 
20
20
  export default defineAction({
@@ -35,7 +35,7 @@ export default defineAction({
35
35
  if (args.path) nav.path = args.path;
36
36
  if (args.threadId) nav.threadId = args.threadId;
37
37
  nav._writeId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
38
- await writeAppState("navigate", nav);
38
+ await writeAppStateForCurrentTab("navigate", nav);
39
39
  return `Navigating to ${args.view || args.path}`;
40
40
  },
41
41
  });
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -11,6 +11,7 @@ export declare function loadAgentNativeConfigFile(cwd: string): Promise<AgentNat
11
11
  */
12
12
  export declare function loadWorkspaceAgentNativeConfigFile(cwd: string): Promise<AgentNativeConfigInput | undefined>;
13
13
  export declare function loadResolvedAgentNativeConfig(cwd: string, context: AgentNativeConfigContext, options?: {
14
+ environment?: Record<string, string | undefined>;
14
15
  loadProjectConfig?: boolean;
15
16
  projectConfig?: AgentNativeConfigInput;
16
17
  }): Promise<AgentNativeConfig>;
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
- import { mergeAgentNativeConfigs, normalizeAgentNativeConfig, resolveAgentNativeConfig, } from "../config.js";
4
+ import { mergeAgentNativeConfigs, normalizeAgentNativeConfig, readAgentNativeConfigEnv, resolveAgentNativeConfig, } from "../config.js";
5
5
  /** The canonical filename comes first; the remaining names stay compatible. */
6
6
  export const AGENT_NATIVE_CONFIG_FILE_CANDIDATES = [
7
7
  "agent-native.config.ts",
@@ -79,9 +79,9 @@ export async function loadResolvedAgentNativeConfig(cwd, context, options = {})
79
79
  (options.loadProjectConfig === false
80
80
  ? undefined
81
81
  : await loadAgentNativeConfigFile(cwd));
82
- return resolveAgentNativeConfig(mergeAgentNativeConfigs(mergeAgentNativeConfigs(workspaceConfig
82
+ return resolveAgentNativeConfig(mergeAgentNativeConfigs(mergeAgentNativeConfigs(mergeAgentNativeConfigs(workspaceConfig
83
83
  ? resolveAgentNativeConfig(workspaceConfig, context)
84
- : {}, readAgentNativeJsonConfig(cwd)), projectConfig ? resolveAgentNativeConfig(projectConfig, context) : {}), context);
84
+ : {}, readAgentNativeJsonConfig(cwd)), readAgentNativeConfigEnv(options.environment ?? process.env)), projectConfig ? resolveAgentNativeConfig(projectConfig, context) : {}), context);
85
85
  }
86
86
  function findConfigPath(cwd) {
87
87
  return AGENT_NATIVE_CONFIG_FILE_CANDIDATES.map((filename) => path.join(cwd, filename)).find((candidate) => fs.existsSync(candidate));
@@ -1,4 +1,4 @@
1
- import type { Plugin } from "vite";
1
+ import { type Plugin } from "vite";
2
2
  import type { AgentNativeConfigInput } from "../config.js";
3
3
  export interface AgentsBundlePluginOptions {
4
4
  agentNativeConfig?: AgentNativeConfigInput;
@@ -14,7 +14,9 @@ import fs from "fs";
14
14
  * without restarting the server.
15
15
  */
16
16
  import path from "path";
17
+ import { loadEnv } from "vite";
17
18
  import { getWorkspaceCoreExports } from "../deploy/workspace-core.js";
19
+ import { findWorkspaceRoot } from "../scripts/utils.js";
18
20
  import { readAgentsBundleFromFs, resolveAgentInstructionPaths, } from "../server/agents-bundle.js";
19
21
  import { createAgentNativeConfigContext, loadResolvedAgentNativeConfig, } from "./agent-native-config-loader.js";
20
22
  const VIRTUAL_ID = "virtual:agents-bundle";
@@ -72,7 +74,17 @@ export function agentsBundlePlugin(options = {}) {
72
74
  name: "agent-native-agents-bundle",
73
75
  async configResolved(config) {
74
76
  projectRoot = config.root;
75
- agentConfigPromise = loadResolvedAgentNativeConfig(projectRoot, createAgentNativeConfigContext(config.command, config.mode), {
77
+ const mode = config.mode ?? "development";
78
+ const workspaceRoot = findWorkspaceRoot(projectRoot);
79
+ const environment = {
80
+ ...(workspaceRoot && workspaceRoot !== projectRoot
81
+ ? loadEnv(mode, workspaceRoot, "")
82
+ : {}),
83
+ ...loadEnv(mode, projectRoot, ""),
84
+ ...process.env,
85
+ };
86
+ agentConfigPromise = loadResolvedAgentNativeConfig(projectRoot, createAgentNativeConfigContext(config.command, mode), {
87
+ environment,
76
88
  loadProjectConfig: options.agentNativeConfig === undefined,
77
89
  projectConfig: options.agentNativeConfig,
78
90
  });
@@ -7,7 +7,7 @@ import { renderDesignSystemThemeCss, } from "@agent-native/toolkit/design-system
7
7
  import { loadEnv, } from "vite";
8
8
  import { mergePendingChangelog, parsePendingEntry, } from "../changelog/parse.js";
9
9
  import { getViteDevRecoveryScript } from "../client/vite-dev-recovery-script.js";
10
- import { inferAgentNativeDeploymentEnvironment, mergeAgentNativeConfigs, resolveAgentNativeConfig, } from "../config.js";
10
+ import { inferAgentNativeDeploymentEnvironment, mergeAgentNativeConfigs, readAgentNativeConfigEnv, resolveAgentNativeConfig, } from "../config.js";
11
11
  import { writeAgentNativeNitroPresetMarker } from "../deploy/nitro-preset.js";
12
12
  import { findWorkspaceRoot } from "../scripts/utils.js";
13
13
  import { verifyEmbedSessionToken } from "../server/embed-session.js";
@@ -2805,7 +2805,19 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
2805
2805
  const cwd = process.cwd();
2806
2806
  const configContext = createAgentNativeConfigContext(command, mode);
2807
2807
  const projectConfigInput = projectConfig ?? options.agentNativeConfig;
2808
- const appConfig = resolveAgentNativeConfig(mergeAgentNativeConfigs(readAgentNativeJsonConfig(cwd), projectConfigInput
2808
+ // Workspace env fallback. If this app is inside a workspace, tell Vite to
2809
+ // also look for .env files at the workspace root. Per-app .env still wins
2810
+ // (Vite's loadEnv merges in precedence order — app dir is loaded after).
2811
+ const workspaceRoot = findWorkspaceRoot(cwd);
2812
+ const envDir = workspaceRoot && workspaceRoot !== cwd ? workspaceRoot : cwd;
2813
+ const runtimeEnv = {
2814
+ ...(workspaceRoot && workspaceRoot !== cwd
2815
+ ? loadEnv(mode, workspaceRoot, "")
2816
+ : {}),
2817
+ ...loadEnv(mode, cwd, ""),
2818
+ ...process.env,
2819
+ };
2820
+ const appConfig = resolveAgentNativeConfig(mergeAgentNativeConfigs(mergeAgentNativeConfigs(readAgentNativeJsonConfig(cwd), readAgentNativeConfigEnv(runtimeEnv)), projectConfigInput
2809
2821
  ? resolveAgentNativeConfig(projectConfigInput, configContext)
2810
2822
  : {}), configContext);
2811
2823
  const inferredDeploymentEnvironment = appConfig.deployment?.environment ??
@@ -2823,11 +2835,6 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
2823
2835
  process.env.CF_PAGES_COMMIT_SHA?.trim() ||
2824
2836
  process.env.AGENT_NATIVE_BUILD_SHA?.trim() ||
2825
2837
  "development";
2826
- // Workspace env fallback. If this app is inside a workspace, tell Vite to
2827
- // also look for .env files at the workspace root. Per-app .env still wins
2828
- // (Vite's loadEnv merges in precedence order — app dir is loaded after).
2829
- const workspaceRoot = findWorkspaceRoot(cwd);
2830
- const envDir = workspaceRoot && workspaceRoot !== cwd ? workspaceRoot : cwd;
2831
2838
  // Preload workspace-root .env into process.env so Nitro server code sees
2832
2839
  // shared keys during dev (Nitro reads process.env, not vite's envDir).
2833
2840
  if (workspaceRoot && workspaceRoot !== cwd) {
@@ -2844,13 +2851,6 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
2844
2851
  }
2845
2852
  catch { }
2846
2853
  }
2847
- const runtimeEnv = {
2848
- ...(workspaceRoot && workspaceRoot !== cwd
2849
- ? loadEnv(mode, workspaceRoot, "")
2850
- : {}),
2851
- ...loadEnv(mode, cwd, ""),
2852
- ...process.env,
2853
- };
2854
2854
  reportRuntimeConfigDiagnostics(appConfig, configContext, mode, runtimeEnv);
2855
2855
  const { base } = getConfiguredAppBasePath();
2856
2856
  const isWorkspaceChild = isTruthyRuntimeValue(process.env.AGENT_NATIVE_WORKSPACE) ||
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "Agent-Native app configuration"
3
- description: "Configure public Agent-Native app defaults with agent-native.config.ts, its typed aliases, or agent-native.json compatibility."
4
- search: "agent-native.config.ts agent-native.ts agent-native.mts agent-native.config.mts agent-native.json onboarding runtime readiness configuration instructions"
3
+ description: "Configure public Agent-Native app defaults with agent-native.config.ts, deterministic environment aliases, or agent-native.json compatibility."
4
+ search: "agent-native.config.ts agent-native.ts agent-native.mts agent-native.config.mts agent-native.json AGENT_NATIVE_CONFIG onboarding runtime readiness configuration instructions"
5
5
  ---
6
6
 
7
7
  # Agent-Native app configuration
@@ -17,10 +17,12 @@ value in these files as public. Put credentials and deployment-specific values
17
17
  in the environment or the scoped secret store instead.
18
18
 
19
19
  This file is the home for public, app-owned configuration - the values that
20
- describe how an app should behave or what capabilities it exposes. It is not a
21
- second environment-variable file. Environment variables still own secrets,
22
- provider credentials, database URLs, host-specific values, and other values
23
- that must change between deployments.
20
+ describe how an app should behave or what capabilities it exposes. Prefer it
21
+ for new non-secret app settings. When the same public setting needs a
22
+ deployment-specific value, the framework also accepts a deterministic
23
+ `AGENT_NATIVE_CONFIG*` environment alias. Environment variables still own
24
+ secrets, provider credentials, database URLs, host-specific values, and other
25
+ server-only values that are not part of this public config.
24
26
 
25
27
  ## File location and loading
26
28
 
@@ -101,6 +103,48 @@ configuration portion of `agent-native.json`:
101
103
  | `changelog.enabled` | `boolean` | Enables the app changelog workflow and lets agents create user-facing entries. |
102
104
  | `harness` | `boolean` or `{ runtimes: string[] }` | Enables the hosted tools-only harness, optionally narrowed to `claude-code`, `codex`, `pi`, or `opencode`. See [Harness Agents](/docs/harness-agents). |
103
105
 
106
+ ## Deterministic environment aliases
107
+
108
+ Every supported public config path has an environment alias under the
109
+ `AGENT_NATIVE_CONFIG` namespace. Convert each lower-camel-case path segment to
110
+ upper snake case and join segments with underscores:
111
+
112
+ | Config path | Environment alias |
113
+ | ---------------------- | ------------------------------------------ |
114
+ | the whole config | `AGENT_NATIVE_CONFIG` |
115
+ | `runtime` | `AGENT_NATIVE_CONFIG_RUNTIME` |
116
+ | `runtime.auth` | `AGENT_NATIVE_CONFIG_RUNTIME_AUTH` |
117
+ | `runtime.auth.enabled` | `AGENT_NATIVE_CONFIG_RUNTIME_AUTH_ENABLED` |
118
+ | `translations.locales` | `AGENT_NATIVE_CONFIG_TRANSLATIONS_LOCALES` |
119
+
120
+ The whole config, an object section, or a deeply nested object can be supplied
121
+ as one JSON string. Arrays also use JSON strings. More-specific aliases are
122
+ applied after broader aliases, so a leaf or nested fragment can refine a
123
+ whole-config value. Objects merge recursively. Arrays and scalar values are
124
+ replaced by the more-specific alias.
125
+
126
+ ```bash
127
+ AGENT_NATIVE_CONFIG='{"runtime":{"auth":{"enabled":true}}}'
128
+ AGENT_NATIVE_CONFIG_RUNTIME='{"database":{"required":false}}'
129
+ AGENT_NATIVE_CONFIG_RUNTIME_AUTH_ENABLED=false
130
+ AGENT_NATIVE_CONFIG_TRANSLATIONS_LOCALES='["en-US","es-ES"]'
131
+ ```
132
+
133
+ Boolean leaves accept `true`, `false`, `1`, `0`, `yes`, `no`, `on`, and `off`.
134
+ Number leaves accept finite decimal values. String leaves accept normal
135
+ environment strings or JSON-quoted strings. Object and array values must be
136
+ valid JSON of the matching shape. An invalid JSON value or an unknown
137
+ `AGENT_NATIVE_CONFIG*` path fails configuration loading with the offending
138
+ variable name. Unknown keys inside fixed-shape JSON fragments fail as well;
139
+ the per-mode `onboarding.firstRun` map is the intentional dynamic-key
140
+ exception.
141
+
142
+ These aliases are for public configuration only. Their resolved values are
143
+ serialized into the browser bundle, just like values from
144
+ `agent-native.config.ts`. Do not put API keys, tokens, passwords, database
145
+ URLs, or other secrets in them. Keep those in deployment configuration or the
146
+ scoped secret and connection stores.
147
+
104
148
  ## Configuration vs environment variables
105
149
 
106
150
  Use the config file or JSON manifest for stable, non-secret application
@@ -243,16 +287,21 @@ For a Vite app, the effective shared configuration follows this order:
243
287
  1. Framework defaults. First-run onboarding defaults to `off`; auth and a
244
288
  persistent database default to required in production diagnostics.
245
289
  2. `agent-native.json` at the app root.
246
- 3. The automatically loaded typed file, if present. The loader checks these
290
+ 3. `AGENT_NATIVE_CONFIG` and its path aliases from the deployment environment.
291
+ The legacy `AGENT_NATIVE_DEPLOYMENT_ENVIRONMENT` variable remains a
292
+ fallback for deployment inference only; it does not override explicit JSON,
293
+ typed, or canonical config-alias values.
294
+ 4. The automatically loaded typed file, if present. The loader checks these
247
295
  candidates in order: `agent-native.config.ts`, `agent-native.ts`,
248
296
  `agent-native.mts`, `agent-native.config.mts`.
249
- 4. An explicit `agentNativeConfig` passed to `agentNative()` or the legacy
297
+ 5. An explicit `agentNativeConfig` passed to `agentNative()` or the legacy
250
298
  `defineConfig()` wrapper. Supplying this option skips automatic typed-file
251
299
  loading, while the explicit value still overlays `agent-native.json`.
252
- 5. For onboarding only, the legacy public Vite variables
300
+ 6. For onboarding only, the legacy public Vite variables
253
301
  `VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING` and
254
302
  `VITE_AGENT_NATIVE_FIRST_RUN_ONBOARDING_SKIP_INTEGRATIONS` can override the
255
- resolved onboarding mode. Use the config file for new work.
303
+ resolved onboarding mode. Use the config file or its canonical path alias
304
+ for new work.
256
305
 
257
306
  Use only one of the four typed filenames. If more than one exists, the first
258
307
  candidate in the loader's order wins, with `agent-native.config.ts` preferred
@@ -325,7 +374,9 @@ default that never depends on the Vite command or mode:
325
374
  ```
326
375
 
327
376
  For new app-owned configuration, prefer `agent-native.config.ts` when the app needs
328
- types, a mode-aware factory, or a clear place to evolve public defaults. Keep
377
+ types, a mode-aware factory, or a clear place to evolve public defaults. Use a
378
+ canonical `AGENT_NATIVE_CONFIG_<PATH>` alias only when a non-secret public value
379
+ needs to vary by deployment. Keep
329
380
  `agent-native.json` when portability or existing manifest sections are the
330
381
  reason to use it. Both formats accept the same shared options shown above.
331
382
 
@@ -188,6 +188,12 @@ createAgentChatPlugin({
188
188
  });
189
189
  ```
190
190
 
191
+ When the same resolver also handles unrestricted chat, return
192
+ `{ mode: "default" }`. This preserves the normal `initialToolNames` filtering
193
+ and `tool-search` discovery instead of loading every available schema on the
194
+ first model request. The explicit mode is preserved across durable
195
+ continuations.
196
+
191
197
  An empty list exposes no native actions. Unknown names fail the request instead
192
198
  of widening access. Every allowed action is loaded directly on the first model
193
199
  request; include `tool-search` explicitly only when discovery inside the
@@ -19,8 +19,11 @@ use environment variables for deploy-level configuration.
19
19
 
20
20
  For committed, non-secret app defaults such as first-run onboarding, use the
21
21
  [Agent-Native app configuration guide](/docs/agent-native-config) instead of
22
- adding another browser-exposed environment setting. Keep credentials and
23
- deployment-specific values in the environment or scoped secret store.
22
+ adding another standalone environment setting. If a public config value must
23
+ vary by deployment, use its deterministic `AGENT_NATIVE_CONFIG_<PATH>` alias,
24
+ which also becomes part of the public browser bundle. Keep credentials and
25
+ user-, organization-, or workspace-scoped values in the appropriate secret or
26
+ connection store.
24
27
 
25
28
  ## Common application and deployment variables
26
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.165.4",
3
+ "version": "0.167.1",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -427,8 +427,8 @@
427
427
  "y-protocols": "^1.0.7",
428
428
  "yjs": "^13.6.32",
429
429
  "zod": "^4.3.6",
430
- "@agent-native/recap-cli": "0.5.5",
431
- "@agent-native/toolkit": "^0.16.8"
430
+ "@agent-native/recap-cli": "0.5.6",
431
+ "@agent-native/toolkit": "^0.16.9"
432
432
  },
433
433
  "devDependencies": {
434
434
  "@ai-sdk/anthropic": "^3.0.71",
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -14,7 +14,7 @@
14
14
  */
15
15
 
16
16
  import { defineAction } from "@agent-native/core/action";
17
- import { writeAppState } from "@agent-native/core/application-state";
17
+ import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
18
18
  import { z } from "zod";
19
19
 
20
20
  export default defineAction({
@@ -35,7 +35,7 @@ export default defineAction({
35
35
  if (args.path) nav.path = args.path;
36
36
  if (args.threadId) nav.threadId = args.threadId;
37
37
  nav._writeId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
38
- await writeAppState("navigate", nav);
38
+ await writeAppStateForCurrentTab("navigate", nav);
39
39
  return `Navigating to ${args.view || args.path}`;
40
40
  },
41
41
  });
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48
 
@@ -55,7 +55,10 @@ Preview before `--apply`, commit `agent-native.ejections.json`, and never edit
55
55
  ZIPs, screenshots, thumbnails, session replay chunks) in configured file/blob
56
56
  storage and persist only URLs, ids, or handles.
57
57
  - Store shared runtime configuration in the workspace root `.env`; use
58
- `apps/<app>/.env` only for app-specific overrides. Never hardcode API keys,
58
+ `apps/<app>/.env` only for app-specific overrides. For public app behavior,
59
+ prefer the default in `agent-native.config.ts` and use the deterministic
60
+ `AGENT_NATIVE_CONFIG_<UPPER_SNAKE_PATH>` alias only when a non-secret value
61
+ needs a deployment override. Never hardcode API keys,
59
62
  tokens, webhook URLs, signing secrets, private Builder/internal data, customer
60
63
  data, or credential-looking literals in source, docs, prompts, fixtures,
61
64
  application state, action responses, or generated app content. Use
@@ -38,7 +38,11 @@ connection exists:
38
38
  register a `kind: "oauth"` entry so the shared UI renders Connect and the
39
39
  runtime owns status, refresh, and reauthorization.
40
40
  - **Deploy- or app-level configuration** - use deployment/runtime
41
- configuration, not a per-user secret row.
41
+ configuration, not a per-user secret row. For a non-secret public setting
42
+ already represented by `AgentNativeConfig`, put the default in
43
+ `agent-native.config.ts` and use its `AGENT_NATIVE_CONFIG_<PATH>` alias only
44
+ for a deployment override. Never put a credential or provider key in that
45
+ public namespace.
42
46
  - **Account, customer, manager, or other non-secret identifier** - store it as
43
47
  scoped connection metadata or app data, not as a masked secret field.
44
48