@talk2view/sdk 0.19.0 → 0.20.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 (49) hide show
  1. package/README.md +8 -2
  2. package/dist/auth.d.ts +8 -0
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +27 -11
  5. package/dist/auth.js.map +1 -1
  6. package/dist/chat/index.d.ts +1 -0
  7. package/dist/chat/index.d.ts.map +1 -1
  8. package/dist/chat/index.js +1 -0
  9. package/dist/chat/index.js.map +1 -1
  10. package/dist/chat/launcher.d.ts.map +1 -1
  11. package/dist/chat/launcher.js +6 -2
  12. package/dist/chat/launcher.js.map +1 -1
  13. package/dist/chat/provider.d.ts +7 -0
  14. package/dist/chat/provider.d.ts.map +1 -1
  15. package/dist/chat/provider.js +22 -1
  16. package/dist/chat/provider.js.map +1 -1
  17. package/dist/chat/voice-button.d.ts +34 -0
  18. package/dist/chat/voice-button.d.ts.map +1 -0
  19. package/dist/chat/voice-button.js +175 -0
  20. package/dist/chat/voice-button.js.map +1 -0
  21. package/dist/chat-css.js +1 -1
  22. package/dist/chat.css +1 -1
  23. package/dist/chat.isolated.css +169 -3
  24. package/dist/chat.raw.css +169 -3
  25. package/dist/event-emitter.d.ts +1 -0
  26. package/dist/event-emitter.d.ts.map +1 -1
  27. package/dist/event-emitter.js +3 -0
  28. package/dist/event-emitter.js.map +1 -1
  29. package/dist/index.d.ts +21 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +34 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/types.d.ts +60 -0
  34. package/dist/types.d.ts.map +1 -1
  35. package/dist/voice-error.d.ts +8 -0
  36. package/dist/voice-error.d.ts.map +1 -0
  37. package/dist/voice-error.js +10 -0
  38. package/dist/voice-error.js.map +1 -0
  39. package/dist/voice-facade.d.ts +57 -0
  40. package/dist/voice-facade.d.ts.map +1 -0
  41. package/dist/voice-facade.js +139 -0
  42. package/dist/voice-facade.js.map +1 -0
  43. package/dist/voice.d.ts +157 -0
  44. package/dist/voice.d.ts.map +1 -0
  45. package/dist/voice.js +630 -0
  46. package/dist/voice.js.map +1 -0
  47. package/docs/chat.md +4 -4
  48. package/docs/voice.md +88 -0
  49. package/package.json +3 -1
