@agent-native/core 0.205.0 → 0.206.0-nightly-20261009011246

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 (115) hide show
  1. package/dist/a2a/client.d.ts +2 -2
  2. package/dist/agent/engine/anthropic-engine.d.ts +1 -1
  3. package/dist/agent/engine/builder-engine.d.ts +1 -1
  4. package/dist/agent/engine/builder-engine.js +23 -8
  5. package/dist/agent/engine/error-telemetry.d.ts +5 -0
  6. package/dist/agent/engine/error-telemetry.js +41 -0
  7. package/dist/agent/engine/registry.d.ts +1 -6
  8. package/dist/agent/engine/registry.js +2 -31
  9. package/dist/agent/model-config.d.ts +26 -14
  10. package/dist/agent/model-config.js +131 -8
  11. package/dist/agent/model-version.d.ts +19 -0
  12. package/dist/agent/model-version.js +153 -0
  13. package/dist/agent/production-agent.d.ts +1 -0
  14. package/dist/agent/production-agent.js +24 -6
  15. package/dist/agent/provider-model-selection.js +6 -4
  16. package/dist/agent/run-manager.js +5 -11
  17. package/dist/agent/thread-data-builder.js +14 -6
  18. package/dist/authorization/check-action.js +8 -4
  19. package/dist/chat-threads/store.js +22 -9
  20. package/dist/client/analytics.d.ts +1 -0
  21. package/dist/client/analytics.js +10 -2
  22. package/dist/client/chat/runtime.js +18 -0
  23. package/dist/client/chat-model-groups.d.ts +3 -0
  24. package/dist/client/error-format.js +10 -7
  25. package/dist/client/onboarding/use-onboarding.d.ts +12 -0
  26. package/dist/client/onboarding/use-onboarding.js +491 -4
  27. package/dist/client/session-replay-privacy.d.ts +8 -0
  28. package/dist/client/session-replay-privacy.js +8 -0
  29. package/dist/client/session-replay.d.ts +1 -0
  30. package/dist/client/session-replay.js +18 -9
  31. package/dist/client/sse-event-processor.js +10 -6
  32. package/dist/client/use-chat-models.d.ts +5 -0
  33. package/dist/client/use-chat-models.js +51 -5
  34. package/dist/client/use-session.d.ts +8 -1
  35. package/dist/client/use-session.js +20 -1
  36. package/dist/collab/struct-routes.d.ts +1 -1
  37. package/dist/deploy/build.js +353 -3
  38. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  39. package/dist/jobs/backfill-run-history-ownership.d.ts +12 -0
  40. package/dist/jobs/backfill-run-history-ownership.js +87 -0
  41. package/dist/jobs/background-automation-runner.js +3 -9
  42. package/dist/jobs/remote-execution.js +3 -9
  43. package/dist/jobs/run-history-ownership.d.ts +5 -0
  44. package/dist/jobs/run-history-ownership.js +16 -0
  45. package/dist/jobs/run-now.js +2 -3
  46. package/dist/localization/agent-resources-messages.d.ts +3 -0
  47. package/dist/localization/agent-resources-messages.js +33 -0
  48. package/dist/mcp/actions/create-org-service-token.js +5 -7
  49. package/dist/mcp/build-server.d.ts +23 -18
  50. package/dist/mcp/build-server.js +220 -212
  51. package/dist/mcp/connect-route.d.ts +11 -2
  52. package/dist/mcp/connect-route.js +34 -24
  53. package/dist/mcp/connect-store.d.ts +9 -13
  54. package/dist/mcp/connect-store.js +11 -24
  55. package/dist/mcp/credential-membership.js +17 -6
  56. package/dist/mcp/oauth-route.d.ts +11 -1
  57. package/dist/mcp/oauth-route.js +28 -6
  58. package/dist/mcp/oauth-token.d.ts +12 -2
  59. package/dist/mcp/oauth-token.js +15 -4
  60. package/dist/mcp/server.js +9 -5
  61. package/dist/notifications/routes.d.ts +2 -2
  62. package/dist/observability/posthog-ai.d.ts +1 -0
  63. package/dist/observability/posthog-ai.js +20 -8
  64. package/dist/observability/routes.d.ts +6 -6
  65. package/dist/observability/traces.js +61 -39
  66. package/dist/org/app-roles.d.ts +8 -1
  67. package/dist/org/app-roles.js +29 -9
  68. package/dist/org/context.js +24 -8
  69. package/dist/org/index.d.ts +2 -2
  70. package/dist/org/workspace-app-identity.d.ts +1 -0
  71. package/dist/org/workspace-app-identity.js +25 -0
  72. package/dist/progress/routes.d.ts +1 -1
  73. package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
  74. package/dist/provider-api/actions/provider-api.d.ts +3 -3
  75. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  76. package/dist/scripts/agent-engines/list-agent-engines.js +1 -0
  77. package/dist/server/action-routes.js +8 -1
  78. package/dist/server/agent-chat-plugin.js +1 -0
  79. package/dist/server/agent-engine-default-model-route.d.ts +1 -1
  80. package/dist/server/auth.js +33 -17
  81. package/dist/server/bearer-credential-refusal.d.ts +23 -0
  82. package/dist/server/bearer-credential-refusal.js +67 -0
  83. package/dist/server/better-auth-instance.js +13 -6
  84. package/dist/server/builder-browser.d.ts +2 -0
  85. package/dist/server/builder-browser.js +16 -3
  86. package/dist/server/capture-error.d.ts +1 -0
  87. package/dist/server/capture-error.js +28 -4
  88. package/dist/server/complete-text.js +16 -3
  89. package/dist/server/core-routes-plugin.js +2 -0
  90. package/dist/server/dev-action-bridge.js +7 -1
  91. package/dist/server/google-oauth.js +6 -3
  92. package/dist/server/index.d.ts +1 -1
  93. package/dist/server/index.js +1 -1
  94. package/dist/server/realtime-token.d.ts +1 -1
  95. package/dist/server/recap-image-route.js +4 -0
  96. package/dist/server/request-context.d.ts +16 -0
  97. package/dist/server/request-context.js +17 -0
  98. package/dist/shared/agent-chat-context.d.ts +1 -0
  99. package/dist/shared/agent-chat-context.js +26 -0
  100. package/dist/shared/index.d.ts +1 -1
  101. package/dist/shared/index.js +1 -1
  102. package/dist/shared/reasoning-effort.js +10 -1
  103. package/dist/shared/ssr-session-bootstrap.d.ts +7 -0
  104. package/dist/shared/ssr-session-bootstrap.js +21 -0
  105. package/dist/sharing/access.js +86 -5
  106. package/dist/templates/builder-code-starter/server/routes/index.get.ts +2 -0
  107. package/dist/triggers/routes.js +2 -1
  108. package/docs/content/automation-connectors.mdx +5 -3
  109. package/docs/content/automations.mdx +78 -49
  110. package/docs/content/observability.mdx +16 -5
  111. package/docs/content/organizations-teams-permissions.mdx +44 -2
  112. package/docs/content/recurring-jobs.mdx +4 -8
  113. package/docs/content/template-forms.mdx +6 -0
  114. package/package.json +5 -4
  115. package/src/templates/builder-code-starter/server/routes/index.get.ts +2 -0
