@agent-native/core 0.164.11 → 0.164.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +84 -0
  3. package/corpus/templates/calendar/AGENTS.md +5 -0
  4. package/corpus/templates/calendar/actions/delete-event.ts +1 -1
  5. package/corpus/templates/calendar/actions/delete-events.ts +508 -0
  6. package/corpus/templates/calendar/actions/event-action-helpers.ts +1 -1
  7. package/corpus/templates/calendar/actions/list-events.ts +53 -0
  8. package/corpus/templates/calendar/changelog/2026-08-18-the-agent-can-now-remove-many-meetings-at-once-such-as-every.md +6 -0
  9. package/corpus/templates/calendar/server/lib/event-weekday.ts +112 -0
  10. package/corpus/templates/content/actions/_database-source-utils.ts +25 -2
  11. package/corpus/templates/content/actions/_database-utils.ts +2 -0
  12. package/corpus/templates/content/actions/_local-folder-source.ts +186 -2
  13. package/corpus/templates/content/actions/connect-local-folder-source.ts +23 -8
  14. package/corpus/templates/content/actions/disconnect-local-folder-source.ts +3 -3
  15. package/corpus/templates/content/actions/resolve-local-folder-conflict.ts +2 -2
  16. package/corpus/templates/content/actions/sync-local-folder-source.ts +130 -12
  17. package/corpus/templates/content/app/components/LocalFolderLiveSync.tsx +77 -0
  18. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +354 -8
  19. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +23 -1
  20. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +78 -1
  21. package/corpus/templates/content/app/components/editor/database/sidebar.tsx +36 -0
  22. package/corpus/templates/content/app/components/editor/local-source-write-state.ts +52 -0
  23. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +244 -6
  24. package/corpus/templates/content/app/components/sidebar/local-source-hierarchy.ts +189 -0
  25. package/corpus/templates/content/app/hooks/use-create-page.ts +26 -4
  26. package/corpus/templates/content/app/hooks/use-documents.ts +83 -0
  27. package/corpus/templates/content/app/i18n-data.ts +79 -0
  28. package/corpus/templates/content/app/lib/desktop-content-files.ts +57 -1
  29. package/corpus/templates/content/app/lib/local-content-source-files.ts +210 -34
  30. package/corpus/templates/content/app/lib/local-folder-live-sync.ts +191 -0
  31. package/corpus/templates/content/app/root.tsx +2 -1
  32. package/corpus/templates/content/app/routes/_app.local-files.tsx +103 -38
  33. package/corpus/templates/content/docs/product/capabilities/content.source.file-folder.md +2 -2
  34. package/corpus/templates/content/docs/product/features/content.feature.bring-your-local-work.md +3 -3
  35. package/corpus/templates/content/docs/product/roadmap.md +2 -2
  36. package/corpus/templates/content/docs/solutions/2026-08-18-content-navigation-coherence-shape.md +482 -0
  37. package/corpus/templates/content/shared/api.ts +25 -0
  38. package/corpus/templates/factory/AGENTS.md +2 -1
  39. package/corpus/templates/factory/actions/get-factory-graph-version.ts +69 -0
  40. package/corpus/templates/factory/actions/list-factory-graph-versions.ts +82 -0
  41. package/corpus/templates/factory/actions/restore-factory-graph-version.ts +163 -0
  42. package/corpus/templates/factory/actions/save-factory-graph.ts +93 -60
  43. package/corpus/templates/factory/app/components/factory/FactoryHistoryView.tsx +709 -0
  44. package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +62 -2
  45. package/corpus/templates/factory/app/components/ui/alert-dialog.tsx +1 -0
  46. package/corpus/templates/factory/app/i18n/en-US.ts +43 -0
  47. package/corpus/templates/factory/app/routes/factory.tsx +115 -15
  48. package/corpus/templates/factory/server/plugins/agent-chat.ts +3 -1
  49. package/dist/app-config/auth.d.ts +4 -0
  50. package/dist/app-config/auth.js +7 -0
  51. package/dist/app-config/schema.d.ts +3 -0
  52. package/dist/app-config/schema.js +2 -0
  53. package/dist/cli/code-agent-executor.js +6 -1
  54. package/dist/cli/code-agent-mcp-config.d.ts +2 -2
  55. package/dist/cli/code-agent-mcp-config.js +34 -9
  56. package/dist/client/org/OrgSwitcher.js +8 -4
  57. package/dist/collab/awareness.d.ts +2 -2
  58. package/dist/collab/routes.d.ts +1 -1
  59. package/dist/collab/struct-routes.d.ts +1 -1
  60. package/dist/mcp-client/config.d.ts +11 -0
  61. package/dist/mcp-client/config.js +33 -26
  62. package/dist/notifications/routes.d.ts +3 -3
  63. package/dist/observability/routes.d.ts +3 -3
  64. package/dist/progress/routes.d.ts +1 -1
  65. package/dist/resources/handlers.d.ts +2 -2
  66. package/dist/secrets/routes.d.ts +9 -9
  67. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  68. package/dist/server/auth.js +15 -1
  69. package/dist/server/realtime-token.d.ts +1 -1
  70. package/docs/content/actions-access-control.mdx +136 -2
  71. package/docs/content/actions-agent-tools.mdx +101 -0
  72. package/docs/content/actions-defining.mdx +2 -2
  73. package/docs/content/audit-log.mdx +1 -1
  74. package/docs/content/authentication.mdx +1 -1
  75. package/docs/content/cloudflare.mdx +43 -0
  76. package/docs/content/creating-templates.mdx +1 -1
  77. package/docs/content/deploy-an-app.mdx +109 -0
  78. package/docs/content/deployment-environment-variables.mdx +101 -0
  79. package/docs/content/deployment.mdx +125 -792
  80. package/docs/content/docs-components.mdx +2 -2
  81. package/docs/content/environment-variables.mdx +41 -41
  82. package/docs/content/file-uploads.mdx +74 -40
  83. package/docs/content/harness-agents.mdx +2 -2
  84. package/docs/content/internationalization.mdx +61 -65
  85. package/docs/content/key-concepts.mdx +3 -3
  86. package/docs/content/multi-app-workspace.mdx +2 -2
  87. package/docs/content/netlify.mdx +47 -0
  88. package/docs/content/node-docker.mdx +138 -0
  89. package/docs/content/organizations-teams-permissions.mdx +5 -5
  90. package/docs/content/other-platforms.mdx +27 -0
  91. package/docs/content/ssr-caching.mdx +45 -0
  92. package/docs/content/template-assets-developers.mdx +2 -2
  93. package/docs/content/template-chat-developers.mdx +2 -2
  94. package/docs/content/template-content-developers.mdx +2 -2
  95. package/docs/content/{local-file-mode.mdx → template-content-local-files.mdx} +2 -1
  96. package/docs/content/template-content-sync.mdx +2 -2
  97. package/docs/content/toolkit-agent-ux.mdx +1 -1
  98. package/docs/content/toolkit-resources.mdx +2 -2
  99. package/docs/content/updating-ui-in-production.mdx +35 -0
  100. package/docs/content/vercel.mdx +38 -0
  101. package/docs/content/what-is-agent-native.mdx +1 -1
  102. package/docs/content/workspace-deployment.mdx +350 -0
  103. package/package.json +1 -1
  104. package/docs/content/agents.mdx +0 -9
  105. package/docs/content/database.mdx +0 -317
  106. package/docs/content/human-approval.mdx +0 -156
