@agent-native/core 0.167.1 → 0.167.4

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 (80) hide show
  1. package/corpus/templates/analytics/.agents/skills/agent-native-docs/SKILL.md +11 -0
  2. package/corpus/templates/assets/.agents/skills/agent-native-docs/SKILL.md +11 -0
  3. package/corpus/templates/brain/.agents/skills/agent-native-docs/SKILL.md +11 -0
  4. package/corpus/templates/calendar/.agents/skills/agent-native-docs/SKILL.md +11 -0
  5. package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +11 -0
  6. package/corpus/templates/clips/.agents/skills/agent-native-docs/SKILL.md +11 -0
  7. package/corpus/templates/clips/app/routes/download.tsx +78 -131
  8. package/corpus/templates/content/.agents/skills/agent-native-docs/SKILL.md +11 -0
  9. package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +11 -0
  10. package/corpus/templates/design/.agents/skills/agent-native-docs/SKILL.md +11 -0
  11. package/corpus/templates/dispatch/.agents/skills/agent-native-docs/SKILL.md +11 -0
  12. package/corpus/templates/factory/.agents/skills/agent-native-docs/SKILL.md +11 -0
  13. package/corpus/templates/forms/.agents/skills/agent-native-docs/SKILL.md +11 -0
  14. package/corpus/templates/macros/.agents/skills/agent-native-docs/SKILL.md +11 -0
  15. package/corpus/templates/mail/.agents/skills/agent-native-docs/SKILL.md +11 -0
  16. package/corpus/templates/plan/.agents/skills/agent-native-docs/SKILL.md +11 -0
  17. package/corpus/templates/slides/.agents/skills/agent-native-docs/SKILL.md +11 -0
  18. package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +11 -0
  19. package/dist/chat-threads/store.d.ts +7 -0
  20. package/dist/chat-threads/store.js +15 -0
  21. package/dist/client/AgentPanel.d.ts +5 -1
  22. package/dist/client/AgentPanel.js +8 -8
  23. package/dist/client/AssistantChat.d.ts +3 -1
  24. package/dist/client/AssistantChat.js +22 -6
  25. package/dist/client/MultiTabAssistantChat.d.ts +3 -1
  26. package/dist/client/MultiTabAssistantChat.js +5 -4
  27. package/dist/client/agent-page/AgentJobsTab.js +39 -6
  28. package/dist/client/agent-page/AutomationScheduleDialog.d.ts +10 -1
  29. package/dist/client/agent-page/AutomationScheduleDialog.js +3 -2
  30. package/dist/client/agent-page/ScheduledTriggerNotice.d.ts +22 -0
  31. package/dist/client/agent-page/ScheduledTriggerNotice.js +84 -0
  32. package/dist/client/agent-page/scheduled-trigger-state.d.ts +28 -0
  33. package/dist/client/agent-page/scheduled-trigger-state.js +10 -0
  34. package/dist/client/agent-page/use-jobs.d.ts +7 -0
  35. package/dist/client/agent-page/use-jobs.js +14 -0
  36. package/dist/client/blocks/library/diagram.config.d.ts +4 -1
  37. package/dist/client/blocks/library/diagram.js +1 -1
  38. package/dist/client/chat/run-recovery.js +15 -7
  39. package/dist/client/use-chat-threads.d.ts +7 -0
  40. package/dist/client/use-chat-threads.js +144 -40
  41. package/dist/collab/awareness.d.ts +2 -2
  42. package/dist/collab/struct-routes.d.ts +1 -1
  43. package/dist/deploy/build.d.ts +5 -0
  44. package/dist/deploy/build.js +12 -1
  45. package/dist/framework-tools.js +1 -0
  46. package/dist/jobs/actions/get-scheduled-trigger-status.d.ts +13 -0
  47. package/dist/jobs/actions/get-scheduled-trigger-status.js +21 -0
  48. package/dist/localization/default-messages.d.ts +14 -0
  49. package/dist/localization/default-messages.js +14 -0
  50. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  51. package/dist/notifications/routes.d.ts +3 -3
  52. package/dist/observability/routes.d.ts +3 -3
  53. package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
  54. package/dist/provider-api/actions/provider-api.d.ts +13 -13
  55. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  56. package/dist/server/action-discovery.js +4 -0
  57. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +42 -1
  58. package/dist/server/agent-chat/recurring-jobs-runtime.js +102 -9
  59. package/dist/server/agent-chat-plugin.d.ts +3 -1
  60. package/dist/server/agent-chat-plugin.js +115 -24
  61. package/dist/server/attribution.d.ts +29 -0
  62. package/dist/server/attribution.js +68 -0
  63. package/dist/server/auth.js +58 -15
  64. package/dist/server/better-auth-instance.js +16 -4
  65. package/dist/server/identity-sso.js +14 -2
  66. package/dist/server/realtime-token.d.ts +1 -1
  67. package/dist/server/request-context.d.ts +8 -0
  68. package/dist/server/request-context.js +4 -0
  69. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +11 -0
  70. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +11 -0
  71. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +11 -0
  72. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +11 -0
  73. package/dist/vite/client.js +10 -0
  74. package/docs/content/deployment.mdx +3 -1
  75. package/docs/content/recurring-jobs.mdx +6 -0
  76. package/package.json +2 -2
  77. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +11 -0
  78. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +11 -0
  79. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +11 -0
  80. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +11 -0
