@agent-native/core 0.12.19 → 0.12.20

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 (59) hide show
  1. package/dist/cli/create.d.ts +4 -1
  2. package/dist/cli/create.d.ts.map +1 -1
  3. package/dist/cli/create.js +19 -4
  4. package/dist/cli/create.js.map +1 -1
  5. package/dist/cli/index.js +1 -1
  6. package/dist/cli/index.js.map +1 -1
  7. package/dist/cli/workspace-dev.d.ts +1 -0
  8. package/dist/cli/workspace-dev.d.ts.map +1 -1
  9. package/dist/cli/workspace-dev.js +11 -9
  10. package/dist/cli/workspace-dev.js.map +1 -1
  11. package/dist/client/analytics.d.ts +4 -0
  12. package/dist/client/analytics.d.ts.map +1 -1
  13. package/dist/client/analytics.js +11 -2
  14. package/dist/client/analytics.js.map +1 -1
  15. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  16. package/dist/client/resources/ResourcesPanel.js +5 -40
  17. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  18. package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
  19. package/dist/client/settings/AutomationsSection.js +3 -30
  20. package/dist/client/settings/AutomationsSection.js.map +1 -1
  21. package/dist/client/terminal/AgentTerminal.d.ts.map +1 -1
  22. package/dist/client/terminal/AgentTerminal.js +44 -14
  23. package/dist/client/terminal/AgentTerminal.js.map +1 -1
  24. package/dist/deploy/build.d.ts.map +1 -1
  25. package/dist/deploy/build.js +61 -6
  26. package/dist/deploy/build.js.map +1 -1
  27. package/dist/deploy/workspace-deploy.d.ts +1 -1
  28. package/dist/deploy/workspace-deploy.d.ts.map +1 -1
  29. package/dist/deploy/workspace-deploy.js +158 -7
  30. package/dist/deploy/workspace-deploy.js.map +1 -1
  31. package/dist/server/auth.d.ts.map +1 -1
  32. package/dist/server/auth.js +48 -8
  33. package/dist/server/auth.js.map +1 -1
  34. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  35. package/dist/server/core-routes-plugin.js +4 -2
  36. package/dist/server/core-routes-plugin.js.map +1 -1
  37. package/dist/server/sentry-config.d.ts +5 -0
  38. package/dist/server/sentry-config.d.ts.map +1 -0
  39. package/dist/server/sentry-config.js +43 -0
  40. package/dist/server/sentry-config.js.map +1 -0
  41. package/dist/server/sentry-plugin.d.ts +1 -1
  42. package/dist/server/sentry-plugin.js +2 -2
  43. package/dist/server/sentry-plugin.js.map +1 -1
  44. package/dist/server/sentry.d.ts +4 -4
  45. package/dist/server/sentry.d.ts.map +1 -1
  46. package/dist/server/sentry.js +13 -13
  47. package/dist/server/sentry.js.map +1 -1
  48. package/dist/server/ssr-handler.d.ts.map +1 -1
  49. package/dist/server/ssr-handler.js +12 -2
  50. package/dist/server/ssr-handler.js.map +1 -1
  51. package/dist/templates/workspace-root/_gitignore +1 -0
  52. package/dist/usage/store.d.ts.map +1 -1
  53. package/dist/usage/store.js +5 -5
  54. package/dist/usage/store.js.map +1 -1
  55. package/docs/content/deployment.md +23 -3
  56. package/docs/content/multi-app-workspace.md +8 -2
  57. package/docs/content/observability.md +8 -8
  58. package/package.json +1 -1
  59. package/src/templates/workspace-root/_gitignore +1 -0
@@ -18,7 +18,7 @@ agent-native deploy
18
18
  # https://your-agents.com/forms/* → apps/forms
19
19
  ```
20
20
 
21
- Each app is built with `APP_BASE_PATH=/<name>` and `VITE_APP_BASE_PATH=/<name>`, then packaged into `dist/<name>/`. Cloudflare Pages is the default preset and uses a generated dispatcher worker at `dist/_worker.js`; Netlify uses one function per app in `.netlify/functions-internal/<app>-server` plus generated redirects.
21
+ Each app is built with `APP_BASE_PATH=/<name>` and `VITE_APP_BASE_PATH=/<name>`, then packaged for the target Nitro preset. Cloudflare Pages is the default preset and uses a generated dispatcher worker at `dist/_worker.js`; Netlify uses one function per app in `.netlify/functions-internal/<app>-server` plus generated redirects; Vercel writes a workspace-level `.vercel/output` using the Build Output API.
22
22
 
23
23
  Same-origin deploy gives you two big wins for free:
24
24
 
@@ -37,7 +37,13 @@ For Netlify unified deploys, use the Netlify preset:
37
37
  agent-native deploy --preset netlify
38
38
  ```