@@ -360,10 +360,21 @@ Tool calls always appear (PostHog derives its tool tags from them), but their
360
360
  `capturePrompts`. When those are off the fields are omitted entirely rather than
361
361
  sent empty, so an unrecorded prompt is never mistaken for an empty one.
362
362
 
363
- Errors carry a structured `$ai_error` with the terminal code and whether the
364
- failure was retryable, and exceptions captured during a run carry the run's
365
- `$ai_trace_id` — so an issue in error tracking and the trace it came from link
366
- to each other.
363
+ Run failure messages are omitted from Analytics and Monitoring, even when
364
+ content capture is enabled. `$ai_error` carries a terminal code, named cause,
365
+ retryability, and fixed message derived from the code. Tracking omits
366
+ `error_message`, `agent_run_terminal.error_detail`, and failed tool result text.
367
+ The terminal event retains `error_code` and `error_cause`. Local
368
+ `agent_runs.error_detail` and `agent_trace_spans.error_message` remain available
369
+ for owner-scoped debugging in the app's own database.
370
+
371
+ Run and Builder gateway exceptions retain their type, code, and stack frames,
372
+ with a fixed `Internal Server Error` message and no original message header or nested
373
+ cause text. Monitoring groups these issues by app, type, frame, error code, and
374
+ failure class, rather than names in the original message. Exceptions retain
375
+ `$ai_trace_id` so an issue links to the run's trace. Optional host-owned
376
+ OpenTelemetry run exports also omit failure text and retain `agent.error_code`
377
+ and `agent.error_cause`. Other exception capture keeps its existing behavior.
367
378
 
368
379
  ### Feedback in PostHog
369
380
 
@@ -404,7 +415,7 @@ The agent loop emits three span kinds:
404
415
  | `chat {model}` | per model call | `gen_ai.provider.name`, `gen_ai.request.model`, `gen_ai.response.model`, `gen_ai.response.finish_reasons`, `gen_ai.usage.*` |
405
416
  | `execute_tool {tool}` | once per action invocation | `gen_ai.tool.name`, `gen_ai.tool.call.id`, plus success/error status |
406
417
 
