@agent-native/core 0.144.3 → 0.145.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 (40) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/clips/changelog/2026-08-06-desktop-full-screen-recordings-now-normalize-microphone-leve.md +6 -0
  3. package/corpus/templates/clips/desktop/src-tauri/src/native_screen/custom_capture.rs +185 -69
  4. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +47 -4
  5. package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -1
  6. package/corpus/templates/slides/server/plugins/agent-chat.ts +1 -1
  7. package/dist/agent/production-agent.d.ts +6 -0
  8. package/dist/collab/routes.d.ts +1 -1
  9. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  10. package/dist/framework-tools.d.ts +126 -0
  11. package/dist/framework-tools.js +114 -0
  12. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  13. package/dist/notifications/routes.d.ts +4 -4
  14. package/dist/observability/routes.d.ts +3 -3
  15. package/dist/progress/routes.d.ts +1 -1
  16. package/dist/provider-api/actions/custom-provider-registration.d.ts +2 -2
  17. package/dist/resources/handlers.d.ts +1 -1
  18. package/dist/secrets/routes.d.ts +3 -3
  19. package/dist/server/action-discovery.d.ts +27 -0
  20. package/dist/server/action-discovery.js +89 -0
  21. package/dist/server/agent-chat/action-filters-a2a.d.ts +11 -0
  22. package/dist/server/agent-chat/action-filters-a2a.js +17 -1
  23. package/dist/server/agent-chat/framework-prompts.d.ts +2 -0
  24. package/dist/server/agent-chat/plugin-options.d.ts +30 -0
  25. package/dist/server/agent-chat/prompt-resources.d.ts +4 -1
  26. package/dist/server/agent-chat/prompt-resources.js +8 -2
  27. package/dist/server/agent-chat-plugin.js +122 -71
  28. package/dist/server/prompts/framework-core-compact.d.ts +5 -0
  29. package/dist/server/prompts/framework-core-compact.js +28 -12
  30. package/dist/server/prompts/framework-core.d.ts +5 -0
  31. package/dist/server/prompts/framework-core.js +33 -16
  32. package/dist/server/prompts/index.d.ts +1 -1
  33. package/dist/server/prompts/index.js +1 -1
  34. package/dist/server/prompts/shared-rules.d.ts +12 -4
  35. package/dist/server/prompts/shared-rules.js +14 -4
  36. package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +6 -3
  37. package/docs/content/deployment.mdx +47 -13
  38. package/docs/content/key-concepts.mdx +13 -6
  39. package/package.json +3 -3
  40. package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +6 -3
@@ -7,6 +7,7 @@
7
7
  * rule) and 12–13 (planning discipline; collaborate through uncertainty) are
8
8
  * reproduced verbatim in both prompts — keep them here.
9
9
  */
10
+ import { frameworkGroupEnabled, } from "../../framework-tools.js";
10
11
  import { normalizeDatabaseToolsMode, } from "../../scripts/db/tool-mode.js";
