@agent-native/core 0.233.0 → 0.234.0-nightly-20261125004429

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 (70) hide show
  1. package/dist/agent/engine/ai-sdk-engine.d.ts +1 -0
  2. package/dist/agent/engine/ai-sdk-engine.js +36 -1
  3. package/dist/agent/engine/anthropic-engine.js +12 -1
  4. package/dist/agent/production-agent.d.ts +7 -0
  5. package/dist/agent/tool-search.js +34 -4
  6. package/dist/application-state/handlers.d.ts +3 -3
  7. package/dist/cli/skills-content/an-skill.d.ts +1 -1
  8. package/dist/cli/skills-content/an-skill.js +30 -13
  9. package/dist/client/action-get-batch.d.ts +1 -0
  10. package/dist/client/action-get-batch.js +5 -1
  11. package/dist/client/application-state.js +65 -7
  12. package/dist/client/chat/agentkit-protocol.js +15 -3
  13. package/dist/client/feature-flags/use-feature-flag.js +3 -0
  14. package/dist/client/labs/use-lab.js +2 -0
  15. package/dist/client/session-identity.d.ts +1 -0
  16. package/dist/client/session-identity.js +7 -0
  17. package/dist/client/use-action.d.ts +1 -0
  18. package/dist/client/use-action.js +19 -6
  19. package/dist/collab/struct-routes.d.ts +1 -1
  20. package/dist/framework-package-versions.json +8 -8
  21. package/dist/identity/rekey.js +55 -2
  22. package/dist/jobs/background-automation-runner.d.ts +7 -1
  23. package/dist/jobs/background-automation-runner.js +18 -2
  24. package/dist/mcp/build-server.d.ts +2 -0
  25. package/dist/mcp/build-server.js +45 -4
  26. package/dist/mcp/embed-app.js +52 -1
  27. package/dist/mcp/skills-extension.d.ts +42 -0
  28. package/dist/mcp/skills-extension.js +61 -0
  29. package/dist/org/migrations.d.ts +1 -1
  30. package/dist/org/workspace-app-access.js +2 -1
  31. package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
  32. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  33. package/dist/resources/handlers.d.ts +2 -2
  34. package/dist/server/action-discovery.js +7 -37
  35. package/dist/server/action-files.d.ts +15 -0
  36. package/dist/server/action-files.js +71 -0
  37. package/dist/server/agent-chat/mcp-options.d.ts +3 -0
  38. package/dist/server/agent-chat/mcp-options.js +1 -0
  39. package/dist/server/agent-chat/plugin-options.d.ts +27 -3
  40. package/dist/server/agent-chat-plugin.d.ts +4 -5
  41. package/dist/server/agent-chat-plugin.js +34 -3
  42. package/dist/server/agent-teams.d.ts +15 -3
  43. package/dist/server/agent-teams.js +26 -4
  44. package/dist/server/dev-database-lifecycle.d.ts +11 -0
  45. package/dist/server/dev-database-lifecycle.js +11 -5
  46. package/dist/server/first-touch-route.d.ts +1 -1
  47. package/dist/server/index.d.ts +1 -0
  48. package/dist/shared/analytics-panel-capture.d.ts +2 -1
  49. package/dist/shared/analytics-panel-capture.js +1 -0
  50. package/dist/shared/reasoning-effort.d.ts +9 -0
  51. package/dist/shared/reasoning-effort.js +19 -0
  52. package/dist/templates/chat/.agents/skills/actions/SKILL.md +2 -0
  53. package/dist/templates/default/.agents/skills/actions/SKILL.md +2 -0
  54. package/dist/templates/headless/.agents/skills/actions/SKILL.md +2 -0
  55. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +2 -0
  56. package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +7 -2
  57. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +8 -8
  58. package/dist/templates/workspace-root/AGENTS.md +3 -0
  59. package/dist/templates/workspace-root/README.md +7 -2
  60. package/dist/vite/action-types-plugin.js +13 -42
  61. package/dist/vite/client.js +28 -17
  62. package/package.json +3 -3
  63. package/src/templates/chat/.agents/skills/actions/SKILL.md +2 -0
  64. package/src/templates/default/.agents/skills/actions/SKILL.md +2 -0
  65. package/src/templates/headless/.agents/skills/actions/SKILL.md +2 -0
  66. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +2 -0
  67. package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +7 -2
  68. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +8 -8
  69. package/src/templates/workspace-root/AGENTS.md +3 -0
  70. package/src/templates/workspace-root/README.md +7 -2