407
- Spans are finished with OK/ERROR status and record the error message on failure. Zero/sentinel attribute values are pruned so spans aren't cluttered with noise. This OTel layer is purely additive to the in-house `agent_trace_spans` / `agent_trace_summaries` tables that power the dashboard above — both are produced from the same run events.
418
+ Spans are finished with OK/ERROR status and record a fixed code-derived message on failure. Zero/sentinel attribute values are pruned so spans aren't cluttered with noise. This OTel layer is purely additive to the in-house `agent_trace_spans` / `agent_trace_summaries` tables that power the dashboard above — both are produced from the same run events.
408
419
 
409
420
  ### Metrics {#otel-metrics}
410
421
 
@@ -186,7 +186,7 @@ import { defineAppRoles } from "@agent-native/core/org-team";
186
186
  export const coachAccess = defineAppRoles({
187
187
  appId: "coach",
188
188
  roles: ["member", "coach-admin"] as const,
189
- defaultRole: "member", // display only — never satisfies a guard
189
+ defaultRole: "member", // display only — does not grant permissions
190
190
  label: "Coach role", // column header in TeamPage
191
191
  roleLabels: { "coach-admin": "Coach admin" },
192
192
  permissions: { approve: ["coach-admin"] },
@@ -272,7 +272,8 @@ null })` means "this run has no user" and does not fall back to the ambient
272
272
  an app id the server never declared.
273
273
  - **An app admin is not an org admin.** Only org owners and admins may change
274
274
  app-role assignments, and nothing in the org handlers reads an app role. The
275
- implication does not run in either direction.
275
+ `allowOrgAdmins` policy can exempt org owners/admins from app-permission
276
+ checks, but never grants org administration to an app role.
276
277
 
277
278
  In the browser, `<TeamPage appRoles={coachRoles} />` adds a role column and
278
279
  picker next to the org role. The argument is the descriptor — the serializable
@@ -293,6 +294,47 @@ a client that shows the wrong affordance still cannot perform the operation.
293
294
  See [Actions → Authorization](/docs/actions-access-control#authorize) for how `authorize`
294
295
  differs from `needsApproval` and from row-level access guards.
295
296
 
297
+ ### Opt-in permission policies
298
+
299
+ By default, permission guards require an assigned app role. Pass an optional
300
+ second argument to `defineAppRoles` to change that policy on the server. Forms
301
+ uses:
302
+
303
+ ```ts
304
+ const formsAccess = defineAppRoles(
305
+ {
306
+ appId: "forms",
307
+ roles: ["editor", "reviewer"] as const,
308
+ defaultRole: "editor",
309
+ permissions: {
310
+ "forms.edit": ["editor"],
311
+ "forms.review": ["editor", "reviewer"],
312
+ },
313
+ },
314
+ { unassignedRole: "editor", allowOrgAdmins: true },
315
+ );
316
+ ```
317
+
318
+ - `unassignedRole` uses a declared role's permissions for active members with
319
+ no app-role assignments. Permission overrides still apply. It does not
320
+ create an assignment or apply to removed members or assignments containing
321
+ only retired roles. Clearing all assignments restores this fallback.
322
+ - `allowOrgAdmins: true` lets active organization owners and admins pass any
323
+ declared app-permission guard, regardless of their app roles or permission
324
+ overrides. It does not grant organization administration to app admins.
325
+
326
+ These options affect only `requirePermission` and `assertPermission`.
327
+ `resolve`, `requireAny`, and `assertAny` retain their explicit-assignment
328
+ semantics, and `defaultRole` remains display only. Both options are opt-in;
329
+ omitting them keeps the strict permission policy. Neither option replaces
330
+ resource authorization: keep `accessFilter` and `assertAccess` checks.
331
+
332
+ Forms keeps existing unassigned members' editing access. An explicitly assigned
333
+ Reviewer can review submissions but cannot edit forms; Editor can do both.
334
+ Resource sharing still determines which forms and submissions they can access.
335
+
336
+ For organization-owned forms, editing and submission review require active membership in the form's organization unless the sharing system recognizes the caller as its owner. A direct share alone does not satisfy this app-permission check.
337
+
296
338
  ## Resource permissions (sharing RBAC)
297
339
 
298
340
  Organization roles and resource roles are different systems:
@@ -127,9 +127,8 @@ The framework includes cron utilities (`isValidCron()` and `describeCron()`) for
127
127
 
128
128
  ### From the Automations UI
129
129
 
130
- Open **Automations** on the full-page Agent surface, then create a
131
- **Scheduled** automation. The stable compatibility URL is `/agent#jobs`; the
132
- hash does not change when the visible tab name changes.
130
+ Open **Settings › Automations**, then create a **Scheduled** automation. Old
131
+ `/agent#jobs` links redirect there.
133
132
 
134
133
  ### By asking the agent
135
134
 
@@ -258,13 +257,10 @@ fire schedules, the **Automations** page says so and names the reason.
258
257
 
