@alexkroman1/aai-ui 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +6 -7
  2. package/dist/_submission-timing.d.ts +40 -0
  3. package/dist/_submission.d.ts +56 -0
  4. package/dist/_theme.d.ts +17 -0
  5. package/dist/_theme.test-d.d.ts +14 -0
  6. package/dist/{_utils-Mi-SCFA1.js → _utils-BlZBJPdj.js} +4 -5
  7. package/dist/_utils.d.ts +4 -5
  8. package/dist/agent-state-labels.d.ts +8 -3
  9. package/dist/agent-state.d.ts +4 -2
  10. package/dist/append-dictation.d.ts +23 -0
  11. package/dist/audio/dictation.d.ts +36 -0
  12. package/dist/audio/index.d.ts +4 -2
  13. package/dist/audio/index.js +44 -1
  14. package/dist/{chat-view-DIwPoAEG.js → chat-view-BwKpF0MN.js} +65 -45
  15. package/dist/{client-config-C7fQrioM.js → client-config-DcMCWmkO.js} +8 -13
  16. package/dist/client-config.d.ts +29 -10
  17. package/dist/components/_form-readiness.d.ts +2 -1
  18. package/dist/components/audio-result.d.ts +2 -0
  19. package/dist/components/bullet-list.d.ts +1 -0
  20. package/dist/components/button.d.ts +2 -2
  21. package/dist/components/button.js +1 -1
  22. package/dist/components/chat-view.js +1 -2
  23. package/dist/components/console-shell.d.ts +8 -5
  24. package/dist/components/controls.d.ts +1 -0
  25. package/dist/components/controls.js +2 -2
  26. package/dist/components/conversation-view.d.ts +1 -0
  27. package/dist/components/facts.d.ts +1 -0
  28. package/dist/components/form-fields.d.ts +31 -12
  29. package/dist/components/form-types.d.ts +48 -2
  30. package/dist/components/form.d.ts +10 -5
  31. package/dist/components/markdown.d.ts +1 -0
  32. package/dist/components/message-list.d.ts +1 -0
  33. package/dist/components/message-list.js +1 -2
  34. package/dist/components/session-controls.d.ts +7 -2
  35. package/dist/components/session-error-banner.d.ts +1 -0
  36. package/dist/components/session-state-dot.d.ts +45 -20
  37. package/dist/components/sidebar-layout.d.ts +2 -2
  38. package/dist/components/sidebar-layout.js +1 -1
  39. package/dist/components/start-screen.js +2 -2
  40. package/dist/components/tool-call-block.d.ts +3 -3
  41. package/dist/components/tool-call-block.js +1 -2
  42. package/dist/components/tool-call-row.d.ts +1 -0
  43. package/dist/components/tool-config-context.d.ts +23 -5
  44. package/dist/components/url-chips.d.ts +4 -3
  45. package/dist/components/workflow-fields.d.ts +36 -11
  46. package/dist/components/workflow-pending-note.d.ts +31 -12
  47. package/dist/components/workflow-run-error.d.ts +1 -0
  48. package/dist/components/workflow-run-panel.d.ts +1 -0
  49. package/dist/context-BF0KsI9X.js +473 -0
  50. package/dist/context.d.ts +8 -7
  51. package/dist/context.js +1 -381
  52. package/dist/default-client/assets/audio-CtBvSS3L.js +1 -0
  53. package/dist/default-client/assets/{capture-processor-CXCWxCO8.js → capture-processor-BZXisGjZ.js} +1 -1
  54. package/dist/default-client/assets/index-BkjCv4MX.css +2 -0
  55. package/dist/default-client/assets/index-DUQoaxdq.js +127 -0
  56. package/dist/default-client/assets/{playback-processor-DXHfyQD9.js → playback-processor-BHk-iXEU.js} +1 -1
  57. package/dist/default-client/index.html +2 -2
  58. package/dist/default-client.d.ts +1 -3
  59. package/dist/define-client.d.ts +32 -28
  60. package/dist/define-client.js +85 -44
  61. package/dist/dictation-transcriber.d.ts +49 -0
  62. package/dist/{eyebrow-UfmSz9yy.js → eyebrow-Bp4y1rZ9.js} +1 -1
  63. package/dist/{hooks-DN4gHYsj.js → hooks-1CoQY_Fc.js} +2 -2
  64. package/dist/hooks.js +1 -2
  65. package/dist/inbox-protocol.d.ts +14 -4
  66. package/dist/inbox.d.ts +1 -0
  67. package/dist/index.d.ts +12 -9
  68. package/dist/index.js +905 -277
  69. package/dist/internal.d.ts +1 -1
  70. package/dist/internal.js +6 -6
  71. package/dist/linked-client.d.ts +2 -0
  72. package/dist/{message-list-DHZcLhRA.js → message-list-BBHLK05X.js} +24 -13
  73. package/dist/page.d.ts +2 -0
  74. package/dist/phone.d.ts +1 -0
  75. package/dist/route-fetch.d.ts +8 -1
  76. package/dist/session/audio-setup.d.ts +1 -1
  77. package/dist/session/audio-state.d.ts +6 -6
  78. package/dist/session/index.js +1 -1
  79. package/dist/session/messages.d.ts +1 -9
  80. package/dist/session/preconnect.d.ts +1 -1
  81. package/dist/session/types.d.ts +4 -0
  82. package/dist/{session-CYdjRvbl.js → session-Rud8mmU-.js} +26 -15
  83. package/dist/stored-value.d.ts +2 -0
  84. package/dist/{tool-call-block-uXtMOUWN.js → tool-call-block-C8s6AhjS.js} +4 -4
  85. package/dist/tool-config-context-Bd-7xrfP.js +28 -0
  86. package/dist/types.d.ts +95 -6
  87. package/dist/{url-chips-oyy_Eiqh.js → url-chips-C_SHU6fq.js} +2 -2
  88. package/dist/use-client-runs.d.ts +2 -0
  89. package/dist/use-conversation-log.d.ts +2 -0
  90. package/dist/use-conversation.d.ts +24 -9
  91. package/dist/use-copy.d.ts +1 -0
  92. package/dist/use-dictation.d.ts +145 -0
  93. package/dist/use-download-url.d.ts +6 -1
  94. package/dist/use-flash.d.ts +1 -0
  95. package/dist/use-inbox.d.ts +2 -0
  96. package/dist/use-push-to-talk.d.ts +6 -1
  97. package/dist/use-route-mutation.d.ts +3 -0
  98. package/dist/use-route.d.ts +51 -7
  99. package/dist/use-run-key.d.ts +6 -1
  100. package/dist/use-session-controls.d.ts +1 -0
  101. package/dist/use-tap-to-talk.d.ts +5 -2
  102. package/dist/{use-user-transcript-uyHhzy4d.js → use-user-transcript-lOu_uMnf.js} +1 -1
  103. package/dist/use-user-transcript.d.ts +5 -1
  104. package/dist/use-workflow-form.d.ts +76 -167
  105. package/dist/use-workflow-progress.d.ts +5 -0
  106. package/dist/{use-workflow-run-DdhWmbx-.js → use-workflow-run-BTEemod0.js} +2 -2
  107. package/dist/use-workflow-run.d.ts +5 -0
  108. package/dist/use-workflow-runs.d.ts +18 -4
  109. package/dist/use-workflow-stream.d.ts +33 -7
  110. package/dist/use-workflows.d.ts +10 -2
  111. package/dist/workflow-client.d.ts +5 -0
  112. package/dist/workflow-def-types.d.ts +18 -2
  113. package/dist/workflow-field-kind.d.ts +66 -10
  114. package/dist/workflow-submission.d.ts +265 -0
  115. package/dist/worklets/capture-processor.d.ts +3 -3
  116. package/dist/worklets/capture-processor.js +2 -2
  117. package/dist/worklets/playback-processor.d.ts +3 -3
  118. package/dist/worklets/playback-processor.js +2 -2
  119. package/package.json +2 -2
  120. package/dist/default-client/assets/audio-DzwGxdv4.js +0 -1
  121. package/dist/default-client/assets/index-BOTLwsNO.js +0 -126
  122. package/dist/default-client/assets/index-_-x5JLLa.css +0 -2
  123. package/dist/tool-config-context-Es4YUzV2.js +0 -19
