The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.
TypeScript ai-receptionistanswering-serviceappointment-bookinglivekitlocal-firstmcpopen-sourceself-hostedsiptelephonytypescriptvoice-agentvoice-ai
Outbound calls page: list, live call with instructions, New call dialog (PR 1983)
Tim Gutberletb5a6929a769c
diff --git a/apps/api/src/workspace-settings.ts b/apps/api/src/workspace-settings.tsindex b38ff9cd..4ab85ec8 100644--- a/apps/api/src/workspace-settings.ts+++ b/apps/api/src/workspace-settings.ts@@ -78,6 +78,7 @@ export const workspaceSettingsHandlers: Record<string, Handler> = {usageLevels: await usageLevelsBilled(tx),// A white-label client's people see minutes, never our prices (docs/white-label.md; review of #1109, L-2)....(partnerManaged ? { partnerManaged } : { usageCentsPerMinute: await levelCentsPerMinute(tx) }),+ outboundCallsEnabled: row?.outbound_calls_enabled ?? false,}return { rows: {}, data }},diff --git a/apps/api/test/outbound-calls.test.ts b/apps/api/test/outbound-calls.test.tsindex 685dc3d8..f2d7a25e 100644--- a/apps/api/test/outbound-calls.test.ts+++ b/apps/api/test/outbound-calls.test.ts@@ -97,3 +97,9 @@ test('outbound calls stay off until a server admin turns them on, and stay in thconst abroad = await act(ws.owner, 'call.dial', { to: '+4915112345678', goal, first_sentence: firstSentence })expect(abroad.status).toBe(409)})++test('workspace.getSettings tells the web app whether outbound calls are on', async () => {+ const off = await createWorkspace('Still off')+ expect((await act(off.owner, 'workspace.getSettings', {})).body.data.outboundCallsEnabled).toBe(false)+ expect((await act(ws.owner, 'workspace.getSettings', {})).body.data.outboundCallsEnabled).toBe(true)+})diff --git a/apps/web/src/Workspace.tsx b/apps/web/src/Workspace.tsxindex aadb73c3..dce20ee5 100644--- a/apps/web/src/Workspace.tsx+++ b/apps/web/src/Workspace.tsx@@ -73,7 +73,8 @@ import { PAGE_VIEW_CALLS, type PageView, registerPageTools } from './agentTools.import { mayChangeWithAgent } from './settings/agentChange.ts'import { settingsAccess } from './settings/readOnly.ts'import { unknownPageText } from './supportAccess.ts'-import { preloadWorkspaceSettings, runActionDirect } from './settings/settings-api.ts'+import { preloadWorkspaceSettings, runActionDirect, useWorkspaceSettings } from './settings/settings-api.ts'+import { outboundAccess } from './outbound/model.ts'import { memberLabel, useAssignableMembers } from './team/members.ts'import { preloadTeam } from './team/team-api.ts'import { takeDeleted } from './session.ts'@@ -175,6 +176,8 @@ export function Workspace({ me, onSignedOut, onSessionStale, notice = null, onReconst assistantName = useAssistantName()// During support access the settings are read-only, API keys aside (settingsAccess, settings/readOnly.ts).const { canEdit: canEditSettings, canManageKeys } = settingsAccess(me)+ // Outbound calls: owners and admins, once a server admin turned them on for this workspace (LIN-873).+ const outbound = outboundAccess(me, useWorkspaceSettings())// Until the first real call, the inbox says what happens when one comes in (goLive.ts).const hadRealCall = useHadRealCall(useGoLiveChecklist(canEditSettings, me.workspace!.id))const showGoLive = useShowGoLive(canEditSettings, me.workspace!.id)@@ -476,9 +479,11 @@ export function Workspace({ me, onSignedOut, onSessionStale, notice = null, onRe// During support access the agent setup links say why they did not open (supportAccess.ts).const lost = !nav.known? unknownPageText(window.location.hash, !!me.impersonation)- : view.missingCall- ? t('shell.lost.call')- : null+ : nav.route === 'outbound' && outbound === 'off'+ ? t('shell.lost.page')+ : view.missingCall+ ? t('shell.lost.call')+ : nulluseEffect(() => {if (!lost) returntoaster.show(lost, false, NOT_FOUND_TOAST_MS)@@ -661,6 +666,7 @@ export function Workspace({ me, onSignedOut, onSessionStale, notice = null, onRemineCount={canAssign ? view.counts.mine : null}unassignedCount={canAssign ? view.counts.unassigned : null}reviewCount={reviewCount}+ outboundCalls={outbound === 'on'}workspaceName={me.workspace!.name}workspaceId={me.workspace!.id}avatarUrl={me.avatarUrl}@@ -715,7 +721,7 @@ export function Workspace({ me, onSignedOut, onSessionStale, notice = null, onRe</div>}>- {page.render({+ {nav.route !== 'outbound' || outbound === 'on' ? page.render({toast: toaster.show,canEditSettings,canManageKeys,@@ -732,7 +738,7 @@ export function Workspace({ me, onSignedOut, onSessionStale, notice = null, onReonRenamed,runUndoable: actions.runUndoable,undoable: actions.undoable,- })}+ }) : null}</ErrorBoundary></>) : openCall ? (diff --git a/apps/web/src/outbound/NewOutboundCall.tsx b/apps/web/src/outbound/NewOutboundCall.tsxnew file mode 100644index 00000000..7203b2d4--- /dev/null+++ b/apps/web/src/outbound/NewOutboundCall.tsx@@ -0,0 +1,172 @@+// New call (N on the Outbound calls page): whom the assistant phones, what it should reach, the first thing it+// says when they pick up and, in a workspace with more than one assistant, which one calls. Start call sends+// call.dial; a refusal (a number abroad, outbound calls not set up) shows in the dialog.+import { DIAL_FIRST_SENTENCE_MAX, DIAL_GOAL_MAX } from '@linedesk/actions'+import { useT } from '@linedesk/i18n/react'+import { type FormEvent, type KeyboardEvent, useRef, useState } from 'react'+import { useDefaultPhoneCountry } from '../phoneCountry.ts'+import { useAssistants } from '../store.tsx'+import { Select } from '../ui/controls.tsx'+import { Dialog, FormField, Input, Textarea } from '../ui/form.tsx'+import { confirmErrorText } from '../ui/DangerConfirmDialog.tsx'+import { Button, Note } from '../ui/kit.tsx'+import { NO_PASSWORD_MANAGER } from '../ui/passwordManager.ts'+import { PhoneInput } from '../ui/PhoneInput.tsx'+import { type DialForm, type DialProblem, dialInput } from './model.ts'+import { dial } from './outbound-api.ts'++type Props = {+ workspaceName: string+ onClose: () => void+ /** The call is on its way: the room it will be in, and the number. */+ onDialled: (room: string, to: string) => void+}++/** Enter in the goal starts the call like in every other field; Shift+Enter starts a new line. */+function submitOnEnter(e: KeyboardEvent<HTMLTextAreaElement>) {+ if (e.key !== 'Enter' || e.shiftKey || e.nativeEvent.isComposing) return+ e.preventDefault()+ e.currentTarget.form?.requestSubmit()+}++export function NewOutboundCall({ workspaceName, onClose, onDialled }: Props) {+ const t = useT()+ const assistants = useAssistants()+ const defaultCountry = useDefaultPhoneCountry()+ const [form, setForm] = useState<DialForm>(() => ({+ to: '',+ goal: '',+ firstSentence: t('call.outbound.new.firstSentenceDefault', {+ assistant: assistants[0]?.name ?? '',+ business: workspaceName,+ }),+ assistantId: '',+ }))+ const [problem, setProblem] = useState<DialProblem | null>(null)+ const [refused, setRefused] = useState<string | null>(null)+ const [busy, setBusy] = useState(false)+ const phoneInput = useRef<HTMLInputElement>(null)+ const set = <K extends keyof DialForm>(field: K, value: DialForm[K]) => {+ setForm(f => ({ ...f, [field]: value }))+ if (problem?.field === field) setProblem(null)+ setRefused(null)+ }++ async function submit(e: FormEvent) {+ e.preventDefault()+ if (busy) return+ const result = dialInput(form)+ if ('problem' in result) {+ setProblem(result.problem)+ if (result.problem.field === 'to') phoneInput.current?.focus()+ else document.getElementById(`oc-new-${result.problem.field}`)?.focus()+ return+ }+ setBusy(true)+ try {+ const dialled = await dial(result.input)+ onDialled(dialled.room, dialled.to)+ } catch (err) {+ setRefused(confirmErrorText(err))+ setBusy(false)+ }+ }++ const errorOf = (field: DialProblem['field']) => (problem?.field === field ? problem.text : null)+ const assistantOptions = [+ { value: '', label: t('call.outbound.new.assistantDefault', { assistant: assistants[0]?.name ?? '' }) },+ ...assistants.slice(1).map(a => ({ value: a.id, label: a.name })),+ ]+ return (+ <Dialog+ title={t('call.outbound.new.title')}+ description={t('call.outbound.new.description', { assistant: assistants[0]?.name ?? '' })}+ onClose={busy ? () => {} : onClose}+ onSubmit={submit}+ footer={+ <>+ <Button variant="ghost" onClick={onClose} disabled={busy}>+ {t('common.action.cancel')}+ </Button>+ <Button+ type="submit"+ variant="primary"+ icon="phone-out"+ busy={busy}+ title={t('common.withKey', { label: t('call.outbound.new.start'), key: '⏎' })}+ >+ {t('call.outbound.new.start')}+ </Button>+ </>+ }+ >+ <div className="oc-new">+ <FormField+ id="oc-new-to"+ label={t('call.outbound.new.to')}+ description={t('call.outbound.new.toHint')}+ error={errorOf('to')}+ >+ <PhoneInput+ id="oc-new-to"+ value={form.to}+ defaultCountry={defaultCountry}+ autoComplete="off"+ autoFocus+ inputRef={phoneInput}+ invalid={!!errorOf('to')}+ onChange={to => set('to', to)}+ />+ </FormField>+ {assistants.length > 1 && (+ <FormField id="oc-new-assistant" label={t('call.outbound.new.assistant')}>+ <Select+ id="oc-new-assistant"+ value={form.assistantId}+ options={assistantOptions}+ label={t('call.outbound.new.assistant')}+ onChange={id => set('assistantId', id)}+ />+ </FormField>+ )}+ <FormField+ id="oc-new-goal"+ label={t('call.outbound.new.goal')}+ description={t('call.outbound.new.goalHint')}+ error={errorOf('goal')}+ >+ <Textarea+ id="oc-new-goal"+ rows={4}+ value={form.goal}+ maxLength={DIAL_GOAL_MAX}+ invalid={!!errorOf('goal')}+ placeholder={t('call.outbound.new.goalPlaceholder')}+ onChange={e => set('goal', e.target.value)}+ onKeyDown={submitOnEnter}+ />+ </FormField>+ <FormField+ id="oc-new-firstSentence"+ label={t('call.outbound.new.firstSentence')}+ description={t('call.outbound.new.firstSentenceHint')}+ error={errorOf('firstSentence')}+ >+ <Input+ id="oc-new-firstSentence"+ {...NO_PASSWORD_MANAGER}+ value={form.firstSentence}+ maxLength={DIAL_FIRST_SENTENCE_MAX}+ invalid={!!errorOf('firstSentence')}+ onChange={e => set('firstSentence', e.target.value)}+ />+ </FormField>+ {refused && (+ <Note tone="danger" role="alert">+ {refused}+ </Note>+ )}+ </div>+ </Dialog>+ )+}diff --git a/apps/web/src/outbound/Outbound.tsx b/apps/web/src/outbound/Outbound.tsxnew file mode 100644index 00000000..4332d7ec--- /dev/null+++ b/apps/web/src/outbound/Outbound.tsx@@ -0,0 +1,168 @@+// Outbound calls (LIN-873): the calls the assistant made towards a goal, newest first, and the open call beside the+// list (on a phone: the list, then the call full screen with Back). A running call shows its transcript as it grows+// (calls and transcript_segments are live tables) and takes instructions (call.guide); an ended call shows its+// summary. New call (N) dials (call.dial). Owners and admins only, once a server admin turned outbound calls on.+import type { Call } from '@linedesk/db/types'+import { useT } from '@linedesk/i18n/react'+import { type ReactNode, useEffect, useMemo, useRef, useState } from 'react'+import { useSegmentsByCall } from '../call/segments.ts'+import { formatPhone } from '../inbox-model.ts'+import { setPageKeys } from '../shell/keys.ts'+import { useRows } from '../store.tsx'+import { parseTs, timeLabel } from '../time.ts'+import { Button, cx } from '../ui/kit.tsx'+import { PageTitle, ShortcutHints, ZeroState } from '../ui/listPage.tsx'+import { NewOutboundCall } from './NewOutboundCall.tsx'+import { OutboundStatus, useCalleeName } from './OutboundStatus.tsx'+import { OutboundDetail } from './OutboundDetail.tsx'+import { goalOf, isLive, outboundCallIdOf, outboundCalls, outboundHash } from './model.ts'+import './outbound.css'++type Props = { menu: ReactNode; toast: (text: string) => void; workspaceName: string }++/** The open call, from the hash (`#outbound/<id>`), so Back on a phone goes back to the list. */+function useOpenCallId(): string | null {+ const [id, setId] = useState(() => outboundCallIdOf(window.location.hash))+ useEffect(() => {+ const read = () => setId(outboundCallIdOf(window.location.hash))+ window.addEventListener('hashchange', read)+ return () => window.removeEventListener('hashchange', read)+ }, [])+ return id+}++/** Opens a call (null: back to the list), as a new history entry. */+function open(id: string | null) {+ window.location.hash = outboundHash(id)+}++function Row({ call, answered, open, onOpen }: { call: Call; answered: boolean; open: boolean; onOpen: () => void }) {+ const who = useCalleeName(call)+ const goal = goalOf(call)+ const title = call.title ?? goal ?? who+ // Without a title or goal the name is the title: the line under it then gives the number (once).+ const number = formatPhone(call.to_number)+ const to = title !== who ? who : who !== number ? number : null+ const more = call.summary ?? (goal && call.title ? goal : null)+ return (+ <button+ type="button"+ className={cx('oc-row', open && 'is-open')}+ aria-current={open ? 'true' : undefined}+ onClick={onOpen}+ >+ <span className="oc-row-top">+ <b className="oc-row-title">{title}</b>+ <time className="oc-row-time">{timeLabel(parseTs(call.started_at))}</time>+ </span>+ <span className="oc-row-sub">{[to, more].filter(Boolean).join(' · ')}</span>+ <span className="oc-row-status">+ <OutboundStatus call={call} answered={answered} />+ </span>+ </button>+ )+}++export function Outbound({ menu, toast, workspaceName }: Props) {+ const t = useT()+ const allCalls = useRows('calls')+ const calls = useMemo(() => outboundCalls(allCalls), [allCalls])+ const segments = useSegmentsByCall()+ const openId = useOpenCallId()+ const opened = openId ? calls.find(c => c.id === openId) : undefined+ const [dialing, setDialing] = useState(false)+ const answered = (call: Call) => (segments.get(call.id) ?? []).some(s => s.speaker === 'caller')++ // A call just dialled shows up once the agent registers it (a second or two): it opens then.+ const waitingFor = useRef<string | null>(null)+ useEffect(() => {+ if (!waitingFor.current) return+ const found = calls.find(c => c.room === waitingFor.current)+ if (found) {+ waitingFor.current = null+ open(found.id)+ }+ }, [calls])++ const keys = useRef<(key: string) => boolean>(() => false)+ keys.current = key => {+ const i = opened ? calls.indexOf(opened) : -1+ if (key === 'n') setDialing(true)+ else if (key === 'j' || key === 'ArrowDown') open(calls[Math.min(calls.length - 1, i + 1)]?.id ?? null)+ else if (key === 'k' || key === 'ArrowUp') open(calls[Math.max(0, i - 1)]?.id ?? null)+ else if (key === 'i' && opened && isLive(opened)) document.getElementById('oc-guide')?.focus()+ else if (key === 'Escape' && opened) open(null)+ else return false+ return true+ }+ useEffect(() => {+ setPageKeys(key => keys.current(key))+ return () => setPageKeys(null)+ }, [])++ const newCall = t('call.outbound.new.title')+ return (+ <div className={cx('cv', 'oc', opened && 'oc-has-open')}>+ <div className="ib-head oc-head">+ {menu}+ <PageTitle title={t('call.outbound.title')} count={calls.length} />+ <div className="ib-right">+ <Button+ size="sm"+ variant="primary"+ icon="plus"+ shortcut={['N']}+ aria-label={newCall}+ title={t('common.withKey', { label: newCall, key: 'N' })}+ onClick={() => setDialing(true)}+ >+ <span className="oc-new-label">{newCall}</span>+ </Button>+ </div>+ </div>+ <div className="oc-main">+ <div className="oc-list-pane">+ <div className="oc-list" role="list" aria-label={t('call.outbound.title')}>+ {calls.map(call => (+ <div role="listitem" key={call.id}>+ <Row call={call} answered={answered(call)} open={call.id === opened?.id} onOpen={() => open(call.id)} />+ </div>+ ))}+ {calls.length === 0 && (+ <ZeroState mark="phone" title={t('call.outbound.empty.title')} line={t('call.outbound.empty.line')} />+ )}+ </div>+ <ShortcutHints+ hints={[+ [['N'], t('call.outbound.new.title')],+ [['I'], t('call.outbound.guide.hint')],+ [['esc'], t('common.shortcut.close')],+ ]}+ />+ </div>+ {opened ? (+ <OutboundDetail+ key={opened.id}+ call={opened}+ segments={segments.get(opened.id) ?? []}+ answered={answered(opened)}+ onBack={() => open(null)}+ />+ ) : (+ <div className="oc-none">{calls.length > 0 && <span>{t('call.outbound.pick')}</span>}</div>+ )}+ </div>+ {dialing && (+ <NewOutboundCall+ workspaceName={workspaceName}+ onClose={() => setDialing(false)}+ onDialled={(room, to) => {+ setDialing(false)+ waitingFor.current = room+ toast(t('call.outbound.new.dialling', { number: formatPhone(to) }))+ }}+ />+ )}+ </div>+ )+}diff --git a/apps/web/src/outbound/OutboundDetail.tsx b/apps/web/src/outbound/OutboundDetail.tsxnew file mode 100644index 00000000..814cbdc5--- /dev/null+++ b/apps/web/src/outbound/OutboundDetail.tsx@@ -0,0 +1,219 @@+// One outbound call: its goal, Listen while it runs, the summary once it ended, the transcript as it grows and the+// instructions it got. While it runs, the field at the bottom sends the assistant a new instruction (call.guide);+// the log under the transcript shows each one, sending, sent or why it failed.+import type { Call, TranscriptSegment } from '@linedesk/db/types'+import { useT } from '@linedesk/i18n/react'+import { type FormEvent, type KeyboardEvent, useEffect, useRef, useState } from 'react'+import { LiveCard } from '../call/LiveCard.tsx'+import { SummaryCard } from '../call/SummaryCard.tsx'+import { Transcript } from '../call/Transcript.tsx'+import { formatPhone } from '../inbox-model.ts'+import { callHash } from '../shell/useRoute.ts'+import { useCallAssistantName } from '../store.tsx'+import { clock, parseTs, timeLabel } from '../time.ts'+import { AppLink } from '../ui/AppLink.tsx'+import { Card, Textarea } from '../ui/form.tsx'+import { Button, Icon } from '../ui/kit.tsx'+import { CALL_GUIDE_MAX } from '@linedesk/actions'+import { goalOf, instructionLog, isLive, type SentInstruction } from './model.ts'+import { OutboundStatus, useCalleeName } from './OutboundStatus.tsx'+import { sendGuide } from './outbound-api.ts'++type Props = {+ call: Call+ segments: TranscriptSegment[]+ answered: boolean+ onBack: () => void+}++/** The instructions this call got, newest last. */+function InstructionLog({+ call,+ segments,+ sent,+}: {+ call: Call+ segments: TranscriptSegment[]+ sent: SentInstruction[]+}) {+ const t = useT()+ const lines = instructionLog(segments, sent)+ if (lines.length === 0) return null+ const started = parseTs(call.started_at).getTime()+ return (+ <section className="oc-log" aria-label={t('call.outbound.guide.log')}>+ <b className="oc-log-h">{t('call.outbound.guide.log')}</b>+ <ol>+ {lines.map(line => (+ <li key={line.id} className={line.kind === 'sent' ? `is-${line.state}` : undefined}>+ <Icon name="send" size={13} />+ <span className="oc-log-text">+ {line.text}+ {line.kind === 'sent' && line.state === 'failed' && (+ <span className="oc-log-error" role="alert">+ {line.error}+ </span>+ )}+ </span>+ <span className="oc-log-meta">+ {line.kind === 'transcript'+ ? clock(line.atMs / 1000)+ : line.state === 'sending'+ ? t('call.outbound.guide.sending')+ : line.state === 'failed'+ ? t('call.outbound.guide.failed')+ : clock(Math.max(0, (line.at - started) / 1000))}+ </span>+ </li>+ ))}+ </ol>+ </section>+ )+}++/** The instruction field: Enter sends, Shift+Enter is a new line. Sticks to the bottom of the call. */+function GuideField({ assistant, onSend }: { assistant: string; onSend: (text: string) => void }) {+ const t = useT()+ const [text, setText] = useState('')+ const submit = (e?: FormEvent) => {+ e?.preventDefault()+ const value = text.trim()+ if (!value) return+ onSend(value)+ setText('')+ }+ const onKey = (e: KeyboardEvent<HTMLTextAreaElement>) => {+ if (e.key !== 'Enter' || e.shiftKey || e.nativeEvent.isComposing) return+ e.preventDefault()+ submit()+ }+ return (+ <form className="oc-guide" onSubmit={submit}>+ <div className="oc-guide-row">+ <Textarea+ id="oc-guide"+ rows={1}+ value={text}+ maxLength={CALL_GUIDE_MAX}+ placeholder={t('call.outbound.guide.placeholder', { assistant })}+ aria-label={t('call.outbound.guide.label', { assistant })}+ onChange={e => setText(e.target.value)}+ onKeyDown={onKey}+ />+ <Button+ type="submit"+ variant="primary"+ icon="send"+ disabled={!text.trim()}+ title={t('common.withKey', { label: t('call.outbound.guide.send'), key: '⏎' })}+ >+ <span className="oc-guide-send">{t('call.outbound.guide.send')}</span>+ </Button>+ </div>+ <p className="oc-guide-note">{t('call.outbound.guide.note', { assistant })}</p>+ </form>+ )+}++export function OutboundDetail({ call, segments, answered, onBack }: Props) {+ const t = useT()+ const assistant = useCallAssistantName(call.assistant_id)+ const who = useCalleeName(call)+ const goal = goalOf(call)+ const live = isLive(call)+ const [sent, setSent] = useState<SentInstruction[]>([])+ const turns = segments.filter(s => s.speaker !== 'system').length++ // The newest line stays in view while the call runs (unless the person scrolled up to read).+ const scroller = useRef<HTMLDivElement>(null)+ const pinned = useRef(true)+ // biome-ignore lint/correctness/useExhaustiveDependencies: scrolls when a line or an instruction comes in+ useEffect(() => {+ const el = scroller.current+ if (el && live && pinned.current) el.scrollTop = el.scrollHeight+ }, [segments.length, sent.length, live])++ const send = (text: string) => {+ const id = crypto.randomUUID()+ setSent(list => [...list, { id, callId: call.id, text, at: Date.now(), state: 'sending' }])+ void sendGuide(call.id, text).then(result =>+ setSent(list => list.map(i => (i.id === id ? { ...i, ...result } : i))),+ )+ }++ return (+ <section className="oc-detail" aria-label={call.title ?? who} data-esc-closes>+ <div className="oc-detail-bar">+ <Button+ size="sm"+ variant="ghost"+ icon="left"+ className="oc-back"+ title={t('common.action.closeWithKey', { key: 'esc' })}+ onClick={onBack}+ >+ {t('call.outbound.back')}+ </Button>+ <AppLink to={callHash(call.id)}>{t('call.outbound.openInInbox')}</AppLink>+ </div>+ <div+ className="oc-detail-scroll"+ ref={scroller}+ onScroll={e => {+ const el = e.currentTarget+ pinned.current = el.scrollHeight - el.scrollTop - el.clientHeight < 48+ }}+ >+ <header className="oc-detail-head">+ <div className="oc-detail-status">+ <OutboundStatus call={call} answered={answered} />+ <span>{timeLabel(parseTs(call.started_at))}</span>+ <span>{t('inbox.status.outboundBy', { assistant })}</span>+ </div>+ <h2>{call.title ?? goal ?? who}</h2>+ <p className="oc-detail-who">+ {who !== formatPhone(call.to_number) && <span>{who} · </span>}+ <span className="oc-num">{formatPhone(call.to_number)}</span>+ </p>+ </header>+ {goal && (+ <Card className="oc-goal" title={t('call.outbound.goal')}>+ <p>{goal}</p>+ </Card>+ )}+ {live && <LiveCard call={call} segments={segments} assistantName={assistant} />}+ {!live && (+ <Card className="cv-sum">+ <SummaryCard call={call} />+ </Card>+ )}+ {turns > 0 ? (+ <div className="oc-transcript">+ <Transcript+ segments={segments}+ callerName={who}+ assistantName={assistant}+ search={null}+ start={{+ time: clock(0),+ label: t('call.outbound.transcriptStart', { assistant, number: formatPhone(call.to_number) }),+ }}+ end={+ live+ ? null+ : {+ time: clock(call.duration_sec ?? Math.max(0, ...segments.map(s => s.at_ms / 1000))),+ label: t('call.transcript.ended'),+ }+ }+ />+ </div>+ ) : (+ <p className="oc-quiet">{live ? t('call.outbound.ringing') : t('call.outbound.noConversation')}</p>+ )}+ <InstructionLog call={call} segments={segments} sent={sent} />+ </div>+ {live && <GuideField assistant={assistant} onSend={send} />}+ </section>+ )+}diff --git a/apps/web/src/outbound/OutboundStatus.tsx b/apps/web/src/outbound/OutboundStatus.tsxnew file mode 100644index 00000000..1c5ec221--- /dev/null+++ b/apps/web/src/outbound/OutboundStatus.tsx@@ -0,0 +1,24 @@+// The parts the list and the open call share: the call's status and whom it went to.+import type { Call } from '@linedesk/db/types'+import { useT } from '@linedesk/i18n/react'+import { formatPhone } from '../inbox-model.ts'+import { useRows } from '../store.tsx'+import { parseTs, shortDuration } from '../time.ts'+import { Badge } from '../ui/kit.tsx'+import { LiveIndicator } from '../ui/LiveIndicator.tsx'+import { isLive } from './model.ts'++/** Live with its clock, or how it ended: not answered (nobody spoke to the assistant), or its length. */+export function OutboundStatus({ call, answered }: { call: Call; answered: boolean }) {+ const t = useT()+ if (isLive(call)) return <LiveIndicator since={parseTs(call.started_at)} />+ if (!answered) return <Badge>{t('call.outbound.status.notAnswered')}</Badge>+ return <Badge>{t('call.outbound.status.ended', { duration: shortDuration(call.duration_sec ?? 0) })}</Badge>+}++/** Whom the call went to: the contact's name, else the number. */+export function useCalleeName(call: Call): string {+ const contacts = useRows('contacts')+ const contact = call.contact_id ? contacts.find(c => c.id === call.contact_id) : undefined+ return (!contact?.deleted_at && contact?.name) || formatPhone(call.to_number)+}diff --git a/apps/web/src/outbound/model.ts b/apps/web/src/outbound/model.tsnew file mode 100644index 00000000..10db1033--- /dev/null+++ b/apps/web/src/outbound/model.ts@@ -0,0 +1,131 @@+// Outbound calls (LIN-873): the assistant phones someone towards a goal (call.dial) and takes instructions while the+// call runs (call.guide). Who sees the page, the list of outbound calls, the New call form's input and the log of+// the instructions sent to a call.+import {+ DIAL_FIRST_SENTENCE_MAX,+ DIAL_GOAL_MAX,+ phoneNumberProblem,+ type WorkspaceSettingsData,+} from '@linedesk/actions'+import type { Call, TranscriptSegment } from '@linedesk/db/types'+import { i18n } from '../i18n/index.tsx'+import { readStoredJson, writeStoredJson } from '../safeStorage.ts'++/** The page's route and hash (`#outbound`, one call: `#outbound/<call id>`). */+export const OUTBOUND_ROUTE = 'outbound'+export const outboundHash = (callId?: string | null) => (callId ? `#outbound/${callId}` : '#outbound')+/** The call a `#outbound/<id>` hash opens, or null. */+export function outboundCallIdOf(hash: string): string | null {+ const [path = ''] = hash.replace(/^#/, '').split('?')+ const [page, id, ...rest] = path.split('/')+ return page === OUTBOUND_ROUTE && id && rest.length === 0 ? id : null+}++/**+ * Whether this person gets the Outbound calls page: `on` with the permission to dial (owners and admins, never while+ * signed in as someone else) once a server admin turned outbound calls on for the workspace; `loading` while the+ * workspace's settings are not known yet; `off` otherwise.+ */+export type OutboundAccess = 'on' | 'off' | 'loading'+export function outboundAccess(+ me: { permissions: readonly string[]; impersonation?: unknown },+ settings: { data: Pick<WorkspaceSettingsData, 'outboundCallsEnabled'> | undefined; error: string | null },+): OutboundAccess {+ if (!me.permissions.includes('call:dial') || me.impersonation) return 'off'+ if (!settings.data) return settings.error ? 'off' : 'loading'+ return settings.data.outboundCallsEnabled ? 'on' : 'off'+}++/** The workspace's outbound calls, newest first (test and sample calls left out). */+export const outboundCalls = (calls: readonly Call[]): Call[] =>+ calls+ .filter(c => c.direction === 'out' && !c.deleted_at && c.source === 'phone')+ .sort((a, b) => b.started_at.localeCompare(a.started_at))++export const isLive = (call: Pick<Call, 'status' | 'ended_at'>) => call.status === 'live' && !call.ended_at++/** What New call holds. `assistantId` "" is the workspace's default assistant. */+export type DialForm = { to: string; goal: string; firstSentence: string; assistantId: string }+export type DialInput = { to: string; goal: string; first_sentence: string; assistantId?: string }+/** Where a problem with the form is shown. */+export type DialProblem = { field: 'to' | 'goal' | 'firstSentence'; text: string }++/** At least this long, as call.dial checks it. */+const GOAL_MIN = 10++/** call.dial's input from New call, or the first problem with it (shown under its field). */+export function dialInput(form: DialForm): { input: DialInput } | { problem: DialProblem } {+ const { t } = i18n()+ const to = form.to.trim()+ if (!to) return { problem: { field: 'to', text: t('call.outbound.new.enterNumber') } }+ const numberProblem = phoneNumberProblem(to, i18n())+ if (numberProblem) return { problem: { field: 'to', text: numberProblem } }+ const goal = form.goal.trim()+ if (goal.length < GOAL_MIN) return { problem: { field: 'goal', text: t('call.outbound.new.goalTooShort') } }+ if (goal.length > DIAL_GOAL_MAX) return { problem: { field: 'goal', text: t('call.outbound.new.tooLong') } }+ const first = form.firstSentence.trim()+ if (!first) return { problem: { field: 'firstSentence', text: t('call.outbound.new.enterFirstSentence') } }+ if (first.length > DIAL_FIRST_SENTENCE_MAX)+ return { problem: { field: 'firstSentence', text: t('call.outbound.new.tooLong') } }+ return { input: { to, goal, first_sentence: first, ...(form.assistantId ? { assistantId: form.assistantId } : {}) } }+}++/** call.dial's answer. */+export type DialResult = { room: string; to: string; from: string; assistantId: string }++// The goal is not stored with the call: this browser keeps the goals it dialled, by room, so the list and the call+// can show them (a call dialled elsewhere, over MCP or the API, shows its title instead).+const GOALS_KEY = 'linedesk.outbound.goals'+const GOALS_KEPT = 100+type Goals = Record<string, { goal: string; at: number }>++export function rememberGoal(room: string, goal: string, now = Date.now()) {+ const goals = readStoredJson<Goals>('local', GOALS_KEY) ?? {}+ goals[room] = { goal, at: now }+ const kept = Object.entries(goals)+ .sort((a, b) => b[1].at - a[1].at)+ .slice(0, GOALS_KEPT)+ writeStoredJson('local', GOALS_KEY, Object.fromEntries(kept))+}++export function goalOf(call: Pick<Call, 'room'>): string | null {+ if (!call.room) return null+ return readStoredJson<Goals>('local', GOALS_KEY)?.[call.room]?.goal ?? null+}++/** An instruction sent from this page: `sending` until call.guide answers, then `sent` or `failed` (with why). */+export type SentInstruction = {+ id: string+ callId: string+ text: string+ at: number+ state: 'sending' | 'sent' | 'failed'+ error?: string+}++/** One line of a call's instruction log: from the transcript (the agent wrote it), or sent here and not in it yet. */+export type LogLine =+ | { kind: 'transcript'; id: string; text: string; atMs: number }+ | { kind: 'sent'; id: string; text: string; at: number; state: SentInstruction['state']; error?: string }++/** call.guide's lines in the transcript (system lines of the tool call.guide). */+export const guideSegments = (segments: readonly TranscriptSegment[]) =>+ segments.filter(s => s.speaker === 'system' && s.tool_event?.tool === 'call.guide')++/**+ * The instructions this call got, in the order sent: the transcript's lines first (every instruction the assistant+ * took, from anyone), then the ones sent from this page that the transcript does not show yet.+ */+export function instructionLog(segments: readonly TranscriptSegment[], sent: readonly SentInstruction[]): LogLine[] {+ const lines = guideSegments(segments)+ const fromTranscript: LogLine[] = lines.map(s => ({+ kind: 'transcript',+ id: s.id,+ text: s.tool_event?.label ?? s.text,+ atMs: s.at_ms,+ }))+ const waiting: LogLine[] = sent+ .filter(i => i.state !== 'sent' || !lines.some(s => (s.tool_event?.label ?? s.text).includes(i.text)))+ .map(i => ({ kind: 'sent', id: i.id, text: i.text, at: i.at, state: i.state, error: i.error }))+ return [...fromTranscript, ...waiting]+}diff --git a/apps/web/src/outbound/outbound-api.ts b/apps/web/src/outbound/outbound-api.tsnew file mode 100644index 00000000..01afe62f--- /dev/null+++ b/apps/web/src/outbound/outbound-api.ts@@ -0,0 +1,26 @@+// The two writes of the Outbound calls page, sent directly (they start or steer a phone call; nothing to apply+// locally): call.dial and call.guide. A refusal (409 with the server's reason, e.g. a number abroad) comes back as+// the text to show.+import { confirmErrorText } from '../ui/DangerConfirmDialog.tsx'+import { callAction } from '../settings/settings-api.ts'+import { type DialInput, type DialResult, rememberGoal, type SentInstruction } from './model.ts'++/** Starts the call; the goal is kept in this browser for the list (goalOf). Throws with the reason to show. */+export async function dial(input: DialInput): Promise<DialResult> {+ const result = await callAction<DialResult>('call.dial', input)+ rememberGoal(result.room, input.goal)+ return result+}++/** Sends one instruction to a running call; how it went, for the instruction log. */+export async function sendGuide(+ callId: string,+ instruction: string,+): Promise<Pick<SentInstruction, 'state' | 'error'>> {+ try {+ await callAction('call.guide', { callId, instruction })+ return { state: 'sent' }+ } catch (err) {+ return { state: 'failed', error: confirmErrorText(err) }+ }+}diff --git a/apps/web/src/outbound/outbound.css b/apps/web/src/outbound/outbound.cssnew file mode 100644index 00000000..f4d1bf8a--- /dev/null+++ b/apps/web/src/outbound/outbound.css@@ -0,0 +1,324 @@+/* Outbound calls (outbound/Outbound.tsx): the list at the left and the open call beside it; below 900 px wide one+ at a time, the open call full screen with Back and the instruction field fixed at its bottom. */+.oc {+ min-width: 0;+ overflow: hidden;+}+.oc-main {+ flex: 1;+ min-height: 0;+ display: grid;+ grid-template-columns: minmax(300px, 2fr) minmax(0, 3fr);+}+.oc-list-pane {+ display: flex;+ flex-direction: column;+ min-height: 0;+ min-width: 0;+ border-right: 1px solid var(--line);+}+.oc-list {+ flex: 1;+ min-height: 0;+ overflow-y: auto;+}+.oc-list .zero {+ padding: 32px 16px;+}++.oc-row {+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ gap: 2px;+ width: 100%;+ min-height: 64px;+ box-sizing: border-box;+ padding: 10px 20px 10px 18px;+ border: 0;+ border-left: 2px solid transparent;+ border-bottom: 1px solid var(--line);+ background: transparent;+ color: var(--ink);+ text-align: left;+ font: inherit;+ cursor: pointer;+}+.oc-row:hover {+ background: var(--surface-hover);+}+.oc-row.is-open {+ background: var(--highlight);+ border-left-color: var(--ink);+}+.oc-row:focus-visible {+ outline: 2px solid var(--focus);+ outline-offset: -2px;+}+.oc-row-top {+ display: flex;+ align-items: baseline;+ gap: 12px;+ min-width: 0;+}+.oc-row-title {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ font-weight: 600;+}+.oc-row-time {+ flex: none;+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--ink-muted);+}+.oc-row-sub {+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ color: var(--ink-muted);+ font-size: 13px;+}+.oc-row-status {+ display: flex;+ margin-top: 2px;+}++.oc-none {+ display: grid;+ place-items: center;+ color: var(--ink-muted);+ padding: 24px;+}++.oc-detail {+ display: flex;+ flex-direction: column;+ min-height: 0;+ min-width: 0;+ background: var(--bg);+}+.oc-detail-bar {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ padding: 8px 16px;+ border-bottom: 1px solid var(--line);+ flex: none;+}+.oc-detail-bar .oc-back {+ visibility: hidden;+}+.oc-detail-scroll {+ flex: 1;+ min-height: 0;+ overflow-y: auto;+ padding: 16px 24px 24px;+ display: grid;+ grid-template-columns: minmax(0, 1fr);+ align-content: start;+ gap: 12px;+}+.oc-detail-head {+ display: grid;+ gap: 4px;+}+.oc-detail-head h2 {+ margin: 0;+ font-size: 20px;+ line-height: 28px;+ font-weight: 600;+ letter-spacing: -0.01em;+ overflow-wrap: anywhere;+}+.oc-detail-status {+ display: flex;+ align-items: center;+ flex-wrap: wrap;+ gap: 4px 10px;+ color: var(--ink-muted);+ font-size: 13px;+}+.oc-detail-who {+ margin: 0;+ color: var(--ink-muted);+}+.oc-num {+ font-family: var(--font-mono);+ font-size: 13px;+}+.oc-goal p {+ margin: 0;+ white-space: pre-wrap;+ overflow-wrap: anywhere;+}+.oc-transcript {+ min-width: 0;+}+.oc-quiet {+ margin: 8px 0;+ color: var(--ink-muted);+ text-align: center;+}++.oc-log {+ display: grid;+ gap: 6px;+ padding-top: 8px;+ border-top: 1px solid var(--line);+}+.oc-log-h {+ font-size: 13px;+}+.oc-log ol {+ list-style: none;+ margin: 0;+ padding: 0;+ display: grid;+ gap: 6px;+}+.oc-log li {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr) auto;+ gap: 8px;+ align-items: start;+ font-size: 13px;+ color: var(--ink);+}+.oc-log li > .k-icon,+.oc-log li > svg {+ margin-top: 3px;+ color: var(--ink-muted);+}+.oc-log-text {+ overflow-wrap: anywhere;+ display: grid;+ gap: 2px;+}+.oc-log-meta {+ font-family: var(--font-mono);+ font-size: 12px;+ color: var(--ink-muted);+}+.oc-log li.is-sending {+ color: var(--ink-muted);+}+.oc-log li.is-failed .oc-log-meta,+.oc-log-error {+ color: var(--danger);+}++.oc-guide {+ flex: none;+ display: grid;+ gap: 4px;+ padding: 10px 16px calc(10px + env(safe-area-inset-bottom));+ border-top: 1px solid var(--line);+ background: var(--surface);+}+.oc-guide-row {+ display: flex;+ gap: 8px;+ align-items: flex-end;+}+.oc-guide-row textarea.ta {+ flex: 1;+ min-width: 0;+ box-sizing: border-box;+ height: 44px;+ min-height: 44px;+ padding: 11px 12px;+ line-height: 20px;+ max-height: 140px;+ resize: none;+ font-size: 16px;+}+.oc-guide-row .k-btn {+ flex: none;+ height: 44px;+}+/* The assistant's steps and the instructions sent wrap here: a phone is too narrow for one line. */+.oc .k-event-in {+ white-space: normal;+ min-width: 0;+}+.oc-guide-note {+ margin: 0;+ font-size: 12px;+ color: var(--ink-muted);+}++.oc-new {+ display: grid;+ gap: 14px;+}++/* One pane at a time: the list, or the open call over the whole page with Back. */+@container main (max-width: 899px) {+ .oc-main {+ grid-template-columns: minmax(0, 1fr);+ }+ .oc-list-pane {+ border-right: 0;+ }+ .oc-has-open .oc-list-pane,+ .oc:not(.oc-has-open) .oc-detail,+ .oc-none {+ display: none;+ }+ .oc-has-open .oc-head {+ display: none;+ }+ .oc-detail-bar .oc-back {+ visibility: visible;+ }+ .oc-detail-bar {+ padding: 6px 12px;+ min-height: 44px;+ }+ .oc-detail-scroll {+ padding: 12px 16px 16px;+ }+ .oc-row {+ padding: 12px 16px;+ min-height: 72px;+ }+ .oc-list-pane .ib-hint {+ display: none;+ }+ .oc-detail-head h2 {+ font-size: 18px;+ line-height: 24px;+ }+}+/* Phones: the label of New call goes (the + stays), the fields are 16 px so iOS does not zoom in. */+@container main (max-width: 480px) {+ .oc-new-label {+ position: absolute;+ width: 1px;+ height: 1px;+ overflow: hidden;+ clip: rect(0 0 0 0);+ }+ .oc-new input,+ .oc-new textarea {+ font-size: 16px;+ }+}+@media (hover: none) and (pointer: coarse) {+ .oc-guide-send {+ display: none;+ }+ .oc-guide-row .k-btn {+ width: 44px;+ height: 44px;+ justify-content: center;+ }+ .oc-guide-note {+ display: none;+ }+}diff --git a/apps/web/src/outbound/outbound.test.tsx b/apps/web/src/outbound/outbound.test.tsxnew file mode 100644index 00000000..ee104d82--- /dev/null+++ b/apps/web/src/outbound/outbound.test.tsx@@ -0,0 +1,179 @@+// Outbound calls page (LIN-873): who gets it, New call's input to call.dial, instructions to a running call through+// call.guide and the log of the instructions sent.+import type { Call, TranscriptSegment } from '@linedesk/db/types'+import { renderToStaticMarkup } from 'react-dom/server'+import { beforeEach, describe, expect, test, vi } from 'vitest'++const sent = vi.hoisted(() => [] as { name: string; input: object }[])+const answer = vi.hoisted(() => ({ refuse: null as string | null }))+vi.mock('../settings/settings-api.ts', () => ({+ callAction: async (name: string, input: object) => {+ sent.push({ name, input })+ if (answer.refuse) throw new Error(answer.refuse)+ return name === 'call.dial'+ ? { room: 'outbound-1', to: (input as { to: string }).to, from: '+15035550100', assistantId: 'as_1' }+ : { callId: (input as { callId: string }).callId, at: '2026-11-28T10:00:00Z' }+ },+}))+vi.mock('../auth.ts', () => ({ auth: { useSession: () => ({ data: { user: { name: 'Mike Brennan' } } }) } }))+vi.mock('../shell/WorkspaceMenu.tsx', () => ({ WorkspaceMenu: () => null }))+vi.mock('../feedback/HelpMenu.tsx', () => ({ HelpMenu: () => null }))+vi.mock('../brand.ts', async importOriginal => ({+ ...(await importOriginal<object>()),+ useBrand: () => ({ starPrompt: false, starCount: null }),+}))++const { dialInput, goalOf, instructionLog, outboundAccess, outboundCallIdOf, outboundCalls } = await import(+ './model.ts'+)+const { dial, sendGuide } = await import('./outbound-api.ts')+const { Nav } = await import('../shell/Nav.tsx')++const store = new Map<string, string>()+beforeEach(() => {+ sent.length = 0+ answer.refuse = null+ store.clear()+ vi.stubGlobal('localStorage', {+ getItem: (k: string) => store.get(k) ?? null,+ setItem: (k: string, v: string) => void store.set(k, v),+ removeItem: (k: string) => void store.delete(k),+ })+})++const owner = { permissions: ['call:read', 'call:dial'] }+const member = { permissions: ['call:read'] }+const on = { data: { outboundCallsEnabled: true }, error: null }+const off = { data: { outboundCallsEnabled: false }, error: null }++describe('who gets the Outbound calls page', () => {+ test('owners and admins once a server admin turned outbound calls on', () => {+ expect(outboundAccess(owner, on)).toBe('on')+ expect(outboundAccess(owner, off)).toBe('off')+ // An older API without the flag: off.+ expect(outboundAccess(owner, { data: {}, error: null })).toBe('off')+ })+ test('never members, never while signed in as someone else; unknown while the settings load', () => {+ expect(outboundAccess(member, on)).toBe('off')+ expect(outboundAccess({ ...owner, impersonation: { edits: true } }, on)).toBe('off')+ expect(outboundAccess(owner, { data: undefined, error: null })).toBe('loading')+ expect(outboundAccess(owner, { data: undefined, error: 'failed' })).toBe('off')+ })++ const nav = (outboundCalls: boolean) =>+ renderToStaticMarkup(+ <Nav+ open+ docked+ route="calls"+ tab="you"+ unreadCount={0}+ reminderCount={0}+ mineCount={null}+ unassignedCount={null}+ reviewCount={null}+ outboundCalls={outboundCalls}+ workspaceName="Brightwater Plumbing & Heating"+ workspaceId="ws_1"+ toast={() => {}}+ invitations={[]}+ onInvitationsChanged={() => {}}+ onInbox={() => {}}+ onPage={() => {}}+ isInstanceAdmin={false}+ onHelp={() => {}}+ onSignOut={() => {}}+ onClose={() => {}}+ />,+ )+ test('the navigation shows Outbound calls only when the page is on', () => {+ expect(nav(true)).toContain('Outbound calls')+ expect(nav(false)).not.toContain('Outbound calls')+ })+})++test('one call open is #outbound/<id>; the list holds real outbound calls only, newest first', () => {+ expect(outboundCallIdOf('#outbound/call_1')).toBe('call_1')+ expect(outboundCallIdOf('#outbound')).toBeNull()+ expect(outboundCallIdOf('#contacts/call_1')).toBeNull()+ const call = (id: string, over: Partial<Call>) =>+ ({ id, direction: 'out', source: 'phone', deleted_at: null, started_at: '2026-11-28T10:00:00Z', ...over }) as Call+ const list = outboundCalls([+ call('old', { started_at: '2026-11-27T10:00:00Z' }),+ call('in', { direction: 'in' }),+ call('test', { source: 'test' }),+ call('gone', { deleted_at: '2026-11-28T11:00:00Z' }),+ call('new', {}),+ ])+ expect(list.map(c => c.id)).toEqual(['new', 'old'])+})++describe('New call', () => {+ const form = {+ to: '+15035550186',+ goal: 'Ask if Monday at 8 AM still works for the install.',+ firstSentence: 'Hello, this is Maya from Brightwater Plumbing.',+ assistantId: '',+ }+ test('says what is missing, under its field', () => {+ expect(dialInput({ ...form, to: '' })).toMatchObject({ problem: { field: 'to' } })+ expect(dialInput({ ...form, to: '5035550186' })).toMatchObject({ problem: { field: 'to' } })+ expect(dialInput({ ...form, goal: 'Call' })).toMatchObject({ problem: { field: 'goal' } })+ expect(dialInput({ ...form, firstSentence: ' ' })).toMatchObject({ problem: { field: 'firstSentence' } })+ })+ test('Start call sends call.dial and keeps the goal for the list', async () => {+ const result = dialInput({ ...form, assistantId: 'as_2' })+ if (!('input' in result)) throw new Error('expected an input')+ const dialled = await dial(result.input)+ expect(sent).toEqual([+ {+ name: 'call.dial',+ input: { to: '+15035550186', goal: form.goal, first_sentence: form.firstSentence, assistantId: 'as_2' },+ },+ ])+ expect(dialled.room).toBe('outbound-1')+ expect(goalOf({ room: 'outbound-1' })).toBe(form.goal)+ // The default assistant is not named.+ const plain = dialInput(form)+ expect('input' in plain && plain.input).not.toHaveProperty('assistantId')+ })+ test('a refusal comes back as the reason to show', async () => {+ answer.refuse = 'Calls can only go to numbers in the same country as the number they come from.'+ await expect(dial({ to: '+4915112345678', goal: form.goal, first_sentence: 'Hi' })).rejects.toThrow(/same country/)+ })+})++describe('instructions to a running call', () => {+ test('Send sends call.guide; a refusal is shown in the log', async () => {+ expect(await sendGuide('call_1', 'Offer Thursday at 2 PM instead.')).toEqual({ state: 'sent' })+ expect(sent).toEqual([+ { name: 'call.guide', input: { callId: 'call_1', instruction: 'Offer Thursday at 2 PM instead.' } },+ ])+ answer.refuse = 'This call has ended: an instruction only reaches a call that is still running.'+ expect(await sendGuide('call_1', 'Hang up.')).toEqual({ state: 'failed', error: answer.refuse })+ })++ test('the log: the transcript’s instruction lines, then what was sent here and is not in it yet', () => {+ const segment = (id: string, over: Partial<TranscriptSegment>) =>+ ({ id, call_id: 'call_1', speaker: 'caller', text: '', at_ms: 0, tool_event: null, ...over }) as TranscriptSegment+ const segments = [+ segment('s1', { speaker: 'agent', text: 'Hello.' }),+ segment('s2', {+ speaker: 'system',+ text: 'Instruction from Mike Brennan: "Ask them to hold one."',+ at_ms: 62_000,+ tool_event: { tool: 'call.guide', label: 'Instruction from Mike Brennan: "Ask them to hold one."' },+ }),+ ]+ const log = instructionLog(segments, [+ { id: 'a', callId: 'call_1', text: 'Ask them to hold one.', at: 1, state: 'sent' },+ { id: 'b', callId: 'call_1', text: 'Ask about the price.', at: 2, state: 'sending' },+ { id: 'c', callId: 'call_1', text: 'Hang up.', at: 3, state: 'failed', error: 'Ended.' },+ ])+ expect(log.map(l => [l.kind, l.id])).toEqual([+ ['transcript', 's2'],+ ['sent', 'b'],+ ['sent', 'c'],+ ])+ })+})diff --git a/apps/web/src/shell/Nav.tsx b/apps/web/src/shell/Nav.tsxindex 3307b478..35072dd0 100644--- a/apps/web/src/shell/Nav.tsx+++ b/apps/web/src/shell/Nav.tsx@@ -33,6 +33,8 @@ type Props = {unassignedCount: number | null/** Owners and admins: open items in How <assistant> did (calls to look at, questions), on Settings; null for members. */reviewCount: number | null+ /** Owners and admins in a workspace with outbound calls on (outbound/model.ts outboundAccess): the Outbound calls entry. */+ outboundCalls?: booleanworkspaceName: stringworkspaceId: string/** The signed-in member's profile picture (/v1/me), for their row in the workspace menu. */@@ -90,7 +92,7 @@ function UnreadDot({ label }: { label: string }) {* or after choosing. Two parts: the workspace button on top (one* menu: switch workspace, your account, sign out) and one list of pages, Settings once at its end (the assistant,* Workspace settings and User settings are its areas). */-export function Nav({ open, docked = false, collapsed = false, onToggleCollapsed, route, tab, unreadCount, reminderCount, mineCount, unassignedCount, reviewCount, workspaceName, workspaceId, avatarUrl, toast, invitations, onInvitationsChanged, isInstanceAdmin, onNewWorkspace, newWorkspaceLabel, onClose, ...on }: Props) {+export function Nav({ open, docked = false, collapsed = false, onToggleCollapsed, route, tab, unreadCount, reminderCount, mineCount, unassignedCount, reviewCount, outboundCalls = false, workspaceName, workspaceId, avatarUrl, toast, invitations, onInvitationsChanged, isInstanceAdmin, onNewWorkspace, newWorkspaceLabel, onClose, ...on }: Props) {const t = useT()const ref = useRef<HTMLElement>(null)useFocusTrap(ref, open && !docked, { initial: '.nav-item[aria-current="page"]' }) // opens on the current page, gives focus back when it closes@@ -134,6 +136,9 @@ export function Nav({ open, docked = false, collapsed = false, onToggleCollapsedcount={unassignedCount} badge={unassignedCount ? <span className="nav-n">{unassignedCount}</span> : null} />)}<NavItem sub label={t('shell.nav.done')} icon="check" keys={['G', 'E']} current={onCalls && tab === 'done'} href={listHash({ tab: 'done', search: null })} onClick={go(() => on.onInbox('done'))} />+ {outboundCalls && (+ <NavItem label={pages.outbound.title} icon="phone-out" current={route === 'outbound'} href="#outbound" onClick={go(() => on.onPage('outbound'))} />+ )}<NavItem label={pages.contacts.title} icon="contact" keys={['G', 'C']} current={route === 'contacts'} href="#contacts" onClick={go(() => on.onPage('contacts'))} /><NavItem label={pages.insights.title} icon="chart" keys={['G', 'N']} current={route === 'insights'} href="#insights" onClick={go(() => on.onPage('insights'))} /><NavItem label={pages.integrations.title} icon="plug" keys={['G', 'O']} current={route === 'integrations'} href="#integrations" onClick={go(() => on.onPage('integrations'))} />diff --git a/apps/web/src/shell/pages.tsx b/apps/web/src/shell/pages.tsxindex 45c8166f..2585aacc 100644--- a/apps/web/src/shell/pages.tsx+++ b/apps/web/src/shell/pages.tsx@@ -6,6 +6,7 @@ import type { ReactNode } from 'react'import { AdminNotice } from '../admin/AdminMode.tsx'import { Contacts } from '../contacts/Contacts.tsx'import { Insights } from '../insights/Insights.tsx'+import { Outbound } from '../outbound/Outbound.tsx'import { Integrations } from '../integrations/Integrations.tsx'import { AccountSettings } from '../settings/account/index.tsx'import type { PhoneSetupStatus } from '../auth.ts'@@ -65,6 +66,16 @@ export const pages = {ownHeader: true,render: p => <Contacts menu={p.menu} toast={p.toast} openCall={p.openCall} runUndoable={p.runUndoable} />,},+ // Outbound calls (LIN-873): owners and admins, once a server admin turned them on (outbound/model.ts+ // outboundAccess; Workspace.tsx shows "not found" otherwise). One call open: `#outbound/<call id>`.+ outbound: {+ get title() {+ return i18n().t('shell.page.outbound')+ },+ ownHeader: true,+ sections: true,+ render: p => <Outbound menu={p.menu} toast={p.toast} workspaceName={p.workspaceName} />,+ },insights: {get title() {return i18n().t('shell.page.insights')diff --git a/packages/actions/src/settings.ts b/packages/actions/src/settings.tsindex ec6e296e..952da9b3 100644--- a/packages/actions/src/settings.ts+++ b/packages/actions/src/settings.ts@@ -601,6 +601,8 @@ export type WorkspaceSettingsData = {* `usageCentsPerMinute` is absent; and its partner's owner picks Premium or Ultra for its assistants, not its own owner.*/partnerManaged?: boolean+ /** A server admin turned outbound calls on for this workspace (workspace.setOutboundCalls). Missing from an older API: off. */+ outboundCallsEnabled?: boolean}/**diff --git a/packages/i18n/i18n.lock.json b/packages/i18n/i18n.lock.jsonindex 55e65cee..80fc16a4 100644--- a/packages/i18n/i18n.lock.json+++ b/packages/i18n/i18n.lock.json@@ -12775,6 +12775,196 @@"out": "a30e6075b19a29e8387ad2b2360ec83c64ef44bf4b723308da85db4d599e1bfc","src": "359dd2caaad34d90a14ceeedd2749fcfebd424b92f6461af2f5c00fda14ce65e"},+ "call.outbound.back": {+ "by": "ai",+ "out": "548611ce58f71a173404d9cfc99816457f97ad25b814310374f5c3f096546ee8",+ "src": "76900f1bfd16c8d4dd3d25e6f46638d7165aee23883ccea6bfe071c514421769"+ },+ "call.outbound.empty.line": {+ "by": "ai",+ "out": "0648b2764d63c621d066744285a997033b0116abc5e25429be9507f52b11e9b6",+ "src": "8e7b5bd07ddf6107f9ed33e8d0b8bdb55858f5a6e953698eb313fb46b3d116d8"+ },+ "call.outbound.empty.title": {+ "by": "ai",+ "out": "d8b80fc4f5212e00d602bd28a431d59c17963a6308402d9c1ce55a5b723a4178",+ "src": "9b4fbe533e40e94c3b7e04bfa26d396319c77bf2fca9c33c40e825c6d3c16ab9"+ },+ "call.outbound.goal": {+ "by": "ai",+ "out": "f487ce3960189b78918da7991c10aa74a9fc8922046c0ebdb978772c61734bbb",+ "src": "cdbf6975e8a35b0d03558be6822dfae166482c24fb86b0433f60e8167f5c91e4"+ },+ "call.outbound.guide.failed": {+ "by": "ai",+ "out": "1e471ce08e5e3d620a2f05ae173f6728545c0a7f2878a74f82adeb8a17845b50",+ "src": "cd5f943d586317a053254e54e42d9979e79bec16124c3bde2e30c340aca5df87"+ },+ "call.outbound.guide.hint": {+ "by": "ai",+ "out": "e1812557f499c9f2929e390505b91f11f387c93755706c15b8c557aaf1bcfa29",+ "src": "5a92f6f089f63f0d476ba2494aa0848b93dbd0bcb7f058544e10992e67f09c98"+ },+ "call.outbound.guide.label": {+ "by": "ai",+ "out": "e6f9d56ac8e2888fcb66cea821a0338b1d8ce94db17c40eea1d762c063bda525",+ "src": "8d168f540cd63ccf592c72afe3da8b65a65ad74ebe80a48abb26f66582fa1927"+ },+ "call.outbound.guide.log": {+ "by": "ai",+ "out": "01925f87abf738fb17378277f9e1c1986362f264041044a1d11b2bd819699c82",+ "src": "226a89aa6ba990a70e002bb62ce934c9d58cbd42b354a5aa815d9d0fffe499be"+ },+ "call.outbound.guide.note": {+ "by": "ai",+ "out": "65ff0ea62e9a0b4b40afa8002bb1cf59207fa0002dc6f36627337348b99c144f",+ "src": "b2a645226b33cc25460f5f0ee653fd1f570fc73952fb69d032e75dd4c2797041"+ },+ "call.outbound.guide.placeholder": {+ "by": "ai",+ "out": "89654b9c31f38fb6e0a3ac8a39c2c80d2ce4417dfb3d033cbbf3d35c3a05c999",+ "src": "146c64e4db091b5a4818cbaa102fb756cefc97f56b1a1480f895c0b437e9acc4"+ },+ "call.outbound.guide.send": {+ "by": "ai",+ "out": "079bef4e232ff78a9c6def1c06f7a059cf4ddd087271bd03892d7463947fdf96",+ "src": "f6f4688ff23d50c67053963c251fa0ce64a925cf283537cf066b1f362cb9b778"+ },+ "call.outbound.guide.sending": {+ "by": "ai",+ "out": "e2308adbdd55d99cd2ab4a7046aa4a2635959c27b4b3e3c7d144a1b69809b34f",+ "src": "b8ed5279e897be5def6b902caa5121b3c1ee6957209f715187878a93ae0ca8be"+ },+ "call.outbound.new.assistant": {+ "by": "ai",+ "out": "f49464f500c688ce8c13aea743f3057ff5e5ebe249c8c816dfac78f7206641fd",+ "src": "391e405152779acc6b0f9429f3a4e27baf2af0deab2c37ba792311efa767d676"+ },+ "call.outbound.new.assistantDefault": {+ "by": "ai",+ "out": "67e203e808e6462cfe7b02714d3c7000c6101bc8bcecfc107c0443b38c2fb573",+ "src": "a0b57f2b826035dbd5a301f455d48b6cd503aa4552fdae35700d2c0dd5d8118b"+ },+ "call.outbound.new.description": {+ "by": "ai",+ "out": "6e9ff7655d9a067249b7f0351053fe7aab7c5ee5addf1a23f4afee1b774874f4",+ "src": "7b88c2f0ef9b70f012676b28fc8a392c6632b32f5901c3d5e0d04dad02871115"+ },+ "call.outbound.new.dialling": {+ "by": "ai",+ "out": "deb09d27bce97df18142869114ba719f285222217adf8fde74fa8af874cadf82",+ "src": "0330177c19199e5a13baca327a6bb3e2b7eedd80524876833f6439f17e1498ab"+ },+ "call.outbound.new.enterFirstSentence": {+ "by": "ai",+ "out": "abc1072628e768de5286059f602e1036fd06592075893ffbfa49940b4bdb1bd2",+ "src": "5df7c944b4017b0744ac59f46abf7e9f9331b600b7d0b5fc25e88ed233644586"+ },+ "call.outbound.new.enterNumber": {+ "by": "ai",+ "out": "e789c9ab8f26ab3aa40515dd0ce7144140e06f9d2881e4b32a8e999f63290f9d",+ "src": "2730e093b62a599ad30d8ddf25866d56ae73d3ec4dfb79069f6860b30b00d7d5"+ },+ "call.outbound.new.firstSentence": {+ "by": "ai",+ "out": "84481e56ea4566e838d8de6f7cdb37b699131010bcae8f31b6afea11901aea68",+ "src": "fa66b2c06fe7809e2440611558b59fc6290bd116f5887aa55c2b5c7d3b92f0b0"+ },+ "call.outbound.new.firstSentenceDefault": {+ "by": "ai",+ "out": "b76c13115d475e7c66f1dab2878b938e4354e5c609521a1ae4bfd600f7a3fdd0",+ "src": "eb9fa6928701e4278f0295a18d7935a3d35ea5bc71c8df264b1c1f26de5b7e0f"+ },+ "call.outbound.new.firstSentenceHint": {+ "by": "ai",+ "out": "554b85b03573a2726ae61c82eb288a634e2b9f976b0846ef0668f6c436e610bb",+ "src": "efc7bf1089046ed8eb592f74abea67524cc550b8d92e706e056dbd15ce332992"+ },+ "call.outbound.new.goal": {+ "by": "ai",+ "out": "f487ce3960189b78918da7991c10aa74a9fc8922046c0ebdb978772c61734bbb",+ "src": "cdbf6975e8a35b0d03558be6822dfae166482c24fb86b0433f60e8167f5c91e4"+ },+ "call.outbound.new.goalHint": {+ "by": "ai",+ "out": "ffc0396a7caecdf143c37edf65f4b09ea209b21fccdd97f19972bb691fe25a2c",+ "src": "0f209eead59a98b0a335364687532a31f6eb3a7c982eaf5cc51376a01b07a075"+ },+ "call.outbound.new.goalPlaceholder": {+ "by": "ai",+ "out": "4327644bd805a7d58f5838de9c3d4c1cc78b010ad40c959c3846d832281067e5",+ "src": "a3162c1ac15b38239ef1e95ca82a919cff72cef8aea376df4b494547e518b877"+ },+ "call.outbound.new.goalTooShort": {+ "by": "ai",+ "out": "2dacfbda7cf892876dca3929d5c8a19bb613b6fdea960cf5651d8dd9f24415b8",+ "src": "e1c525c57d3c51c791e50db1d1ca73fb625dcca2e1c2b457350800a688118176"+ },+ "call.outbound.new.start": {+ "by": "ai",+ "out": "df9324e19dc229a5033bc417c59e8dea8ebc8d0300ec32d11cc358b3f04ef244",+ "src": "99e5d804a4e99361adf998f288c338371a550541544b8982203066421f89123f"+ },+ "call.outbound.new.title": {+ "by": "ai",+ "out": "b3a6684d654180a37e97931d2ca430aff68ba53b615a169d71a67f5a8af4ba58",+ "src": "5e9b7ec48384b0ed8613bd9659ebec27cc21ab959f25735342e01c154807e320"+ },+ "call.outbound.new.to": {+ "by": "ai",+ "out": "a188e5297d9d5b6cbde550a42f0ea3509134fdc62bee727fdf7aa8f37b8e6106",+ "src": "b02832a97514655fed17d8415ce06a274ca1f318a2c872e996a5262c9c85251e"+ },+ "call.outbound.new.toHint": {+ "by": "ai",+ "out": "b18a77aaf2486c6b059c239878aa73b2108ec56aaba71b4b5f7e0dcfb6b55595",+ "src": "4b91ef1b1e0dc3d7581c34883dd90b9890e5131ed5467a66689a45e6d15b2dbd"+ },+ "call.outbound.new.tooLong": {+ "by": "ai",+ "out": "90c8f6a10f8745af5f71d82d7f0161cd803a07d26766c5c66cf91c86795a6662",+ "src": "51ccdf73164ee49bcd13080eb33687db795e5012498c8bcfe678ffb82db1fad1"+ },+ "call.outbound.noConversation": {+ "by": "ai",+ "out": "14e36ecbfd7cfe63b05f642bae2375d617da7b4aef42b277eb293aa117746b53",+ "src": "2c2f8ad026580ad074e0c0325f4ab48b46316f53093765f55b7a62a4de0c99eb"+ },+ "call.outbound.openInInbox": {+ "by": "ai",+ "out": "b2b551c7793359d4451451b592c98ad92931097f216dc45a8e033115013ab8ba",+ "src": "c66ebd8edcd7f8a7d0fa9097652b5886d441c8c72ef053e21318b213ef5b79d6"+ },+ "call.outbound.pick": {+ "by": "ai",+ "out": "c7a6aff6b9cd459789e9a84d3dc49d7aeaa57f5470906526cbc9e6b82f4a8779",+ "src": "db15e0011ecb5ec2cae8271e97917c0f23192739a78e8e6981be68e9fd1ef791"+ },+ "call.outbound.ringing": {+ "by": "ai",+ "out": "26f10860fca6898369c7d59cab1388179e82ff40c1d20f4d9be2c490c5318573",+ "src": "7398751e32fd30e00c5cc83971687890c40de9d77d4861eff9399161b668c211"+ },+ "call.outbound.status.ended": {+ "by": "ai",+ "out": "9716c5e4bc3d38c797050ee70b5edecb33aad310d3b3115bb86e7e89abfdc66e",+ "src": "220dcbf4c93efefe89bd0caebd8aab7c836ec5a74477a998659e41c294ae21aa"+ },+ "call.outbound.status.notAnswered": {+ "by": "ai",+ "out": "04d136105b96a3ef8e3ace34a9421bc81706dab580d6eb17d51b6230b54a73ac",+ "src": "1d4ffa2b34782393b95387ce5d785c317d0d1286db7d01b8d2abd4e1c9bba993"+ },+ "call.outbound.title": {+ "by": "ai",+ "out": "c23308495f1e09c0168a6061c9f3c69b803f1e5f17833d3e7a839af6255f9253",+ "src": "85882b729d9cc7b87a26846dfae97edbc974797311035e510d697b88210f0ca2"+ },+ "call.outbound.transcriptStart": {+ "by": "ai",+ "out": "37bfb048665b58a025927d822b4b70a0d8f0a7d760863f27779b093f099d69c6",+ "src": "399d3fc6b57431a0076dd90a5a643df30ced277343b83e41e862b15243ee2a89"+ },"call.recording.label": {"by": "ai","out": "57b7a97b5795ed2683ded516eb4afd18837c795120bb4e3dfbf64d548fe7931d",@@ -38145,6 +38335,11 @@"out": "ae34d045abaf00d5887e2618ece75cb7fb627a052ec8f2d14e176f22df0707f7","src": "090512d93fcc3c0d307d0c5760823992c4670ced80eb4464aa6c97c71b456891"},+ "shell.page.outbound": {+ "by": "human",+ "out": "c23308495f1e09c0168a6061c9f3c69b803f1e5f17833d3e7a839af6255f9253",+ "src": "85882b729d9cc7b87a26846dfae97edbc974797311035e510d697b88210f0ca2"+ },"shell.page.settings": {"by": "ai","out": "f5750a5d7231e1f74f898c956d7d29749a7a893174ef81349d42dd785dcac7a1",diff --git a/packages/i18n/locales/de/call.json b/packages/i18n/locales/de/call.jsonindex 89e871e0..cd2e11fa 100644--- a/packages/i18n/locales/de/call.json+++ b/packages/i18n/locales/de/call.json@@ -139,6 +139,44 @@"missingInfo.callbackNumberTitle": "Keine Rufnummer übermittelt und keine Nummer genannt: Niemand kann zurückrufen","missingInfo.reason": "Kein Anliegen","missingInfo.reasonTitle": "Aus dem Anruf geht nicht hervor, was der Anrufer möchte",+ "outbound.back": "Zurück",+ "outbound.empty.line": "Starten Sie einen mit „Neuer Anruf“: Der Assistent ruft die Nummer an und arbeitet an Ihrem Ziel.",+ "outbound.empty.title": "Noch keine ausgehenden Anrufe",+ "outbound.goal": "Ziel",+ "outbound.guide.failed": "Nicht gesendet",+ "outbound.guide.hint": "Anweisung",+ "outbound.guide.label": "Anweisung an {assistant}",+ "outbound.guide.log": "Gesendete Anweisungen",+ "outbound.guide.note": "Nur {assistant} hört sie. Enter sendet.",+ "outbound.guide.placeholder": "Sagen Sie {assistant}, was als Nächstes zu tun ist …",+ "outbound.guide.send": "Senden",+ "outbound.guide.sending": "Wird gesendet …",+ "outbound.new.assistant": "Assistent",+ "outbound.new.assistantDefault": "{assistant} (Standard)",+ "outbound.new.description": "{assistant} ruft die Nummer an und arbeitet an dem Ziel.",+ "outbound.new.dialling": "{number} wird angerufen …",+ "outbound.new.enterFirstSentence": "Geben Sie ein, was der Assistent zuerst sagt.",+ "outbound.new.enterNumber": "Geben Sie die Nummer ein, die angerufen werden soll.",+ "outbound.new.firstSentence": "Erster Satz",+ "outbound.new.firstSentenceDefault": "Hallo, hier ist {assistant} von {business}.",+ "outbound.new.firstSentenceHint": "Was der Assistent sagt, wenn die Person abnimmt.",+ "outbound.new.goal": "Ziel",+ "outbound.new.goalHint": "Was herausgefunden, weitergegeben oder vereinbart werden soll, und wann der Anruf endet.",+ "outbound.new.goalPlaceholder": "Fragen, ob Montag um 8 Uhr für die Installation des Warmwasserbereiters noch passt.",+ "outbound.new.goalTooShort": "Beschreiben Sie das Ziel in einem ganzen Satz.",+ "outbound.new.start": "Anruf starten",+ "outbound.new.title": "Neuer Anruf",+ "outbound.new.to": "Anzurufende Nummer",+ "outbound.new.toHint": "Mit Ländervorwahl, im selben Land wie Ihre Geschäftsnummer.",+ "outbound.new.tooLong": "Das ist zu lang.",+ "outbound.noConversation": "Bei diesem Anruf hat niemand gesprochen.",+ "outbound.openInInbox": "Im Posteingang öffnen",+ "outbound.pick": "Wählen Sie einen Anruf, um ihn hier zu sehen.",+ "outbound.ringing": "Es klingelt …",+ "outbound.status.ended": "Beendet · {duration}",+ "outbound.status.notAnswered": "Nicht angenommen",+ "outbound.title": "Ausgehende Anrufe",+ "outbound.transcriptStart": "{assistant} hat {number} angerufen","recording.label": "Aufnahme","recording.loadFailed": "Die Aufnahme konnte nicht geladen werden.","recording.notKept": "Aufnahme nicht gespeichert",diff --git a/packages/i18n/locales/de/shell.json b/packages/i18n/locales/de/shell.jsonindex 98550127..609601e1 100644--- a/packages/i18n/locales/de/shell.json+++ b/packages/i18n/locales/de/shell.json@@ -243,6 +243,7 @@"page.contacts": "Kontakte","page.insights": "Statistiken","page.integrations": "Integrationen",+ "page.outbound": "Ausgehende Anrufe","page.settings": "Einstellungen","page.workspace": "Workspace-Einstellungen","pageFailed.text": "Lade die App neu oder geh mit {keys} zurück zum Posteingang.",diff --git a/packages/i18n/locales/en/call.json b/packages/i18n/locales/en/call.jsonindex ecb43e9f..49d93c08 100644--- a/packages/i18n/locales/en/call.json+++ b/packages/i18n/locales/en/call.json@@ -139,6 +139,44 @@"missingInfo.callbackNumberTitle": "No caller ID, and the caller gave no number: nobody can call them back","missingInfo.reason": "No reason","missingInfo.reasonTitle": "Nothing on this call says what the caller wants",+ "outbound.back": "Back",+ "outbound.empty.line": "Start one with New call: the assistant phones the number and works on your goal.",+ "outbound.empty.title": "No outbound calls yet",+ "outbound.goal": "Goal",+ "outbound.guide.failed": "Not sent",+ "outbound.guide.hint": "instruction",+ "outbound.guide.label": "Instruction for {assistant}",+ "outbound.guide.log": "Instructions sent",+ "outbound.guide.note": "Only {assistant} hears it. Enter sends.",+ "outbound.guide.placeholder": "Tell {assistant} what to do next…",+ "outbound.guide.send": "Send",+ "outbound.guide.sending": "Sending…",+ "outbound.new.assistant": "Assistant",+ "outbound.new.assistantDefault": "{assistant} (default)",+ "outbound.new.description": "{assistant} calls the number and works on the goal.",+ "outbound.new.dialling": "Calling {number}…",+ "outbound.new.enterFirstSentence": "Enter the first thing the assistant says.",+ "outbound.new.enterNumber": "Enter the number to call.",+ "outbound.new.firstSentence": "First sentence",+ "outbound.new.firstSentenceDefault": "Hello, this is {assistant} from {business}.",+ "outbound.new.firstSentenceHint": "What the assistant says when the person picks up.",+ "outbound.new.goal": "Goal",+ "outbound.new.goalHint": "What to find out, pass on or arrange, and when to end the call.",+ "outbound.new.goalPlaceholder": "Ask if Monday at 8 AM still works for the water heater install.",+ "outbound.new.goalTooShort": "Describe the goal in a full sentence.",+ "outbound.new.start": "Start call",+ "outbound.new.title": "New call",+ "outbound.new.to": "Number to call",+ "outbound.new.toHint": "With the country code, in the same country as your business number.",+ "outbound.new.tooLong": "This is too long.",+ "outbound.noConversation": "Nobody spoke on this call.",+ "outbound.openInInbox": "Open in the inbox",+ "outbound.pick": "Pick a call to see it here.",+ "outbound.ringing": "Ringing…",+ "outbound.status.ended": "Ended · {duration}",+ "outbound.status.notAnswered": "Not answered",+ "outbound.title": "Outbound calls",+ "outbound.transcriptStart": "{assistant} called {number}","recording.label": "Recording","recording.loadFailed": "The recording could not be loaded.","recording.notKept": "Recording not kept",diff --git a/packages/i18n/locales/en/shell.json b/packages/i18n/locales/en/shell.jsonindex 3214cdc5..d6282d35 100644--- a/packages/i18n/locales/en/shell.json+++ b/packages/i18n/locales/en/shell.json@@ -243,6 +243,7 @@"page.contacts": "Contacts","page.insights": "Insights","page.integrations": "Integrations",+ "page.outbound": "Outbound calls","page.settings": "Settings","page.workspace": "Workspace settings","pageFailed.text": "Reload the app, or go back to the inbox with {keys}.",