@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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A schedule's cron line, read into what it fires at: the moments of a day (a squad's day, an
|
|
3
|
+
* automation's next runs) and the sentence that says it (`whenOf`). Five fields (minute, hour,
|
|
4
|
+
* day of the month, month, day of the week) with `*`, lists, ranges, steps and English names, as
|
|
5
|
+
* the API's croniter reads them; anything past that is not read (null).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface Cron {
|
|
9
|
+
minutes: ReadonlySet<number>;
|
|
10
|
+
hours: ReadonlySet<number>;
|
|
11
|
+
/** Day of the month, 1–31. */
|
|
12
|
+
days: ReadonlySet<number>;
|
|
13
|
+
/** 1–12. */
|
|
14
|
+
months: ReadonlySet<number>;
|
|
15
|
+
/** 0–6, Sunday 0. */
|
|
16
|
+
weekdays: ReadonlySet<number>;
|
|
17
|
+
/** Left open (`*`): cron's rule for days reads which of the two narrows them. */
|
|
18
|
+
anyDay: boolean;
|
|
19
|
+
anyWeekday: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface Field {
|
|
23
|
+
min: number;
|
|
24
|
+
max: number;
|
|
25
|
+
names?: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const MONTH_NAMES = [
|
|
29
|
+
"jan",
|
|
30
|
+
"feb",
|
|
31
|
+
"mar",
|
|
32
|
+
"apr",
|
|
33
|
+
"may",
|
|
34
|
+
"jun",
|
|
35
|
+
"jul",
|
|
36
|
+
"aug",
|
|
37
|
+
"sep",
|
|
38
|
+
"oct",
|
|
39
|
+
"nov",
|
|
40
|
+
"dec",
|
|
41
|
+
] as const;
|
|
42
|
+
const WEEKDAY_NAMES = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] as const;
|
|
43
|
+
|
|
44
|
+
const FIELDS: readonly Field[] = [
|
|
45
|
+
{ min: 0, max: 59 },
|
|
46
|
+
{ min: 0, max: 23 },
|
|
47
|
+
{ min: 1, max: 31 },
|
|
48
|
+
{ min: 1, max: 12, names: MONTH_NAMES },
|
|
49
|
+
{ min: 0, max: 7, names: WEEKDAY_NAMES },
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
/** One value of a field: a number in its bounds, or one of its names (`mon`, `jan`). */
|
|
53
|
+
function valueOf(text: string, field: Field): number | null {
|
|
54
|
+
const named = field.names?.indexOf(text.toLowerCase()) ?? -1;
|
|
55
|
+
if (named >= 0) return named + field.min;
|
|
56
|
+
if (!/^\d+$/.test(text)) return null;
|
|
57
|
+
const value = Number(text);
|
|
58
|
+
return value >= field.min && value <= field.max ? value : null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A field's values: `*`, `5`, `1-5`, `*` every 15, `8-18` every 2, `mon-fri`, and lists of them. */
|
|
62
|
+
function parseField(text: string, field: Field): number[] | null {
|
|
63
|
+
const values = new Set<number>();
|
|
64
|
+
for (const part of text.split(",")) {
|
|
65
|
+
const [range = "", stepText] = part.split("/");
|
|
66
|
+
const step = stepText === undefined ? 1 : Number(stepText);
|
|
67
|
+
if (!Number.isInteger(step) || step < 1) return null;
|
|
68
|
+
let from: number | null;
|
|
69
|
+
let to: number | null;
|
|
70
|
+
if (range === "*") {
|
|
71
|
+
[from, to] = [field.min, field.max];
|
|
72
|
+
} else {
|
|
73
|
+
const [first = "", last] = range.split("-");
|
|
74
|
+
from = valueOf(first, field);
|
|
75
|
+
// "8/2" runs from 8 to the end of the field, as cron reads it.
|
|
76
|
+
to = last !== undefined ? valueOf(last, field) : stepText !== undefined ? field.max : from;
|
|
77
|
+
}
|
|
78
|
+
if (from === null || to === null || from > to) return null;
|
|
79
|
+
for (let value = from; value <= to; value += step) values.add(value);
|
|
80
|
+
}
|
|
81
|
+
return [...values];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A cron line of five fields, or null when it is anything else. */
|
|
85
|
+
export function parseCron(line: string): Cron | null {
|
|
86
|
+
const texts = line.trim().split(/\s+/);
|
|
87
|
+
if (texts.length !== 5) return null;
|
|
88
|
+
const [minutes, hours, days, months, weekdays] = texts.map((text, at) => {
|
|
89
|
+
const field = FIELDS[at];
|
|
90
|
+
return field ? parseField(text, field) : null;
|
|
91
|
+
});
|
|
92
|
+
if (!minutes || !hours || !days || !months || !weekdays) return null;
|
|
93
|
+
return {
|
|
94
|
+
minutes: new Set(minutes),
|
|
95
|
+
hours: new Set(hours),
|
|
96
|
+
days: new Set(days),
|
|
97
|
+
months: new Set(months),
|
|
98
|
+
// 7 is Sunday too.
|
|
99
|
+
weekdays: new Set(weekdays.map((day) => day % 7)),
|
|
100
|
+
anyDay: texts[2]?.startsWith("*") ?? false,
|
|
101
|
+
anyWeekday: texts[4]?.startsWith("*") ?? false,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** A moment as a zone's clock reads it. */
|
|
106
|
+
export interface Wall {
|
|
107
|
+
minute: number;
|
|
108
|
+
hour: number;
|
|
109
|
+
day: number;
|
|
110
|
+
month: number;
|
|
111
|
+
weekday: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Whether the line fires at that minute. Days follow cron's rule: when both the day of the month
|
|
116
|
+
* and the day of the week are narrowed, either one is enough.
|
|
117
|
+
*/
|
|
118
|
+
export function fires(cron: Cron, at: Wall): boolean {
|
|
119
|
+
if (!cron.minutes.has(at.minute) || !cron.hours.has(at.hour) || !cron.months.has(at.month)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
const day = cron.days.has(at.day);
|
|
123
|
+
const weekday = cron.weekdays.has(at.weekday);
|
|
124
|
+
if (cron.anyDay && cron.anyWeekday) return true;
|
|
125
|
+
if (cron.anyDay) return weekday;
|
|
126
|
+
if (cron.anyWeekday) return day;
|
|
127
|
+
return day || weekday;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const MINUTE = 60_000;
|
|
131
|
+
/** How often the zone's offset is read again: a quarter of an hour meets every zone's changes. */
|
|
132
|
+
const QUARTER = 15 * MINUTE;
|
|
133
|
+
|
|
134
|
+
const clocks = new Map<string, Intl.DateTimeFormat>();
|
|
135
|
+
|
|
136
|
+
/** The zone's clock, kept; an unknown zone reads as UTC, the API's default. */
|
|
137
|
+
function clockOf(zone: string): Intl.DateTimeFormat {
|
|
138
|
+
let clock = clocks.get(zone);
|
|
139
|
+
if (!clock) {
|
|
140
|
+
const options: Intl.DateTimeFormatOptions = {
|
|
141
|
+
hourCycle: "h23",
|
|
142
|
+
year: "numeric",
|
|
143
|
+
month: "numeric",
|
|
144
|
+
day: "numeric",
|
|
145
|
+
hour: "numeric",
|
|
146
|
+
minute: "numeric",
|
|
147
|
+
second: "numeric",
|
|
148
|
+
};
|
|
149
|
+
try {
|
|
150
|
+
clock = new Intl.DateTimeFormat("en-US", { ...options, timeZone: zone });
|
|
151
|
+
} catch {
|
|
152
|
+
clock = new Intl.DateTimeFormat("en-US", { ...options, timeZone: "UTC" });
|
|
153
|
+
}
|
|
154
|
+
clocks.set(zone, clock);
|
|
155
|
+
}
|
|
156
|
+
return clock;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** How far the zone's clock is ahead of UTC at a moment, in milliseconds. */
|
|
160
|
+
export function offsetOf(zone: string, at: Date): number {
|
|
161
|
+
const parts = clockOf(zone).formatToParts(at);
|
|
162
|
+
const part = (type: Intl.DateTimeFormatPartTypes) =>
|
|
163
|
+
Number(parts.find((each) => each.type === type)?.value ?? 0);
|
|
164
|
+
const wall = Date.UTC(
|
|
165
|
+
part("year"),
|
|
166
|
+
part("month") - 1,
|
|
167
|
+
part("day"),
|
|
168
|
+
part("hour") % 24,
|
|
169
|
+
part("minute"),
|
|
170
|
+
part("second"),
|
|
171
|
+
);
|
|
172
|
+
return wall - Math.floor(at.getTime() / 1000) * 1000;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Every moment in [from, to) the line fires at, read on the clock of `zone`. */
|
|
176
|
+
export function occurrences(cron: Cron, zone: string, from: Date, to: Date): Date[] {
|
|
177
|
+
const out: Date[] = [];
|
|
178
|
+
let quarter = Number.NaN;
|
|
179
|
+
let offset = 0;
|
|
180
|
+
for (let at = Math.ceil(from.getTime() / MINUTE) * MINUTE; at < to.getTime(); at += MINUTE) {
|
|
181
|
+
if (Math.floor(at / QUARTER) !== quarter) {
|
|
182
|
+
quarter = Math.floor(at / QUARTER);
|
|
183
|
+
offset = offsetOf(zone, new Date(at));
|
|
184
|
+
}
|
|
185
|
+
const wall = new Date(at + offset);
|
|
186
|
+
const fired = fires(cron, {
|
|
187
|
+
minute: wall.getUTCMinutes(),
|
|
188
|
+
hour: wall.getUTCHours(),
|
|
189
|
+
day: wall.getUTCDate(),
|
|
190
|
+
month: wall.getUTCMonth() + 1,
|
|
191
|
+
weekday: wall.getUTCDay(),
|
|
192
|
+
});
|
|
193
|
+
if (fired) out.push(new Date(at));
|
|
194
|
+
}
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BellIcon,
|
|
3
|
+
BrainIcon,
|
|
4
|
+
ChatCircleIcon,
|
|
5
|
+
ChatTextIcon,
|
|
6
|
+
ChatsCircleIcon,
|
|
7
|
+
ClockIcon,
|
|
8
|
+
FileTextIcon,
|
|
9
|
+
FlaskIcon,
|
|
10
|
+
GlobeIcon,
|
|
11
|
+
LightningIcon,
|
|
12
|
+
SparkleIcon,
|
|
13
|
+
TableIcon,
|
|
14
|
+
WebhooksLogoIcon,
|
|
15
|
+
type Icon,
|
|
16
|
+
} from "@phosphor-icons/react";
|
|
17
|
+
import type { ReactNode } from "react";
|
|
18
|
+
|
|
19
|
+
import type { AppDirectory } from "../AgentAbout";
|
|
20
|
+
import { Mark } from "../kit/Mark";
|
|
21
|
+
import { sentOn } from "./record";
|
|
22
|
+
import type { RunBy, RunStep, Trigger, Use } from "./types";
|
|
23
|
+
|
|
24
|
+
/** Only an https logo is loaded: never a script, never a local file. */
|
|
25
|
+
const https = (url: string | null): url is string => url !== null && /^https:\/\//i.test(url);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* An app's mark: the host's logo when it draws apps (`apps`), else the logo the API gives, else
|
|
29
|
+
* the app's initial; each bare, as `Mark` draws it.
|
|
30
|
+
*/
|
|
31
|
+
export function AppMark({
|
|
32
|
+
name,
|
|
33
|
+
icon,
|
|
34
|
+
size,
|
|
35
|
+
apps,
|
|
36
|
+
}: {
|
|
37
|
+
name: string;
|
|
38
|
+
icon: string | null;
|
|
39
|
+
size: number;
|
|
40
|
+
apps: AppDirectory | undefined;
|
|
41
|
+
}) {
|
|
42
|
+
if (apps !== undefined) return <>{apps.logo({ provider: "", name, icon, size })}</>;
|
|
43
|
+
if (https(icon)) return <Mark src={icon} size={size} />;
|
|
44
|
+
return (
|
|
45
|
+
<Mark size={size}>
|
|
46
|
+
<span>{name.trim().charAt(0).toUpperCase() || "?"}</span>
|
|
47
|
+
</Mark>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const KINDS: Readonly<Record<Exclude<Trigger["kind"], "event">, Icon>> = {
|
|
52
|
+
schedule: ClockIcon,
|
|
53
|
+
webhook: WebhooksLogoIcon,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** What starts an automation, as a mark: a clock, a webhook, the app whose event it waits for. */
|
|
57
|
+
export function TriggerMark({
|
|
58
|
+
trigger,
|
|
59
|
+
size,
|
|
60
|
+
apps,
|
|
61
|
+
}: {
|
|
62
|
+
trigger: Trigger;
|
|
63
|
+
size: number;
|
|
64
|
+
apps: AppDirectory | undefined;
|
|
65
|
+
}) {
|
|
66
|
+
if (trigger.kind !== "event") return <Mark icon={KINDS[trigger.kind]} size={size} />;
|
|
67
|
+
const name = trigger.app_title ?? trigger.app;
|
|
68
|
+
if (name === null) return <Mark icon={LightningIcon} size={size} />;
|
|
69
|
+
return <AppMark name={name} icon={trigger.icon} size={size} apps={apps} />;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** What started a run: its time, a call, its app's event, a chat with the agent, a test. */
|
|
73
|
+
const BY: Readonly<Record<Exclude<RunBy, "event">, Icon>> = {
|
|
74
|
+
schedule: ClockIcon,
|
|
75
|
+
webhook: WebhooksLogoIcon,
|
|
76
|
+
agent: ChatCircleIcon,
|
|
77
|
+
test: FlaskIcon,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export function ByMark({
|
|
81
|
+
by,
|
|
82
|
+
trigger,
|
|
83
|
+
size,
|
|
84
|
+
apps,
|
|
85
|
+
}: {
|
|
86
|
+
by: RunBy;
|
|
87
|
+
/** The automation's, for an event's app; none, a plain mark. */
|
|
88
|
+
trigger: Trigger | null;
|
|
89
|
+
size: number;
|
|
90
|
+
apps: AppDirectory | undefined;
|
|
91
|
+
}) {
|
|
92
|
+
if (by !== "event") return <Mark icon={BY[by]} size={size} />;
|
|
93
|
+
return trigger === null ? (
|
|
94
|
+
<Mark icon={LightningIcon} size={size} />
|
|
95
|
+
) : (
|
|
96
|
+
<TriggerMark trigger={trigger} size={size} apps={apps} />
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* What a step uses, other than an app: the model, the agent, the inbox, a message on a channel, a
|
|
102
|
+
* table, the web.
|
|
103
|
+
*/
|
|
104
|
+
export const USES: Readonly<Record<Exclude<Use["kind"], "app">, Icon>> = {
|
|
105
|
+
ai: SparkleIcon,
|
|
106
|
+
agent: ChatsCircleIcon,
|
|
107
|
+
notify: BellIcon,
|
|
108
|
+
send: ChatTextIcon,
|
|
109
|
+
data: TableIcon,
|
|
110
|
+
http: GlobeIcon,
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/** A call of a run's record, by what it reached; an app's tool by the app's mark. */
|
|
114
|
+
const CALLS: Readonly<Record<string, Icon>> = {
|
|
115
|
+
ai: SparkleIcon,
|
|
116
|
+
notify: BellIcon,
|
|
117
|
+
send: ChatTextIcon,
|
|
118
|
+
"agent.start": ChatsCircleIcon,
|
|
119
|
+
"data.find": TableIcon,
|
|
120
|
+
"data.add": TableIcon,
|
|
121
|
+
"data.update": TableIcon,
|
|
122
|
+
http: GlobeIcon,
|
|
123
|
+
"files.search": FileTextIcon,
|
|
124
|
+
"files.read": FileTextIcon,
|
|
125
|
+
"files.write": FileTextIcon,
|
|
126
|
+
"files.list": FileTextIcon,
|
|
127
|
+
"memory.remember": BrainIcon,
|
|
128
|
+
"memory.recall": BrainIcon,
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export function callMark(
|
|
132
|
+
step: RunStep,
|
|
133
|
+
app: { name: string; icon: string | null } | null,
|
|
134
|
+
apps: AppDirectory | undefined,
|
|
135
|
+
size: number,
|
|
136
|
+
): ReactNode {
|
|
137
|
+
if (app !== null) return <AppMark name={app.name} icon={app.icon} size={size} apps={apps} />;
|
|
138
|
+
// A message sent on a channel: the channel's brand, when the host draws brands and it is known.
|
|
139
|
+
const channel = step.call === "send" ? sentOn(step) : null;
|
|
140
|
+
if (channel !== null && apps !== undefined) {
|
|
141
|
+
return apps.logo({ provider: channel, name: channel, size });
|
|
142
|
+
}
|
|
143
|
+
return <Mark icon={CALLS[step.call] ?? LightningIcon} size={size} />;
|
|
144
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import type { AutomationState, RunBy, RunStatus, Use } from "./types";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A day as a person says it beside a time: today, yesterday, tomorrow, a weekday within the
|
|
5
|
+
* week (`name` as the locale names it, short or long), or a date further away.
|
|
6
|
+
*/
|
|
7
|
+
export type DayRef =
|
|
8
|
+
{ kind: "today" | "yesterday" | "tomorrow" } | { kind: "weekday" | "date"; name: string };
|
|
9
|
+
|
|
10
|
+
/** A tool's call by what it does, read from its name: what a run's record says it did. */
|
|
11
|
+
export type Verb = "search" | "send" | "create" | "update" | "remove" | "use";
|
|
12
|
+
|
|
13
|
+
/** What a run did, call by call, in words; `would` is a test's write, recorded and not done. */
|
|
14
|
+
export interface CallMessages {
|
|
15
|
+
/** An app's tool, by what its name says it does, with the app's name. */
|
|
16
|
+
tool: (verb: Verb, app: string, would: boolean) => string;
|
|
17
|
+
/** One model call: it reads and writes for real in a test too. */
|
|
18
|
+
ai: string;
|
|
19
|
+
/** A line in the owner's inbox. */
|
|
20
|
+
notify: (would: boolean) => string;
|
|
21
|
+
/**
|
|
22
|
+
* A message to a contact on one of the agent's channels: the channel's kind when the record
|
|
23
|
+
* says it (`whatsapp`, `instagram`, `sms`), and who to (a number; "" for a contact by its id).
|
|
24
|
+
*/
|
|
25
|
+
send: (channel: string | null, to: string, would: boolean) => string;
|
|
26
|
+
/** A conversation of the agent opened for what needs judgement or a person. */
|
|
27
|
+
start: (would: boolean) => string;
|
|
28
|
+
/** A table's rows looked up, added, changed, by the table's title. */
|
|
29
|
+
find: (table: string) => string;
|
|
30
|
+
add: (table: string, would: boolean) => string;
|
|
31
|
+
change: (table: string, would: boolean) => string;
|
|
32
|
+
/** A call to another system, by its host. */
|
|
33
|
+
http: (host: string, would: boolean) => string;
|
|
34
|
+
/** The organization's files searched. */
|
|
35
|
+
files: string;
|
|
36
|
+
/** One of its files read, kept, or its files listed, by the file's name. */
|
|
37
|
+
read: (file: string) => string;
|
|
38
|
+
wrote: (file: string, would: boolean) => string;
|
|
39
|
+
listed: string;
|
|
40
|
+
/** A line kept in, and one looked up from, what the agent learned. */
|
|
41
|
+
remember: (would: boolean) => string;
|
|
42
|
+
recall: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The words of an automation and its runs: the trigger in words, its state, its runs. */
|
|
46
|
+
export interface AutomationMessages {
|
|
47
|
+
/** When it runs, from its cron line (`whenOf`): the days, then the times. */
|
|
48
|
+
daily: string;
|
|
49
|
+
/** Monday to Friday. */
|
|
50
|
+
weekdays: string;
|
|
51
|
+
/** Saturday and Sunday. */
|
|
52
|
+
weekends: string;
|
|
53
|
+
/** Some days of the week, by their names. */
|
|
54
|
+
weekly: (days: string[]) => string;
|
|
55
|
+
/** Some days of the month. */
|
|
56
|
+
monthly: (days: number[]) => string;
|
|
57
|
+
/** The times it runs at, after the days ("9:00", as the locale writes it). */
|
|
58
|
+
at: (times: string[]) => string;
|
|
59
|
+
/** Every few minutes or hours, all day or `between` two times. */
|
|
60
|
+
every: (count: number, unit: "minute" | "hour") => string;
|
|
61
|
+
between: (from: string, to: string) => string;
|
|
62
|
+
/** A frequency on some days only: "every 15 minutes" and "on weekdays". */
|
|
63
|
+
on: (often: string, days: string) => string;
|
|
64
|
+
/** A schedule the sentence can't say. */
|
|
65
|
+
custom: string;
|
|
66
|
+
/** What another kind of trigger waits for. */
|
|
67
|
+
webhook: string;
|
|
68
|
+
event: (app: string | null, event: string | null) => string;
|
|
69
|
+
/** When it runs next, after when it runs: the day, and the time when the line doesn't say it. */
|
|
70
|
+
next: (day: DayRef, time: string | null) => string;
|
|
71
|
+
/** How it stands, on its pill. */
|
|
72
|
+
states: Readonly<Record<AutomationState, string>>;
|
|
73
|
+
/** Its switch, for screen readers. */
|
|
74
|
+
switchLabel: string;
|
|
75
|
+
/** Over its steps, the table it moves, its runs. */
|
|
76
|
+
steps: string;
|
|
77
|
+
runs: string;
|
|
78
|
+
/** In the place of its runs, when there are none yet. */
|
|
79
|
+
noRuns: string;
|
|
80
|
+
/** What a step uses, other than an app (which goes by its name). */
|
|
81
|
+
uses: Readonly<Record<Exclude<Use["kind"], "app">, string>>;
|
|
82
|
+
/** The values of the table past the ones shown: "+3". */
|
|
83
|
+
more: (count: number) => string;
|
|
84
|
+
/** An automation the agent named that is not there (removed, renamed). */
|
|
85
|
+
gone: string;
|
|
86
|
+
/** When a run started, beside what started it. */
|
|
87
|
+
moment: (day: DayRef, time: string) => string;
|
|
88
|
+
/** What started a run; an event's by its app's name, when known. */
|
|
89
|
+
by: (by: RunBy, app: string | null) => string;
|
|
90
|
+
/** How a run stands. */
|
|
91
|
+
statuses: Readonly<Record<RunStatus, string>>;
|
|
92
|
+
/** A test's line: what the run returned, though it changed nothing. */
|
|
93
|
+
dry: (summary: string) => string;
|
|
94
|
+
/** How long a run took. */
|
|
95
|
+
took: (ms: number) => string;
|
|
96
|
+
/** Over the conversations a run opened, and each one's link. */
|
|
97
|
+
opened: string;
|
|
98
|
+
conversation: (index: number) => string;
|
|
99
|
+
/** The conversation the agent was asked in, for a run it started. */
|
|
100
|
+
askedIn: string;
|
|
101
|
+
/** A run that called nothing. */
|
|
102
|
+
noCalls: string;
|
|
103
|
+
/** Over the calls made outside any step. */
|
|
104
|
+
outside: string;
|
|
105
|
+
/** A call made several times in a row: "×12". */
|
|
106
|
+
times: (count: number) => string;
|
|
107
|
+
calls: CallMessages;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const plural = (count: number, one: string, many: string) =>
|
|
111
|
+
count === 1 ? one : `${count} ${many}`;
|
|
112
|
+
|
|
113
|
+
/** English: what the package says until a host gives its own words. */
|
|
114
|
+
export const AUTOMATION_MESSAGES: AutomationMessages = {
|
|
115
|
+
daily: "Every day",
|
|
116
|
+
weekdays: "Every weekday",
|
|
117
|
+
weekends: "Every weekend",
|
|
118
|
+
weekly: (days) =>
|
|
119
|
+
days.length === 1 ? `Every ${days[0] ?? ""}` : `On ${new Intl.ListFormat("en").format(days)}`,
|
|
120
|
+
monthly: (days) => `On day ${new Intl.ListFormat("en").format(days.map(String))} of every month`,
|
|
121
|
+
at: (times) => `at ${new Intl.ListFormat("en").format(times)}`,
|
|
122
|
+
every: (count, unit) => `Every ${plural(count, unit, `${unit}s`)}`,
|
|
123
|
+
between: (from, to) => `from ${from} to ${to}`,
|
|
124
|
+
on: (often, days) => `${often}, ${days.charAt(0).toLowerCase()}${days.slice(1)}`,
|
|
125
|
+
custom: "On a schedule of its own",
|
|
126
|
+
webhook: "When another system calls it",
|
|
127
|
+
event: (app, event) =>
|
|
128
|
+
event ? `When ${event} in ${app ?? "an app"}` : `On an event in ${app ?? "an app"}`,
|
|
129
|
+
next: (day, time) => {
|
|
130
|
+
const at = time === null ? "" : ` at ${time}`;
|
|
131
|
+
switch (day.kind) {
|
|
132
|
+
case "today":
|
|
133
|
+
return `next today${at}`;
|
|
134
|
+
case "tomorrow":
|
|
135
|
+
return `next tomorrow${at}`;
|
|
136
|
+
case "yesterday":
|
|
137
|
+
return `next${at}`;
|
|
138
|
+
default:
|
|
139
|
+
return `next on ${day.name}${at}`;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
states: { active: "On", paused: "Paused", failing: "Last run failed" },
|
|
143
|
+
switchLabel: "On",
|
|
144
|
+
steps: "Steps",
|
|
145
|
+
runs: "Runs",
|
|
146
|
+
noRuns: "It hasn't run yet.",
|
|
147
|
+
uses: {
|
|
148
|
+
ai: "AI",
|
|
149
|
+
agent: "Agent",
|
|
150
|
+
notify: "Inbox",
|
|
151
|
+
send: "Message",
|
|
152
|
+
data: "Table",
|
|
153
|
+
http: "Web",
|
|
154
|
+
},
|
|
155
|
+
more: (count) => `+${count}`,
|
|
156
|
+
gone: "This automation is no longer there.",
|
|
157
|
+
moment: (day, time) => {
|
|
158
|
+
switch (day.kind) {
|
|
159
|
+
case "today":
|
|
160
|
+
return `Today ${time}`;
|
|
161
|
+
case "yesterday":
|
|
162
|
+
return `Yesterday ${time}`;
|
|
163
|
+
case "tomorrow":
|
|
164
|
+
return `Tomorrow ${time}`;
|
|
165
|
+
default:
|
|
166
|
+
return `${day.name} ${time}`;
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
by: (by, app) =>
|
|
170
|
+
({
|
|
171
|
+
schedule: "scheduled",
|
|
172
|
+
webhook: "webhook",
|
|
173
|
+
event: app ? `${app} event` : "event",
|
|
174
|
+
agent: "you asked in the chat",
|
|
175
|
+
test: "test",
|
|
176
|
+
})[by],
|
|
177
|
+
statuses: {
|
|
178
|
+
running: "Running",
|
|
179
|
+
waiting: "Waiting",
|
|
180
|
+
done: "Done",
|
|
181
|
+
failed: "Failed",
|
|
182
|
+
skipped: "Skipped",
|
|
183
|
+
},
|
|
184
|
+
dry: (summary) => `Test: ${summary}`,
|
|
185
|
+
took: (ms) =>
|
|
186
|
+
ms < 60_000 ? `${Math.max(1, Math.round(ms / 1000))} s` : `${Math.round(ms / 60_000)} min`,
|
|
187
|
+
opened: "Conversations it opened",
|
|
188
|
+
conversation: (index) => `Conversation ${index}`,
|
|
189
|
+
askedIn: "The conversation you asked in",
|
|
190
|
+
noCalls: "It didn't call anything.",
|
|
191
|
+
outside: "Outside the steps",
|
|
192
|
+
times: (count) => `×${count}`,
|
|
193
|
+
calls: {
|
|
194
|
+
tool: (verb, app, would) => {
|
|
195
|
+
const done = {
|
|
196
|
+
search: `Searched ${app}`,
|
|
197
|
+
send: `Sent with ${app}`,
|
|
198
|
+
create: `Created in ${app}`,
|
|
199
|
+
update: `Changed in ${app}`,
|
|
200
|
+
remove: `Removed in ${app}`,
|
|
201
|
+
use: `Used ${app}`,
|
|
202
|
+
}[verb];
|
|
203
|
+
return would && verb !== "search"
|
|
204
|
+
? `Would have ${done.charAt(0).toLowerCase()}${done.slice(1)}`
|
|
205
|
+
: done;
|
|
206
|
+
},
|
|
207
|
+
ai: "Used AI",
|
|
208
|
+
notify: (would) => (would ? "Would have told you in the inbox" : "Told you in the inbox"),
|
|
209
|
+
send: (channel, to, would) => {
|
|
210
|
+
const what =
|
|
211
|
+
{ whatsapp: "a WhatsApp", sms: "an SMS", instagram: "an Instagram message" }[
|
|
212
|
+
channel ?? ""
|
|
213
|
+
] ?? "a message";
|
|
214
|
+
const sent = `${what} to ${to || "a contact"}`;
|
|
215
|
+
return would ? `Would have sent ${sent}` : `Sent ${sent}`;
|
|
216
|
+
},
|
|
217
|
+
start: (would) => (would ? "Would have opened a conversation" : "Opened a conversation"),
|
|
218
|
+
find: (table) => `Looked up ${table}`,
|
|
219
|
+
add: (table, would) =>
|
|
220
|
+
would ? `Would have added a row to ${table}` : `Added a row to ${table}`,
|
|
221
|
+
change: (table, would) =>
|
|
222
|
+
would ? `Would have changed a row of ${table}` : `Changed a row of ${table}`,
|
|
223
|
+
http: (host, would) => (would ? `Would have called ${host}` : `Called ${host}`),
|
|
224
|
+
files: "Searched the files",
|
|
225
|
+
read: (file) => `Read ${file}`,
|
|
226
|
+
wrote: (file, would) => (would ? `Would have saved ${file}` : `Saved ${file}`),
|
|
227
|
+
listed: "Looked through its files",
|
|
228
|
+
remember: (would) => (would ? "Would have kept a memory" : "Kept a memory"),
|
|
229
|
+
recall: "Searched what it learned",
|
|
230
|
+
},
|
|
231
|
+
};
|