@@ -19,10 +19,12 @@ import { getAppConfig } from "../app-config/index.js";
19
19
  import { GOOGLE_AUTH_REQUIRED_MESSAGE, isGoogleSignInRequiredForEmail, } from "../org/auth-policy.js";
20
20
  import { SIGN_IN_ENTRY_PATH } from "../shared/sign-in-journey.js";
21
21
  import { getAppName } from "./app-name.js";
22
+ import { addSignupAttributionHeader, signupAttributionContextFromCookieHeader, } from "./attribution.js";
22
23
  import { getSession, isExpectedAuthFailure, safeReturnPath } from "./auth.js";
23
24
  import { getBetterAuth, getBetterAuthInternalAdapter, } from "./better-auth-instance.js";
24
25
  import { createOAuthSession, getOrigin } from "./google-oauth.js";
25
26
  import { consumeSsoState, createSsoState, CANONICAL_IDENTITY_SSO_HUB_URL, getIdentityHubUrl, identitySsoLoginButtonHtml, isCanonicalIdentitySsoClientRequest, isDesktopSsoUserAgent, isIdentitySsoExplicitlyEnabled, isIdentitySsoEnabled, isJtiReplayed, SSO_STATE_TTL_MS, } from "./identity-sso-store.js";
27
+ import { getRequestContext, hasContinuationLocalRequestContext, runWithRequestContext, } from "./request-context.js";
26
28
  export { getIdentityHubUrl, identitySsoLoginButtonHtml, isIdentitySsoEnabled };
27
29
  export const IDENTITY_SSO_PROVIDER_ID = "agent-native";
28
30
  export const IDENTITY_SSO_SCOPE = "identity";
@@ -269,7 +271,7 @@ async function exchangeIdentityCode(hub, binding, input) {
269
271
  return null;
270
272
  }
271
273
  }
272
- async function jitLinkIdentity(identity) {
274
+ async function jitLinkIdentity(identity, signupHeaders) {
273
275
  const adapter = await getBetterAuthInternalAdapter();
274
276
  let existing = adapter
275
277
  ? await adapter
@@ -288,6 +290,7 @@ async function jitLinkIdentity(identity) {
288
290
  password: createUnusableSsoCredential(),
289
291
  name: identity.name || identity.email.split("@")[0] || "User",
290
292
  },
293
+ ...(signupHeaders ? { headers: signupHeaders } : {}),
291
294
  });
292
295
  }
