@alexkroman1/aai-ui 3.0.0 → 3.2.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.
@@ -1,4 +1,4 @@
1
- import{i as e}from"./index-DXf7-M0Q.js";import{t}from"./_module-url-BX0RuRU2.js";var n=t(`
1
+ import{i as e}from"./index-BeVXjGwG.js";import{t}from"./_module-url-BX0RuRU2.js";var n=t(`
2
2
  class PlaybackProcessor extends AudioWorkletProcessor {
3
3
  constructor(options) {
4
4
  super();
Binary file
@@ -4,9 +4,9 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
6
  <title>aai</title>
7
- <link rel="icon" href="data:," />
7
+ <link rel="icon" href="./favicon.ico" />
8
8
  <style>html, body { background: #FBF8F2; margin: 0; }</style>
9
- <script type="module" crossorigin src="./assets/index-DXf7-M0Q.js"></script>
9
+ <script type="module" crossorigin src="./assets/index-BeVXjGwG.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="./assets/index-Dv-Q5VRL.css">
11
11
  </head>
12
12
  <body>
@@ -3,7 +3,7 @@ import { t as ChatView } from "./chat-view-C1oJxsWz.js";
3
3
  import { n as ToolConfigContext } from "./tool-call-block-DIxpG8GM.js";
4
4
  import { SidebarLayout } from "./components/sidebar-layout.js";
5
5
  import { StartScreen } from "./components/start-screen.js";
6
- import { t as createSessionCore } from "./session-core-BM3WHeoY.js";
6
+ import { t as createSessionCore } from "./session-core-DgioOYyx.js";
7
7
  import { CLIENT_CONFIG_PATH, ClientConfigResponseSchema } from "@alexkroman1/aai/protocol";
8
8
  import { createElement, useEffect, useState } from "react";
9
9
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { t as client } from "./define-client-Cyf1jqAl.js";
1
+ import { t as client } from "./define-client-fjNCp9be.js";
2
2
  import "./context.js";
3
3
  import "./components/sidebar-layout.js";
4
4
  import "./components/start-screen.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VOICE_CAPTURE_CONSTRAINTS } from "./types.js";
2
2
  import { floatToPcm16 } from "./audio.js";
3
- import { n as buildAgentUrl, r as fetchClientConfig, t as client } from "./define-client-Cyf1jqAl.js";
3
+ import { n as buildAgentUrl, r as fetchClientConfig, t as client } from "./define-client-fjNCp9be.js";
4
4
  import { SessionProvider, ThemeProvider, useSession, useSessionSelector, useTheme } from "./context.js";
5
5
  import { Button } from "./components/button.js";
6
6
  import { t as ChatView } from "./chat-view-C1oJxsWz.js";
@@ -9,6 +9,6 @@ import { n as ToolConfigContext } from "./tool-call-block-DIxpG8GM.js";
9
9
  import { MessageList } from "./components/message-list.js";
10
10
  import { SidebarLayout } from "./components/sidebar-layout.js";
11
11
  import { StartScreen } from "./components/start-screen.js";
12
- import { t as createSessionCore } from "./session-core-BM3WHeoY.js";
12
+ import { t as createSessionCore } from "./session-core-DgioOYyx.js";
13
13
  import { useEvent, useToolCallStart, useToolResult } from "./hooks.js";
14
14
  export { ApiUrlChip, Button, ChatView, Controls, MessageList, SessionProvider, SessionUrlChips, SidebarLayout, StartScreen, ThemeProvider, ToolConfigContext, UiUrlChip, VOICE_CAPTURE_CONSTRAINTS, buildAgentUrl, client, createSessionCore, fetchClientConfig, floatToPcm16, useEvent, useSession, useSessionSelector, useTheme, useToolCallStart, useToolResult };
@@ -182,7 +182,28 @@ function createMessageHandlers(deps) {
182
182
  state: "thinking"
183
183
  });
184
184
  }
185
+ /**
186
+ * `agent_transcript` carries the reply's text *so far* and is cumulative
187
+ * within a reply (see the protocol schema), so it renders as the live
188
+ * assistant bubble and only becomes a message when the reply closes. Pipeline
189
+ * mode sends one per piece of speech, so appending each would break a single
190
+ * reply into a message per sentence.
191
+ */
185
192
  function handleAgentTranscriptEvent(text) {
193
+ updateState({ agentTranscript: text });
194
+ }
195
+ /**
196
+ * The reply is over (`reply_done`, or `cancelled` for a barge-in): move
197
+ * whatever was spoken into the conversation. A cancelled reply still keeps its
198
+ * text — the caller heard that much, and dropping it would leave the
199
+ * transcript claiming the agent never spoke.
200
+ */
201
+ function commitAgentTranscript() {
202
+ const text = getSnapshot().agentTranscript;
203
+ if (text === null || text.length === 0) {
204
+ updateState({ agentTranscript: null });
205
+ return;
206
+ }
186
207
  updateState({
187
208
  agentTranscript: null,
188
209
  messages: appendCapped(getSnapshot().messages, {
@@ -265,14 +286,15 @@ function createMessageHandlers(deps) {
265
286
  break;
266
287
  }
267
288
  case "reply_done":
289
+ commitAgentTranscript();
268
290
  updateState({ state: "listening" });
269
291
  break;
270
292
  case "cancelled":
271
293
  handlerGeneration++;
272
294
  conn.voiceIO?.flush();
295
+ commitAgentTranscript();
273
296
  updateState({
274
297
  userTranscript: null,
275
- agentTranscript: null,
276
298
  state: "listening"
277
299
  });
278
300
  break;
@@ -1,2 +1,2 @@
1
- import { t as createSessionCore } from "./session-core-BM3WHeoY.js";
1
+ import { t as createSessionCore } from "./session-core-DgioOYyx.js";
2
2
  export { createSessionCore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-ui",
3
- "version": "3.0.0",
3
+ "version": "3.2.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -20,7 +20,7 @@
20
20
  "clsx": "^2.1.1",
21
21
  "partysocket": "^1.3.0",
22
22
  "use-sync-external-store": "^1.6.0",
23
- "@alexkroman1/aai": "3.0.0"
23
+ "@alexkroman1/aai": "3.2.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": "^19.0.0",