@signalcore/ui 0.1.0 → 1.0.0-beta.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 +896 -513
- package/dist/AgentAbout.d.ts +186 -0
- package/dist/AgentAbout.js +1020 -0
- package/dist/AgentAbout.js.map +1 -0
- package/dist/AgentCard.d.ts +49 -0
- package/dist/AgentCard.js +77 -0
- package/dist/AgentCard.js.map +1 -0
- package/dist/AgentChat.d.ts +233 -0
- package/dist/AgentChat.js +1119 -0
- package/dist/AgentChat.js.map +1 -0
- package/dist/AgentSpace.d.ts +112 -0
- package/dist/AgentSpace.js +339 -0
- package/dist/AgentSpace.js.map +1 -0
- package/dist/AgentTasks.d.ts +48 -0
- package/dist/AgentTasks.js +120 -0
- package/dist/AgentTasks.js.map +1 -0
- package/dist/BrowserView.d.ts +52 -0
- package/dist/BrowserView.js +328 -0
- package/dist/BrowserView.js.map +1 -0
- package/dist/FileView.d.ts +63 -0
- package/dist/FileView.js +449 -0
- package/dist/FileView.js.map +1 -0
- package/dist/Modes.d.ts +13 -0
- package/dist/Modes.js +75 -0
- package/dist/Modes.js.map +1 -0
- package/dist/VoiceCall.d.ts +91 -0
- package/dist/VoiceCall.js +302 -0
- package/dist/VoiceCall.js.map +1 -0
- package/dist/about.d.ts +212 -0
- package/dist/about.js +136 -0
- package/dist/about.js.map +1 -0
- package/dist/agentIcons.d.ts +33 -0
- package/dist/agentIcons.js +36 -0
- package/dist/agentIcons.js.map +1 -0
- package/dist/automation/Automation.d.ts +35 -0
- package/dist/automation/Automation.js +268 -0
- package/dist/automation/Automation.js.map +1 -0
- package/dist/automation/RunView.d.ts +25 -0
- package/dist/automation/RunView.js +187 -0
- package/dist/automation/RunView.js.map +1 -0
- package/dist/automation/cron.d.ts +41 -0
- package/dist/automation/cron.js +169 -0
- package/dist/automation/cron.js.map +1 -0
- package/dist/automation/marks.js +121 -0
- package/dist/automation/marks.js.map +1 -0
- package/dist/automation/messages.d.ts +113 -0
- package/dist/automation/messages.js +113 -0
- package/dist/automation/messages.js.map +1 -0
- package/dist/automation/record.d.ts +47 -0
- package/dist/automation/record.js +177 -0
- package/dist/automation/record.js.map +1 -0
- package/dist/automation/types.d.ts +143 -0
- package/dist/automation/when.d.ts +36 -0
- package/dist/automation/when.js +168 -0
- package/dist/automation/when.js.map +1 -0
- package/dist/blocks.d.ts +185 -0
- package/dist/browser.js +292 -0
- package/dist/browser.js.map +1 -0
- package/dist/call.d.ts +89 -0
- package/dist/call.js +218 -0
- package/dist/call.js.map +1 -0
- package/dist/channelParts.js +26 -0
- package/dist/channelParts.js.map +1 -0
- package/dist/classes.js +8 -3
- package/dist/classes.js.map +1 -0
- package/dist/client.d.ts +146 -54
- package/dist/client.js +204 -1
- package/dist/client.js.map +1 -0
- package/dist/conversationFiles.js +46 -0
- package/dist/conversationFiles.js.map +1 -0
- package/dist/credentials.d.ts +45 -0
- package/dist/credentials.js +98 -0
- package/dist/credentials.js.map +1 -0
- package/dist/dev.js +17 -0
- package/dist/dev.js.map +1 -0
- package/dist/es.d.ts +17 -0
- package/dist/es.js +382 -0
- package/dist/es.js.map +1 -0
- package/dist/files.d.ts +21 -0
- package/dist/files.js +214 -0
- package/dist/files.js.map +1 -0
- package/dist/frames.d.ts +115 -0
- package/dist/frames.js +219 -0
- package/dist/frames.js.map +1 -0
- package/dist/icons.js +29 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +63 -60
- package/dist/index.js +59 -45
- package/dist/kit/AudioPlayer.d.ts +20 -0
- package/dist/kit/AudioPlayer.js +116 -0
- package/dist/kit/AudioPlayer.js.map +1 -0
- package/dist/kit/Button.d.ts +29 -0
- package/dist/kit/Button.js +59 -0
- package/dist/kit/Button.js.map +1 -0
- package/dist/kit/Card.d.ts +16 -0
- package/dist/kit/Card.js +36 -0
- package/dist/kit/Card.js.map +1 -0
- package/dist/kit/Chart.js +152 -0
- package/dist/kit/Chart.js.map +1 -0
- package/dist/kit/Choices.d.ts +21 -0
- package/dist/kit/Choices.js +99 -0
- package/dist/kit/Choices.js.map +1 -0
- package/dist/kit/Combobox.d.ts +26 -0
- package/dist/kit/Combobox.js +190 -0
- package/dist/kit/Combobox.js.map +1 -0
- package/dist/kit/DateField.d.ts +17 -0
- package/dist/kit/DateField.js +133 -0
- package/dist/kit/DateField.js.map +1 -0
- package/dist/kit/Field.d.ts +40 -0
- package/dist/kit/Field.js +98 -0
- package/dist/kit/Field.js.map +1 -0
- package/dist/kit/FileField.d.ts +113 -0
- package/dist/kit/FileField.js +341 -0
- package/dist/kit/FileField.js.map +1 -0
- package/dist/kit/FileMark.d.ts +15 -0
- package/dist/kit/FileMark.js +39 -0
- package/dist/kit/FileMark.js.map +1 -0
- package/dist/kit/Inputs.d.ts +59 -0
- package/dist/kit/Inputs.js +205 -0
- package/dist/kit/Inputs.js.map +1 -0
- package/dist/kit/List.d.ts +47 -0
- package/dist/kit/List.js +85 -0
- package/dist/kit/List.js.map +1 -0
- package/dist/kit/Mark.d.ts +30 -0
- package/dist/kit/Mark.js +27 -0
- package/dist/kit/Mark.js.map +1 -0
- package/dist/kit/MarkStack.d.ts +15 -0
- package/dist/kit/MarkStack.js +26 -0
- package/dist/kit/MarkStack.js.map +1 -0
- package/dist/kit/Note.d.ts +11 -0
- package/dist/kit/Note.js +31 -0
- package/dist/kit/Note.js.map +1 -0
- package/dist/kit/Popover.js +90 -0
- package/dist/kit/Popover.js.map +1 -0
- package/dist/kit/RangeField.d.ts +14 -0
- package/dist/kit/RangeField.js +47 -0
- package/dist/kit/RangeField.js.map +1 -0
- package/dist/kit/RatingField.d.ts +14 -0
- package/dist/kit/RatingField.js +50 -0
- package/dist/kit/RatingField.js.map +1 -0
- package/dist/kit/Stat.d.ts +26 -0
- package/dist/kit/Stat.js +46 -0
- package/dist/kit/Stat.js.map +1 -0
- package/dist/kit/Switch.d.ts +14 -0
- package/dist/kit/Switch.js +21 -0
- package/dist/kit/Switch.js.map +1 -0
- package/dist/kit/Tag.d.ts +16 -0
- package/dist/kit/Tag.js +20 -0
- package/dist/kit/Tag.js.map +1 -0
- package/dist/kit/Tile.d.ts +34 -0
- package/dist/kit/Tile.js +52 -0
- package/dist/kit/Tile.js.map +1 -0
- package/dist/kit/TimeField.d.ts +31 -0
- package/dist/kit/TimeField.js +109 -0
- package/dist/kit/TimeField.js.map +1 -0
- package/dist/kit/context.d.ts +22 -0
- package/dist/kit/context.js +46 -0
- package/dist/kit/context.js.map +1 -0
- package/dist/kit/dates.d.ts +14 -0
- package/dist/kit/dates.js +129 -0
- package/dist/kit/dates.js.map +1 -0
- package/dist/kit/messages.d.ts +99 -0
- package/dist/kit/messages.js +66 -0
- package/dist/kit/messages.js.map +1 -0
- package/dist/kit/numbers.d.ts +12 -0
- package/dist/kit/numbers.js +40 -0
- package/dist/kit/numbers.js.map +1 -0
- package/dist/kit/options.d.ts +10 -0
- package/dist/kit/options.js +23 -0
- package/dist/kit/options.js.map +1 -0
- package/dist/kit/uploads.d.ts +42 -0
- package/dist/kit/uploads.js +165 -0
- package/dist/kit/uploads.js.map +1 -0
- package/dist/kit/waveform.js +76 -0
- package/dist/kit/waveform.js.map +1 -0
- package/dist/locale.d.ts +1 -0
- package/dist/locale.js +1 -0
- package/dist/markdown.js +84 -0
- package/dist/markdown.js.map +1 -0
- package/dist/marks.js +217 -0
- package/dist/marks.js.map +1 -0
- package/dist/reveal.js +48 -0
- package/dist/reveal.js.map +1 -0
- package/dist/stepGlyphs.js +62 -0
- package/dist/stepGlyphs.js.map +1 -0
- package/dist/surface/Form.js +264 -0
- package/dist/surface/Form.js.map +1 -0
- package/dist/surface/Markdown.js +42 -0
- package/dist/surface/Markdown.js.map +1 -0
- package/dist/surface/Surface.d.ts +31 -17
- package/dist/surface/Surface.js +480 -57
- package/dist/surface/Surface.js.map +1 -0
- package/dist/surface/scope.d.ts +32 -0
- package/dist/surface/scope.js +23 -0
- package/dist/surface/scope.js.map +1 -0
- package/dist/surface/values.d.ts +44 -0
- package/dist/surface/values.js +237 -0
- package/dist/surface/values.js.map +1 -0
- package/dist/tint.d.ts +10 -0
- package/dist/tint.js +19 -0
- package/dist/tint.js.map +1 -0
- package/dist/types.d.ts +534 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/useAgentFace.d.ts +18 -0
- package/dist/useAgentFace.js +45 -0
- package/dist/useAgentFace.js.map +1 -0
- package/dist/useCall.d.ts +39 -0
- package/dist/useCall.js +273 -0
- package/dist/useCall.js.map +1 -0
- package/dist/useConversation.d.ts +77 -0
- package/dist/useConversation.js +523 -0
- package/dist/useConversation.js.map +1 -0
- package/dist/useDictation.d.ts +17 -0
- package/dist/useDictation.js +68 -0
- package/dist/useDictation.js.map +1 -0
- package/dist/useLive.d.ts +26 -0
- package/dist/useLive.js +88 -0
- package/dist/useLive.js.map +1 -0
- package/dist/usePolled.js +68 -0
- package/dist/usePolled.js.map +1 -0
- package/dist/voice/Orb.d.ts +10 -9
- package/dist/voice/Orb.js +43 -39
- package/dist/voice/Orb.js.map +1 -0
- package/dist/voice/StillOrb.js +33 -0
- package/dist/voice/StillOrb.js.map +1 -0
- package/dist/voice/WebGLOrb.js +98 -0
- package/dist/voice/WebGLOrb.js.map +1 -0
- package/dist/voice/fluidDots.js +161 -0
- package/dist/voice/fluidDots.js.map +1 -0
- package/dist/voice/motion.js +84 -0
- package/dist/voice/motion.js.map +1 -0
- package/dist/voice/orbs.d.ts +32 -0
- package/dist/voice/orbs.js +16 -0
- package/dist/voice/orbs.js.map +1 -0
- package/dist/voice/useReducedMotion.js +16 -16
- package/dist/voice/useReducedMotion.js.map +1 -0
- package/dist/voice/wave.js +116 -0
- package/dist/voice/wave.js.map +1 -0
- package/dist/voice/webgl.js +177 -0
- package/dist/voice/webgl.js.map +1 -0
- package/dist/widget.js +284 -8
- package/package.json +49 -39
- package/src/AgentAbout.tsx +1621 -0
- package/src/AgentCard.tsx +123 -0
- package/src/AgentChat.tsx +1795 -0
- package/src/AgentSpace.tsx +540 -0
- package/src/AgentTasks.tsx +163 -0
- package/src/BrowserView.tsx +442 -0
- package/src/FileView.tsx +620 -0
- package/src/Modes.tsx +112 -0
- package/src/VoiceCall.tsx +411 -0
- package/src/about.ts +355 -0
- package/src/agentIcons.ts +56 -0
- package/src/automation/Automation.tsx +308 -0
- package/src/automation/RunView.tsx +213 -0
- package/src/automation/cron.ts +196 -0
- package/src/automation/marks.tsx +144 -0
- package/src/automation/messages.ts +231 -0
- package/src/automation/record.ts +206 -0
- package/src/automation/types.ts +146 -0
- package/src/automation/when.ts +195 -0
- package/src/blocks.ts +249 -0
- package/src/browser.ts +334 -0
- package/src/call.ts +300 -0
- package/src/channelParts.ts +17 -0
- package/src/classes.ts +10 -0
- package/src/client.ts +397 -0
- package/src/conversationFiles.ts +54 -0
- package/src/credentials.ts +158 -0
- package/src/dev.ts +20 -0
- package/src/es.ts +423 -0
- package/src/files.ts +238 -0
- package/src/frames.ts +291 -0
- package/src/icons.tsx +49 -0
- package/src/index.ts +270 -0
- package/src/kit/AudioPlayer.tsx +129 -0
- package/src/kit/Button.tsx +97 -0
- package/src/kit/Card.tsx +47 -0
- package/src/kit/Chart.tsx +129 -0
- package/src/kit/Choices.tsx +131 -0
- package/src/kit/Combobox.tsx +247 -0
- package/src/kit/DateField.tsx +156 -0
- package/src/kit/Field.tsx +137 -0
- package/src/kit/FileField.tsx +492 -0
- package/src/kit/FileMark.tsx +56 -0
- package/src/kit/Inputs.tsx +250 -0
- package/src/kit/List.tsx +135 -0
- package/src/kit/Mark.tsx +64 -0
- package/src/kit/MarkStack.tsx +29 -0
- package/src/kit/Note.tsx +42 -0
- package/src/kit/Popover.tsx +121 -0
- package/src/kit/RangeField.tsx +53 -0
- package/src/kit/RatingField.tsx +62 -0
- package/src/kit/Stat.tsx +60 -0
- package/src/kit/Switch.tsx +28 -0
- package/src/kit/Tag.tsx +32 -0
- package/src/kit/Tile.tsx +74 -0
- package/src/kit/TimeField.tsx +157 -0
- package/src/kit/context.tsx +246 -0
- package/src/kit/dates.ts +150 -0
- package/src/kit/messages.ts +160 -0
- package/src/kit/numbers.ts +44 -0
- package/src/kit/options.ts +30 -0
- package/src/kit/uploads.ts +244 -0
- package/src/kit/waveform.ts +84 -0
- package/src/locale.ts +6 -0
- package/src/markdown.ts +69 -0
- package/src/marks.tsx +328 -0
- package/src/reveal.ts +52 -0
- package/src/stepGlyphs.ts +83 -0
- package/src/styles.css +6961 -0
- package/src/surface/Form.tsx +299 -0
- package/src/surface/Markdown.tsx +55 -0
- package/src/surface/Surface.tsx +605 -0
- package/src/surface/scope.ts +82 -0
- package/src/surface/values.ts +361 -0
- package/src/tint.ts +14 -0
- package/src/types.ts +596 -0
- package/src/useAgentFace.ts +47 -0
- package/src/useCall.ts +292 -0
- package/src/useConversation.ts +627 -0
- package/src/useDictation.ts +83 -0
- package/src/useLive.ts +115 -0
- package/src/usePolled.ts +60 -0
- package/src/voice/Orb.tsx +45 -0
- package/src/voice/StillOrb.tsx +29 -0
- package/src/voice/WebGLOrb.tsx +98 -0
- package/src/voice/fluidDots.tsx +171 -0
- package/src/voice/motion.ts +112 -0
- package/src/voice/orbs.ts +39 -0
- package/src/voice/useReducedMotion.ts +24 -0
- package/src/voice/wave.tsx +129 -0
- package/src/voice/webgl.ts +209 -0
- package/src/widget/css.d.ts +5 -0
- package/src/widget/element.tsx +535 -0
- package/src/widget/index.ts +10 -0
- package/src/widget/mount.ts +27 -0
- package/src/widget/widget.css +253 -0
- package/dist/SignalcoreProvider.d.ts +0 -113
- package/dist/SignalcoreProvider.js +0 -84
- package/dist/automations/AppMarks.d.ts +0 -11
- package/dist/automations/AppMarks.js +0 -18
- package/dist/automations/AutomationCard.d.ts +0 -27
- package/dist/automations/AutomationCard.js +0 -53
- package/dist/automations/AutomationsWindow.d.ts +0 -38
- package/dist/automations/AutomationsWindow.js +0 -57
- package/dist/automations/Card.d.ts +0 -46
- package/dist/automations/Card.js +0 -45
- package/dist/automations/ScheduleMarks.d.ts +0 -13
- package/dist/automations/ScheduleMarks.js +0 -24
- package/dist/automations/presentationIcons.d.ts +0 -7
- package/dist/automations/presentationIcons.js +0 -67
- package/dist/automations/schedule.d.ts +0 -25
- package/dist/automations/schedule.js +0 -59
- package/dist/automations/time.d.ts +0 -3
- package/dist/automations/time.js +0 -25
- package/dist/browser/BrowserView.d.ts +0 -43
- package/dist/browser/BrowserView.js +0 -94
- package/dist/browser/room.d.ts +0 -21
- package/dist/browser/room.js +0 -33
- package/dist/browser/useBrowserSession.d.ts +0 -17
- package/dist/browser/useBrowserSession.js +0 -67
- package/dist/builder/BuilderChat.d.ts +0 -32
- package/dist/builder/BuilderChat.js +0 -41
- package/dist/builder/BuilderTranscript.d.ts +0 -49
- package/dist/builder/BuilderTranscript.js +0 -62
- package/dist/builder/StatusLine.d.ts +0 -8
- package/dist/builder/StatusLine.js +0 -17
- package/dist/builder/answer.d.ts +0 -7
- package/dist/builder/answer.js +0 -8
- package/dist/builder/blocks.d.ts +0 -31
- package/dist/builder/blocks.js +0 -74
- package/dist/builder/items.d.ts +0 -15
- package/dist/builder/items.js +0 -21
- package/dist/builder/steps.d.ts +0 -20
- package/dist/builder/steps.js +0 -120
- package/dist/builder/time.d.ts +0 -4
- package/dist/builder/time.js +0 -24
- package/dist/builder/useBuildSession.d.ts +0 -36
- package/dist/builder/useBuildSession.js +0 -130
- package/dist/builder/workingOn.d.ts +0 -7
- package/dist/builder/workingOn.js +0 -15
- package/dist/chat/AgentChat.d.ts +0 -37
- package/dist/chat/AgentChat.js +0 -21
- package/dist/chat/ChatView.d.ts +0 -25
- package/dist/chat/ChatView.js +0 -34
- package/dist/chat/Composer.d.ts +0 -20
- package/dist/chat/Composer.js +0 -22
- package/dist/chat/MessageRow.d.ts +0 -22
- package/dist/chat/MessageRow.js +0 -32
- package/dist/chat/arrival.d.ts +0 -15
- package/dist/chat/arrival.js +0 -25
- package/dist/chat/history.d.ts +0 -24
- package/dist/chat/history.js +0 -45
- package/dist/chat/moments.d.ts +0 -25
- package/dist/chat/moments.js +0 -72
- package/dist/chat/types.d.ts +0 -12
- package/dist/chat/types.js +0 -1
- package/dist/chat/useComposer.d.ts +0 -46
- package/dist/chat/useComposer.js +0 -62
- package/dist/chat/useConversation.d.ts +0 -35
- package/dist/chat/useConversation.js +0 -71
- package/dist/chat/useStickToBottom.d.ts +0 -9
- package/dist/chat/useStickToBottom.js +0 -33
- package/dist/chat/useTurns.d.ts +0 -49
- package/dist/chat/useTurns.js +0 -111
- package/dist/classes.d.ts +0 -2
- package/dist/development.d.ts +0 -5
- package/dist/development.js +0 -8
- package/dist/flow/FlowWindow.d.ts +0 -42
- package/dist/flow/FlowWindow.js +0 -126
- package/dist/flow/index.d.ts +0 -16
- package/dist/flow/index.js +0 -16
- package/dist/flow/kinds.d.ts +0 -23
- package/dist/flow/kinds.js +0 -48
- package/dist/flow/map.d.ts +0 -44
- package/dist/flow/map.js +0 -225
- package/dist/flow/nodePaths.d.ts +0 -7
- package/dist/flow/nodePaths.js +0 -17
- package/dist/flow/relations.d.ts +0 -42
- package/dist/flow/relations.js +0 -174
- package/dist/host.d.ts +0 -124
- package/dist/host.js +0 -1
- package/dist/live/LiveView.d.ts +0 -28
- package/dist/live/LiveView.js +0 -55
- package/dist/live/capture.d.ts +0 -20
- package/dist/live/capture.js +0 -100
- package/dist/live/follow.d.ts +0 -26
- package/dist/live/follow.js +0 -72
- package/dist/live/paint.d.ts +0 -13
- package/dist/live/paint.js +0 -77
- package/dist/live/useLiveStream.d.ts +0 -16
- package/dist/live/useLiveStream.js +0 -57
- package/dist/look.d.ts +0 -33
- package/dist/look.js +0 -241
- package/dist/messages/en.d.ts +0 -3
- package/dist/messages/en.js +0 -251
- package/dist/messages/es.d.ts +0 -3
- package/dist/messages/es.js +0 -251
- package/dist/messages/index.d.ts +0 -16
- package/dist/messages/index.js +0 -33
- package/dist/messages/types.d.ts +0 -246
- package/dist/messages/types.js +0 -1
- package/dist/parts/Button.d.ts +0 -18
- package/dist/parts/Button.js +0 -17
- package/dist/parts/Icon.d.ts +0 -39
- package/dist/parts/Icon.js +0 -37
- package/dist/parts/Input.d.ts +0 -6
- package/dist/parts/Input.js +0 -11
- package/dist/parts/Spinner.d.ts +0 -2
- package/dist/parts/Spinner.js +0 -7
- package/dist/patterns.d.ts +0 -15
- package/dist/patterns.js +0 -5
- package/dist/presets.d.ts +0 -82
- package/dist/presets.js +0 -81
- package/dist/primitives.d.ts +0 -22
- package/dist/primitives.js +0 -58
- package/dist/request/RequestCard.d.ts +0 -34
- package/dist/request/RequestCard.js +0 -101
- package/dist/request/approval/ApprovalPreview.d.ts +0 -5
- package/dist/request/approval/ApprovalPreview.js +0 -27
- package/dist/request/approval/shapes.d.ts +0 -32
- package/dist/request/approval/shapes.js +0 -68
- package/dist/request/apps.d.ts +0 -11
- package/dist/request/apps.js +0 -27
- package/dist/request/cards.d.ts +0 -12
- package/dist/request/cards.js +0 -24
- package/dist/request/deliver.d.ts +0 -12
- package/dist/request/deliver.js +0 -21
- package/dist/request/handOver.d.ts +0 -18
- package/dist/request/handOver.js +0 -33
- package/dist/request/kinds/Approval.d.ts +0 -3
- package/dist/request/kinds/Approval.js +0 -9
- package/dist/request/kinds/Choice.d.ts +0 -3
- package/dist/request/kinds/Choice.js +0 -8
- package/dist/request/kinds/Connect.d.ts +0 -9
- package/dist/request/kinds/Connect.js +0 -119
- package/dist/request/kinds/FreeText.d.ts +0 -3
- package/dist/request/kinds/FreeText.js +0 -20
- package/dist/request/kinds/HandOver.d.ts +0 -13
- package/dist/request/kinds/HandOver.js +0 -20
- package/dist/request/kinds/Secret.d.ts +0 -7
- package/dist/request/kinds/Secret.js +0 -49
- package/dist/request/kinds/Upload.d.ts +0 -6
- package/dist/request/kinds/Upload.js +0 -47
- package/dist/request/types.d.ts +0 -83
- package/dist/request/types.js +0 -1
- package/dist/safeUrl.d.ts +0 -6
- package/dist/safeUrl.js +0 -8
- package/dist/stream/builder.d.ts +0 -176
- package/dist/stream/builder.js +0 -202
- package/dist/stream/reduce.d.ts +0 -51
- package/dist/stream/reduce.js +0 -58
- package/dist/stream/untilAborted.d.ts +0 -7
- package/dist/stream/untilAborted.js +0 -32
- package/dist/stream/useRunStream.d.ts +0 -26
- package/dist/stream/useRunStream.js +0 -137
- package/dist/styles.css +0 -2318
- package/dist/surface/HostNode.d.ts +0 -14
- package/dist/surface/HostNode.js +0 -30
- package/dist/surface/Node.d.ts +0 -7
- package/dist/surface/Node.js +0 -49
- package/dist/surface/SurfaceBoundary.d.ts +0 -26
- package/dist/surface/SurfaceBoundary.js +0 -20
- package/dist/surface/bindings.d.ts +0 -14
- package/dist/surface/bindings.js +0 -37
- package/dist/surface/check.d.ts +0 -27
- package/dist/surface/check.js +0 -102
- package/dist/surface/format.d.ts +0 -10
- package/dist/surface/format.js +0 -32
- package/dist/surface/hosts.d.ts +0 -6
- package/dist/surface/hosts.js +0 -11
- package/dist/surface/scene.d.ts +0 -21
- package/dist/surface/scene.js +0 -8
- package/dist/surface/templates/Browser.d.ts +0 -6
- package/dist/surface/templates/Browser.js +0 -11
- package/dist/surface/templates/Chart.d.ts +0 -6
- package/dist/surface/templates/Chart.js +0 -13
- package/dist/surface/templates/Choices.d.ts +0 -3
- package/dist/surface/templates/Choices.js +0 -12
- package/dist/surface/templates/Form.d.ts +0 -3
- package/dist/surface/templates/Form.js +0 -44
- package/dist/surface/templates/KeyValue.d.ts +0 -3
- package/dist/surface/templates/KeyValue.js +0 -7
- package/dist/surface/templates/Layout.d.ts +0 -5
- package/dist/surface/templates/Layout.js +0 -16
- package/dist/surface/templates/Live.d.ts +0 -6
- package/dist/surface/templates/Live.js +0 -9
- package/dist/surface/templates/Media.d.ts +0 -5
- package/dist/surface/templates/Media.js +0 -13
- package/dist/surface/templates/Slots.d.ts +0 -3
- package/dist/surface/templates/Slots.js +0 -19
- package/dist/surface/templates/Table.d.ts +0 -3
- package/dist/surface/templates/Table.js +0 -12
- package/dist/surface/templates/Text.d.ts +0 -4
- package/dist/surface/templates/Text.js +0 -15
- package/dist/surface/templates/index.d.ts +0 -7
- package/dist/surface/templates/index.js +0 -32
- package/dist/surface/types.d.ts +0 -68
- package/dist/surface/types.js +0 -6
- package/dist/theme.d.ts +0 -62
- package/dist/theme.js +0 -9
- package/dist/useTokens.d.ts +0 -7
- package/dist/useTokens.js +0 -41
- package/dist/voice/VoiceWindow.d.ts +0 -18
- package/dist/voice/VoiceWindow.js +0 -35
- package/dist/voice/index.d.ts +0 -13
- package/dist/voice/index.js +0 -12
- package/dist/voice/meter.d.ts +0 -16
- package/dist/voice/meter.js +0 -52
- package/dist/voice/orbColors.d.ts +0 -16
- package/dist/voice/orbColors.js +0 -75
- package/dist/voice/pushable.d.ts +0 -16
- package/dist/voice/pushable.js +0 -56
- package/dist/voice/useDictation.d.ts +0 -24
- package/dist/voice/useDictation.js +0 -60
- package/dist/voice/useReducedMotion.d.ts +0 -5
- package/dist/voice/useVoice.d.ts +0 -70
- package/dist/voice/useVoice.js +0 -197
- package/dist/voice/useVoicePrimitives.d.ts +0 -7
- package/dist/voice/useVoicePrimitives.js +0 -11
- package/dist/voice/voice.d.ts +0 -55
- package/dist/voice/voice.js +0 -9
- package/dist/voice/webSpeech.d.ts +0 -33
- package/dist/voice/webSpeech.js +0 -258
- package/dist/widget.js.map +0 -1
- package/dist/windows/AgentSpace.d.ts +0 -78
- package/dist/windows/AgentSpace.js +0 -135
- package/dist/windows/Captions.d.ts +0 -13
- package/dist/windows/Captions.js +0 -22
- package/dist/windows/Dock.d.ts +0 -37
- package/dist/windows/Dock.js +0 -22
- package/dist/windows/Journal.d.ts +0 -15
- package/dist/windows/Journal.js +0 -19
- package/dist/windows/KindMark.d.ts +0 -7
- package/dist/windows/KindMark.js +0 -31
- package/dist/windows/Pending.d.ts +0 -8
- package/dist/windows/Pending.js +0 -17
- package/dist/windows/Stage.d.ts +0 -18
- package/dist/windows/Stage.js +0 -21
- package/dist/windows/StatusLabel.d.ts +0 -9
- package/dist/windows/StatusLabel.js +0 -7
- package/dist/windows/Strip.d.ts +0 -17
- package/dist/windows/Strip.js +0 -42
- package/dist/windows/SurfaceWindow.d.ts +0 -20
- package/dist/windows/SurfaceWindow.js +0 -12
- package/dist/windows/WindowFrame.d.ts +0 -23
- package/dist/windows/WindowFrame.js +0 -22
- package/dist/windows/hearing.d.ts +0 -11
- package/dist/windows/hearing.js +0 -26
- package/dist/windows/kinds.d.ts +0 -47
- package/dist/windows/kinds.js +0 -28
- package/dist/windows/reduce.d.ts +0 -98
- package/dist/windows/reduce.js +0 -151
- package/dist/windows/registry.d.ts +0 -18
- package/dist/windows/registry.js +0 -61
- package/dist/windows/reveal.d.ts +0 -9
- package/dist/windows/reveal.js +0 -6
- package/dist/windows/space.d.ts +0 -21
- package/dist/windows/space.js +0 -6
- package/dist/windows/status.d.ts +0 -11
- package/dist/windows/status.js +0 -30
- package/dist/windows/types.d.ts +0 -15
- package/dist/windows/types.js +0 -1
- package/dist/windows/useLoaded.d.ts +0 -44
- package/dist/windows/useLoaded.js +0 -58
- package/dist/windows/useUnread.d.ts +0 -7
- package/dist/windows/useUnread.js +0 -21
- package/dist/windows/useWindows.d.ts +0 -70
- package/dist/windows/useWindows.js +0 -60
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { ChannelKind } from "./about.js";
|
|
2
|
+
import { Surface } from "./blocks.js";
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
/** The channel a conversation is on, as a list draws it. */
|
|
5
|
+
export interface ChannelGlance {
|
|
6
|
+
id: string;
|
|
7
|
+
kind: ChannelKind;
|
|
8
|
+
/** The number, the @username. */
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
/** The person a conversation on a channel is with, or a person who signed in to the host's app. */
|
|
12
|
+
export interface ContactGlance {
|
|
13
|
+
id: string;
|
|
14
|
+
/** As they show it on the channel; null when it doesn't say. */
|
|
15
|
+
name: string | null;
|
|
16
|
+
/** Where they are on it: the number, the Instagram id; their account in the host's app. */
|
|
17
|
+
address: string;
|
|
18
|
+
/** The owner marked them: the agent doesn't answer them; left out by an API from before. */
|
|
19
|
+
muted?: boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Who answers a conversation: its agent; a person of the business (the agent paused in it: it
|
|
23
|
+
* handed it over, or one of them wrote in it); or nobody (it is ignored: what comes is kept, never
|
|
24
|
+
* answered).
|
|
25
|
+
*/
|
|
26
|
+
export type Holder = "agent" | "person" | "nobody";
|
|
27
|
+
/** A change of who answers a conversation: to whom, why, who changed it and when. */
|
|
28
|
+
export interface Handover {
|
|
29
|
+
holder: Holder;
|
|
30
|
+
/** Why, in the words of whoever changed it; "" when they said nothing. */
|
|
31
|
+
reason: string;
|
|
32
|
+
/**
|
|
33
|
+
* `owner` (a person of the business), `agent` (its `escalate`), `platform`, or an automation by
|
|
34
|
+
* its file's name.
|
|
35
|
+
*/
|
|
36
|
+
by: string;
|
|
37
|
+
/** The automation's title, when one changed it. */
|
|
38
|
+
title: string | null;
|
|
39
|
+
at: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What was decided of a person's message on a channel before the agent answered it: `deciding`
|
|
43
|
+
* while the automations that decide go; then the agent answers it (`answer`), lets it pass this
|
|
44
|
+
* time (`skip`), or the conversation goes to a person (`hold`) or to nobody (`ignore`).
|
|
45
|
+
*/
|
|
46
|
+
export interface Decision {
|
|
47
|
+
kind: "deciding" | "answer" | "skip" | "hold" | "ignore";
|
|
48
|
+
/** Why, in the owner's words; null when it says nothing. */
|
|
49
|
+
reason: string | null;
|
|
50
|
+
/** The automation that decided, by its file's name; null when the platform did (a filter, the hours). */
|
|
51
|
+
automation: string | null;
|
|
52
|
+
/** Its title. */
|
|
53
|
+
title: string | null;
|
|
54
|
+
/** Its run that decided. */
|
|
55
|
+
run_id: string | null;
|
|
56
|
+
}
|
|
57
|
+
/** A conversation between a person and one agent. */
|
|
58
|
+
export interface Conversation {
|
|
59
|
+
id: string;
|
|
60
|
+
agent_id: string;
|
|
61
|
+
/** A turn stopped, waiting for the person to answer on a surface. */
|
|
62
|
+
pending: boolean;
|
|
63
|
+
/** Who answers it now: its agent, a person of the business, or nobody. */
|
|
64
|
+
handled_by: Holder;
|
|
65
|
+
/** Its last change of who answers it; null when it never changed, left out by an older API. */
|
|
66
|
+
handover?: Handover | null | undefined;
|
|
67
|
+
/** The owner trying the agent out: no customer sees it, and it is never the agent's activity. */
|
|
68
|
+
test: boolean;
|
|
69
|
+
created_at: string;
|
|
70
|
+
/** Its title in a list: what a person first said in it; null while they've said nothing. */
|
|
71
|
+
title: string | null;
|
|
72
|
+
/** On a channel: which, and the person; null (or left out by an older API) elsewhere. */
|
|
73
|
+
channel?: ChannelGlance | null | undefined;
|
|
74
|
+
contact?: ContactGlance | null | undefined;
|
|
75
|
+
/** On a channel: when the agent's reply is due, once the person has been quiet a moment. */
|
|
76
|
+
reply_due_at?: string | null | undefined;
|
|
77
|
+
/** On a channel: when the person last wrote (WhatsApp's 24 h window counts from it). */
|
|
78
|
+
last_inbound_at?: string | null | undefined;
|
|
79
|
+
/** The call it is, when it is one; null elsewhere, and left out by an API from before calls. */
|
|
80
|
+
call?: CallGlance | null | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Who it is with, when a person's token or a publishable key started it: a person of the
|
|
83
|
+
* host's app (`host_person`, its `contact` then) or the widget's visitor.
|
|
84
|
+
*/
|
|
85
|
+
person?: ConversationPerson | null | undefined;
|
|
86
|
+
}
|
|
87
|
+
/** Who a person's token or a publishable key started a conversation for. */
|
|
88
|
+
export interface ConversationPerson {
|
|
89
|
+
kind: "host_person" | "visitor" | "contact" | "owner";
|
|
90
|
+
/** The host's id for them, the visitor's id. */
|
|
91
|
+
external_id: string;
|
|
92
|
+
name: string | null;
|
|
93
|
+
email: string | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Why a call ended, as the API keeps it: the caller hung up, the agent said goodbye, it reached
|
|
97
|
+
* its longest time, it failed, its end never came, or it was never taken.
|
|
98
|
+
*/
|
|
99
|
+
export type CallReason = "caller" | "agent" | "max_duration" | "error" | "lost" | "missed";
|
|
100
|
+
/**
|
|
101
|
+
* The call a conversation is (v3/VOICE.md): the owner's in the browser or a phone call, when the
|
|
102
|
+
* agent took it and when it ended, why and how long.
|
|
103
|
+
*/
|
|
104
|
+
export interface CallGlance {
|
|
105
|
+
id: string;
|
|
106
|
+
kind: "browser" | "phone";
|
|
107
|
+
/** Null while it is on. */
|
|
108
|
+
reason: CallReason | null;
|
|
109
|
+
/** From when the agent took it to when it ended; null while it is on. */
|
|
110
|
+
seconds: number | null;
|
|
111
|
+
started_at: string | null;
|
|
112
|
+
ended_at: string | null;
|
|
113
|
+
/** Whether it was recorded, to play from the conversation; left out by an older API. */
|
|
114
|
+
recording?: boolean | undefined;
|
|
115
|
+
}
|
|
116
|
+
/** Who said a message on a channel: the person, the agent, or a person of the business. */
|
|
117
|
+
export type Author = "contact" | "agent" | "operator";
|
|
118
|
+
/** Where a message that goes out on a channel got to: it only moves forward, and `failed` wins. */
|
|
119
|
+
export type Delivery = "queued" | "sent" | "delivered" | "read" | "failed";
|
|
120
|
+
/** How a channel's account stands, as its provider last said. */
|
|
121
|
+
export type ChannelStatus = "pending" | "active" | "error" | "disconnected";
|
|
122
|
+
/** A day of the week, as a channel's hours name it. */
|
|
123
|
+
export type Weekday = "mon" | "tue" | "wed" | "thu" | "fri" | "sat" | "sun";
|
|
124
|
+
/** A stretch of a day, from one time to a later one ("HH:MM"). */
|
|
125
|
+
export interface HoursSpan {
|
|
126
|
+
start: string;
|
|
127
|
+
end: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A week of hours in the agent's time zone: each day's stretches, in order and apart, four at
|
|
131
|
+
* most; a day left out, or empty, is closed.
|
|
132
|
+
*/
|
|
133
|
+
export type WeekHours = Partial<Record<Weekday, HoursSpan[]>>;
|
|
134
|
+
/**
|
|
135
|
+
* How the agent behaves on a channel, the same for every text channel (each shows only what its
|
|
136
|
+
* medium can do): when it answers, how what it says goes out, and what it is told there.
|
|
137
|
+
*/
|
|
138
|
+
export interface ChannelSettings {
|
|
139
|
+
/** It answers on this channel; off, everything goes to the inbox for a person. */
|
|
140
|
+
answers: boolean;
|
|
141
|
+
/** Who it answers, in the owner's words; null: everyone. */
|
|
142
|
+
filter: string | null;
|
|
143
|
+
/** Words that, said in a message, have it answer without weighing the filter. */
|
|
144
|
+
filter_keywords: string[];
|
|
145
|
+
/** The week it keeps; null: it answers at any hour. */
|
|
146
|
+
hours: WeekHours | null;
|
|
147
|
+
/** It answers inside the hours, or outside them (the business's people take the hours). */
|
|
148
|
+
answers_when: "in_hours" | "out_of_hours";
|
|
149
|
+
/** Sent once per conversation while the hours keep it from answering; null: nothing. */
|
|
150
|
+
away_message: string | null;
|
|
151
|
+
/** WhatsApp: it answers in group chats too. */
|
|
152
|
+
groups: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* A conversation a person took over goes back to the agent after this long without them; null:
|
|
155
|
+
* it stays theirs until they give it back.
|
|
156
|
+
*/
|
|
157
|
+
auto_release_after_h: number | null;
|
|
158
|
+
/** What it is told on this channel only, besides its own instructions. */
|
|
159
|
+
instructions: string | null;
|
|
160
|
+
/** The quiet period after the person's last message before the agent answers them all. */
|
|
161
|
+
reply_delay_s: number;
|
|
162
|
+
/** A long answer goes in up to three messages as a person writes them, its words as they are. */
|
|
163
|
+
split: boolean;
|
|
164
|
+
/** The channel shows the agent writing between the parts of an answer, where it can. */
|
|
165
|
+
typing: boolean;
|
|
166
|
+
/** WhatsApp, past 24 h since the person last wrote: the template that carries the answer. */
|
|
167
|
+
window_template: string | null;
|
|
168
|
+
/**
|
|
169
|
+
* WhatsApp: the answer as a voice note in the agent's voice, its words kept as what it said;
|
|
170
|
+
* never, when the person's last message was a voice note, or always.
|
|
171
|
+
*/
|
|
172
|
+
voice_replies: "never" | "when_voice" | "always";
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* An account on a provider (a WhatsApp number, an Instagram account, an SMS number) and the agent
|
|
176
|
+
* that answers it (`GET /channels?agent=`).
|
|
177
|
+
*/
|
|
178
|
+
export interface Channel {
|
|
179
|
+
id: string;
|
|
180
|
+
agent_id: string;
|
|
181
|
+
kind: "whatsapp" | "instagram" | "sms" | "phone" | "web";
|
|
182
|
+
/** meta · twilio · livekit · signalcore (the widget) */
|
|
183
|
+
provider: string;
|
|
184
|
+
/** The number, the @username. */
|
|
185
|
+
name: string;
|
|
186
|
+
/** The provider's id for the account. */
|
|
187
|
+
external_id: string;
|
|
188
|
+
/** A phone number's: where its provider sends its calls (a SIP address); null for others. */
|
|
189
|
+
address: string | null;
|
|
190
|
+
/** A phone number's: whether the agent calls out from it (it has the number's SIP login). */
|
|
191
|
+
outbound: boolean;
|
|
192
|
+
status: ChannelStatus;
|
|
193
|
+
/** The provider's word on its status, or what went wrong; null when it said nothing. */
|
|
194
|
+
detail: string | null;
|
|
195
|
+
settings: ChannelSettings;
|
|
196
|
+
/** A web channel's: the widget's publishable key, its sites and its look; null for others. */
|
|
197
|
+
web: ChannelWeb | null;
|
|
198
|
+
created_at: string;
|
|
199
|
+
}
|
|
200
|
+
/** The widget a web channel is: the key its line carries, the sites it loads on, its look. */
|
|
201
|
+
export interface ChannelWeb {
|
|
202
|
+
key: string;
|
|
203
|
+
origins: string[];
|
|
204
|
+
appearance: WidgetLook;
|
|
205
|
+
}
|
|
206
|
+
export type StepState = "running" | "waiting" | "done" | "failed";
|
|
207
|
+
/**
|
|
208
|
+
* Who gives the yes an action waits for: the person on the screen (the turn stopped for it), or
|
|
209
|
+
* the business (the turn went on; its people allow or decline it from the app, the inbox).
|
|
210
|
+
*/
|
|
211
|
+
export type Decides = "person" | "business";
|
|
212
|
+
/** An action the platform will not run until it is allowed: what, with what input, by whom. */
|
|
213
|
+
export interface Request {
|
|
214
|
+
action: string;
|
|
215
|
+
input: Record<string, unknown>;
|
|
216
|
+
/** The person's when left out (an API from before it). */
|
|
217
|
+
decides?: Decides | undefined;
|
|
218
|
+
}
|
|
219
|
+
/** An action a reply called: what, how it went, and what it drew. */
|
|
220
|
+
export interface Step {
|
|
221
|
+
id: string;
|
|
222
|
+
action: string;
|
|
223
|
+
state: StepState;
|
|
224
|
+
output: string | null;
|
|
225
|
+
surface: Surface | null;
|
|
226
|
+
/**
|
|
227
|
+
* The turn stopped on it: the person's answer on its surface carries it on. Never a host's tool
|
|
228
|
+
* the page runs, nor a yes the business gives.
|
|
229
|
+
*/
|
|
230
|
+
awaits: boolean;
|
|
231
|
+
/** Set while it waits to be allowed: by the person (the turn stopped), or by the business. */
|
|
232
|
+
request: Request | null;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* What a person did on a surface: `surface` is its id, `name` the block's action, `data` what it
|
|
236
|
+
* carries (a pick, a form's values), `label` the words the app shows for it.
|
|
237
|
+
*/
|
|
238
|
+
export interface Action {
|
|
239
|
+
surface: string;
|
|
240
|
+
name: string;
|
|
241
|
+
data: Record<string, unknown>;
|
|
242
|
+
label: string;
|
|
243
|
+
}
|
|
244
|
+
/** What is read of a message: who said it, its text, what it did on a surface, its steps. */
|
|
245
|
+
export interface Message {
|
|
246
|
+
id: string;
|
|
247
|
+
role: "user" | "assistant";
|
|
248
|
+
text: string;
|
|
249
|
+
/** When the message came from a surface; `text` is then its label. */
|
|
250
|
+
action: Action | null;
|
|
251
|
+
steps: Step[];
|
|
252
|
+
/** The files the person sent with it; an API from before files leaves it out. */
|
|
253
|
+
files?: Attachment[] | undefined;
|
|
254
|
+
/** On a channel, who said it; null elsewhere. A person of the business's is `assistant`. */
|
|
255
|
+
author?: Author | null | undefined;
|
|
256
|
+
/** On a channel, where what goes out got to, and why it failed when it did. */
|
|
257
|
+
delivery?: Delivery | null | undefined;
|
|
258
|
+
delivery_error?: string | null | undefined;
|
|
259
|
+
/** Gone out on a channel in several parts: the words of each, in order; null as one. */
|
|
260
|
+
pieces?: string[] | null | undefined;
|
|
261
|
+
/** Going out on a channel: how many of its parts went so far; null for what doesn't go out. */
|
|
262
|
+
sent_parts?: number | null | undefined;
|
|
263
|
+
/**
|
|
264
|
+
* On a channel, a voice note, the person's or the agent's: its file, played with `text` (what
|
|
265
|
+
* was said) under it; null otherwise, and left out by an API from before voice notes.
|
|
266
|
+
*/
|
|
267
|
+
voice?: Attachment | null | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* On a call, a person's message: what they heard of the agent's last words before saying it,
|
|
270
|
+
* when that isn't what was stored (a reply or the greeting they cut short; "" for nothing of
|
|
271
|
+
* it); null otherwise, and left out by an API from before calls.
|
|
272
|
+
*/
|
|
273
|
+
heard?: string | null | undefined;
|
|
274
|
+
/** On a channel, a person's message: what was decided of it; null otherwise. */
|
|
275
|
+
decision?: Decision | null | undefined;
|
|
276
|
+
created_at: string;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* A call with an agent from the browser (the owner's test, `POST /agents/{id}/voice/token`; anyone
|
|
280
|
+
* who may talk to it, a person's as theirs, `POST /agents/{id}/calls`): LiveKit's address, a token
|
|
281
|
+
* to join the call's room (for 10 minutes), and the call and its own conversation, made with it,
|
|
282
|
+
* whose live socket shows what is said.
|
|
283
|
+
*/
|
|
284
|
+
export interface CallToken {
|
|
285
|
+
url: string;
|
|
286
|
+
token: string;
|
|
287
|
+
room: string;
|
|
288
|
+
call_id: string;
|
|
289
|
+
conversation_id: string;
|
|
290
|
+
}
|
|
291
|
+
/** A file that arrived in a conversation, as a message carries it. */
|
|
292
|
+
export interface Attachment {
|
|
293
|
+
id: string;
|
|
294
|
+
name: string;
|
|
295
|
+
media_type: string;
|
|
296
|
+
size: number;
|
|
297
|
+
}
|
|
298
|
+
/** A conversation's file, as the API stores it (`POST /conversations/{id}/files`). */
|
|
299
|
+
export interface ConversationFile extends Attachment {
|
|
300
|
+
conversation_id: string;
|
|
301
|
+
created_at: string;
|
|
302
|
+
}
|
|
303
|
+
/** A conversation with its messages, in the order they were said. */
|
|
304
|
+
export interface ConversationDetail extends Conversation {
|
|
305
|
+
messages: Message[];
|
|
306
|
+
/** Every change of who answers it, in order; left out by an API from before them. */
|
|
307
|
+
handovers?: Handover[] | undefined;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* How far a searchable file's index is: its passages being made, made, or failed; what to know
|
|
311
|
+
* of it (why it failed, what of it can't be searched); its pages without text the model read.
|
|
312
|
+
*/
|
|
313
|
+
export interface FileIndex {
|
|
314
|
+
state: "indexing" | "ready" | "failed";
|
|
315
|
+
detail: string | null;
|
|
316
|
+
scanned: number;
|
|
317
|
+
}
|
|
318
|
+
/** A file kept under a name: the organization's, or an agent's own. */
|
|
319
|
+
export interface StoredFile {
|
|
320
|
+
id: string;
|
|
321
|
+
path: string;
|
|
322
|
+
media_type: string;
|
|
323
|
+
size: number;
|
|
324
|
+
/** Text, Markdown, JSON, YAML or PDF, read by `search_files`; anything else is only kept. */
|
|
325
|
+
searchable: boolean;
|
|
326
|
+
/** Its index, while it is searchable; left out by an API from before it. */
|
|
327
|
+
index?: FileIndex | null | undefined;
|
|
328
|
+
created_at: string;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Where a file is, for what reads any of them: the organization's or an agent's own by its path,
|
|
332
|
+
* a conversation's by its id.
|
|
333
|
+
*/
|
|
334
|
+
export type FileAt = {
|
|
335
|
+
path: string;
|
|
336
|
+
} | {
|
|
337
|
+
agentId: string;
|
|
338
|
+
path: string;
|
|
339
|
+
} | {
|
|
340
|
+
conversationId: string;
|
|
341
|
+
fileId: string;
|
|
342
|
+
};
|
|
343
|
+
/** A PDF: the viewer draws the bytes it fetches. Null pages when they can't be counted. */
|
|
344
|
+
export interface PdfPreview {
|
|
345
|
+
kind: "pdf";
|
|
346
|
+
pages: number | null;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* One sheet: its first row with anything in it as its columns (null for an empty sheet), and the
|
|
350
|
+
* rows under it, the first 500 (an empty row between two as `[]`), each cell as Excel shows it;
|
|
351
|
+
* `total_rows`, every row under its columns.
|
|
352
|
+
*/
|
|
353
|
+
export interface PreviewSheet {
|
|
354
|
+
name: string;
|
|
355
|
+
columns: string[] | null;
|
|
356
|
+
rows: string[][];
|
|
357
|
+
total_rows: number;
|
|
358
|
+
}
|
|
359
|
+
/** A spreadsheet's sheets (20 at most), or a CSV as one, named as its file. */
|
|
360
|
+
export interface SheetPreview {
|
|
361
|
+
kind: "sheet";
|
|
362
|
+
sheets: PreviewSheet[];
|
|
363
|
+
/** Rows, columns (50 at most), long cells or sheets were left out. */
|
|
364
|
+
truncated: boolean;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* A Word file as simple HTML: headings, paragraphs, lists, tables, bold and italic, small
|
|
368
|
+
* pictures as data URLs. Cleaned by the API against an allow-list: nothing in it runs, styles
|
|
369
|
+
* or loads from another address.
|
|
370
|
+
*/
|
|
371
|
+
export interface DocumentPreview {
|
|
372
|
+
kind: "document";
|
|
373
|
+
html: string;
|
|
374
|
+
truncated: boolean;
|
|
375
|
+
}
|
|
376
|
+
/** A slide: its title (null without one), the words of its other shapes, its notes. */
|
|
377
|
+
export interface PreviewSlide {
|
|
378
|
+
title: string | null;
|
|
379
|
+
text: string;
|
|
380
|
+
notes: string | null;
|
|
381
|
+
}
|
|
382
|
+
/** A deck's slides, in order. */
|
|
383
|
+
export interface SlidesPreview {
|
|
384
|
+
kind: "slides";
|
|
385
|
+
slides: PreviewSlide[];
|
|
386
|
+
truncated: boolean;
|
|
387
|
+
}
|
|
388
|
+
/** Words as written: Markdown, plain text, JSON. */
|
|
389
|
+
export interface TextPreview {
|
|
390
|
+
kind: "markdown" | "text" | "json";
|
|
391
|
+
text: string;
|
|
392
|
+
truncated: boolean;
|
|
393
|
+
}
|
|
394
|
+
/** A source as written, never run (HTML too), in the language highlighters name it by. */
|
|
395
|
+
export interface CodePreview {
|
|
396
|
+
kind: "code";
|
|
397
|
+
text: string;
|
|
398
|
+
truncated: boolean;
|
|
399
|
+
language: string;
|
|
400
|
+
}
|
|
401
|
+
/** A picture, a video or a sound: the viewer plays the bytes, typed as `media_type`. */
|
|
402
|
+
export interface MediaPreview {
|
|
403
|
+
kind: "image" | "video" | "audio";
|
|
404
|
+
media_type: string;
|
|
405
|
+
}
|
|
406
|
+
/** Nothing to draw: a kind no viewer shows, or a file that can't be read; it is saved. */
|
|
407
|
+
export interface UnknownPreview {
|
|
408
|
+
kind: "unknown";
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* What a viewer draws of a file (`GET …/preview`), by its `kind`. What is too long answers what
|
|
412
|
+
* fits, with `truncated`.
|
|
413
|
+
*/
|
|
414
|
+
export type FilePreview = PdfPreview | SheetPreview | DocumentPreview | SlidesPreview | TextPreview | CodePreview | MediaPreview | UnknownPreview;
|
|
415
|
+
/**
|
|
416
|
+
* A file the agent shows in a surface (`show`'s `file` block): it names one it may read (`path`:
|
|
417
|
+
* its own or the organization's by path, or the conversation's by id), and the API fills in
|
|
418
|
+
* `file`, the conversation's file it put there (`{conversationId, fileId}` to preview and fetch
|
|
419
|
+
* it); null while there is none (the reply's message before the show ran, or one it refused).
|
|
420
|
+
*/
|
|
421
|
+
export interface FileBlock {
|
|
422
|
+
type: "file";
|
|
423
|
+
path: string;
|
|
424
|
+
/** Over it; none: its name. */
|
|
425
|
+
title?: string;
|
|
426
|
+
file: Attachment | null;
|
|
427
|
+
}
|
|
428
|
+
/** Who holds the conversation's browser: the agent drives it, or the person does. */
|
|
429
|
+
export type BrowserControl = "agent" | "person";
|
|
430
|
+
/** Whose the browser is: a clean one in the cloud, or the owner's own Chrome. */
|
|
431
|
+
export type BrowserWhere = "hosted" | "mine";
|
|
432
|
+
/**
|
|
433
|
+
* The conversation's hosted browser, while it is open: where it is, who holds it, and, when the
|
|
434
|
+
* agent handed it over, why (`reason`) and the step the person's answer carries on (`wait`).
|
|
435
|
+
* `width` and `height` are the page's, the pixels its pointer events are in.
|
|
436
|
+
*/
|
|
437
|
+
export interface BrowserState {
|
|
438
|
+
where: BrowserWhere;
|
|
439
|
+
url: string;
|
|
440
|
+
title: string;
|
|
441
|
+
control: BrowserControl;
|
|
442
|
+
reason: string | null;
|
|
443
|
+
wait: string | null;
|
|
444
|
+
width: number;
|
|
445
|
+
height: number;
|
|
446
|
+
}
|
|
447
|
+
/** A picture of the browser's screen: a JPEG in base64, showing the page at this size. */
|
|
448
|
+
export interface BrowserFrame {
|
|
449
|
+
jpeg: string;
|
|
450
|
+
width: number;
|
|
451
|
+
height: number;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* What the person does on the browser's screen while they hold it, in the page's pixels: the
|
|
455
|
+
* pointer, the wheel, keys (the DOM's `key`, `code` and `keyCode`; `modifiers` is Alt 1, Ctrl 2,
|
|
456
|
+
* Meta 4, Shift 8) and text pasted.
|
|
457
|
+
*/
|
|
458
|
+
export type BrowserInput = {
|
|
459
|
+
kind: "mouse";
|
|
460
|
+
action: "move" | "down" | "up";
|
|
461
|
+
x: number;
|
|
462
|
+
y: number;
|
|
463
|
+
button?: "left" | "middle" | "right";
|
|
464
|
+
clicks?: number;
|
|
465
|
+
} | {
|
|
466
|
+
kind: "wheel";
|
|
467
|
+
x: number;
|
|
468
|
+
y: number;
|
|
469
|
+
dx: number;
|
|
470
|
+
dy: number;
|
|
471
|
+
} | {
|
|
472
|
+
kind: "key";
|
|
473
|
+
action: "down" | "up";
|
|
474
|
+
key: string;
|
|
475
|
+
code: string;
|
|
476
|
+
keyCode: number;
|
|
477
|
+
modifiers: number;
|
|
478
|
+
} | {
|
|
479
|
+
kind: "paste";
|
|
480
|
+
text: string;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* What a person may know of the agent they talk to (`GET /agents/{id}/face`): its name, its role
|
|
484
|
+
* in a line, the mark of its work (an `AgentIcon`; null until it picked one) and whether it takes
|
|
485
|
+
* calls.
|
|
486
|
+
*/
|
|
487
|
+
/**
|
|
488
|
+
* How a web channel's widget looks (`PUT /channels/{id}/appearance`): each unset field keeps the
|
|
489
|
+
* widget's own default (the page's type and ink, neutral greys). Colours are `#rrggbb`, sizes
|
|
490
|
+
* pixels; `css` is the widget's own stylesheet, drawn inside it after ours.
|
|
491
|
+
*/
|
|
492
|
+
export interface WidgetLook {
|
|
493
|
+
accent?: string | null;
|
|
494
|
+
accent_fg?: string | null;
|
|
495
|
+
font?: WidgetFont | null;
|
|
496
|
+
radius?: number | null;
|
|
497
|
+
theme?: "auto" | "light" | "dark";
|
|
498
|
+
position?: "right" | "left";
|
|
499
|
+
launcher_size?: number | null;
|
|
500
|
+
panel_width?: number | null;
|
|
501
|
+
panel_height?: number | null;
|
|
502
|
+
header?: boolean;
|
|
503
|
+
css?: string | null;
|
|
504
|
+
}
|
|
505
|
+
/** The faces a widget may wear besides the page's own: Google Fonts it loads by name. */
|
|
506
|
+
export declare const WIDGET_FONTS: readonly ["Inter", "Manrope", "DM Sans", "Plus Jakarta Sans", "Poppins", "Nunito", "Lora", "Playfair Display"];
|
|
507
|
+
export type WidgetFont = (typeof WIDGET_FONTS)[number];
|
|
508
|
+
/** What the widget reads as it loads, by its publishable key: its agent, and how it looks. */
|
|
509
|
+
export interface WidgetConfig {
|
|
510
|
+
agent_id: string;
|
|
511
|
+
agent_name: string;
|
|
512
|
+
appearance: WidgetLook;
|
|
513
|
+
}
|
|
514
|
+
export interface AgentFace {
|
|
515
|
+
id: string;
|
|
516
|
+
name: string;
|
|
517
|
+
/** "" when it has none. */
|
|
518
|
+
role: string;
|
|
519
|
+
icon: string | null;
|
|
520
|
+
voice: {
|
|
521
|
+
enabled: boolean;
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* One of the host's own tools the agent called, to run in the page (a tool declared `client` on
|
|
526
|
+
* the agent): the call's id, the tool's name, and what the agent gave it, as its JSON Schema says.
|
|
527
|
+
*/
|
|
528
|
+
export interface ToolCall {
|
|
529
|
+
id: string;
|
|
530
|
+
name: string;
|
|
531
|
+
input: Record<string, unknown>;
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/types.ts
|
|
2
|
+
/** The faces a widget may wear besides the page's own: Google Fonts it loads by name. */
|
|
3
|
+
const WIDGET_FONTS = [
|
|
4
|
+
"Inter",
|
|
5
|
+
"Manrope",
|
|
6
|
+
"DM Sans",
|
|
7
|
+
"Plus Jakarta Sans",
|
|
8
|
+
"Poppins",
|
|
9
|
+
"Nunito",
|
|
10
|
+
"Lora",
|
|
11
|
+
"Playfair Display"
|
|
12
|
+
];
|
|
13
|
+
//#endregion
|
|
14
|
+
export { WIDGET_FONTS };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/** The API's objects this package reads (v3/README.md). */\n\nimport type { ChannelKind } from \"./about\";\nimport type { Surface } from \"./blocks\";\n\n/** The channel a conversation is on, as a list draws it. */\nexport interface ChannelGlance {\n id: string;\n kind: ChannelKind;\n /** The number, the @username. */\n name: string;\n}\n\n/** The person a conversation on a channel is with, or a person who signed in to the host's app. */\nexport interface ContactGlance {\n id: string;\n /** As they show it on the channel; null when it doesn't say. */\n name: string | null;\n /** Where they are on it: the number, the Instagram id; their account in the host's app. */\n address: string;\n /** The owner marked them: the agent doesn't answer them; left out by an API from before. */\n muted?: boolean | undefined;\n}\n\n/**\n * Who answers a conversation: its agent; a person of the business (the agent paused in it: it\n * handed it over, or one of them wrote in it); or nobody (it is ignored: what comes is kept, never\n * answered).\n */\nexport type Holder = \"agent\" | \"person\" | \"nobody\";\n\n/** A change of who answers a conversation: to whom, why, who changed it and when. */\nexport interface Handover {\n holder: Holder;\n /** Why, in the words of whoever changed it; \"\" when they said nothing. */\n reason: string;\n /**\n * `owner` (a person of the business), `agent` (its `escalate`), `platform`, or an automation by\n * its file's name.\n */\n by: string;\n /** The automation's title, when one changed it. */\n title: string | null;\n at: string;\n}\n\n/**\n * What was decided of a person's message on a channel before the agent answered it: `deciding`\n * while the automations that decide go; then the agent answers it (`answer`), lets it pass this\n * time (`skip`), or the conversation goes to a person (`hold`) or to nobody (`ignore`).\n */\nexport interface Decision {\n kind: \"deciding\" | \"answer\" | \"skip\" | \"hold\" | \"ignore\";\n /** Why, in the owner's words; null when it says nothing. */\n reason: string | null;\n /** The automation that decided, by its file's name; null when the platform did (a filter, the hours). */\n automation: string | null;\n /** Its title. */\n title: string | null;\n /** Its run that decided. */\n run_id: string | null;\n}\n\n/** A conversation between a person and one agent. */\nexport interface Conversation {\n id: string;\n agent_id: string;\n /** A turn stopped, waiting for the person to answer on a surface. */\n pending: boolean;\n /** Who answers it now: its agent, a person of the business, or nobody. */\n handled_by: Holder;\n /** Its last change of who answers it; null when it never changed, left out by an older API. */\n handover?: Handover | null | undefined;\n /** The owner trying the agent out: no customer sees it, and it is never the agent's activity. */\n test: boolean;\n created_at: string;\n /** Its title in a list: what a person first said in it; null while they've said nothing. */\n title: string | null;\n /** On a channel: which, and the person; null (or left out by an older API) elsewhere. */\n channel?: ChannelGlance | null | undefined;\n contact?: ContactGlance | null | undefined;\n /** On a channel: when the agent's reply is due, once the person has been quiet a moment. */\n reply_due_at?: string | null | undefined;\n /** On a channel: when the person last wrote (WhatsApp's 24 h window counts from it). */\n last_inbound_at?: string | null | undefined;\n /** The call it is, when it is one; null elsewhere, and left out by an API from before calls. */\n call?: CallGlance | null | undefined;\n /**\n * Who it is with, when a person's token or a publishable key started it: a person of the\n * host's app (`host_person`, its `contact` then) or the widget's visitor.\n */\n person?: ConversationPerson | null | undefined;\n}\n\n/** Who a person's token or a publishable key started a conversation for. */\nexport interface ConversationPerson {\n kind: \"host_person\" | \"visitor\" | \"contact\" | \"owner\";\n /** The host's id for them, the visitor's id. */\n external_id: string;\n name: string | null;\n email: string | null;\n}\n\n/**\n * Why a call ended, as the API keeps it: the caller hung up, the agent said goodbye, it reached\n * its longest time, it failed, its end never came, or it was never taken.\n */\nexport type CallReason = \"caller\" | \"agent\" | \"max_duration\" | \"error\" | \"lost\" | \"missed\";\n\n/**\n * The call a conversation is (v3/VOICE.md): the owner's in the browser or a phone call, when the\n * agent took it and when it ended, why and how long.\n */\nexport interface CallGlance {\n id: string;\n kind: \"browser\" | \"phone\";\n /** Null while it is on. */\n reason: CallReason | null;\n /** From when the agent took it to when it ended; null while it is on. */\n seconds: number | null;\n started_at: string | null;\n ended_at: string | null;\n /** Whether it was recorded, to play from the conversation; left out by an older API. */\n recording?: boolean | undefined;\n}\n\n/** Who said a message on a channel: the person, the agent, or a person of the business. */\nexport type Author = \"contact\" | \"agent\" | \"operator\";\n\n/** Where a message that goes out on a channel got to: it only moves forward, and `failed` wins. */\nexport type Delivery = \"queued\" | \"sent\" | \"delivered\" | \"read\" | \"failed\";\n\n/** How a channel's account stands, as its provider last said. */\nexport type ChannelStatus = \"pending\" | \"active\" | \"error\" | \"disconnected\";\n\n/** A day of the week, as a channel's hours name it. */\nexport type Weekday = \"mon\" | \"tue\" | \"wed\" | \"thu\" | \"fri\" | \"sat\" | \"sun\";\n\n/** A stretch of a day, from one time to a later one (\"HH:MM\"). */\nexport interface HoursSpan {\n start: string;\n end: string;\n}\n\n/**\n * A week of hours in the agent's time zone: each day's stretches, in order and apart, four at\n * most; a day left out, or empty, is closed.\n */\nexport type WeekHours = Partial<Record<Weekday, HoursSpan[]>>;\n\n/**\n * How the agent behaves on a channel, the same for every text channel (each shows only what its\n * medium can do): when it answers, how what it says goes out, and what it is told there.\n */\nexport interface ChannelSettings {\n /** It answers on this channel; off, everything goes to the inbox for a person. */\n answers: boolean;\n /** Who it answers, in the owner's words; null: everyone. */\n filter: string | null;\n /** Words that, said in a message, have it answer without weighing the filter. */\n filter_keywords: string[];\n /** The week it keeps; null: it answers at any hour. */\n hours: WeekHours | null;\n /** It answers inside the hours, or outside them (the business's people take the hours). */\n answers_when: \"in_hours\" | \"out_of_hours\";\n /** Sent once per conversation while the hours keep it from answering; null: nothing. */\n away_message: string | null;\n /** WhatsApp: it answers in group chats too. */\n groups: boolean;\n /**\n * A conversation a person took over goes back to the agent after this long without them; null:\n * it stays theirs until they give it back.\n */\n auto_release_after_h: number | null;\n /** What it is told on this channel only, besides its own instructions. */\n instructions: string | null;\n /** The quiet period after the person's last message before the agent answers them all. */\n reply_delay_s: number;\n /** A long answer goes in up to three messages as a person writes them, its words as they are. */\n split: boolean;\n /** The channel shows the agent writing between the parts of an answer, where it can. */\n typing: boolean;\n /** WhatsApp, past 24 h since the person last wrote: the template that carries the answer. */\n window_template: string | null;\n /**\n * WhatsApp: the answer as a voice note in the agent's voice, its words kept as what it said;\n * never, when the person's last message was a voice note, or always.\n */\n voice_replies: \"never\" | \"when_voice\" | \"always\";\n}\n\n/**\n * An account on a provider (a WhatsApp number, an Instagram account, an SMS number) and the agent\n * that answers it (`GET /channels?agent=`).\n */\nexport interface Channel {\n id: string;\n agent_id: string;\n kind: \"whatsapp\" | \"instagram\" | \"sms\" | \"phone\" | \"web\";\n /** meta · twilio · livekit · signalcore (the widget) */\n provider: string;\n /** The number, the @username. */\n name: string;\n /** The provider's id for the account. */\n external_id: string;\n /** A phone number's: where its provider sends its calls (a SIP address); null for others. */\n address: string | null;\n /** A phone number's: whether the agent calls out from it (it has the number's SIP login). */\n outbound: boolean;\n status: ChannelStatus;\n /** The provider's word on its status, or what went wrong; null when it said nothing. */\n detail: string | null;\n settings: ChannelSettings;\n /** A web channel's: the widget's publishable key, its sites and its look; null for others. */\n web: ChannelWeb | null;\n created_at: string;\n}\n\n/** The widget a web channel is: the key its line carries, the sites it loads on, its look. */\nexport interface ChannelWeb {\n key: string;\n origins: string[];\n appearance: WidgetLook;\n}\n\nexport type StepState = \"running\" | \"waiting\" | \"done\" | \"failed\";\n\n/**\n * Who gives the yes an action waits for: the person on the screen (the turn stopped for it), or\n * the business (the turn went on; its people allow or decline it from the app, the inbox).\n */\nexport type Decides = \"person\" | \"business\";\n\n/** An action the platform will not run until it is allowed: what, with what input, by whom. */\nexport interface Request {\n action: string;\n input: Record<string, unknown>;\n /** The person's when left out (an API from before it). */\n decides?: Decides | undefined;\n}\n\n/** An action a reply called: what, how it went, and what it drew. */\nexport interface Step {\n id: string;\n action: string;\n state: StepState;\n output: string | null;\n surface: Surface | null;\n /**\n * The turn stopped on it: the person's answer on its surface carries it on. Never a host's tool\n * the page runs, nor a yes the business gives.\n */\n awaits: boolean;\n /** Set while it waits to be allowed: by the person (the turn stopped), or by the business. */\n request: Request | null;\n}\n\n/**\n * What a person did on a surface: `surface` is its id, `name` the block's action, `data` what it\n * carries (a pick, a form's values), `label` the words the app shows for it.\n */\nexport interface Action {\n surface: string;\n name: string;\n data: Record<string, unknown>;\n label: string;\n}\n\n/** What is read of a message: who said it, its text, what it did on a surface, its steps. */\nexport interface Message {\n id: string;\n role: \"user\" | \"assistant\";\n text: string;\n /** When the message came from a surface; `text` is then its label. */\n action: Action | null;\n steps: Step[];\n /** The files the person sent with it; an API from before files leaves it out. */\n files?: Attachment[] | undefined;\n /** On a channel, who said it; null elsewhere. A person of the business's is `assistant`. */\n author?: Author | null | undefined;\n /** On a channel, where what goes out got to, and why it failed when it did. */\n delivery?: Delivery | null | undefined;\n delivery_error?: string | null | undefined;\n /** Gone out on a channel in several parts: the words of each, in order; null as one. */\n pieces?: string[] | null | undefined;\n /** Going out on a channel: how many of its parts went so far; null for what doesn't go out. */\n sent_parts?: number | null | undefined;\n /**\n * On a channel, a voice note, the person's or the agent's: its file, played with `text` (what\n * was said) under it; null otherwise, and left out by an API from before voice notes.\n */\n voice?: Attachment | null | undefined;\n /**\n * On a call, a person's message: what they heard of the agent's last words before saying it,\n * when that isn't what was stored (a reply or the greeting they cut short; \"\" for nothing of\n * it); null otherwise, and left out by an API from before calls.\n */\n heard?: string | null | undefined;\n /** On a channel, a person's message: what was decided of it; null otherwise. */\n decision?: Decision | null | undefined;\n created_at: string;\n}\n\n/**\n * A call with an agent from the browser (the owner's test, `POST /agents/{id}/voice/token`; anyone\n * who may talk to it, a person's as theirs, `POST /agents/{id}/calls`): LiveKit's address, a token\n * to join the call's room (for 10 minutes), and the call and its own conversation, made with it,\n * whose live socket shows what is said.\n */\nexport interface CallToken {\n url: string;\n token: string;\n room: string;\n call_id: string;\n conversation_id: string;\n}\n\n/** A file that arrived in a conversation, as a message carries it. */\nexport interface Attachment {\n id: string;\n name: string;\n media_type: string;\n size: number;\n}\n\n/** Where a file of a conversation plays from, until `expires_at`: a path under the API's root. */\nexport interface FileLink {\n path: string;\n expires_at: string;\n}\n\n/** A conversation's file, as the API stores it (`POST /conversations/{id}/files`). */\nexport interface ConversationFile extends Attachment {\n conversation_id: string;\n created_at: string;\n}\n\n/** A conversation with its messages, in the order they were said. */\nexport interface ConversationDetail extends Conversation {\n messages: Message[];\n /** Every change of who answers it, in order; left out by an API from before them. */\n handovers?: Handover[] | undefined;\n}\n\n/**\n * How far a searchable file's index is: its passages being made, made, or failed; what to know\n * of it (why it failed, what of it can't be searched); its pages without text the model read.\n */\nexport interface FileIndex {\n state: \"indexing\" | \"ready\" | \"failed\";\n detail: string | null;\n scanned: number;\n}\n\n/** A file kept under a name: the organization's, or an agent's own. */\nexport interface StoredFile {\n id: string;\n path: string;\n media_type: string;\n size: number;\n /** Text, Markdown, JSON, YAML or PDF, read by `search_files`; anything else is only kept. */\n searchable: boolean;\n /** Its index, while it is searchable; left out by an API from before it. */\n index?: FileIndex | null | undefined;\n created_at: string;\n}\n\n/**\n * Where a file is, for what reads any of them: the organization's or an agent's own by its path,\n * a conversation's by its id.\n */\nexport type FileAt =\n { path: string } | { agentId: string; path: string } | { conversationId: string; fileId: string };\n\n/** A PDF: the viewer draws the bytes it fetches. Null pages when they can't be counted. */\nexport interface PdfPreview {\n kind: \"pdf\";\n pages: number | null;\n}\n\n/**\n * One sheet: its first row with anything in it as its columns (null for an empty sheet), and the\n * rows under it, the first 500 (an empty row between two as `[]`), each cell as Excel shows it;\n * `total_rows`, every row under its columns.\n */\nexport interface PreviewSheet {\n name: string;\n columns: string[] | null;\n rows: string[][];\n total_rows: number;\n}\n\n/** A spreadsheet's sheets (20 at most), or a CSV as one, named as its file. */\nexport interface SheetPreview {\n kind: \"sheet\";\n sheets: PreviewSheet[];\n /** Rows, columns (50 at most), long cells or sheets were left out. */\n truncated: boolean;\n}\n\n/**\n * A Word file as simple HTML: headings, paragraphs, lists, tables, bold and italic, small\n * pictures as data URLs. Cleaned by the API against an allow-list: nothing in it runs, styles\n * or loads from another address.\n */\nexport interface DocumentPreview {\n kind: \"document\";\n html: string;\n truncated: boolean;\n}\n\n/** A slide: its title (null without one), the words of its other shapes, its notes. */\nexport interface PreviewSlide {\n title: string | null;\n text: string;\n notes: string | null;\n}\n\n/** A deck's slides, in order. */\nexport interface SlidesPreview {\n kind: \"slides\";\n slides: PreviewSlide[];\n truncated: boolean;\n}\n\n/** Words as written: Markdown, plain text, JSON. */\nexport interface TextPreview {\n kind: \"markdown\" | \"text\" | \"json\";\n text: string;\n truncated: boolean;\n}\n\n/** A source as written, never run (HTML too), in the language highlighters name it by. */\nexport interface CodePreview {\n kind: \"code\";\n text: string;\n truncated: boolean;\n language: string;\n}\n\n/** A picture, a video or a sound: the viewer plays the bytes, typed as `media_type`. */\nexport interface MediaPreview {\n kind: \"image\" | \"video\" | \"audio\";\n media_type: string;\n}\n\n/** Nothing to draw: a kind no viewer shows, or a file that can't be read; it is saved. */\nexport interface UnknownPreview {\n kind: \"unknown\";\n}\n\n/**\n * What a viewer draws of a file (`GET …/preview`), by its `kind`. What is too long answers what\n * fits, with `truncated`.\n */\nexport type FilePreview =\n | PdfPreview\n | SheetPreview\n | DocumentPreview\n | SlidesPreview\n | TextPreview\n | CodePreview\n | MediaPreview\n | UnknownPreview;\n\n/**\n * A file the agent shows in a surface (`show`'s `file` block): it names one it may read (`path`:\n * its own or the organization's by path, or the conversation's by id), and the API fills in\n * `file`, the conversation's file it put there (`{conversationId, fileId}` to preview and fetch\n * it); null while there is none (the reply's message before the show ran, or one it refused).\n */\nexport interface FileBlock {\n type: \"file\";\n path: string;\n /** Over it; none: its name. */\n title?: string;\n file: Attachment | null;\n}\n\n/** Who holds the conversation's browser: the agent drives it, or the person does. */\nexport type BrowserControl = \"agent\" | \"person\";\n\n/** Whose the browser is: a clean one in the cloud, or the owner's own Chrome. */\nexport type BrowserWhere = \"hosted\" | \"mine\";\n\n/**\n * The conversation's hosted browser, while it is open: where it is, who holds it, and, when the\n * agent handed it over, why (`reason`) and the step the person's answer carries on (`wait`).\n * `width` and `height` are the page's, the pixels its pointer events are in.\n */\nexport interface BrowserState {\n where: BrowserWhere;\n url: string;\n title: string;\n control: BrowserControl;\n reason: string | null;\n wait: string | null;\n width: number;\n height: number;\n}\n\n/** A picture of the browser's screen: a JPEG in base64, showing the page at this size. */\nexport interface BrowserFrame {\n jpeg: string;\n width: number;\n height: number;\n}\n\n/**\n * What the person does on the browser's screen while they hold it, in the page's pixels: the\n * pointer, the wheel, keys (the DOM's `key`, `code` and `keyCode`; `modifiers` is Alt 1, Ctrl 2,\n * Meta 4, Shift 8) and text pasted.\n */\nexport type BrowserInput =\n | {\n kind: \"mouse\";\n action: \"move\" | \"down\" | \"up\";\n x: number;\n y: number;\n button?: \"left\" | \"middle\" | \"right\";\n clicks?: number;\n }\n | { kind: \"wheel\"; x: number; y: number; dx: number; dy: number }\n | {\n kind: \"key\";\n action: \"down\" | \"up\";\n key: string;\n code: string;\n keyCode: number;\n modifiers: number;\n }\n | { kind: \"paste\"; text: string };\n\n/**\n * What a person may know of the agent they talk to (`GET /agents/{id}/face`): its name, its role\n * in a line, the mark of its work (an `AgentIcon`; null until it picked one) and whether it takes\n * calls.\n */\n/**\n * How a web channel's widget looks (`PUT /channels/{id}/appearance`): each unset field keeps the\n * widget's own default (the page's type and ink, neutral greys). Colours are `#rrggbb`, sizes\n * pixels; `css` is the widget's own stylesheet, drawn inside it after ours.\n */\nexport interface WidgetLook {\n accent?: string | null;\n accent_fg?: string | null;\n font?: WidgetFont | null;\n radius?: number | null;\n theme?: \"auto\" | \"light\" | \"dark\";\n position?: \"right\" | \"left\";\n launcher_size?: number | null;\n panel_width?: number | null;\n panel_height?: number | null;\n header?: boolean;\n css?: string | null;\n}\n\n/** The faces a widget may wear besides the page's own: Google Fonts it loads by name. */\nexport const WIDGET_FONTS = [\n \"Inter\",\n \"Manrope\",\n \"DM Sans\",\n \"Plus Jakarta Sans\",\n \"Poppins\",\n \"Nunito\",\n \"Lora\",\n \"Playfair Display\",\n] as const;\n\nexport type WidgetFont = (typeof WIDGET_FONTS)[number];\n\n/** What the widget reads as it loads, by its publishable key: its agent, and how it looks. */\nexport interface WidgetConfig {\n agent_id: string;\n agent_name: string;\n appearance: WidgetLook;\n}\n\nexport interface AgentFace {\n id: string;\n name: string;\n /** \"\" when it has none. */\n role: string;\n icon: string | null;\n voice: { enabled: boolean };\n}\n\n/**\n * One of the host's own tools the agent called, to run in the page (a tool declared `client` on\n * the agent): the call's id, the tool's name, and what the agent gave it, as its JSON Schema says.\n */\nexport interface ToolCall {\n id: string;\n name: string;\n input: Record<string, unknown>;\n}\n"],"mappings":";;AA8iBA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AgentFace } from "./types.js";
|
|
2
|
+
import { Client } from "./client.js";
|
|
3
|
+
//#region src/useAgentFace.d.ts
|
|
4
|
+
/** The agent's face as it is read: null until it lands, with what the read threw if it failed. */
|
|
5
|
+
export interface FaceRead {
|
|
6
|
+
face: AgentFace | null;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error: unknown;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a person may know of agent `agentId` (`GET /agents/{id}/face`): its name, its role, the
|
|
12
|
+
* mark of its work and whether it takes calls, read once for each agent. Until it lands (and
|
|
13
|
+
* while another agent's is read) there is none; one that lands for an agent no longer asked
|
|
14
|
+
* about is dropped.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAgentFace(client: Client, agentId: string): FaceRead;
|
|
17
|
+
//#endregion
|
|
18
|
+
//# sourceMappingURL=useAgentFace.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
//#region src/useAgentFace.ts
|
|
3
|
+
/**
|
|
4
|
+
* What a person may know of agent `agentId` (`GET /agents/{id}/face`): its name, its role, the
|
|
5
|
+
* mark of its work and whether it takes calls, read once for each agent. Until it lands (and
|
|
6
|
+
* while another agent's is read) there is none; one that lands for an agent no longer asked
|
|
7
|
+
* about is dropped.
|
|
8
|
+
*/
|
|
9
|
+
function useAgentFace(client, agentId) {
|
|
10
|
+
const [landed, setLanded] = useState(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
let asked = true;
|
|
13
|
+
client.agents.face(agentId).then((face) => {
|
|
14
|
+
if (asked) setLanded({
|
|
15
|
+
client,
|
|
16
|
+
agentId,
|
|
17
|
+
face,
|
|
18
|
+
error: null
|
|
19
|
+
});
|
|
20
|
+
}, (error) => {
|
|
21
|
+
if (asked) setLanded({
|
|
22
|
+
client,
|
|
23
|
+
agentId,
|
|
24
|
+
face: null,
|
|
25
|
+
error
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return () => {
|
|
29
|
+
asked = false;
|
|
30
|
+
};
|
|
31
|
+
}, [client, agentId]);
|
|
32
|
+
return landed !== null && landed.client === client && landed.agentId === agentId ? {
|
|
33
|
+
face: landed.face,
|
|
34
|
+
loading: false,
|
|
35
|
+
error: landed.error
|
|
36
|
+
} : {
|
|
37
|
+
face: null,
|
|
38
|
+
loading: true,
|
|
39
|
+
error: null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { useAgentFace };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=useAgentFace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentFace.js","names":[],"sources":["../src/useAgentFace.ts"],"sourcesContent":["import { useEffect, useState } from \"react\";\n\nimport type { Client } from \"./client\";\nimport type { AgentFace } from \"./types\";\n\n/** The agent's face as it is read: null until it lands, with what the read threw if it failed. */\nexport interface FaceRead {\n face: AgentFace | null;\n loading: boolean;\n error: unknown;\n}\n\n/** A read that landed, and for which agent: one for another is not this one's. */\ninterface Landed {\n client: Client;\n agentId: string;\n face: AgentFace | null;\n error: unknown;\n}\n\n/**\n * What a person may know of agent `agentId` (`GET /agents/{id}/face`): its name, its role, the\n * mark of its work and whether it takes calls, read once for each agent. Until it lands (and\n * while another agent's is read) there is none; one that lands for an agent no longer asked\n * about is dropped.\n */\nexport function useAgentFace(client: Client, agentId: string): FaceRead {\n const [landed, setLanded] = useState<Landed | null>(null);\n useEffect(() => {\n let asked = true;\n client.agents.face(agentId).then(\n (face) => {\n if (asked) setLanded({ client, agentId, face, error: null });\n },\n (error: unknown) => {\n if (asked) setLanded({ client, agentId, face: null, error });\n },\n );\n return () => {\n asked = false;\n };\n }, [client, agentId]);\n const current = landed !== null && landed.client === client && landed.agentId === agentId;\n return current\n ? { face: landed.face, loading: false, error: landed.error }\n : { face: null, loading: true, error: null };\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,aAAa,QAAgB,SAA2B;CACtE,MAAM,CAAC,QAAQ,aAAa,SAAwB,IAAI;CACxD,gBAAgB;EACd,IAAI,QAAQ;EACZ,OAAO,OAAO,KAAK,OAAO,CAAC,CAAC,MACzB,SAAS;GACR,IAAI,OAAO,UAAU;IAAE;IAAQ;IAAS;IAAM,OAAO;GAAK,CAAC;EAC7D,IACC,UAAmB;GAClB,IAAI,OAAO,UAAU;IAAE;IAAQ;IAAS,MAAM;IAAM;GAAM,CAAC;EAC7D,CACF;EACA,aAAa;GACX,QAAQ;EACV;CACF,GAAG,CAAC,QAAQ,OAAO,CAAC;CAEpB,OADgB,WAAW,QAAQ,OAAO,WAAW,UAAU,OAAO,YAAY,UAE9E;EAAE,MAAM,OAAO;EAAM,SAAS;EAAO,OAAO,OAAO;CAAM,IACzD;EAAE,MAAM;EAAM,SAAS;EAAM,OAAO;CAAK;AAC/C"}
|