39
39
 
40
- Generated workspaces include a root `netlify.toml` that runs `agent-native deploy --preset netlify --build-only`, publishes `dist`, and points Netlify at `.netlify/functions-internal`.
40
+ For Vercel unified deploys, use the Vercel preset:
41
+
42
+ ```bash
43
+ agent-native deploy --preset vercel
44
+ ```
45
+
46
+ When configuring a provider build command, use the same command with `--build-only`. Vercel should run `pnpm exec agent-native deploy --preset vercel --build-only`; the command writes `.vercel/output` directly, so no `vercel.json` is required for workspace routing.
41
47
 
42
48
  Hosted workspace builds require `A2A_SECRET` in the deploy provider environment.
43
49
  This makes Slack, inbound webhooks, and cross-app A2A resume work through signed
@@ -128,6 +134,20 @@ Deploy via the Vercel CLI or git push:
128
134
  vercel deploy
129
135
  ```
130
136
 
137
+ For a workspace, build every app into one Vercel Build Output API bundle:
138
+
139
+ ```bash
140
+ agent-native deploy --preset vercel
141
+ ```
142
+
143
+ For Vercel Git deployments, set the build command to:
144
+
145
+ ```bash
146
+ pnpm exec agent-native deploy --preset vercel --build-only
147
+ ```
148
+
149
+ The workspace build copies each app's Nitro `vercel` output into the root `.vercel/output`, gives each function its own mount-path environment, and writes the route config that serves apps at `/<app-id>`.
150
+
131
151
  ## Netlify {#netlify}
132
152
 
133
153
  The Nitro `netlify` preset works well and, in practice, has given us much faster cold starts than Cloudflare Pages (~200ms TTFB vs ~9s) for templates that talk to external Postgres (Neon). Either set the preset in `vite.config.ts`:
@@ -147,7 +167,7 @@ For a workspace, deploy every app from one Netlify site by running:
147
167
  agent-native deploy --preset netlify
148
168
  ```
149
169
 
150
- The workspace build writes static assets to `dist/<app>/` and routes each app to its own Netlify function without forced redirects, so files like `/mail/assets/...` are served statically before the server function handles app routes.
170
+ The workspace build writes static assets under `dist/_workspace_static/` and routes each app to its own Netlify function without forced asset redirects, so files like `/mail/assets/...` are served statically before the server function handles app routes.
151
171
 
152
172
  ## Cloudflare Pages {#cloudflare-pages}
153
173
 
@@ -205,7 +205,7 @@ agent-native deploy
205
205
  # https://your-agents.com/forms/* → apps/forms
206
206
  ```
207
207
 
208
- Each app is built with `APP_BASE_PATH=/<name>` and `VITE_APP_BASE_PATH=/<name>` and emitted into `dist/<name>/`. Cloudflare Pages is the default preset and uses a dispatcher worker at `dist/_worker.js` plus `_routes.json`. Netlify is also supported with `agent-native deploy --preset netlify`; it emits app functions under `.netlify/functions-internal/<app>-server` and generated redirects that leave static assets unforced so the CDN serves files first.
208
+ Each app is built with `APP_BASE_PATH=/<name>` and `VITE_APP_BASE_PATH=/<name>` and emitted through the selected Nitro preset. Cloudflare Pages is the default preset and uses a dispatcher worker at `dist/_worker.js` plus `_routes.json`. Netlify is supported with `agent-native deploy --preset netlify`; it emits app functions under `.netlify/functions-internal/<app>-server` and generated redirects that leave static assets unforced so the CDN serves files first. Vercel is supported with `agent-native deploy --preset vercel`; it writes a root `.vercel/output` bundle using Vercel's Build Output API.
209
209
 
210
210
  Being on the **same origin** is where the real payoff lives:
211
211
 
@@ -219,12 +219,18 @@ Publish the `dist/` output:
219
219
  wrangler pages deploy dist
220
220
  ```
221
221
 
222
- For Netlify, generated workspaces already include a root `netlify.toml`. Existing workspaces can use:
222
+ For Netlify:
223
223
 
224
224
  ```bash
225
225
  agent-native deploy --preset netlify --build-only
226
226
  ```
227
227
 
228
+ For Vercel Git deployments, set the build command to:
229
+
230
+ ```bash
231
+ pnpm exec agent-native deploy --preset vercel --build-only
232
+ ```
233
+
228
234
  ### Per-app independent deploy
