@agent-native/core 0.209.0-nightly-20261014153330 → 0.209.0

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 (44) hide show
  1. package/dist/agent/production-agent.d.ts +8 -0
  2. package/dist/agent/production-agent.js +68 -3
  3. package/dist/agent/strict-tool-input.d.ts +4 -0
  4. package/dist/agent/strict-tool-input.js +26 -0
  5. package/dist/agent/types.d.ts +7 -0
  6. package/dist/automation/index.d.ts +1 -1
  7. package/dist/cli/skills-content/turn-into-app-attachments.d.ts +1 -1
  8. package/dist/cli/skills-content/turn-into-app-attachments.js +1 -3
  9. package/dist/cli/skills-content/turn-into-app-skill.d.ts +2 -2
  10. package/dist/cli/skills-content/turn-into-app-skill.js +15 -10
  11. package/dist/client/chat/agentkit-protocol.js +2 -0
  12. package/dist/client/chat/runtime.d.ts +1 -0
  13. package/dist/client/chat/runtime.js +35 -3
  14. package/dist/collab/routes.d.ts +1 -1
  15. package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
  16. package/dist/observability/metrics.d.ts +2 -0
  17. package/dist/observability/metrics.js +15 -1
  18. package/dist/observability/routes.d.ts +7 -7
  19. package/dist/observability/traces.js +8 -1
  20. package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
  21. package/dist/provider-api/actions/provider-api.d.ts +10 -10
  22. package/dist/resources/handlers.d.ts +1 -1
  23. package/dist/secrets/routes.d.ts +10 -10
  24. package/dist/server/agent-chat/additional-actions.d.ts +45 -0
  25. package/dist/server/agent-chat/additional-actions.js +707 -0
  26. package/dist/server/agent-chat/plugin-options.d.ts +21 -0
  27. package/dist/server/agent-chat-plugin.js +54 -13
  28. package/dist/server/better-auth-instance.js +108 -18
  29. package/dist/server/builder-browser.d.ts +4 -2
  30. package/dist/server/builder-browser.js +21 -16
  31. package/dist/server/index.d.ts +2 -1
  32. package/dist/server/index.js +1 -1
  33. package/dist/shared/data-url.d.ts +2 -0
  34. package/dist/shared/data-url.js +12 -0
  35. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/attachments.md +1 -3
  36. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +13 -8
  37. package/dist/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +2 -2
  38. package/dist/triggers/actions/manage-automation.d.ts +5 -5
  39. package/docs/content/agent-surfaces.mdx +61 -0
  40. package/docs/content/observability.mdx +2 -0
  41. package/package.json +5 -4
  42. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/attachments.md +1 -3
  43. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/fresh-project.md +13 -8
  44. package/src/templates/workspace-core/.agents/skills/turn-into-app/references/source-brief.md +2 -2
@@ -13,8 +13,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
13
13
  executionEngine?: string;
14
14
  executionCwd?: string;