293
296
  catch (error) {
@@ -463,7 +466,16 @@ export async function handleIdentitySso(event, subpath) {
463
466
  return errorPage(GOOGLE_AUTH_REQUIRED_MESSAGE, loginPath);
464
467
  }
465
468
  try {
466
- await jitLinkIdentity(identity);
469
+ const signupCookieHeader = getHeader(event, "cookie") ?? null;
470
+ const signupAttribution = signupAttributionContextFromCookieHeader(signupCookieHeader);
471
+ const signupHeaders = addSignupAttributionHeader(event.headers, signupAttribution);
472
+ const linkIdentity = () => jitLinkIdentity(identity, signupHeaders);
473
+ await (hasContinuationLocalRequestContext()
474
+ ? runWithRequestContext({
475
+ ...(getRequestContext() ?? {}),
476
+ signupAttribution,
477
+ }, linkIdentity)
478
+ : linkIdentity());
467
479
  }
468
480
  catch {
469
481
  return errorPage("Could not finish linking your account. Please try again.", loginPath);
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
26
26
  expiresAt?: undefined;
27
27
  ttlSeconds?: undefined;
28
28
  } | {
29
- error?: undefined;
30
29
  token: string;
31
30
  expiresAt: string;
32
31
  ttlSeconds: number;
32
+ error?: undefined;
33
33
  }>>;
@@ -15,6 +15,7 @@
15
15
  * process.env so existing `AGENT_USER_EMAIL=x pnpm action foo` invocations
16
16
  * continue to work.
17
17
  */
18
+ import type { SignupAttributionContext } from "./attribution.js";
18
19
  /**
19
20
  * Per-request agent-run state. Lives on `RequestContext.run` so the
20
21
  * agent-chat plugin can populate fields as the run progresses (owner,
@@ -109,6 +110,11 @@ export interface RequestContext {
109
110
  * replay; never used for authorization.
110
111
  */
111
112
  browserSessionId?: string;
113
+ /**
114
+ * Browser attribution captured before a Better Auth signup crosses into its
115
+ * async user-create hook. Analytics-only; never used for authorization.
116
+ */
117
+ signupAttribution?: SignupAttributionContext;
112
118
  /** Canonical client surface for analytics attribution. */
113
119
  clientPlatform?: import("../shared/analytics-platform.js").AnalyticsClientPlatform;
114
120
  /**
@@ -188,6 +194,8 @@ type RequestContextObserver = (ctx: RequestContext) => void;
188
194
  * overlapping async requests are only isolated by native AsyncLocalStorage.
189
195
  */
190
196
  export declare function assertRequestActionSurfaceIsolation(): void;
197
+ /** Whether request context values are isolated across overlapping promises. */
198
+ export declare function hasContinuationLocalRequestContext(): boolean;
191
199
  /**
192
200
  * Register a callback fired every time `runWithRequestContext` enters a new
193
201
  * scope. The hook runs INSIDE the AsyncLocalStorage scope, so observability
@@ -80,6 +80,10 @@ export function assertRequestActionSurfaceIsolation() {
80
80
  throw new Error("Request-scoped action surfaces require continuation-local request context storage; " +
81
81
  "this runtime only provides the non-isolated fallback.");
82
82
  }
83
+ /** Whether request context values are isolated across overlapping promises. */
84
+ export function hasContinuationLocalRequestContext() {
85
+ return globalRef[CONTINUATION_LOCAL_KEY] === true;
86
+ }
83
87
  /**
84
88
  * Register a callback fired every time `runWithRequestContext` enters a new
85
89
  * scope. The hook runs INSIDE the AsyncLocalStorage scope, so observability
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -10,6 +10,7 @@ import { getViteDevRecoveryScript } from "../client/vite-dev-recovery-script.js"
10
10
  import { inferAgentNativeDeploymentEnvironment, mergeAgentNativeConfigs, readAgentNativeConfigEnv, resolveAgentNativeConfig, } from "../config.js";
11
11
  import { writeAgentNativeNitroPresetMarker } from "../deploy/nitro-preset.js";
12
12
  import { findWorkspaceRoot } from "../scripts/utils.js";
13
+ import { RECURRING_JOBS_BUILD_MARKER_ENV_VAR, resolveRecurringJobsBuildMarker, } from "../server/agent-chat/recurring-jobs-runtime.js";
13
14
  import { verifyEmbedSessionToken } from "../server/embed-session.js";
14
15
  import { EMBED_SESSION_COOKIE, EMBED_TOKEN_QUERY_PARAM, MCP_APP_CHAT_BRIDGE_QUERY_PARAM, } from "../shared/embed-auth.js";
15
16
  import { isMcpEmbedCorsOrigin, MCP_EMBED_CORS_ALLOW_HEADERS, MCP_EMBED_STATIC_ASSET_HEADERS, mcpEmbedStaticAssetRouteRules, shouldAllowMcpEmbedCredentials, } from "../shared/mcp-embed-headers.js";
@@ -2561,6 +2562,10 @@ function createNitroDevPlugin(options, appBasePath) {
2561
2562
  // injected into deployed Functions. Nitro is a separate server build,
2562
2563
  // so it needs the release ownership decision in its own replacement map.
2563
2564
  "process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
2565
+ // Same reason as the release owner above: the recurring-jobs decision
2566
+ // belongs to the build env, and Nitro is a separate server build with its
2567
+ // own replacement map.
2568
+ [`process.env.${RECURRING_JOBS_BUILD_MARKER_ENV_VAR}`]: JSON.stringify(resolveRecurringJobsBuildMarker(process.env)),
2564
2569
  },
2565
2570
  // Never auto-load test files as server handlers/plugins/middleware.
2566
2571
  // Nitro scans server/{plugins,middleware,routes,api}/*; a co-located
@@ -2913,6 +2918,11 @@ function createAgentNativeConfig(options = {}, command, userConfig = {}, mode =
2913
2918
  // netlify.toml environment is available to the build but not injected
2914
2919
  // into deployed Functions, so embed the decision in the server bundle.
2915
2920
  "process.env.AGENT_NATIVE_RELEASE_MIGRATIONS": JSON.stringify(process.env.AGENT_NATIVE_RELEASE_MIGRATIONS?.trim() || ""),
2921
+ // Recurring jobs are turned off (and their platform scheduled trigger
2922
+ // omitted) by the BUILD environment, which a deployed serverless runtime
2923
+ // never sees. Embed the decision so the Automations page reports what
2924
+ // will actually fire instead of inferring it from runtime-only markers.
2925
+ [`process.env.${RECURRING_JOBS_BUILD_MARKER_ENV_VAR}`]: JSON.stringify(resolveRecurringJobsBuildMarker(process.env)),
2916
2926
  ...(resolvedAppConfig.deployment?.environment
2917
2927
  ? {
2918
2928
  "process.env.AGENT_NATIVE_DEPLOYMENT_ENVIRONMENT": JSON.stringify(resolvedAppConfig.deployment.environment),
@@ -65,7 +65,9 @@ In a workspace, every app inherits the root `DATABASE_URL` by default. Set
65
65
  Set a Nitro preset for the target you choose. The app code and database
66
66
  contract stay the same.
67
67
 
68
- <Diagram id="doc-block-deployment-targets" title="Supported deployment targets" summary="Agent-Native apps can deploy to Node.js, Docker, Vercel, Netlify, Cloudflare Pages, Cloudflare Workers, AWS Lambda, Deno Deploy, Azure Static Web Apps, Koyeb, and Render.">
68
+ <!-- i18n-copy-ignore: renderer-only Diagram attributes keep this shared UI block in clean mode. -->
69
+
70
+ <Diagram id="doc-block-deployment-targets" title="Supported deployment targets" summary="Agent-Native apps can deploy to Node.js, Docker, Vercel, Netlify, Cloudflare Pages, Cloudflare Workers, AWS Lambda, Deno Deploy, Azure Static Web Apps, Koyeb, and Render." frame="hide" renderMode="design">
69
71
 
70
72
  ```html
71
73
  <!-- i18n-copy-ignore: deployment target logo markup is visual-only; labels are unchanged. -->
@@ -233,6 +233,12 @@ The scheduler is a framework plugin (the internal `processRecurringJobs()` routi
233
233
 
234
234
  </Callout>
235
235
 
236
+ <Callout id="doc-block-rj3" tone="warning">
237
+
238
+ **`AGENT_NATIVE_DISABLE_RECURRING_JOBS` is read in two scopes.** In the **build** environment it decides whether the platform's scheduled trigger is emitted at all — on Netlify that emitted function is the only durable driver, so a build with the switch on ships an app where no schedule can fire, whatever the deployed environment says. In the **runtime** environment it gates the in-process `setInterval` loop. Set it in the build environment to turn recurring jobs off for a deploy; the build records its decision so the **Automations** page can say schedules will never run instead of showing a next-run date nothing will honour.
239
+
240
+ </Callout>
241
+
236
242
  ## Debugging a job {#debugging}
237
243
 
238
244
  - Open the automation's details in **Automations**, or inspect
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.167.1",
3
+ "version": "0.167.4",
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": {
@@ -427,7 +427,7 @@
427
427
  "y-protocols": "^1.0.7",
428
428
  "yjs": "^13.6.32",
429
429
  "zod": "^4.3.6",
430
- "@agent-native/recap-cli": "0.5.6",
430
+ "@agent-native/recap-cli": "0.5.7",
431
431
  "@agent-native/toolkit": "^0.16.9"
432
432
  },
433
433
  "devDependencies": {
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.
@@ -134,3 +134,14 @@ hand-duplicating framework logic.
134
134
  `agent-surfaces`.
135
135
  - Do not copy framework runtime internals when a public API or narrow UI copy
136
136
  will do; read `customizing-agent-native` for the supported override ladder.
137
+
138
+ ## Authoring visual docs blocks
139
+
140
+ Treat the shared `Diagram` block as a renderer, not as a reason to style every
141
+ docs UI as a sketch. Use the hand-drawn font and Rough.js only for actual
142
+ diagrams or wireframes that communicate structure, flow, or a design draft.
143
+ For polished UI-like content - cards, logo walls, tables, controls, or product
144
+ shells — set `renderMode="design"` (and usually `frame="hide"` when the block
145
+ is the content itself). Design mode preserves normal docs typography and
146
+ disables the Rough.js overlay. Keep `data-rough` only on elements intentionally
147
+ sketched inside a real diagram.