@burdenoff/microfe-healthybowl 2026.901.9 → 2026.901.10
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.
|
@@ -6,12 +6,20 @@ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
|
6
6
|
var s = ({ state: s, userCaption: c, assistantCaption: l, expanded: u, statusText: d, control: f, errorText: p = null }) => {
|
|
7
7
|
let m = n(s) ? l : r(s) ? c : null;
|
|
8
8
|
return /* @__PURE__ */ o("div", {
|
|
9
|
-
className:
|
|
9
|
+
className: [
|
|
10
|
+
"flex min-h-0 w-full flex-1 flex-col items-center",
|
|
11
|
+
u ? "px-8" : "px-14",
|
|
12
|
+
u ? "justify-start pt-[16vh]" : "justify-center"
|
|
13
|
+
].join(" "),
|
|
10
14
|
"data-testid": "assistant-voice-stage",
|
|
11
15
|
"data-state": s,
|
|
12
16
|
children: [
|
|
13
17
|
/* @__PURE__ */ a("p", {
|
|
14
|
-
className:
|
|
18
|
+
className: [
|
|
19
|
+
"text-center text-text-muted",
|
|
20
|
+
u ? "text-base" : "text-sm",
|
|
21
|
+
u ? "mb-3" : "mb-2"
|
|
22
|
+
].join(" "),
|
|
15
23
|
"data-testid": "assistant-voice-status",
|
|
16
24
|
children: d
|
|
17
25
|
}),
|
|
@@ -20,17 +28,23 @@ var s = ({ state: s, userCaption: c, assistantCaption: l, expanded: u, statusTex
|
|
|
20
28
|
role: "alert",
|
|
21
29
|
"data-testid": "assistant-voice-stage-error",
|
|
22
30
|
children: p
|
|
23
|
-
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
}) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("div", {
|
|
32
|
+
className: u ? "mb-10" : "mb-5",
|
|
33
|
+
children: /* @__PURE__ */ a(t, {
|
|
34
|
+
active: s === "listening" || s === "speaking",
|
|
35
|
+
tone: s === "speaking" ? "speaking" : "listening",
|
|
36
|
+
expanded: u
|
|
37
|
+
})
|
|
38
|
+
}), m ? /* @__PURE__ */ a("div", {
|
|
39
|
+
className: u ? "mb-12 w-full" : "mb-6 w-full",
|
|
40
|
+
children: /* @__PURE__ */ a(e, {
|
|
41
|
+
text: m,
|
|
42
|
+
role: n(s) ? "assistant" : "user",
|
|
43
|
+
expanded: u,
|
|
44
|
+
testId: "assistant-voice-caption"
|
|
45
|
+
})
|
|
32
46
|
}) : /* @__PURE__ */ a("div", {
|
|
33
|
-
className: u ? "h-
|
|
47
|
+
className: u ? "mb-12 h-[4.5rem]" : "mb-6 h-12",
|
|
34
48
|
"aria-hidden": "true"
|
|
35
49
|
})] }),
|
|
36
50
|
f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceStage.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceStage.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { VoiceCaption } from './VoiceCaption';\nimport { VoiceWaveform } from './VoiceWaveform';\nimport { showsAssistantCaption, showsUserCaption, type VoiceStageState } from '../../../utils/voiceStageState';\n\n/**\n * The middle of the voice panel: exactly ONE state, rendered as itself.\n *\n * What this replaces is the whole problem the operator screenshotted. The old\n * overlay showed, simultaneously: \"Listening…\", a microphone warning, the last\n * six messages of the chat conversation as bubbles (markdown syntax and all),\n * the assistant's answer AGAIN as a caption, and the orb. Five things competing,\n * none of them readable.\n *\n * ★ A stage shows one thing because the session IS one thing at a time. The\n * state is derived in `voiceStageState`, which is pure and tested; this file is\n * presentational and cannot be tested in this repo (vitest runs in `node`, no\n * DOM), so it deliberately contains no logic worth testing.\n *\n * The microphone warning is NOT rendered here. Mixing a system message into the\n * conversation area is what made it read as part of the reply; it belongs to\n * the chrome around the stage.\n */\n\ninterface Props {\n state: VoiceStageState;\n /** What the user is saying (live) or last said. */\n userCaption: string | null;\n /** What the assistant is saying. */\n assistantCaption: string | null;\n expanded: boolean;\n /** Status words — already localised by the caller. */\n statusText: string;\n /** The microphone / interrupt control. */\n control: ReactNode;\n /** Shown in the mic-error state instead of a caption. */\n errorText?: string | null;\n}\n\nexport const VoiceStage: FC<Props> = ({\n state,\n userCaption,\n assistantCaption,\n expanded,\n statusText,\n control,\n errorText = null,\n}) => {\n const caption = showsAssistantCaption(state) ? assistantCaption : showsUserCaption(state) ? userCaption : null;\n\n return (\n <div\n className={
|
|
1
|
+
{"version":3,"file":"VoiceStage.js","names":[],"sources":["../../../../src/components/assistant/voice/VoiceStage.tsx"],"sourcesContent":["import type { FC, ReactNode } from 'react';\nimport { VoiceCaption } from './VoiceCaption';\nimport { VoiceWaveform } from './VoiceWaveform';\nimport { showsAssistantCaption, showsUserCaption, type VoiceStageState } from '../../../utils/voiceStageState';\n\n/**\n * The middle of the voice panel: exactly ONE state, rendered as itself.\n *\n * What this replaces is the whole problem the operator screenshotted. The old\n * overlay showed, simultaneously: \"Listening…\", a microphone warning, the last\n * six messages of the chat conversation as bubbles (markdown syntax and all),\n * the assistant's answer AGAIN as a caption, and the orb. Five things competing,\n * none of them readable.\n *\n * ★ A stage shows one thing because the session IS one thing at a time. The\n * state is derived in `voiceStageState`, which is pure and tested; this file is\n * presentational and cannot be tested in this repo (vitest runs in `node`, no\n * DOM), so it deliberately contains no logic worth testing.\n *\n * The microphone warning is NOT rendered here. Mixing a system message into the\n * conversation area is what made it read as part of the reply; it belongs to\n * the chrome around the stage.\n */\n\ninterface Props {\n state: VoiceStageState;\n /** What the user is saying (live) or last said. */\n userCaption: string | null;\n /** What the assistant is saying. */\n assistantCaption: string | null;\n expanded: boolean;\n /** Status words — already localised by the caller. */\n statusText: string;\n /** The microphone / interrupt control. */\n control: ReactNode;\n /** Shown in the mic-error state instead of a caption. */\n errorText?: string | null;\n}\n\nexport const VoiceStage: FC<Props> = ({\n state,\n userCaption,\n assistantCaption,\n expanded,\n statusText,\n control,\n errorText = null,\n}) => {\n const caption = showsAssistantCaption(state) ? assistantCaption : showsUserCaption(state) ? userCaption : null;\n\n return (\n <div\n className={[\n 'flex min-h-0 w-full flex-1 flex-col items-center',\n expanded ? 'px-8' : 'px-14',\n // ★ Expanded, the group is anchored just above the optical centre\n // rather than centred in the whole box. Measured at 1440x900 the\n // content was 314px of a 756px stage with 221px of dead air above AND\n // below — technically centred, visually adrift. Docked the box is\n // small enough that centring is right.\n expanded ? 'justify-start pt-[16vh]' : 'justify-center',\n ].join(' ')}\n data-testid=\"assistant-voice-stage\"\n data-state={state}\n >\n {/* Status first and small: it is the label for the state, not the content. */}\n <p\n className={[\n 'text-center text-text-muted',\n expanded ? 'text-base' : 'text-sm',\n // The status LABELS the waveform, so it sits close to it. A uniform\n // gap made status, waveform, caption and control read as four\n // items of equal weight, with no hierarchy at all.\n expanded ? 'mb-3' : 'mb-2',\n ].join(' ')}\n data-testid=\"assistant-voice-status\"\n >\n {statusText}\n </p>\n\n {state === 'mic-error' ? (\n // A failure gets the stage to itself — no caption, no waveform. It is\n // not part of the conversation and must not look like it.\n <p\n className={`max-w-md text-center text-status-warning ${expanded ? 'text-lg' : 'text-sm'}`}\n role=\"alert\"\n data-testid=\"assistant-voice-stage-error\"\n >\n {errorText}\n </p>\n ) : (\n <>\n <div className={expanded ? 'mb-10' : 'mb-5'}>\n <VoiceWaveform\n active={state === 'listening' || state === 'speaking'}\n tone={state === 'speaking' ? 'speaking' : 'listening'}\n expanded={expanded}\n />\n </div>\n\n {caption ? (\n <div className={expanded ? 'mb-12 w-full' : 'mb-6 w-full'}>\n <VoiceCaption\n text={caption}\n role={showsAssistantCaption(state) ? 'assistant' : 'user'}\n expanded={expanded}\n testId=\"assistant-voice-caption\"\n />\n </div>\n ) : (\n // Reserve the caption's space so the control does not jump when the\n // first words arrive. Two lines' worth at each size, matching what\n // a typical utterance actually occupies.\n <div className={expanded ? 'mb-12 h-[4.5rem]' : 'mb-6 h-12'} aria-hidden=\"true\" />\n )}\n </>\n )}\n\n {control}\n </div>\n );\n};\n"],"mappings":";;;;;AAuCA,IAAa,KAAyB,EACpC,UACA,gBACA,qBACA,aACA,eACA,YACA,eAAY,WACR;CACJ,IAAM,IAAU,EAAsB,CAAK,IAAI,IAAmB,EAAiB,CAAK,IAAI,IAAc;CAE1G,OACE,kBAAC,OAAD;EACE,WAAW;GACT;GACA,IAAW,SAAS;GAMpB,IAAW,4BAA4B;EACzC,EAAE,KAAK,GAAG;EACV,eAAY;EACZ,cAAY;YAZd;GAeE,kBAAC,KAAD;IACE,WAAW;KACT;KACA,IAAW,cAAc;KAIzB,IAAW,SAAS;IACtB,EAAE,KAAK,GAAG;IACV,eAAY;cAEX;GACA,CAAA;GAEF,MAAU,cAGT,kBAAC,KAAD;IACE,WAAW,4CAA4C,IAAW,YAAY;IAC9E,MAAK;IACL,eAAY;cAEX;GACA,CAAA,IAEH,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,OAAD;IAAK,WAAW,IAAW,UAAU;cACnC,kBAAC,GAAD;KACE,QAAQ,MAAU,eAAe,MAAU;KAC3C,MAAM,MAAU,aAAa,aAAa;KAChC;IACX,CAAA;GACE,CAAA,GAEJ,IACC,kBAAC,OAAD;IAAK,WAAW,IAAW,iBAAiB;cAC1C,kBAAC,GAAD;KACE,MAAM;KACN,MAAM,EAAsB,CAAK,IAAI,cAAc;KACzC;KACV,QAAO;IACR,CAAA;GACE,CAAA,IAKL,kBAAC,OAAD;IAAK,WAAW,IAAW,qBAAqB;IAAa,eAAY;GAAQ,CAAA,CAEnF,EAAA,CAAA;GAGH;EACE;;AAET"}
|
package/package.json
CHANGED