15
15
  }, {
16
- deleted?: undefined;
17
- enabled?: undefined;
18
16
  created: boolean;
19
17
  name: string;
20
18
  scope: "organization" | "personal";
@@ -25,31 +23,33 @@ declare const _default: import("../../action.js").ActionDefinition<{
25
23
  reasoningEffort: "auto" | "high" | "low" | "max" | "medium" | "minimal" | "none" | "xhigh";
26
24
  webhookPath: string;
27
25
  nextRun: string;
26
+ deleted?: undefined;
27
+ enabled?: undefined;
28
28
  executionHostId?: undefined;
29
29
  executionEngine?: undefined;
30
30
  executionCwd?: undefined;
31
31
  } | {
32
- enabled?: undefined;
33
- nextRun?: undefined;
34
32
  created?: undefined;
35
33
  scope?: undefined;
36
34
  triggerType?: undefined;
37
35
  event?: undefined;
38
36
  deleted: boolean;
39
37
  name: string;
38
+ enabled?: undefined;
40
39
  schedule?: undefined;
41
40
  timezone?: undefined;
42
41
  reasoningEffort?: undefined;
43
42
  executionHostId?: undefined;
44
43
  executionEngine?: undefined;
45
44
  executionCwd?: undefined;
45
+ nextRun?: undefined;
46
46
  webhookPath?: undefined;
47
47
  } | {
48
- deleted?: undefined;
49
48
  created?: undefined;
50
49
  scope?: undefined;
51
50
  triggerType?: undefined;
52
51
  event?: undefined;
52
+ deleted?: undefined;
53
53
  name: string;
54
54
  enabled: boolean;
55
55
  schedule: string;
@@ -202,6 +202,67 @@ framework guidance and spawned sub-agents inherit the same surface. Trusted
202
202
  shell tools are automatically reduced to the request-filtered sandbox because
203
203
  an unrestricted shell cannot enforce a hard action boundary.
204
204
 
205
+ ### Request-scoped additional actions
206
+
207
+ Use `resolveAdditionalActions` when the actions a caller can use are only known
208
+ at request time, such as tools a user registers while the server runs. The
209
+ callback runs once per authenticated interactive chat run (production and dev),
210
+ before `tool-search` and `resolveActionSurface`, so both see the returned
211
+ entries. They join that caller's registry for that run only. A2A tasks and MCP
212
+ `ask_app` calls receive them only when you list those surfaces in
213
+ `additionalActionSurfaces`; `surface` tells the callback which one is asking.
214
+
215
+ ```ts
216
+ createAgentChatPlugin({
217
+ actions,
218
+ additionalActionSurfaces: ["a2a"],
219
+ resolveAdditionalActions: async ({ surface, ownerEmail, orgId }) =>
220
+ loadUserTools(ownerEmail, orgId, {
221
+ includeEditorTools: surface === "chat",
222
+ }),
223
+ });
224
+ ```
225
+
226
+ Treat returned entries as untrusted input. The framework ignores an entry, and
227
+ logs a warning once, when its name is not 1–64 letters, digits, `_`, or `-`;
228
+ when the name belongs to any template, framework, dev, or MCP action, including
229
+ actions hidden from the agent; when it is an `mcp__` name the caller cannot
230
+ see; or when its tool definition is unusable. Descriptions lose hidden control
231
+ characters and are capped. `parameters` must be a bounded schema of plain JSON
232
+ data with an `object` root, using only common validation and annotation
233
+ keywords. Unknown keywords, `pattern`, `patternProperties`, `uniqueItems`,
234
+ `$async`, `$id`, anchors, and any `$ref` that is recursive or points outside
235
+ the schema are refused. The model sees the checked copy of the schema, and a
236
+ call whose arguments are too large to validate against it is refused. Flags such as
237
+ `readOnly` and `access` are your app's own declarations, which the framework
238
+ trusts as it trusts `run`: set them from what your code does, never from
239
+ metadata a user registered.
240
+
241
+ Each entry is bound to the caller it was resolved for. Every call, whichever
242
+ dispatcher makes it, refuses to run for a different user or organization,
243
+ enforces the entry's `access` policy, and validates the arguments against its
244
+ schema without type coercion.
245
+
246
+ Names are pinned only when a hosted chat turn continues as a durable background
247
+ run. The callback runs again, and the turn keeps its original names for these
248
+ entries and the caller's MCP tools alike: new entries stay out, a name that
249
+ disappeared returns an error when called, and a name that remains runs its
250
+ current definition. Every other request resolves fresh, including each
251
+ continuation on a local sidecar, and a dropped stream that reattaches to its run
252
+ resolves nothing.
253
+
254
+ Put the binding's identity in the name, such as a window id or scope
255
+ (`notes_window_42_insert`), so a rebind reads as one tool leaving and another
256
+ appearing. "Always allow" approvals follow the tool name, so they carry over
257
+ when the same name later means something new.
258
+
259
+ These entries are native tools for the agent loop only. Like the caller's MCP
260
+ tools, they aren't reachable from `run-code` or `tool-orchestration`.
261
+
262
+ `event` is set for `chat` and `a2a`; `ask_app` calls have none. The callback
263
+ is not called for anonymous requests, scheduled jobs, automations, or agent-team
264
+ sub-agents. An error the callback throws fails the request.
265
+
205
266
  ## Native inline UI {#native-inline-ui}
206
267
 
207
268
  Use this when your actions return structured data — a list of records, a chart dataset, a status summary — that should render as a real UI component inside the chat thread rather than a plain text description. You define a `chatUI` renderer on the action, and Agent-Native renders it as a first-party React component: no iframes, no separate rendering path.
@@ -435,6 +435,8 @@ Core also records metrics once the host registers a meter provider with `registe
435
435
 
436
436
  On metrics, `gen_ai.tool.name` is a framework action's name or `other`, and `gen_ai.request.model` is the model id only when the engine lists it as supported, otherwise `_OTHER`. App-defined tools and caller-supplied model ids therefore cannot create unbounded series; spans keep the exact values.
437
437
 
438
+ A failed model call's `error.type` on `gen_ai.client.operation.duration` is the provider's HTTP status when the call returned a 4xx or 5xx (`http_429`, `http_529`), otherwise `rate_limit`, `context_overflow`, `provider_error`, or `no_model_connected` when the engine's error code names one, otherwise `_OTHER`. Each retry is its own call with its own `error.type`, so a run that retries a throttled request several times records several `http_429` calls even if it finishes.
439
+
438
440
  `http.route` is set on every request and comes from a closed set: a framework endpoint's route template (`/_agent-native/auth/session`, `/_agent-native/agent-chat/runs/:runId/events`), an action's declared template, the app's own Nitro file route (`/api/clips/:id`), or a bucket. The buckets are `/_agent-native/*`, `/mcp/*`, and `/.well-known/*` for an unlisted path in those namespaces, `/api/*` for any other API path, `static` for file requests, `page` for any other `GET` or `HEAD`, and `other`. A raw request path is never recorded. The `http.server` span carries the same value.
439
441
 
440
442
  ## Connecting an OpenTelemetry back end {#otel-provider}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.209.0-nightly-20261014153330",
3
+ "version": "0.209.0",
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": {
@@ -660,6 +660,7 @@
660
660
  "dependencies": {
661
661
  "@anthropic-ai/sdk": "^0.90.0",
662
662
  "@babel/parser": "8.0.7",
663
+ "@better-auth/core": "1.7.6",
663
664
  "@clack/prompts": "^1.7.0",
664
665
  "@mcp-b/webmcp-polyfill": "^5.1.0",
665
666
  "@modelcontextprotocol/client": "2.0.0",
@@ -703,8 +704,8 @@
703
704
  "yaml": "^2.9.0",
704
705
  "yjs": "^13.6.33",
705
706
  "zod": "^4.3.6",
706
- "@agent-native/agentkit": "^0.209.0-nightly-20261014153330",
707
- "@agent-native/recap-cli": "^0.5.71"
707
+ "@agent-native/agentkit": "^0.209.0",
708
+ "@agent-native/recap-cli": "^0.5.72"
708
709
  },
709
710
  "devDependencies": {
710
711
  "@ai-sdk/anthropic": "^3.0.71",
@@ -774,7 +775,7 @@
774
775
  "xlsx": "^0.18.5"
775
776
  },
776
777
  "peerDependencies": {
777
- "@agent-native/core-corpus": "0.209.0-nightly-20261014153330",
778
+ "@agent-native/core-corpus": ">=0.196.0",
778
779
  "@ai-sdk/anthropic": ">=3",
779
780
  "@ai-sdk/cohere": ">=3",
780
781
  "@ai-sdk/google": ">=3",
@@ -12,7 +12,6 @@ Images and PDFs use an upload attachment with a matching base64 data URL:
12
12
  contentType: "image/webp" | "image/png" | "image/jpeg" | "image/gif" | "application/pdf",
13
13
  name: string,
14
14
  dataUrl: "data:<contentType>;base64,<BASE64_CONTENT>",
15
- size: number,
16
15
  id: string
17
16
  }
18
17
  ```
@@ -26,12 +25,11 @@ Text and JSON files provide decoded contents instead of a data URL:
26
25
  name: string,
27
26
  dataUrl: "",
28
27
  text: string,
29
- size: number,
30
28
  id: string
31
29
  }
32
30
  ```
33
31
 
34
- Set `size` to the UTF-8 byte length of `text`. Use a stable or unique `id` for each attachment.
32
+ Send any other text-based file (Markdown, CSV, source code, plain text) as `text/plain` with its real file name, for example `notes.md`. Use a stable or unique `id` for each attachment. A malformed attachment is rejected with `invalid_attachment` and a message naming the problem; fix that attachment and retry, because an unchanged retry fails the same way.
35
33
 
36
34
  ## Public URLs
37
35
 
@@ -21,14 +21,19 @@ On a browser host the host is an orchestrator, not the build environment:
21
21
  (archetype, direction, first viewport, sample-data plan, agent moments).
22
22
  2. Call `start-workspace-app-creation` on the Agent-Native Dispatch MCP
23
23
  connector (`agent-native-dispatch`). Put the brief and the design decisions
24
- in `prompt`; pass an `appId`, a short `description`, the `template`, the
25
- selected `resourceIds`, and source files as `attachments`
26
- ([attachments.md](attachments.md)). The tool's schema describes each
27
- argument. Reference resources by id; never paste whole knowledge files or
28
- binary data into `prompt`, and do not assume an attachment becomes a file in
29
- the generated workspace. A workbook cannot be attached (attachments take
30
- images, PDF, text, and JSON): pass a bounded CSV rendering as text, or a
31
- public URL, and say what was left out.
24
+ in `prompt`; pass an `appId`, a short `description`, and the `template`.
25
+ The tool's schema describes each argument. Send the Project's own text as
26
+ `attachments` ([attachments.md](attachments.md)), never as a summary: the
27
+ Project instructions as `project-instructions.md` and every knowledge file,
28
+ each verbatim as `text/plain`. Never paste whole knowledge files or binary
29
+ data into `prompt`. Attachments are model context
30
+ and are not copied into the generated workspace, so tell the Builder agent in
31
+ `prompt` to persist what the app needs: knowledge files as app resources, the
32
+ instructions as the in-app agent's instructions. If a file cannot be
33
+ reproduced verbatim (not in context, too large), say so in the brief and the
34
+ report; never swap in a digest silently. A workbook cannot be attached
35
+ (attachments take images, PDF, text, and JSON): pass a bounded CSV rendering
36
+ as text, or a public URL, and say what was left out.
32
37
  3. Report what Dispatch actually returned: the branch, the path, and the status.
33
38
  The browser host cannot run or inspect the app, and a returned path can 404
34
39
  until the branch merges and deploys, so the report ends at pending or
@@ -20,7 +20,7 @@ heading; write `n/a` where a heading does not apply.
20
20
  Source and provenance: type (thread, skill, Project, spreadsheet, export), file names, ids, what was read and what was not
21
21
  Project goal: the user and the repeatable job, in one sentence
22
22
  Configuration and constraints: audience, rules, output standards, approved tools
23
- Knowledge sources: reference files the app ships with, by name or id
23
+ Knowledge sources: reference files the app ships with, by name
24
24
  Repeatable workflow: the job's trigger, steps, and outcome, in the source's own words
25
25
  Inputs and outputs: what comes in, what the user gets back, fixed output shapes
26
26
  Judgment and review points: 1-3 agent moments, each tied to the object it acts on; what the user confirms
@@ -38,7 +38,7 @@ App design: archetype, direction, first-viewport sketch, sample-data plan
38
38
 
39
39
  - Name the latest successful, repeatable job. A walkthrough of one example is
40
40
  evidence for the job, not the job.
41
- - Keep references bounded: a file name, URL, resource id, or short summary
41
+ - Keep references bounded: a file name, URL, or short summary
42
42
  instead of a pasted document. No secrets, credentials, or customer data.
43
43
  - Corrections the user made in the source are product rules. Record each one
44
44
  as an invariant.