229
235
 
230
236
  Prefer each app on its own domain (`mail.company.com`, `calendar.company.com`)? Every app in the workspace is still an independent deployable — `cd apps/mail && agent-native build` behaves exactly like a standalone scaffold. Cross-app A2A then goes through the standard JWT-signed path with a shared `A2A_SECRET`.
@@ -185,17 +185,17 @@ The framework emits `gen_ai.*` semantic convention spans compatible with the Ope
185
185
 
186
186
  ## Error Reporting (Sentry)
187
187
 
188
- Server-side errors that escape Nitro route handlers are reported to Sentry when a DSN is configured. Without it the SDK silently no-ops, so it's safe to leave the env vars unset in dev. Three independent Sentry projects cover the framework:
188
+ Server-side errors that escape Nitro route handlers are reported to Sentry when a DSN is configured. Without it the SDK silently no-ops, so it's safe to leave the env vars unset in dev. Browser and server events can go to the same Sentry project; split them into separate projects only when you want operational separation for ownership, volume, quotas, or alert routing.
189
189
 
190
- | Surface | SDK | Env var | Notes |
191
- | ------------------ | ----------------- | ------------------------ | --------------------------------------------------------------------- |
192
- | Browser / SPA | `@sentry/browser` | `VITE_SENTRY_CLIENT_DSN` | Captures unhandled errors and route-change breadcrumbs in the client. |
193
- | Nitro server | `@sentry/node` | `SENTRY_SERVER_DSN` | Captures 5xx responses and Nitro lifecycle errors. Per-request user. |
194
- | `agent-native` CLI | `@sentry/node` | _hardcoded_ | Crash reports from the published CLI binary; not user-configurable. |
190
+ | Surface | SDK | Env var | Notes |
191
+ | ------------------ | ----------------- | -------------------------------------------------------------- | --------------------------------------------------------------------- |
192
+ | Browser / SPA | `@sentry/browser` | `VITE_SENTRY_CLIENT_DSN`, `SENTRY_CLIENT_DSN`, or `SENTRY_DSN` | Captures unhandled errors and route-change breadcrumbs in the client. |
193
+ | Nitro server | `@sentry/node` | `SENTRY_SERVER_DSN` or `SENTRY_DSN` | Captures 5xx responses and Nitro lifecycle errors. Per-request user. |
194
+ | `agent-native` CLI | `@sentry/node` | _hardcoded_ | Crash reports from the published CLI binary; not user-configurable. |
195
195
 
196
196
  ### Server-side configuration
197
197
 
198
- Set `SENTRY_SERVER_DSN` in the deploy environment (Netlify dashboard, Cloudflare secrets, etc.). The framework auto-mounts a Nitro plugin that:
198
+ Set `SENTRY_SERVER_DSN` or the shared `SENTRY_DSN` in the deploy environment (Netlify dashboard, Cloudflare secrets, etc.). The framework auto-mounts a Nitro plugin that:
199
199
 
200
200
  1. Calls `Sentry.init` once at startup (idempotent — safe to call from multiple plugins).
201
201
  2. Resolves the user via `getSession(event)` on every API/framework request and attaches `id` / `email` / `username` plus an `orgId` tag to Sentry's per-request isolation scope. Static-asset paths are skipped to avoid extra DB hits.
@@ -208,7 +208,7 @@ Optional knobs:
208
208
 
209
209
  ### Templates
210
210
 
211
- Every template inherits this automatically — there's nothing to import. Templates that want custom behavior (extra tags, different DSN per template, hard-disable Sentry) can override by exporting their own plugin from `server/plugins/sentry.ts`:
211
+ Every template inherits this automatically — there's nothing to import. For SSR apps, the server injects a tiny browser config script when `SENTRY_CLIENT_DSN`, `VITE_SENTRY_CLIENT_DSN`, or shared `SENTRY_DSN` is available at runtime, so browser capture is not limited to Vite build-time env. Templates that want custom behavior (extra tags, different DSN per template, hard-disable Sentry) can override by exporting their own plugin from `server/plugins/sentry.ts`:
212
212
 
213
213
  ```ts
214
214
  // server/plugins/sentry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.12.19",
3
+ "version": "0.12.20",
4
4
  "type": "module",
5
5
  "description": "Framework for agent-native application development — where AI agents and UI share state via files",
6
6
  "license": "MIT",
@@ -1,5 +1,6 @@
1
1
  node_modules/
2
2
  .netlify/
3
+ .vercel/
3
4
  dist/
4
5
  build/
5
6
  apps/*/dist/