@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.
- package/bin/agent-native.js +25 -3
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +17 -0
- package/corpus/core/bin/agent-native.js +25 -3
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/durable-background.ts +18 -18
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +8 -2
- package/corpus/core/src/agent/engine/anthropic-engine.ts +11 -1
- package/corpus/core/src/agent/engine/index.ts +1 -0
- package/corpus/core/src/agent/engine/registry.ts +63 -2
- package/corpus/core/src/agent/production-agent.ts +22 -11
- package/corpus/core/src/agent/run-manager.ts +17 -6
- package/corpus/core/src/agent/run-store.ts +16 -11
- package/corpus/core/src/cli/create.ts +35 -0
- package/corpus/core/src/cli/design-connect.ts +263 -1
- package/corpus/core/src/cli/index.ts +84 -7
- package/corpus/core/src/cli/workspacify.ts +34 -0
- package/corpus/core/src/client/KeepTabOpenNotice.tsx +20 -15
- package/corpus/core/src/client/RunStuckBanner.tsx +14 -13
- package/corpus/core/src/client/agent-chat-adapter.ts +28 -17
- package/corpus/core/src/client/history/VersionHistoryPanel.tsx +77 -47
- package/corpus/core/src/client/history/index.ts +3 -0
- package/corpus/core/src/client/history/use-history.ts +28 -0
- package/corpus/core/src/client/index.ts +8 -0
- package/corpus/core/src/client/review/index.ts +5 -0
- package/corpus/core/src/client/review/use-review.ts +40 -2
- package/corpus/core/src/client/use-run-stuck-detection.ts +8 -5
- package/corpus/core/src/history/actions/create-resource-version.ts +11 -8
- package/corpus/core/src/history/index.ts +0 -1
- package/corpus/core/src/history/registry.ts +24 -12
- package/corpus/core/src/history/store.ts +84 -53
- package/corpus/core/src/review/actions/consume-review-feedback.ts +15 -5
- package/corpus/core/src/review/actions/delete-review-comment.ts +15 -3
- package/corpus/core/src/review/actions/resolve-review-thread.ts +12 -5
- package/corpus/core/src/review/index.ts +0 -5
- package/corpus/core/src/review/registry.ts +24 -12
- package/corpus/core/src/review/store.ts +10 -7
- package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
- package/corpus/core/src/server/credential-provider.ts +13 -3
- package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +11 -11
- package/corpus/templates/assets/actions/generate-image.ts +64 -28
- package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +1 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +91 -74
- package/corpus/templates/assets/server/lib/generation.ts +29 -4
- package/corpus/templates/assets/server/lib/image-processing.ts +131 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +24 -2
- package/corpus/templates/calendar/AGENTS.md +3 -0
- package/corpus/templates/calendar/actions/create-event.ts +8 -34
- package/corpus/templates/calendar/actions/event-action-helpers.ts +52 -0
- package/corpus/templates/calendar/actions/manage-event-draft.ts +7 -34
- package/corpus/templates/calendar/actions/update-event.ts +10 -23
- package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +47 -0
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +23 -0
- package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +59 -2
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +40 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +34 -1
- package/corpus/templates/calendar/app/hooks/use-events.ts +6 -0
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/calendar/app/i18n-data.ts +40 -0
- package/corpus/templates/calendar/changelog/2026-07-07-you-can-mark-event-guests-as-optional-while-inviting-them-or.md +6 -0
- package/corpus/templates/calendar/server/handlers/events.ts +1 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +4 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
- package/corpus/templates/calendar/shared/api.ts +2 -0
- package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +29 -3
- package/corpus/templates/clips/actions/generate-workflow.ts +19 -8
- package/corpus/templates/clips/actions/get-clips-ai-prefs.ts +36 -0
- package/corpus/templates/clips/actions/lib/clips-ai-prefs.ts +28 -0
- package/corpus/templates/clips/actions/regenerate-chapters.ts +21 -7
- package/corpus/templates/clips/actions/regenerate-summary.ts +26 -8
- package/corpus/templates/clips/actions/regenerate-title.ts +44 -7
- package/corpus/templates/clips/actions/update-clips-ai-prefs.ts +50 -0
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +7 -2
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +25 -10
- package/corpus/templates/clips/app/i18n/ar-SA.ts +28 -6
- package/corpus/templates/clips/app/i18n/de-DE.ts +28 -6
- package/corpus/templates/clips/app/i18n/en-US.ts +29 -6
- package/corpus/templates/clips/app/i18n/es-ES.ts +29 -6
- package/corpus/templates/clips/app/i18n/fr-FR.ts +30 -6
- package/corpus/templates/clips/app/i18n/hi-IN.ts +26 -6
- package/corpus/templates/clips/app/i18n/ja-JP.ts +27 -6
- package/corpus/templates/clips/app/i18n/ko-KR.ts +28 -6
- package/corpus/templates/clips/app/i18n/pt-BR.ts +28 -6
- package/corpus/templates/clips/app/i18n/zh-CN.ts +26 -6
- package/corpus/templates/clips/app/i18n/zh-TW.ts +25 -6
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +73 -0
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -0
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -2
- package/corpus/templates/clips/changelog/2026-07-07-ai-tools-can-include-the-full-video-not-just-the-transcript-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-clips-desktop-now-surfaces-meetings-and-dictate-directly-in-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-notes-now-explain-exactly-how-to-start-granola-style.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-meeting-start-alerts-now-include-separate-start-notes-and-jo.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-07-recordings-start-more-predictably-and-newly-saved-clips-refr.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
- package/corpus/templates/clips/desktop/src/app.tsx +435 -105
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +27 -21
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -22
- package/corpus/templates/clips/desktop/src/styles.css +167 -2
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -7
- package/corpus/templates/clips/desktop/src-tauri/src/tray_meetings.rs +5 -4
- package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +16 -8
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +81 -0
- package/corpus/templates/content/AGENTS.md +1 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +73 -8
- package/corpus/templates/content/actions/_database-utils.ts +2 -1
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +20 -1
- package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +663 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +33 -7
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +53 -4
- package/corpus/templates/content/app/components/editor/database/settings.tsx +24 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +70 -1
- package/corpus/templates/content/app/hooks/use-document-properties.ts +63 -5
- package/corpus/templates/content/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/content/app/i18n-data.ts +31 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-source-rows-can-be-staged-in-bulk-with-a-reviewable.md +6 -0
- package/corpus/templates/content/changelog/2026-07-07-builder-backed-database-fields-now-edit-like-normal-content-fields.md +6 -0
- package/corpus/templates/content/parity/matrix.md +24 -24
- package/corpus/templates/content/parity/matrix.ts +2 -0
- package/corpus/templates/content/shared/api.ts +59 -4
- package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +16 -1
- package/corpus/templates/design/actions/add-localhost-screens.ts +1 -0
- package/corpus/templates/design/actions/connect-localhost.ts +26 -3
- package/corpus/templates/design/actions/open-visual-edit.ts +4 -37
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +362 -12
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +89 -14
- package/corpus/templates/design/app/components/design/bridge-security.ts +7 -1
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +1 -1
- package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +41 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-keeps-bridge-access-when-opening-previousl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-now-keeps-the-live-app-connection-authenti.md +6 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-uses-live-app-iframes-for-click-to-edit-pr.md +6 -0
- package/dist/agent/durable-background.d.ts +12 -12
- package/dist/agent/durable-background.js +18 -18
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +8 -2
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +11 -1
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/index.d.ts +1 -1
- package/dist/agent/engine/index.d.ts.map +1 -1
- package/dist/agent/engine/index.js +1 -1
- package/dist/agent/engine/index.js.map +1 -1
- package/dist/agent/engine/registry.d.ts +14 -0
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +56 -2
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts +2 -2
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +18 -11
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +7 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +6 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +15 -10
- package/dist/agent/run-store.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +31 -0
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +197 -1
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/index.js +76 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/workspacify.d.ts.map +1 -1
- package/dist/cli/workspacify.js +30 -0
- package/dist/cli/workspacify.js.map +1 -1
- package/dist/client/KeepTabOpenNotice.d.ts +9 -10
- package/dist/client/KeepTabOpenNotice.d.ts.map +1 -1
- package/dist/client/KeepTabOpenNotice.js +8 -4
- package/dist/client/KeepTabOpenNotice.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +14 -13
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +25 -17
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/history/VersionHistoryPanel.d.ts +1 -1
- package/dist/client/history/VersionHistoryPanel.d.ts.map +1 -1
- package/dist/client/history/VersionHistoryPanel.js +12 -5
- package/dist/client/history/VersionHistoryPanel.js.map +1 -1
- package/dist/client/history/index.d.ts +1 -1
- package/dist/client/history/index.d.ts.map +1 -1
- package/dist/client/history/index.js +1 -1
- package/dist/client/history/index.js.map +1 -1
- package/dist/client/history/use-history.d.ts +12 -0
- package/dist/client/history/use-history.d.ts.map +1 -1
- package/dist/client/history/use-history.js +6 -0
- package/dist/client/history/use-history.js.map +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/review/index.d.ts +1 -1
- package/dist/client/review/index.d.ts.map +1 -1
- package/dist/client/review/index.js +1 -1
- package/dist/client/review/index.js.map +1 -1
- package/dist/client/review/use-review.d.ts +23 -0
- package/dist/client/review/use-review.d.ts.map +1 -1
- package/dist/client/review/use-review.js +8 -0
- package/dist/client/review/use-review.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts +1 -1
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +6 -4
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/history/actions/create-resource-version.js +7 -4
- package/dist/history/actions/create-resource-version.js.map +1 -1
- package/dist/history/index.d.ts +1 -1
- package/dist/history/index.d.ts.map +1 -1
- package/dist/history/index.js +1 -1
- package/dist/history/index.js.map +1 -1
- package/dist/history/registry.d.ts.map +1 -1
- package/dist/history/registry.js +14 -12
- package/dist/history/registry.js.map +1 -1
- package/dist/history/store.d.ts.map +1 -1
- package/dist/history/store.js +74 -49
- package/dist/history/store.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/review/actions/consume-review-feedback.d.ts +1 -0
- package/dist/review/actions/consume-review-feedback.js +8 -2
- package/dist/review/actions/consume-review-feedback.js.map +1 -1
- package/dist/review/actions/delete-review-comment.d.ts +2 -1
- package/dist/review/actions/delete-review-comment.js +11 -3
- package/dist/review/actions/delete-review-comment.js.map +1 -1
- package/dist/review/actions/resolve-review-thread.d.ts +2 -1
- package/dist/review/actions/resolve-review-thread.js +5 -2
- package/dist/review/actions/resolve-review-thread.js.map +1 -1
- package/dist/review/index.d.ts +1 -1
- package/dist/review/index.d.ts.map +1 -1
- package/dist/review/index.js +1 -1
- package/dist/review/index.js.map +1 -1
- package/dist/review/registry.d.ts.map +1 -1
- package/dist/review/registry.js +14 -12
- package/dist/review/registry.js.map +1 -1
- package/dist/review/store.d.ts +3 -3
- package/dist/review/store.d.ts.map +1 -1
- package/dist/review/store.js +7 -4
- package/dist/review/store.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +5 -0
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/credential-provider.d.ts +2 -0
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +13 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/package.json +1 -1
package/bin/agent-native.js
CHANGED
|
@@ -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
|
-
|
|
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
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -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
|
-
|
|
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/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.90.
|
|
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-
|
|
344
|
-
*
|
|
345
|
-
* (`
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
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
|
|
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 === "
|
|
362
|
-
normalized === "
|
|
363
|
-
normalized === "
|
|
364
|
-
normalized === "
|
|
361
|
+
normalized === "0" ||
|
|
362
|
+
normalized === "false" ||
|
|
363
|
+
normalized === "no" ||
|
|
364
|
+
normalized === "off"
|
|
365
365
|
);
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/**
|
|
369
|
-
* Gate for the
|
|
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
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
|
|
388
|
-
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
-
|
|
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
|
|
4624
|
-
*
|
|
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
|
-
//
|
|
6193
|
-
// this specific run never having been routed to
|
|
6194
|
-
// worker. A run that WAS dispatched to background
|
|
6195
|
-
// already has its recovery owned by the background
|
|
6196
|
-
// `isBackgroundWorker` chain above — this flag must never
|
|
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
|
|
6306
|
-
//
|
|
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(
|
|
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
|
|
484
|
-
|
|
485
|
-
|
|
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 (
|
|
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, "
|
|
187
|
-
//
|
|
188
|
-
// for
|
|
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, "
|
|
277
|
-
//
|
|
278
|
-
// for
|
|
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
|
|
460
|
-
*
|
|
461
|
-
* "background
|
|
462
|
-
*
|
|
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;
|