@@ -0,0 +1,109 @@
1
+ ---
2
+ title: "Deploy an app"
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"
5
+ ---
6
+
7
+ # Deploy an app
8
+
9
+ Use this path for a standalone app, or for one app from a workspace that you
10
+ want to run on its own domain. For several apps on one origin, use [Deploy a
11
+ workspace](/docs/workspace-deployment) instead.
12
+
13
+ <Steps>
14
+
15
+ ### Create or open the app
16
+
17
+ Create a standalone Chat app, or work from an existing app:
18
+
19
+ ```bash
20
+ npx @agent-native/core@latest create my-app --standalone --template chat
21
+ cd my-app
22
+ pnpm install
23
+ ```
24
+
25
+ ### Choose a deployment target
26
+
27
+ The default target is Node.js. For another host, set the Nitro preset in
28
+ `vite.config.ts` or set `NITRO_PRESET` at build time.
29
+
30
+ ```ts filename="vite.config.ts"
31
+ import { agentNative } from "@agent-native/core/vite";
32
+ import { defineConfig } from "vite";
33
+
34
+ export default defineConfig({
35
+ plugins: [agentNative({ nitro: { preset: "vercel" } })],
36
+ });
37
+ ```
38
+
39
+ See the target page for the provider command and runtime details:
40
+
41
+ - [**Node.js & Docker**](/docs/node-docker)
42
+ - [**Vercel**](/docs/vercel)
43
+ - [**Netlify**](/docs/netlify)
44
+ - [**Cloudflare**](/docs/cloudflare)
45
+ - [**AWS Lambda and Deno Deploy**](/docs/other-platforms)
46
+
47
+ ### Build the app
48
+
49
+ Build the client and server output:
50
+
51
+ ```bash
52
+ npx @agent-native/core@latest build
53
+ ```
54
+
55
+ The default Node.js output runs with:
56
+
57
+ ```bash
58
+ node .output/server/index.mjs
59
+ ```
60
+
61
+ For a local production-shaped check with Postgres and Docker, follow the
62
+ [Node.js & Docker quickstart](/docs/node-docker#self-host-quickstart).
63
+
64
+ ### Configure the deployment
65
+
66
+ Set `DATABASE_URL` to a persistent SQL database before the first production
67
+ deploy. A standalone app using framework auth also needs a stable
68
+ `BETTER_AUTH_SECRET`. Add the provider and integration variables your app uses.
69
+
70
+ Use the [deployment environment reference](/docs/deployment-environment-variables)
71
+ for production secrets, auth, webhooks, workspace inheritance, and runtime
72
+ flags.
73
+
74
+ ### Deploy and verify
75
+
76
+ Publish the output using your provider's normal deploy command. Then verify the
77
+ public URL, sign-in flow, database reads and writes, and any OAuth callbacks or
78
+ webhooks your app uses.
79
+
80
+ </Steps>
81
+
82
+ <Callout tone="warning">
83
+
84
+ Do not use the local SQLite file as production storage. Do not reuse the sample
85
+ auth secret from a local Docker setup. Keep secrets in the deployment
86
+ provider's environment or managed secret store.
87
+
88
+ </Callout>
89
+
90
+ ## Deploying one app from a workspace
91
+
92
+ Each workspace app is independently deployable. Run the build from the app
93
+ directory:
94
+
95
+ ```bash
96
+ cd apps/<name>
97
+ npx @agent-native/core@latest build
98
+ ```
99
+
100
+ Give that app its own public origin and configure its database and auth URL for
101
+ that origin. If the apps should share one origin, shared login, and same-origin
102
+ app to app communication, use [Workspace Deployment](/docs/workspace-deployment).
103
+
104
+ ## What's next
105
+
106
+ - [**Deployment**](/docs/deployment) - the database prerequisite and target overview
107
+ - [**Workspace Deployment**](/docs/workspace-deployment) - one origin for many apps
108
+ - [**Database**](/docs/server-database#production) - production SQL adapters and connections
109
+ - [**Security**](/docs/security) - the production security checklist
@@ -0,0 +1,101 @@
1
+ ---
2
+ title: "Deployment: Environment Variables"
3
+ description: "The production environment variable reference for build, runtime, secrets, and hosting behavior."
4
+ ---
5
+
6
+ # Deployment: Environment Variables
7
+
8
+ For the repository-wide reference, including template, provider, local, and CI
9
+ variables, see [Environment Variables](/docs/environment-variables). The tables
10
+ below remain the authoritative deployment guide for production values and
11
+ hosting behavior.
12
+
13
+ ## Build / Runtime {#env-runtime}
14
+
15
+ | Variable | Description |
16
+ | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17
+ | `PORT` | Server port (Node.js only) |
18
+ | `NITRO_PRESET` | Override build preset at build time |
19
+ | `APP_BASE_PATH` | Mount the app under a prefix (e.g. `/mail`). Set automatically by `npx @agent-native/core@latest deploy`. Leave unset for standalone. |
20
+ | `APP_URL` | Optional canonical public origin. Checked ahead of `BETTER_AUTH_URL` when resolving the A2A JWT audience, the OAuth public origin, self-dispatch webhook targets, and generated resource links. Set it explicitly on preview/staging deploys where the request host is unreliable. |
21
+ | `AGENT_PROD_CODE_EXECUTION` | Optional production code-execution mode: `off` (default), `sandboxed`, or `trusted`. See [Production Code Execution](/docs/actions-agent-tools#production-code-execution). |
22
+ | `AGENT_NATIVE_SSR_CACHE` | Deployment-wide SSR shell cache policy: unset/`on` keeps the default hard-cache, `off` sends `no-store`, or a duration such as `30s` / `5m` sets a shorter freshness. See [SSR Caching](/docs/ssr-caching). |
23
+ | `AGENT_NATIVE_ENABLE_KEEP_WARM` | Opt into the Netlify keep-warm scheduled function. Unset by default. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
24
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM` | Compatibility kill switch for the Netlify keep-warm scheduled function. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
25
+ | `AGENT_NATIVE_KEEP_WARM_SCHEDULE` | Override the keep-warm cadence with a 5-field cron expression (default `* * * * *` when enabled). An unparseable value fails the build. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
26
+ | `AGENT_NATIVE_DISABLE_KEEP_WARM_BACKGROUND` | Drop only the background-function warm and keep the server warm. See [Keep-warm](/docs/netlify#netlify-keep-warm). |
27
+ | `AGENT_NATIVE_DISABLE_INPROCESS_SWEEPS` | Turn off the in-process backstop sweep timers (automation redispatch, agent-teams reconciliation, sandbox-execution recovery). On serverless these run per warm container, so their query rate scales with instance count. Set it **only** where a durable scheduler already drives the same recovery, or queued work will not be retried. |
28
+ | `AGENT_NATIVE_SKIP_ENSURE_TABLES` | Skip on-demand schema DDL on deployments the automatic serverless skip does not cover. Requires that your schema is already migrated. See [On-demand schema DDL](/docs/deployment#skip-ensure-tables). |
29
+ | `AGENT_NATIVE_BUILDER_RELAY_SECRET` | Dedicated 32+ char shared HMAC secret for preview-safe Builder authorization relay. Set the same value on the approved corporate callback deployment and preview deployments only when authorization must land in an isolated preview database. |
30
+ | `AGENT_NATIVE_BUILDER_RELAY_TARGET_ORIGINS` | Corporate callback-only, comma-separated allowlist of exact trusted preview origins (for example, `https://0123456789abcdef01234567--content.netlify.app`). Set it only on the corporate callback deployment. Netlify origins must use an immutable, deploy-specific 24-hex permalink. Mutable `deploy-preview-*` aliases, wildcards, and domain suffixes are rejected. |
31
+
32
+ Database connection variables (`DATABASE_URL`, `DATABASE_AUTH_TOKEN`, per-app `<APP_NAME>_DATABASE_URL`) live in [Database](/docs/server-database#production).
33
+
34
+ ## Schema setup and cold starts {#skip-ensure-tables}
35
+
36
+ On the first database touch, each data store checks whether its tables, columns,
37
+ and indexes exist, then creates only what is missing. Managed serverless
38
+ deployments skip this boot-time check in production. Other deployments can make
39
+ the same tradeoff explicit with `AGENT_NATIVE_SKIP_ENSURE_TABLES=1` after the
40
+ schema has been migrated.
41
+
42
+ Use the flag only when your deployment owns schema migrations. If a required
43
+ table is missing, the first real query fails loudly instead of repairing the
44
+ schema at runtime.
45
+
46
+ The check is batched into one introspection pass per database. This keeps the
47
+ default safe for long-lived Node servers while limiting cold-start work on
48
+ platforms that do not skip it automatically.
49
+
50
+ ## Production-sensitive configuration {#env-required-prod}
51
+
52
+ These settings cover production-sensitive behavior. A standalone app using the
53
+ framework auth needs a stable `BETTER_AUTH_SECRET` and a persistent database.
54
+ The public auth URL is inferred from the request, known template, or hosting
55
+ platform when it is unset. Workspace and A2A settings are conditional on those
56
+ features. Missing values either fail-closed or fall back to weaker behavior
57
+ with a loud warning.
58
+
59
+ | Variable | Description |
60
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
61
+ | `BETTER_AUTH_SECRET` | 32+ char random string. Signs session cookies and is the fallback for `OAUTH_STATE_SECRET` and app-local encrypted values. It is also a legacy read candidate for existing shared vault ciphertext. Hard-required: the framework throws on startup if missing in production. |
62
+ | `BETTER_AUTH_URL` | Optional public origin override for this app (e.g. `https://mail.example.com`). The framework infers it from request, known-template, and hosting-platform context when unset. |
63
+ | `ANTHROPIC_API_KEY` | API key for the embedded production agent. **In multi-tenant deploys**, the framework refuses to fall back to this when the user has no per-user key. Bring-your-own-key is required. Single-tenant self-hosted installs use it as a global key. |
64
+ | `OAUTH_STATE_SECRET` | Dedicated HMAC key for OAuth state envelopes (Google, Atlassian, Zoom). Falls back to `BETTER_AUTH_SECRET` when unset, but a dedicated value is recommended so rotating one doesn't invalidate the other. Generate via `openssl rand -hex 32`. |
65
+ | `A2A_SECRET` | Shared HMAC for inter-app A2A JSON-RPC and signed background handoffs. Required for hosted workspace deploys and A2A features. Without it, those endpoints fail closed in production. When no dedicated workspace vault key is set, shared vault ciphertext uses a purpose-derived key from this value, so rotating it also rotates the vault key. |
66
+ | `WORKSPACE_SECRETS_ENCRYPTION_KEY` | Preferred stable AES-256-GCM key for the shared encrypted-at-rest secrets vault. Set the same value in every app that reads the vault. It is separate from app-local OAuth/credential encryption, so A2A trust can rotate without stranding vault rows. Existing A2A-, Better Auth-, and app-key ciphertext is migrated on successful reads. |
67
+ | `WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS` | Optional previous workspace vault key used only during a rotation window. Deploy it alongside the new `WORKSPACE_SECRETS_ENCRYPTION_KEY`, let successful reads re-encrypt rows, then remove it after migration. |
68
+ | `SECRETS_ENCRYPTION_KEY` | Legacy combined key for app-local encryption and the shared vault. It remains supported, but new multi-app deployments should use `WORKSPACE_SECRETS_ENCRYPTION_KEY` for the shared vault so changing workspace encryption does not change app-local OAuth ciphertext. |
69
+
70
+ ## Auth & Identity {#env-auth}
71
+
72
+ OAuth provider credentials (Google, GitHub), static MCP bearer fallbacks (`ACCESS_TOKEN` / `ACCESS_TOKENS`), and email-verification toggles are documented in [Authentication](/docs/authentication). Set them there per the auth mode you choose.
73
+
74
+ ## Inbound Webhooks {#env-webhooks}
75
+
76
+ Each messaging integration requires its own signing secret in production (handlers fail-closed on forged requests when the secret is missing). The per-integration variables are listed in [Messaging](/docs/messaging) and [Security](/docs/security). For local development only, `AGENT_NATIVE_ALLOW_UNVERIFIED_WEBHOOKS=1` opts back into "warn and accept". Never set it in prod.
77
+
78
+ ## Security Configuration (Opt-in) {#security-config}
79
+
80
+ Defaults are strict. A handful of opt-in flags relax behavior (debug stack traces, unverified webhooks, workspace-scoped key fallback, the MCP hub multi-org switch, runtime env-var writes). They are documented with their security trade-offs in [Security](/docs/security). Don't set them unless you specifically want the relaxed path.
81
+
82
+ ## Workspace .env Inheritance {#env-inheritance}
83
+
84
+ Inside a workspace, the root `.env` is loaded into every app automatically, so shared keys like `ANTHROPIC_API_KEY`, `A2A_SECRET`, `BETTER_AUTH_SECRET`, and `OAUTH_STATE_SECRET` only need to be set once. Per-app `apps/<name>/.env` wins on conflict.
85
+
86
+ ## Generating Strong Secrets {#env-generate-secrets}
87
+
88
+ For any secret marked "32+ char random" (`BETTER_AUTH_SECRET`, `OAUTH_STATE_SECRET`, `A2A_SECRET`, `WORKSPACE_SECRETS_ENCRYPTION_KEY`, `SECRETS_ENCRYPTION_KEY`, `AGENT_NATIVE_BUILDER_RELAY_SECRET`), generate fresh values with:
89
+
90
+ ```bash
91
+ openssl rand -hex 32
92
+ ```
93
+
94
+ Rotate signing/session keys by replacing the env var on every instance and redeploying. Sessions and OAuth state envelopes signed under the old key become invalid, so users may need to sign in again. Rotate `WORKSPACE_SECRETS_ENCRYPTION_KEY` with the `..._PREVIOUS` window described above so encrypted vault rows remain readable while they migrate.
95
+
96
+ ## What's next
97
+
98
+ - [**Deployment**](/docs/deployment) — pick a persistent database and a preset before your first production deploy
99
+ - [**Environment Variables**](/docs/environment-variables) — the repository-wide reference, including template, provider, local, and CI variables
100
+ - [**Security**](/docs/security) — the production checklist and opt-in flags referenced throughout this page
101
+ - [**Authentication**](/docs/authentication) — OAuth credentials and env vars for the auth mode you choose