@agent-native/core 0.90.3 → 0.90.5

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 (256) hide show
  1. package/bin/agent-native.js +25 -3
  2. package/corpus/README.md +1 -1
  3. package/corpus/core/CHANGELOG.md +17 -0
  4. package/corpus/core/bin/agent-native.js +25 -3
  5. package/corpus/core/package.json +1 -1
  6. package/corpus/core/src/agent/durable-background.ts +18 -18
  7. package/corpus/core/src/agent/engine/ai-sdk-engine.ts +8 -2
  8. package/corpus/core/src/agent/engine/anthropic-engine.ts +11 -1
  9. package/corpus/core/src/agent/engine/index.ts +1 -0
  10. package/corpus/core/src/agent/engine/registry.ts +63 -2
  11. package/corpus/core/src/agent/production-agent.ts +22 -11
  12. package/corpus/core/src/agent/run-manager.ts +17 -6
  13. package/corpus/core/src/agent/run-store.ts +16 -11
  14. package/corpus/core/src/cli/create.ts +35 -0
  15. package/corpus/core/src/cli/design-connect.ts +263 -1
  16. package/corpus/core/src/cli/index.ts +84 -7
  17. package/corpus/core/src/cli/workspacify.ts +34 -0
  18. package/corpus/core/src/client/KeepTabOpenNotice.tsx +20 -15
  19. package/corpus/core/src/client/RunStuckBanner.tsx +14 -13
  20. package/corpus/core/src/client/agent-chat-adapter.ts +28 -17
  21. package/corpus/core/src/client/history/VersionHistoryPanel.tsx +77 -47
  22. package/corpus/core/src/client/history/index.ts +3 -0
  23. package/corpus/core/src/client/history/use-history.ts +28 -0
  24. package/corpus/core/src/client/index.ts +8 -0
  25. package/corpus/core/src/client/review/index.ts +5 -0
  26. package/corpus/core/src/client/review/use-review.ts +40 -2
  27. package/corpus/core/src/client/use-run-stuck-detection.ts +8 -5
  28. package/corpus/core/src/history/actions/create-resource-version.ts +11 -8
  29. package/corpus/core/src/history/index.ts +0 -1
  30. package/corpus/core/src/history/registry.ts +24 -12
  31. package/corpus/core/src/history/store.ts +84 -53
  32. package/corpus/core/src/review/actions/consume-review-feedback.ts +15 -5
  33. package/corpus/core/src/review/actions/delete-review-comment.ts +15 -3
  34. package/corpus/core/src/review/actions/resolve-review-thread.ts +12 -5
  35. package/corpus/core/src/review/index.ts +0 -5
  36. package/corpus/core/src/review/registry.ts +24 -12
  37. package/corpus/core/src/review/store.ts +10 -7
  38. package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
  39. package/corpus/core/src/server/credential-provider.ts +13 -3
  40. package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +11 -11
  41. package/corpus/templates/assets/actions/generate-image.ts +64 -28
  42. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +1 -1
  43. package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +91 -74
  44. package/corpus/templates/assets/server/lib/generation.ts +29 -4
  45. package/corpus/templates/assets/server/lib/image-processing.ts +131 -0
  46. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +24 -2
  47. package/corpus/templates/calendar/AGENTS.md +3 -0
  48. package/corpus/templates/calendar/actions/create-event.ts +8 -34
  49. package/corpus/templates/calendar/actions/event-action-helpers.ts +52 -0
  50. package/corpus/templates/calendar/actions/manage-event-draft.ts +7 -34
  51. package/corpus/templates/calendar/actions/update-event.ts +10 -23
  52. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +47 -0
  53. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +23 -0
  54. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +59 -2
  55. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +40 -1
  56. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +34 -1
  57. package/corpus/templates/calendar/app/hooks/use-events.ts +6 -0
  58. package/corpus/templates/calendar/app/i18n/zh-TW.ts +4 -0
  59. package/corpus/templates/calendar/app/i18n-data.ts +40 -0
  60. package/corpus/templates/calendar/changelog/2026-07-07-you-can-mark-event-guests-as-optional-while-inviting-them-or.md +6 -0
  61. package/corpus/templates/calendar/server/handlers/events.ts +1 -0
  62. package/corpus/templates/calendar/server/lib/google-calendar.ts +4 -0
  63. package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
  64. package/corpus/templates/calendar/shared/api.ts +2 -0
  65. package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +29 -3
  66. package/corpus/templates/clips/actions/generate-workflow.ts +19 -8
  67. package/corpus/templates/clips/actions/get-clips-ai-prefs.ts +36 -0
  68. package/corpus/templates/clips/actions/lib/clips-ai-prefs.ts +28 -0
  69. package/corpus/templates/clips/actions/regenerate-chapters.ts +21 -7
  70. package/corpus/templates/clips/actions/regenerate-summary.ts +26 -8
  71. package/corpus/templates/clips/actions/regenerate-title.ts +44 -7
  72. package/corpus/templates/clips/actions/update-clips-ai-prefs.ts +50 -0
  73. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +7 -2
  74. package/corpus/templates/clips/app/hooks/use-auto-title.ts +25 -10
  75. package/corpus/templates/clips/app/i18n/ar-SA.ts +28 -6
  76. package/corpus/templates/clips/app/i18n/de-DE.ts +28 -6
  77. package/corpus/templates/clips/app/i18n/en-US.ts +29 -6
  78. package/corpus/templates/clips/app/i18n/es-ES.ts +29 -6
  79. package/corpus/templates/clips/app/i18n/fr-FR.ts +30 -6
  80. package/corpus/templates/clips/app/i18n/hi-IN.ts +26 -6
  81. package/corpus/templates/clips/app/i18n/ja-JP.ts +27 -6
  82. package/corpus/templates/clips/app/i18n/ko-KR.ts +28 -6
  83. package/corpus/templates/clips/app/i18n/pt-BR.ts +28 -6
  84. package/corpus/templates/clips/app/i18n/zh-CN.ts +26 -6
  85. package/corpus/templates/clips/app/i18n/zh-TW.ts +25 -6
  86. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +73 -0
  87. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -0
  88. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -2
  89. package/corpus/templates/clips/changelog/2026-07-07-ai-tools-can-include-the-full-video-not-just-the-transcript-.md +6 -0
  90. package/corpus/templates/clips/changelog/2026-07-07-clips-desktop-now-surfaces-meetings-and-dictate-directly-in-.md +6 -0
  91. package/corpus/templates/clips/changelog/2026-07-07-meeting-notes-now-explain-exactly-how-to-start-granola-style.md +6 -0
  92. package/corpus/templates/clips/changelog/2026-07-07-meeting-start-alerts-now-include-separate-start-notes-and-jo.md +6 -0
  93. package/corpus/templates/clips/changelog/2026-07-07-recordings-start-more-predictably-and-newly-saved-clips-refr.md +6 -0
  94. package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
  95. package/corpus/templates/clips/desktop/src/app.tsx +435 -105
  96. package/corpus/templates/clips/desktop/src/lib/recorder.ts +27 -21
  97. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -22
  98. package/corpus/templates/clips/desktop/src/styles.css +167 -2
  99. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
  100. package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -7
  101. package/corpus/templates/clips/desktop/src-tauri/src/tray_meetings.rs +5 -4
  102. package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +16 -8
  103. package/corpus/templates/clips/shared/clips-ai-prefs.ts +81 -0
  104. package/corpus/templates/content/AGENTS.md +1 -0
  105. package/corpus/templates/content/actions/_database-source-utils.ts +73 -8
  106. package/corpus/templates/content/actions/_database-utils.ts +2 -1
  107. package/corpus/templates/content/actions/prepare-builder-source-review.ts +20 -1
  108. package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +663 -0
  109. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +33 -7
  110. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +53 -4
  111. package/corpus/templates/content/app/components/editor/database/settings.tsx +24 -0
  112. package/corpus/templates/content/app/hooks/use-content-database.ts +70 -1
  113. package/corpus/templates/content/app/hooks/use-document-properties.ts +63 -5
  114. package/corpus/templates/content/app/i18n/zh-TW.ts +3 -0
  115. package/corpus/templates/content/app/i18n-data.ts +31 -0
  116. package/corpus/templates/content/changelog/2026-07-01-builder-source-rows-can-be-staged-in-bulk-with-a-reviewable.md +6 -0
  117. package/corpus/templates/content/changelog/2026-07-07-builder-backed-database-fields-now-edit-like-normal-content-fields.md +6 -0
  118. package/corpus/templates/content/parity/matrix.md +24 -24
  119. package/corpus/templates/content/parity/matrix.ts +2 -0
  120. package/corpus/templates/content/shared/api.ts +59 -4
  121. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +16 -1
  122. package/corpus/templates/design/actions/add-localhost-screens.ts +1 -0
  123. package/corpus/templates/design/actions/connect-localhost.ts +26 -3
  124. package/corpus/templates/design/actions/open-visual-edit.ts +4 -37
  125. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +362 -12
  126. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +89 -14
  127. package/corpus/templates/design/app/components/design/bridge-security.ts +7 -1
  128. package/corpus/templates/design/app/components/design/multi-screen/types.ts +1 -1
  129. package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
  130. package/corpus/templates/design/app/i18n-data.ts +41 -0
  131. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-keeps-bridge-access-when-opening-previousl.md +6 -0
  132. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-now-keeps-the-live-app-connection-authenti.md +6 -0
  133. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-uses-live-app-iframes-for-click-to-edit-pr.md +6 -0
  134. package/dist/agent/durable-background.d.ts +12 -12
  135. package/dist/agent/durable-background.js +18 -18
  136. package/dist/agent/durable-background.js.map +1 -1
  137. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  138. package/dist/agent/engine/ai-sdk-engine.js +8 -2
  139. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  140. package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
  141. package/dist/agent/engine/anthropic-engine.js +11 -1
  142. package/dist/agent/engine/anthropic-engine.js.map +1 -1
  143. package/dist/agent/engine/index.d.ts +1 -1
  144. package/dist/agent/engine/index.d.ts.map +1 -1
  145. package/dist/agent/engine/index.js +1 -1
  146. package/dist/agent/engine/index.js.map +1 -1
  147. package/dist/agent/engine/registry.d.ts +14 -0
  148. package/dist/agent/engine/registry.d.ts.map +1 -1
  149. package/dist/agent/engine/registry.js +56 -2
  150. package/dist/agent/engine/registry.js.map +1 -1
  151. package/dist/agent/production-agent.d.ts +2 -2
  152. package/dist/agent/production-agent.d.ts.map +1 -1
  153. package/dist/agent/production-agent.js +18 -11
  154. package/dist/agent/production-agent.js.map +1 -1
  155. package/dist/agent/run-manager.d.ts +7 -1
  156. package/dist/agent/run-manager.d.ts.map +1 -1
  157. package/dist/agent/run-manager.js +6 -1
  158. package/dist/agent/run-manager.js.map +1 -1
  159. package/dist/agent/run-store.d.ts +1 -1
  160. package/dist/agent/run-store.d.ts.map +1 -1
  161. package/dist/agent/run-store.js +15 -10
  162. package/dist/agent/run-store.js.map +1 -1
  163. package/dist/cli/create.d.ts.map +1 -1
  164. package/dist/cli/create.js +31 -0
  165. package/dist/cli/create.js.map +1 -1
  166. package/dist/cli/design-connect.d.ts.map +1 -1
  167. package/dist/cli/design-connect.js +197 -1
  168. package/dist/cli/design-connect.js.map +1 -1
  169. package/dist/cli/index.js +76 -9
  170. package/dist/cli/index.js.map +1 -1
  171. package/dist/cli/workspacify.d.ts.map +1 -1
  172. package/dist/cli/workspacify.js +30 -0
  173. package/dist/cli/workspacify.js.map +1 -1
  174. package/dist/client/KeepTabOpenNotice.d.ts +9 -10
  175. package/dist/client/KeepTabOpenNotice.d.ts.map +1 -1
  176. package/dist/client/KeepTabOpenNotice.js +8 -4
  177. package/dist/client/KeepTabOpenNotice.js.map +1 -1
  178. package/dist/client/RunStuckBanner.d.ts.map +1 -1
  179. package/dist/client/RunStuckBanner.js +14 -13
  180. package/dist/client/RunStuckBanner.js.map +1 -1
  181. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  182. package/dist/client/agent-chat-adapter.js +25 -17
  183. package/dist/client/agent-chat-adapter.js.map +1 -1
  184. package/dist/client/history/VersionHistoryPanel.d.ts +1 -1
  185. package/dist/client/history/VersionHistoryPanel.d.ts.map +1 -1
  186. package/dist/client/history/VersionHistoryPanel.js +12 -5
  187. package/dist/client/history/VersionHistoryPanel.js.map +1 -1
  188. package/dist/client/history/index.d.ts +1 -1
  189. package/dist/client/history/index.d.ts.map +1 -1
  190. package/dist/client/history/index.js +1 -1
  191. package/dist/client/history/index.js.map +1 -1
  192. package/dist/client/history/use-history.d.ts +12 -0
  193. package/dist/client/history/use-history.d.ts.map +1 -1
  194. package/dist/client/history/use-history.js +6 -0
  195. package/dist/client/history/use-history.js.map +1 -1
  196. package/dist/client/index.d.ts +2 -2
  197. package/dist/client/index.d.ts.map +1 -1
  198. package/dist/client/index.js +2 -2
  199. package/dist/client/index.js.map +1 -1
  200. package/dist/client/review/index.d.ts +1 -1
  201. package/dist/client/review/index.d.ts.map +1 -1
  202. package/dist/client/review/index.js +1 -1
  203. package/dist/client/review/index.js.map +1 -1
  204. package/dist/client/review/use-review.d.ts +23 -0
  205. package/dist/client/review/use-review.d.ts.map +1 -1
  206. package/dist/client/review/use-review.js +8 -0
  207. package/dist/client/review/use-review.js.map +1 -1
  208. package/dist/client/use-run-stuck-detection.d.ts +1 -1
  209. package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
  210. package/dist/client/use-run-stuck-detection.js +6 -4
  211. package/dist/client/use-run-stuck-detection.js.map +1 -1
  212. package/dist/collab/struct-routes.d.ts +1 -1
  213. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  214. package/dist/history/actions/create-resource-version.js +7 -4
  215. package/dist/history/actions/create-resource-version.js.map +1 -1
  216. package/dist/history/index.d.ts +1 -1
  217. package/dist/history/index.d.ts.map +1 -1
  218. package/dist/history/index.js +1 -1
  219. package/dist/history/index.js.map +1 -1
  220. package/dist/history/registry.d.ts.map +1 -1
  221. package/dist/history/registry.js +14 -12
  222. package/dist/history/registry.js.map +1 -1
  223. package/dist/history/store.d.ts.map +1 -1
  224. package/dist/history/store.js +74 -49
  225. package/dist/history/store.js.map +1 -1
  226. package/dist/notifications/routes.d.ts +1 -1
  227. package/dist/resources/handlers.d.ts +3 -3
  228. package/dist/review/actions/consume-review-feedback.d.ts +1 -0
  229. package/dist/review/actions/consume-review-feedback.js +8 -2
  230. package/dist/review/actions/consume-review-feedback.js.map +1 -1
  231. package/dist/review/actions/delete-review-comment.d.ts +2 -1
  232. package/dist/review/actions/delete-review-comment.js +11 -3
  233. package/dist/review/actions/delete-review-comment.js.map +1 -1
  234. package/dist/review/actions/resolve-review-thread.d.ts +2 -1
  235. package/dist/review/actions/resolve-review-thread.js +5 -2
  236. package/dist/review/actions/resolve-review-thread.js.map +1 -1
  237. package/dist/review/index.d.ts +1 -1
  238. package/dist/review/index.d.ts.map +1 -1
  239. package/dist/review/index.js +1 -1
  240. package/dist/review/index.js.map +1 -1
  241. package/dist/review/registry.d.ts.map +1 -1
  242. package/dist/review/registry.js +14 -12
  243. package/dist/review/registry.js.map +1 -1
  244. package/dist/review/store.d.ts +3 -3
  245. package/dist/review/store.d.ts.map +1 -1
  246. package/dist/review/store.js +7 -4
  247. package/dist/review/store.js.map +1 -1
  248. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  249. package/dist/server/agent-chat-plugin.js +5 -0
  250. package/dist/server/agent-chat-plugin.js.map +1 -1
  251. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  252. package/dist/server/credential-provider.d.ts +2 -0
  253. package/dist/server/credential-provider.d.ts.map +1 -1
  254. package/dist/server/credential-provider.js +13 -3
  255. package/dist/server/credential-provider.js.map +1 -1
  256. package/package.json +1 -1
