asta-ui 0.9.5 → 0.9.7

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 (144) hide show
  1. package/css/asta.css +2 -2
  2. package/css/asta.js +1461 -1
  3. package/css/components.css +1900 -138
  4. package/css/runtime/agent.css +136 -0
  5. package/css/runtime/agent.js +173 -0
  6. package/css/runtime/assist.css +79 -0
  7. package/css/runtime/assist.js +799 -0
  8. package/css/runtime/controls.css +48 -0
  9. package/css/runtime/controls.js +482 -0
  10. package/css/src/agent.css +484 -0
  11. package/css/src/assist.css +598 -0
  12. package/css/src/controls.css +424 -0
  13. package/css/tokens.css +16 -0
  14. package/dist/agent-plan.d.ts +2 -0
  15. package/dist/agent-plan.js +11 -0
  16. package/dist/agent-team.d.ts +2 -0
  17. package/dist/agent-team.js +7 -0
  18. package/dist/api-keys.d.ts +2 -0
  19. package/dist/api-keys.js +10 -0
  20. package/dist/autonomy-dial.d.ts +2 -0
  21. package/dist/autonomy-dial.js +7 -0
  22. package/dist/base/agent-plan.d.ts +2 -0
  23. package/dist/base/agent-plan.js +11 -0
  24. package/dist/base/agent-team.d.ts +2 -0
  25. package/dist/base/agent-team.js +7 -0
  26. package/dist/base/api-keys.d.ts +2 -0
  27. package/dist/base/api-keys.js +10 -0
  28. package/dist/base/autonomy-dial.d.ts +2 -0
  29. package/dist/base/autonomy-dial.js +7 -0
  30. package/dist/base/change-ledger.d.ts +2 -0
  31. package/dist/base/change-ledger.js +7 -0
  32. package/dist/base/citations.d.ts +2 -0
  33. package/dist/base/citations.js +9 -0
  34. package/dist/base/context-meter.d.ts +2 -0
  35. package/dist/base/context-meter.js +14 -0
  36. package/dist/base/fallback-chain.d.ts +2 -0
  37. package/dist/base/fallback-chain.js +7 -0
  38. package/dist/base/model-picker.d.ts +2 -0
  39. package/dist/base/model-picker.js +9 -0
  40. package/dist/base/navbar.js +1 -1
  41. package/dist/base/prompt-composer.d.ts +2 -0
  42. package/dist/base/prompt-composer.js +9 -0
  43. package/dist/base/scrub-input.d.ts +2 -0
  44. package/dist/base/scrub-input.js +13 -0
  45. package/dist/base/sidebar.js +1 -1
  46. package/dist/base/thinking.d.ts +2 -0
  47. package/dist/base/thinking.js +11 -0
  48. package/dist/base/tool-approval.d.ts +2 -0
  49. package/dist/base/tool-approval.js +9 -0
  50. package/dist/base/trace-waterfall.d.ts +2 -0
  51. package/dist/base/trace-waterfall.js +9 -0
  52. package/dist/base.js +204 -136
  53. package/dist/change-ledger.d.ts +2 -0
  54. package/dist/change-ledger.js +7 -0
  55. package/dist/chunk-24O5V2PQ.js +253 -0
  56. package/dist/chunk-44DNL43W.js +490 -0
  57. package/dist/chunk-45IXJ7W7.js +245 -0
  58. package/dist/chunk-ANL6VX4X.js +326 -0
  59. package/dist/chunk-DNROUJ62.js +432 -0
  60. package/dist/{chunk-2EBWWZPS.js → chunk-DWPGFNNF.js} +38 -9
  61. package/dist/{chunk-CACW5LH3.js → chunk-EAHHWF3V.js} +38 -9
  62. package/dist/chunk-F4CWSZXK.js +226 -0
  63. package/dist/chunk-FT66LAUZ.js +388 -0
  64. package/dist/chunk-GBOJUMMY.js +163 -0
  65. package/dist/chunk-H4NFBYKY.js +275 -0
  66. package/dist/chunk-KFPGQ5RT.js +321 -0
  67. package/dist/chunk-OIIMYSVT.js +342 -0
  68. package/dist/chunk-SUWA7DM6.js +388 -0
  69. package/dist/chunk-TL32C2SQ.js +221 -0
  70. package/dist/chunk-UBTYMAKF.js +240 -0
  71. package/dist/chunk-W6YVDJHX.js +235 -0
  72. package/dist/chunk-XYQI4ZYV.js +314 -0
  73. package/dist/citations.d.ts +2 -0
  74. package/dist/citations.js +9 -0
  75. package/dist/context-meter.d.ts +2 -0
  76. package/dist/context-meter.js +14 -0
  77. package/dist/fallback-chain.d.ts +2 -0
  78. package/dist/fallback-chain.js +7 -0
  79. package/dist/index.js +204 -136
  80. package/dist/model-picker.d.ts +2 -0
  81. package/dist/model-picker.js +9 -0
  82. package/dist/navbar.js +1 -1
  83. package/dist/prompt-composer.d.ts +2 -0
  84. package/dist/prompt-composer.js +9 -0
  85. package/dist/scrub-input.d.ts +2 -0
  86. package/dist/scrub-input.js +13 -0
  87. package/dist/sidebar.js +1 -1
  88. package/dist/thinking.d.ts +2 -0
  89. package/dist/thinking.js +11 -0
  90. package/dist/tool-approval.d.ts +2 -0
  91. package/dist/tool-approval.js +9 -0
  92. package/dist/trace-waterfall.d.ts +2 -0
  93. package/dist/trace-waterfall.js +9 -0
  94. package/dist/types/components/kit/agent-plan.d.ts +34 -0
  95. package/dist/types/components/kit/api-keys.d.ts +62 -0
  96. package/dist/types/components/kit/base/navbar.d.ts +4 -1
  97. package/dist/types/components/kit/base/sidebar.d.ts +29 -7
  98. package/dist/types/components/kit/citations.d.ts +34 -0
  99. package/dist/types/components/kit/context-meter.d.ts +38 -0
  100. package/dist/types/components/kit/model-picker.d.ts +46 -0
  101. package/dist/types/components/kit/navbar.d.ts +4 -1
  102. package/dist/types/components/kit/prompt-composer.d.ts +61 -0
  103. package/dist/types/components/kit/scrub-input.d.ts +44 -0
  104. package/dist/types/components/kit/sidebar.d.ts +29 -7
  105. package/dist/types/components/kit/thinking.d.ts +28 -0
  106. package/dist/types/components/kit/tool-approval.d.ts +43 -0
  107. package/dist/types/components/kit/trace-waterfall.d.ts +44 -0
  108. package/dist/types/components/lab/blocks/AgentTeam.d.ts +2 -0
  109. package/dist/types/components/lab/blocks/AutonomyDial.d.ts +2 -0
  110. package/dist/types/components/lab/blocks/ChangeLedger.d.ts +2 -0
  111. package/dist/types/components/lab/blocks/FallbackChain.d.ts +2 -0
  112. package/dist/types/packages/asta-ui/src/agent-plan.d.ts +2 -0
  113. package/dist/types/packages/asta-ui/src/agent-team.d.ts +2 -0
  114. package/dist/types/packages/asta-ui/src/api-keys.d.ts +2 -0
  115. package/dist/types/packages/asta-ui/src/autonomy-dial.d.ts +2 -0
  116. package/dist/types/packages/asta-ui/src/base/agent-plan.d.ts +2 -0
  117. package/dist/types/packages/asta-ui/src/base/agent-team.d.ts +2 -0
  118. package/dist/types/packages/asta-ui/src/base/api-keys.d.ts +2 -0
  119. package/dist/types/packages/asta-ui/src/base/autonomy-dial.d.ts +2 -0
  120. package/dist/types/packages/asta-ui/src/base/change-ledger.d.ts +2 -0
  121. package/dist/types/packages/asta-ui/src/base/citations.d.ts +2 -0
  122. package/dist/types/packages/asta-ui/src/base/context-meter.d.ts +2 -0
  123. package/dist/types/packages/asta-ui/src/base/fallback-chain.d.ts +2 -0
  124. package/dist/types/packages/asta-ui/src/base/model-picker.d.ts +2 -0
  125. package/dist/types/packages/asta-ui/src/base/prompt-composer.d.ts +2 -0
  126. package/dist/types/packages/asta-ui/src/base/scrub-input.d.ts +2 -0
  127. package/dist/types/packages/asta-ui/src/base/thinking.d.ts +2 -0
  128. package/dist/types/packages/asta-ui/src/base/tool-approval.d.ts +2 -0
  129. package/dist/types/packages/asta-ui/src/base/trace-waterfall.d.ts +2 -0
  130. package/dist/types/packages/asta-ui/src/base.d.ts +26 -2
  131. package/dist/types/packages/asta-ui/src/change-ledger.d.ts +2 -0
  132. package/dist/types/packages/asta-ui/src/citations.d.ts +2 -0
  133. package/dist/types/packages/asta-ui/src/context-meter.d.ts +2 -0
  134. package/dist/types/packages/asta-ui/src/fallback-chain.d.ts +2 -0
  135. package/dist/types/packages/asta-ui/src/index.d.ts +26 -2
  136. package/dist/types/packages/asta-ui/src/model-picker.d.ts +2 -0
  137. package/dist/types/packages/asta-ui/src/prompt-composer.d.ts +2 -0
  138. package/dist/types/packages/asta-ui/src/scrub-input.d.ts +2 -0
  139. package/dist/types/packages/asta-ui/src/thinking.d.ts +2 -0
  140. package/dist/types/packages/asta-ui/src/tool-approval.d.ts +2 -0
  141. package/dist/types/packages/asta-ui/src/trace-waterfall.d.ts +2 -0
  142. package/package.json +1 -1
  143. package/dist/chunk-MVE7RJJ6.js +0 -322
  144. package/dist/chunk-TBMUSER2.js +0 -322
