@alexkroman1/aai-ui 13.2.0 → 13.3.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 (41) hide show
  1. package/dist/{_colors-j8XMToi9.js → _colors-CZ6OlPbL.js} +1 -1
  2. package/dist/{_module-url-C_4gRVL0.js → _module-url-C13kAJ87.js} +1 -1
  3. package/dist/_recover-run.d.ts +11 -5
  4. package/dist/{_utils-B6498_bm.js → _utils-CyzjK0gW.js} +1 -1
  5. package/dist/{aai-logo-CXZGPSIY.js → aai-logo-CFlomZlS.js} +1 -1
  6. package/dist/audio.js +1 -1
  7. package/dist/{chat-view-DDTtrh7N.js → chat-view-Bv5VFJIE.js} +6 -6
  8. package/dist/{client-config-BT_kWID5.js → client-config-DD820zHn.js} +1 -1
  9. package/dist/client-dir.js +1 -1
  10. package/dist/components/button.js +2 -2
  11. package/dist/components/chat-view.js +1 -1
  12. package/dist/components/controls.js +2 -2
  13. package/dist/components/message-list.js +1 -1
  14. package/dist/components/sidebar-layout.js +1 -1
  15. package/dist/components/start-screen.js +4 -4
  16. package/dist/components/tool-call-block.js +1 -1
  17. package/dist/context.js +1 -1
  18. package/dist/default-client.d.ts +1 -1
  19. package/dist/define-client.js +6 -6
  20. package/dist/{eyebrow-C6ZFuiz6.js → eyebrow-UfmSz9yy.js} +1 -1
  21. package/dist/hooks.js +2 -2
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +1168 -1114
  24. package/dist/internal.js +5 -5
  25. package/dist/{message-list-BJYyuIcR.js → message-list-C0pL7x41.js} +7 -7
  26. package/dist/{session-core-DxBYsfHA.js → session-core-C9elBIdu.js} +11 -11
  27. package/dist/session-core.js +1 -1
  28. package/dist/{tool-call-block-tcPQAkcP.js → tool-call-block-Bunc6rCw.js} +6 -6
  29. package/dist/{tool-config-context-DzAofqi_.js → tool-config-context-Bh8p3DtG.js} +1 -1
  30. package/dist/types.js +1 -1
  31. package/dist/{url-chips-YqhCjWfQ.js → url-chips-C2u7QPv8.js} +3 -3
  32. package/dist/use-run-key.d.ts +44 -10
  33. package/dist/{use-user-transcript-C14qWFu2.js → use-user-transcript-DFTSEuZN.js} +1 -1
  34. package/dist/use-workflow-form.d.ts +31 -90
  35. package/dist/{use-workflow-progress-Cu0SxMyg.js → use-workflow-run-CXGEcM0l.js} +256 -256
  36. package/dist/use-workflow-stream.d.ts +4 -1
  37. package/dist/use-workflows.d.ts +77 -0
  38. package/dist/worklets/capture-processor.js +2 -2
  39. package/dist/worklets/playback-processor.js +2 -2
  40. package/package.json +6 -6
  41. package/dist/tsdown.config.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- //#region components/_colors.ts
1
+ //#region src/components/_colors.ts
2
2
  /**
3
3
  * Shared tints used by the default components (AssemblyAI design system,
4
4
  * "website refresh": warm neutrals over the cream/white surfaces).
@@ -1,4 +1,4 @@
1
- //#region worklets/_module-url.ts
1
+ //#region src/worklets/_module-url.ts
2
2
  /**
3
3
  * Blob-URL module for an inlined AudioWorklet processor source.
4
4
  *
@@ -37,12 +37,18 @@
37
37
  * `useWorkflows`, for the same reason: an empty answer here is a confident
38
38
  * false statement.
39
39
  *
40
- * ## It is OPT-IN
40
+ * ## It is ON by default, and it used to be opt-in
41
41
  *
42
- * A `key` on its own still means only "record this with the run", which is what
43
- * a voice agent's `ctx.workflows.start({ key })` means and what a page passing
44
- * an account id may well want. Adopting a run is a decision about the PAGE, so
45
- * it is `recover: true` and the two together read as what they do.
42
+ * The argument for opt-in was that a `key` on its own means only "record this
43
+ * with the run" — which is what a voice agent's `ctx.workflows.start({ key })`
44
+ * means, there being no page to put a run back on. A FORM is the other case: it
45
+ * is the page, and losing the run is the thing it cannot recover from. Six of
46
+ * six page templates wrote `useRunKey()` and `recover: true` together, which is
47
+ * the same shape `session-resume-store.ts` names on the voice side — a default
48
+ * in the wrong place — so `useWorkflowSubmit` now mints the key and asks.
49
+ *
50
+ * `enabled` remains, because `recover: false` remains: a page whose form must
51
+ * always open empty says so, and then nothing here runs.
46
52
  */