@@ -1,17 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawn } from "node:child_process";
4
- import { existsSync } from "node:fs";
4
+ import { existsSync, statSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
7
7
 
8
8
  const binDir = dirname(fileURLToPath(import.meta.url));
9
9
  const distEntry = join(binDir, "../dist/cli/index.js");
10
+ const sourceEntry = join(binDir, "../src/cli/index.ts");
11
+ const freshnessChecks = [
12
+ [sourceEntry, distEntry],
13
+ [
14
+ join(binDir, "../src/cli/design-connect.ts"),
15
+ join(binDir, "../dist/cli/design-connect.js"),
16
+ ],
17
+ ];
10
18
 
11
- if (existsSync(distEntry)) {
19
+ function shouldUseSourceFallback() {
20
+ if (!existsSync(sourceEntry)) return false;
21
+ if (!existsSync(distEntry)) return true;
22
+ try {
23
+ return freshnessChecks.some(
24
+ ([source, dist]) =>
25
+ existsSync(source) &&
26
+ existsSync(dist) &&
27
+ statSync(source).mtimeMs > statSync(dist).mtimeMs,
28
+ );
29
+ } catch {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ if (!shouldUseSourceFallback() && existsSync(distEntry)) {
12
35
  await import(pathToFileURL(distEntry).href);
13
36
  } else {
14
- const sourceEntry = join(binDir, "../src/cli/index.ts");
15
37
  if (!existsSync(sourceEntry)) {
16
38
  console.error(
17
39
  "agent-native CLI build output is missing. Run `pnpm --filter @agent-native/core build` and try again.",
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 2144
31
- - template files: 4806
31
+ - template files: 4822
@@ -1,5 +1,22 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.90.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 3da78df: Classify BYO-provider rate limits (HTTP 429) as retryable. The native Anthropic and AI-SDK engines now forward the provider HTTP status as a structured `http_<status>` errorCode + `statusCode` for every failure (not just 401), so a bare "429 status code (no body)" surfaces as `http_429`. `isRetryableError` also matches `http_429` and bare `429` messages. Previously a directly-connected provider key that Anthropic rate-limited failed hard instead of backing off and retrying like the Builder gateway path does, and rate-limited runs can now auto-continue.
8
+ - 3da78df: Fix localhost Design bridge self-registration so capability payloads match the Design server action and bridge tokens can be persisted.
9
+ - 3da78df: Make hosted foreground agent turns continue from the server by default, so switching tabs or closing the browser no longer leaves long runs dependent on a client-side auto-continue POST.
10
+
11
+ ## 0.90.4
12
+
13
+ ### Patch Changes
14
+
15
+ - 9f396bc: Fail closed for unregistered History/Review resource types, allocate unique version numbers atomically, verify resolve/consume update counts, and prefer server snapshots over client-supplied ones.
16
+ - 9f396bc: Add live visual-edit bridge support for localhost apps so Design can render editable live iframes instead of static HTML snapshots.
17
+ - 9f396bc: Expire sticky provider auth-failure markers, skip rejected deploy env keys during engine auto-detect, and clear failure markers from the legacy save-key path.
18
+ - 9f396bc: Keep React Router build packages installed for scaffolded app builds and report missing build dependencies before spawning the CLI.
19
+
3
20
  ## 0.90.3
4
21
 
5
22
  ### Patch Changes
@@ -1,17 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { spawn } from "node:child_process";
4
- import { existsSync } from "node:fs";
4
+ import { existsSync, statSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
7
7
 
8
8
  const binDir = dirname(fileURLToPath(import.meta.url));
9
9
  const distEntry = join(binDir, "../dist/cli/index.js");
10
+ const sourceEntry = join(binDir, "../src/cli/index.ts");
11
+ const freshnessChecks = [
12
+ [sourceEntry, distEntry],
13
+ [
14
+ join(binDir, "../src/cli/design-connect.ts"),
15
+ join(binDir, "../dist/cli/design-connect.js"),
16
+ ],
17
+ ];
10
18
 
11
- if (existsSync(distEntry)) {
19
+ function shouldUseSourceFallback() {
20
+ if (!existsSync(sourceEntry)) return false;
21
+ if (!existsSync(distEntry)) return true;
22
+ try {
23
+ return freshnessChecks.some(
24
+ ([source, dist]) =>
25
+ existsSync(source) &&
26
+ existsSync(dist) &&
27
+ statSync(source).mtimeMs > statSync(dist).mtimeMs,
28
+ );
29
+ } catch {
30
+ return false;
31
+ }
32
+ }
33
+
34
+ if (!shouldUseSourceFallback() && existsSync(distEntry)) {
12
35
  await import(pathToFileURL(distEntry).href);
13
36
  } else {
14
- const sourceEntry = join(binDir, "../src/cli/index.ts");
15
37
  if (!existsSync(sourceEntry)) {
16
38
  console.error(
17
39
  "agent-native CLI build output is missing. Run `pnpm --filter @agent-native/core build` and try again.",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.90.3",
3
+ "version": "0.90.5",
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": {
@@ -340,17 +340,17 @@ export function isAgentChatDurableBackgroundEnabled(options?: {
340
340
  }
341
341
 
342
342
  /**
343
- * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-OFF (opt-in):
344
- * unset means disabled; an app opts IN with an explicit truthy value
345
- * (`true`/`1`/`yes`/`on`) — same parsing convention as
346
- * `AGENT_CHAT_DURABLE_BACKGROUND`, deliberately kept as a separate flag so
347
- * this narrower capability can be enabled/disabled independently of the full
348
- * durable-background worker path.
343
+ * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-ON for hosted
344
+ * deployments with `A2A_SECRET`: unset/empty/unknown means enabled, and an app
345
+ * opts OUT with an explicit falsy value (`false`/`0`/`no`/`off`). Deliberately
346
+ * kept separate from `AGENT_CHAT_DURABLE_BACKGROUND` so this narrower
347
+ * capability can be disabled independently of the full durable-background
348
+ * worker path.
349
349
  */
350
350
  export const AGENT_CHAT_FOREGROUND_SELF_CHAIN_ENV =
351
351
  "AGENT_CHAT_FOREGROUND_SELF_CHAIN";
352
352
 
353
- function isForegroundSelfChainFlagEnabled(): boolean {
353
+ function isForegroundSelfChainExplicitlyDisabled(): boolean {
354
354
  // Read the literal key (not `process.env[CONST]`) so guard:no-env-credentials
355
355
  // can statically verify it against the allowlisted `AGENT_*` prefix. Keep this
356
356
  // in sync with AGENT_CHAT_FOREGROUND_SELF_CHAIN_ENV.
@@ -358,26 +358,26 @@ function isForegroundSelfChainFlagEnabled(): boolean {
358
358
  if (raw == null) return false;
359
359
  const normalized = raw.trim().toLowerCase();
360
360
  return (
361
- normalized === "1" ||
362
- normalized === "true" ||
363
- normalized === "yes" ||
364
- normalized === "on"
361
+ normalized === "0" ||
362
+ normalized === "false" ||
363
+ normalized === "no" ||
364
+ normalized === "off"
365
365
  );
366
366
  }
367
367
 
368
368
  /**
369
- * Gate for the OPT-IN foreground self-chain: a normal (non-durable-background)
369
+ * Gate for the foreground self-chain: a normal (non-durable-background)
370
370
  * agent-chat turn that hits its soft-timeout chunk boundary continues via a
371
371
  * server-side self-dispatch on the REGULAR function (not a Netlify
372
372
  * `-background` function) instead of depending on the client to re-POST
373
373
  * `auto_continue`. Composes exactly like `isAgentChatDurableBackgroundEnabled`:
374
- * true only when the env flag is explicitly truthy AND the runtime is hosted
375
- * AND `A2A_SECRET` is configured (the HMAC handoff authenticates the
376
- * self-dispatch). False otherwise — and false means the existing
377
- * client-driven `auto_continue` re-POST path is used unchanged, byte-for-byte.
374
+ * true when the runtime is hosted AND `A2A_SECRET` is configured (the HMAC
375
+ * handoff authenticates the self-dispatch), unless the env flag is explicitly
376
+ * falsy. False otherwise — and false means the existing client-driven
377
+ * `auto_continue` re-POST path is used unchanged, byte-for-byte.
378
378
  *
379
379
  * Deliberately independent of `isAgentChatDurableBackgroundEnabled`: an app can
380
- * enable this narrower capability without opting into the full 15-min
380
+ * use this narrower capability without opting into the full 15-min
381
381
  * background-function worker path, and the two gates never need to agree.
382
382
  * When BOTH would be true for a given run, the durable-background dispatch
383
383
  * decision in `production-agent.ts` is evaluated first and takes precedence —
@@ -386,7 +386,7 @@ function isForegroundSelfChainFlagEnabled(): boolean {
386
386
  */
387
387
  export function isAgentChatForegroundSelfChainEnabled(): boolean {
388
388
  return (
389
- isForegroundSelfChainFlagEnabled() &&
389
+ !isForegroundSelfChainExplicitlyDisabled() &&
390
390
  isHostedRuntimeForDurableBackground() &&
391
391
  hasConfiguredA2ASecret()
392
392
  );
@@ -384,8 +384,14 @@ class AISDKEngine implements AgentEngine {
384
384
  type: "stop",
385
385
  reason: "error",
386
386
  error: err?.message ?? String(err),
387
- ...(statusCode === 401 ? { errorCode: "http_401" } : {}),
388
- ...(statusCode !== undefined ? { statusCode } : {}),
387
+ // Tag every known status with `http_<status>` (not just 401) so a
388
+ // rate limit surfaces as `http_429`. The structured statusCode
389
+ // already drives turn-level retries, but the run-level continuation
390
+ // logic keys off the errorCode, so this lets a rate-limited turn
391
+ // auto-resume too — matching the Builder gateway path.
392
+ ...(statusCode !== undefined
393
+ ? { errorCode: `http_${statusCode}`, statusCode }
394
+ : {}),
389
395
  ...(providerRetryable !== undefined ? { providerRetryable } : {}),
390
396
  };
391
397
  throw err;
@@ -227,7 +227,17 @@ class AnthropicEngine implements AgentEngine {
227
227
  type: "stop",
228
228
  reason: "error",
229
229
  error: err?.message ?? String(err),
230
- ...(statusCode === 401 ? { errorCode: "http_401", statusCode } : {}),
230
+ // Forward the provider HTTP status for EVERY known status, not just
231
+ // 401. The Anthropic SDK reports empty-body failures as a bare
232
+ // "429 status code (no body)" message, so without a structured
233
+ // statusCode/errorCode `isRetryableError` couldn't classify a rate
234
+ // limit (it matches "529"/"502" substrings but not "429") and the
235
+ // run failed hard instead of backing off + retrying like the Builder
236
+ // gateway path does. `http_429`/`http_529` also let the run-level
237
+ // continuation logic auto-resume a rate-limited turn.
238
+ ...(statusCode !== undefined
239
+ ? { errorCode: `http_${statusCode}`, statusCode }
240
+ : {}),
231
241
  };
232
242
  throw err;
233
243
  }
@@ -25,6 +25,7 @@ export {
25
25
  getStoredModelForEngine,
26
26
  normalizeModelForEngine,
27
27
  detectEngineFromEnv,
28
+ detectEngineFromEnvForRequest,
28
29
  detectEngineFromUserSecrets,
29
30
  isAgentEngineSettingConfigured,
30
31
  isAgentEnginePackageInstalled,
@@ -156,6 +156,10 @@ function assertAgentEnginePackageInstalled(entry: AgentEngineEntry): void {
156
156
  * on the first pass, so an explicit provider key (ANTHROPIC_API_KEY etc.)
157
157
  * is picked instead. Builder is still used as the fallback when no other
158
158
  * provider key is set.
159
+ *
160
+ * This sync helper is for CLI/status callers that cannot await settings. Prefer
161
+ * {@link detectEngineFromEnvForRequest} at request time so sticky auth-failure
162
+ * markers can skip rejected deploy keys.
159
163
  */
160
164
  export function detectEngineFromEnv(): AgentEngineEntry | null {
161
165
  const preferByo = /^(1|true)$/i.test(
@@ -196,6 +200,59 @@ export function detectEngineFromEnv(): AgentEngineEntry | null {
196
200
  return null;
197
201
  }
198
202
 
203
+ async function envKeyUsableForEntry(
204
+ entry: AgentEngineEntry,
205
+ key: string,
206
+ ): Promise<boolean> {
207
+ if (
208
+ !(
209
+ canUseDeployCredentialFallbackForRequest(key) &&
210
+ !!readDeployCredentialEnv(key)
211
+ )
212
+ ) {
213
+ return false;
214
+ }
215
+ if (entry.name === "builder") {
216
+ return true;
217
+ }
218
+ const value = readDeployCredentialEnv(key);
219
+ if (!value) return false;
220
+ return !(await getProviderCredentialAuthFailure({ key, value }));
221
+ }
222
+
223
+ async function hasUsableEnvKeys(entry: AgentEngineEntry): Promise<boolean> {
224
+ if (!isAgentEnginePackageInstalled(entry)) return false;
225
+ if (entry.requiredEnvVars.length === 0) return false;
226
+ for (const key of entry.requiredEnvVars) {
227
+ if (!(await envKeyUsableForEntry(entry, key))) return false;
228
+ }
229
+ return true;
230
+ }
231
+
232
+ /**
233
+ * Request-aware env auto-detect. Same priority as {@link detectEngineFromEnv},
234
+ * but skips provider keys that currently have an auth-failure marker so a
235
+ * rejected deploy key does not permanently win selection and leave chat stuck
236
+ * on `missing_credentials`.
237
+ */
238
+ export async function detectEngineFromEnvForRequest(): Promise<AgentEngineEntry | null> {
239
+ const preferByo = /^(1|true)$/i.test(
240
+ process.env.AGENT_ENGINE_PREFER_BYO_KEY ?? "",
241
+ );
242
+
243
+ if (preferByo) {
244
+ for (const entry of _registry.values()) {
245
+ if (entry.name === "builder") continue;
246
+ if (await hasUsableEnvKeys(entry)) return entry;
247
+ }
248
+ }
249
+
250
+ for (const entry of _registry.values()) {
251
+ if (await hasUsableEnvKeys(entry)) return entry;
252
+ }
253
+ return null;
254
+ }
255
+
199
256
  function shouldTraceEngineDetection(): boolean {
200
257
  return /^(1|true)$/i.test(
201
258
  process.env.AGENT_NATIVE_DEBUG_AGENT_ENGINE_DETECT ??
@@ -399,6 +456,9 @@ async function engineCreateConfigForEntry(
399
456
  * AND an API key for it is reachable via the engine's required env vars.
400
457
  * Inline keys on the global settings row are ignored; see
401
458
  * `isAgentEngineSettingConfigured`.
459
+ *
460
+ * Sync helper for CLI/status. Prefer {@link isStoredEngineUsableForRequest}
461
+ * so sticky auth-failure markers are respected.
402
462
  */
403
463
  export function isStoredEngineUsable(
404
464
  stored: unknown,
@@ -618,8 +678,9 @@ export async function resolveEngine(
618
678
  }
619
679
 
620
680
  // 8. Auto-detect from any provider env var — so just dropping a key in
621
- // .env works without also setting AGENT_ENGINE.
622
- const detected = detectEngineFromEnv();
681
+ // .env works without also setting AGENT_ENGINE. Skip keys with active
682
+ // auth-failure markers so a rejected deploy key cannot permanently win.
683
+ const detected = await detectEngineFromEnvForRequest();
623
684
  if (detected) {
624
685
  return detected.create(await engineCreateConfigForEntry(detected, apiKey));
625
686
  }
@@ -1132,6 +1132,7 @@ export function isRetryableError(err: unknown): boolean {
1132
1132
  return (
1133
1133
  code === "builder_gateway_error" ||
1134
1134
  code === "builder_gateway_network_error" ||
1135
+ code === "http_429" ||
1135
1136
  code === "http_500" ||
1136
1137
  code === "http_502" ||
1137
1138
  code === "http_503" ||
@@ -1140,6 +1141,9 @@ export function isRetryableError(err: unknown): boolean {
1140
1141
  // Anthropic
1141
1142
  msg.includes("overloaded") ||
1142
1143
  msg.includes("rate_limit") ||
1144
+ // Bare provider rate-limit messages that carry no structured status,
1145
+ // e.g. the Anthropic/AI-SDK "429 status code (no body)" format.
1146
+ /\b429\b/.test(msg) ||
1143
1147
  msg.includes("529") ||
1144
1148
  // OpenAI phrasing
1145
1149
  msg.includes("rate limit reached") ||
@@ -4620,8 +4624,8 @@ export const MAX_BACKGROUND_RUN_CONTINUATIONS = 20;
4620
4624
  * budget:
4621
4625
  * - a durable-background WORKER run (`isBackgroundWorker`) — unconditional,
4622
4626
  * unchanged from before; or
4623
- * - a FOREGROUND run when the opt-in `foregroundSelfChainEligible` flag is
4624
- * set (see `isAgentChatForegroundSelfChainEnabled` in
4627
+ * - a FOREGROUND run when the resolved `foregroundSelfChainEligible` gate is
4628
+ * true (see `isAgentChatForegroundSelfChainEnabled` in
4625
4629
  * `durable-background.ts`) AND this specific run was never dispatched to
4626
4630
  * the durable background worker (`dispatchedToBackground` false) — a run
4627
4631
  * already headed to the durable background path chains via the
@@ -6189,12 +6193,12 @@ export function createProductionAgentHandler(
6189
6193
  turnId: effectiveTurnId,
6190
6194
  }
6191
6195
  : null;
6192
- // Opt-in (default-OFF) foreground self-chain: gated on the env flag AND
6193
- // this specific run never having been routed to the durable background
6194
- // worker. A run that WAS dispatched to background (`dispatchToBackground`)
6195
- // already has its recovery owned by the background circuit-breaker /
6196
- // `isBackgroundWorker` chain above — this flag must never double up with
6197
- // that path, only stand in for it on plain foreground turns. A persistent
6196
+ // Foreground self-chain: gated on hosted runtime + A2A_SECRET, with an
6197
+ // explicit env opt-out, AND this specific run never having been routed to
6198
+ // the durable background worker. A run that WAS dispatched to background
6199
+ // (`dispatchToBackground`) already has its recovery owned by the background
6200
+ // circuit-breaker / `isBackgroundWorker` chain above — this flag must never
6201
+ // double up with that path, only stand in for it on plain foreground turns. A persistent
6198
6202
  // threadId is required: the client discovers the pre-inserted successor
6199
6203
  // via `/runs/active?threadId` and the successor chunk resumes from the
6200
6204
  // thread's persisted thread_data — without a thread there is neither a
@@ -6302,8 +6306,8 @@ export function createProductionAgentHandler(
6302
6306
 
6303
6307
  // Wrap so the background worker is unblocked even when there is no app
6304
6308
  // onRunComplete / tracked-progress callback configured. Also installed for
6305
- // a foreground run eligible for the opt-in self-chain — that path needs
6306
- // this same wrapper to fire the continuation dispatch below.
6309
+ // a foreground run eligible for self-chain — that path needs this same
6310
+ // wrapper to fire the continuation dispatch below.
6307
6311
  const handleRunComplete =
6308
6312
  isBackgroundWorker || foregroundSelfChainEligible || baseHandleRunComplete
6309
6313
  ? async (run: ActiveRun) => {
@@ -6897,6 +6901,9 @@ export function createProductionAgentHandler(
6897
6901
  // assistant message. Falls back to the runId (turn == run) when the
6898
6902
  // client doesn't supply a turnId.
6899
6903
  turnId: effectiveTurnId,
6904
+ dispatchMode: foregroundSelfChainEligible
6905
+ ? "foreground-self-chain"
6906
+ : "foreground",
6900
6907
  },
6901
6908
  );
6902
6909
 
@@ -6920,7 +6927,11 @@ export function createProductionAgentHandler(
6920
6927
  setResponseHeader(event, "Cache-Control", "no-cache");
6921
6928
  setResponseHeader(event, "Connection", "keep-alive");
6922
6929
  setResponseHeader(event, "X-Run-Id", runId);
6923
- setResponseHeader(event, "X-Dispatch-Mode", "foreground");
6930
+ setResponseHeader(
6931
+ event,
6932
+ "X-Dispatch-Mode",
6933
+ foregroundSelfChainEligible ? "foreground-self-chain" : "foreground",
6934
+ );
6924
6935
 
6925
6936
  return stream;
6926
6937
  });
@@ -264,6 +264,12 @@ export interface StartRunOptions {
264
264
  * and to disabled otherwise (local dev stays unbounded).
265
265
  */
266
266
  noProgressTimeoutMs?: number;
267
+ /**
268
+ * Lifecycle metadata persisted to `agent_runs.dispatch_mode` and surfaced to
269
+ * clients through `/runs/active`. This does not change run-manager behavior;
270
+ * callers use it to describe who owns continuation at hosted chunk boundaries.
271
+ */
272
+ dispatchMode?: "foreground" | "foreground-self-chain";
267
273
  }
268
274
 
269
275
  export interface ResolveRunSoftTimeoutOptions {
@@ -480,11 +486,16 @@ export function startRun(
480
486
  // Persist run to SQL without blocking the response. Keep the promise so
481
487
  // final status cannot race ahead of a slow initial INSERT and then get
482
488
  // overwritten by a late row stuck at status='running'.
483
- const insertRunPromise = insertRun(runId, threadId, options?.turnId).catch(
484
- (error) => {
485
- captureRunPersistenceError(error, "insert-run");
486
- },
487
- );
489
+ const insertOptions = options?.dispatchMode
490
+ ? { dispatchMode: options.dispatchMode }
491
+ : undefined;
492
+ const insertRunPromise = (
493
+ insertOptions
494
+ ? insertRun(runId, threadId, options?.turnId, insertOptions)
495
+ : insertRun(runId, threadId, options?.turnId)
496
+ ).catch((error) => {
497
+ captureRunPersistenceError(error, "insert-run");
498
+ });
488
499
 
489
500
  // Per-run event persistence chain: events are chained so SQL inserts commit
490
501
  // in seq order. Without this, a fast seq=5 commit before a slow seq=4 means
@@ -1356,7 +1367,7 @@ export async function getActiveRunForThreadAsync(threadId: string): Promise<{
1356
1367
  status: string;
1357
1368
  heartbeatAt: number;
1358
1369
  lastProgressAt: number | null;
1359
- /** How the run was dispatched (NULL/foreground, background, background-processing). */
1370
+ /** How the run was dispatched/continued (foreground, foreground-self-chain, background...). */
1360
1371
  dispatchMode?: string | null;
1361
1372
  /** Compact terminal classification, e.g. done, run_timeout, stale_run. */
1362
1373
  terminalReason?: string | null;
@@ -183,9 +183,11 @@ async function ensureRunTables(): Promise<void> {
183
183
  // at completion so errored/cut-off runs are queryable for
184
184
  // pattern analysis (see listErroredRuns).
185
185
  // dispatch_mode marks how a run was started: NULL/"foreground" for the
186
- // normal synchronous path, "background" for a run dispatched into a
187
- // Netlify background function. The reaper/claim widen the stale window
188
- // for background rows so a slow cold-start isn't falsely reaped.
186
+ // normal client-continued synchronous path, "foreground-self-chain" for
187
+ // a foreground run whose continuation boundary is server-driven, and
188
+ // "background" for a run dispatched into a Netlify background function.
189
+ // The reaper/claim widen the stale window for background rows so a slow
190
+ // cold-start isn't falsely reaped.
189
191
  // diag_stage records the last reached pipeline stage (+ any error) for a
190
192
  // background-dispatched run so a silent worker death is DIAGNOSABLE from
191
193
  // the client (/runs/active surfaces it) without reading the unreadable
@@ -273,9 +275,11 @@ async function ensureRunTables(): Promise<void> {
273
275
  // at completion so errored/cut-off runs are queryable for
274
276
  // pattern analysis (see listErroredRuns).
275
277
  // dispatch_mode marks how a run was started: NULL/"foreground" for the
276
- // normal synchronous path, "background" for a run dispatched into a
277
- // Netlify background function. The reaper/claim widen the stale window
278
- // for background rows so a slow cold-start isn't falsely reaped.
278
+ // normal client-continued synchronous path, "foreground-self-chain" for
279
+ // a foreground run whose continuation boundary is server-driven, and
280
+ // "background" for a run dispatched into a Netlify background function.
281
+ // The reaper/claim widen the stale window for background rows so a slow
282
+ // cold-start isn't falsely reaped.
279
283
  // diag_stage records the last reached pipeline stage (+ any error) for a
280
284
  // background-dispatched run so a silent worker death is DIAGNOSABLE from
281
285
  // the client (/runs/active surfaces it) without reading the unreadable
@@ -420,7 +424,7 @@ export async function insertRun(
420
424
  threadId: string,
421
425
  turnId?: string,
422
426
  options?: {
423
- dispatchMode?: "foreground" | "background";
427
+ dispatchMode?: "foreground" | "foreground-self-chain" | "background";
424
428
  /**
425
429
  * JSON-serialized request body for a background dispatch. Persisted on the
426
430
  * run row so the self-POST to the background function carries only the
@@ -456,10 +460,11 @@ export async function insertRun(
456
460
  * subtracted by the resolved window so the comparison is
457
461
  * `COALESCE(heartbeat_at, started_at) < (now - window)`.
458
462
  *
459
- * `dispatch_mode` is one of NULL/"foreground" (normal sync path), "background"
460
- * (foreground inserted the row for a background dispatch), or
461
- * "background-processing" (the background worker claimed it). Both background
462
- * states get the wider window via a LIKE-prefix match.
463
+ * `dispatch_mode` is one of NULL/"foreground" (normal client-continued sync
464
+ * path), "foreground-self-chain" (server-driven continuation at the foreground
465
+ * chunk boundary), "background" (foreground inserted the row for a background
466
+ * dispatch), or "background-processing" (the background worker claimed it). Both
467
+ * background states get the wider window via a LIKE-prefix match.
463
468
  */
464
469
  function backgroundAwareStaleCutoffSql(): string {
465
470
  // `CAST(? AS BIGINT)` is required: without it Postgres infers the param as
@@ -27,6 +27,12 @@ const STANDALONE_EXACT_DEPENDENCY_OVERRIDES: Record<string, string> = {
27
27
  "@react-router/fs-routes": "8.1.0",
28
28
  "react-router": "8.1.0",
29
29
  };
30
+ const REACT_ROUTER_BUILD_DEPENDENCIES = [
31
+ "@react-router/dev",
32
+ "@react-router/fs-routes",
33
+ "react-router",
34
+ "vite",
35
+ ] as const;
30
36
  const SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = ['"@sentry/*"'];
31
37
  const FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [
32
38
  "*/CLAUDE.md",
@@ -1045,6 +1051,7 @@ function postProcessStandalone(
1045
1051
  // under pnpm 10+ without prompting for `pnpm approve-builds`.
1046
1052
  pkg.dependencies = pkg.dependencies ?? {};
1047
1053
  pkg.dependencies.postgres ??= POSTGRES_DEPENDENCY_VERSION;
1054
+ ensureReactRouterBuildDependencies(pkg);
1048
1055
 
1049
1056
  const requiredBuilt = ["better-sqlite3", "esbuild", "node-pty"];
1050
1057
  if (!pkg.pnpm || typeof pkg.pnpm !== "object") {
@@ -1105,6 +1112,34 @@ function postProcessStandalone(
1105
1112
  setupAgentSymlinks(targetDir);
1106
1113
  }
1107
1114
 
1115
+ function ensureReactRouterBuildDependencies(pkg: Record<string, any>): void {
1116
+ const allDeps = {
1117
+ ...pkg.dependencies,
1118
+ ...pkg.devDependencies,
1119
+ ...pkg.peerDependencies,
1120
+ };
1121
+ if (
1122
+ !allDeps["@react-router/dev"] &&
1123
+ !allDeps["react-router"] &&
1124
+ !allDeps["@react-router/fs-routes"]
1125
+ ) {
1126
+ return;
1127
+ }
1128
+
1129
+ pkg.dependencies = pkg.dependencies ?? {};
1130
+ for (const key of REACT_ROUTER_BUILD_DEPENDENCIES) {
1131
+ const existing =
1132
+ pkg.dependencies[key] ??
1133
+ pkg.devDependencies?.[key] ??
1134
+ pkg.peerDependencies?.[key];
1135
+ if (!existing) continue;
1136
+ pkg.dependencies[key] =
1137
+ STANDALONE_EXACT_DEPENDENCY_OVERRIDES[key] ?? existing;
1138
+ delete pkg.devDependencies?.[key];
1139
+ delete pkg.peerDependencies?.[key];
1140
+ }
1141
+ }
1142
+
1108
1143
  function fixStandaloneTsconfig(targetDir: string, templateName?: string): void {
1109
1144
  const tsconfigPath = path.join(targetDir, "tsconfig.json");
1110
1145
  if (!fs.existsSync(tsconfigPath)) return;