@@ -66,7 +66,33 @@ export declare const CLIENT_CONFIG_ATTEMPT_TIMEOUT_MS = 10000;
66
66
  *
67
67
  * @internal
68
68
  */
69
- export declare function loadClientConfig(platformUrl: string, fetchFn?: typeof globalThis.fetch, presentedTicket?: string): Promise<ClientConfigResponse | null>;
69
+ export declare function loadClientConfig(platformUrl: string, fetchFn?: typeof globalThis.fetch, presentedTicket?: string, signal?: AbortSignal): Promise<ClientConfigResponse | null>;
70
+ /**
71
+ * Options for {@link fetchClientConfig}.
72
+ *
73
+ * @input
74
+ * @public
75
+ */
76
+ export type FetchClientConfigOptions = {
77
+ /**
78
+ * The agent's base URL. **Defaults to the page's own origin and path**, which
79
+ * is the agent that served the page and the only case a browser has. Pass
80
+ * one for a page reading a DIFFERENT agent; the endpoint is resolved
81
+ * relative to it.
82
+ */
83
+ platformUrl?: string | undefined;
84
+ /**
85
+ * Fetch implementation, for tests and for a caller that supplies its own
86
+ * credentials. Defaults to the global `fetch`.
87
+ */
88
+ fetch?: typeof globalThis.fetch | undefined;
89
+ /**
90
+ * Abandons the lookup — a component that unmounts before the answer, say.
91
+ * An abandoned lookup resolves to the agent default like every other one that produced no
92
+ * answer; the built-in 10 s deadline applies either way.
93
+ */
94
+ signal?: AbortSignal | undefined;
95
+ };
70
96
  /**
71
97
  * Fetch the agent's declared `name`, `greeting` and front door; any failure
72
98
  * yields the agent default (`{}`).
@@ -86,14 +112,7 @@ export declare function loadClientConfig(platformUrl: string, fetchFn?: typeof g
86
112
  * treat every field as optional, because an agent that declared none is a
87
113
  * normal agent.
88
114
  *
89
- * @param platformUrl - The agent's base URL. **Defaults to the page's own
90
- * origin and path** (`pageBaseUrl()`), which is the agent that served the page
91
- * and the only case a browser has — the argument was required while the default
92
- * sat one module away in this same package, so every caller wrote
93
- * `location.origin + location.pathname` for itself. Pass one for a page reading
94
- * a DIFFERENT agent. The endpoint is resolved relative to it.
95
- * @param fetchFn - Fetch implementation, for tests and for a caller that
96
- * supplies its own credentials. Defaults to the global `fetch`.
115
+ * @param options - Where to look and how; see {@link FetchClientConfigOptions}.
97
116
  * @returns The agent's config, or `{}` when the lookup produced no answer.
98
117
  *
99
118
  * @example
@@ -116,4 +135,4 @@ export declare function loadClientConfig(platformUrl: string, fetchFn?: typeof g
116
135
  *
117
136
  * @public
118
137
  */
