@alexkroman1/aai-ui 5.2.0 → 5.4.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 (42) hide show
  1. package/README.md +59 -0
  2. package/dist/{chat-view-C6N2oXjo.js → chat-view-CqRGHImR.js} +12 -6
  3. package/dist/client-config.d.ts +13 -2
  4. package/dist/components/button.d.ts +17 -11
  5. package/dist/components/button.js +9 -6
  6. package/dist/components/chat-view.d.ts +10 -4
  7. package/dist/components/chat-view.js +1 -1
  8. package/dist/components/controls.d.ts +6 -2
  9. package/dist/components/controls.js +1 -1
  10. package/dist/components/message-list.d.ts +6 -2
  11. package/dist/components/message-list.js +1 -1
  12. package/dist/components/sidebar-layout.d.ts +13 -3
  13. package/dist/components/sidebar-layout.js +13 -3
  14. package/dist/components/start-screen.d.ts +2 -0
  15. package/dist/components/start-screen.js +2 -0
  16. package/dist/components/tool-call-block.d.ts +1 -6
  17. package/dist/components/tool-call-block.js +1 -1
  18. package/dist/components/tool-config-context.d.ts +3 -3
  19. package/dist/components/url-chips.d.ts +3 -3
  20. package/dist/context.d.ts +59 -2
  21. package/dist/context.js +45 -0
  22. package/dist/{controls-Cqg7T4FN.js → controls-CoBO6sId.js} +9 -5
  23. package/dist/default-client/assets/{audio-C1U_foBG.js → audio-DXQj0wCf.js} +1 -1
  24. package/dist/default-client/assets/{capture-processor-dyyJArQs.js → capture-processor-DZg_Q6hY.js} +1 -1
  25. package/dist/default-client/assets/{index-CGZajs1V.js → index-DyY8OeVc.js} +25 -25
  26. package/dist/default-client/assets/{playback-processor-BO2TdYrv.js → playback-processor-DZlwpHHt.js} +1 -1
  27. package/dist/default-client/index.html +1 -1
  28. package/dist/define-client.d.ts +44 -9
  29. package/dist/define-client.js +22 -4
  30. package/dist/hooks.d.ts +51 -19
  31. package/dist/hooks.js +37 -7
  32. package/dist/index.d.ts +5 -5
  33. package/dist/index.js +6 -6
  34. package/dist/{message-list-CD9GxrlH.js → message-list-CdtrNi4w.js} +7 -3
  35. package/dist/{session-core-Bvga6tUS.js → session-core-DX2SIpdQ.js} +30 -4
  36. package/dist/session-core-types.d.ts +34 -9
  37. package/dist/session-core.d.ts +15 -0
  38. package/dist/session-core.js +1 -1
  39. package/dist/{tool-call-block-O9vLqoyU.js → tool-call-block-C--Bj04_.js} +4 -9
  40. package/dist/types.d.ts +23 -7
  41. package/dist/types.js +3 -0
  42. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -21,6 +21,9 @@ export { CAPTURE_STOP_ACK_TIMEOUT_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_
21
21
  *
22
22
  * Cast because `voiceIsolation` is newer than TypeScript's DOM lib.
23
23
  *
24
+ * Public so a custom client that opens its own microphone gets the same
25
+ * signal the built-in capture paths do.
26
+ *
24
27
  * @public
25
28
  */
26
29
  export declare const VOICE_CAPTURE_CONSTRAINTS: MediaTrackConstraints;
@@ -33,6 +36,11 @@ export type AgentState = "disconnected" | "connecting" | "ready" | "listening" |
33
36
  /**
34
37
  * A chat message exchanged between user and assistant.
35
38
  *
39
+ * `role` is `"user" | "assistant"` only — unlike the SDK's `Message`, there
40
+ * is no `"tool"` role here. Tool activity never arrives as messages: it is
41
+ * surfaced via `SessionSnapshot.toolCalls` (or `useEvent` for `ctx.send`
42
+ * events).
43
+ *
36
44
  * @public
37
45
  */
38
46
  export type ChatMessage = {
@@ -86,6 +94,10 @@ export type ToolCallInfo = {
86
94
  */
87
95
  afterMessageId: number;
88
96
  };
97
+ /**
98
+ * Re-exported from `@alexkroman1/aai/protocol` (the canonical definition)
99
+ * so client code needs only this package.
100
+ */
89
101
  export type { SessionErrorCode } from "@alexkroman1/aai/protocol";
90
102
  /**
91
103
  * Error reported by the voice session.
@@ -99,7 +111,10 @@ export type SessionError = {
99
111
  readonly message: string;
100
112
  };
101
113
  /**
102
- * Options for creating a voice session.
114
+ * Options for creating a voice session — the shared field set accepted by
115
+ * both `client()` and `createSessionCore`. The one difference: `client()`
116
+ * defaults `platformUrl` from `location.href`, while `createSessionCore`
117
+ * requires it.
103
118
  *
104
119
  * @public
105
120
  */
@@ -118,9 +133,10 @@ export type VoiceSessionOptions = {
118
133
  */
119
134
  onSessionId?: ((sessionId: string) => void) | undefined;
120
135
  /**
121
- * Session ID from a previous connection. When set, the server will
122
- * attempt to restore persisted session state (if the agent has
123
- * `persistence` enabled). Sensitive see {@link onSessionId}.
136
+ * Session ID from a previous connection. When set, the server resumes
137
+ * that session if its per-session state is still within the resume grace
138
+ * window (`SESSION_RESUME_GRACE_MS`), replaying history into the new
139
+ * connection. Sensitive — see {@link onSessionId}.
124
140
  */
125
141
  resumeSessionId?: string | undefined;
126
142
  /**
@@ -151,10 +167,10 @@ export type ClientTheme = {
151
167
  bg?: string;
152
168
  /** Primary accent color. Default: `#3F2BC1`. */
153
169
  primary?: string;
154
- /** Main text color. */
170
+ /** Main text color. Default: `#1B1A18`. */
155
171
  text?: string;
156
- /** Surface/card color. */
172
+ /** Surface/card color. Default: `#FFFFFF`. */
157
173
  surface?: string;
158
- /** Border color. */
174
+ /** Border color. Default: `#DCD7CC`. */
159
175
  border?: string;
160
176
  };
package/dist/types.js CHANGED
@@ -20,6 +20,9 @@ import { CAPTURE_STOP_ACK_TIMEOUT_MS, MIC_BUFFER_SECONDS, MIC_SEND_MAX_BUFFERED_
20
20
  *
21
21
  * Cast because `voiceIsolation` is newer than TypeScript's DOM lib.
22
22
  *
23
+ * Public so a custom client that opens its own microphone gets the same
24
+ * signal the built-in capture paths do.
25
+ *
23
26
  * @public
24
27
  */
25
28
  const VOICE_CAPTURE_CONSTRAINTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-ui",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -22,7 +22,7 @@
22
22
  "react-markdown": "^10.1.0",
23
23
  "remark-gfm": "^4.0.1",
24
24
  "use-sync-external-store": "^1.6.0",
25
- "@alexkroman1/aai": "5.2.0"
25
+ "@alexkroman1/aai": "5.4.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.0.0",