@agent-native/core 0.0.0-beta-20260820220930 → 0.0.0-beta-20260820224008

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 (52) 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/blocks/library/diagram.config.d.ts +4 -1
  28. package/dist/client/blocks/library/diagram.js +1 -1
  29. package/dist/client/chat/run-recovery.js +15 -7
  30. package/dist/client/use-chat-threads.d.ts +7 -0
  31. package/dist/client/use-chat-threads.js +144 -40
  32. package/dist/collab/routes.d.ts +1 -1
  33. package/dist/notifications/routes.d.ts +3 -3
  34. package/dist/resources/handlers.d.ts +2 -2
  35. package/dist/server/agent-chat-plugin.js +112 -23
  36. package/dist/server/attribution.d.ts +29 -0
  37. package/dist/server/attribution.js +68 -0
  38. package/dist/server/auth.js +58 -15
  39. package/dist/server/better-auth-instance.js +16 -4
  40. package/dist/server/identity-sso.js +14 -2
  41. package/dist/server/request-context.d.ts +8 -0
  42. package/dist/server/request-context.js +4 -0
  43. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +11 -0
  44. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +11 -0
  45. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +11 -0
  46. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +11 -0
  47. package/docs/content/deployment.mdx +3 -1
  48. package/package.json +2 -2
  49. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +11 -0
  50. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +11 -0
  51. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +11 -0
  52. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +11 -0
@@ -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.
@@ -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.
@@ -4,20 +4,12 @@ import {
4
4
  IconBrandChrome,
5
5
  IconBrandApple,
6
6
  IconBrandWindows,
7
- IconChevronDown,
8
- IconDeviceDesktop,
9
7
  IconExternalLink,
8
+ IconTerminal2,
10
9
  } from "@tabler/icons-react";
11
10
  import { useEffect, useState } from "react";
12
11
 
13
12
  import { Button } from "@/components/ui/button";
14
- import {
15
- DropdownMenu,
16
- DropdownMenuContent,
17
- DropdownMenuRadioGroup,
18
- DropdownMenuRadioItem,
19
- DropdownMenuTrigger,
20
- } from "@/components/ui/dropdown-menu";
21
13
  import { Skeleton } from "@/components/ui/skeleton";
22
14
  import enMessages from "@/i18n/en-US";