package/dist/sidebar.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  Sidebar,
4
4
  sidebar_default
5
- } from "./chunk-TBMUSER2.js";
5
+ } from "./chunk-FT66LAUZ.js";
6
6
  import "./chunk-6RA7LJ3K.js";
7
7
  export {
8
8
  Sidebar,
@@ -0,0 +1,2 @@
1
+ export * from "./types/packages/asta-ui/src/thinking";
2
+ export { default } from "./types/packages/asta-ui/src/thinking";
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import {
3
+ Thinking,
4
+ formatThinkingTime,
5
+ thinking_default
6
+ } from "./chunk-GBOJUMMY.js";
7
+ export {
8
+ Thinking,
9
+ thinking_default as default,
10
+ formatThinkingTime
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./types/packages/asta-ui/src/tool-approval";
2
+ export { default } from "./types/packages/asta-ui/src/tool-approval";
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ ToolApproval,
4
+ tool_approval_default
5
+ } from "./chunk-KFPGQ5RT.js";
6
+ export {
7
+ ToolApproval,
8
+ tool_approval_default as default
9
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./types/packages/asta-ui/src/trace-waterfall";
2
+ export { default } from "./types/packages/asta-ui/src/trace-waterfall";
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import {
3
+ TraceWaterfall,
4
+ trace_waterfall_default
5
+ } from "./chunk-OIIMYSVT.js";
6
+ export {
7
+ TraceWaterfall,
8
+ trace_waterfall_default as default
9
+ };
@@ -0,0 +1,34 @@
1
+ import { type ReactNode } from "react";
2
+ export type PlanStepStatus = "pending" | "running" | "done" | "skipped" | "failed";
3
+ export interface PlanStep {
4
+ id: string;
5
+ title: string;
6
+ status: PlanStepStatus;
7
+ /** The live log line while running, or a short result or reason once settled. */
8
+ detail?: string;
9
+ /** When the step started (epoch ms). A running step counts up from here. */
10
+ startedAt?: number;
11
+ /** How long it took in ms, once settled. */
12
+ duration?: number;
13
+ /** Smaller steps inside this one. They show when the row is open. */
14
+ substeps?: PlanStep[];
15
+ }
16
+ export interface AgentPlanProps {
17
+ /** What the agent is doing, e.g. "Migrate billing to usage-based plans". */
18
+ title: string;
19
+ steps: PlanStep[];
20
+ /** Something on the right of the header, e.g. a Stop button. */
21
+ action?: ReactNode;
22
+ /** Shown under the list, e.g. Retry after a failure. */
23
+ footer?: ReactNode;
24
+ className?: string;
25
+ }
26
+ /** 4200 → "4.2s", 75000 → "1m 15s". */
27
+ export declare const formatStepTime: (ms: number) => string;
28
+ /**
29
+ * A task list an agent works through while you watch. Steps go from pending to running to done, skipped or
30
+ * failed, each with its own timer. The running step opens by itself to show its live log line, and its check
31
+ * draws in when it finishes. Failures use a word and an icon, not red.
32
+ */
33
+ export declare function AgentPlan({ title, steps, action, footer, className }: AgentPlanProps): import("react").JSX.Element;
34
+ export default AgentPlan;
@@ -0,0 +1,62 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ApiKey {
3
+ id: string;
4
+ name: string;
5
+ /** Start of the key, e.g. "ak_live". */
6
+ prefix: string;
7
+ /** Last four characters of the secret. */
8
+ last4: string;
9
+ scopes: string[];
10
+ created: Date;
11
+ lastUsed?: Date | null;
12
+ /** When it stops working. Leave out for no expiry. */
13
+ expires?: Date | null;
14
+ }
15
+ export interface ApiKeyScope {
16
+ value: string;
17
+ label: string;
18
+ hint?: string;
19
+ }
20
+ export interface NewApiKey {
21
+ name: string;
22
+ scopes: string[];
23
+ /** null means it never expires. */
24
+ expiresInDays: number | null;
25
+ }
26
+ export interface ApiKeysProps {
27
+ defaultKeys?: ApiKey[];
28
+ scopes?: ApiKeyScope[];
29
+ expiryOptions?: {
30
+ label: string;
31
+ days: number | null;
32
+ }[];
33
+ /** Create the key on your server and return it with the full secret. Reject to keep the form and show an error. */
34
+ onCreate?: (input: NewApiKey) => Promise<{
35
+ key: ApiKey;
36
+ secret: string;
37
+ }> | {
38
+ key: ApiKey;
39
+ secret: string;
40
+ };
41
+ /** Called once the undo window has passed. */
42
+ onRevoke?: (id: string) => void;
43
+ /** Shows placeholder rows in the final layout. */
44
+ loading?: boolean;
45
+ /** Load error. Shown instead of the list, with a retry button when `onRetry` is set. */
46
+ error?: string | null;
47
+ onRetry?: () => void;
48
+ /** How long a revoke can be undone, in ms. */
49
+ undoMs?: number;
50
+ /** Override "now" for relative times. */
51
+ now?: Date;
52
+ title?: string;
53
+ description?: ReactNode;
54
+ className?: string;
55
+ }
56
+ /**
57
+ * A settings section for API keys: a list of keys with masked prefixes, scopes, last use and status. Create a key
58
+ * in an inline form and its secret shows once in a highlighted row with a copy button, then masks for good.
59
+ * Revoking asks first and leaves a few seconds to undo. Stacks into cards on narrow screens.
60
+ */
61
+ export declare function ApiKeys({ defaultKeys, scopes, expiryOptions, onCreate, onRevoke, loading, error, onRetry, undoMs, now: nowProp, title, description, className, }: ApiKeysProps): import("react").JSX.Element;
62
+ export default ApiKeys;
@@ -10,6 +10,8 @@ export interface NavTile {
10
10
  export interface NavMenu {
11
11
  /** Panel width in px (clamped to the space available). */
12
12
  width?: number;
13
+ /** A plain dropdown: a short list that opens right under its trigger instead of the centred mega panel. */
14
+ list?: NavTile[];
13
15
  tiles?: NavTile[];
14
16
  columns?: {
15
17
  heading: string;
@@ -46,7 +48,8 @@ export interface NavbarProps {
46
48
  }
47
49
  /**
48
50
  * Site header with a mega menu. One shared panel sits under the bar and morphs its size between
49
- * sections while the new content slides in from the side you moved toward. Hovering a tile dims the
51
+ * sections while the new content slides in from the side you moved toward. A menu with `list` is a
52
+ * plain dropdown: the same panel glides over to sit right under its trigger. Hovering a tile dims the
50
53
  * rest. Below 560px of container width it collapses to a burger and a sheet of accordion sections.
51
54
  * Wrap it in an element with `@container` (the demo does) or it falls back to the viewport width.
52
55
  */
@@ -14,12 +14,34 @@ export interface SidebarWorkspace {
14
14
  id: string;
15
15
  name: string;
16
16
  plan?: string;
17
+ /** Square logo. Leave it out and the first letter is used. */
18
+ logo?: ReactNode;
19
+ }
20
+ export interface SidebarPromo {
21
+ title: string;
22
+ text?: string;
23
+ icon?: ReactNode;
24
+ onClick?: () => void;
25
+ /** Shows a close button. The card hides itself and this is called. */
26
+ onDismiss?: () => void;
17
27
  }
18
28
  export interface SidebarProps {
19
- workspaces: SidebarWorkspace[];
29
+ /** Wordmark at the top. Defaults to the current workspace name. */
30
+ brand?: ReactNode;
31
+ groups: SidebarGroup[];
32
+ /** Links pinned to the bottom, under the promo card. */
33
+ footer?: SidebarItem[];
34
+ promo?: SidebarPromo;
35
+ /** The striped button near the bottom, for an upgrade or a plan. */
36
+ cta?: {
37
+ label: string;
38
+ icon?: ReactNode;
39
+ onClick?: () => void;
40
+ };
41
+ /** Workspace switcher at the very bottom. The menu opens upward. */
42
+ workspaces?: SidebarWorkspace[];
20
43
  defaultWorkspace?: string;
21
44
  onWorkspaceChange?: (id: string) => void;
22
- groups: SidebarGroup[];
23
45
  /** Controlled active item. Leave it out and the sidebar tracks clicks itself. */
24
46
  active?: string;
25
47
  defaultActive?: string;
@@ -27,7 +49,7 @@ export interface SidebarProps {
27
49
  collapsed?: boolean;
28
50
  defaultCollapsed?: boolean;
29
51
  onCollapsedChange?: (collapsed: boolean) => void;
30
- user: {
52
+ user?: {
31
53
  name: string;
32
54
  email: string;
33
55
  src?: string;
@@ -35,9 +57,9 @@ export interface SidebarProps {
35
57
  className?: string;
36
58
  }
37
59
  /**
38
- * App sidebar: a workspace switcher, grouped navigation with a sliding active indicator, and the
39
- * signed-in user at the bottom. It folds to a 64px icon rail where labels fade out and tooltips take
40
- * over. Arrow keys move between items.
60
+ * App sidebar: a wordmark, grouped navigation with a sliding grey pill, then a promo card, footer
61
+ * links, a striped call to action and the workspace switcher at the bottom. It folds to a 64px icon
62
+ * rail where labels fade out and tooltips take over. Arrow keys move between items.
41
63
  */
42
- export declare function Sidebar({ workspaces, defaultWorkspace, onWorkspaceChange, groups, active: activeProp, defaultActive, onNavigate, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, user, className, }: SidebarProps): import("react").JSX.Element;
64
+ export declare function Sidebar({ brand, groups, footer, promo, cta, workspaces, defaultWorkspace, onWorkspaceChange, active: activeProp, defaultActive, onNavigate, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, user, className, }: SidebarProps): import("react").JSX.Element;
43
65
  export default Sidebar;
@@ -0,0 +1,34 @@
1
+ export interface CitationSource {
2
+ title: string;
3
+ /** Shown under the title and used for the letter tile, e.g. "fieldnotes.dev". */
4
+ domain: string;
5
+ /** The passage the answer leans on. */
6
+ snippet: string;
7
+ /** The exact part of `snippet` that was cited. It is highlighted in the preview. */
8
+ quote?: string;
9
+ /** Opens the source. Without it the source card is not a link. */
10
+ url?: string;
11
+ /** e.g. "Oct 2026". */
12
+ date?: string;
13
+ }
14
+ export interface CitationsProps {
15
+ /**
16
+ * The answer. Mark a citation with its source number in brackets: "Revenue grew 18% [1]." Several at once:
17
+ * "[1, 3]" or "[1][3]". A blank line starts a new paragraph.
18
+ */
19
+ text: string;
20
+ /** Source 1 is `sources[0]`. */
21
+ sources: CitationSource[];
22
+ /** Keeps the layout with placeholder lines while the answer loads. */
23
+ loading?: boolean;
24
+ /** How many source cards show before "Show all". Default 3. */
25
+ visible?: number;
26
+ className?: string;
27
+ }
28
+ /**
29
+ * An answer with numbered citation pills. Hover or focus a pill to preview its source: title, domain and
30
+ * the quoted passage with the cited part highlighted. The Sources row below expands into a full list, and
31
+ * hovering a source lights up its pills in the text. Tap a pill on touch screens.
32
+ */
33
+ export declare function Citations({ text, sources, loading, visible, className }: CitationsProps): import("react").JSX.Element;
34
+ export default Citations;
@@ -0,0 +1,38 @@
1
+ import { type PopoverAlign, type PopoverSide } from "./popover";
2
+ export interface ContextSegment {
3
+ label: string;
4
+ tokens: number;
5
+ }
6
+ export interface ContextBreakdownProps {
7
+ /** What fills the window, e.g. system prompt, tools, files, conversation. */
8
+ segments: ContextSegment[];
9
+ /** Size of the context window in tokens. */
10
+ max: number;
11
+ /** Model name shown in the header. */
12
+ model?: string;
13
+ /** From this share of `max` (0–1) the ring and bar turn ink and a note shows. Default 0.8. */
14
+ warnAt?: number;
15
+ /** Shows "Compact conversation". Return a promise and the button shows progress until it settles. */
16
+ onCompact?: () => void | Promise<void>;
17
+ className?: string;
18
+ }
19
+ export interface ContextMeterProps extends ContextBreakdownProps {
20
+ /** `sm` shows the ring and percentage only. */
21
+ size?: "sm" | "md";
22
+ side?: PopoverSide;
23
+ align?: PopoverAlign;
24
+ }
25
+ /** 182600 → "182.6k", 200000 → "200k". */
26
+ export declare const formatTokens: (n: number) => string;
27
+ /**
28
+ * The full breakdown of a context window: total used, a segmented bar, a legend per part and a Compact action.
29
+ * When usage drops, the bar glides down and the total counts down to the new value. ContextMeter shows it in a
30
+ * popover; place it on its own in a side panel.
31
+ */
32
+ export declare function ContextBreakdown({ segments, max, model, warnAt, onCompact, className }: ContextBreakdownProps): import("react").JSX.Element;
33
+ /**
34
+ * How much of the model's context window a conversation uses. A compact ring and "62% of 200k" open a breakdown
35
+ * by part with a Compact action. Near the limit the ring turns ink and the label says so in words.
36
+ */
37
+ export declare function ContextMeter({ size, side, align, ...props }: ContextMeterProps): import("react").JSX.Element;
38
+ export default ContextMeter;
@@ -0,0 +1,46 @@
1
+ export interface ModelOption {
2
+ value: string;
3
+ label: string;
4
+ /** Family heading the model sits under, e.g. "Astra 2". Models keep their order inside a group. */
5
+ group?: string;
6
+ /** One line about what it is good at. */
7
+ hint?: string;
8
+ /** Short tag next to the name in the trigger, e.g. "Pro" or "Fast". */
9
+ tag?: string;
10
+ /** 1 to 5. */
11
+ speed: number;
12
+ /** 1 to 5. */
13
+ intelligence: number;
14
+ /** Context window label, e.g. "200K". */
15
+ context?: string;
16
+ isNew?: boolean;
17
+ disabled?: boolean;
18
+ /** Why it is disabled, shown instead of the hint. */
19
+ disabledReason?: string;
20
+ }
21
+ export interface ModelPickerProps {
22
+ models: ModelOption[];
23
+ value?: string;
24
+ defaultValue?: string;
25
+ onChange?: (value: string) => void;
26
+ /** Accessible name of the trigger and the list. */
27
+ label?: string;
28
+ /** Show a search field at the top of the list. Default true. */
29
+ searchable?: boolean;
30
+ /** `field` is a bordered select, `chip` a quiet trigger for toolbars (e.g. inside a prompt composer). */
31
+ variant?: "field" | "chip";
32
+ /** Where the list opens. Default bottom. */
33
+ side?: "bottom" | "top";
34
+ align?: "start" | "end";
35
+ /** Form field name, submitted as a hidden input. */
36
+ name?: string;
37
+ disabled?: boolean;
38
+ className?: string;
39
+ }
40
+ /**
41
+ * A select for AI models. The list is grouped by family and every row shows a one-line hint, speed and
42
+ * intelligence dots, the context size and a New badge. Search filters as you type. Arrows, Home/End,
43
+ * Enter and Escape work, and without search, typing jumps to a model. The selection mark slides between rows.
44
+ */
45
+ export declare function ModelPicker({ models, value, defaultValue, onChange, label, searchable, variant, side, align, name, disabled, className, }: ModelPickerProps): import("react").JSX.Element;
46
+ export default ModelPicker;
@@ -10,6 +10,8 @@ export interface NavTile {
10
10
  export interface NavMenu {
11
11
  /** Panel width in px (clamped to the space available). */
12
12
  width?: number;
13
+ /** A plain dropdown: a short list that opens right under its trigger instead of the centred mega panel. */
14
+ list?: NavTile[];
13
15
  tiles?: NavTile[];
14
16
  columns?: {
15
17
  heading: string;
@@ -46,7 +48,8 @@ export interface NavbarProps {
46
48
  }
47
49
  /**
48
50
  * Site header with a mega menu. One shared panel sits under the bar and morphs its size between
49
- * sections while the new content slides in from the side you moved toward. Hovering a tile dims the
51
+ * sections while the new content slides in from the side you moved toward. A menu with `list` is a
52
+ * plain dropdown: the same panel glides over to sit right under its trigger. Hovering a tile dims the
50
53
  * rest. Below 560px of container width it collapses to a burger and a sheet of accordion sections.
51
54
  * Wrap it in an element with `@container` (the demo does) or it falls back to the viewport width.
52
55
  */
@@ -0,0 +1,61 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ComposerMention {
3
+ id: string;
4
+ label: string;
5
+ type: "file" | "person" | "doc";
6
+ /** Muted text on the right, e.g. a path or a role. */
7
+ hint?: string;
8
+ }
9
+ export interface ComposerCommand {
10
+ id: string;
11
+ /** Without the slash, e.g. "summarize". */
12
+ label: string;
13
+ hint?: string;
14
+ }
15
+ export type ComposerPart = {
16
+ type: "text";
17
+ text: string;
18
+ } | {
19
+ type: "mention";
20
+ item: ComposerMention;
21
+ } | {
22
+ type: "command";
23
+ item: ComposerCommand;
24
+ };
25
+ export interface ComposerMessage {
26
+ /** Plain text with tokens written as @label and /label. */
27
+ text: string;
28
+ /** Text and tokens in order, for when you need the ids. */
29
+ parts: ComposerPart[];
30
+ files: File[];
31
+ }
32
+ export interface PromptComposerProps {
33
+ onSend: (message: ComposerMessage) => void;
34
+ /** Called by the Stop button and by Escape while `running`. */
35
+ onStop?: () => void;
36
+ /** The agent is working: Send turns into Stop and a light orbits the border. */
37
+ running?: boolean;
38
+ /** Offered when you type @. */
39
+ mentions?: ComposerMention[];
40
+ /** Offered when you type /. */
41
+ commands?: ComposerCommand[];
42
+ /** A slot in the toolbar, e.g. a `ModelPicker` with variant="chip" side="top". */
43
+ model?: ReactNode;
44
+ placeholder?: string;
45
+ /** Accessible name of the field. Default "Message". */
46
+ label?: string;
47
+ /** `accept` for the file picker. */
48
+ accept?: string;
49
+ /** Bytes. Default 20 MB. */
50
+ maxFileSize?: number;
51
+ disabled?: boolean;
52
+ className?: string;
53
+ }
54
+ /**
55
+ * The input of an agent app. The field grows as you type. @ opens a mention menu for files, people and docs,
56
+ * / opens commands, and a pick becomes a token chip that Backspace removes in one go. Attach files as chips,
57
+ * put a model picker in the toolbar, and press Enter to send (Shift + Enter for a new line). While the agent
58
+ * works, Send turns into Stop and a band of light orbits the border.
59
+ */
60
+ export declare function PromptComposer({ onSend, onStop, running, mentions, commands, model, placeholder, label, accept, maxFileSize, disabled, className, }: PromptComposerProps): import("react").JSX.Element;
61
+ export default PromptComposer;
@@ -0,0 +1,44 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * Reads what was typed into a scrub field without eval: numbers with an optional unit ("12px", "1.5rem", "45°"),
4
+ * + − × ÷ and brackets. A leading +, * or / works on the current value ("+8", "*2"). Returns null when it can't.
5
+ */
6
+ export declare function parseScrubValue(text: string, current: number, unit?: string): number | null;
7
+ export interface ScrubInputProps {
8
+ /** Short prefix you drag to scrub: "X", "W" or a small icon. */
9
+ label: ReactNode;
10
+ /** Full name for screen readers and the tooltip, e.g. "Rotation". Needed when the label is an icon or one letter. */
11
+ title?: string;
12
+ value?: number;
13
+ defaultValue?: number;
14
+ /** Fires on every change, also while scrubbing. */
15
+ onChange?: (value: number) => void;
16
+ min?: number;
17
+ max?: number;
18
+ /** One arrow press, or 2px of drag. Shift is ×10, Alt is ×0.1. */
19
+ step?: number;
20
+ /** Most decimals kept. Trailing zeros are hidden. */
21
+ precision?: number;
22
+ /** Unit of the value: px, rem, °, %, ms… Typed units of the same kind convert ("1.5rem" → 24 in a px field). */
23
+ unit?: string;
24
+ /** Submits the number with a form through a hidden input. */
25
+ name?: string;
26
+ disabled?: boolean;
27
+ size?: "sm" | "md";
28
+ className?: string;
29
+ }
30
+ /**
31
+ * The number field of a design tool. Drag the label left or right to scrub (Shift ×10, Alt ×0.1), or click and
32
+ * type. It reads units and simple sums like "24*2" or "+8" on Enter. Arrow keys step. At min or max the value
33
+ * nudges toward the edge and a short bar shows which limit it hit.
34
+ */
35
+ export declare function ScrubInput({ label, title, value, defaultValue, onChange, min, max, step, precision, unit, name, disabled, size, className }: ScrubInputProps): import("react").JSX.Element;
36
+ export interface ScrubRowProps {
37
+ /** Muted label on the left, e.g. "Position". */
38
+ label?: string;
39
+ cols?: 1 | 2 | 3 | 4;
40
+ children: ReactNode;
41
+ className?: string;
42
+ }
43
+ export declare function ScrubRow({ label, cols, children, className }: ScrubRowProps): import("react").JSX.Element;
44
+ export default ScrubInput;
@@ -14,12 +14,34 @@ export interface SidebarWorkspace {
14
14
  id: string;
15
15
  name: string;
16
16
  plan?: string;
17
+ /** Square logo. Leave it out and the first letter is used. */
18
+ logo?: ReactNode;
19
+ }
20
+ export interface SidebarPromo {
21
+ title: string;
22
+ text?: string;
23
+ icon?: ReactNode;
24
+ onClick?: () => void;
25
+ /** Shows a close button. The card hides itself and this is called. */
26
+ onDismiss?: () => void;
17
27
  }
18
28
  export interface SidebarProps {
19
- workspaces: SidebarWorkspace[];
29
+ /** Wordmark at the top. Defaults to the current workspace name. */
30
+ brand?: ReactNode;
31
+ groups: SidebarGroup[];
32
+ /** Links pinned to the bottom, under the promo card. */
33
+ footer?: SidebarItem[];
34
+ promo?: SidebarPromo;
35
+ /** The striped button near the bottom, for an upgrade or a plan. */
36
+ cta?: {
37
+ label: string;
38
+ icon?: ReactNode;
39
+ onClick?: () => void;
40
+ };
41
+ /** Workspace switcher at the very bottom. The menu opens upward. */
42
+ workspaces?: SidebarWorkspace[];
20
43
  defaultWorkspace?: string;
21
44
  onWorkspaceChange?: (id: string) => void;
22
- groups: SidebarGroup[];
23
45
  /** Controlled active item. Leave it out and the sidebar tracks clicks itself. */
24
46
  active?: string;
25
47
  defaultActive?: string;
@@ -27,7 +49,7 @@ export interface SidebarProps {
27
49
  collapsed?: boolean;
28
50
  defaultCollapsed?: boolean;
29
51
  onCollapsedChange?: (collapsed: boolean) => void;
30
- user: {
52
+ user?: {
31
53
  name: string;
32
54
  email: string;
33
55
  src?: string;
@@ -35,9 +57,9 @@ export interface SidebarProps {
35
57
  className?: string;
36
58
  }
37
59
  /**
38
- * App sidebar: a workspace switcher, grouped navigation with a sliding active indicator, and the
39
- * signed-in user at the bottom. It folds to a 64px icon rail where labels fade out and tooltips take
40
- * over. Arrow keys move between items.
60
+ * App sidebar: a wordmark, grouped navigation with a sliding grey pill, then a promo card, footer
61
+ * links, a striped call to action and the workspace switcher at the bottom. It folds to a 64px icon
62
+ * rail where labels fade out and tooltips take over. Arrow keys move between items.
41
63
  */
42
- export declare function Sidebar({ workspaces, defaultWorkspace, onWorkspaceChange, groups, active: activeProp, defaultActive, onNavigate, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, user, className, }: SidebarProps): import("react").JSX.Element;
64
+ export declare function Sidebar({ brand, groups, footer, promo, cta, workspaces, defaultWorkspace, onWorkspaceChange, active: activeProp, defaultActive, onNavigate, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, user, className, }: SidebarProps): import("react").JSX.Element;
43
65
  export default Sidebar;
@@ -0,0 +1,28 @@
1
+ export type ThinkingStatus = "thinking" | "done" | "stopped";
2
+ export interface ThinkingProps {
3
+ /** `thinking` runs the shimmer and the timer. `done` and `stopped` freeze them and fold the panel. */
4
+ status?: ThinkingStatus;
5
+ /** Reasoning summary lines. Append to the array while thinking and each new line fades in. */
6
+ steps?: string[];
7
+ /** One line shown under the header once finished, while folded. Defaults to the last step. */
8
+ summary?: string;
9
+ /** Elapsed seconds, if you track time yourself. Leave it out and the component times itself. */
10
+ seconds?: number;
11
+ /** Label while thinking. */
12
+ label?: string;
13
+ open?: boolean;
14
+ defaultOpen?: boolean;
15
+ onOpenChange?: (open: boolean) => void;
16
+ /** `block` shows a preview line and the panel under the header. `inline` is one line that sits in text, with no panel. */
17
+ variant?: "block" | "inline";
18
+ size?: "sm" | "md";
19
+ className?: string;
20
+ }
21
+ export declare const formatThinkingTime: (s: number) => string;
22
+ /**
23
+ * Shows that a model is reasoning. The label shimmers and a timer counts up while it thinks, and the reasoning
24
+ * summary streams in line by line inside a disclosure. When it finishes the shimmer stops, the label reads
25
+ * "Thought for 12s" and the panel folds down to one summary line you can open again.
26
+ */
27
+ export declare function Thinking({ status, steps, summary, seconds, label, open, defaultOpen, onOpenChange, variant, size, className, }: ThinkingProps): import("react").JSX.Element;
28
+ export default Thinking;
@@ -0,0 +1,43 @@
1
+ export type ToolDecision = "deny" | "once" | "always";
2
+ /** `read` only looks, `write` changes data you can change back, `destructive` can't be undone or reaches people. */
3
+ export type ToolRisk = "read" | "write" | "destructive";
4
+ export type ToolKind = "sql" | "shell" | "file" | "web" | "mail";
5
+ export interface ToolCallRequest {
6
+ id: string;
7
+ /** The tool's name as the agent calls it, e.g. `run_sql`. */
8
+ tool: string;
9
+ /** What the call will do, in one plain sentence. */
10
+ summary?: string;
11
+ /** Where it runs, e.g. "Postgres · billing-prod". */
12
+ source?: string;
13
+ kind?: ToolKind;
14
+ /** Arguments as a key/value list. */
15
+ args?: Record<string, string | number | boolean>;
16
+ /** A query or command, shown as code. Long ones fold after six lines. */
17
+ code?: string;
18
+ /** A file change. Lines start with "+", "-" or a space. */
19
+ diff?: {
20
+ file: string;
21
+ lines: string[];
22
+ };
23
+ risk?: ToolRisk;
24
+ /** Overrides the risk hint text, e.g. "Sends to 214 customers". */
25
+ note?: string;
26
+ }
27
+ export interface ToolApprovalProps {
28
+ /** Calls waiting for a decision, oldest first. Add to the array as the agent asks for more. */
29
+ calls: ToolCallRequest[];
30
+ /** Runs the tool once allowed (or is told it was denied). Return a promise and its time shows on the receipt. Throw to mark it failed. */
31
+ onDecide?: (call: ToolCallRequest, decision: ToolDecision) => void | Promise<unknown>;
32
+ /** Tools that never ask, e.g. remembered from an earlier session. */
33
+ defaultAllowed?: string[];
34
+ className?: string;
35
+ }
36
+ /**
37
+ * A permission card for an agent's tool call. It shows the tool, the arguments as key/value pairs, a query or a
38
+ * diff, and a risk hint in words. Deny, Allow once, or Always allow from the split menu, and the card folds into a
39
+ * one-line receipt with the run time. Enter allows and Esc denies while the card has focus. Queued calls stack
40
+ * behind it, and "Always allow" clears the queued calls to the same tool.
41
+ */
42
+ export declare function ToolApproval({ calls, onDecide, defaultAllowed, className }: ToolApprovalProps): import("react").JSX.Element;
43
+ export default ToolApproval;
@@ -0,0 +1,44 @@
1
+ export type SpanKind = "agent" | "llm" | "tool" | "retrieval";
2
+ export interface TraceSpan {
3
+ id: string;
4
+ /** Nests the span under another one. */
5
+ parentId?: string;
6
+ name: string;
7
+ kind: SpanKind;
8
+ /** Milliseconds from the start of the run. */
9
+ start: number;
10
+ /** Milliseconds. Leave it out while the span is still running (live mode). */
11
+ duration?: number;
12
+ model?: string;
13
+ tokensIn?: number;
14
+ tokensOut?: number;
15
+ /** In US dollars. */
16
+ cost?: number;
17
+ status?: "ok" | "error";
18
+ /** What went wrong, shown in the detail panel. */
19
+ error?: string;
20
+ input?: string;
21
+ output?: string;
22
+ }
23
+ export interface TraceWaterfallProps {
24
+ spans: TraceSpan[];
25
+ title?: string;
26
+ /** Running spans grow with the clock and new spans animate in as you append them. */
27
+ live?: boolean;
28
+ /** When the run started (epoch ms). Needed for live mode. */
29
+ startedAt?: number;
30
+ selected?: string | null;
31
+ defaultSelected?: string | null;
32
+ onSelect?: (id: string | null) => void;
33
+ /** Keeps the layout with placeholder rows. */
34
+ loading?: boolean;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * An agent run as an APM-style waterfall. Spans nest as a tree you can fold, and their bars sit on a shared
39
+ * time axis with tokens, cost and latency beside them. Bars grow in from the left on first paint, and in live
40
+ * mode running spans stretch with the clock while new ones slide in. Select a span to see its input and output.
41
+ * Failed spans say "Error" with an icon. On phones the table scrolls sideways and the span names stay put.
42
+ */
43
+ export declare function TraceWaterfall({ spans, title, live, startedAt, selected, defaultSelected, onSelect, loading, className }: TraceWaterfallProps): import("react").JSX.Element;
44
+ export default TraceWaterfall;