@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
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { CheckIcon, TableIcon, WarningCircleIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { useId, type ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import type { AppDirectory } from "../AgentAbout";
|
|
5
|
+
import { joined, useKit, useParts } from "../kit/context";
|
|
6
|
+
import { List, Row } from "../kit/List";
|
|
7
|
+
import { Stat, Stats } from "../kit/Stat";
|
|
8
|
+
import { Switch } from "../kit/Switch";
|
|
9
|
+
import { Tag } from "../kit/Tag";
|
|
10
|
+
import { AppMark, ByMark, TriggerMark, USES } from "./marks";
|
|
11
|
+
import type { AutomationMessages } from "./messages";
|
|
12
|
+
import type { Automation as Shown, AutomationState, Board, Run, Step, Trigger } from "./types";
|
|
13
|
+
import { lineOf, momentOf } from "./when";
|
|
14
|
+
|
|
15
|
+
export interface AutomationProps {
|
|
16
|
+
automation: Shown;
|
|
17
|
+
/** Its newest runs, newest first; without them the part is left out. */
|
|
18
|
+
runs?: readonly Run[] | undefined;
|
|
19
|
+
/** Switching it on and off, the host's call; without it there is no switch (a conversation's). */
|
|
20
|
+
onSwitch?: ((on: boolean) => void) | undefined;
|
|
21
|
+
/** The switch's change is on its way: it holds still. */
|
|
22
|
+
switching?: boolean | undefined;
|
|
23
|
+
/** The host's controls after the switch (taking a contact's task away). */
|
|
24
|
+
actions?: ReactNode | undefined;
|
|
25
|
+
/** Opening a run's record; without it the runs only read. */
|
|
26
|
+
onOpenRun?: ((run: Run) => void) | undefined;
|
|
27
|
+
/** The run open beside it, marked in the list. */
|
|
28
|
+
openRun?: string | null | undefined;
|
|
29
|
+
/** The host's logos for apps; without them an app shows the logo the API gives. */
|
|
30
|
+
apps?: AppDirectory | undefined;
|
|
31
|
+
/** What time it is, for the words that say when; now by default. */
|
|
32
|
+
now?: Date | undefined;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** How the state reads on its pill: running well, paused, or its last run failed. */
|
|
37
|
+
const STATE_TONES: Readonly<Record<AutomationState, "success" | "danger" | undefined>> = {
|
|
38
|
+
active: "success",
|
|
39
|
+
paused: undefined,
|
|
40
|
+
failing: "danger",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** The values of its table shown as figures; the rest are counted after them. */
|
|
44
|
+
const SHOWN_COUNTS = 4;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* One automation, as its owner reads it: a head with what starts it (a clock, a webhook, the
|
|
48
|
+
* app whose event it waits for) as a 40px mark, its title, when it runs in words with its next
|
|
49
|
+
* run, and how it stands (with the host's switch, when it gives one); the owner's own sentence of
|
|
50
|
+
* what it does, set apart; its steps, numbered, each with what it uses; the table it moves, as a
|
|
51
|
+
* figure per value; and its runs, each with what started it and when, its line, how it ended.
|
|
52
|
+
* It only draws: switching it and opening a run are the host's (`onSwitch`, `onOpenRun`).
|
|
53
|
+
*/
|
|
54
|
+
export function Automation({
|
|
55
|
+
automation,
|
|
56
|
+
runs,
|
|
57
|
+
onSwitch,
|
|
58
|
+
switching,
|
|
59
|
+
actions,
|
|
60
|
+
onOpenRun,
|
|
61
|
+
openRun,
|
|
62
|
+
apps,
|
|
63
|
+
now = new Date(),
|
|
64
|
+
className,
|
|
65
|
+
}: AutomationProps) {
|
|
66
|
+
const part = useParts();
|
|
67
|
+
const { messages, code } = useKit();
|
|
68
|
+
const words = messages.automation;
|
|
69
|
+
const title = useId();
|
|
70
|
+
return (
|
|
71
|
+
<section aria-labelledby={title} className={joined(part("sc-automation"), className)}>
|
|
72
|
+
<header className={part("sc-automation__head")}>
|
|
73
|
+
<TriggerMark trigger={automation.trigger} size={40} apps={apps} />
|
|
74
|
+
<div className={part("sc-automation__heading")}>
|
|
75
|
+
<h3 id={title} className={part("sc-automation__title")}>
|
|
76
|
+
{automation.title}
|
|
77
|
+
</h3>
|
|
78
|
+
<p className={part("sc-automation__when")}>{lineOf(automation, now, words, code)}</p>
|
|
79
|
+
</div>
|
|
80
|
+
<div className={part("sc-automation__end")}>
|
|
81
|
+
<Tag tone={STATE_TONES[automation.state]}>
|
|
82
|
+
<i aria-hidden className={part("sc-automation__dot")} />
|
|
83
|
+
{words.states[automation.state]}
|
|
84
|
+
</Tag>
|
|
85
|
+
{onSwitch !== undefined && (
|
|
86
|
+
<Switch
|
|
87
|
+
checked={automation.on}
|
|
88
|
+
onChange={onSwitch}
|
|
89
|
+
label={words.switchLabel}
|
|
90
|
+
disabled={switching}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
{actions}
|
|
94
|
+
</div>
|
|
95
|
+
</header>
|
|
96
|
+
{automation.summary !== "" && (
|
|
97
|
+
<p className={part("sc-automation__summary")}>{automation.summary}</p>
|
|
98
|
+
)}
|
|
99
|
+
{automation.steps.length > 0 && <Steps steps={automation.steps} words={words} apps={apps} />}
|
|
100
|
+
{automation.board !== null && automation.board.counts.length > 0 && (
|
|
101
|
+
<BoardView board={automation.board} words={words} />
|
|
102
|
+
)}
|
|
103
|
+
{runs !== undefined && (
|
|
104
|
+
<Runs
|
|
105
|
+
runs={runs}
|
|
106
|
+
trigger={automation.trigger}
|
|
107
|
+
words={words}
|
|
108
|
+
apps={apps}
|
|
109
|
+
now={now}
|
|
110
|
+
code={code}
|
|
111
|
+
onOpenRun={onOpenRun}
|
|
112
|
+
openRun={openRun ?? null}
|
|
113
|
+
/>
|
|
114
|
+
)}
|
|
115
|
+
</section>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** A part of it under its small label. */
|
|
120
|
+
function Part({ label, children }: { label: ReactNode; children: ReactNode }) {
|
|
121
|
+
const part = useParts();
|
|
122
|
+
const id = useId();
|
|
123
|
+
return (
|
|
124
|
+
<section aria-labelledby={id} className={part("sc-automation__section")}>
|
|
125
|
+
<h4 id={id} className={part("sc-automation__label")}>
|
|
126
|
+
{label}
|
|
127
|
+
</h4>
|
|
128
|
+
{children}
|
|
129
|
+
</section>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Its steps in the code's order: a number, the step's name, and what it uses at the right. */
|
|
134
|
+
function Steps({
|
|
135
|
+
steps,
|
|
136
|
+
words,
|
|
137
|
+
apps,
|
|
138
|
+
}: {
|
|
139
|
+
steps: readonly Step[];
|
|
140
|
+
words: AutomationMessages;
|
|
141
|
+
apps: AppDirectory | undefined;
|
|
142
|
+
}) {
|
|
143
|
+
const part = useParts();
|
|
144
|
+
return (
|
|
145
|
+
<Part label={words.steps}>
|
|
146
|
+
<ol className={part("sc-automation__steps")}>
|
|
147
|
+
{steps.map((step, index) => (
|
|
148
|
+
<li key={`${index}:${step.name}`} className={part("sc-automation__step")}>
|
|
149
|
+
<span aria-hidden className={part("sc-automation__number")}>
|
|
150
|
+
{index + 1}
|
|
151
|
+
</span>
|
|
152
|
+
<span className={part("sc-automation__name")}>{step.name}</span>
|
|
153
|
+
{step.uses.length > 0 && (
|
|
154
|
+
<span className={part("sc-automation__uses")}>
|
|
155
|
+
{step.uses.map((use, at) => {
|
|
156
|
+
const key = `${at}:${use.kind}:${use.app ?? ""}`;
|
|
157
|
+
if (use.kind !== "app") {
|
|
158
|
+
const Glyph = USES[use.kind];
|
|
159
|
+
return (
|
|
160
|
+
<span key={key} className={part("sc-automation__use")}>
|
|
161
|
+
<Glyph aria-hidden weight="regular" />
|
|
162
|
+
{words.uses[use.kind]}
|
|
163
|
+
</span>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
const name = use.title ?? use.app ?? "";
|
|
167
|
+
return (
|
|
168
|
+
<span key={key} className={part("sc-automation__use")}>
|
|
169
|
+
<AppMark name={name} icon={use.icon} size={18} apps={apps} />
|
|
170
|
+
{name}
|
|
171
|
+
</span>
|
|
172
|
+
);
|
|
173
|
+
})}
|
|
174
|
+
</span>
|
|
175
|
+
)}
|
|
176
|
+
</li>
|
|
177
|
+
))}
|
|
178
|
+
</ol>
|
|
179
|
+
</Part>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const capital = (text: string): string => text.charAt(0).toUpperCase() + text.slice(1);
|
|
184
|
+
|
|
185
|
+
/** The table it moves: its title, then a figure per value (the biggest few, and how many more). */
|
|
186
|
+
function BoardView({ board, words }: { board: Board; words: AutomationMessages }) {
|
|
187
|
+
const part = useParts();
|
|
188
|
+
const shown = board.counts.slice(0, SHOWN_COUNTS);
|
|
189
|
+
const more = board.counts.length - shown.length;
|
|
190
|
+
return (
|
|
191
|
+
<Part
|
|
192
|
+
label={
|
|
193
|
+
<>
|
|
194
|
+
<TableIcon aria-hidden />
|
|
195
|
+
{board.title}
|
|
196
|
+
</>
|
|
197
|
+
}
|
|
198
|
+
>
|
|
199
|
+
<div className={part("sc-automation__board")}>
|
|
200
|
+
<Stats label={board.title}>
|
|
201
|
+
{shown.map((count) => (
|
|
202
|
+
<Stat key={count.value} label={capital(count.value)} value={count.count} />
|
|
203
|
+
))}
|
|
204
|
+
</Stats>
|
|
205
|
+
{more > 0 && <span className={part("sc-automation__more")}>{words.more(more)}</span>}
|
|
206
|
+
</div>
|
|
207
|
+
</Part>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Its runs, newest first: what started each (its mark, when, by what), its line, why it failed
|
|
213
|
+
* in the danger tone, and at the right a check once it went well; a test's line says what it
|
|
214
|
+
* would have done.
|
|
215
|
+
*/
|
|
216
|
+
function Runs({
|
|
217
|
+
runs,
|
|
218
|
+
trigger,
|
|
219
|
+
words,
|
|
220
|
+
apps,
|
|
221
|
+
now,
|
|
222
|
+
code,
|
|
223
|
+
onOpenRun,
|
|
224
|
+
openRun,
|
|
225
|
+
}: {
|
|
226
|
+
runs: readonly Run[];
|
|
227
|
+
trigger: Trigger;
|
|
228
|
+
words: AutomationMessages;
|
|
229
|
+
apps: AppDirectory | undefined;
|
|
230
|
+
now: Date;
|
|
231
|
+
code: string;
|
|
232
|
+
onOpenRun: ((run: Run) => void) | undefined;
|
|
233
|
+
openRun: string | null;
|
|
234
|
+
}) {
|
|
235
|
+
const part = useParts();
|
|
236
|
+
const app = trigger.app_title ?? trigger.app;
|
|
237
|
+
return (
|
|
238
|
+
<Part label={words.runs}>
|
|
239
|
+
{runs.length === 0 ? (
|
|
240
|
+
<p className={part("sc-automation__empty")}>{words.noRuns}</p>
|
|
241
|
+
) : (
|
|
242
|
+
<div className={part("sc-automation__runs")}>
|
|
243
|
+
<List>
|
|
244
|
+
{runs.map((run) => (
|
|
245
|
+
<Row
|
|
246
|
+
key={run.id}
|
|
247
|
+
className={run.id === openRun ? part("sc-automation__run--open") : undefined}
|
|
248
|
+
mark={
|
|
249
|
+
<span
|
|
250
|
+
role="img"
|
|
251
|
+
aria-label={words.by(run.by, app)}
|
|
252
|
+
title={words.by(run.by, app)}
|
|
253
|
+
className={part("sc-run__by")}
|
|
254
|
+
>
|
|
255
|
+
<ByMark by={run.by} trigger={trigger} size={28} apps={apps} />
|
|
256
|
+
</span>
|
|
257
|
+
}
|
|
258
|
+
title={momentOf(new Date(run.started_at), now, words, code)}
|
|
259
|
+
subtitle={
|
|
260
|
+
run.summary === null ? undefined : run.dry ? words.dry(run.summary) : run.summary
|
|
261
|
+
}
|
|
262
|
+
error={
|
|
263
|
+
run.status === "failed" && run.error !== null ? (
|
|
264
|
+
<span>
|
|
265
|
+
<WarningCircleIcon aria-hidden weight="fill" />
|
|
266
|
+
{run.error}
|
|
267
|
+
</span>
|
|
268
|
+
) : undefined
|
|
269
|
+
}
|
|
270
|
+
meta={<RunStatus run={run} words={words} />}
|
|
271
|
+
onPress={onOpenRun && (() => onOpenRun(run))}
|
|
272
|
+
/>
|
|
273
|
+
))}
|
|
274
|
+
</List>
|
|
275
|
+
</div>
|
|
276
|
+
)}
|
|
277
|
+
</Part>
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* How a run stands, at its row's right: a check once done; the words while it goes, waits or was
|
|
283
|
+
* skipped; nothing once it failed (its error says so, under it).
|
|
284
|
+
*/
|
|
285
|
+
function RunStatus({ run, words }: { run: Run; words: AutomationMessages }) {
|
|
286
|
+
const part = useParts();
|
|
287
|
+
switch (run.status) {
|
|
288
|
+
case "done":
|
|
289
|
+
return (
|
|
290
|
+
<span role="img" aria-label={words.statuses.done} className={part("sc-automation__status")}>
|
|
291
|
+
<CheckIcon aria-hidden weight="bold" />
|
|
292
|
+
</span>
|
|
293
|
+
);
|
|
294
|
+
case "failed":
|
|
295
|
+
return null;
|
|
296
|
+
case "running":
|
|
297
|
+
return (
|
|
298
|
+
<Tag tone="info">
|
|
299
|
+
<i aria-hidden className={part("sc-run__live")} />
|
|
300
|
+
{words.statuses.running}
|
|
301
|
+
</Tag>
|
|
302
|
+
);
|
|
303
|
+
case "waiting":
|
|
304
|
+
return <Tag tone="warning">{words.statuses.waiting}</Tag>;
|
|
305
|
+
case "skipped":
|
|
306
|
+
return <Tag>{words.statuses.skipped}</Tag>;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ChatCircleIcon, ChatsCircleIcon } from "@phosphor-icons/react";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
|
|
4
|
+
import type { AppDirectory } from "../AgentAbout";
|
|
5
|
+
import { Button } from "../kit/Button";
|
|
6
|
+
import { joined, useKit, useParts } from "../kit/context";
|
|
7
|
+
import { Note } from "../kit/Note";
|
|
8
|
+
import { Tag } from "../kit/Tag";
|
|
9
|
+
import { ByMark, callMark } from "./marks";
|
|
10
|
+
import type { AutomationMessages } from "./messages";
|
|
11
|
+
import { appOf, groupsOf, namingOf, type Names, type StepGroup } from "./record";
|
|
12
|
+
import type { Automation, RunRecord, RunStatus } from "./types";
|
|
13
|
+
import { momentOf, tookOf } from "./when";
|
|
14
|
+
|
|
15
|
+
export interface RunViewProps {
|
|
16
|
+
run: RunRecord;
|
|
17
|
+
/** The automation it is a run of: its steps' order, its apps' names and logos, its table. */
|
|
18
|
+
automation?: Automation | null | undefined;
|
|
19
|
+
/** Opening a conversation the run opened, or the one it was asked in; without it, none opens. */
|
|
20
|
+
onOpenConversation?: ((id: string) => void) | undefined;
|
|
21
|
+
/** The host's logos for apps; without them an app shows the logo the API gives. */
|
|
22
|
+
apps?: AppDirectory | undefined;
|
|
23
|
+
/** What time it is, for the words that say when; now by default. */
|
|
24
|
+
now?: Date | undefined;
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const STATUS_TONES: Readonly<
|
|
29
|
+
Record<RunStatus, "success" | "danger" | "info" | "warning" | undefined>
|
|
30
|
+
> = {
|
|
31
|
+
running: "info",
|
|
32
|
+
waiting: "warning",
|
|
33
|
+
done: "success",
|
|
34
|
+
failed: "danger",
|
|
35
|
+
skipped: undefined,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One run, as its owner reads it: a head with what started it, when, how long it took and how it
|
|
40
|
+
* stands; the line it returned (a test's, as what it would have done); why it failed, in words;
|
|
41
|
+
* then what it did, step by step in the code's order, each call in words ("Buscó en Gmail",
|
|
42
|
+
* "Añadió una fila a Citas"; a test's writes as "Habría…"), the same call in a row once with how
|
|
43
|
+
* many; and the conversations it opened, each opening through the host.
|
|
44
|
+
*/
|
|
45
|
+
export function RunView({
|
|
46
|
+
run,
|
|
47
|
+
automation = null,
|
|
48
|
+
onOpenConversation,
|
|
49
|
+
apps,
|
|
50
|
+
now = new Date(),
|
|
51
|
+
className,
|
|
52
|
+
}: RunViewProps) {
|
|
53
|
+
const part = useParts();
|
|
54
|
+
const { messages, code } = useKit();
|
|
55
|
+
const words = messages.automation;
|
|
56
|
+
const title = useId();
|
|
57
|
+
const names = namingOf(automation);
|
|
58
|
+
const groups = groupsOf(run.steps, words.calls, names);
|
|
59
|
+
const order = (automation?.steps ?? []).map((step) => step.name);
|
|
60
|
+
const app = automation?.trigger.app_title ?? automation?.trigger.app ?? null;
|
|
61
|
+
// What started it is its mark's to show; its words are the mark's name, and its hint.
|
|
62
|
+
const by = words.by(run.by, app);
|
|
63
|
+
const took = tookOf(run, words);
|
|
64
|
+
return (
|
|
65
|
+
<article aria-labelledby={title} className={joined(part("sc-run"), className)}>
|
|
66
|
+
<header className={part("sc-run__head")}>
|
|
67
|
+
<span role="img" aria-label={by} title={by} className={part("sc-run__by")}>
|
|
68
|
+
<ByMark by={run.by} trigger={automation?.trigger ?? null} size={40} apps={apps} />
|
|
69
|
+
</span>
|
|
70
|
+
<div className={part("sc-run__heading")}>
|
|
71
|
+
<h3 id={title} className={part("sc-run__title")}>
|
|
72
|
+
{run.title}
|
|
73
|
+
</h3>
|
|
74
|
+
<p className={part("sc-run__meta")}>
|
|
75
|
+
{momentOf(new Date(run.started_at), now, words, code)}
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
<div className={part("sc-run__end")}>
|
|
79
|
+
<Tag tone={STATUS_TONES[run.status]}>
|
|
80
|
+
{run.status === "running" && <i aria-hidden className={part("sc-run__live")} />}
|
|
81
|
+
{words.statuses[run.status]}
|
|
82
|
+
</Tag>
|
|
83
|
+
{took !== null && <span className={part("sc-run__took")}>{took}</span>}
|
|
84
|
+
</div>
|
|
85
|
+
</header>
|
|
86
|
+
{run.summary !== null && (
|
|
87
|
+
<p className={part("sc-run__summary")}>{run.dry ? words.dry(run.summary) : run.summary}</p>
|
|
88
|
+
)}
|
|
89
|
+
{run.status === "failed" && run.error !== null && <Note tone="danger">{run.error}</Note>}
|
|
90
|
+
{groups.length === 0 ? (
|
|
91
|
+
run.status !== "running" && <p className={part("sc-run__empty")}>{words.noCalls}</p>
|
|
92
|
+
) : (
|
|
93
|
+
<ol className={part("sc-run__steps")}>
|
|
94
|
+
{groups.map((group, index) => (
|
|
95
|
+
<Group
|
|
96
|
+
key={`${index}:${group.step ?? ""}`}
|
|
97
|
+
group={group}
|
|
98
|
+
number={group.step === null ? null : order.indexOf(group.step) + 1 || index + 1}
|
|
99
|
+
names={names}
|
|
100
|
+
words={words}
|
|
101
|
+
apps={apps}
|
|
102
|
+
/>
|
|
103
|
+
))}
|
|
104
|
+
</ol>
|
|
105
|
+
)}
|
|
106
|
+
{run.status === "running" && (
|
|
107
|
+
<p className={part("sc-run__empty")}>
|
|
108
|
+
<i aria-hidden className={part("sc-run__live")} />
|
|
109
|
+
{words.statuses.running}
|
|
110
|
+
</p>
|
|
111
|
+
)}
|
|
112
|
+
{onOpenConversation !== undefined &&
|
|
113
|
+
(run.opened.length > 0 || run.conversation_id !== null) && (
|
|
114
|
+
<Links run={run} words={words} onOpen={onOpenConversation} />
|
|
115
|
+
)}
|
|
116
|
+
</article>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** One step of the run: its number and name, then its calls in words. */
|
|
121
|
+
function Group({
|
|
122
|
+
group,
|
|
123
|
+
number,
|
|
124
|
+
names,
|
|
125
|
+
words,
|
|
126
|
+
apps,
|
|
127
|
+
}: {
|
|
128
|
+
group: StepGroup;
|
|
129
|
+
number: number | null;
|
|
130
|
+
names: Names;
|
|
131
|
+
words: AutomationMessages;
|
|
132
|
+
apps: AppDirectory | undefined;
|
|
133
|
+
}) {
|
|
134
|
+
const part = useParts();
|
|
135
|
+
return (
|
|
136
|
+
<li className={part("sc-run__step")}>
|
|
137
|
+
<p className={part("sc-run__name")}>
|
|
138
|
+
<span aria-hidden className={part("sc-run__number")}>
|
|
139
|
+
{number ?? "·"}
|
|
140
|
+
</span>
|
|
141
|
+
{group.step ?? words.outside}
|
|
142
|
+
</p>
|
|
143
|
+
<ul className={part("sc-run__calls")}>
|
|
144
|
+
{group.lines.map((line) => {
|
|
145
|
+
const first = line.calls[0];
|
|
146
|
+
const alias = first ? appOf(first.call) : null;
|
|
147
|
+
return (
|
|
148
|
+
<li
|
|
149
|
+
key={line.seq}
|
|
150
|
+
className={part(
|
|
151
|
+
"sc-run__call",
|
|
152
|
+
...(line.would ? (["sc-run__call--would"] as const) : []),
|
|
153
|
+
...(line.error !== null ? (["sc-run__call--failed"] as const) : []),
|
|
154
|
+
)}
|
|
155
|
+
>
|
|
156
|
+
{first &&
|
|
157
|
+
callMark(
|
|
158
|
+
first,
|
|
159
|
+
alias === null ? null : { name: names.app(alias), icon: names.icon(alias) },
|
|
160
|
+
apps,
|
|
161
|
+
20,
|
|
162
|
+
)}
|
|
163
|
+
<span>
|
|
164
|
+
{line.text}
|
|
165
|
+
{line.count > 1 && (
|
|
166
|
+
<span className={part("sc-run__count")}> {words.times(line.count)}</span>
|
|
167
|
+
)}
|
|
168
|
+
{line.error !== null && <span className={part("sc-run__error")}>{line.error}</span>}
|
|
169
|
+
</span>
|
|
170
|
+
</li>
|
|
171
|
+
);
|
|
172
|
+
})}
|
|
173
|
+
</ul>
|
|
174
|
+
</li>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** The conversation it was asked in, then the ones it opened: each a button the host opens. */
|
|
179
|
+
function Links({
|
|
180
|
+
run,
|
|
181
|
+
words,
|
|
182
|
+
onOpen,
|
|
183
|
+
}: {
|
|
184
|
+
run: RunRecord;
|
|
185
|
+
words: AutomationMessages;
|
|
186
|
+
onOpen: (id: string) => void;
|
|
187
|
+
}) {
|
|
188
|
+
const part = useParts();
|
|
189
|
+
const asked = run.conversation_id;
|
|
190
|
+
return (
|
|
191
|
+
<>
|
|
192
|
+
{asked !== null && (
|
|
193
|
+
<div className={part("sc-run__links")}>
|
|
194
|
+
<Button size="sm" icon={ChatCircleIcon} onClick={() => onOpen(asked)}>
|
|
195
|
+
{words.askedIn}
|
|
196
|
+
</Button>
|
|
197
|
+
</div>
|
|
198
|
+
)}
|
|
199
|
+
{run.opened.length > 0 && (
|
|
200
|
+
<section className={part("sc-run__section")}>
|
|
201
|
+
<h4 className={part("sc-run__label")}>{words.opened}</h4>
|
|
202
|
+
<div className={part("sc-run__links")}>
|
|
203
|
+
{run.opened.map((id, index) => (
|
|
204
|
+
<Button key={id} size="sm" icon={ChatsCircleIcon} onClick={() => onOpen(id)}>
|
|
205
|
+
{words.conversation(index + 1)}
|
|
206
|
+
</Button>
|
|
207
|
+
))}
|
|
208
|
+
</div>
|
|
209
|
+
</section>
|
|
210
|
+
)}
|
|
211
|
+
</>
|
|
212
|
+
);
|
|
213
|
+
}
|