@@ -43,6 +43,7 @@ export const ANALYTICS_CAPTURE_SOURCES = [
43
43
  "demo",
44
44
  "prometheus",
45
45
  "program",
46
+ "postgres",
46
47
  ];
47
48
  const MAX_FILTERS = 40;
48
49
  const MAX_CELL_TEXT = 500;
@@ -20,6 +20,15 @@ export declare function claudeAdaptiveThinking(model: string): {
20
20
  type: "adaptive";
21
21
  display?: "summarized";
22
22
  };
23
+ /**
24
+ * Beta value that unlocks `thinking.block_binding`. A signed thinking block is
25
+ * bound to the system prompt, tools and messages before it, so a tool list that
26
+ * changes mid-turn (tool-search loading a tool, a guard expanding the tool
27
+ * surface) makes the API reject the replayed block with a 400.
28
+ */
29
+ export declare const ANTHROPIC_THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
30
+ /** Models whose thinking blocks are prefix-bound and accept `block_binding`. */
31
+ export declare function supportsAnthropicThinkingBlockBinding(model: string | undefined): boolean;
23
32
  export declare function anthropicManualThinkingBudget(effort: ReasoningEffort): 1024 | 4096 | 8000 | 16000 | 32000;
24
33
  export declare function allowsSamplingParams(args: {
25
34
  model: string | undefined;
@@ -161,6 +161,25 @@ export function claudeAdaptiveThinking(model) {
161
161
  ? { type: "adaptive", display: "summarized" }
162
162
  : { type: "adaptive" };
163
163
  }
164
+ /**
165
+ * Beta value that unlocks `thinking.block_binding`. A signed thinking block is
166
+ * bound to the system prompt, tools and messages before it, so a tool list that
167
+ * changes mid-turn (tool-search loading a tool, a guard expanding the tool
168
+ * surface) makes the API reject the replayed block with a 400.
169
+ */
170
+ export const ANTHROPIC_THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
171
+ /** Models whose thinking blocks are prefix-bound and accept `block_binding`. */
172
+ export function supportsAnthropicThinkingBlockBinding(model) {
173
+ if (!model)
174
+ return false;
175
+ const id = model.toLowerCase().replace(/^anthropic\//, "");
176
+ return (id.includes("fable-5") ||
177
+ id.includes("mythos-5") ||
178
+ id.includes("sonnet-5") ||
179
+ id.includes("haiku-5-5") ||
180
+ id.includes("haiku-5.5") ||
181
+ claudeOpusAtLeast(id, 5, 0));
182
+ }
164
183
  export function anthropicManualThinkingBudget(effort) {
165
184
  switch (effort) {
166
185
  case "low":
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -131,8 +131,13 @@ not a single app that clones every provider integration.
131
131
 
132
132
  ## Don't
133
133
 
134
- - Do not clone Mail, Calendar, Analytics, Brain, Assets, or another first-party
135
- app just to reuse its data. Delegate or link to the existing app.
134
+ - Do not clone Mail, Calendar, Analytics, Brain, Assets, Content, or another
135
+ first-party app just to reuse its data. Delegate or link to the existing app.
136
+ - Do not ask for a Content token, or keep one in an environment variable, to
137
+ save pages or Collection rows. Message Content to do it as the signed-in
138
+ person: `call-agent` to `content` from the agent, or `invokeAgent()` from a
139
+ server request, passing the `userEmail`, `orgDomain` and `orgSecret` that
140
+ `resolveA2ACallerAuth()` returns.
136
141
  - Do not hide a multi-provider workflow inside a giant "misc tools" app.
137
142
  - Do not add one-off provider endpoints when `provider-api-request` can express
138
143
  the upstream API safely.
@@ -247,19 +247,19 @@ connection or page WebMCP. Route UI through
247
247
  unless they explicitly opt into the full catalog, and
248
248
  `publicAgent.expose` remains the action-level opt-in for safe read/ingest tools
249
249
  outside the compact MCP Apps catalog. Apps can set
250
- `externalAgents.authenticatedReads: "auto"` to automatically advertise every
251
- action that is GET + `readOnly` + `publicAgent.requiresAuth`, instead of
252
- maintaining a long connector allow-list. This policy never includes writes by
253
- default. Set `writes: "allowlisted"` to serve the writes your actions choose to
254
- serve; `writes: "ask_app_only"`, the default with automatic reads, is
255
- deprecated and warns at startup, so keep a write in the app with
256
- `mcpTool: false` instead. Use `denyActions` for defense-in-depth vetoes.
250
+ `externalAgents.authenticatedReads: "auto"` advertises GET + `readOnly` +
251
+ `publicAgent.requiresAuth` actions without a connector allow-list. Writes are
252
+ excluded by default. Set `writes: "allowlisted"` to serve selected writes;
253
+ `writes: "ask_app_only"`, the automatic-reads default, is deprecated and warns at startup. Keep a write in
254
+ the app with `mcpTool: false`. Use `denyActions` for defense-in-depth vetoes.
257
255
  `tool-search` finds only the tools the connection is served, listed or
258
256
  `mcpTool: "search"` ones that `call-tool` runs. It names matching actions
259
257
  outside them under `notServed`, for the caller to hand to `ask_app`. Do not rely on
260
258
  action-specific `mcpApp` resources appearing in ChatGPT/Claude discovery by
261
259
  default; use `open_app` for the
262
- first-class app embed path. If a specific
260
+ first-class app embed path. For "show", "open", "draft", "chart", calendar, or
261
+ dashboard asks, call `open_app` after the read or save so the host opens the pane
262
+ instead of drawing its own card. If a specific
263
263
  action truly must remain visible in that compact app-host catalog, set
264
264
  `mcpApp.compactCatalog: true` as a rare escape hatch.
265
265
 
@@ -57,6 +57,9 @@ resources to All apps only for global guidance.
57
57
  - Reuse provider connections and scoped resolvers. Framework apps use
58
58
  `resolveSecret`; workspace apps use the connector helper. Request missing
59
59
  keys through Dispatch vault, not a non-admin's `.env`.
60
+ - Save to Content as the signed-in person, in a message: `call-agent` to
61
+ `content`, or `invokeAgent()` with `userEmail`, `orgDomain` and `orgSecret`
62
+ from `resolveA2ACallerAuth()`. Never ask for a Content token or put one in env.
60
63
  - Verify `/<app-id>` on the workspace gateway serves the new app before saying
61
64
  it is created; app servers start lazily.
62
65
 
@@ -140,12 +140,17 @@ separate workspace app registry to edit. React Router apps must keep the
140
140
  For requests phrased as creating an "agent", classify the scope first: simple
141
141
  recurring Dispatch behavior can stay in Dispatch, while a robust app-like
142
142
  teammate should become a real workspace app listed with the rest of the apps.
143
- First-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch should be
144
- treated as existing hosted or connected neighbors. If a new app needs access to
143
+ First-party apps such as Mail, Calendar, Analytics, Brain, Assets, Content, and Dispatch
144
+ should be treated as existing hosted or connected neighbors. If a new app needs access to
145
145
  their data or agents, link/delegate to those apps through the workspace/A2A
146
146
  path rather than creating wrapper apps, child apps, or cloned template copies
147
147
  inside the new app. Only fork one of those apps when the user explicitly asks
148
148
  for a customized copy.
149
+ To save pages or Collection rows to Content, message Content to do the work as
150
+ the signed-in person: `call-agent` to `content` from the agent, or
151
+ `invokeAgent()` from a server request, passing the `userEmail`, `orgDomain` and
152
+ `orgSecret` that `resolveA2ACallerAuth()` returns. Never ask the user for a
153
+ Content token or keep one in an environment variable.
149
154
 
150
155
  ## Editing shared behavior
151
156
 
@@ -1,5 +1,6 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
+ import { scanActionDir } from "../server/action-files.js";
3
4
  const ACTION_REGISTRY_REFRESH_DELAY_MS = 300;
4
5
  const SKIP_FILES = new Set([
5
6
  "helpers",
@@ -442,45 +443,19 @@ const CORE_SHARING_ACTIONS = [
442
443
  specifier: "@agent-native/core/review/suggestions/actions/decide-resource-suggestion",
443
444
  },
444
445
  ];
445
- function isRuntimeSourceFile(filename) {
446
- if (!/\.(ts|js)$/.test(filename))
447
- return false;
448
- if (/\.d\.ts$/.test(filename))
449
- return false;
450
- if (/\.(test|spec)\.(ts|js)$/.test(filename))
451
- return false;
452
- return true;
453
- }
454
446
  function scanActionFiles(actionsDir) {
455
- let files;
456
- try {
457
- files = fs.readdirSync(actionsDir);
458
- }
459
- catch {
460
- return [];
461
- }
462
- return files.filter((f) => {
463
- if (!isRuntimeSourceFile(f))
464
- return false;
465
- const name = f.replace(/\.(ts|js)$/, "");
466
- if (name.startsWith("_"))
467
- return false;
468
- if (SKIP_FILES.has(name))
469
- return false;
447
+ return scanActionDir(actionsDir, SKIP_FILES).filter(({ relPath }) => {
470
448
  try {
471
- const content = fs.readFileSync(path.join(actionsDir, f), "utf-8");
449
+ const content = fs.readFileSync(path.join(actionsDir, relPath), "utf-8");
472
450
  const reexportsDefaultAction = /export\s*\{\s*default\s*\}\s*from\s*["'][^"']+["']/.test(content);
473
451
  const exportsActionFactory = /export\s+default\s+(?:(?:create|define)[A-Z][A-Za-z0-9]*Action|defineActionFactory)\s*\(/.test(content);
474
- if (!content.includes("defineAction") &&
475
- !reexportsDefaultAction &&
476
- !exportsActionFactory) {
477
- return false;
478
- }
452
+ return (content.includes("defineAction") ||
453
+ reexportsDefaultAction ||
454
+ exportsActionFactory);
479
455
  }
480
456
  catch {
481
457
  return false;
482
458
  }
483
- return true;
484
459
  });
485
460
  }
486
461
  function toIdent(name) {
@@ -582,22 +557,18 @@ function generateActionArtifacts(actionsDir, projectRoot) {
582
557
  const workspaceActionFiles = workspaceActionsDir
583
558
  ? scanActionFiles(workspaceActionsDir)
584
559
  : [];
585
- const templateActionNames = new Set(actionFiles.map((f) => f.replace(/\.(ts|js)$/, "")));
560
+ const templateActionNames = new Set(actionFiles.map((f) => f.name));
586
561
  const registeredActionNames = new Set(templateActionNames);
587
- const actionSources = actionFiles.map((f) => {
588
- const name = f.replace(/\.(ts|js)$/, "");
589
- return {
590
- name,
591
- relPath: `${relActionsDir}/${name}`,
592
- };
593
- });
562
+ const actionSources = actionFiles.map(({ name, relPath }) => ({
563
+ name,
564
+ relPath: `${relActionsDir}/${relPath.replace(/\.(ts|js)$/, "")}`,
565
+ }));
594
566
  if (workspaceActionsDir) {
595
- for (const f of workspaceActionFiles) {
596
- const name = f.replace(/\.(ts|js)$/, "");
567
+ for (const { name, relPath: fileRel } of workspaceActionFiles) {
597
568
  if (registeredActionNames.has(name))
598
569
  continue;
599
570
  const relPath = path
600
- .relative(outDir, path.join(workspaceActionsDir, name))
571
+ .relative(outDir, path.join(workspaceActionsDir, fileRel.replace(/\.(ts|js)$/, "")))
601
572
  .replace(/\\/g, "/");
602
573
  actionSources.push({ name, relPath });
603
574
  registeredActionNames.add(name);
@@ -3615,10 +3615,33 @@ async function requestNitroDevDatabaseLifecycleEvent(environment, requestEvent,
3615
3615
  if (!hot?.on || !hot.off || !hot.send) {
3616
3616
  throw new Error(`Nitro dev environment cannot acknowledge database ${operation} before restart.`);
3617
3617
  }
3618
+ const on = hot.on.bind(hot);
3619
+ const off = hot.off.bind(hot);
3620
+ const sendPayload = hot.send.bind(hot);
3618
3621
  await new Promise((resolve, reject) => {
3619
3622
  const cleanup = () => {
3620
3623
  clearTimeout(timeout);
3621
- hot.off?.(acknowledgementEvent, onClosed);
3624
+ off("agent-native:dev-database-ready", onReady);
3625
+ off(acknowledgementEvent, onClosed);
3626
+ };
3627
+ const send = (event, data) => {
3628
+ try {
3629
+ sendPayload({ type: "custom", event, data });
3630
+ }
3631
+ catch (error) {
3632
+ cleanup();
3633
+ reject(error);
3634
+ }
3635
+ };
3636
+ const waitFor = (stage) => setTimeout(() => {
3637
+ cleanup();
3638
+ reject(new NitroDevDatabaseLifecycleTimeout(`Nitro dev environment did not ${stage} before restart.`));
3639
+ }, 5_000);
3640
+ const onReady = () => {
3641
+ off("agent-native:dev-database-ready", onReady);
3642
+ clearTimeout(timeout);
3643
+ timeout = waitFor(`acknowledge database ${operation}`);
3644
+ send(requestEvent, { requestId });
3622
3645
  };
3623
3646
  const onClosed = (payload) => {
3624
3647
  if (payload?.requestId !== requestId)
@@ -3631,22 +3654,10 @@ async function requestNitroDevDatabaseLifecycleEvent(environment, requestEvent,
3631
3654
  resolve();
3632
3655
  }
3633
3656
  };
3634
- const timeout = setTimeout(() => {
3635
- cleanup();
3636
- reject(new NitroDevDatabaseLifecycleTimeout(`Nitro dev environment did not acknowledge database ${operation} before restart.`));
3637
- }, 5_000);
3638
- hot.on?.(acknowledgementEvent, onClosed);
3639
- try {
3640
- hot.send?.({
3641
- type: "custom",
3642
- event: requestEvent,
3643
- data: { requestId },
3644
- });
3645
- }
3646
- catch (error) {
3647
- cleanup();
3648
- reject(error);
3649
- }
3657
+ let timeout = waitFor(`report database ${operation} listeners ready`);
3658
+ on(acknowledgementEvent, onClosed);
3659
+ on("agent-native:dev-database-ready", onReady);
3660
+ send("agent-native:dev-database-ready-check");
3650
3661
  });
3651
3662
  }
3652
3663
  class NitroDevDatabaseLifecycleTimeout extends Error {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.233.0",
3
+ "version": "0.234.0-nightly-20261125004429",
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": {
@@ -823,7 +823,7 @@
823
823
  "yaml": "^2.9.0",
824
824
  "yjs": "^13.6.33",
825
825
  "zod": "^4.3.6",
826
- "@agent-native/agentkit": "^0.233.0",
826
+ "@agent-native/agentkit": "^0.234.0-nightly-20261125004429",
827
827
  "@agent-native/recap-cli": "^0.5.108"
828
828
  },
829
829
  "devDependencies": {
@@ -898,7 +898,7 @@
898
898
  "xlsx": "^0.18.5"
899
899
  },
900
900
  "peerDependencies": {
901
- "@agent-native/core-corpus": ">=0.196.0",
901
+ "@agent-native/core-corpus": "0.234.0-nightly-20261125004429",
902
902
  "@ai-sdk/anthropic": ">=3",
903
903
  "@ai-sdk/cohere": ">=3",
904
904
  "@ai-sdk/google": ">=3",
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -30,6 +30,8 @@ When a workflow is research, analysis, generation, recommendation, or synthesis
30
30
 
31
31
  **One action per file, default-exported. The filename is the action name** (kebab-case): `actions/list-meals.ts` is the `list-meals` action. Don't put several `defineAction`s as named exports in one file — the registry keys actions by filename and only the default export is registered, so extra named exports never become callable and won't match `.generated/action-types.d.ts`.
32
32
 
33
+ Subfolders group actions by domain: the name is the relative path with `-` between segments, so `actions/billing/create-invoice.ts` is `billing-create-invoice`. Two files that resolve to the same name (that one and a flat `actions/billing-create-invoice.ts`) fail boot. Folders and files starting with `_` are helpers and are never registered.
34
+
33
35
  ```ts
34
36
  // actions/list-meals.ts
35
37
  import { z } from "zod";
@@ -131,8 +131,13 @@ not a single app that clones every provider integration.
131
131
 
132
132
  ## Don't
133
133
 
134
- - Do not clone Mail, Calendar, Analytics, Brain, Assets, or another first-party
135
- app just to reuse its data. Delegate or link to the existing app.
134
+ - Do not clone Mail, Calendar, Analytics, Brain, Assets, Content, or another
135
+ first-party app just to reuse its data. Delegate or link to the existing app.
136
+ - Do not ask for a Content token, or keep one in an environment variable, to
137
+ save pages or Collection rows. Message Content to do it as the signed-in
138
+ person: `call-agent` to `content` from the agent, or `invokeAgent()` from a
139
+ server request, passing the `userEmail`, `orgDomain` and `orgSecret` that
140
+ `resolveA2ACallerAuth()` returns.
136
141
  - Do not hide a multi-provider workflow inside a giant "misc tools" app.
137
142
  - Do not add one-off provider endpoints when `provider-api-request` can express
138
143
  the upstream API safely.
@@ -247,19 +247,19 @@ connection or page WebMCP. Route UI through
247
247
  unless they explicitly opt into the full catalog, and
248
248
  `publicAgent.expose` remains the action-level opt-in for safe read/ingest tools
249
249
  outside the compact MCP Apps catalog. Apps can set
250
- `externalAgents.authenticatedReads: "auto"` to automatically advertise every
251
- action that is GET + `readOnly` + `publicAgent.requiresAuth`, instead of
252
- maintaining a long connector allow-list. This policy never includes writes by
253
- default. Set `writes: "allowlisted"` to serve the writes your actions choose to
254
- serve; `writes: "ask_app_only"`, the default with automatic reads, is
255
- deprecated and warns at startup, so keep a write in the app with
256
- `mcpTool: false` instead. Use `denyActions` for defense-in-depth vetoes.
250
+ `externalAgents.authenticatedReads: "auto"` advertises GET + `readOnly` +
251
+ `publicAgent.requiresAuth` actions without a connector allow-list. Writes are
252
+ excluded by default. Set `writes: "allowlisted"` to serve selected writes;
253
+ `writes: "ask_app_only"`, the automatic-reads default, is deprecated and warns at startup. Keep a write in
254
+ the app with `mcpTool: false`. Use `denyActions` for defense-in-depth vetoes.
257
255
  `tool-search` finds only the tools the connection is served, listed or
258
256
  `mcpTool: "search"` ones that `call-tool` runs. It names matching actions
259
257
  outside them under `notServed`, for the caller to hand to `ask_app`. Do not rely on
260
258
  action-specific `mcpApp` resources appearing in ChatGPT/Claude discovery by
261
259
  default; use `open_app` for the
262
- first-class app embed path. If a specific
260
+ first-class app embed path. For "show", "open", "draft", "chart", calendar, or
261
+ dashboard asks, call `open_app` after the read or save so the host opens the pane
262
+ instead of drawing its own card. If a specific
263
263
  action truly must remain visible in that compact app-host catalog, set
264
264
  `mcpApp.compactCatalog: true` as a rare escape hatch.
265
265
 
@@ -57,6 +57,9 @@ resources to All apps only for global guidance.
57
57
  - Reuse provider connections and scoped resolvers. Framework apps use
58
58
  `resolveSecret`; workspace apps use the connector helper. Request missing
59
59
  keys through Dispatch vault, not a non-admin's `.env`.
60
+ - Save to Content as the signed-in person, in a message: `call-agent` to
61
+ `content`, or `invokeAgent()` with `userEmail`, `orgDomain` and `orgSecret`
62
+ from `resolveA2ACallerAuth()`. Never ask for a Content token or put one in env.
60
63
  - Verify `/<app-id>` on the workspace gateway serves the new app before saying
61
64
  it is created; app servers start lazily.
62
65
 
@@ -140,12 +140,17 @@ separate workspace app registry to edit. React Router apps must keep the
140
140
  For requests phrased as creating an "agent", classify the scope first: simple
141
141
  recurring Dispatch behavior can stay in Dispatch, while a robust app-like
142
142
  teammate should become a real workspace app listed with the rest of the apps.
143
- First-party apps such as Mail, Calendar, Analytics, Brain, Assets, and Dispatch should be
144
- treated as existing hosted or connected neighbors. If a new app needs access to
143
+ First-party apps such as Mail, Calendar, Analytics, Brain, Assets, Content, and Dispatch
144
+ should be treated as existing hosted or connected neighbors. If a new app needs access to
145
145
  their data or agents, link/delegate to those apps through the workspace/A2A
146
146
  path rather than creating wrapper apps, child apps, or cloned template copies
147
147
  inside the new app. Only fork one of those apps when the user explicitly asks
148
148
  for a customized copy.
149
+ To save pages or Collection rows to Content, message Content to do the work as
150
+ the signed-in person: `call-agent` to `content` from the agent, or
151
+ `invokeAgent()` from a server request, passing the `userEmail`, `orgDomain` and
152
+ `orgSecret` that `resolveA2ACallerAuth()` returns. Never ask the user for a
153
+ Content token or keep one in an environment variable.
149
154
 
150
155
  ## Editing shared behavior
151
156