259
258
  ## Debugging a job {#debugging}
260
259
 
261
- - Open the automation's details in **Automations**, or inspect
260
+ - Open the automation's details in **Settings › Automations**, or inspect
262
261
  `jobs/<name>.md` in Agent Resources — the frontmatter shows `lastRun`,
263
262
  `lastStatus`, `lastError`, and `nextRun`.
264
- - **Test it without waiting:** open the automation in **Automations** and
265
- choose **Run now**. It runs the automation immediately, with its real side
266
- effects, and doesn't wait for a scheduler tick, so it also works locally and
267
- on hosts without a trigger.
263
+ - **Test it without waiting:** click **Run now** in **Settings › Automations**, or ask the agent to run it (`manage-automations` with `action=run-now`). The job's prompt runs immediately with its real side effects, and `nextRun` doesn't change. The exception is a job the framework paused: a successful run turns it back on and recomputes `nextRun`. Run now doesn't wait for a scheduler tick, so it also works on localhost without `AGENT_NATIVE_ENABLE_LOCAL_RECURRING_JOBS` and on hosts without a scheduler trigger.
268
264
  - **Pause it:** flip `enabled: false`. The file stays put, just stops running.
269
265
 
270
266
  ## Agent tool {#agent-tool}
@@ -133,3 +133,9 @@ If you run Forms alongside other apps in [Dispatch](/docs/template-dispatch), a
133
133
  - [**Actions**](/docs/actions-overview) — the action system powering the builder
134
134
  - [**Messaging**](/docs/messaging) — Slack and other submission destinations
135
135
  - [**Sharing**](/docs/sharing) — the share-grant model form shares build on
136
+
137
+ Forms enforces the Team page roles through shared permission guards. Reviewer can review submissions and export or analyze responses, but cannot create, edit, publish, archive, delete, or restore forms. Editor can edit and review. Submission review still requires an editor-level resource share; the app role does not grant access to private forms. Form owners and organization owners/admins bypass the app-role restriction while resource sharing checks remain in force. Members without an assigned role retain Editor permissions for compatibility; assigning Reviewer removes those edit permissions. Authenticated personal deployments without an organization retain their existing resource access. Forms opts into `defineAppRoles(descriptor, { unassignedRole: "editor", allowOrgAdmins: true })`; `defaultRole` remains display-only, and other apps retain strict guards unless they opt in.
138
+
139
+ Organization-owned forms always use that organization's role policy, even when personal scope or a different organization is selected. Changing a form's visibility also requires edit permission.
140
+
141
+ For organization-owned forms, editing and submission review require active membership in the form's organization unless the sharing system recognizes the caller as its owner. A direct share alone does not satisfy this app-permission check.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.205.0",
3
+ "version": "0.206.0-nightly-20261009011246",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -183,6 +183,7 @@
183
183
  "./client/lazy-chunk-error-boundary": "./dist/client/tombstone/lazy-chunk-error-boundary.js",
184
184
  "./client/lazy-chunk-retry-fallback": "./dist/client/tombstone/lazy-chunk-retry-fallback.js",
185
185
  "./client/secrets": "./dist/client/secrets.js",
186
+ "./client/session-replay-privacy": "./dist/client/session-replay-privacy.js",
186
187
  "./client/use-db-sync": "./dist/client/use-db-sync.js",
187
188
  "./client/zoom-gesture": "./dist/client/zoom-gesture.js",
188
189
  "./client/ui": "./dist/client/ui/index.js",
@@ -685,8 +686,8 @@
685
686
  "yaml": "^2.9.0",
686
687
  "yjs": "^13.6.33",
687
688
  "zod": "^4.3.6",
688
- "@agent-native/recap-cli": "^0.5.67",
689
- "@agent-native/agentkit": "^0.205.0"
689
+ "@agent-native/agentkit": "^0.206.0-nightly-20261009011246",
690
+ "@agent-native/recap-cli": "^0.5.68-nightly-20261009011246"
690
691
  },
691
692
  "devDependencies": {
692
693
  "@ai-sdk/anthropic": "^3.0.71",
@@ -756,7 +757,7 @@
756
757
  "xlsx": "^0.18.5"
757
758
  },
758
759
  "peerDependencies": {
759
- "@agent-native/core-corpus": ">=0.196.0",
760
+ "@agent-native/core-corpus": "0.206.0-nightly-20261009011246",
760
761
  "@ai-sdk/anthropic": ">=3",
761
762
  "@ai-sdk/cohere": ">=3",
762
763
  "@ai-sdk/google": ">=3",
@@ -0,0 +1,2 @@
1
+ // Nitro's [...page] catch-all doesn't match "/", and this starter serves its home page at "/".
2
+ export { default } from "./[...page].get.js";