@signalcore/ui 0.1.0 → 1.0.0-beta.1
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 +1127 -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 +541 -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 +1812 -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 +271 -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 +6970 -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 +604 -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
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { usePrimitives } from "../../primitives.js";
|
|
3
|
-
import { useLanguage, useParts } from "../../SignalcoreProvider.js";
|
|
4
|
-
import { when } from "../format.js";
|
|
5
|
-
import { useScene } from "../scene.js";
|
|
6
|
-
/** Free times to book: each is a button, and the pick goes back as the `book` action. */
|
|
7
|
-
export function SlotPicker({ read }) {
|
|
8
|
-
const part = useParts();
|
|
9
|
-
const { locale } = useLanguage();
|
|
10
|
-
const { Button } = usePrimitives();
|
|
11
|
-
const { act } = useScene();
|
|
12
|
-
const name = read.text("action") ?? "book";
|
|
13
|
-
return (_jsx("div", { ...part("slots"), children: read.list("slots").map((slot) => {
|
|
14
|
-
const label = slot.label ?? when(slot.start, locale);
|
|
15
|
-
return (_jsx(Button, { size: "sm", disabled: !act, onClick: () => {
|
|
16
|
-
act?.({ name, data: { slot: slot.id, start: slot.start }, label });
|
|
17
|
-
}, children: label }, slot.id));
|
|
18
|
-
}) }));
|
|
19
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { usePrimitives } from "../../primitives.js";
|
|
3
|
-
import { display } from "../format.js";
|
|
4
|
-
/** Rows of records, one column per `columns` entry; drawn with the host's `Table` if it has one. */
|
|
5
|
-
export function DataTable({ read }) {
|
|
6
|
-
const { Table } = usePrimitives();
|
|
7
|
-
const columns = read.list("columns");
|
|
8
|
-
const rows = read
|
|
9
|
-
.list("rows")
|
|
10
|
-
.map((row) => Object.fromEntries(columns.map((column) => [column.key, display(row[column.key])])));
|
|
11
|
-
return _jsx(Table, { columns: columns, rows: rows });
|
|
12
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TemplateProps } from "../scene.js";
|
|
2
|
-
export declare function Text({ read }: TemplateProps): import("react").JSX.Element;
|
|
3
|
-
/** A line the user should not miss, tinted by its tone (always in words as well). */
|
|
4
|
-
export declare function Callout({ read }: TemplateProps): import("react").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
3
|
-
const VARIANTS = new Set(["heading", "caption"]);
|
|
4
|
-
export function Text({ read }) {
|
|
5
|
-
const part = useParts();
|
|
6
|
-
const variant = read.text("variant");
|
|
7
|
-
return (_jsx("p", { ...part("text", [variant && VARIANTS.has(variant) && variant]), children: read.text("text") }));
|
|
8
|
-
}
|
|
9
|
-
const TONES = new Set(["info", "success", "warning", "error"]);
|
|
10
|
-
/** A line the user should not miss, tinted by its tone (always in words as well). */
|
|
11
|
-
export function Callout({ read }) {
|
|
12
|
-
const part = useParts();
|
|
13
|
-
const tone = read.text("tone");
|
|
14
|
-
return _jsx("p", { ...part("callout", [tone && TONES.has(tone) ? tone : "info"]), children: read.text("text") });
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from "react";
|
|
2
|
-
import type { TemplateProps } from "../scene.js";
|
|
3
|
-
/**
|
|
4
|
-
* The catalog `signalcore-basic.v1`, component by component: the only things a surface can draw.
|
|
5
|
-
* A name that is not here is drawn by nothing, which is what keeps a model from adding markup.
|
|
6
|
-
*/
|
|
7
|
-
export declare const TEMPLATES: ReadonlyMap<string, ComponentType<TemplateProps>>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Browser } from "./Browser.js";
|
|
2
|
-
import { Chart } from "./Chart.js";
|
|
3
|
-
import { ChoiceList } from "./Choices.js";
|
|
4
|
-
import { Form } from "./Form.js";
|
|
5
|
-
import { KeyValue } from "./KeyValue.js";
|
|
6
|
-
import { Card, Column, Row } from "./Layout.js";
|
|
7
|
-
import { Live } from "./Live.js";
|
|
8
|
-
import { Image, Link } from "./Media.js";
|
|
9
|
-
import { SlotPicker } from "./Slots.js";
|
|
10
|
-
import { DataTable } from "./Table.js";
|
|
11
|
-
import { Callout, Text } from "./Text.js";
|
|
12
|
-
/**
|
|
13
|
-
* The catalog `signalcore-basic.v1`, component by component: the only things a surface can draw.
|
|
14
|
-
* A name that is not here is drawn by nothing, which is what keeps a model from adding markup.
|
|
15
|
-
*/
|
|
16
|
-
export const TEMPLATES = new Map([
|
|
17
|
-
["Column", Column],
|
|
18
|
-
["Row", Row],
|
|
19
|
-
["Card", Card],
|
|
20
|
-
["Text", Text],
|
|
21
|
-
["KeyValue", KeyValue],
|
|
22
|
-
["DataTable", DataTable],
|
|
23
|
-
["Chart", Chart],
|
|
24
|
-
["Callout", Callout],
|
|
25
|
-
["Image", Image],
|
|
26
|
-
["Link", Link],
|
|
27
|
-
["ChoiceList", ChoiceList],
|
|
28
|
-
["SlotPicker", SlotPicker],
|
|
29
|
-
["Form", Form],
|
|
30
|
-
["Browser", Browser],
|
|
31
|
-
["Live", Live],
|
|
32
|
-
]);
|
package/dist/surface/types.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shapes of a surface of the `signalcore-basic.v1` catalog, as the API sends them (see
|
|
3
|
-
* `signalcore_core.ui`). A component's own properties are loose here (`unknown`): they come
|
|
4
|
-
* from a model and are read defensively where they are drawn.
|
|
5
|
-
*/
|
|
6
|
-
export interface ComponentData {
|
|
7
|
-
id: string;
|
|
8
|
-
component: string;
|
|
9
|
-
[prop: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Where a surface goes when it deserves a page of its own (ADR 0011): the `slot` names the
|
|
13
|
-
* place, and showing into a slot that is open replaces what was there; the `title` is what the
|
|
14
|
-
* window is called.
|
|
15
|
-
*/
|
|
16
|
-
export interface Placement {
|
|
17
|
-
slot: string;
|
|
18
|
-
title: string;
|
|
19
|
-
}
|
|
20
|
-
export interface SurfaceData {
|
|
21
|
-
id: string;
|
|
22
|
-
root: string;
|
|
23
|
-
components: ComponentData[];
|
|
24
|
-
data?: Record<string, unknown>;
|
|
25
|
-
/** The text twin: what channels, screen readers and text-only doors show instead. */
|
|
26
|
-
fallback_text: string;
|
|
27
|
-
/** Set when the agent placed the surface as a window of the shell instead of in the transcript. */
|
|
28
|
-
window?: Placement | null;
|
|
29
|
-
}
|
|
30
|
-
/** What the user did on a surface, in the shape the API's `Action` expects. */
|
|
31
|
-
export interface SurfaceAction {
|
|
32
|
-
surface_id: string;
|
|
33
|
-
/** The component's action: `choose`, `book`, `submit`. */
|
|
34
|
-
name: string;
|
|
35
|
-
data: Record<string, unknown>;
|
|
36
|
-
/** In words, as the user would say it: "Martes 10:00". */
|
|
37
|
-
label: string;
|
|
38
|
-
}
|
|
39
|
-
export interface Pair {
|
|
40
|
-
label: string;
|
|
41
|
-
value: string;
|
|
42
|
-
}
|
|
43
|
-
export interface TableColumn {
|
|
44
|
-
key: string;
|
|
45
|
-
label: string;
|
|
46
|
-
}
|
|
47
|
-
export interface Point {
|
|
48
|
-
label: string;
|
|
49
|
-
value: number;
|
|
50
|
-
}
|
|
51
|
-
export interface Option {
|
|
52
|
-
id: string;
|
|
53
|
-
label: string;
|
|
54
|
-
description?: string;
|
|
55
|
-
}
|
|
56
|
-
/** A free time on a `SlotPicker`. */
|
|
57
|
-
export interface TimeSlot {
|
|
58
|
-
id: string;
|
|
59
|
-
start: string;
|
|
60
|
-
label?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface FormField {
|
|
63
|
-
name: string;
|
|
64
|
-
label: string;
|
|
65
|
-
kind: "text" | "number" | "date" | "select" | "checkbox";
|
|
66
|
-
required?: boolean;
|
|
67
|
-
options?: Option[];
|
|
68
|
-
}
|
package/dist/surface/types.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shapes of a surface of the `signalcore-basic.v1` catalog, as the API sends them (see
|
|
3
|
-
* `signalcore_core.ui`). A component's own properties are loose here (`unknown`): they come
|
|
4
|
-
* from a model and are read defensively where they are drawn.
|
|
5
|
-
*/
|
|
6
|
-
export {};
|
package/dist/theme.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
import type { PresetChoice } from "./presets.js";
|
|
3
|
-
/**
|
|
4
|
-
* The tokens the components are drawn with. Each is the CSS custom property `--sc-<name>`
|
|
5
|
-
* (`accentFg` is `--sc-accent-fg`), and every one has a default in styles.css, so a host sets
|
|
6
|
-
* only what it wants different: in its own CSS (`:root { --sc-accent: var(--primary) }`), or
|
|
7
|
-
* through the provider's `theme`, which writes them as inline custom properties on its wrapper.
|
|
8
|
-
*
|
|
9
|
-
* Unset, the type, the text color and the color scheme are the host page's own; the neutrals
|
|
10
|
-
* (lines, muted text, sunken areas) are tints of the text color; the accent is SignalCore's.
|
|
11
|
-
*/
|
|
12
|
-
export interface Theme {
|
|
13
|
-
/** Ink. Default: the text color of the page the surface is in. */
|
|
14
|
-
text: string;
|
|
15
|
-
muted: string;
|
|
16
|
-
subtle: string;
|
|
17
|
-
/** What the surfaces sit on. `surface` falls back to it. */
|
|
18
|
-
bg: string;
|
|
19
|
-
/** The face of a card. Default: none, so a card is a bordered area of the page. */
|
|
20
|
-
surface: string;
|
|
21
|
-
/** A recessed or hovered area. */
|
|
22
|
-
sunken: string;
|
|
23
|
-
line: string;
|
|
24
|
-
lineStrong: string;
|
|
25
|
-
/** The owner acting: primary buttons, selection, links. */
|
|
26
|
-
accent: string;
|
|
27
|
-
accentFg: string;
|
|
28
|
-
accentSoft: string;
|
|
29
|
-
/** The agent at work. */
|
|
30
|
-
signal: string;
|
|
31
|
-
signalSoft: string;
|
|
32
|
-
ok: string;
|
|
33
|
-
okSoft: string;
|
|
34
|
-
danger: string;
|
|
35
|
-
dangerSoft: string;
|
|
36
|
-
/** The ring around a focused control. */
|
|
37
|
-
focus: string;
|
|
38
|
-
/** The face of a button, and under the pointer. */
|
|
39
|
-
face: string;
|
|
40
|
-
faceHover: string;
|
|
41
|
-
/** The corner of a card; buttons and fields take smaller ones in proportion. */
|
|
42
|
-
radius: string;
|
|
43
|
-
/** How much room things take, as a multiplier: 1 is the product's, 0.8 tighter, 1.25 looser. */
|
|
44
|
-
density: string | number;
|
|
45
|
-
/** Default: the page's own font. */
|
|
46
|
-
font: string;
|
|
47
|
-
fontMono: string;
|
|
48
|
-
/** The reading size; the interface sizes derive from it. Default 14px. */
|
|
49
|
-
fontSize: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* What a host passes as `theme`: a design system by name (`"shadcn"`), `"auto"` (the default:
|
|
53
|
-
* the system the page turns out to use, if any), `"none"`, or tokens, which are laid over the
|
|
54
|
-
* detected system, or over the one named in `preset`.
|
|
55
|
-
*/
|
|
56
|
-
export type ThemeOption = PresetChoice | (Partial<Theme> & {
|
|
57
|
-
preset?: PresetChoice;
|
|
58
|
-
});
|
|
59
|
-
/** `lineStrong` → `--sc-line-strong`. */
|
|
60
|
-
export declare function variableOf(token: keyof Theme): string;
|
|
61
|
-
/** Tokens as the inline style of the element carrying them; nothing when there are none. */
|
|
62
|
-
export declare function themeStyle(tokens: Partial<Theme>): CSSProperties | undefined;
|
package/dist/theme.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** `lineStrong` → `--sc-line-strong`. */
|
|
2
|
-
export function variableOf(token) {
|
|
3
|
-
return `--sc-${token.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
4
|
-
}
|
|
5
|
-
/** Tokens as the inline style of the element carrying them; nothing when there are none. */
|
|
6
|
-
export function themeStyle(tokens) {
|
|
7
|
-
const entries = Object.entries(tokens).map(([token, value]) => [variableOf(token), String(value)]);
|
|
8
|
-
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
9
|
-
}
|
package/dist/useTokens.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Theme, ThemeOption } from "./theme.js";
|
|
2
|
-
/**
|
|
3
|
-
* The tokens to write on the provider's wrapper: the chosen system's (found, for `"auto"`), under
|
|
4
|
-
* whatever tokens the host gave. They are only ever written on the wrapper, never on the page's
|
|
5
|
-
* root, so the host's own variables are read and never changed.
|
|
6
|
-
*/
|
|
7
|
-
export declare function useTokens(option?: ThemeOption): Partial<Theme>;
|
package/dist/useTokens.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useSyncExternalStore } from "react";
|
|
2
|
-
import { detectPreset, SYSTEMS } from "./presets.js";
|
|
3
|
-
// What changes on <html> when a page changes theme: the attribute, or the class that dark mode
|
|
4
|
-
// toggles (shadcn). The system's variables may only exist, or change, in one of them.
|
|
5
|
-
const WATCHED = ["data-theme", "class"];
|
|
6
|
-
function watchRoot(changed) {
|
|
7
|
-
const observer = new MutationObserver(changed);
|
|
8
|
-
observer.observe(document.documentElement, { attributes: true, attributeFilter: WATCHED });
|
|
9
|
-
return () => {
|
|
10
|
-
observer.disconnect();
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
const probeRoot = () => detectPreset(getComputedStyle(document.documentElement));
|
|
14
|
-
const never = () => () => undefined;
|
|
15
|
-
const nothing = () => null;
|
|
16
|
-
/**
|
|
17
|
-
* The design system the page uses, found by asking its root for the variables each system always
|
|
18
|
-
* defines, again whenever its theme changes. Nothing is asked without a `document` (a server
|
|
19
|
-
* renders as if the page used none, then the client finds out), and nothing at all when the host
|
|
20
|
-
* named its system or wants none.
|
|
21
|
-
*/
|
|
22
|
-
function useDetected(wanted) {
|
|
23
|
-
const browser = wanted && typeof document !== "undefined";
|
|
24
|
-
return useSyncExternalStore(browser ? watchRoot : never, browser ? probeRoot : nothing, nothing);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The tokens to write on the provider's wrapper: the chosen system's (found, for `"auto"`), under
|
|
28
|
-
* whatever tokens the host gave. They are only ever written on the wrapper, never on the page's
|
|
29
|
-
* root, so the host's own variables are read and never changed.
|
|
30
|
-
*/
|
|
31
|
-
export function useTokens(option = "auto") {
|
|
32
|
-
const { preset = "auto", ...own } = typeof option === "string" ? { preset: option } : option;
|
|
33
|
-
const detected = useDetected(preset === "auto");
|
|
34
|
-
const system = choose(preset, detected);
|
|
35
|
-
return { ...(system ? SYSTEMS[system].tokens : {}), ...own };
|
|
36
|
-
}
|
|
37
|
-
function choose(preset, detected) {
|
|
38
|
-
if (preset === "auto")
|
|
39
|
-
return detected;
|
|
40
|
-
return preset === "none" ? null : preset;
|
|
41
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type VoiceOptions } from "./useVoice.js";
|
|
2
|
-
export interface VoiceWindowProps extends Pick<VoiceOptions, "agentId" | "thread" | "voice" | "lang" | "continuous" | "onTurn" | "onSurfaces"> {
|
|
3
|
-
/** What the window is called to someone who cannot see it. */
|
|
4
|
-
label?: string | undefined;
|
|
5
|
-
className?: string | undefined;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Talking to an agent (ADR 0011): an orb that listens, thinks and speaks, the state in words
|
|
9
|
-
* under it, and captions of what was heard and what the agent said. The person chooses voice by
|
|
10
|
-
* pressing the button (the agent may suggest it, never start it); from then on it is a
|
|
11
|
-
* conversation, until they end it, with a button to turn the microphone off meanwhile.
|
|
12
|
-
*
|
|
13
|
-
* It speaks to the agent as the person does in the chat (`useVoice`, with `modality: "voice"`)
|
|
14
|
-
* and can never change it. What the agent shows with its answer is not drawn here: it goes to
|
|
15
|
-
* `onSurfaces`, for the host to place as a window. Where the browser cannot listen or speak, the
|
|
16
|
-
* window says so and offers nothing else. The orb is the `Orb` primitive, the host's if it has one.
|
|
17
|
-
*/
|
|
18
|
-
export declare function VoiceWindow(props: VoiceWindowProps): import("react").JSX.Element;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, IconButton } from "../parts/Button.js";
|
|
3
|
-
import { Icon } from "../parts/Icon.js";
|
|
4
|
-
import { ErrorText } from "../parts/Input.js";
|
|
5
|
-
import { Scoped, useMessages, useParts } from "../SignalcoreProvider.js";
|
|
6
|
-
import { useVoicePrimitives } from "./useVoicePrimitives.js";
|
|
7
|
-
import { useVoice } from "./useVoice.js";
|
|
8
|
-
/** How big the orb is drawn: room for it to grow when the voice is loud. */
|
|
9
|
-
const ORB_SIZE = 280;
|
|
10
|
-
/**
|
|
11
|
-
* Talking to an agent (ADR 0011): an orb that listens, thinks and speaks, the state in words
|
|
12
|
-
* under it, and captions of what was heard and what the agent said. The person chooses voice by
|
|
13
|
-
* pressing the button (the agent may suggest it, never start it); from then on it is a
|
|
14
|
-
* conversation, until they end it, with a button to turn the microphone off meanwhile.
|
|
15
|
-
*
|
|
16
|
-
* It speaks to the agent as the person does in the chat (`useVoice`, with `modality: "voice"`)
|
|
17
|
-
* and can never change it. What the agent shows with its answer is not drawn here: it goes to
|
|
18
|
-
* `onSurfaces`, for the host to place as a window. Where the browser cannot listen or speak, the
|
|
19
|
-
* window says so and offers nothing else. The orb is the `Orb` primitive, the host's if it has one.
|
|
20
|
-
*/
|
|
21
|
-
export function VoiceWindow(props) {
|
|
22
|
-
return (_jsx(Scoped, { children: _jsx(Window, { ...props }, `${props.agentId}/${props.thread ?? ""}`) }));
|
|
23
|
-
}
|
|
24
|
-
function Window({ label, className, ...options }) {
|
|
25
|
-
const part = useParts();
|
|
26
|
-
const copy = useMessages();
|
|
27
|
-
const { Orb } = useVoicePrimitives();
|
|
28
|
-
const talk = useVoice(options);
|
|
29
|
-
// The microphone being off is not a state of the conversation, but it is what the person sees.
|
|
30
|
-
const muted = talk.active && talk.muted;
|
|
31
|
-
const state = muted ? copy.voiceMuted : copy.voiceStates[talk.state];
|
|
32
|
-
return (_jsxs("section", { ...part("voice", [talk.state, muted && "muted"], className), "aria-label": label ?? copy.voiceWindow, children: [_jsx("div", { ...part("voice__stage"), children: _jsx(Orb, { state: talk.state, level: talk.level, size: ORB_SIZE, label: state }) }), _jsx("p", { role: "status", ...part("voice__state"), children: state }), _jsxs("div", { ...part("voice__captions"), children: [talk.transcript !== "" && (_jsxs("p", { ...part("voice__line", ["person"]), children: [_jsx("span", { ...part("voice__who"), children: copy.you }), talk.transcript] })), talk.captions !== "" && (_jsxs("p", { ...part("voice__line", ["agent"]), children: [_jsx("span", { ...part("voice__who"), children: copy.theAgent }), talk.captions] }))] }), !talk.supported && _jsx("p", { ...part("voice__note"), children: copy.voiceUnsupported }), talk.problem !== undefined && _jsx(ErrorText, { children: talk.problem }), _jsxs("div", { ...part("voice__controls"), children: [_jsxs(Button, { variant: talk.active ? "secondary" : "primary", disabled: !talk.supported, onClick: talk.active ? talk.stop : talk.start, children: [_jsx(Icon, { name: "microphone" }), talk.active ? copy.stopVoice : copy.startVoice] }), _jsx(IconButton, { label: talk.muted ? copy.unmuteVoice : copy.muteVoice, "aria-pressed": talk.muted, disabled: !talk.active, onClick: () => {
|
|
33
|
-
talk.mute();
|
|
34
|
-
}, children: _jsx(Icon, { name: talk.muted ? "microphoneSlash" : "microphone" }) })] })] }));
|
|
35
|
-
}
|
package/dist/voice/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Talking to an agent: a voice window with an orb, the loop behind it and the ways of listening
|
|
3
|
-
* and speaking it runs on. A separate entry, so a host that never speaks does not load the orb
|
|
4
|
-
* library.
|
|
5
|
-
*
|
|
6
|
-
* import { VoiceWindow } from "@signalcore/ui/voice";
|
|
7
|
-
*/
|
|
8
|
-
export type { OrbProps } from "../host.js";
|
|
9
|
-
export { Orb } from "./Orb.js";
|
|
10
|
-
export { useVoice, type VoiceConversation, type VoiceOptions, type VoiceTurn } from "./useVoice.js";
|
|
11
|
-
export { VoiceError, type Heard, type Voice, type VoiceFailure, type VoiceState } from "./voice.js";
|
|
12
|
-
export { VoiceWindow, type VoiceWindowProps } from "./VoiceWindow.js";
|
|
13
|
-
export { webSpeechVoice, type WebSpeechOptions } from "./webSpeech.js";
|
package/dist/voice/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Talking to an agent: a voice window with an orb, the loop behind it and the ways of listening
|
|
3
|
-
* and speaking it runs on. A separate entry, so a host that never speaks does not load the orb
|
|
4
|
-
* library.
|
|
5
|
-
*
|
|
6
|
-
* import { VoiceWindow } from "@signalcore/ui/voice";
|
|
7
|
-
*/
|
|
8
|
-
export { Orb } from "./Orb.js";
|
|
9
|
-
export { useVoice } from "./useVoice.js";
|
|
10
|
-
export { VoiceError } from "./voice.js";
|
|
11
|
-
export { VoiceWindow } from "./VoiceWindow.js";
|
|
12
|
-
export { webSpeechVoice } from "./webSpeech.js";
|
package/dist/voice/meter.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** One step of the smoothing: where a level that was `level` is after a frame aiming at `goal`. */
|
|
2
|
-
export declare function approach(level: number, goal: number): number;
|
|
3
|
-
/** The microphone's loudness, read when asked. */
|
|
4
|
-
export interface Meter {
|
|
5
|
-
/** From 0 (silence) to 1 (loud), right now, not smoothed. */
|
|
6
|
-
read: () => number;
|
|
7
|
-
/** Lets go of the microphone. */
|
|
8
|
-
close: () => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Opens the microphone only to measure it (an `AnalyserNode` over its stream: the root mean
|
|
12
|
-
* square of the waveform). Nothing is recorded or sent anywhere. Where it cannot be read, because
|
|
13
|
-
* the person said no, there is no device or the browser has no Web Audio, there is no meter, and
|
|
14
|
-
* whoever asked goes without a level.
|
|
15
|
-
*/
|
|
16
|
-
export declare function openMeter(): Promise<Meter | undefined>;
|
package/dist/voice/meter.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How much of the way to its goal a level covers in one frame. Each frame the level moves by this
|
|
3
|
-
* fraction of what is left, so a jump in loudness eases in and out instead of flickering.
|
|
4
|
-
*/
|
|
5
|
-
const SMOOTHING = 0.15;
|
|
6
|
-
/** Speech sits well below full scale on a microphone; this brings its usual loudness near 1. */
|
|
7
|
-
const GAIN = 4;
|
|
8
|
-
/** One step of the smoothing: where a level that was `level` is after a frame aiming at `goal`. */
|
|
9
|
-
export function approach(level, goal) {
|
|
10
|
-
return level + (goal - level) * SMOOTHING;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Opens the microphone only to measure it (an `AnalyserNode` over its stream: the root mean
|
|
14
|
-
* square of the waveform). Nothing is recorded or sent anywhere. Where it cannot be read, because
|
|
15
|
-
* the person said no, there is no device or the browser has no Web Audio, there is no meter, and
|
|
16
|
-
* whoever asked goes without a level.
|
|
17
|
-
*/
|
|
18
|
-
export async function openMeter() {
|
|
19
|
-
const devices = navigator.mediaDevices;
|
|
20
|
-
if (!devices || typeof AudioContext === "undefined")
|
|
21
|
-
return undefined;
|
|
22
|
-
let stream;
|
|
23
|
-
try {
|
|
24
|
-
stream = await devices.getUserMedia({ audio: true });
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const context = new AudioContext();
|
|
30
|
-
void context.resume();
|
|
31
|
-
const analyser = context.createAnalyser();
|
|
32
|
-
analyser.fftSize = 512;
|
|
33
|
-
context.createMediaStreamSource(stream).connect(analyser);
|
|
34
|
-
const samples = new Uint8Array(analyser.fftSize);
|
|
35
|
-
return {
|
|
36
|
-
read: () => {
|
|
37
|
-
analyser.getByteTimeDomainData(samples);
|
|
38
|
-
let energy = 0;
|
|
39
|
-
for (const sample of samples) {
|
|
40
|
-
// Bytes centred on 128 are the waveform from -1 to 1.
|
|
41
|
-
const wave = (sample - 128) / 128;
|
|
42
|
-
energy += wave * wave;
|
|
43
|
-
}
|
|
44
|
-
return Math.min(1, Math.sqrt(energy / samples.length) * GAIN);
|
|
45
|
-
},
|
|
46
|
-
close: () => {
|
|
47
|
-
for (const track of stream.getTracks())
|
|
48
|
-
track.stop();
|
|
49
|
-
void context.close();
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { VoiceState } from "./voice.js";
|
|
2
|
-
/** What each state is when the page cannot say (no CSS color mixing, or no styles at all). */
|
|
3
|
-
export declare const FALLBACK_COLORS: Record<VoiceState, string>;
|
|
4
|
-
/**
|
|
5
|
-
* `#rrggbb` for a color as a browser reports it once computed: `rgb(153, 50, 204)`, the modern
|
|
6
|
-
* `rgb(153 50 204 / 1)`, or `color(srgb 0.6 0.2 0.8)` (what Chrome says for a color it mixed).
|
|
7
|
-
* Nothing for any other notation. Transparency is ignored; channels out of gamut are clamped.
|
|
8
|
-
*/
|
|
9
|
-
export declare function hexOf(color: string): string | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* The color of a state as the page draws it here: our tokens, with the host's values and the
|
|
12
|
-
* scheme (light or dark) of the element. Asked of a probe placed inside `host`, so it follows
|
|
13
|
-
* whatever the host set on the provider or above it. A color the browser cannot give is the
|
|
14
|
-
* fallback's.
|
|
15
|
-
*/
|
|
16
|
-
export declare function resolveColor(host: Element, state: VoiceState): string;
|
package/dist/voice/orbColors.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The colors the orb library is given for each state. It takes `#rrggbb` only (it blends them
|
|
3
|
-
* frame by frame), so a CSS variable cannot be passed as it is: each is written in terms of our
|
|
4
|
-
* tokens, resolved by the browser on a probe element, and turned into hex (`resolveColors`).
|
|
5
|
-
*
|
|
6
|
-
* The person is the accent (the one acting, as on a primary button); the agent working and
|
|
7
|
-
* speaking is the signal (the agent at work); at rest the orb is the accent worn down to gray.
|
|
8
|
-
* The fallbacks inside `var()` are the product's own defaults, for a page without our styles.
|
|
9
|
-
*/
|
|
10
|
-
const ACCENT = "var(--_accent, var(--sc-accent, #9932cc))";
|
|
11
|
-
const SIGNAL = "var(--_signal, var(--sc-signal, #ff8c00))";
|
|
12
|
-
const TOKENS = {
|
|
13
|
-
idle: `color-mix(in srgb, ${ACCENT} 40%, rgb(150 150 150))`,
|
|
14
|
-
listening: ACCENT,
|
|
15
|
-
thinking: SIGNAL,
|
|
16
|
-
speaking: SIGNAL,
|
|
17
|
-
};
|
|
18
|
-
/** What each state is when the page cannot say (no CSS color mixing, or no styles at all). */
|
|
19
|
-
export const FALLBACK_COLORS = {
|
|
20
|
-
idle: "#976eac",
|
|
21
|
-
listening: "#9932cc",
|
|
22
|
-
thinking: "#ff8c00",
|
|
23
|
-
speaking: "#ff8c00",
|
|
24
|
-
};
|
|
25
|
-
const channel = (value) => Math.round(Math.min(255, Math.max(0, value)))
|
|
26
|
-
.toString(16)
|
|
27
|
-
.padStart(2, "0");
|
|
28
|
-
/** `#rrggbb` from three channels on a scale of 255; nothing if one is not a number. */
|
|
29
|
-
function toHex(red, green, blue) {
|
|
30
|
-
if (red === undefined || green === undefined || blue === undefined)
|
|
31
|
-
return undefined;
|
|
32
|
-
if ([red, green, blue].some(Number.isNaN))
|
|
33
|
-
return undefined;
|
|
34
|
-
return `#${channel(red)}${channel(green)}${channel(blue)}`;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* `#rrggbb` for a color as a browser reports it once computed: `rgb(153, 50, 204)`, the modern
|
|
38
|
-
* `rgb(153 50 204 / 1)`, or `color(srgb 0.6 0.2 0.8)` (what Chrome says for a color it mixed).
|
|
39
|
-
* Nothing for any other notation. Transparency is ignored; channels out of gamut are clamped.
|
|
40
|
-
*/
|
|
41
|
-
export function hexOf(color) {
|
|
42
|
-
const text = color.trim().toLowerCase();
|
|
43
|
-
if (/^#[0-9a-f]{6}$/.test(text))
|
|
44
|
-
return text;
|
|
45
|
-
const unit = /^color\(srgb\s+(\S+)\s+(\S+)\s+(\S+)(?:\s*\/\s*\S+)?\)$/.exec(text);
|
|
46
|
-
if (unit) {
|
|
47
|
-
const [red, green, blue] = unit.slice(1, 4).map((each) => Number.parseFloat(each) * 255);
|
|
48
|
-
return toHex(red, green, blue);
|
|
49
|
-
}
|
|
50
|
-
const rgb = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+[\d.]+%?)?\s*\)$/.exec(text);
|
|
51
|
-
if (rgb) {
|
|
52
|
-
const [red, green, blue] = rgb.slice(1, 4).map((each) => Number.parseFloat(each));
|
|
53
|
-
return toHex(red, green, blue);
|
|
54
|
-
}
|
|
55
|
-
return undefined;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* The color of a state as the page draws it here: our tokens, with the host's values and the
|
|
59
|
-
* scheme (light or dark) of the element. Asked of a probe placed inside `host`, so it follows
|
|
60
|
-
* whatever the host set on the provider or above it. A color the browser cannot give is the
|
|
61
|
-
* fallback's.
|
|
62
|
-
*/
|
|
63
|
-
export function resolveColor(host, state) {
|
|
64
|
-
const probe = host.ownerDocument.createElement("span");
|
|
65
|
-
host.append(probe);
|
|
66
|
-
try {
|
|
67
|
-
// Mixed with itself in sRGB, so the browser answers in a notation `hexOf` reads whatever
|
|
68
|
-
// space the token was written in.
|
|
69
|
-
probe.style.color = `color-mix(in srgb, ${TOKENS[state]}, ${TOKENS[state]})`;
|
|
70
|
-
return hexOf(getComputedStyle(probe).color) ?? FALLBACK_COLORS[state];
|
|
71
|
-
}
|
|
72
|
-
finally {
|
|
73
|
-
probe.remove();
|
|
74
|
-
}
|
|
75
|
-
}
|
package/dist/voice/pushable.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** An async iterable that is fed from outside, for events that arrive when they please. */
|
|
2
|
-
export interface Pushable<T> {
|
|
3
|
-
readonly iterable: AsyncIterable<T>;
|
|
4
|
-
push: (item: T) => void;
|
|
5
|
-
/** Nothing more will come: the iteration ends once what was pushed has been read. */
|
|
6
|
-
end: () => void;
|
|
7
|
-
/** The source broke: the iteration throws `error` once what was pushed has been read. */
|
|
8
|
-
fail: (error: unknown) => void;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Turns a callback source (a recognizer's `onresult`) into something to `for await` over. Items
|
|
12
|
-
* are kept until they are read, in order. `onClose` runs when the reader is done, however it
|
|
13
|
-
* left: the iteration ended, threw, or the reader broke out of its loop, so the source is never
|
|
14
|
-
* left running for nobody.
|
|
15
|
-
*/
|
|
16
|
-
export declare function pushable<T>(onClose: () => void): Pushable<T>;
|
package/dist/voice/pushable.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Turns a callback source (a recognizer's `onresult`) into something to `for await` over. Items
|
|
3
|
-
* are kept until they are read, in order. `onClose` runs when the reader is done, however it
|
|
4
|
-
* left: the iteration ended, threw, or the reader broke out of its loop, so the source is never
|
|
5
|
-
* left running for nobody.
|
|
6
|
-
*/
|
|
7
|
-
export function pushable(onClose) {
|
|
8
|
-
const items = [];
|
|
9
|
-
let ending;
|
|
10
|
-
let wake;
|
|
11
|
-
const notify = () => {
|
|
12
|
-
wake?.();
|
|
13
|
-
wake = undefined;
|
|
14
|
-
};
|
|
15
|
-
async function* read() {
|
|
16
|
-
try {
|
|
17
|
-
for (;;) {
|
|
18
|
-
const next = items.shift();
|
|
19
|
-
if (next) {
|
|
20
|
-
yield next.value;
|
|
21
|
-
}
|
|
22
|
-
else if (ending === "end") {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
else if (ending) {
|
|
26
|
-
throw ending.error;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
await new Promise((resolve) => {
|
|
30
|
-
wake = resolve;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
onClose();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
iterable: read(),
|
|
41
|
-
push: (item) => {
|
|
42
|
-
if (ending)
|
|
43
|
-
return;
|
|
44
|
-
items.push({ value: item });
|
|
45
|
-
notify();
|
|
46
|
-
},
|
|
47
|
-
end: () => {
|
|
48
|
-
ending ??= "end";
|
|
49
|
-
notify();
|
|
50
|
-
},
|
|
51
|
-
fail: (error) => {
|
|
52
|
-
ending ??= { error };
|
|
53
|
-
notify();
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export interface DictationOptions {
|
|
2
|
-
/** The language spoken, as a BCP 47 tag (`"es-ES"`). */
|
|
3
|
-
lang: string;
|
|
4
|
-
/** A sentence settled: the person paused, and these words will not change. */
|
|
5
|
-
onFinal: (text: string) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface Dictation {
|
|
8
|
-
/** Whether this browser can listen. Where it cannot, nothing else is offered. */
|
|
9
|
-
supported: boolean;
|
|
10
|
-
listening: boolean;
|
|
11
|
-
/** The words being heard now, which may still change. Empty between sentences. */
|
|
12
|
-
interim: string;
|
|
13
|
-
start: () => void;
|
|
14
|
-
/** Stops listening. What was said just before still arrives. */
|
|
15
|
-
stop: () => void;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Dictating into a message box: the words settle into `onFinal` sentence by sentence while
|
|
19
|
-
* `interim` shows what is still being heard, until `stop`, or until the browser ends the session
|
|
20
|
-
* or refuses the microphone. It is the voice window's transport (`webSpeechVoice`) without the
|
|
21
|
-
* conversation, and without reading the microphone's level, which a box to write in does not
|
|
22
|
-
* show and some browsers do not like having a second reader of.
|
|
23
|
-
*/
|
|
24
|
-
export declare function useDictation({ lang, onFinal }: DictationOptions): Dictation;
|