11
12
  const DEFAULT_PROVIDER_ACTIONS = [
12
13
  "provider-search",
@@ -64,14 +65,23 @@ export const SHARED_RULE_9 = `9. **Never fabricate — verify results, report fa
64
65
  - **Never fabricate success from tool errors** — when a tool call returns an error (marked \`isError: true\`, contains "Command failed", "Error:", or non-zero exit output), the operation FAILED; do not synthesize a success narrative or describe what it "would have" produced. Report the failure verbatim (this applies especially to \`bash(command="pnpm action ...")\` calls). Before telling the user a mutating action (create/update/delete/send/publish) is done, confirm it actually landed — check the tool result, or read the refreshed \`<current-screen>\` / re-query the data; having *called* an action is not proof it worked. If a result is ambiguous, check rather than assume.
65
66
  - **Recover instead of giving up** — treat a failure or ambiguous result as a signal to retry the obvious fix, try an alternate tool or approach, or clearly hand the blocker back with what you tried; never silently give up, and never paper over a failure by claiming success.`;
66
67
  /**
67
- * Rule 12 (const name retained as SHARED_RULE_14 for import stability) —
68
- * Planning and progress. Deliberately states only when to open a progress run;
69
- * the start/update/complete discipline lives in `manage-progress`'s own tool
68
+ * Rule 12 (name retained as `sharedRule14` for import stability) — Planning and
69
+ * progress. Deliberately states only when to open a progress run; the
70
+ * start/update/complete discipline lives in `manage-progress`'s own tool
70
71
  * description (packages/core/src/progress/actions.ts). Re-adding the mechanics
71
72
  * here means every turn pays for guidance the model only needs once it has the
72
73
  * tool loaded.
74
+ *
75
+ * Drops the `manage-progress` reference when the `automation` group is off, so
76
+ * the rule never names a tool the request does not carry. The planning
77
+ * discipline itself still applies — only the tool call goes away.
73
78
  */
74
- export const SHARED_RULE_14 = `12. **Plan and track multi-step work** — When a task spans several real steps the user would want to watch, open a \`manage-progress\` run so the work is visible while it's still in flight, and keep it updated as you go rather than after the fact; the tool's own description carries the full discipline. Skip it for single-action lookups, simple reads, and anything that finishes in one tool call — never create single-step plans.`;
79
+ export function sharedRule14(options) {
80
+ if (!frameworkGroupEnabled(options?.disabledFrameworkGroups, "automation")) {
81
+ return `12. **Plan and track multi-step work** — When a task spans several real steps, work through them in order and tell the user where you are as you go rather than only at the end. Skip ceremony for single-action lookups, simple reads, and anything that finishes in one tool call.`;
82
+ }
83
+ return `12. **Plan and track multi-step work** — When a task spans several real steps the user would want to watch, open a \`manage-progress\` run so the work is visible while it's still in flight, and keep it updated as you go rather than after the fact; the tool's own description carries the full discipline. Skip it for single-action lookups, simple reads, and anything that finishes in one tool call — never create single-step plans.`;
84
+ }
75
85
  /**
76
86
  * Rule 14 — Relay agent warnings. Named for what it is rather than its number,
77
87
  * since the `SHARED_RULE_14`/`15` names above no longer match theirs.
@@ -217,9 +217,12 @@ POST /_agent-native/extensions
217
217
 
218
218
  HTTP creation is disabled by default. The host app must set
219
219
  `extensionTools: true` on `createCoreRoutesPlugin()` as well as
220
- `createAgentChatPlugin()`; otherwise authenticated collection `POST` requests
221
- return `403` while existing extension runtime, read, edit, and deep-link routes
222
- remain available for compatibility.
220
+ `frameworkTools: { extensions: true }` on `createAgentChatPlugin()`; otherwise
221
+ authenticated collection `POST` requests return `403` while existing extension
222
+ runtime, read, edit, and deep-link routes remain available for compatibility.
223
+ (`extensionTools` on the agent-chat plugin is the deprecated spelling of
224
+ `frameworkTools.extensions`; the core-routes option keeps its own name because
225
+ it gates route mounting rather than agent tools.)
223
226
 
224
227
  The action accepts:
225
228
 
@@ -580,16 +580,19 @@ Rotate signing/session keys by replacing the env var on every instance and redep
580
580
 
581
581
  ## Production Agent Tools {#production-agent-tools}
582
582
 
583
- Production agents get the app's registered actions plus framework tools from
584
- the agent chat plugin. SQL inspection is enabled by default, while database
585
- writes go through typed app actions unless the app explicitly opts into raw
586
- write tools:
583
+ Production agents get the app's registered actions plus the framework's own
584
+ tools. `frameworkTools` selects which of those framework tools this app exposes.
585
+ Every group defaults to today's behavior, so omitting the option changes
586
+ nothing:
587
587
 
588
588
  ```ts filename="server/plugins/agent-chat.ts"
589
589
  export default createAgentChatPlugin({
590
- // Default: "read"
591
- databaseTools: "read", // "write" | "read" | "off"
592
- extensionTools: true,
590
+ frameworkTools: {
591
+ database: "read", // "write" | "read" | "off" — default "read"
592
+ extensions: true, // default false
593
+ sharing: false, // this app has no share surface
594
+ review: false,
595
+ },
593
596
  });
594
597
  ```
595
598
 
@@ -599,17 +602,48 @@ export default createCoreRoutesPlugin({
599
602
  });
600
603
  ```
601
604
 
602
- - `databaseTools: "read"` — default. Registers only `db-schema` and `db-query`;
605
+ `database` and `extensions` accept the values the old top-level flags did:
606
+
607
+ - `database: "read"` — default. Registers only `db-schema` and `db-query`;
603
608
  agents inspect data with SQL but must use typed app actions for writes.
604
- - `databaseTools: "write"` or `true` — additionally registers `db-exec` and
609
+ - `database: "write"` or `true` — additionally registers `db-exec` and
605
610
  `db-patch` for deliberate raw SQL maintenance. Writes are scoped to the
606
611
  current user/org and schema changes are blocked.
607
- - `databaseTools: "off"` or `false` — removes raw database tools from the
612
+ - `database: "off"` or `false` — removes raw database tools from the
608
613
  agent surface so the app's actions are the only data access path.
609
- - `extensionTools: true` — opts the app into framework extension-management
614
+ - `extensions: true` — opts the app into framework extension-management
610
615
  actions and prompt guidance (`create-extension`, `update-extension`, etc.).
611
- Set it on both plugins to also allow authenticated REST creation. Extensions
612
- are disabled by default.
616
+ Set `extensionTools: true` on the core-routes plugin as well to allow
617
+ authenticated REST creation. Extensions are disabled by default.
618
+
619
+ The remaining groups are booleans, all on by default: `sharing`, `review`,
620
+ `history`, `featureFlags`, `localization`, `audit`, `contextXray`,
621
+ `userProfile`, `automation`, `docs`, `resources`, `web`, `workspaceApps`,
622
+ `chat`, and `email`. Use `frameworkTools: "minimal"` to turn every group off at
623
+ once for a voice-first or single-purpose app, or
624
+ `frameworkTools: { preset: "minimal", resources: true }` to keep just one — an
625
+ explicit group key always wins over the preset.
626
+
627
+ Switching a group off removes it from the **agent** surfaces only: interactive
628
+ chat, MCP, A2A, and background runs. The matching HTTP action routes stay
629
+ mounted, because the UI reaches them through client hooks — disabling `sharing`
630
+ must not 404 a share dialog that is still on screen. Weigh that parity cost
631
+ before using it: the framework's contract is that anything the UI can do the
632
+ agent can do, so `sharing: false` alongside a visible share button is a
633
+ deliberate break, and only makes sense when the app has no such surface at all.
634
+
635
+ Framework tools are no longer promoted into the first model request by default,
636
+ independent of this option. They stay in the searchable registry and load
637
+ through `tool-search`, or immediately if the app names them in
638
+ `initialToolNames`.
639
+
640
+ <Callout tone="warning">
641
+ The top-level `databaseTools` and `extensionTools` options are deprecated in
642
+ favor of `frameworkTools.database` and `frameworkTools.extensions`. They are
643
+ still honored, but setting a top-level flag and its `frameworkTools`
644
+ equivalent to conflicting values throws at plugin startup rather than booting
645
+ with a tool surface nobody chose.
646
+ </Callout>
613
647
 
614
648
  ## Production Code Execution {#production-code-execution}
615
649
 
@@ -254,12 +254,19 @@ pnpm action db-query --sql "SELECT * FROM forms"
254
254
  ```
255
255
 
256
256
  The production agent chat plugin defaults raw SQL tools to read-only
257
- (`databaseTools: "read"`), so agents inspect app-owned data with `db-schema` /
258
- `db-query` and perform writes through typed app actions. Set
259
- `databaseTools: "write"` (or `true`) only for deliberate maintenance surfaces
260
- that should also expose scoped `db-exec` / `db-patch`; set
261
- `databaseTools: "off"` / `false` to require typed app actions for all data
262
- access.
257
+ (`frameworkTools: { database: "read" }`), so agents inspect app-owned data with
258
+ `db-schema` / `db-query` and perform writes through typed app actions. Set
259
+ `database: "write"` (or `true`) only for deliberate maintenance surfaces that
260
+ should also expose scoped `db-exec` / `db-patch`; set `database: "off"` /
261
+ `false` to require typed app actions for all data access.
262
+
263
+ `frameworkTools` governs the rest of the framework's own tools the same way —
264
+ sharing, review comments, version history, feature flags, localization, audit,
265
+ context X-Ray, profile, automations, docs, resources, web, cross-app delegation,
266
+ chat, and email. See
267
+ [Production Agent Tools](/docs/deployment#production-agent-tools) for the full
268
+ list, the `"minimal"` preset, and why disabling a group leaves its HTTP routes
269
+ mounted.
263
270
 
264
271
  ## Agent chat bridge {#agent-chat-bridge}
265
272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.144.3",
3
+ "version": "0.145.0",
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": {
@@ -412,8 +412,8 @@
412
412
  "y-protocols": "^1.0.7",
413
413
  "yjs": "^13.6.31",
414
414
  "zod": "^4.3.6",
415
- "@agent-native/toolkit": "^0.13.3",
416
- "@agent-native/recap-cli": "0.5.3"
415
+ "@agent-native/recap-cli": "0.5.3",
416
+ "@agent-native/toolkit": "^0.13.3"
417
417
  },
418
418
  "devDependencies": {
419
419
  "@ai-sdk/anthropic": "^3.0.71",
@@ -217,9 +217,12 @@ POST /_agent-native/extensions
217
217
 
218
218
  HTTP creation is disabled by default. The host app must set
219
219
  `extensionTools: true` on `createCoreRoutesPlugin()` as well as
220
- `createAgentChatPlugin()`; otherwise authenticated collection `POST` requests
221
- return `403` while existing extension runtime, read, edit, and deep-link routes
222
- remain available for compatibility.
220
+ `frameworkTools: { extensions: true }` on `createAgentChatPlugin()`; otherwise
221
+ authenticated collection `POST` requests return `403` while existing extension
222
+ runtime, read, edit, and deep-link routes remain available for compatibility.
223
+ (`extensionTools` on the agent-chat plugin is the deprecated spelling of
224
+ `frameworkTools.extensions`; the core-routes option keeps its own name because
225
+ it gates route mounting rather than agent tools.)
223
226
 
224
227
  The action accepts:
225
228