@agent-native/core 0.0.0-beta-20260820010957 → 0.0.0-beta-20260820052446
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/dist/client/EnvironmentBadge.d.ts +1 -2
- package/dist/client/EnvironmentBadge.js +2 -3
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/deploy/build.d.ts +7 -0
- package/dist/deploy/build.js +51 -0
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/server/onboarding-html.js +29 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/environment-lanes.d.ts +1 -0
- package/dist/shared/environment-lanes.js +1 -0
- package/docs/content/agent-native-config.mdx +45 -1
- package/docs/content/aws-lambda.mdx +36 -0
- package/docs/content/azure-static-web-apps.mdx +36 -0
- package/docs/content/cloudflare.mdx +1 -1
- package/docs/content/deno-deploy.mdx +36 -0
- package/docs/content/deploy-an-app.mdx +11 -5
- package/docs/content/deployment.mdx +36 -11
- package/docs/content/docker.mdx +63 -0
- package/docs/content/koyeb.mdx +36 -0
- package/docs/content/netlify.mdx +1 -1
- package/docs/content/node-docker.mdx +14 -127
- package/docs/content/node-js.mdx +56 -0
- package/docs/content/other-platforms.mdx +12 -18
- package/docs/content/render.mdx +35 -0
- package/docs/content/vercel.mdx +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AgentNativeDeploymentEnvironment, AgentNativeConfig } from "../config.js";
|
|
2
|
-
export
|
|
3
|
-
export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, type EnvironmentBadgeTargets, } from "../shared/environment-lanes.js";
|
|
2
|
+
export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAGE_KEY, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, type EnvironmentBadgeTargets, } from "../shared/environment-lanes.js";
|
|
4
3
|
export declare function isBuilderIoEmployee(email: string | null | undefined): boolean;
|
|
5
4
|
export declare function resolveEnvironmentChannel(config: AgentNativeConfig, hostname: string | undefined): Extract<AgentNativeDeploymentEnvironment, "beta" | "production"> | null;
|
|
6
5
|
export declare function isBetaOptOutActive(value: string | number | null | undefined, now?: number): boolean;
|
|
@@ -2,12 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from "@agent-native/toolkit/ui/button";
|
|
3
3
|
import { Popover, PopoverContent, PopoverTrigger, } from "@agent-native/toolkit/ui/popover";
|
|
4
4
|
import { useEffect, useMemo, useRef } from "react";
|
|
5
|
-
import { BETA_OPT_OUT_QUERY_PARAM, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, } from "../shared/environment-lanes.js";
|
|
5
|
+
import { BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAGE_KEY, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, } from "../shared/environment-lanes.js";
|
|
6
6
|
import { trackEvent } from "./analytics.js";
|
|
7
7
|
import { injectedAgentNativeConfig } from "./app-config.js";
|
|
8
8
|
import { useSession } from "./use-session.js";
|
|
9
|
-
export
|
|
10
|
-
export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, } from "../shared/environment-lanes.js";
|
|
9
|
+
export { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAGE_KEY, buildEnvironmentOptOutUrl, buildEnvironmentUrl, resolveEnvironmentTargets, } from "../shared/environment-lanes.js";
|
|
11
10
|
export function isBuilderIoEmployee(email) {
|
|
12
11
|
return email?.trim().toLowerCase().endsWith("@builder.io") ?? false;
|
|
13
12
|
}
|
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
-
error?: undefined;
|
|
66
65
|
states: {
|
|
67
66
|
clientId: number;
|
|
68
67
|
state: string;
|
|
69
68
|
}[];
|
|
69
|
+
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
-
error?: undefined;
|
|
81
80
|
users: {
|
|
82
81
|
clientId: number;
|
|
83
82
|
lastSeen: number;
|
|
84
83
|
}[];
|
|
84
|
+
error?: undefined;
|
|
85
85
|
}>>;
|
package/dist/deploy/build.d.ts
CHANGED
|
@@ -224,6 +224,13 @@ export declare function emitSingleTemplateNetlifyBackgroundFunction(projectCwd:
|
|
|
224
224
|
*/
|
|
225
225
|
export declare function assertEmittedBackgroundFunctionOnDisk(destDir: string, functionName: string): void;
|
|
226
226
|
export declare function emitSingleTemplateNetlifyIntegrationRecoveryFunction(projectCwd: string): void;
|
|
227
|
+
/**
|
|
228
|
+
* A host-side prebuilt Netlify output can accidentally carry the native
|
|
229
|
+
* better-sqlite3 binary from the developer's machine. Netlify functions run
|
|
230
|
+
* on Linux, so fail before publication unless every copied binary is an ELF
|
|
231
|
+
* object produced by the Linux build.
|
|
232
|
+
*/
|
|
233
|
+
export declare function findNonLinuxBetterSqlite3Binaries(serverDir: string): string[];
|
|
227
234
|
/**
|
|
228
235
|
* Nitro receives the React Router SSR build as prebuilt chunks, so its normal
|
|
229
236
|
* dependency resolver cannot reliably fold the preserved bare `yjs` imports
|
package/dist/deploy/build.js
CHANGED
|
@@ -2996,6 +2996,51 @@ function walkServerJavaScriptFiles(dir, onFile) {
|
|
|
2996
2996
|
onFile(entryPath);
|
|
2997
2997
|
}
|
|
2998
2998
|
}
|
|
2999
|
+
/**
|
|
3000
|
+
* A host-side prebuilt Netlify output can accidentally carry the native
|
|
3001
|
+
* better-sqlite3 binary from the developer's machine. Netlify functions run
|
|
3002
|
+
* on Linux, so fail before publication unless every copied binary is an ELF
|
|
3003
|
+
* object produced by the Linux build.
|
|
3004
|
+
*/
|
|
3005
|
+
export function findNonLinuxBetterSqlite3Binaries(serverDir) {
|
|
3006
|
+
const failures = [];
|
|
3007
|
+
const walk = (dir) => {
|
|
3008
|
+
if (!fs.existsSync(dir))
|
|
3009
|
+
return;
|
|
3010
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
3011
|
+
const entryPath = path.join(dir, entry.name);
|
|
3012
|
+
if (entry.isDirectory()) {
|
|
3013
|
+
walk(entryPath);
|
|
3014
|
+
continue;
|
|
3015
|
+
}
|
|
3016
|
+
if (entry.name !== "better_sqlite3.node")
|
|
3017
|
+
continue;
|
|
3018
|
+
const normalizedPath = entryPath.split(path.sep).join("/");
|
|
3019
|
+
if (!normalizedPath.includes("/node_modules/better-sqlite3/build/Release/better_sqlite3.node")) {
|
|
3020
|
+
continue;
|
|
3021
|
+
}
|
|
3022
|
+
const header = fs.readFileSync(entryPath).subarray(0, 20);
|
|
3023
|
+
const isLittleEndian = header[5] === 1;
|
|
3024
|
+
const machine = header.length >= 20 && header[5] === 1
|
|
3025
|
+
? header.readUInt16LE(18)
|
|
3026
|
+
: header.length >= 20 && header[5] === 2
|
|
3027
|
+
? header.readUInt16BE(18)
|
|
3028
|
+
: null;
|
|
3029
|
+
if (header.length < 20 ||
|
|
3030
|
+
header[0] !== 0x7f ||
|
|
3031
|
+
header[1] !== 0x45 ||
|
|
3032
|
+
header[2] !== 0x4c ||
|
|
3033
|
+
header[3] !== 0x46 ||
|
|
3034
|
+
header[4] !== 2 ||
|
|
3035
|
+
!isLittleEndian ||
|
|
3036
|
+
machine !== 62) {
|
|
3037
|
+
failures.push(entryPath);
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
};
|
|
3041
|
+
walk(serverDir);
|
|
3042
|
+
return failures;
|
|
3043
|
+
}
|
|
2999
3044
|
/**
|
|
3000
3045
|
* Nitro receives the React Router SSR build as prebuilt chunks, so its normal
|
|
3001
3046
|
* dependency resolver cannot reliably fold the preserved bare `yjs` imports
|
|
@@ -3242,6 +3287,12 @@ export function assertSingleTemplateNetlifyBuildOutput(projectCwd) {
|
|
|
3242
3287
|
if (privateYjsImports.length > 0) {
|
|
3243
3288
|
failures.push(`Netlify server bundle imports Nitro's internal tree-shaken _libs/yjs.mjs: ${privateYjsImports.join(", ")}`);
|
|
3244
3289
|
}
|
|
3290
|
+
const nonLinuxBetterSqlite3Binaries = findNonLinuxBetterSqlite3Binaries(serverDir);
|
|
3291
|
+
if (nonLinuxBetterSqlite3Binaries.length > 0) {
|
|
3292
|
+
failures.push(`Netlify server bundle contains non-Linux better-sqlite3 native binaries: ${nonLinuxBetterSqlite3Binaries
|
|
3293
|
+
.map((filePath) => path.relative(projectCwd, filePath))
|
|
3294
|
+
.join(", ")}; build in Netlify's Linux environment instead of uploading a host-native prebuilt output`);
|
|
3295
|
+
}
|
|
3245
3296
|
// React Router's filesystem route discovery can accidentally treat a
|
|
3246
3297
|
// co-located *.test.ts route as production code. That bundles Vitest into
|
|
3247
3298
|
// SSR and only fails when the first request executes the test helpers.
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
* DELETE /_agent-native/notifications/:id — delete
|
|
12
12
|
*/
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
|
-
error?: undefined;
|
|
15
14
|
count: number;
|
|
16
15
|
updated?: undefined;
|
|
16
|
+
error?: undefined;
|
|
17
17
|
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
|
-
error?: undefined;
|
|
20
19
|
count?: undefined;
|
|
21
20
|
updated: number;
|
|
21
|
+
error?: undefined;
|
|
22
22
|
ok?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
count?: undefined;
|
|
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
error: string;
|
|
27
27
|
ok?: undefined;
|
|
28
28
|
} | {
|
|
29
|
-
error?: undefined;
|
|
30
29
|
count?: undefined;
|
|
31
30
|
updated?: undefined;
|
|
31
|
+
error?: undefined;
|
|
32
32
|
ok: boolean;
|
|
33
33
|
}>>;
|
|
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
+
error?: undefined;
|
|
45
|
+
ok?: undefined;
|
|
44
46
|
summary: import("./types.js").TraceSummary;
|
|
45
47
|
spans: import("./types.js").TraceSpan[];
|
|
46
48
|
id?: undefined;
|
|
49
|
+
} | {
|
|
47
50
|
error?: undefined;
|
|
48
51
|
ok?: undefined;
|
|
49
|
-
} | {
|
|
50
52
|
summary?: undefined;
|
|
51
53
|
spans?: undefined;
|
|
52
54
|
id: string;
|
|
53
|
-
error?: undefined;
|
|
54
|
-
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
|
+
ok?: undefined;
|
|
56
57
|
summary?: undefined;
|
|
57
58
|
spans?: undefined;
|
|
58
59
|
id?: undefined;
|
|
59
60
|
error: any;
|
|
60
|
-
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
|
+
error?: undefined;
|
|
62
63
|
summary?: undefined;
|
|
63
64
|
spans?: undefined;
|
|
64
65
|
id?: undefined;
|
|
65
|
-
error?: undefined;
|
|
66
66
|
ok: boolean;
|
|
67
67
|
}>>;
|
|
@@ -11,7 +11,7 @@ import { getLocaleInitScript } from "../localization/server.js";
|
|
|
11
11
|
import { DEFAULT_LOCALE, LOCALE_METADATA, LOCALE_STORAGE_KEY, SUPPORTED_LOCALES, localeDisplayName, } from "../localization/shared.js";
|
|
12
12
|
import { NATIVE_AUTH_COPY } from "../shared/auth-copy.js";
|
|
13
13
|
import { docsUrl } from "../shared/docs-url.js";
|
|
14
|
-
import { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, ENVIRONMENT_BETA_HOSTS, } from "../shared/environment-lanes.js";
|
|
14
|
+
import { BETA_OPT_OUT_DURATION_MS, BETA_OPT_OUT_QUERY_PARAM, BETA_OPT_OUT_STORAGE_KEY, ENVIRONMENT_BETA_HOSTS, } from "../shared/environment-lanes.js";
|
|
15
15
|
import { PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, } from "../shared/password-policy.js";
|
|
16
16
|
import { signInJourneyInlineScript } from "../shared/sign-in-journey.js";
|
|
17
17
|
import { AGENT_NATIVE_SOCIAL_IMAGE_ALT, AGENT_NATIVE_SOCIAL_IMAGE_HEIGHT, AGENT_NATIVE_SOCIAL_IMAGE_PATH, AGENT_NATIVE_SOCIAL_IMAGE_TYPE, AGENT_NATIVE_SOCIAL_IMAGE_WIDTH, withAgentNativeSocialImageCacheBuster, } from "../shared/social-meta.js";
|
|
@@ -1433,6 +1433,34 @@ ${marketing.description ? ` <p class="app-desc" data-marketing-field="descr
|
|
|
1433
1433
|
if (!switcher || !button || !popover || !productionLink) return;
|
|
1434
1434
|
if (window.parent !== window) return;
|
|
1435
1435
|
|
|
1436
|
+
// Persist the beta opt-out before authentication replaces this cached shell.
|
|
1437
|
+
try {
|
|
1438
|
+
var optOutUrl = new URL(window.location.href);
|
|
1439
|
+
var optOutValue = optOutUrl.searchParams.get(${JSON.stringify(BETA_OPT_OUT_QUERY_PARAM)});
|
|
1440
|
+
if (optOutValue !== null) {
|
|
1441
|
+
var optOutExpiry = Number(optOutValue);
|
|
1442
|
+
var optOutIsActive = Number.isFinite(optOutExpiry) && optOutExpiry > Date.now();
|
|
1443
|
+
var optOutStorageReady = false;
|
|
1444
|
+
try {
|
|
1445
|
+
if (optOutIsActive) {
|
|
1446
|
+
window.localStorage.setItem(
|
|
1447
|
+
${JSON.stringify(BETA_OPT_OUT_STORAGE_KEY)},
|
|
1448
|
+
String(optOutExpiry),
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
optOutStorageReady = true;
|
|
1452
|
+
} catch (error) {
|
|
1453
|
+
void error;
|
|
1454
|
+
}
|
|
1455
|
+
if (optOutStorageReady) {
|
|
1456
|
+
optOutUrl.searchParams.delete(${JSON.stringify(BETA_OPT_OUT_QUERY_PARAM)});
|
|
1457
|
+
window.history.replaceState(null, '', optOutUrl.toString());
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
} catch (error) {
|
|
1461
|
+
void error;
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1436
1464
|
var betaHosts = ${JSON.stringify(ENVIRONMENT_BETA_HOSTS)};
|
|
1437
1465
|
var hostname = (window.location.hostname || '').toLowerCase().replace(/\\.$/, '');
|
|
1438
1466
|
var productionHost = hostname.indexOf('beta.') === 0 ? hostname.slice(5) : '';
|
|
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
error?: undefined;
|
|
29
30
|
token: string;
|
|
30
31
|
expiresAt: string;
|
|
31
32
|
ttlSeconds: number;
|
|
32
|
-
error?: undefined;
|
|
33
33
|
}>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const BETA_OPT_OUT_QUERY_PARAM = "agentNativeBetaOptOut";
|
|
2
2
|
export declare const BETA_OPT_OUT_DURATION_MS: number;
|
|
3
|
+
export declare const BETA_OPT_OUT_STORAGE_KEY = "agent-native:beta-opt-out-until";
|
|
3
4
|
export declare const ENVIRONMENT_BETA_HOSTS: {
|
|
4
5
|
readonly "agent-workspace.builder.io": "beta.agent-workspace.builder.io";
|
|
5
6
|
readonly "analytics.agent-native.com": "beta.analytics.agent-native.com";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const BETA_OPT_OUT_QUERY_PARAM = "agentNativeBetaOptOut";
|
|
2
2
|
export const BETA_OPT_OUT_DURATION_MS = 24 * 60 * 60 * 1000;
|
|
3
|
+
export const BETA_OPT_OUT_STORAGE_KEY = "agent-native:beta-opt-out-until";
|
|
3
4
|
export const ENVIRONMENT_BETA_HOSTS = {
|
|
4
5
|
"agent-workspace.builder.io": "beta.agent-workspace.builder.io",
|
|
5
6
|
"analytics.agent-native.com": "beta.analytics.agent-native.com",
|
|
@@ -16,6 +16,12 @@ The resolved configuration is serialized into the browser bundle. Treat every
|
|
|
16
16
|
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
|
+
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.
|
|
24
|
+
|
|
19
25
|
## File location and loading
|
|
20
26
|
|
|
21
27
|
Put one configuration file at the app root, alongside `package.json` and the
|
|
@@ -77,7 +83,7 @@ recommended form.
|
|
|
77
83
|
|
|
78
84
|
## Supported options
|
|
79
85
|
|
|
80
|
-
These are the
|
|
86
|
+
These are the shared options read from the typed config and the shared
|
|
81
87
|
configuration portion of `agent-native.json`:
|
|
82
88
|
|
|
83
89
|
| Option | Type | Effect |
|
|
@@ -87,9 +93,47 @@ configuration portion of `agent-native.json`:
|
|
|
87
93
|
| `runtime.auth.enabled` | `boolean` | Declares whether the app expects the framework or a custom authentication layer. |
|
|
88
94
|
| `runtime.database.required` | `boolean` | Declares whether production needs a persistent remote SQL database. |
|
|
89
95
|
| `runtime.environment.required` | `string[]` | Declares additional required environment variable names. Names must match `[A-Za-z_][A-Za-z0-9_]*`; values do not belong in the config. |
|
|
96
|
+
| `deployment.environment` | `"local"`, `"beta"`, `"production"`, or `"preview"` | Records the release lane that produced the current client bundle. |
|
|
90
97
|
| `diagnostics.failOnBuild` | `boolean` | When `true`, a production Vite build throws on runtime configuration issues. When absent or `false`, it reports them without failing the build. |
|
|
91
98
|
| `instructions.runtime` | `string` | Optional relative Markdown path for the in-app runtime agent. Defaults to `AGENTS.md`. |
|
|
92
99
|
| `instructions.development` | `string` | Optional relative Markdown path for development/coding agents. Defaults to `AGENTS.md`. |
|
|
100
|
+
| `translations.locales` | `string[]` | Lists the locales the app intentionally ships. `en-US` remains the source locale. |
|
|
101
|
+
| `changelog.enabled` | `boolean` | Enables the app changelog workflow and lets agents create user-facing entries. |
|
|
102
|
+
| `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
|
+
|
|
104
|
+
## Configuration vs environment variables
|
|
105
|
+
|
|
106
|
+
Use the config file or JSON manifest for stable, non-secret application
|
|
107
|
+
defaults. Use environment variables or the scoped secret store for values that
|
|
108
|
+
belong to a deployment or a user or organization connection:
|
|
109
|
+
|
|
110
|
+
| Put it in | Examples | Notes |
|
|
111
|
+
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
112
|
+
| `agent-native.config.ts` or the shared section of `agent-native.json` | onboarding mode, required runtime contracts, release lane, shipped locales, changelog, hosted harness capabilities | Committed app policy. It is resolved during the Vite config phase and can use `command`, `mode`, `isDev`, and `isBuild`. |
|
|
113
|
+
| Deployment environment variables | `DATABASE_URL`, `BETTER_AUTH_SECRET`, `APP_URL`, `NITRO_PRESET`, provider keys, host-specific toggles | Set by the deployment platform or local `.env`. Keep secret values out of source control. See [Environment Variables](/docs/environment-variables). |
|
|
114
|
+
| `runtime.environment.required` | `"PUBLIC_API_ORIGIN"`, `"STRIPE_PUBLISHABLE_KEY"` | A declaration of names the production readiness check must find. It does not set, expose, or replace the values. |
|
|
115
|
+
|
|
116
|
+
For example, keep the app's public policy in the config file and inject the
|
|
117
|
+
actual deployment values separately:
|
|
118
|
+
|
|
119
|
+
```ts filename="agent-native.config.ts"
|
|
120
|
+
import { defineAgentNativeConfig } from "@agent-native/core/config";
|
|
121
|
+
|
|
122
|
+
export default defineAgentNativeConfig({
|
|
123
|
+
deployment: { environment: "production" },
|
|
124
|
+
translations: { locales: ["en-US", "es-ES"] },
|
|
125
|
+
changelog: { enabled: true },
|
|
126
|
+
harness: { runtimes: ["codex"] },
|
|
127
|
+
runtime: {
|
|
128
|
+
database: { required: true },
|
|
129
|
+
environment: { required: ["PUBLIC_API_ORIGIN"] },
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Set `DATABASE_URL`, `BETTER_AUTH_SECRET`, and `PUBLIC_API_ORIGIN` in the
|
|
135
|
+
hosting provider or scoped secret store. The config file declares the policy;
|
|
136
|
+
the deployment supplies the values.
|
|
93
137
|
|
|
94
138
|
### Separate runtime and development instructions
|
|
95
139
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "AWS Lambda"
|
|
3
|
+
description: "Deploy an Agent-Native app to AWS Lambda with Nitro's aws-lambda preset."
|
|
4
|
+
search: "AWS Lambda deployment Nitro preset serverless"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AWS Lambda
|
|
8
|
+
|
|
9
|
+
Use Nitro's `aws-lambda` preset to build a Lambda-compatible server bundle.
|
|
10
|
+
The Lambda filesystem is temporary, so store application data in a persistent
|
|
11
|
+
SQL provider.
|
|
12
|
+
|
|
13
|
+
```ts filename="vite.config.ts"
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [agentNative({ nitro: { preset: "aws-lambda" } })],
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build the function bundle:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @agent-native/core@latest build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Publish the generated output with AWS SAM, CDK, Serverless Framework, or the
|
|
26
|
+
AWS console. Configure `DATABASE_URL`, `BETTER_AUTH_SECRET`, and any app
|
|
27
|
+
secrets in Lambda environment variables or AWS Secrets Manager.
|
|
28
|
+
|
|
29
|
+
See [Nitro's AWS Lambda provider guide](https://nitro.build/deploy/providers/aws)
|
|
30
|
+
for provider-specific packaging and streaming options.
|
|
31
|
+
|
|
32
|
+
## What's next
|
|
33
|
+
|
|
34
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
35
|
+
- [**Deployment environment variables**](/docs/deployment-environment-variables) - production configuration
|
|
36
|
+
- [**Deno Deploy**](/docs/deno-deploy) - another serverless runtime
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Azure Static Web Apps"
|
|
3
|
+
description: "Deploy an Agent-Native app to Azure Static Web Apps with Nitro's azure-swa preset."
|
|
4
|
+
search: "Azure Static Web Apps deployment Nitro preset"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Azure Static Web Apps
|
|
8
|
+
|
|
9
|
+
Nitro provides the `azure-swa` preset for Azure Static Web Apps. It packages
|
|
10
|
+
the public assets and server routes for the provider's static and API hosting
|
|
11
|
+
model.
|
|
12
|
+
|
|
13
|
+
```ts filename="vite.config.ts"
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [agentNative({ nitro: { preset: "azure-swa" } })],
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build the provider output:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @agent-native/core@latest build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Deploy the generated output with the Azure Static Web Apps CLI or your CI
|
|
26
|
+
workflow. Use a persistent external SQL database and configure
|
|
27
|
+
`DATABASE_URL`, `BETTER_AUTH_SECRET`, and app secrets in the Azure environment.
|
|
28
|
+
|
|
29
|
+
See [Nitro's Azure provider guide](https://nitro.build/deploy/providers/azure)
|
|
30
|
+
for the current provider workflow.
|
|
31
|
+
|
|
32
|
+
## What's next
|
|
33
|
+
|
|
34
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
35
|
+
- [**Deployment environment variables**](/docs/deployment-environment-variables) - production configuration
|
|
36
|
+
- [**Koyeb**](/docs/koyeb) - a managed Node.js target
|
|
@@ -40,4 +40,4 @@ before deploying. A Worker filesystem is not a persistent application store.
|
|
|
40
40
|
|
|
41
41
|
- [**Deployment**](/docs/deployment) — pick a persistent database and a preset before your first production deploy
|
|
42
42
|
- [**Workspace Deployment**](/docs/workspace-deployment) — Cloudflare Pages is the default preset for the unified `deploy` command
|
|
43
|
-
- [**Node.js
|
|
43
|
+
- [**Node.js**](/docs/node-js), [**Docker**](/docs/docker), [**Vercel**](/docs/vercel), [**Netlify**](/docs/netlify), [**AWS Lambda**](/docs/aws-lambda), and [**Deno Deploy**](/docs/deno-deploy) — the other Nitro presets
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Deno Deploy"
|
|
3
|
+
description: "Deploy an Agent-Native app to Deno Deploy with Nitro's deno-deploy preset."
|
|
4
|
+
search: "Deno Deploy deployment Nitro preset serverless"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Deno Deploy
|
|
8
|
+
|
|
9
|
+
Use Nitro's `deno-deploy` preset to generate a Deno-compatible server output.
|
|
10
|
+
Keep application data in a persistent SQL provider because a deployment
|
|
11
|
+
filesystem is not durable application storage.
|
|
12
|
+
|
|
13
|
+
```ts filename="vite.config.ts"
|
|
14
|
+
export default defineConfig({
|
|
15
|
+
plugins: [agentNative({ nitro: { preset: "deno-deploy" } })],
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Build the deployment output:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @agent-native/core@latest build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Publish the generated output with Deno Deploy's current CLI or dashboard.
|
|
26
|
+
Configure `DATABASE_URL`, `BETTER_AUTH_SECRET`, and any app secrets in the
|
|
27
|
+
deployment environment.
|
|
28
|
+
|
|
29
|
+
See [Nitro's Deno Deploy provider guide](https://nitro.build/deploy/providers/deno-deploy)
|
|
30
|
+
for the current provider workflow.
|
|
31
|
+
|
|
32
|
+
## What's next
|
|
33
|
+
|
|
34
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
35
|
+
- [**Deployment environment variables**](/docs/deployment-environment-variables) - production configuration
|
|
36
|
+
- [**AWS Lambda**](/docs/aws-lambda) - another serverless runtime
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Deploy an app"
|
|
3
3
|
description: "Build and deploy one Agent-Native app to Node.js, Vercel, Netlify, Cloudflare, AWS, or Deno."
|
|
4
|
-
search: "deploy app standalone build Nitro preset Node.js Vercel Netlify Cloudflare AWS Deno"
|
|
4
|
+
search: "deploy app standalone build Nitro preset Node.js Docker Vercel Netlify Cloudflare AWS Lambda Deno Deploy Azure Koyeb Render"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Deploy an app
|
|
@@ -38,11 +38,17 @@ export default defineConfig({
|
|
|
38
38
|
|
|
39
39
|
See the target page for the provider command and runtime details:
|
|
40
40
|
|
|
41
|
-
- [**Node.js
|
|
41
|
+
- [**Node.js**](/docs/node-js)
|
|
42
|
+
- [**Docker**](/docs/docker)
|
|
42
43
|
- [**Vercel**](/docs/vercel)
|
|
43
44
|
- [**Netlify**](/docs/netlify)
|
|
44
|
-
- [**Cloudflare**](/docs/cloudflare)
|
|
45
|
-
- [**
|
|
45
|
+
- [**Cloudflare Pages**](/docs/cloudflare#cloudflare-pages)
|
|
46
|
+
- [**Cloudflare Workers**](/docs/cloudflare#cloudflare-workers)
|
|
47
|
+
- [**AWS Lambda**](/docs/aws-lambda)
|
|
48
|
+
- [**Deno Deploy**](/docs/deno-deploy)
|
|
49
|
+
- [**Azure Static Web Apps**](/docs/azure-static-web-apps)
|
|
50
|
+
- [**Koyeb**](/docs/koyeb)
|
|
51
|
+
- [**Render**](/docs/render)
|
|
46
52
|
|
|
47
53
|
### Build the app
|
|
48
54
|
|
|
@@ -59,7 +65,7 @@ node .output/server/index.mjs
|
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
For a local production-shaped check with Postgres and Docker, follow the
|
|
62
|
-
[
|
|
68
|
+
[Docker quickstart](/docs/docker#self-host-quickstart).
|
|
63
69
|
|
|
64
70
|
### Configure the deployment
|
|
65
71
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Deployment"
|
|
3
3
|
description: "Deploy an Agent-Native app or workspace to a Nitro-compatible platform with a persistent SQL database."
|
|
4
|
-
search: "deployment deploy app workspace hosting database Nitro Vercel Netlify Cloudflare
|
|
4
|
+
search: "deployment deploy app workspace hosting database Nitro Node.js Docker Vercel Netlify Cloudflare AWS Lambda Deno Deploy Azure Static Web Apps Koyeb Render"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Deployment
|
|
@@ -65,14 +65,18 @@ In a workspace, every app inherits the root `DATABASE_URL` by default. Set
|
|
|
65
65
|
Set a Nitro preset for the target you choose. The app code and database
|
|
66
66
|
contract stay the same.
|
|
67
67
|
|
|
68
|
-
<Diagram id="doc-block-deployment-targets" title="Supported deployment targets" summary="Agent-Native apps can deploy to Node.js, Vercel, Netlify, Cloudflare, AWS Lambda,
|
|
68
|
+
<Diagram id="doc-block-deployment-targets" title="Supported deployment targets" summary="Agent-Native apps can deploy to Node.js, Docker, Vercel, Netlify, Cloudflare Pages, Cloudflare Workers, AWS Lambda, Deno Deploy, Azure Static Web Apps, Koyeb, and Render.">
|
|
69
69
|
|
|
70
70
|
```html
|
|
71
71
|
<div class="deployment-target-grid">
|
|
72
|
-
<a class="deployment-target" href="/docs/node-
|
|
72
|
+
<a class="deployment-target" href="/docs/node-js">
|
|
73
73
|
<span class="deployment-target-mark text-mark">N</span>
|
|
74
74
|
<strong>Node.js</strong>
|
|
75
75
|
</a>
|
|
76
|
+
<a class="deployment-target" href="/docs/docker">
|
|
77
|
+
<span class="deployment-target-mark text-mark">D</span>
|
|
78
|
+
<strong>Docker</strong>
|
|
79
|
+
</a>
|
|
76
80
|
<a class="deployment-target" href="/docs/vercel">
|
|
77
81
|
<span class="deployment-target-mark">
|
|
78
82
|
<img src="/integration-logos/vercel.svg" alt="" />
|
|
@@ -85,20 +89,38 @@ contract stay the same.
|
|
|
85
89
|
</span>
|
|
86
90
|
<strong>Netlify</strong>
|
|
87
91
|
</a>
|
|
88
|
-
<a class="deployment-target" href="/docs/cloudflare">
|
|
92
|
+
<a class="deployment-target" href="/docs/cloudflare#cloudflare-pages">
|
|
89
93
|
<span class="deployment-target-mark">
|
|
90
94
|
<img src="/integration-logos/cloudflare.svg" alt="" />
|
|
91
95
|
</span>
|
|
92
|
-
<strong>Cloudflare</strong>
|
|
96
|
+
<strong>Cloudflare Pages</strong>
|
|
93
97
|
</a>
|
|
94
|
-
<a class="deployment-target" href="/docs/
|
|
98
|
+
<a class="deployment-target" href="/docs/cloudflare#cloudflare-workers">
|
|
99
|
+
<span class="deployment-target-mark">
|
|
100
|
+
<img src="/integration-logos/cloudflare.svg" alt="" />
|
|
101
|
+
</span>
|
|
102
|
+
<strong>Cloudflare Workers</strong>
|
|
103
|
+
</a>
|
|
104
|
+
<a class="deployment-target" href="/docs/aws-lambda">
|
|
95
105
|
<span class="deployment-target-mark text-mark">AWS</span>
|
|
96
106
|
<strong>AWS Lambda</strong>
|
|
97
107
|
</a>
|
|
98
|
-
<a class="deployment-target" href="/docs/
|
|
108
|
+
<a class="deployment-target" href="/docs/deno-deploy">
|
|
99
109
|
<span class="deployment-target-mark text-mark">D</span>
|
|
100
110
|
<strong>Deno Deploy</strong>
|
|
101
111
|
</a>
|
|
112
|
+
<a class="deployment-target" href="/docs/azure-static-web-apps">
|
|
113
|
+
<span class="deployment-target-mark text-mark">A</span>
|
|
114
|
+
<strong>Azure Static Web Apps</strong>
|
|
115
|
+
</a>
|
|
116
|
+
<a class="deployment-target" href="/docs/koyeb">
|
|
117
|
+
<span class="deployment-target-mark text-mark">K</span>
|
|
118
|
+
<strong>Koyeb</strong>
|
|
119
|
+
</a>
|
|
120
|
+
<a class="deployment-target" href="/docs/render">
|
|
121
|
+
<span class="deployment-target-mark text-mark">R</span>
|
|
122
|
+
<strong>Render</strong>
|
|
123
|
+
</a>
|
|
102
124
|
</div>
|
|
103
125
|
```
|
|
104
126
|
|
|
@@ -154,9 +176,12 @@ contract stay the same.
|
|
|
154
176
|
Start with the path above. Use these pages when you need provider-specific
|
|
155
177
|
settings or production controls:
|
|
156
178
|
|
|
157
|
-
- [**Node.js
|
|
158
|
-
- [**
|
|
159
|
-
- [**
|
|
179
|
+
- [**Node.js**](/docs/node-js) - run the default Nitro server preset
|
|
180
|
+
- [**Docker**](/docs/docker) - package the Node.js server in a container
|
|
181
|
+
- [**Vercel**](/docs/vercel), [**Netlify**](/docs/netlify), [**Cloudflare Pages**](/docs/cloudflare#cloudflare-pages), and [**Cloudflare Workers**](/docs/cloudflare#cloudflare-workers) - configure hosted targets
|
|
182
|
+
- [**AWS Lambda**](/docs/aws-lambda) and [**Deno Deploy**](/docs/deno-deploy) - deploy to function and Deno runtimes
|
|
183
|
+
- [**Azure Static Web Apps**](/docs/azure-static-web-apps), [**Koyeb**](/docs/koyeb), and [**Render**](/docs/render) - use additional Nitro providers
|
|
184
|
+
- [Nitro's provider list](https://nitro.build/deploy/providers) - see the broader set of presets Nitro supports
|
|
160
185
|
- [**SSR Caching**](/docs/ssr-caching) - configure the public shell cache
|
|
161
186
|
- [**Deployment Environment Variables**](/docs/deployment-environment-variables) - production secrets, runtime flags, and workspace inheritance
|
|
162
187
|
- [**Production Agent Access**](/docs/actions-agent-tools) - control framework tools and code execution
|
|
@@ -166,7 +191,7 @@ settings or production controls:
|
|
|
166
191
|
<a id="skip-ensure-tables"></a>
|
|
167
192
|
|
|
168
193
|
For compatibility with older links, the local Docker quickstart now lives on
|
|
169
|
-
[
|
|
194
|
+
[Docker](/docs/docker#self-host-quickstart). Schema setup and
|
|
170
195
|
cold-start guidance live in the [deployment environment reference](/docs/deployment-environment-variables#skip-ensure-tables).
|
|
171
196
|
|
|
172
197
|
## What's next
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Docker"
|
|
3
|
+
description: "Package an Agent-Native Node.js server in a Docker image or local Compose stack."
|
|
4
|
+
search: "Docker container deployment Node.js Postgres Compose Nitro"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Docker
|
|
8
|
+
|
|
9
|
+
Docker is an optional packaging and self-hosting choice. It runs the
|
|
10
|
+
framework's Node.js server. You do not need Docker when deploying directly to
|
|
11
|
+
Node.js, Vercel, Netlify, Cloudflare, or another Nitro target.
|
|
12
|
+
|
|
13
|
+
## Local quickstart {#self-host-quickstart}
|
|
14
|
+
|
|
15
|
+
Create an app, install dependencies, and build the image:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @agent-native/core@latest create my-app --standalone --template chat
|
|
19
|
+
cd my-app
|
|
20
|
+
pnpm install
|
|
21
|
+
docker build -t my-agent-native-app .
|
|
22
|
+
docker run --rm -p 3000:3000 my-agent-native-app
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For a local Postgres-backed stack, use Docker Compose. The [self-hosted Chat
|
|
26
|
+
fixture](https://www.agent-native.com/examples/self-hosted-chat/docker-compose.yml)
|
|
27
|
+
includes the app and database services. It is for local development, not an
|
|
28
|
+
internet-facing production deployment.
|
|
29
|
+
|
|
30
|
+
## Production image
|
|
31
|
+
|
|
32
|
+
Use a persistent external database. Do not copy the local `data/` directory
|
|
33
|
+
into the image.
|
|
34
|
+
|
|
35
|
+
```dockerfile filename="Dockerfile"
|
|
36
|
+
FROM node:24-slim AS build
|
|
37
|
+
WORKDIR /app
|
|
38
|
+
COPY package.json pnpm-lock.yaml ./
|
|
39
|
+
RUN corepack enable && pnpm install --frozen-lockfile
|
|
40
|
+
COPY . .
|
|
41
|
+
RUN pnpm build
|
|
42
|
+
|
|
43
|
+
FROM node:24-slim
|
|
44
|
+
WORKDIR /app
|
|
45
|
+
COPY --from=build /app/.output .output
|
|
46
|
+
ENV NODE_ENV=production
|
|
47
|
+
ENV PORT=3000
|
|
48
|
+
EXPOSE 3000
|
|
49
|
+
CMD ["node", ".output/server/index.mjs"]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Set `DATABASE_URL`, `BETTER_AUTH_SECRET`, and any provider keys in the
|
|
53
|
+
container or host secret store. Configure HTTPS and OAuth callback URLs for
|
|
54
|
+
the public origin.
|
|
55
|
+
|
|
56
|
+
Self-hosting multiple apps with Docker Compose is covered in
|
|
57
|
+
[Workspace Deployment](/docs/workspace-deployment#workspace-docker-compose).
|
|
58
|
+
|
|
59
|
+
## What's next
|
|
60
|
+
|
|
61
|
+
- [**Node.js**](/docs/node-js) - the runtime behind this image
|
|
62
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
63
|
+
- [**Deployment**](/docs/deployment) - compare deployment targets
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Koyeb"
|
|
3
|
+
description: "Deploy an Agent-Native app to Koyeb with Nitro's koyeb preset."
|
|
4
|
+
search: "Koyeb deployment Nitro preset Node.js"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Koyeb
|
|
8
|
+
|
|
9
|
+
Use Nitro's `koyeb` preset to build an output for Koyeb's managed application
|
|
10
|
+
runtime.
|
|
11
|
+
|
|
12
|
+
```ts filename="vite.config.ts"
|
|
13
|
+
export default defineConfig({
|
|
14
|
+
plugins: [agentNative({ nitro: { preset: "koyeb" } })],
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Build the app and deploy the generated server with Koyeb's git or container
|
|
19
|
+
workflow:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @agent-native/core@latest build
|
|
23
|
+
node .output/server/index.mjs
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Set `DATABASE_URL`, `BETTER_AUTH_SECRET`, and any app secrets as Koyeb
|
|
27
|
+
environment variables. Use a persistent SQL database instead of local files.
|
|
28
|
+
|
|
29
|
+
See [Nitro's Koyeb provider guide](https://nitro.build/deploy/providers/koyeb)
|
|
30
|
+
for the current provider workflow.
|
|
31
|
+
|
|
32
|
+
## What's next
|
|
33
|
+
|
|
34
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
35
|
+
- [**Node.js**](/docs/node-js) - the default runtime
|
|
36
|
+
- [**Render**](/docs/render) - another managed Node.js target
|
package/docs/content/netlify.mdx
CHANGED
|
@@ -44,4 +44,4 @@ If you are on a free or otherwise quota-limited database tier, leave `AGENT_NATI
|
|
|
44
44
|
|
|
45
45
|
- [**Deployment**](/docs/deployment) — pick a persistent database and a preset before your first production deploy
|
|
46
46
|
- [**SSR Caching**](/docs/ssr-caching) — the default cache policy and Netlify's separate `netlify-cdn-cache-control` behavior
|
|
47
|
-
- [**Node.js
|
|
47
|
+
- [**Node.js**](/docs/node-js), [**Docker**](/docs/docker), [**Vercel**](/docs/vercel), [**Cloudflare**](/docs/cloudflare), [**AWS Lambda**](/docs/aws-lambda), and [**Deno Deploy**](/docs/deno-deploy) — the other Nitro presets
|
|
@@ -1,138 +1,25 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Node.js
|
|
3
|
-
description: "
|
|
2
|
+
title: "Node.js and Docker"
|
|
3
|
+
description: "Compatibility page for the former combined Node.js and Docker deployment guide."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Node.js
|
|
6
|
+
# Node.js and Docker
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
This URL is kept for older links. Node.js and Docker are separate deployment
|
|
9
|
+
choices, so use the individual guides:
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
- [**Node.js**](/docs/node-js) - run the default Nitro server preset
|
|
12
|
+
- [**Docker**](/docs/docker) - package the server in a container
|
|
13
|
+
- [**Workspace Deployment**](/docs/workspace-deployment#workspace-docker-compose) - run several apps with Docker Compose
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
<a id="self-host-quickstart"></a>
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
- **Operating an app?** Use the local Docker path below first. It exercises the same Node.js, Postgres, authentication, and environment-variable shape you will use on a small server.
|
|
17
|
+
The former local quickstart now lives in the [Docker guide](/docs/docker#self-host-quickstart).
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
<a id="nodejs"></a>
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
The former Node.js section now lives in the [Node.js guide](/docs/node-js).
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
npx @agent-native/core@latest create my-app --standalone --template chat
|
|
23
|
-
cd my-app
|
|
24
|
-
pnpm install
|
|
25
|
-
```
|
|
23
|
+
<a id="docker"></a>
|
|
26
24
|
|
|
27
|
-
The
|
|
28
|
-
|
|
29
|
-
### 2. Add the local Docker files
|
|
30
|
-
|
|
31
|
-
Create `Dockerfile`, `.dockerignore`, and `docker-compose.yml` in the app root. `docker compose up --build` needs the Dockerfile, and `.dockerignore` keeps host-only files such as `node_modules` out of the Linux build context. Compose starts Postgres only on the private Compose network.
|
|
32
|
-
|
|
33
|
-
You can also download the [Dockerfile](https://www.agent-native.com/examples/self-hosted-chat/Dockerfile), [.dockerignore](https://www.agent-native.com/examples/self-hosted-chat/.dockerignore), [Compose file](https://www.agent-native.com/examples/self-hosted-chat/docker-compose.yml), and [environment template](https://www.agent-native.com/examples/self-hosted-chat/env.example) as a starter fixture. The [Dockerfile](#docker) below matches the fixture.
|
|
34
|
-
|
|
35
|
-
```yaml filename="docker-compose.yml" maxLines=40
|
|
36
|
-
services:
|
|
37
|
-
app:
|
|
38
|
-
build: .
|
|
39
|
-
ports:
|
|
40
|
-
- "127.0.0.1:3000:3000"
|
|
41
|
-
environment:
|
|
42
|
-
DATABASE_URL: postgres://agent_native@postgres:5432/agent_native
|
|
43
|
-
BETTER_AUTH_SECRET: local-development-secret-change-me-1234567890
|
|
44
|
-
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
|
|
45
|
-
depends_on:
|
|
46
|
-
postgres:
|
|
47
|
-
condition: service_healthy
|
|
48
|
-
|
|
49
|
-
postgres:
|
|
50
|
-
image: postgres:18
|
|
51
|
-
environment:
|
|
52
|
-
POSTGRES_DB: agent_native
|
|
53
|
-
POSTGRES_USER: agent_native
|
|
54
|
-
POSTGRES_HOST_AUTH_METHOD: trust
|
|
55
|
-
volumes:
|
|
56
|
-
- postgres-data-v18:/var/lib/postgresql
|
|
57
|
-
healthcheck:
|
|
58
|
-
test: ["CMD-SHELL", "pg_isready -U agent_native -d agent_native"]
|
|
59
|
-
interval: 5s
|
|
60
|
-
timeout: 5s
|
|
61
|
-
retries: 10
|
|
62
|
-
|
|
63
|
-
volumes:
|
|
64
|
-
postgres-data-v18:
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
PostgreSQL 18 uses `/var/lib/postgresql` as its volume mount path, unlike PostgreSQL 17 and earlier. The versioned volume name keeps this fresh fixture separate from older local stacks. If you are upgrading an existing PostgreSQL 17 or earlier stack, back up and migrate its data before changing the image or mount path. Do not point this fixture at the old volume without a migration.
|
|
68
|
-
|
|
69
|
-
### 3. Run it
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
docker compose up --build
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
Open [http://localhost:3000](http://localhost:3000). The app infers its local auth origin from the browser request. Set `ANTHROPIC_API_KEY` in a local `.env` file if you want to use the embedded agent; leave it empty if you only want to verify that the app and database start. Stop the stack with `docker compose down`; add `-v` when you intentionally want to reset the local database.
|
|
76
|
-
|
|
77
|
-
Before putting this on the public internet, replace the example secret, configure HTTPS and OAuth callback URLs, use a persistent production database, and complete the [production environment checklist](/docs/deployment-environment-variables#env-required-prod).
|
|
78
|
-
|
|
79
|
-
## Node.js (Default) {#nodejs}
|
|
80
|
-
|
|
81
|
-
The default preset. Build and run:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
npx @agent-native/core@latest build
|
|
85
|
-
node .output/server/index.mjs
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Set `PORT` to configure the listen port (default: `3000`).
|
|
89
|
-
|
|
90
|
-
Use the current Node.js LTS line for production deploys. As of May 2026, that
|
|
91
|
-
is Node.js 24. Node.js 20 reached end-of-life on April 30, 2026 and no longer
|
|
92
|
-
receives upstream security updates.
|
|
93
|
-
|
|
94
|
-
## Docker {#docker}
|
|
95
|
-
|
|
96
|
-
This Dockerfile works for the standalone app created above. Run `pnpm install` before building so `pnpm-lock.yaml` exists in the build context. Keep the dependency manifest and lockfile in sync when you update the app.
|
|
97
|
-
|
|
98
|
-
```dockerfile filename="Dockerfile"
|
|
99
|
-
FROM node:24-slim AS build
|
|
100
|
-
WORKDIR /app
|
|
101
|
-
COPY package.json pnpm-lock.yaml ./
|
|
102
|
-
RUN corepack enable && pnpm install --frozen-lockfile
|
|
103
|
-
COPY . .
|
|
104
|
-
RUN pnpm build
|
|
105
|
-
|
|
106
|
-
FROM node:24-slim
|
|
107
|
-
WORKDIR /app
|
|
108
|
-
COPY --from=build /app/.output .output
|
|
109
|
-
# data/ is a runtime-created SQLite directory. Do not copy a dev DB into prod.
|
|
110
|
-
# For production, set DATABASE_URL to a hosted Postgres or Turso instance.
|
|
111
|
-
RUN mkdir -p /app/data
|
|
112
|
-
ENV NODE_ENV=production
|
|
113
|
-
ENV PORT=3000
|
|
114
|
-
EXPOSE 3000
|
|
115
|
-
CMD ["node", ".output/server/index.mjs"]
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Create `.dockerignore` alongside the Dockerfile:
|
|
119
|
-
|
|
120
|
-
```text filename=".dockerignore"
|
|
121
|
-
node_modules
|
|
122
|
-
.output
|
|
123
|
-
data
|
|
124
|
-
.env
|
|
125
|
-
.env.*
|
|
126
|
-
!.env.example
|
|
127
|
-
.git
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
Self-hosting a multi-app workspace with Docker Compose, built on this same
|
|
131
|
-
standalone Dockerfile, is covered in
|
|
132
|
-
[Workspace Deployment](/docs/workspace-deployment#workspace-docker-compose).
|
|
133
|
-
|
|
134
|
-
## What's next
|
|
135
|
-
|
|
136
|
-
- [**Deployment**](/docs/deployment) — pick a persistent database and a preset before your first production deploy
|
|
137
|
-
- [**Workspace Deployment**](/docs/workspace-deployment) — self-host a multi-app workspace with Docker Compose
|
|
138
|
-
- [**Vercel**](/docs/vercel), [**Netlify**](/docs/netlify), [**Cloudflare**](/docs/cloudflare), and [**Other Platforms**](/docs/other-platforms) — the other Nitro presets
|
|
25
|
+
The former Docker section now lives in the [Docker guide](/docs/docker).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Node.js"
|
|
3
|
+
description: "Deploy an Agent-Native app with Nitro's default Node.js server preset."
|
|
4
|
+
search: "Node.js deployment Nitro node server preset production"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Node.js
|
|
8
|
+
|
|
9
|
+
Node.js is the default Nitro target. Use it when you want to run the generated
|
|
10
|
+
server yourself on a VM, a managed Node host, or your own infrastructure.
|
|
11
|
+
|
|
12
|
+
<Steps>
|
|
13
|
+
|
|
14
|
+
### Build the app
|
|
15
|
+
|
|
16
|
+
Build the client and server output:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @agent-native/core@latest build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
You can make the target explicit in a build environment:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
NITRO_PRESET=node npx @agent-native/core@latest build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Start the server
|
|
29
|
+
|
|
30
|
+
Run the generated server with a supported Node.js LTS release:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
node .output/server/index.mjs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The server listens on port `3000` by default. Set `PORT` when your host assigns
|
|
37
|
+
a different port.
|
|
38
|
+
|
|
39
|
+
### Configure production
|
|
40
|
+
|
|
41
|
+
Use a persistent SQL database and set `DATABASE_URL` before the first
|
|
42
|
+
production start. Add a stable `BETTER_AUTH_SECRET` and the provider variables
|
|
43
|
+
your app uses. The [deployment environment reference](/docs/deployment-environment-variables)
|
|
44
|
+
covers the full production configuration.
|
|
45
|
+
|
|
46
|
+
</Steps>
|
|
47
|
+
|
|
48
|
+
Node.js is a runtime choice, not a requirement to use Docker. If you want a
|
|
49
|
+
container image, use the separate [Docker guide](/docs/docker).
|
|
50
|
+
|
|
51
|
+
## What's next
|
|
52
|
+
|
|
53
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
54
|
+
- [**Workspace Deployment**](/docs/workspace-deployment) - one origin for many apps
|
|
55
|
+
- [**Docker**](/docs/docker) - package this Node.js server in a container
|
|
56
|
+
- [**Deployment**](/docs/deployment) - compare targets and prerequisites
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "Other Platforms"
|
|
3
|
-
description: "
|
|
2
|
+
title: "Other Nitro Platforms"
|
|
3
|
+
description: "Compatibility page for deployment targets that were formerly grouped under Other Platforms."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Other Platforms
|
|
6
|
+
# Other Nitro Platforms
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
These targets now have individual pages. This URL is kept for older links.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
export default defineConfig({
|
|
12
|
-
plugins: [agentNative({ nitro: { preset: "aws_lambda" } })],
|
|
13
|
-
});
|
|
14
|
-
```
|
|
10
|
+
<a id="aws-lambda"></a>
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
- [**AWS Lambda**](/docs/aws-lambda)
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
export default defineConfig({
|
|
20
|
-
plugins: [agentNative({ nitro: { preset: "deno_deploy" } })],
|
|
21
|
-
});
|
|
22
|
-
```
|
|
14
|
+
<a id="deno-deploy"></a>
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
- [**Deno Deploy**](/docs/deno-deploy)
|
|
25
17
|
|
|
26
|
-
- [**
|
|
27
|
-
- [**
|
|
18
|
+
- [**Azure Static Web Apps**](/docs/azure-static-web-apps)
|
|
19
|
+
- [**Koyeb**](/docs/koyeb)
|
|
20
|
+
- [**Render**](/docs/render)
|
|
21
|
+
- [Nitro's provider list](https://nitro.build/deploy/providers)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Render"
|
|
3
|
+
description: "Deploy an Agent-Native app to Render with Nitro's render-com preset."
|
|
4
|
+
search: "Render deployment Nitro preset Node.js"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Render
|
|
8
|
+
|
|
9
|
+
Use Nitro's `render-com` preset to build an output for a Render web service.
|
|
10
|
+
|
|
11
|
+
```ts filename="vite.config.ts"
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
plugins: [agentNative({ nitro: { preset: "render-com" } })],
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Build the app and use Render's normal web service workflow to run the output:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @agent-native/core@latest build
|
|
21
|
+
node .output/server/index.mjs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Set `DATABASE_URL`, `BETTER_AUTH_SECRET`, and any app secrets in Render's
|
|
25
|
+
environment configuration. Use a persistent SQL database instead of local
|
|
26
|
+
files.
|
|
27
|
+
|
|
28
|
+
See [Nitro's Render provider guide](https://nitro.build/deploy/providers/render)
|
|
29
|
+
for the current provider workflow.
|
|
30
|
+
|
|
31
|
+
## What's next
|
|
32
|
+
|
|
33
|
+
- [**Deploy an app**](/docs/deploy-an-app) - the complete app path
|
|
34
|
+
- [**Node.js**](/docs/node-js) - the default runtime
|
|
35
|
+
- [**Koyeb**](/docs/koyeb) - another managed Node.js target
|
package/docs/content/vercel.mdx
CHANGED
|
@@ -35,4 +35,4 @@ The workspace build copies each app's Nitro `vercel` output into the root `.verc
|
|
|
35
35
|
|
|
36
36
|
- [**Deployment**](/docs/deployment) — pick a persistent database and a preset before your first production deploy
|
|
37
37
|
- [**Workspace Deployment**](/docs/workspace-deployment) — the `deploy --preset vercel` workspace build in full
|
|
38
|
-
- [**Node.js
|
|
38
|
+
- [**Node.js**](/docs/node-js), [**Docker**](/docs/docker), [**Netlify**](/docs/netlify), [**Cloudflare**](/docs/cloudflare), [**AWS Lambda**](/docs/aws-lambda), and [**Deno Deploy**](/docs/deno-deploy) — the other Nitro presets
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.0.0-beta-
|
|
3
|
+
"version": "0.0.0-beta-20260820052446",
|
|
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": {
|