@alexkroman1/aai-ui 0.12.3 → 0.13.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.
- package/README.md +257 -0
- package/dist/_colors-CpZO-88A.js +78 -0
- package/dist/_module-url-C13kAJ87.js +15 -0
- package/dist/_page-shell.d.ts +11 -0
- package/dist/_recover-run.d.ts +79 -0
- package/dist/_repeat-until.d.ts +30 -0
- package/dist/_run-controls.d.ts +33 -0
- package/dist/_submission-state.d.ts +92 -0
- package/dist/_tap-to-talk-state.d.ts +88 -0
- package/dist/_utils-Mi-SCFA1.js +47 -0
- package/dist/_utils.d.ts +26 -0
- package/dist/_web-storage.d.ts +43 -0
- package/dist/_workflow-api-ref.d.ts +37 -0
- package/dist/_workflow-files.d.ts +34 -0
- package/dist/_workflow-test-defs.d.ts +38 -0
- package/dist/aai-logo-D8pMVn9_.js +85 -0
- package/dist/agent-state-labels.d.ts +65 -0
- package/dist/agent-state.d.ts +108 -0
- package/dist/audio/capture.d.ts +44 -0
- package/dist/audio/index.d.ts +18 -0
- package/dist/audio/index.js +431 -0
- package/dist/audio/preconnect.d.ts +87 -0
- package/dist/audio/voice-io.d.ts +112 -0
- package/dist/build-default-client.d.ts +1 -0
- package/dist/chat-view-BCbI7gD4.js +396 -0
- package/dist/client-config-C7fQrioM.js +139 -0
- package/dist/client-config.d.ts +119 -0
- package/dist/client-dir.d.ts +44 -0
- package/dist/client-dir.js +58 -0
- package/dist/client-identity.d.ts +131 -0
- package/dist/client-tool.d.ts +51 -0
- package/dist/components/_colors.d.ts +73 -0
- package/dist/components/_form-readiness.d.ts +56 -0
- package/dist/components/_form-values.d.ts +19 -0
- package/dist/components/aai-logo.d.ts +12 -0
- package/dist/components/audio-result.d.ts +94 -0
- package/dist/components/auto-scroll.d.ts +74 -0
- package/dist/components/bullet-list.d.ts +74 -0
- package/dist/components/button.d.ts +29 -21
- package/dist/components/button.js +62 -23
- package/dist/components/chat-view.d.ts +24 -18
- package/dist/components/chat-view.js +2 -60
- package/dist/components/console-shell.d.ts +85 -0
- package/dist/components/controls.d.ts +21 -6
- package/dist/components/controls.js +31 -19
- package/dist/components/conversation-view.d.ts +130 -0
- package/dist/components/eyebrow.d.ts +12 -0
- package/dist/components/facts.d.ts +81 -0
- package/dist/components/form-fields.d.ts +142 -0
- package/dist/components/form-types.d.ts +73 -0
- package/dist/components/form.d.ts +96 -0
- package/dist/components/markdown.d.ts +57 -0
- package/dist/components/message-list.d.ts +34 -7
- package/dist/components/message-list.js +2 -75
- package/dist/components/session-controls.d.ts +125 -0
- package/dist/components/session-error-banner.d.ts +69 -0
- package/dist/components/session-state-dot.d.ts +111 -0
- package/dist/components/sidebar-layout.d.ts +31 -10
- package/dist/components/sidebar-layout.js +32 -12
- package/dist/components/start-screen.d.ts +17 -6
- package/dist/components/start-screen.js +34 -14
- package/dist/components/tool-call-block.d.ts +15 -14
- package/dist/components/tool-call-block.js +2 -117
- package/dist/components/tool-call-row.d.ts +75 -0
- package/dist/components/tool-config-context.d.ts +22 -0
- package/dist/components/upload-progress.d.ts +76 -0
- package/dist/components/url-chips.d.ts +29 -0
- package/dist/components/workflow-fields.d.ts +46 -0
- package/dist/components/workflow-pending-note.d.ts +81 -0
- package/dist/components/workflow-progress.d.ts +81 -0
- package/dist/components/workflow-run-error.d.ts +48 -0
- package/dist/components/workflow-run-panel.d.ts +79 -0
- package/dist/context.d.ts +288 -0
- package/dist/context.js +382 -0
- package/dist/conversation-log.d.ts +88 -0
- package/dist/default-client/assets/_module-url-BX0RuRU2.js +1 -0
- package/dist/default-client/assets/audio-cGFGID-2.js +1 -0
- package/dist/default-client/assets/capture-processor-BUABoo3_.js +90 -0
- package/dist/default-client/assets/index-8ihb1Urm.css +2 -0
- package/dist/default-client/assets/index-BQURVARl.js +126 -0
- package/dist/default-client/assets/playback-processor-ABOa11j0.js +314 -0
- package/dist/default-client/favicon.ico +0 -0
- package/dist/default-client/index.html +15 -0
- package/dist/default-client.d.ts +23 -0
- package/dist/define-client.d.ts +162 -26
- package/dist/define-client.js +201 -55
- package/dist/eyebrow-UfmSz9yy.js +27 -0
- package/dist/hooks-DN4gHYsj.js +182 -0
- package/dist/hooks.d.ts +172 -0
- package/dist/hooks.js +3 -0
- package/dist/hooks.test-d.d.ts +14 -0
- package/dist/inbox-protocol.d.ts +128 -0
- package/dist/inbox.d.ts +132 -0
- package/dist/index.d.ts +126 -29
- package/dist/index.js +5500 -15
- package/dist/internal.d.ts +43 -0
- package/dist/internal.js +8 -0
- package/dist/linked-client.d.ts +70 -0
- package/dist/message-list-DHZcLhRA.js +682 -0
- package/dist/notice-player.d.ts +70 -0
- package/dist/page.d.ts +114 -0
- package/dist/phone.d.ts +50 -0
- package/dist/route-fetch.d.ts +79 -0
- package/dist/session/audio-effects.d.ts +31 -0
- package/dist/session/audio-setup.d.ts +57 -0
- package/dist/session/audio-state.d.ts +157 -0
- package/dist/session/browser-session.d.ts +30 -0
- package/dist/session/close.d.ts +26 -0
- package/dist/session/dial.d.ts +65 -0
- package/dist/session/handshake.d.ts +60 -0
- package/dist/session/index.d.ts +17 -0
- package/dist/session/index.js +2 -0
- package/dist/session/messages.d.ts +63 -0
- package/dist/session/mic.d.ts +64 -0
- package/dist/session/preconnect.d.ts +48 -0
- package/dist/session/reconnect.d.ts +25 -0
- package/dist/session/resume-store.d.ts +57 -0
- package/dist/session/state.d.ts +146 -0
- package/dist/session/ticket.d.ts +44 -0
- package/dist/session/types.d.ts +476 -0
- package/dist/session/url.d.ts +17 -0
- package/dist/session/user-turn.d.ts +55 -0
- package/dist/session-CE0Ipsb3.js +2129 -0
- package/dist/stored-value.d.ts +103 -0
- package/dist/tool-call-block-uXtMOUWN.js +204 -0
- package/dist/tool-config-context-Es4YUzV2.js +19 -0
- package/dist/types.d.ts +272 -34
- package/dist/types.js +35 -4
- package/dist/upload/files.d.ts +83 -0
- package/dist/upload/index.d.ts +15 -0
- package/dist/upload/pause.d.ts +31 -0
- package/dist/upload/recall.d.ts +67 -0
- package/dist/upload/report.d.ts +26 -0
- package/dist/upload/session.d.ts +99 -0
- package/dist/url-chips-oyy_Eiqh.js +239 -0
- package/dist/use-client-runs.d.ts +87 -0
- package/dist/use-conversation-log.d.ts +86 -0
- package/dist/use-conversation.d.ts +131 -0
- package/dist/use-copy.d.ts +74 -0
- package/dist/use-download-url.d.ts +84 -0
- package/dist/use-flash.d.ts +61 -0
- package/dist/use-inbox.d.ts +101 -0
- package/dist/use-push-to-talk.d.ts +105 -0
- package/dist/use-route-mutation.d.ts +113 -0
- package/dist/use-route.d.ts +82 -0
- package/dist/use-run-key.d.ts +133 -0
- package/dist/use-session-controls.d.ts +69 -0
- package/dist/use-session-id.d.ts +57 -0
- package/dist/use-tap-to-talk.d.ts +138 -0
- package/dist/use-user-transcript-uyHhzy4d.js +73 -0
- package/dist/use-user-transcript.d.ts +75 -0
- package/dist/use-workflow-form.d.ts +285 -0
- package/dist/use-workflow-progress.d.ts +137 -0
- package/dist/use-workflow-run-DdhWmbx-.js +697 -0
- package/dist/use-workflow-run.d.ts +100 -0
- package/dist/use-workflow-runs.d.ts +71 -0
- package/dist/use-workflow-stream.d.ts +154 -0
- package/dist/use-workflows.d.ts +77 -0
- package/dist/workflow-client.d.ts +136 -0
- package/dist/workflow-def-types.d.ts +31 -0
- package/dist/workflow-events.d.ts +39 -0
- package/dist/workflow-field-kind.d.ts +95 -0
- package/dist/workflow-status-labels.d.ts +35 -0
- package/dist/worklets/_module-url.d.ts +10 -0
- package/dist/worklets/_playback-bench-harness.d.ts +181 -0
- package/dist/worklets/_playback-bench-host.d.ts +63 -0
- package/dist/worklets/_playback-bench-page.d.ts +65 -0
- package/dist/worklets/_tts-trace-harness.d.ts +142 -0
- package/dist/worklets/_worklet-test-utils.d.ts +27 -0
- package/dist/worklets/capture-processor.d.ts +4 -2
- package/dist/worklets/capture-processor.js +73 -33
- package/dist/worklets/playback-processor.d.ts +4 -2
- package/dist/worklets/playback-processor.js +258 -42
- package/package.json +57 -32
- package/styles.css +152 -30
- package/dist/audio.d.ts +0 -45
- package/dist/audio.js +0 -121
- package/dist/client-context.d.ts +0 -33
- package/dist/client-context.js +0 -15
- package/dist/client-handler.d.ts +0 -43
- package/dist/components/app.d.ts +0 -23
- package/dist/components/app.js +0 -41
- package/dist/components/error-banner.d.ts +0 -21
- package/dist/components/error-banner.js +0 -27
- package/dist/components/message-bubble.d.ts +0 -23
- package/dist/components/message-bubble.js +0 -35
- package/dist/components/state-indicator.d.ts +0 -29
- package/dist/components/state-indicator.js +0 -37
- package/dist/components/thinking-indicator.d.ts +0 -16
- package/dist/components/thinking-indicator.js +0 -34
- package/dist/components/tool-icons.d.ts +0 -17
- package/dist/components/tool-icons.js +0 -128
- package/dist/components/transcript.d.ts +0 -25
- package/dist/components/transcript.js +0 -35
- package/dist/session-CWB7vmqz.js +0 -429
- package/dist/session.d.ts +0 -69
- package/dist/session.js +0 -2
- package/dist/signals.d.ts +0 -120
- package/dist/signals.js +0 -161
- package/dist/tsdown.config.d.ts +0 -2
- package/dist/types.test-d.d.ts +0 -7
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
3
|
-
//#region components/state-indicator.tsx
|
|
4
|
-
/**
|
|
5
|
-
* Colored dot + label showing the current {@link AgentState}.
|
|
6
|
-
*
|
|
7
|
-
* State-to-color mapping:
|
|
8
|
-
* - `disconnected` — gray
|
|
9
|
-
* - `connecting` — yellow
|
|
10
|
-
* - `ready` — green
|
|
11
|
-
* - `listening` — blue
|
|
12
|
-
* - `thinking` — purple
|
|
13
|
-
* - `speaking` — red
|
|
14
|
-
* - `error` — red
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const { session } = useSession();
|
|
19
|
-
* <StateIndicator state={session.state} />
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @param state - A reactive {@link AgentState} value.
|
|
23
|
-
* @param className - Additional CSS class names.
|
|
24
|
-
*
|
|
25
|
-
* @public
|
|
26
|
-
*/
|
|
27
|
-
function StateIndicator({ state, className }) {
|
|
28
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
29
|
-
class: clsx("inline-flex items-center justify-center gap-1.5 text-[13px] font-medium leading-[130%] text-aai-text-muted capitalize", className),
|
|
30
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
31
|
-
"data-state": state.value,
|
|
32
|
-
class: "w-2 h-2 rounded-full data-[state=disconnected]:bg-aai-state-disconnected data-[state=connecting]:bg-aai-state-connecting data-[state=ready]:bg-aai-state-ready data-[state=listening]:bg-aai-state-listening data-[state=thinking]:bg-aai-state-thinking data-[state=speaking]:bg-aai-state-speaking data-[state=error]:bg-aai-state-error"
|
|
33
|
-
}), state.value]
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
|
-
export { StateIndicator };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type * as preact from "preact";
|
|
2
|
-
/**
|
|
3
|
-
* Animated three-dot "thinking" indicator shown while the agent is processing.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* {isThinking && <ThinkingIndicator />}
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
* @param className - Additional CSS class names.
|
|
11
|
-
*
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
14
|
-
export declare function ThinkingIndicator({ className }: {
|
|
15
|
-
className?: string;
|
|
16
|
-
}): preact.JSX.Element;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import { jsx } from "preact/jsx-runtime";
|
|
3
|
-
//#region components/thinking-indicator.tsx
|
|
4
|
-
const DOT_STYLES = [
|
|
5
|
-
0,
|
|
6
|
-
.16,
|
|
7
|
-
.32
|
|
8
|
-
].map((delay) => ({
|
|
9
|
-
animation: "aai-bounce 1.4s infinite ease-in-out both",
|
|
10
|
-
animationDelay: `${delay}s`
|
|
11
|
-
}));
|
|
12
|
-
/**
|
|
13
|
-
* Animated three-dot "thinking" indicator shown while the agent is processing.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* {isThinking && <ThinkingIndicator />}
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* @param className - Additional CSS class names.
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
function ThinkingIndicator({ className }) {
|
|
25
|
-
return /* @__PURE__ */ jsx("div", {
|
|
26
|
-
class: clsx("flex items-center gap-2 text-aai-text-dim text-sm font-medium min-h-5", className),
|
|
27
|
-
children: DOT_STYLES.map((style, i) => /* @__PURE__ */ jsx("div", {
|
|
28
|
-
class: "w-1.5 h-1.5 rounded-full bg-aai-text-dim",
|
|
29
|
-
style
|
|
30
|
-
}, i))
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { ThinkingIndicator };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type * as preact from "preact";
|
|
2
|
-
type IconProps = {
|
|
3
|
-
class?: string;
|
|
4
|
-
};
|
|
5
|
-
/** Magnifying glass icon for web_search. */
|
|
6
|
-
export declare function SearchIcon(props: IconProps): preact.JSX.Element;
|
|
7
|
-
/** External link icon for visit_webpage. */
|
|
8
|
-
export declare function ExternalLinkIcon(props: IconProps): preact.JSX.Element;
|
|
9
|
-
/** Terminal icon for run_code. */
|
|
10
|
-
export declare function TerminalIcon(props: IconProps): preact.JSX.Element;
|
|
11
|
-
/** Download icon for fetch_json. */
|
|
12
|
-
export declare function DownloadIcon(props: IconProps): preact.JSX.Element;
|
|
13
|
-
/** Chat bubble icon for user_input. */
|
|
14
|
-
export declare function ChatBubbleIcon(props: IconProps): preact.JSX.Element;
|
|
15
|
-
/** Bolt/lightning icon for default/unknown tools. */
|
|
16
|
-
export declare function BoltIcon(props: IconProps): preact.JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
2
|
-
//#region components/tool-icons.tsx
|
|
3
|
-
/** Magnifying glass icon for web_search. */
|
|
4
|
-
function SearchIcon(props) {
|
|
5
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
6
|
-
viewBox: "0 0 16 16",
|
|
7
|
-
fill: "none",
|
|
8
|
-
stroke: "currentColor",
|
|
9
|
-
"stroke-width": "1.5",
|
|
10
|
-
class: props.class,
|
|
11
|
-
children: [/* @__PURE__ */ jsx("circle", {
|
|
12
|
-
cx: "7",
|
|
13
|
-
cy: "7",
|
|
14
|
-
r: "4.5"
|
|
15
|
-
}), /* @__PURE__ */ jsx("path", {
|
|
16
|
-
d: "M10.5 10.5L14 14",
|
|
17
|
-
"stroke-linecap": "round"
|
|
18
|
-
})]
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
/** External link icon for visit_webpage. */
|
|
22
|
-
function ExternalLinkIcon(props) {
|
|
23
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
24
|
-
viewBox: "0 0 16 16",
|
|
25
|
-
fill: "none",
|
|
26
|
-
stroke: "currentColor",
|
|
27
|
-
"stroke-width": "1.5",
|
|
28
|
-
class: props.class,
|
|
29
|
-
children: [
|
|
30
|
-
/* @__PURE__ */ jsx("path", {
|
|
31
|
-
d: "M6 2H3a1 1 0 00-1 1v10a1 1 0 001 1h10a1 1 0 001-1v-3",
|
|
32
|
-
"stroke-linecap": "round"
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ jsx("path", {
|
|
35
|
-
d: "M9 2h5v5",
|
|
36
|
-
"stroke-linecap": "round",
|
|
37
|
-
"stroke-linejoin": "round"
|
|
38
|
-
}),
|
|
39
|
-
/* @__PURE__ */ jsx("path", {
|
|
40
|
-
d: "M14 2L7 9",
|
|
41
|
-
"stroke-linecap": "round"
|
|
42
|
-
})
|
|
43
|
-
]
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
/** Terminal icon for run_code. */
|
|
47
|
-
function TerminalIcon(props) {
|
|
48
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
49
|
-
viewBox: "0 0 16 16",
|
|
50
|
-
fill: "none",
|
|
51
|
-
stroke: "currentColor",
|
|
52
|
-
"stroke-width": "1.5",
|
|
53
|
-
class: props.class,
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsx("rect", {
|
|
56
|
-
x: "1",
|
|
57
|
-
y: "2",
|
|
58
|
-
width: "14",
|
|
59
|
-
height: "12",
|
|
60
|
-
rx: "1.5"
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ jsx("path", {
|
|
63
|
-
d: "M4 6l3 2.5L4 11",
|
|
64
|
-
"stroke-linecap": "round",
|
|
65
|
-
"stroke-linejoin": "round"
|
|
66
|
-
}),
|
|
67
|
-
/* @__PURE__ */ jsx("path", {
|
|
68
|
-
d: "M9 11h3",
|
|
69
|
-
"stroke-linecap": "round"
|
|
70
|
-
})
|
|
71
|
-
]
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
/** Download icon for fetch_json. */
|
|
75
|
-
function DownloadIcon(props) {
|
|
76
|
-
return /* @__PURE__ */ jsxs("svg", {
|
|
77
|
-
viewBox: "0 0 16 16",
|
|
78
|
-
fill: "none",
|
|
79
|
-
stroke: "currentColor",
|
|
80
|
-
"stroke-width": "1.5",
|
|
81
|
-
class: props.class,
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ jsx("path", {
|
|
84
|
-
d: "M8 2v9",
|
|
85
|
-
"stroke-linecap": "round"
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ jsx("path", {
|
|
88
|
-
d: "M4.5 8L8 11.5 11.5 8",
|
|
89
|
-
"stroke-linecap": "round",
|
|
90
|
-
"stroke-linejoin": "round"
|
|
91
|
-
}),
|
|
92
|
-
/* @__PURE__ */ jsx("path", {
|
|
93
|
-
d: "M2 13h12",
|
|
94
|
-
"stroke-linecap": "round"
|
|
95
|
-
})
|
|
96
|
-
]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/** Chat bubble icon for user_input. */
|
|
100
|
-
function ChatBubbleIcon(props) {
|
|
101
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
102
|
-
viewBox: "0 0 16 16",
|
|
103
|
-
fill: "none",
|
|
104
|
-
stroke: "currentColor",
|
|
105
|
-
"stroke-width": "1.5",
|
|
106
|
-
class: props.class,
|
|
107
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
108
|
-
d: "M2 3a1 1 0 011-1h10a1 1 0 011 1v7a1 1 0 01-1 1H5l-3 3V3z",
|
|
109
|
-
"stroke-linejoin": "round"
|
|
110
|
-
})
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
/** Bolt/lightning icon for default/unknown tools. */
|
|
114
|
-
function BoltIcon(props) {
|
|
115
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
116
|
-
viewBox: "0 0 16 16",
|
|
117
|
-
fill: "none",
|
|
118
|
-
stroke: "currentColor",
|
|
119
|
-
"stroke-width": "1.5",
|
|
120
|
-
class: props.class,
|
|
121
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
122
|
-
d: "M9 1L3 9h5l-1 6 6-8H8l1-6z",
|
|
123
|
-
"stroke-linejoin": "round"
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
export { BoltIcon, ChatBubbleIcon, DownloadIcon, ExternalLinkIcon, SearchIcon, TerminalIcon };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type * as preact from "preact";
|
|
2
|
-
import type { Reactive } from "../types.ts";
|
|
3
|
-
/**
|
|
4
|
-
* Live speech-to-text transcript shown while the user is speaking.
|
|
5
|
-
* Returns `null` when there is no active utterance.
|
|
6
|
-
*
|
|
7
|
-
* Displays a {@link ThinkingIndicator} while waiting for the first
|
|
8
|
-
* transcription text (i.e., `userUtterance` is `""`).
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* const { session } = useSession();
|
|
13
|
-
* <Transcript userUtterance={session.userUtterance} />
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @param userUtterance - Reactive string (`null` when idle, `""` when
|
|
17
|
-
* listening but no text yet, or the transcript text).
|
|
18
|
-
* @param className - Additional CSS class names.
|
|
19
|
-
*
|
|
20
|
-
* @public
|
|
21
|
-
*/
|
|
22
|
-
export declare function Transcript({ userUtterance, className, }: {
|
|
23
|
-
userUtterance: Reactive<string | null>;
|
|
24
|
-
className?: string;
|
|
25
|
-
}): preact.JSX.Element | null;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ThinkingIndicator } from "./thinking-indicator.js";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { jsx } from "preact/jsx-runtime";
|
|
4
|
-
//#region components/transcript.tsx
|
|
5
|
-
/**
|
|
6
|
-
* Live speech-to-text transcript shown while the user is speaking.
|
|
7
|
-
* Returns `null` when there is no active utterance.
|
|
8
|
-
*
|
|
9
|
-
* Displays a {@link ThinkingIndicator} while waiting for the first
|
|
10
|
-
* transcription text (i.e., `userUtterance` is `""`).
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* const { session } = useSession();
|
|
15
|
-
* <Transcript userUtterance={session.userUtterance} />
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @param userUtterance - Reactive string (`null` when idle, `""` when
|
|
19
|
-
* listening but no text yet, or the transcript text).
|
|
20
|
-
* @param className - Additional CSS class names.
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
23
|
-
*/
|
|
24
|
-
function Transcript({ userUtterance, className }) {
|
|
25
|
-
if (userUtterance.value === null) return null;
|
|
26
|
-
return /* @__PURE__ */ jsx("div", {
|
|
27
|
-
class: clsx("flex flex-col items-end w-full", className),
|
|
28
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
29
|
-
class: "max-w-[min(82%,64ch)] whitespace-pre-wrap wrap-break-word text-sm leading-[150%] text-aai-text-muted bg-aai-surface-faint border border-aai-border px-3 py-2 rounded-aai ml-auto",
|
|
30
|
-
children: userUtterance.value || /* @__PURE__ */ jsx(ThinkingIndicator, {})
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { Transcript };
|