@@ -0,0 +1,175 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * `<VoiceButton>` — press to talk to the agent, press again to hang up.
5
+ *
6
+ * Inside `<Talk2ViewChat>` or the launcher it takes the chat's client and shows
7
+ * only when the partner has voice enabled (`/v1/config` →
8
+ * `voice_agent_enabled`) and `features.voice` is not false. Standalone it takes
9
+ * a `client` prop, and whether to render it is the integrator's call.
10
+ *
11
+ * Everything here is display. The call itself is `t2v.voice` (the facade in
12
+ * `src/voice-facade.ts`), which runs the SAME tool registry, permission check
13
+ * and approvals as chat, so partners write no new code for voice. The one
14
+ * control is `start()` / `stop()`: a press while the call is connecting or live
15
+ * is a `stop()`, and the controller is what releases the microphone.
16
+ */
17
+ import { useCallback, useEffect, useRef, useState } from 'react';
18
+ import { LoaderCircleIcon, XIcon } from 'lucide-react';
19
+ import { ApprovalCard } from '../ui/components/ApprovalCard.js';
20
+ import { BrandWaveform } from './composer-extras.js';
21
+ import { cn } from './lib/cn.js';
22
+ import { useOptionalChatContext } from './provider.js';
23
+ /** The launcher's gate: the integrator has not turned voice off, and the partner has it on. */
24
+ export function shouldShowVoice(features, config) {
25
+ return features.voice !== false && !!config?.voice_agent_enabled;
26
+ }
27
+ /** Two rising notes, about 200 ms, from the Web Audio API. Nothing is fetched. */
28
+ export function playListeningEarcon() {
29
+ try {
30
+ const Ctx = window.AudioContext ??
31
+ window.webkitAudioContext;
32
+ if (!Ctx)
33
+ return;
34
+ const ctx = new Ctx();
35
+ const now = ctx.currentTime;
36
+ for (const [freq, at] of [
37
+ [660, 0],
38
+ [880, 0.09],
39
+ ]) {
40
+ const osc = ctx.createOscillator();
41
+ const gain = ctx.createGain();
42
+ osc.frequency.value = freq;
43
+ gain.gain.setValueAtTime(0.0001, now + at);
44
+ gain.gain.exponentialRampToValueAtTime(0.2, now + at + 0.01);
45
+ gain.gain.exponentialRampToValueAtTime(0.0001, now + at + 0.12);
46
+ osc.connect(gain).connect(ctx.destination);
47
+ osc.start(now + at);
48
+ osc.stop(now + at + 0.13);
49
+ }
50
+ setTimeout(() => void ctx.close(), 400);
51
+ }
52
+ catch {
53
+ // No audio context (tests, locked-down browsers): silence is fine.
54
+ }
55
+ }
56
+ /**
57
+ * What to tell the end-user for each `VoiceError.type`. Written here rather
58
+ * than taken from `error.message`, so a reason reads the same whichever layer
59
+ * raised it (engine, voice service, transport). `voice_error` is the catch-all:
60
+ * its message is the controller's own, so it is shown as it comes, as is any
61
+ * type added later.
62
+ */
63
+ const ERROR_MESSAGES = {
64
+ voice_disabled: 'Voice isn’t turned on for this app.',
65
+ account_required: 'Sign in to use voice.',
66
+ auth_expired: 'Your sign-in expired. Sign in again to use voice.',
67
+ insufficient_credit: 'You’re out of credit for now.',
68
+ credit_check_unavailable: 'Couldn’t check your credit just now. Try again shortly.',
69
+ service_unconfigured: 'Voice isn’t available right now.',
70
+ service_unavailable: 'Voice isn’t available right now. Try again shortly.',
71
+ voice_at_capacity: 'Voice is busy right now. Try again shortly.',
72
+ voice_ticket_invalid: 'The call took too long to connect. Try again.',
73
+ upstream_error: 'Voice couldn’t reach the assistant. Try again.',
74
+ transport_error: 'The call couldn’t connect. Check your connection and try again.',
75
+ mic_unavailable: 'Voice needs microphone access. Allow the microphone and try again.',
76
+ };
77
+ export function voiceErrorMessage(error) {
78
+ return ERROR_MESSAGES[error.type] ?? (error.message || 'Something went wrong with voice. Try again.');
79
+ }
80
+ /** Why a call ended, when it was not the end-user's own press. */
81
+ const ENDED_MESSAGES = {
82
+ disconnected: 'The call dropped.',
83
+ session_cap: 'The call reached its time limit.',
84
+ idle: 'The call ended after a quiet spell.',
85
+ error: 'The call ended.',
86
+ };
87
+ /** How long the "call ended" note stays up. An error stays until it is dismissed or a new call starts. */
88
+ const ENDED_NOTE_MS = 4000;
89
+ export const VoiceButton = (props) => {
90
+ const ctx = useOptionalChatContext();
91
+ const client = props.client ?? ctx?.client;
92
+ if (!client) {
93
+ throw new Error('<VoiceButton> needs a client prop, or must render inside <Talk2ViewChat>.');
94
+ }
95
+ // Inside a chat the partner's switch applies; standalone the integrator decides.
96
+ if (ctx && !shouldShowVoice(ctx.features, ctx.config))
97
+ return null;
98
+ return _jsx(VoiceControl, { ...props, client: client, standalone: !ctx });
99
+ };
100
+ const VoiceControl = ({ client, standalone, className, label = 'Talk to Talk2View', earcon = true, }) => {
101
+ const voice = client.voice;
102
+ const [state, setState] = useState(() => voice.state);
103
+ const [error, setError] = useState(null);
104
+ const [approval, setApproval] = useState(null);
105
+ const [working, setWorking] = useState(false);
106
+ const [endedNote, setEndedNote] = useState(null);
107
+ // Read by the listeners, so changing the prop does not re-subscribe.
108
+ const earconRef = useRef(earcon);
109
+ earconRef.current = earcon;
110
+ useEffect(() => {
111
+ // A remount mid-call (StrictMode, a re-keyed parent) picks up where it is.
112
+ setState(voice.state);
113
+ const offs = [
114
+ voice.on('stateChange', (next) => {
115
+ setState(next);
116
+ if (next !== 'listening')
117
+ setWorking(false);
118
+ if (next === 'connecting' || next === 'listening') {
119
+ setError(null);
120
+ setEndedNote(null);
121
+ }
122
+ if (next === 'listening' && earconRef.current)
123
+ playListeningEarcon();
124
+ }),
125
+ voice.on('error', setError),
126
+ voice.on('approvalChange', setApproval),
127
+ voice.on('agentState', (agent) => setWorking(agent === 'working')),
128
+ voice.on('ended', (reason) => setEndedNote(ENDED_MESSAGES[reason] ?? null)),
129
+ ];
130
+ return () => offs.forEach((off) => off());
131
+ }, [voice]);
132
+ // A button that goes away takes its call with it: nothing may keep the
133
+ // microphone open behind a control the end-user can no longer see.
134
+ useEffect(() => () => {
135
+ if (voice.state === 'connecting' || voice.state === 'listening')
136
+ void voice.stop();
137
+ }, [voice]);
138
+ useEffect(() => {
139
+ if (!endedNote)
140
+ return;
141
+ const timer = setTimeout(() => setEndedNote(null), ENDED_NOTE_MS);
142
+ return () => clearTimeout(timer);
143
+ }, [endedNote]);
144
+ const on = state === 'connecting' || state === 'listening';
145
+ const toggle = useCallback(() => {
146
+ if (voice.state === 'connecting' || voice.state === 'listening') {
147
+ void voice.stop();
148
+ return;
149
+ }
150
+ voice.start().catch(() => {
151
+ // Reported through the 'error' event and shown below.
152
+ });
153
+ }, [voice]);
154
+ const preload = useCallback(() => voice.preload(), [voice]);
155
+ const status = state === 'connecting'
156
+ ? 'Connecting…'
157
+ : state === 'listening'
158
+ ? working
159
+ ? 'Working…'
160
+ : 'Listening'
161
+ : state === 'ended' && !error
162
+ ? endedNote
163
+ : null;
164
+ const icon = state === 'connecting' ? (_jsx(LoaderCircleIcon, { className: "t2v-voice-spin size-6", "aria-hidden": "true" })) : state === 'listening' ? (
165
+ // The brand's voice mark, as the composer's dictation face uses it.
166
+ _jsx(BrandWaveform, { mode: working ? 'busy' : 'live', className: "h-[20px] w-[22px]" })) : (
167
+ // The dictation mark at rest, the same face the composer's dictate button wears.
168
+ _jsx(BrandWaveform, { mode: "rest", className: "h-[20px] w-[22px]" }));
169
+ return (_jsxs("div", { className: cn('t2v-voice', standalone && 't2v-chat', className), "data-on": on ? '' : undefined, children: [error || approval || status ? (_jsxs("div", { className: "t2v-voice-popover", children: [error ? (_jsxs("div", { role: "alert", className: "t2v-voice-error", children: [_jsx("span", { children: voiceErrorMessage(error) }), _jsx("button", { type: "button", className: "t2v-voice-dismiss", "aria-label": "Dismiss", onClick: () => setError(null), children: _jsx(XIcon, { className: "size-4", "aria-hidden": "true" }) })] })) : null, approval ? (_jsx("div", { className: "t2v-voice-approval", children: _jsx(ApprovalCard
170
+ // A new card per call: a half-edited argument must not carry over.
171
+ , { toolName: approval.toolName, toolCallId: approval.toolCallId, args: approval.arguments, description: approval.description, onDecision: (decision) => approval.decide(decision) }, approval.toolCallId) })) : null, status && !error ? (_jsx("div", { "aria-hidden": "true", className: "t2v-voice-status", children: status })) : null] })) : null, _jsx("span", { role: "status", className: "t2v-voice-sr", children: error ? '' : (status ?? '') }), _jsx("button", { type: "button", className: "t2v-voice-button", onClick: toggle,
172
+ // Fetch the voice code while the pointer is on its way to a click.
173
+ onPointerEnter: preload, onFocus: preload, "aria-label": label, title: on ? 'End the call' : label, "aria-pressed": on, "aria-busy": state === 'connecting' || undefined, "data-state": state, "data-busy": working ? 'true' : undefined, children: icon })] }));
174
+ };
175
+ //# sourceMappingURL=voice-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice-button.js","sourceRoot":"","sources":["../../src/chat/voice-button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAA2B,MAAM,OAAO,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AASvD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAA8B,MAAM,eAAe,CAAC;AAYnF,+FAA+F;AAC/F,MAAM,UAAU,eAAe,CAC7B,QAA8C,EAC9C,MAA4B;IAE5B,OAAO,QAAQ,CAAC,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,MAAM,EAAE,mBAAmB,CAAC;AACnE,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC;QACH,MAAM,GAAG,GACP,MAAM,CAAC,YAAY;YAClB,MAAkE,CAAC,kBAAkB,CAAC;QACzF,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QAC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