@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/request/apps.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { safeUrl } from "../safeUrl.js";
|
|
3
|
-
import { useParts } from "../SignalcoreProvider.js";
|
|
4
|
-
/** `googlecalendar` stays as it is, `google_calendar` becomes "Google Calendar". */
|
|
5
|
-
function readable(provider) {
|
|
6
|
-
const slug = provider.slice(provider.indexOf(":") + 1);
|
|
7
|
-
return slug
|
|
8
|
-
.split(/[_\s-]+/)
|
|
9
|
-
.filter(Boolean)
|
|
10
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
11
|
-
.join(" ");
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* How the owner calls an app: the host's name for it, else the slug made readable, else `none`
|
|
15
|
-
* ("the app").
|
|
16
|
-
*/
|
|
17
|
-
export function appName(apps, provider, none) {
|
|
18
|
-
return apps?.name?.(provider) ?? ((provider && readable(provider)) || none);
|
|
19
|
-
}
|
|
20
|
-
/** An app's mark: the host's, else the one the app declared (over https), else a monogram. */
|
|
21
|
-
export function AppLogo({ apps, mark }) {
|
|
22
|
-
const part = useParts();
|
|
23
|
-
if (apps?.logo)
|
|
24
|
-
return _jsx(_Fragment, { children: apps.logo(mark) });
|
|
25
|
-
const picture = safeUrl(mark.icon);
|
|
26
|
-
return (_jsx("span", { "aria-hidden": true, ...part("app-logo"), style: { width: mark.size, height: mark.size, fontSize: mark.size * 0.46 }, children: picture ? _jsx("img", { src: picture, alt: "" }) : mark.name.trim().charAt(0).toUpperCase() || "?" }));
|
|
27
|
-
}
|
package/dist/request/cards.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { RequestCardData, RequestKind } from "./types.js";
|
|
2
|
-
export declare function isAnswerable(kind: string): kind is RequestKind;
|
|
3
|
-
/** A request as the API lists it (`requests.pending`), with all its card needs. */
|
|
4
|
-
export interface ListedRequest {
|
|
5
|
-
id: string;
|
|
6
|
-
agent_id: string;
|
|
7
|
-
kind: string;
|
|
8
|
-
title: string;
|
|
9
|
-
payload: Record<string, unknown>;
|
|
10
|
-
}
|
|
11
|
-
/** The card for a listed request; nothing for a kind that is only told, or not known here. */
|
|
12
|
-
export declare function cardOf(request: ListedRequest): RequestCardData | undefined;
|
package/dist/request/cards.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/** Kinds that have a card; a `notify` is only told, and a kind from a newer API is left alone. */
|
|
2
|
-
const ANSWERABLE = new Set([
|
|
3
|
-
"question",
|
|
4
|
-
"choice",
|
|
5
|
-
"connect",
|
|
6
|
-
"upload",
|
|
7
|
-
"approval",
|
|
8
|
-
"secret",
|
|
9
|
-
]);
|
|
10
|
-
export function isAnswerable(kind) {
|
|
11
|
-
return ANSWERABLE.has(kind);
|
|
12
|
-
}
|
|
13
|
-
/** The card for a listed request; nothing for a kind that is only told, or not known here. */
|
|
14
|
-
export function cardOf(request) {
|
|
15
|
-
if (!isAnswerable(request.kind))
|
|
16
|
-
return undefined;
|
|
17
|
-
return {
|
|
18
|
-
request_id: request.id,
|
|
19
|
-
agent_id: request.agent_id,
|
|
20
|
-
kind: request.kind,
|
|
21
|
-
title: request.title,
|
|
22
|
-
payload: request.payload,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { UiClient } from "../client.js";
|
|
2
|
-
import type { Resolution } from "./types.js";
|
|
3
|
-
/** How the host hears of an answer; see `RequestCard`. */
|
|
4
|
-
export type OnResolve = (resolution: Resolution) => void | Promise<void>;
|
|
5
|
-
/** Whether an answer has anywhere to go: the API through the client, or the host. */
|
|
6
|
-
export declare function canAnswer(client: UiClient | undefined, onResolve: OnResolve | undefined): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Gets an answer to where it belongs. With a client the API takes it, and the host is told
|
|
9
|
-
* afterwards; without one the host takes it from here, and the card counts it answered when the
|
|
10
|
-
* host does. Throws when it cannot be delivered, which the card shows: `cannotAnswer` says why.
|
|
11
|
-
*/
|
|
12
|
-
export declare function deliver(client: UiClient | undefined, onResolve: OnResolve | undefined, resolution: Resolution, cannotAnswer: string): Promise<void>;
|
package/dist/request/deliver.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Whether an answer has anywhere to go: the API through the client, or the host. */
|
|
2
|
-
export function canAnswer(client, onResolve) {
|
|
3
|
-
return client?.requests !== undefined || onResolve !== undefined;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Gets an answer to where it belongs. With a client the API takes it, and the host is told
|
|
7
|
-
* afterwards; without one the host takes it from here, and the card counts it answered when the
|
|
8
|
-
* host does. Throws when it cannot be delivered, which the card shows: `cannotAnswer` says why.
|
|
9
|
-
*/
|
|
10
|
-
export async function deliver(client, onResolve, resolution, cannotAnswer) {
|
|
11
|
-
if (client?.requests) {
|
|
12
|
-
await client.requests.resolve(resolution.request_id, {
|
|
13
|
-
value: resolution.value,
|
|
14
|
-
reject: resolution.reject,
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else if (!onResolve) {
|
|
18
|
-
throw new Error(cannotAnswer);
|
|
19
|
-
}
|
|
20
|
-
await onResolve?.(resolution);
|
|
21
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { RequestCardData } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A question whose payload carries the browser is a hand-over: the agent stopped at a login or a
|
|
4
|
-
* payment and the owner takes the controls, in the live view, then says when it is done.
|
|
5
|
-
*/
|
|
6
|
-
export interface HandOver {
|
|
7
|
-
session_id: string;
|
|
8
|
-
live_url: string | null;
|
|
9
|
-
/** The live stream showing the browser, when it has one: watched in preference to the rest. */
|
|
10
|
-
stream_id: string | null;
|
|
11
|
-
url: string;
|
|
12
|
-
title: string;
|
|
13
|
-
/** Why the agent stopped, in its words: the card's heading when it said. */
|
|
14
|
-
reason: string | null;
|
|
15
|
-
/** What the owner has to do in the browser, in order (the page marks them with the same numbers). */
|
|
16
|
-
steps: string[];
|
|
17
|
-
}
|
|
18
|
-
export declare function handOverOf(card: RequestCardData): HandOver | null;
|
package/dist/request/handOver.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export function handOverOf(card) {
|
|
2
|
-
if (card.kind !== "question")
|
|
3
|
-
return null;
|
|
4
|
-
const browser = card.payload.browser;
|
|
5
|
-
if (!browser || typeof browser !== "object")
|
|
6
|
-
return null;
|
|
7
|
-
const fields = browser;
|
|
8
|
-
const session = fields["session_id"];
|
|
9
|
-
if (typeof session !== "string")
|
|
10
|
-
return null;
|
|
11
|
-
const text = (key) => (typeof fields[key] === "string" ? fields[key] : "");
|
|
12
|
-
const reason = card.payload.reason;
|
|
13
|
-
return {
|
|
14
|
-
session_id: session,
|
|
15
|
-
live_url: text("live_url") || null,
|
|
16
|
-
stream_id: text("stream_id") || null,
|
|
17
|
-
url: text("url"),
|
|
18
|
-
title: text("title"),
|
|
19
|
-
reason: typeof reason === "string" && reason.trim() ? reason.trim() : null,
|
|
20
|
-
steps: instructionsOf(card.payload.steps),
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** The instructions of `payload.steps`, in order; anything that is not one is skipped. */
|
|
24
|
-
function instructionsOf(value) {
|
|
25
|
-
if (!Array.isArray(value))
|
|
26
|
-
return [];
|
|
27
|
-
return value.flatMap((step) => {
|
|
28
|
-
if (!step || typeof step !== "object")
|
|
29
|
-
return [];
|
|
30
|
-
const instruction = step["instruction"];
|
|
31
|
-
return typeof instruction === "string" && instruction.trim() ? [instruction.trim()] : [];
|
|
32
|
-
});
|
|
33
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "../../parts/Button.js";
|
|
3
|
-
import { useMessages, useParts } from "../../SignalcoreProvider.js";
|
|
4
|
-
/** Allow the action or turn it down. What it would do is shown above, by `ApprovalPreview`. */
|
|
5
|
-
export function Approval({ reply, busy }) {
|
|
6
|
-
const part = useParts();
|
|
7
|
-
const messages = useMessages();
|
|
8
|
-
return (_jsxs("div", { ...part("request__actions"), children: [_jsx(Button, { size: "sm", variant: "primary", disabled: busy, onClick: () => void reply(true, messages.approved), children: messages.approve }), _jsx(Button, { size: "sm", disabled: busy, onClick: () => void reply(false, messages.rejected, true), children: messages.reject })] }));
|
|
9
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button } from "../../parts/Button.js";
|
|
3
|
-
import { useParts } from "../../SignalcoreProvider.js";
|
|
4
|
-
/** Pick one of the options the agent offered; the pick is the answer. */
|
|
5
|
-
export function Choice({ card, reply, busy }) {
|
|
6
|
-
const part = useParts();
|
|
7
|
-
return (_jsx("div", { ...part("request__actions"), children: (card.payload.options ?? []).map((option) => (_jsx(Button, { size: "sm", disabled: busy, onClick: () => void reply(option, option), children: option }, option))) }));
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { KindProps } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* OAuth in a popup. The consent link is asked for on the click, when the client can: the one the
|
|
4
|
-
* card was made with is good for one attempt and expires, and a card answered hours later would
|
|
5
|
-
* send the owner to a dead flow. The callback page tells us when it is done (a message from our
|
|
6
|
-
* own origin); we confirm with the API, and while the consent window is open we ask it every few
|
|
7
|
-
* seconds, since the provider may not send the browser back (local addresses, an unlisted domain).
|
|
8
|
-
*/
|
|
9
|
-
export declare function Connect({ card, busy, reply, apps }: KindProps): import("react").JSX.Element;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useEffectEvent, useState } from "react";
|
|
3
|
-
import { Button } from "../../parts/Button.js";
|
|
4
|
-
import { ErrorText } from "../../parts/Input.js";
|
|
5
|
-
import { safeUrl } from "../../safeUrl.js";
|
|
6
|
-
import { useMessages, useParts, useSignalcore } from "../../SignalcoreProvider.js";
|
|
7
|
-
import { AppLogo, appName } from "../apps.js";
|
|
8
|
-
const POLL_MS = 3_000;
|
|
9
|
-
const GIVE_UP_MS = 5 * 60_000;
|
|
10
|
-
const POPUP = "width=520,height=720";
|
|
11
|
-
/**
|
|
12
|
-
* OAuth in a popup. The consent link is asked for on the click, when the client can: the one the
|
|
13
|
-
* card was made with is good for one attempt and expires, and a card answered hours later would
|
|
14
|
-
* send the owner to a dead flow. The callback page tells us when it is done (a message from our
|
|
15
|
-
* own origin); we confirm with the API, and while the consent window is open we ask it every few
|
|
16
|
-
* seconds, since the provider may not send the browser back (local addresses, an unlisted domain).
|
|
17
|
-
*/
|
|
18
|
-
export function Connect({ card, busy, reply, apps }) {
|
|
19
|
-
const part = useParts();
|
|
20
|
-
const messages = useMessages();
|
|
21
|
-
const { url, connection_id: connectionId, provider, icon } = card.payload;
|
|
22
|
-
const app = appName(apps, provider, messages.theApp);
|
|
23
|
-
const connections = useSignalcore().client?.connections;
|
|
24
|
-
const [status, setStatus] = useState(null);
|
|
25
|
-
const [polling, setPolling] = useState(false);
|
|
26
|
-
const authorize = safeUrl(url);
|
|
27
|
-
/** Whether the app is connected; a client that cannot ask takes the owner's word for it. */
|
|
28
|
-
const isConnected = async () => {
|
|
29
|
-
if (!connections || !connectionId)
|
|
30
|
-
return true;
|
|
31
|
-
return (await connections.refresh(connectionId)).status === "active";
|
|
32
|
-
};
|
|
33
|
-
const connected = () => reply("connected", messages.connected(app));
|
|
34
|
-
const check = async () => {
|
|
35
|
-
try {
|
|
36
|
-
if (await isConnected())
|
|
37
|
-
await connected();
|
|
38
|
-
else
|
|
39
|
-
setStatus(messages.notConnectedYet);
|
|
40
|
-
}
|
|
41
|
-
catch (reason) {
|
|
42
|
-
setStatus(reason instanceof Error ? reason.message : messages.cannotSend);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Where the owner authorizes now; `""` when nothing is left to authorize. A client that
|
|
47
|
-
* cannot ask, or an answer that is not a safe address, leaves the link the card came with.
|
|
48
|
-
*/
|
|
49
|
-
const freshLink = async () => {
|
|
50
|
-
if (!connections || !connectionId)
|
|
51
|
-
return authorize;
|
|
52
|
-
try {
|
|
53
|
-
const pending = await connections.authorize(connectionId);
|
|
54
|
-
return pending.url ? (safeUrl(pending.url) ?? authorize) : "";
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
return authorize;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const openConsent = async () => {
|
|
61
|
-
// Opened on the click itself: browsers block a window opened after an await.
|
|
62
|
-
const popup = window.open("", "sc-connect", POPUP);
|
|
63
|
-
setPolling(true);
|
|
64
|
-
const link = await freshLink();
|
|
65
|
-
if (!link) {
|
|
66
|
-
popup?.close();
|
|
67
|
-
setPolling(false);
|
|
68
|
-
if (link === "")
|
|
69
|
-
await connected();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (popup)
|
|
73
|
-
popup.location.href = link;
|
|
74
|
-
else
|
|
75
|
-
window.open(link, "sc-connect", POPUP);
|
|
76
|
-
};
|
|
77
|
-
const onCallback = useEffectEvent(() => void check());
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
const onMessage = (event) => {
|
|
80
|
-
const data = event.data;
|
|
81
|
-
if (event.origin === window.location.origin && data?.type === "sc:connected")
|
|
82
|
-
onCallback();
|
|
83
|
-
};
|
|
84
|
-
window.addEventListener("message", onMessage);
|
|
85
|
-
return () => {
|
|
86
|
-
window.removeEventListener("message", onMessage);
|
|
87
|
-
};
|
|
88
|
-
}, []);
|
|
89
|
-
const onTick = useEffectEvent(async () => {
|
|
90
|
-
if (connections &&
|
|
91
|
-
connectionId &&
|
|
92
|
-
(await connections.refresh(connectionId)).status === "active") {
|
|
93
|
-
setPolling(false);
|
|
94
|
-
await connected();
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
useEffect(() => {
|
|
98
|
-
if (!polling || !connections || !connectionId)
|
|
99
|
-
return undefined;
|
|
100
|
-
const started = Date.now();
|
|
101
|
-
const timer = window.setInterval(() => {
|
|
102
|
-
if (Date.now() - started > GIVE_UP_MS)
|
|
103
|
-
setPolling(false);
|
|
104
|
-
else
|
|
105
|
-
void onTick().catch(() => undefined);
|
|
106
|
-
}, POLL_MS);
|
|
107
|
-
return () => {
|
|
108
|
-
window.clearInterval(timer);
|
|
109
|
-
};
|
|
110
|
-
}, [polling, connections, connectionId]);
|
|
111
|
-
if (!url) {
|
|
112
|
-
// Nothing to authorize: the app needs no account, or the owner already gave access.
|
|
113
|
-
return (_jsxs("div", { ...part("request__form"), children: [_jsx("p", { ...part("request__details"), children: messages.alreadyConnected(app) }), _jsx("div", { children: _jsx(Button, { size: "sm", variant: "primary", disabled: busy, onClick: () => void connected(), children: messages.continue }) })] }));
|
|
114
|
-
}
|
|
115
|
-
return (_jsxs("div", { ...part("request__form"), children: [_jsxs("div", { ...part("request__actions", ["center"]), children: [_jsxs("button", { type: "button", disabled: busy || !authorize, "aria-busy": polling, ...part("app-button", [polling && "waiting"]), onClick: () => {
|
|
116
|
-
if (authorize)
|
|
117
|
-
void openConsent();
|
|
118
|
-
}, children: [_jsxs("span", { ...part("app-button__logo"), children: [_jsx(AppLogo, { apps: apps, mark: { provider, name: app, icon, size: 24 } }), polling && _jsx("span", { "aria-hidden": true, ...part("app-button__ping") })] }), polling ? messages.waitingFor(app) : messages.connectWith(app)] }), _jsx(Button, { size: "sm", variant: "ghost", disabled: busy, onClick: () => void check(), children: messages.iConnectedIt }), _jsx(Button, { size: "sm", variant: "ghost", disabled: busy, onClick: () => void reply("skip", messages.notNow, true), children: messages.notNow })] }), status && _jsx("p", { ...part("request__hint"), children: status }), !authorize && _jsx(ErrorText, { children: messages.unsafeAddress })] }));
|
|
119
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Button } from "../../parts/Button.js";
|
|
4
|
-
import { Input } from "../../parts/Input.js";
|
|
5
|
-
import { useMessages, useParts } from "../../SignalcoreProvider.js";
|
|
6
|
-
/** A question with no options: the owner answers in a line. */
|
|
7
|
-
export function FreeText({ reply, busy }) {
|
|
8
|
-
const part = useParts();
|
|
9
|
-
const messages = useMessages();
|
|
10
|
-
const [value, setValue] = useState("");
|
|
11
|
-
const submit = (event) => {
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
const text = value.trim();
|
|
14
|
-
if (text)
|
|
15
|
-
void reply(text, text);
|
|
16
|
-
};
|
|
17
|
-
return (_jsxs("form", { onSubmit: submit, ...part("request__form"), children: [_jsx(Input, { value: value, onChange: (event) => {
|
|
18
|
-
setValue(event.target.value);
|
|
19
|
-
}, placeholder: messages.yourAnswer, autoFocus: true }), _jsx("div", { children: _jsx(Button, { type: "submit", size: "sm", variant: "primary", disabled: busy || !value.trim(), children: messages.reply }) })] }));
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { HandOver as HandOverData } from "../handOver.js";
|
|
2
|
-
import type { Reply } from "../types.js";
|
|
3
|
-
/**
|
|
4
|
-
* The owner takes the controls of the agent's browser right here (a login, a payment: their
|
|
5
|
-
* data stays in the hosted browser, nothing passes through us) and says when it is done.
|
|
6
|
-
*/
|
|
7
|
-
export declare function HandOver({ handOver, busy, reply, active, }: {
|
|
8
|
-
handOver: HandOverData;
|
|
9
|
-
busy: boolean;
|
|
10
|
-
reply: Reply;
|
|
11
|
-
/** A hand-over the owner is in the middle of: its browser takes the room. */
|
|
12
|
-
active: boolean;
|
|
13
|
-
}): import("react").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { BrowserView } from "../../browser/BrowserView.js";
|
|
3
|
-
import { Button } from "../../parts/Button.js";
|
|
4
|
-
import { useMessages, useParts } from "../../SignalcoreProvider.js";
|
|
5
|
-
/**
|
|
6
|
-
* The owner takes the controls of the agent's browser right here (a login, a payment: their
|
|
7
|
-
* data stays in the hosted browser, nothing passes through us) and says when it is done.
|
|
8
|
-
*/
|
|
9
|
-
export function HandOver({ handOver, busy, reply, active, }) {
|
|
10
|
-
const part = useParts();
|
|
11
|
-
const messages = useMessages();
|
|
12
|
-
const { steps } = handOver;
|
|
13
|
-
return (_jsxs("div", { ...part("handover", [steps.length > 0 && "steps"]), children: [_jsx(BrowserView, { mode: "guiding", sessionId: handOver.session_id, liveUrl: handOver.live_url ?? undefined, streamId: handOver.stream_id ?? undefined, url: handOver.url, title: handOver.title, active: active }), _jsxs("div", { ...part("handover__side"), children: [steps.length > 0 && _jsx(Steps, { steps: steps }), _jsx("p", { ...part("request__details"), children: messages.doItInTheBrowser }), _jsx("div", { children: _jsx(Button, { size: "sm", variant: "primary", disabled: busy, onClick: () => void reply(messages.done, messages.done), children: messages.done }) })] })] }));
|
|
14
|
-
}
|
|
15
|
-
/** What the owner has to do in the browser, in order, numbered as the page marks it. */
|
|
16
|
-
function Steps({ steps }) {
|
|
17
|
-
const part = useParts();
|
|
18
|
-
const messages = useMessages();
|
|
19
|
-
return (_jsx("ol", { "aria-label": messages.steps, ...part("steps"), children: steps.map((instruction, index) => (_jsxs("li", { ...part("steps__item"), children: [_jsx("span", { ...part("steps__number"), children: index + 1 }), _jsx("span", { ...part("steps__text"), children: instruction })] }, index))) }));
|
|
20
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { KindProps } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A key typed straight into the vault: it goes to the vault API through the client, never into
|
|
4
|
-
* the host's callbacks, the chat, the builder or the transcript. The agent only learns that it
|
|
5
|
-
* was saved. Without a client that can store it, the card says so instead of taking it.
|
|
6
|
-
*/
|
|
7
|
-
export declare function Secret({ card, busy, reply }: KindProps): import("react").JSX.Element;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Button } from "../../parts/Button.js";
|
|
4
|
-
import { ErrorText, Input } from "../../parts/Input.js";
|
|
5
|
-
import { useMessages, useParts, useSignalcore } from "../../SignalcoreProvider.js";
|
|
6
|
-
/**
|
|
7
|
-
* A key typed straight into the vault: it goes to the vault API through the client, never into
|
|
8
|
-
* the host's callbacks, the chat, the builder or the transcript. The agent only learns that it
|
|
9
|
-
* was saved. Without a client that can store it, the card says so instead of taking it.
|
|
10
|
-
*/
|
|
11
|
-
export function Secret({ card, busy, reply }) {
|
|
12
|
-
const part = useParts();
|
|
13
|
-
const messages = useMessages();
|
|
14
|
-
const vault = useSignalcore().client?.vault;
|
|
15
|
-
const name = card.payload.secret_name ?? "";
|
|
16
|
-
const hosts = card.payload.hosts ?? [];
|
|
17
|
-
const [value, setValue] = useState("");
|
|
18
|
-
const [saving, setSaving] = useState(false);
|
|
19
|
-
const [error, setError] = useState(null);
|
|
20
|
-
const submit = async (event) => {
|
|
21
|
-
event.preventDefault();
|
|
22
|
-
const secret = value.trim();
|
|
23
|
-
if (!secret || !vault)
|
|
24
|
-
return;
|
|
25
|
-
setSaving(true);
|
|
26
|
-
setError(null);
|
|
27
|
-
try {
|
|
28
|
-
await vault.put(name, {
|
|
29
|
-
value: secret,
|
|
30
|
-
hosts,
|
|
31
|
-
...(card.title ? { description: card.title } : {}),
|
|
32
|
-
...(card.agent_id ? { agent_id: card.agent_id } : {}),
|
|
33
|
-
});
|
|
34
|
-
setValue("");
|
|
35
|
-
await reply("saved", messages.savedInVault);
|
|
36
|
-
}
|
|
37
|
-
catch (reason) {
|
|
38
|
-
setError(reason instanceof Error ? reason.message : messages.cannotSend);
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
setSaving(false);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
if (!vault)
|
|
45
|
-
return _jsx("p", { ...part("request__details"), children: messages.cannotStoreHere });
|
|
46
|
-
return (_jsxs("form", { onSubmit: (event) => void submit(event), ...part("request__form"), children: [_jsx("p", { ...part("request__name"), children: name }), _jsx(Input, { type: "password", autoComplete: "off", spellCheck: false, value: value, onChange: (event) => {
|
|
47
|
-
setValue(event.target.value);
|
|
48
|
-
}, placeholder: messages.pasteTheKey, "aria-label": messages.secretValue(name) }), _jsx("p", { ...part("request__hint"), children: messages.storedEncrypted }), hosts.length > 0 && (_jsxs("p", { ...part("request__hint"), children: [messages.onlySentTo, _jsx("span", { ...part("request__name"), children: hosts.join(", ") }), "."] })), error && _jsx(ErrorText, { children: error }), _jsx("div", { children: _jsx(Button, { type: "submit", size: "sm", variant: "primary", loading: saving, disabled: busy || !value.trim(), children: messages.saveInVault }) })] }));
|
|
49
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { KindProps } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* A document for the agent's knowledge base, uploaded right from the card through the client.
|
|
4
|
-
* Without a client that can store it, the card says so instead of taking a file.
|
|
5
|
-
*/
|
|
6
|
-
export declare function Upload({ card, busy, reply }: KindProps): import("react").JSX.Element;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { Icon } from "../../parts/Icon.js";
|
|
4
|
-
import { ErrorText } from "../../parts/Input.js";
|
|
5
|
-
import { useMessages, useParts, useSignalcore } from "../../SignalcoreProvider.js";
|
|
6
|
-
/** What the knowledge base reads; the API turns away the rest. */
|
|
7
|
-
const ACCEPTED = ".pdf,.txt,.md,.csv,.html,.htm";
|
|
8
|
-
/**
|
|
9
|
-
* A document for the agent's knowledge base, uploaded right from the card through the client.
|
|
10
|
-
* Without a client that can store it, the card says so instead of taking a file.
|
|
11
|
-
*/
|
|
12
|
-
export function Upload({ card, busy, reply }) {
|
|
13
|
-
const part = useParts();
|
|
14
|
-
const messages = useMessages();
|
|
15
|
-
const documents = useSignalcore().client?.documents;
|
|
16
|
-
const [uploading, setUploading] = useState(false);
|
|
17
|
-
const [error, setError] = useState(null);
|
|
18
|
-
const upload = async (files) => {
|
|
19
|
-
const file = files?.[0];
|
|
20
|
-
if (!file || !documents)
|
|
21
|
-
return;
|
|
22
|
-
setUploading(true);
|
|
23
|
-
setError(null);
|
|
24
|
-
try {
|
|
25
|
-
const document = await documents.addFile(file, {
|
|
26
|
-
shared: true,
|
|
27
|
-
...(card.agent_id ? { agent_id: card.agent_id } : {}),
|
|
28
|
-
});
|
|
29
|
-
if (document.status === "failed") {
|
|
30
|
-
setError(document.error ?? messages.cannotReadFile);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
await reply(document.id, messages.uploaded(document.title));
|
|
34
|
-
}
|
|
35
|
-
catch (reason) {
|
|
36
|
-
setError(reason instanceof Error ? reason.message : messages.cannotUpload);
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
setUploading(false);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
if (!documents)
|
|
43
|
-
return _jsx("p", { ...part("request__details"), children: messages.cannotStoreHere });
|
|
44
|
-
return (_jsxs("div", { ...part("request__form"), children: [_jsxs("label", { ...part("drop", [(busy || uploading) && "busy"]), children: [_jsx(Icon, { name: "upload", slot: "drop__icon" }), uploading ? messages.uploading : messages.chooseAFile, _jsx("input", { type: "file", accept: ACCEPTED, hidden: true, onChange: (event) => {
|
|
45
|
-
void upload(event.target.files);
|
|
46
|
-
} })] }), error && _jsx(ErrorText, { children: error })] }));
|
|
47
|
-
}
|
package/dist/request/types.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
/** The kinds of request an owner answers; `notify` is only told, so it has no card. */
|
|
3
|
-
export type RequestKind = "question" | "choice" | "connect" | "upload" | "approval" | "secret";
|
|
4
|
-
/** What a request carries for its card. Which fields are there depends on the kind. */
|
|
5
|
-
export interface RequestPayload {
|
|
6
|
-
/** The choices of a `choice`. */
|
|
7
|
-
options?: string[];
|
|
8
|
-
/** The app a `connect` or a `secret` is about, as a slug: `googlecalendar`. */
|
|
9
|
-
provider?: string;
|
|
10
|
-
/** The app's own mark, kept on its connection. */
|
|
11
|
-
icon?: string | null;
|
|
12
|
-
details?: string;
|
|
13
|
-
/** Where the owner authorizes an app (`connect`); missing when there is nothing to authorize. */
|
|
14
|
-
url?: string;
|
|
15
|
-
connection_id?: string;
|
|
16
|
-
/** The name a `secret` is kept under in the vault. */
|
|
17
|
-
secret_name?: string;
|
|
18
|
-
/** The hosts a secret may be sent to, as the builder asked for it. */
|
|
19
|
-
hosts?: string[];
|
|
20
|
-
/** A hand-over or an approval about a hosted browser: which session and where it is. */
|
|
21
|
-
browser?: unknown;
|
|
22
|
-
/** Why the agent gave the owner the controls, in its words (a hand-over). */
|
|
23
|
-
reason?: string;
|
|
24
|
-
/** What the owner has to do in the browser, in order; `ref` names the element for the page. */
|
|
25
|
-
steps?: {
|
|
26
|
-
instruction: string;
|
|
27
|
-
ref?: string | null;
|
|
28
|
-
}[];
|
|
29
|
-
/** The calls a paused turn stopped at, and what the agent's code attached to show (approval). */
|
|
30
|
-
calls?: unknown;
|
|
31
|
-
preview?: unknown;
|
|
32
|
-
}
|
|
33
|
-
/** A request, as its card needs it: the API's `RequestOut`, under the name the card uses. */
|
|
34
|
-
export interface RequestCardData {
|
|
35
|
-
request_id: string;
|
|
36
|
-
/** Which agent asked; set where cards are shown outside one agent's page (the inbox). */
|
|
37
|
-
agent_id?: string | undefined;
|
|
38
|
-
kind: RequestKind;
|
|
39
|
-
title: string;
|
|
40
|
-
payload: RequestPayload;
|
|
41
|
-
}
|
|
42
|
-
/** What the owner answered. */
|
|
43
|
-
export interface Resolution {
|
|
44
|
-
request_id: string;
|
|
45
|
-
/** What goes to the API as the answer: `true` approves, an option, a line of text. */
|
|
46
|
-
value: unknown;
|
|
47
|
-
/** The owner turned it down (Rechazar, Ahora no). */
|
|
48
|
-
reject: boolean;
|
|
49
|
-
/** The answer in words, as the card shows it afterwards: "Aprobado". */
|
|
50
|
-
label: string;
|
|
51
|
-
}
|
|
52
|
-
/** An app, to draw its mark. */
|
|
53
|
-
export interface AppMark {
|
|
54
|
-
provider: string | null | undefined;
|
|
55
|
-
/** How the app is called. */
|
|
56
|
-
name: string;
|
|
57
|
-
/** The mark the app declared itself, if it did. */
|
|
58
|
-
icon: string | null | undefined;
|
|
59
|
-
/** The site of an app that is a server of its own, for a host that finds its logo there. */
|
|
60
|
-
website?: string | null | undefined;
|
|
61
|
-
/** In pixels. */
|
|
62
|
-
size: number;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* How a host knows its apps. The package has no catalog of brands: without this an app is its
|
|
66
|
-
* name made readable and a monogram. The web app passes the logos it already has.
|
|
67
|
-
*/
|
|
68
|
-
export interface AppDirectory {
|
|
69
|
-
/** How an app is called, from its slug: `googlecalendar` → "Google Calendar". */
|
|
70
|
-
name?: (provider: string | undefined) => string | undefined;
|
|
71
|
-
/** An app's mark, `size` pixels wide. */
|
|
72
|
-
logo?: (app: AppMark) => ReactNode;
|
|
73
|
-
}
|
|
74
|
-
/** Answers the card's request; what each kind of card calls when its owner decides. */
|
|
75
|
-
export type Reply = (value: unknown, shown: string, reject?: boolean) => Promise<void>;
|
|
76
|
-
/** What every kind of card is given. */
|
|
77
|
-
export interface KindProps {
|
|
78
|
-
card: RequestCardData;
|
|
79
|
-
reply: Reply;
|
|
80
|
-
/** Nothing can be pressed: an answer is on its way, or the host asked for it to wait. */
|
|
81
|
-
busy: boolean;
|
|
82
|
-
apps: AppDirectory | undefined;
|
|
83
|
-
}
|
package/dist/request/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/safeUrl.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An address a model gave us, if it is safe to put in front of the user: `https://` only. An
|
|
3
|
-
* image, a link and a live browser view all go through this, so no surface can point the page at
|
|
4
|
-
* a `javascript:` or `data:` address, or at plain `http`.
|
|
5
|
-
*/
|
|
6
|
-
export declare function safeUrl(url: string | null | undefined): string | undefined;
|
package/dist/safeUrl.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* An address a model gave us, if it is safe to put in front of the user: `https://` only. An
|
|
3
|
-
* image, a link and a live browser view all go through this, so no surface can point the page at
|
|
4
|
-
* a `javascript:` or `data:` address, or at plain `http`.
|
|
5
|
-
*/
|
|
6
|
-
export function safeUrl(url) {
|
|
7
|
-
return url?.startsWith("https://") ? url : undefined;
|
|
8
|
-
}
|