23
15
  import {
@@ -45,7 +37,6 @@ type PlatformId = "mac" | "windows" | "linux";
45
37
  interface PlatformVariant {
46
38
  id: PlatformId;
47
39
  label: string;
48
- sublabel: string;
49
40
  assetKinds: readonly (
50
41
  | "mac-universal"
51
42
  | "mac-arm64"
@@ -64,23 +55,20 @@ const VARIANTS: PlatformVariant[] = [
64
55
  {
65
56
  id: "mac",
66
57
  label: "macOS",
67
- sublabel: "Universal (Apple Silicon + Intel)",
68
58
  assetKinds: ["mac-universal", "mac-arm64", "mac-x64"],
69
59
  icon: IconBrandApple,
70
60
  },
71
61
  {
72
62
  id: "windows",
73
63
  label: "Windows",
74
- sublabel: "64-bit MSI installer",
75
64
  assetKinds: ["windows-msi"],
76
65
  icon: IconBrandWindows,
77
66
  },
78
67
  {
79
68
  id: "linux",
80
69
  label: "Linux",
81
- sublabel: "AppImage, Debian, and RPM packages",
82
70
  assetKinds: ["linux-appimage", "linux-deb", "linux-rpm"],
83
- icon: IconDeviceDesktop,
71
+ icon: IconTerminal2,
84
72
  },
85
73
  ];
86
74
 
@@ -171,47 +159,6 @@ function primaryDownloadButton(
171
159
  );
172
160
  }
173
161
 
174
- function secondaryDownloadButton(
175
- variant: PlatformVariant,
176
- manifest: Manifest | null,
177
- manifestError: boolean,
178
- downloadLabel: string,
179
- retryLabel: string,
180
- onRetry: () => void,
181
- ) {
182
- const asset = pickAsset(manifest, variant);
183
- const Icon = variant.icon;
184
- const className =
185
- "h-auto gap-1.5 px-2 py-1 text-sm font-normal text-muted-foreground hover:bg-transparent hover:text-foreground";
186
- if (asset) {
187
- return (
188
- <Button asChild variant="ghost" className={className}>
189
- <a href={asset.url} download onClick={markDesktopAppDownloaded}>
190
- <Icon className="h-4 w-4" />
191
- {downloadLabel}
192
- </a>
193
- </Button>
194
- );
195
- }
196
- if (manifest === null && !manifestError) {
197
- return <Skeleton className="h-7 w-[208px] rounded-md" />;
198
- }
199
- if (manifestError) {
200
- return (
201
- <Button variant="ghost" className={className} onClick={onRetry}>
202
- <Icon className="h-4 w-4" />
203
- {retryLabel}
204
- </Button>
205
- );
206
- }
207
- return (
208
- <Button variant="ghost" className={className} disabled>
209
- <Icon className="h-4 w-4" />
210
- {downloadLabel}
211
- </Button>
212
- );
213
- }
214
-
215
162
  export default function DownloadPage() {
216
163
  const chromeExtensionEnabled = useClipsChromeExtensionEnabled();
217
164
  const t = useT();
@@ -267,7 +214,11 @@ export default function DownloadPage() {
267
214
  };
268
215
 
269
216
  const primary = VARIANTS.find((v) => v.id === detected) ?? VARIANTS[0];
270
- const secondary = VARIANTS.filter((v) => v.id !== primary.id);
217
+
218
+ const handlePlatformChange = (nextPlatform: PlatformId) => {
219
+ if (nextPlatform === detected) return;
220
+ setDetected(nextPlatform);
221
+ };
271
222
 
272
223
  return (
273
224
  <div className="min-h-screen bg-background text-foreground">
@@ -317,87 +268,83 @@ export default function DownloadPage() {
317
268
  {t("downloadRoute.heroDescription")}
318
269
  </p>
319
270
 
320
- <div className="mt-10 flex flex-col items-center gap-3">
321
- {primaryDownloadButton(
322
- primary,
323
- manifest,
324
- manifestError,
325
- t("downloadRoute.downloadFor", { platform: primary.label }),
326
- t("downloadRoute.retry"),
327
- retryManifest,
328
- )}
329
- {secondary.map((variant) => (
330
- <div key={variant.id}>
331
- {secondaryDownloadButton(
332
- variant,
333
- manifest,
334
- manifestError,
335
- t("downloadRoute.alsoFor", { platform: variant.label }),
336
- t("downloadRoute.retry"),
337
- retryManifest,
338
- )}
339
- </div>
340
- ))}
341
- <div className="text-xs text-muted-foreground">
342
- {manifest ? (
343
- <>
344
- {manifest.pub_date
345
- ? t("downloadRoute.versionReleased", {
346
- version: manifest.version,
347
- date: new Date(manifest.pub_date).toLocaleDateString(),
348
- })
349
- : t("downloadRoute.version", {
350
- version: manifest.version,
351
- })}
352
- </>
353
- ) : manifestError ? (
354
- <>{t("downloadRoute.manifestError")}</>
355
- ) : (
356
- <>{t("downloadRoute.loadingRelease")}</>
357
- )}
271
+ <div className="mt-10 flex flex-col items-center">
272
+ <div className="mb-2 flex justify-center gap-2">
273
+ {VARIANTS.map((variant) => {
274
+ const Icon = variant.icon;
275
+ const active = primary.id === variant.id;
276
+ return (
277
+ <button
278
+ key={variant.id}
279
+ type="button"
280
+ aria-label={variant.label}
281
+ aria-pressed={active}
282
+ onClick={() => handlePlatformChange(variant.id)}
283
+ className={`group flex items-center justify-center rounded-lg p-4 transition-opacity focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${
284
+ active
285
+ ? "text-foreground"
286
+ : "text-muted-foreground opacity-40 hover:opacity-65"
287
+ }`}
288
+ >
289
+ <Icon className="size-6" aria-hidden="true" />
290
+ </button>
291
+ );
292
+ })}
358
293
  </div>
359
- <div className="mt-2 flex items-center justify-center text-xs text-muted-foreground">
360
- <DropdownMenu>
361
- <DropdownMenuTrigger asChild>
362
- <Button
294
+
295
+ <div className="mx-auto mt-8 max-w-2xl text-center">
296
+ {primaryDownloadButton(
297
+ primary,
298
+ manifest,
299
+ manifestError,
300
+ t("downloadRoute.downloadFor", { platform: primary.label }),
301
+ t("downloadRoute.retry"),
302
+ retryManifest,
303
+ )}
304
+
305
+ <div className="mt-5 flex justify-center">
306
+ <div className="flex items-center gap-2 text-xs text-muted-foreground">
307
+ <span>{t("downloadRoute.stable")}</span>
308
+ <button
363
309
  type="button"
364
- variant="ghost"
365
- size="sm"
366
- className="h-7 gap-1.5 px-2 font-normal text-muted-foreground hover:bg-muted/50 hover:text-foreground"
367
- data-release-channel={channel}
310
+ role="switch"
311
+ aria-checked={channel === "nightly"}
312
+ aria-label={t(
313
+ channel === "nightly"
314
+ ? "downloadRoute.switchToStable"
315
+ : "downloadRoute.switchToNightly",
316
+ )}
317
+ onClick={() =>
318
+ handleChannelChange(
319
+ channel === "nightly" ? "production" : "nightly",
320
+ )
321
+ }
322
+ className={`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${
323
+ channel === "nightly"
324
+ ? "bg-foreground"
325
+ : "bg-muted-foreground/20"
326
+ }`}
368
327
  >
369
328
  <span
370
- className={
329
+ aria-hidden="true"
330
+ className={`block size-3.5 rounded-full bg-primary-foreground shadow-sm transition-transform ${
371
331
  channel === "nightly"
372
- ? "font-medium text-foreground"
373
- : undefined
374
- }
375
- >
376
- {channel === "nightly"
377
- ? t("downloadRoute.nightly")
378
- : t("downloadRoute.stable")}
379
- </span>
380
- <IconChevronDown className="size-3.5" aria-hidden="true" />
381
- </Button>
382
- </DropdownMenuTrigger>
383
- <DropdownMenuContent align="center" className="w-44">
384
- <DropdownMenuRadioGroup
385
- value={channel}
386
- onValueChange={(value) => {
387
- if (value === "production" || value === "nightly") {
388
- handleChannelChange(value);
389
- }
390
- }}
332
+ ? "translate-x-[18px]"
333
+ : "translate-x-[2px]"
334
+ }`}
335
+ />
336
+ </button>
337
+ <span
338
+ className={
339
+ channel === "nightly"
340
+ ? "font-medium text-foreground"
341
+ : "text-muted-foreground"
342
+ }
391
343
  >
392
- <DropdownMenuRadioItem value="production">
393
- {t("downloadRoute.stable")}
394
- </DropdownMenuRadioItem>
395
- <DropdownMenuRadioItem value="nightly">
396
- {t("downloadRoute.nightly")}
397
- </DropdownMenuRadioItem>
398
- </DropdownMenuRadioGroup>
399
- </DropdownMenuContent>
400
- </DropdownMenu>
344
+ {t("downloadRoute.nightly")}
345
+ </span>
346
+ </div>
347
+ </div>
401
348
  </div>
402
349
  </div>
403
350
 
@@ -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.
@@ -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.
@@ -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.
@@ -26,6 +26,13 @@ export interface ChatThreadScope {
26
26
  id: string;
27
27
  label?: string;
28
28
  }
29
+ export declare function isAppOwnedChatScope(scope?: ChatThreadScope | null): boolean;
30
+ /**
31
+ * A scoped rail may claim a legacy unscoped thread on its first write, but
32
+ * once a thread has a scope, a non-null incoming scope must match it. App-
33
+ * owned threads additionally require a scope on every subsequent write.
34
+ */
35
+ export declare function threadScopeMismatch(existing?: ChatThreadScope | null, incoming?: ChatThreadScope | null): boolean;
29
36
  export interface ChatThreadSource {
30
37
  platform?: string | null;
31
38
  appId?: string | null;
@@ -241,6 +241,21 @@ export async function repairLegacyChatThreadMessageCounts(options = {}) {
241
241
  function generateId() {
242
242
  return `thread-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
243
243
  }
244
+ export function isAppOwnedChatScope(scope) {
245
+ return scope?.type === "workspace-app" || scope?.type === "desktop-app";
246
+ }
247
+ /**
248
+ * A scoped rail may claim a legacy unscoped thread on its first write, but
249
+ * once a thread has a scope, a non-null incoming scope must match it. App-
250
+ * owned threads additionally require a scope on every subsequent write.
251
+ */
252
+ export function threadScopeMismatch(existing, incoming) {
253
+ if (!existing)
254
+ return false;
255
+ if (!incoming)
256
+ return isAppOwnedChatScope(existing);
257
+ return existing.type !== incoming.type || existing.id !== incoming.id;
258
+ }
244
259
  function readScope(r) {
245
260
  const type = r.scope_type;
246
261
  const id = r.scope_id;
@@ -107,6 +107,8 @@ export interface AgentPanelProps extends Omit<AssistantChatProps, "onSwitchToCli
107
107
  restoreActiveThread?: boolean;
108
108
  /** Ambient resource context rendered as a composer chip. */
109
109
  scope?: import("./use-chat-threads.js").ChatThreadScope | null;
110
+ /** Keep app-owned chat history isolated to the supplied scope. */
111
+ isolateHistoryByScope?: boolean;
110
112
  /** @deprecated Scope context now appears inside the composer. */
111
113
  showScopeBadge?: MultiTabAssistantChatProps["showScopeBadge"];
112
114
  /** Stable browser tab id used for tab-scoped app-state context. */
@@ -239,6 +241,8 @@ export interface AgentSidebarProps {
239
241
  onFullscreenRequest?: () => void;
240
242
  /** Ambient resource context rendered as a composer chip. */
241
243
  scope?: import("./use-chat-threads.js").ChatThreadScope | null;
244
+ /** Keep app-owned chat history isolated to the supplied scope. */
245
+ isolateHistoryByScope?: boolean;
242
246
  /** @deprecated Scope context now appears inside the composer. */
243
247
  showScopeBadge?: MultiTabAssistantChatProps["showScopeBadge"];
244
248
  /** Stable browser tab id used for tab-scoped app-state context. */
@@ -254,7 +258,7 @@ export interface AgentSidebarProps {
254
258
  * Wraps app content with a toggleable agent sidebar.
255
259
  * Use AgentToggleButton in your header to open/close it.
256
260
  */
257
- export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
261
+ export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, isolateHistoryByScope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
258
262
  /**
259
263
  * Focus the agent chat composer input.
260
264
  * Opens the sidebar if closed, then focuses the text input.