47
53
  import type { WorkflowApi } from "./workflow-client.ts";
48
54
  /** What {@link useRecoveredRun} needs. */
@@ -1,5 +1,5 @@
1
1
  import { safeJsonParse } from "@alexkroman1/aai";
2
- //#region _utils.ts
2
+ //#region src/_utils.ts
3
3
  /** Parse a JSON string, returning the input unchanged when it isn't valid JSON. */
4
4
  function tryParseJSON(str) {
5
5
  if (!str) return str;
@@ -1,7 +1,7 @@
1
1
  import { useTheme } from "./context.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { memo } from "react";
4
- //#region components/aai-logo.tsx
4
+ //#region src/components/aai-logo.tsx
5
5
  /** @jsxImportSource react */
6
6
  /**
7
7
  * The AssemblyAI wordmark (design-system "website refresh" asset).
package/dist/audio.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CAPTURE_STOP_ACK_TIMEOUT_MS, PLAYBACK_DONE_MAX_WAIT_MS, PLAYBACK_DONE_POLL_MS, VOICE_CAPTURE_CONSTRAINTS } from "./types.js";
2
- //#region audio.ts
2
+ //#region src/audio.ts
3
3
  /**
4
4
  * Throw unless the browser honored a requested context sample rate. The
5
5
  * requested rates are never advisory: captured audio is tagged with the
@@ -1,12 +1,12 @@
1
- import { t as MessageList } from "./message-list-BJYyuIcR.js";
1
+ import { t as MessageList } from "./message-list-C0pL7x41.js";
2
2
  import { useSessionSelector, useTheme } from "./context.js";
3
- import { n as THINKING_COLOR, r as inkTint, t as ERROR_COLOR } from "./_colors-j8XMToi9.js";
4
- import { t as AaiLogo } from "./aai-logo-CXZGPSIY.js";
5
- import { t as Eyebrow } from "./eyebrow-C6ZFuiz6.js";
3
+ import { n as THINKING_COLOR, r as inkTint, t as ERROR_COLOR } from "./_colors-CZ6OlPbL.js";
4
+ import { t as AaiLogo } from "./aai-logo-CFlomZlS.js";
5
+ import { t as Eyebrow } from "./eyebrow-UfmSz9yy.js";
6
6
  import { Controls } from "./components/controls.js";
7
7
  import clsx from "clsx";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
- //#region components/console-shell.tsx
9
+ //#region src/components/console-shell.tsx
10
10
  /** @jsxImportSource react */
11
11
  /**
12
12
  * Indicator dot color per state.
@@ -138,7 +138,7 @@ function ConsoleShell({ icon, title, state, pulsing, error, children, footer, cl
138
138
  });
139
139
  }
140
140
  //#endregion
141
- //#region components/chat-view.tsx
141
+ //#region src/components/chat-view.tsx
142
142
  const PULSING_STATES = /* @__PURE__ */ new Set(["listening", "speaking"]);
143
143
  /**
144
144
  * The main chat interface for a voice agent session — the design-system
@@ -1,5 +1,5 @@
1
1
  import { CLIENT_CONFIG_PATH, ClientConfigResponseSchema } from "@alexkroman1/aai/protocol";
2
- //#region client-config.ts
2
+ //#region src/client-config.ts
3
3
  /**
4
4
  * Pre-connection client-config lookup.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import path from "node:path";
3
- //#region client-dir.ts
3
+ //#region src/client-dir.ts
4
4
  /**
5
5
  * Filesystem location of the prebuilt default client — **Node only**.
6
6
  *
@@ -1,8 +1,8 @@
1
1
  import { useTheme } from "../context.js";
2
- import { i as primaryTint, r as inkTint } from "../_colors-j8XMToi9.js";
2
+ import { i as primaryTint, r as inkTint } from "../_colors-CZ6OlPbL.js";
3
3
  import clsx from "clsx";
4
4
  import { jsx } from "react/jsx-runtime";
5
- //#region components/button.tsx
5
+ //#region src/components/button.tsx
6
6
  /** @jsxImportSource react */
7
7
  /** One variant's rest and hover colors, derived from the theme. */
8
8
  function variantColors(variant, theme) {
@@ -1,3 +1,3 @@
1
1
  import "../context.js";
2
- import { t as ChatView } from "../chat-view-DDTtrh7N.js";
2
+ import { t as ChatView } from "../chat-view-Bv5VFJIE.js";
3
3
  export { ChatView };
@@ -1,10 +1,10 @@
1
1
  import { useSessionCore, useSessionSelector } from "../context.js";
2
2
  import { Button } from "./button.js";
3
- import { n as SessionUrlChips } from "../url-chips-YqhCjWfQ.js";
3
+ import { n as SessionUrlChips } from "../url-chips-C2u7QPv8.js";
4
4
  import clsx from "clsx";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { memo } from "react";
7
- //#region components/controls.tsx
7
+ //#region src/components/controls.tsx
8
8
  /** @jsxImportSource react */
9
9
  /**
10
10
  * Session control buttons: **Stop / Resume** and **New Conversation**.
@@ -1,3 +1,3 @@
1
- import { t as MessageList } from "../message-list-BJYyuIcR.js";
1
+ import { t as MessageList } from "../message-list-C0pL7x41.js";
2
2
  import "../context.js";
3
3
  export { MessageList };
@@ -1,7 +1,7 @@
1
1
  import { useTheme } from "../context.js";
2
2
  import clsx from "clsx";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
- //#region components/sidebar-layout.tsx
4
+ //#region src/components/sidebar-layout.tsx
5
5
  /** @jsxImportSource react */
6
6
  /**
7
7
  * A two-column layout with a fixed-width sidebar and a flexible main area.
@@ -1,11 +1,11 @@
1
1
  import { useSessionCore, useSessionSelector, useTheme } from "../context.js";
2
- import { r as inkTint } from "../_colors-j8XMToi9.js";
2
+ import { r as inkTint } from "../_colors-CZ6OlPbL.js";
3
3
  import { Button } from "./button.js";
4
- import { t as AaiLogo } from "../aai-logo-CXZGPSIY.js";
5
- import { t as Eyebrow } from "../eyebrow-C6ZFuiz6.js";
4
+ import { t as AaiLogo } from "../aai-logo-CFlomZlS.js";
5
+ import { t as Eyebrow } from "../eyebrow-UfmSz9yy.js";
6
6
  import clsx from "clsx";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- //#region components/start-screen.tsx
8
+ //#region src/components/start-screen.tsx
9
9
  /** @jsxImportSource react */
10
10
  /**
11
11
  * A centered start screen: a white card on the cream page with the logo, an
@@ -1,3 +1,3 @@
1
1
  import "../context.js";
2
- import { t as ToolCallBlock } from "../tool-call-block-tcPQAkcP.js";
2
+ import { t as ToolCallBlock } from "../tool-call-block-Bunc6rCw.js";
3
3
  export { ToolCallBlock };
package/dist/context.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createContext, createElement, useContext, useEffect, useMemo, useSyncExternalStore } from "react";
2
2
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/with-selector";
3
- //#region context.ts
3
+ //#region src/context.ts
4
4
  const DEFAULT_THEME = {
5
5
  bg: "#FBF8F2",
6
6
  primary: "#3F2BC1",
@@ -1,2 +1,2 @@
1
1
  /** @jsxImportSource react */
2
- import "./styles.css";
2
+ import "../styles.css";
@@ -1,16 +1,16 @@
1
- import { n as fetchClientConfig } from "./client-config-BT_kWID5.js";
1
+ import { n as fetchClientConfig } from "./client-config-DD820zHn.js";
2
2
  import { SessionProvider, ThemeProvider } from "./context.js";
3
- import { t as ChatView } from "./chat-view-DDTtrh7N.js";
4
- import { n as setPageTitle, t as pageBaseUrl } from "./_utils-B6498_bm.js";
5
- import { t as ToolConfigContext } from "./tool-config-context-DzAofqi_.js";
3
+ import { t as ChatView } from "./chat-view-Bv5VFJIE.js";
4
+ import { n as setPageTitle, t as pageBaseUrl } from "./_utils-CyzjK0gW.js";
5
+ import { t as ToolConfigContext } from "./tool-config-context-Bh8p3DtG.js";
6
6
  import { SidebarLayout } from "./components/sidebar-layout.js";
7
7
  import { StartScreen } from "./components/start-screen.js";
8
- import { t as createSessionCore } from "./session-core-DxBYsfHA.js";
8
+ import { t as createSessionCore } from "./session-core-C9elBIdu.js";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  import { createElement, useEffect, useState } from "react";
11
11
  import { flushSync } from "react-dom";
12
12
  import { createRoot } from "react-dom/client";
13
- //#region define-client.tsx
13
+ //#region src/define-client.tsx
14
14
  /** @jsxImportSource react */
15
15
  /**
16
16
  * The element a mount renders into.
@@ -1,7 +1,7 @@
1
1
  import { useTheme } from "./context.js";
2
2
  import clsx from "clsx";
3
3
  import { jsx } from "react/jsx-runtime";
4
- //#region components/eyebrow.tsx
4
+ //#region src/components/eyebrow.tsx
5
5
  /** @jsxImportSource react */
6
6
  /**
7
7
  * Eyebrow label — the design system's small outlined pill with ALL-CAPS,
package/dist/hooks.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useSessionSelector } from "./context.js";
2
- import { i as tryParseJSON } from "./_utils-B6498_bm.js";
2
+ import { i as tryParseJSON } from "./_utils-CyzjK0gW.js";
3
3
  import { useEffect, useMemo, useRef } from "react";
4
- //#region hooks.ts
4
+ //#region src/hooks.ts
5
5
  /** Index of the first item whose sequence number is above the watermark (tail scan from the end). */
6
6
  function tailStart(items, seqOf, watermark) {
7
7
  let start = items.length;
package/dist/index.d.ts CHANGED
@@ -27,11 +27,12 @@ export { type ConversationItem, type UseConversationResult, useConversation, } f
27
27
  export { type UseDownloadUrlOptions, type UseDownloadUrlResult, useDownloadUrl, } from "./use-download-url.ts";
28
28
  export { useRunKey } from "./use-run-key.ts";
29
29
  export { type UseUserTranscriptResult, useUserTranscript } from "./use-user-transcript.ts";
30
- export { type UploadStatus, type UseWorkflowSubmitOptions, type UseWorkflowsOptions, type UseWorkflowsResult, useWorkflowSubmit, useWorkflows, type WorkflowSubmission, } from "./use-workflow-form.ts";
30
+ export { type UploadStatus, type UseWorkflowSubmitOptions, useWorkflowSubmit, type WorkflowSubmission, } from "./use-workflow-form.ts";
31
31
  export { type UseWorkflowProgressResult, useWorkflowProgress, } from "./use-workflow-progress.ts";
32
32
  export { type UseWorkflowRunResult, useWorkflowRun } from "./use-workflow-run.ts";
33
33
  export { type UseWorkflowRunsOptions, type UseWorkflowRunsResult, useWorkflowRuns, } from "./use-workflow-runs.ts";
34
34
  export { type UseWorkflowStreamOptions, useWorkflowStream, type WorkflowStreamSubmission, } from "./use-workflow-stream.ts";
35
+ export { type UseWorkflowsOptions, type UseWorkflowsResult, useWorkflows, } from "./use-workflows.ts";
35
36
  export { createWorkflowApi, isTerminal, type WorkflowApi, type WorkflowApiOptions, type WorkflowInputOf, type WorkflowOutputOf, type WorkflowRun, type WorkflowRunStatus, type WorkflowSummary, } from "./workflow-client.ts";
36
37
  export type { SubmitInputOf } from "./workflow-def-types.ts";
37
38
  export { WORKFLOW_STATUS_LABELS } from "./workflow-status-labels.ts";