119
- export declare function fetchClientConfig(platformUrl?: string, fetchFn?: typeof globalThis.fetch): Promise<ClientConfigResponse>;
138
+ export declare function fetchClientConfig(options?: FetchClientConfigOptions): Promise<ClientConfigResponse>;
@@ -28,9 +28,10 @@
28
28
  * outside a provider reports nothing pending, so every hand-written form is
29
29
  * unaffected and `Form` keeps working outside this package.
30
30
  */
31
+ import { type Provider } from "react";
31
32
  /** What a child calls to say whether its own fields are ready. */
32
33
  type Readiness = (key: string, pending: boolean) => void;
33
- export declare const FormReadinessProvider: import("react").Provider<Readiness | undefined>;
34
+ export declare const FormReadinessProvider: Provider<Readiness | undefined>;
34
35
  /**
35
36
  * Track which children are still waiting for their fields.
36
37
  *
@@ -4,6 +4,7 @@ import type { UseDownloadUrlResult } from "../use-download-url.ts";
4
4
  * A one-cue caption track for {@link AudioResult}: the words the clip speaks,
5
5
  * spanning its whole length.
6
6
  *
7
+ * @input
7
8
  * @public
8
9
  */
9
10
  export type AudioResultCaptions = {
@@ -19,6 +20,7 @@ export type AudioResultCaptions = {
19
20
  /**
20
21
  * Props of {@link AudioResult}.
21
22
  *
23
+ * @input
22
24
  * @public
23
25
  */
24
26
  export type AudioResultProps = {
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
2
2
  /**
3
3
  * Props for {@link BulletList}.
4
4
  *
5
+ * @input
5
6
  * @public
6
7
  */
7
8
  export type BulletListProps = {
@@ -1,4 +1,4 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
1
+ import type { ButtonHTMLAttributes, JSX, ReactNode } from "react";
2
2
  /**
3
3
  * Visual style of a {@link Button} (design-system "website refresh":
4
4
  * rectangular, ALL-CAPS, tracked labels).
@@ -55,4 +55,4 @@ export declare function Button({ variant, size, className, children, style, ...r
55
55
  className?: string;
56
56
  /** Button label / content. */
57
57
  children?: ReactNode;
58
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className">): import("react").JSX.Element;
58
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className">): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { useTheme } from "../context.js";
1
+ import { u as useTheme } from "../context-BF0KsI9X.js";
2
2
  import { a as inkTint, i as focusRingStyle, n as FOCUS_RING, o as primaryTint } from "../_colors-CpZO-88A.js";
3
3
  import clsx from "clsx";
4
4
  import { jsx } from "react/jsx-runtime";
@@ -1,3 +1,2 @@
1
- import { t as ChatView } from "../chat-view-DIwPoAEG.js";
2
- import "../context.js";
1
+ import { t as ChatView } from "../chat-view-BwKpF0MN.js";
3
2
  export { ChatView };
@@ -3,6 +3,7 @@ import type { AgentState } from "../types.ts";
3
3
  /**
4
4
  * Props of {@link ConsoleShell}.
5
5
  *
6
+ * @input
6
7
  * @public
7
8
  */
8
9
  export type ConsoleShellProps = {
@@ -67,11 +68,13 @@ export type ConsoleShellProps = {
67
68
  * footer={<Controls />}
68
69
  * >
69
70
  * <ul>
70
- * {items.map((item) => (
71
- * <li key={item.kind === "message" ? item.message.id : item.toolCall.callId}>
72
- * {item.kind === "message" ? item.message.content : item.toolCall.name}
73
- * </li>
74
- * ))}
71
+ * {items.map((item) =>
72
+ * item.kind === "message" ? (
73
+ * <li key={item.message.id}>{item.message.content}</li>
74
+ * ) : item.kind === "tool" ? (
75
+ * <li key={item.toolCall.callId}>{item.toolCall.name}</li>
76
+ * ) : null,
77
+ * )}
75
78
  * </ul>
76
79
  * </ConsoleShell>
77
80
  * );
@@ -2,6 +2,7 @@ import { type FunctionComponent, type MemoExoticComponent } from "react";
2
2
  /**
3
3
  * Props of {@link Controls}.
4
4
  *
5
+ * @input
5
6
  * @public
6
7
  */
7
8
  export type ControlsProps = {
@@ -1,6 +1,6 @@
1
- import { useSessionCore, useSessionSelector } from "../context.js";
1
+ import { c as useSessionSelector, o as useSessionCore } from "../context-BF0KsI9X.js";
2
2
  import { Button } from "./button.js";
3
- import { n as SessionUrlChips } from "../url-chips-oyy_Eiqh.js";
3
+ import { n as SessionUrlChips } from "../url-chips-C_SHU6fq.js";
4
4
  import { memo } from "react";
5
5
  import clsx from "clsx";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -6,6 +6,7 @@ import type { UseUserTranscriptResult } from "../use-user-transcript.ts";
6
6
  /**
7
7
  * Props of {@link ConversationView}.
8
8
  *
9
+ * @input
9
10
  * @public
10
11
  */
11
12
  export type ConversationViewProps = {
@@ -2,6 +2,7 @@ import type { ReactNode } from "react";
2
2
  /**
3
3
  * Props for {@link Facts}.
4
4
  *
5
+ * @input
5
6
  * @public
6
7
  */
7
8
  export type FactsProps = {
@@ -1,5 +1,5 @@
1
- import type { InputHTMLAttributes, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
2
- import type { FieldShell, FileReadMode } from "./form-types.ts";
1
+ import type { InputHTMLAttributes, JSX, ReactNode, SelectHTMLAttributes, TextareaHTMLAttributes } from "react";
2
+ import type { FieldShell, FileReadMode, FileValueShape, TextSplitMode } from "./form-types.ts";
3
3
  /**
4
4
  * Label + control + hint, in the layout every field here uses.
5
5
  *
@@ -36,7 +36,7 @@ export declare function Field({ label, hint, htmlFor, className, children, }: {
36
36
  className?: string | undefined;
37
37
  /** The control itself. */
38
38
  children: ReactNode;
39
- }): import("react").JSX.Element;
39
+ }): JSX.Element;
40
40
  /**
41
41
  * A single-line text input.
42
42
  *
@@ -47,7 +47,7 @@ export declare function Field({ label, hint, htmlFor, className, children, }: {
47
47
  *
48
48
  * @public
49
49
  */
50
- export declare function TextField(props: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className">): import("react").JSX.Element;
50
+ export declare function TextField(props: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className">): JSX.Element;
51
51
  /**
52
52
  * A number input. Contributes a NUMBER to {@link FormValues}, or nothing when
53
53
  * left empty.
@@ -60,18 +60,28 @@ export declare function TextField(props: FieldShell & Omit<InputHTMLAttributes<H
60
60
  *
61
61
  * @public
62
62
  */
63
- export declare function NumberField(props: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): import("react").JSX.Element;
63
+ export declare function NumberField(props: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): JSX.Element;
64
64
  /**
65
65
  * A multi-line text input.
66
66
  *
67
67
  * Accepts every `<textarea>` attribute except `name` and `className`, plus the
68
68
  * shared {@link FieldShell} props. `rows` defaults to 4.
69
69
  *
70
- * @param props - {@link FieldShell} props plus `<textarea>` attributes.
70
+ * **`split="lines"` contributes a `string[]`** — one entry per non-blank line,
71
+ * trimmed — which is the control for a schema's `z.array(z.string())`: "one
72
+ * point per line". `document-redline-workflow` reshaped the textarea's string
73
+ * by hand on submit; the field does it now, so `<WorkflowFields>` can render
74
+ * it for a `string[]` property and a hand-written one can match. See
75
+ * {@link TextSplitMode}.
76
+ *
77
+ * @param props - {@link FieldShell} props, `split`, and `<textarea>` attributes.
71
78
  *
72
79
  * @public
73
80
  */
74
- export declare function TextAreaField({ name, label, hint, className, rows, ...rest }: FieldShell & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "name" | "className">): import("react").JSX.Element;
81
+ export declare function TextAreaField({ name, label, hint, className, rows, split, ...rest }: FieldShell & {
82
+ /** How the text is contributed — see above. Default `"none"`, the string. */
83
+ split?: TextSplitMode | undefined;
84
+ } & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "name" | "className">): JSX.Element;
75
85
  /**
76
86
  * A dropdown.
77
87
  *
@@ -94,7 +104,7 @@ export declare function SelectField({ name, label, hint, className, options, chi
94
104
  value: string;
95
105
  label: string;
96
106
  })[];
97
- } & Omit<SelectHTMLAttributes<HTMLSelectElement>, "name" | "className">): import("react").JSX.Element;
107
+ } & Omit<SelectHTMLAttributes<HTMLSelectElement>, "name" | "className">): JSX.Element;
98
108
  /**
99
109
  * A checkbox. Contributes a BOOLEAN to {@link FormValues}.
100
110
  *
@@ -106,7 +116,7 @@ export declare function SelectField({ name, label, hint, className, options, chi
106
116
  *
107
117
  * @public
108
118
  */
109
- export declare function CheckboxField({ name, label, hint, className, ...rest }: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): import("react").JSX.Element;
119
+ export declare function CheckboxField({ name, label, hint, className, ...rest }: FieldShell & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): JSX.Element;
110
120
  /**
111
121
  * A file picker. Contributes a {@link FileValue} (or an array, with `multiple`)
112
122
  * to {@link FormValues} — or nothing when no file was chosen.
@@ -126,17 +136,26 @@ export declare function CheckboxField({ name, label, hint, className, ...rest }:
126
136
  * {@link FileReadMode} for the four values; `upload` is shorthand for
127
137
  * `read="upload"`.
128
138
  *
139
+ * **`as="namedText"` contributes `{ name, text }`** ({@link NamedTextValue})
140
+ * instead of the metadata-bearing {@link FileValue}, and implies
141
+ * `read="text"`: the shape a schema declares for a draft to redline or a
142
+ * config to apply, and the one `<WorkflowFields>` renders for an object
143
+ * property of exactly that shape. `document-redline-workflow` reshaped the
144
+ * `FileValue` by hand on submit; the field does it now.
145
+ *
129
146
  * Otherwise accepts every `<input>` attribute except `name`, `className` and
130
147
  * `type`, plus the shared {@link FieldShell} props — so `accept` and
131
148
  * `multiple` are passed straight through.
132
149
  *
133
- * @param props - {@link FieldShell} props, `read`/`upload`, and `<input>`
150
+ * @param props - {@link FieldShell} props, `read`/`upload`/`as`, and `<input>`
134
151
  * attributes.
135
152
  *
136
153
  * @public
137
154
  */
138
- export declare function FileField({ name, label, hint, className, read, upload, ...rest }: FieldShell & {
155
+ export declare function FileField({ name, label, hint, className, read, upload, as, ...rest }: FieldShell & {
139
156
  read?: FileReadMode;
140
157
  /** Shorthand for `read="upload"` — see above. */
141
158
  upload?: boolean;
142
- } & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): import("react").JSX.Element;
159
+ /** The shape of a READ file's value — see above and {@link FileValueShape}. */
160
+ as?: FileValueShape | undefined;
161
+ } & Omit<InputHTMLAttributes<HTMLInputElement>, "name" | "className" | "type">): JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * What a form's controls CONTRIBUTE — the three types both halves of the form
3
- * code share.
2
+ * What a form's controls CONTRIBUTE — the types both halves of the form code
3
+ * share, and {@link isFileValue}, the guard that reads one back.
4
4
  *
5
5
  * Their own module because `form.tsx` (the components) and `_form-values.ts`
6
6
  * (the DOM read) both need them, and a type living in one of those would make
@@ -18,6 +18,10 @@ export type FormValues = Record<string, unknown>;
18
18
  /**
19
19
  * What a {@link FileField} contributes to {@link FormValues}.
20
20
  *
21
+ * `FormValues` is `Record<string, unknown>`, so a page narrows the field's
22
+ * value with {@link isFileValue} rather than casting it.
23
+ *
24
+ * @sealed
21
25
  * @public
22
26
  */
23
27
  export type FileValue = {
@@ -35,6 +39,30 @@ export type FileValue = {
35
39
  */
36
40
  content?: string;
37
41
  };
42
+ /**
43
+ * Whether one {@link FormValues} entry is what a {@link FileField} contributed.
44
+ *
45
+ * A field with nothing chosen contributes no key at all, so the absent case is
46
+ * the ordinary one — this is `false` for `undefined`, not an error.
47
+ *
48
+ * @public
49
+ */
50
+ export declare function isFileValue(value: unknown): value is FileValue;
51
+ /**
52
+ * What a `<FileField read="text" as="namedText">` contributes: the file's name
53
+ * and its text, and nothing else — the shape a workflow schema declares as
54
+ * `z.object({ name: z.string(), text: z.string() })` for a draft, a config, a
55
+ * CSV of ids that belongs in the run's input rather than in an upload. A
56
+ * {@link FileValue} carries the browser's metadata too, which a schema then
57
+ * has to strip or refuse; this is the value a schema can take as it is.
58
+ *
59
+ * @sealed
60
+ * @public
61
+ */
62
+ export type NamedTextValue = {
63
+ name: string;
64
+ text: string;
65
+ };
38
66
  /**
39
67
  * How much of a chosen file a {@link FileField} reads.
40
68
  *
@@ -47,6 +75,23 @@ export type FileValue = {
47
75
  * @public
48
76
  */
49
77
  export type FileReadMode = "none" | "text" | "dataUrl" | "upload";
78
+ /**
79
+ * The SHAPE a {@link FileField} contributes a read file as. `"file"` (the
80
+ * default) is a {@link FileValue}; `"namedText"` is a {@link NamedTextValue},
81
+ * which implies `read="text"`. Only `"namedText"` is a reshape today; the
82
+ * option exists so a workflow's object property has a declared control.
83
+ *
84
+ * @public
85
+ */
86
+ export type FileValueShape = "file" | "namedText";
87
+ /**
88
+ * How a {@link TextAreaField} contributes its text. `"none"` (the default) is
89
+ * the string; `"lines"` is a `string[]` — one entry per non-blank line,
90
+ * trimmed — the control for a schema's `z.array(z.string())`.
91
+ *
92
+ * @public
93
+ */
94
+ export type TextSplitMode = "none" | "lines";
50
95
  /**
51
96
  * The props every field in `form.tsx` shares.
52
97
  *
@@ -54,6 +99,7 @@ export type FileReadMode = "none" | "text" | "dataUrl" | "upload";
54
99
  * from a documented one has to be reachable from the entry point too, which the
55
100
  * docs build enforces.
56
101
  *
102
+ * @input
57
103
  * @public
58
104
  */
59
105
  export type FieldShell = {
@@ -1,9 +1,14 @@
1
- import type { ButtonHTMLAttributes, FormHTMLAttributes, ReactNode } from "react";
1
+ import type { ButtonHTMLAttributes, FormHTMLAttributes, JSX, ReactNode } from "react";
2
2
  import { type ButtonSize, type ButtonVariant } from "./button.tsx";
3
3
  import type { FormValues } from "./form-types.ts";
4
4
  export { CheckboxField, Field, FileField, NumberField, SelectField, TextAreaField, TextField, } from "./form-fields.tsx";
5
- export type { FieldShell, FileReadMode, FileValue, FormValues } from "./form-types.ts";
6
- /** Props of {@link Form}. */
5
+ export type { FieldShell, FileReadMode, FileValue, FileValueShape, FormValues, NamedTextValue, TextSplitMode, } from "./form-types.ts";
6
+ export { isFileValue } from "./form-types.ts";
7
+ /**
8
+ * Props of {@link Form}.
9
+ *
10
+ * @input
11
+ */
7
12
  export type FormProps = {
8
13
  /**
9
14
  * Called with the collected values. May be async — the form stays disabled
@@ -44,7 +49,7 @@ export type FormProps = {
44
49
  *
45
50
  * @public
46
51
  */
47
- export declare function Form({ onSubmit, error, children, className, ...rest }: FormProps): import("react").JSX.Element;
52
+ export declare function Form({ onSubmit, error, children, className, ...rest }: FormProps): JSX.Element;
48
53
  /**
49
54
  * The form's submit button, disabled and relabelled while a submit is in
50
55
  * flight.
@@ -93,4 +98,4 @@ export declare function SubmitButton({ children, pending, pendingLabel, size, va
93
98
  variant?: ButtonVariant | undefined;
94
99
  /** Additional CSS class names, appended to {@link Button}'s own. */
95
100
  className?: string | undefined;
96
- } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "disabled" | "className">): import("react").JSX.Element;
101
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "disabled" | "className">): JSX.Element;
@@ -10,6 +10,7 @@ export type MarkdownVariant = "default" | "compact";
10
10
  /**
11
11
  * Props of {@link Markdown}.
12
12
  *
13
+ * @input
13
14
  * @public
14
15
  */
15
16
  export type MarkdownProps = {
@@ -4,6 +4,7 @@ import type { ConversationLogEntry } from "../conversation-log.ts";
4
4
  /**
5
5
  * Props of {@link MessageList}.
6
6
  *
7
+ * @input
7
8
  * @public
8
9
  */
9
10
  export type MessageListProps = {
@@ -1,3 +1,2 @@
1
- import "../context.js";
2
- import { t as MessageList } from "../message-list-DHZcLhRA.js";
1
+ import { t as MessageList } from "../message-list-BBHLK05X.js";
3
2
  export { MessageList };
@@ -1,13 +1,16 @@
1
1
  import { type ReactNode } from "react";
2
2
  /**
3
- * Which of the four buttons a {@link SessionControlButton} is.
3
+ * Which button a {@link SessionControlButton} is: one of the four today. Open
4
+ * (`| (string & {})`) so a button added later is not a break — a `renderButton`
5
+ * keeps a default look for an action it does not know.
4
6
  *
5
7
  * @public
6
8
  */
7
- export type SessionControlAction = "start" | "toggle" | "restart" | "end";
9
+ export type SessionControlAction = "start" | "toggle" | "restart" | "end" | (string & {});
8
10
  /**
9
11
  * One button of {@link SessionControls}, as handed to `renderButton`.
10
12
  *
13
+ * @sealed
11
14
  * @public
12
15
  */
13
16
  export type SessionControlButton = {
@@ -27,6 +30,7 @@ export type SessionControlButton = {
27
30
  /**
28
31
  * The five words {@link SessionControls} renders, every one overridable.
29
32
  *
33
+ * @input
30
34
  * @public
31
35
  */
32
36
  export type SessionControlsLabels = {
@@ -44,6 +48,7 @@ export type SessionControlsLabels = {
44
48
  /**
45
49
  * Props of {@link SessionControls}.
46
50
  *
51
+ * @input
47
52
  * @public
48
53
  */
49
54
  export type SessionControlsProps = {
@@ -8,6 +8,7 @@ import type { ReactNode } from "react";
8
8
  * `createElement(SessionErrorBanner, { className })` caller unable to infer the
9
9
  * props at all, and gives the reference page nothing to link to.
10
10
  *
11
+ * @input
11
12
  * @public
12
13
  */
13
14
  export type SessionErrorBannerProps = {
@@ -1,5 +1,16 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { AgentState } from "../types.ts";
3
+ /**
4
+ * Indicator dot colour per state, from the theme — `ConsoleShell`'s dot, and
5
+ * {@link SessionStateDot}'s for every state its `colors` does not name.
6
+ *
7
+ * `idle` is the theme's own faint ink step rather than a fixed warm grey, so
8
+ * the dot stays visible on a dark ground; the thinking amber and error red
9
+ * are semantic and stay fixed. A state this version does not know is `idle`.
10
+ *
11
+ * @internal
12
+ */
13
+ export declare function stateColor(state: AgentState, primary: string, idle: string): string;
3
14
  /**
4
15
  * The dot itself: a coloured circle, pulsing or still.
5
16
  *
@@ -24,23 +35,45 @@ export declare function StateDot({ color, pulseMs, className, title, }: {
24
35
  /** Tooltip text, typically the raw state. */
25
36
  title?: string | undefined;
26
37
  }): ReactNode;
38
+ /**
39
+ * The coarse colour groups {@link SessionStateDotColors} accepts beside the
40
+ * exact states: `idle` (disconnected, connecting, and any state this version
41
+ * does not know), `live` (ready, listening, speaking) and `busy` (thinking).
42
+ * `error` has no group: its red is semantic and is only replaced by name.
43
+ *
44
+ * @public
45
+ */
46
+ export type SessionStateDotGroup = "idle" | "live" | "busy";
47
+ /**
48
+ * What {@link SessionStateDot} takes as `colors`: a colour per
49
+ * {@link AgentState}, per {@link SessionStateDotGroup}, or any mix. An exact
50
+ * state wins over its group; a state neither names is painted from the theme.
51
+ *
52
+ * @input
53
+ * @public
54
+ */
55
+ export type SessionStateDotColors = Partial<Readonly<Record<AgentState | SessionStateDotGroup, string>>>;
27
56
  /**
28
57
  * Props of {@link SessionStateDot}.
29
58
  *
59
+ * @input
30
60
  * @public
31
61
  */
32
62
  export type SessionStateDotProps = {
33
63
  /**
34
- * The dot's colour per {@link AgentState} — the chrome's own palette. A
35
- * complete record, so a state added upstream is a compile error here rather
36
- * than a silently unpainted dot; `satisfies Record<AgentState, string>` on the
37
- * caller's literal is the shape to write it in.
64
+ * The dot's colour per {@link AgentState}, per coarse group (`idle`, `live`,
65
+ * `busy`), or both — the chrome's own palette, see
66
+ * {@link SessionStateDotColors}. Any state not named either way (including
67
+ * one a later release adds) is painted from the mounted theme: the primary
68
+ * colour while live, the text colour at half strength while idle, a fixed
69
+ * amber while thinking, red on error.
38
70
  */
39
- colors: Readonly<Record<AgentState, string>>;
71
+ colors?: SessionStateDotColors | undefined;
40
72
  /**
41
73
  * The words this chrome has a better term for. Anything not named falls back
42
74
  * to {@link AGENT_STATE_LABELS}, so a page overrides one member (`speaking:
43
- * "Narrating"`) without restating the union.
75
+ * "Narrating"`) without restating the union; a state neither names is shown
76
+ * as its raw value.
44
77
  */
45
78
  labels?: Partial<Readonly<Record<AgentState, string>>> | undefined;
46
79
  /**
@@ -72,31 +105,20 @@ export type SessionStateDotProps = {
72
105
  * against a dot component on the grounds that it would take the shared part
73
106
  * (the words) hostage to the part that is not (the palette); this takes the
74
107
  * palette as a prop precisely so it does not. What is shared is the structure
75
- * — the exhaustive colour lookup, the label fallback, the pulse rule, the
108
+ * — the colour lookup and its theme fallback, the label fallback, the pulse rule, the
76
109
  * `useSessionStatus()` subscription that keeps the rest of the header from
77
110
  * re-rendering at STT-partial rate.
78
111
  *
79
112
  * Must be rendered inside the providers `mountClient()` installs.
80
113
  *
81
- * @example A dispatch board's readout: its own colours, three of its own words
114
+ * @example A dispatch board's readout: coarse colours, three of its own words
82
115
  * ```tsx
83
- * import type { AgentState } from "@alexkroman1/aai-ui";
84
116
  * import { SessionStateDot } from "@alexkroman1/aai-ui";
85
117
  *
86
- * const STATE_COLORS = {
87
- * disconnected: "#6b7280",
88
- * connecting: "#6b7280",
89
- * ready: "#22c55e",
90
- * listening: "#22c55e",
91
- * thinking: "#eab308",
92
- * speaking: "#3b82f6",
93
- * error: "#6b7280",
94
- * } satisfies Record<AgentState, string>;
95
- *
96
118
  * function StatusReadout() {
97
119
  * return (
98
120
  * <SessionStateDot
99
- * colors={STATE_COLORS}
121
+ * colors={{ idle: "#6b7280", live: "#22c55e", busy: "#eab308", speaking: "#3b82f6" }}
100
122
  * labels={{ listening: "LISTENING", thinking: "PROCESSING", speaking: "TRANSMITTING" }}
101
123
  * labelClassName="text-[11px] uppercase"
102
124
  * />
@@ -104,6 +126,9 @@ export type SessionStateDotProps = {
104
126
  * }
105
127
  * ```
106
128
  *
129
+ * With no `colors` at all the dot follows the mounted theme — a chrome that
130
+ * sets `mountClient({ theme })` gets a matching dot for free.
131
+ *
107
132
  * @param props - See {@link SessionStateDotProps}.
108
133
  *
109
134
  * @public
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import type { JSX, ReactNode } from "react";
2
2
  /**
3
3
  * A two-column layout with a fixed-width sidebar and a flexible main area.
4
4
  * Commonly used to pair a custom sidebar (cart, dashboard) with `<ChatView />`.
@@ -39,4 +39,4 @@ export declare function SidebarLayout({ sidebar, children, sidebarWidth, sidebar
39
39
  sidebarPosition?: "left" | "right" | undefined;
40
40
  /** Additional CSS class names for the root element, appended to its own. */
41
41
  className?: string;
42
- }): import("react").JSX.Element;
42
+ }): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { useTheme } from "../context.js";
1
+ import { u as useTheme } from "../context-BF0KsI9X.js";
2
2
  import clsx from "clsx";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/sidebar-layout.tsx
@@ -1,7 +1,7 @@
1
- import { useSessionCore, useSessionSelector, useTheme } from "../context.js";
1
+ import { c as useSessionSelector, o as useSessionCore, u as useTheme } from "../context-BF0KsI9X.js";
2
2
  import { a as inkTint } from "../_colors-CpZO-88A.js";
3
3
  import { Button } from "./button.js";
4
- import { t as Eyebrow } from "../eyebrow-UfmSz9yy.js";
4
+ import { t as Eyebrow } from "../eyebrow-Bp4y1rZ9.js";
5
5
  import clsx from "clsx";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/start-screen.tsx
@@ -1,5 +1,5 @@
1
1
  /** @jsxImportSource react */
2
- import { type ReactNode } from "react";
2
+ import { type FunctionComponent, type MemoExoticComponent } from "react";
3
3
  import type { ToolCallInfo } from "../types.ts";
4
4
  /**
5
5
  * Renders a tool invocation as the design system's console row (see
@@ -22,7 +22,7 @@ import type { ToolCallInfo } from "../types.ts";
22
22
  *
23
23
  * @internal Not exported from the package — rendered by `MessageList`.
24
24
  */
25
- export declare const ToolCallBlock: import("react").MemoExoticComponent<({ toolCall, className, }: {
25
+ export declare const ToolCallBlock: MemoExoticComponent<FunctionComponent<{
26
26
  toolCall: ToolCallInfo;
27
27
  className?: string;
28
- }) => ReactNode>;
28
+ }>>;
@@ -1,3 +1,2 @@
1
- import "../context.js";
2
- import { t as ToolCallBlock } from "../tool-call-block-uXtMOUWN.js";
1
+ import { t as ToolCallBlock } from "../tool-call-block-C8s6AhjS.js";
3
2
  export { ToolCallBlock };
@@ -9,6 +9,7 @@ export type ToolCallRowVariant = "default" | "compact";
9
9
  /**
10
10
  * Props for {@link ToolCallRow}.
11
11
  *
12
+ * @input
12
13
  * @public
13
14
  */
14
15
  export interface ToolCallRowProps {