@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,84 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
|
|
3
|
+
/** The most a file may weigh to be drawn as its waveform: past it, it draws even. */
|
|
4
|
+
const MOST_BYTES = 8 * 1024 * 1024;
|
|
5
|
+
|
|
6
|
+
/** An audio as drawn: its bars' heights, and how long it is (what an Ogg doesn't say upfront). */
|
|
7
|
+
export interface Waveform {
|
|
8
|
+
heights: number[];
|
|
9
|
+
seconds: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const drawn = new Map<string, Promise<Waveform | null>>();
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An audio's waveform as `bars` heights between 0 and 1 (each stretch's energy, the strongest at
|
|
16
|
+
* 1), and its length. Read once per address and kept; null while it is read, and for audio the
|
|
17
|
+
* browser can't read (or too heavy to), which draws even.
|
|
18
|
+
*/
|
|
19
|
+
export function useWaveform(src: string | undefined, bars: number): Waveform | null {
|
|
20
|
+
const [heights, setHeights] = useState<Waveform | null>(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (src === undefined) return;
|
|
23
|
+
let live = true;
|
|
24
|
+
const key = `${String(bars)} ${src}`;
|
|
25
|
+
let reading = drawn.get(key);
|
|
26
|
+
if (reading === undefined) {
|
|
27
|
+
reading = read(src, bars);
|
|
28
|
+
drawn.set(key, reading);
|
|
29
|
+
}
|
|
30
|
+
void reading.then((read) => {
|
|
31
|
+
if (live) setHeights(read);
|
|
32
|
+
});
|
|
33
|
+
return () => {
|
|
34
|
+
live = false;
|
|
35
|
+
};
|
|
36
|
+
}, [src, bars]);
|
|
37
|
+
return heights;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async function read(src: string, bars: number): Promise<Waveform | null> {
|
|
41
|
+
try {
|
|
42
|
+
const response = await fetch(src, { credentials: "same-origin" });
|
|
43
|
+
if (!response.ok) return null;
|
|
44
|
+
if (Number(response.headers.get("content-length") ?? 0) > MOST_BYTES) return null;
|
|
45
|
+
const context = new AudioContext();
|
|
46
|
+
try {
|
|
47
|
+
const audio = await context.decodeAudioData(await response.arrayBuffer());
|
|
48
|
+
return { heights: energies(audio, bars), seconds: audio.duration };
|
|
49
|
+
} finally {
|
|
50
|
+
void context.close();
|
|
51
|
+
}
|
|
52
|
+
} catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The energy (root mean square) of each of `bars` even stretches, the strongest channel's, scaled
|
|
59
|
+
* so the strongest stretch is 1: speech reads as its syllables and pauses, where the loudest
|
|
60
|
+
* sample of each would stand nearly even.
|
|
61
|
+
*/
|
|
62
|
+
export function energies(
|
|
63
|
+
audio: Pick<AudioBuffer, "numberOfChannels" | "getChannelData">,
|
|
64
|
+
bars: number,
|
|
65
|
+
): number[] {
|
|
66
|
+
const channels = Array.from({ length: audio.numberOfChannels }, (_, index) =>
|
|
67
|
+
audio.getChannelData(index),
|
|
68
|
+
);
|
|
69
|
+
const length = channels[0]?.length ?? 0;
|
|
70
|
+
const stretch = Math.max(1, Math.floor(length / bars));
|
|
71
|
+
const found = Array.from({ length: bars }, (_, bar) => {
|
|
72
|
+
const from = bar * stretch;
|
|
73
|
+
const to = Math.min(length, from + stretch);
|
|
74
|
+
let strongest = 0;
|
|
75
|
+
for (const data of channels) {
|
|
76
|
+
let sum = 0;
|
|
77
|
+
for (let at = from; at < to; at += 1) sum += (data[at] ?? 0) ** 2;
|
|
78
|
+
strongest = Math.max(strongest, to > from ? Math.sqrt(sum / (to - from)) : 0);
|
|
79
|
+
}
|
|
80
|
+
return strongest;
|
|
81
|
+
});
|
|
82
|
+
const top = Math.max(...found, 0);
|
|
83
|
+
return top === 0 ? found.map(() => 0) : found.map((value) => value / top);
|
|
84
|
+
}
|
package/src/locale.ts
ADDED
package/src/markdown.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The little Markdown an agent's words use, read into a tree the renderer draws: headings,
|
|
3
|
+
* paragraphs and bullet lists, with bold, italic, code and links inside. No library: this is all
|
|
4
|
+
* a surface's text (and a file of notes) needs, and what it cannot read it shows as written.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type Inline =
|
|
8
|
+
| { kind: "text" | "strong" | "em" | "code"; text: string }
|
|
9
|
+
| { kind: "link"; text: string; href: string };
|
|
10
|
+
|
|
11
|
+
export type Node =
|
|
12
|
+
| { kind: "heading"; level: number; inline: Inline[] }
|
|
13
|
+
| { kind: "paragraph"; inline: Inline[] }
|
|
14
|
+
| { kind: "list"; items: Inline[][] };
|
|
15
|
+
|
|
16
|
+
/** `# Title`, up to six marks, a space, the words (closing marks dropped). */
|
|
17
|
+
const HEADING = /^ {0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/;
|
|
18
|
+
const ITEM = /^\s*[-*]\s+(.*)$/;
|
|
19
|
+
const INLINE = /`([^`]+)`|\*\*([^*]+)\*\*|\*([^*]+)\*|\[([^\]]+)\]\(([^)\s]+)\)/g;
|
|
20
|
+
// The words are the agent's, not the host's: a link may open a page, never run anything.
|
|
21
|
+
const SAFE_HREF = /^(https?:|mailto:)/i;
|
|
22
|
+
|
|
23
|
+
export function parse(markdown: string): Node[] {
|
|
24
|
+
const nodes: Node[] = [];
|
|
25
|
+
let lines: string[] = [];
|
|
26
|
+
const paragraph = () => {
|
|
27
|
+
if (lines.length > 0) nodes.push({ kind: "paragraph", inline: inline(lines.join("\n")) });
|
|
28
|
+
lines = [];
|
|
29
|
+
};
|
|
30
|
+
for (const line of markdown.split("\n")) {
|
|
31
|
+
const heading = HEADING.exec(line);
|
|
32
|
+
const item = ITEM.exec(line);
|
|
33
|
+
if (heading) {
|
|
34
|
+
paragraph();
|
|
35
|
+
const [, marks = "#", text = ""] = heading;
|
|
36
|
+
nodes.push({ kind: "heading", level: marks.length, inline: inline(text) });
|
|
37
|
+
} else if (item) {
|
|
38
|
+
paragraph();
|
|
39
|
+
const last = nodes.at(-1);
|
|
40
|
+
const text = inline(item[1] ?? "");
|
|
41
|
+
if (last?.kind === "list") last.items.push(text);
|
|
42
|
+
else nodes.push({ kind: "list", items: [text] });
|
|
43
|
+
} else if (line.trim() === "") {
|
|
44
|
+
paragraph();
|
|
45
|
+
} else {
|
|
46
|
+
lines.push(line.trim());
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
paragraph();
|
|
50
|
+
return nodes;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function inline(text: string): Inline[] {
|
|
54
|
+
const out: Inline[] = [];
|
|
55
|
+
let at = 0;
|
|
56
|
+
for (const match of text.matchAll(INLINE)) {
|
|
57
|
+
if (match.index > at) out.push({ kind: "text", text: text.slice(at, match.index) });
|
|
58
|
+
const [whole, code, strong, em, label, href] = match;
|
|
59
|
+
if (code !== undefined) out.push({ kind: "code", text: code });
|
|
60
|
+
else if (strong !== undefined) out.push({ kind: "strong", text: strong });
|
|
61
|
+
else if (em !== undefined) out.push({ kind: "em", text: em });
|
|
62
|
+
else if (label !== undefined && href !== undefined && SAFE_HREF.test(href)) {
|
|
63
|
+
out.push({ kind: "link", text: label, href });
|
|
64
|
+
} else out.push({ kind: "text", text: whole });
|
|
65
|
+
at = match.index + whole.length;
|
|
66
|
+
}
|
|
67
|
+
if (at < text.length) out.push({ kind: "text", text: text.slice(at) });
|
|
68
|
+
return out;
|
|
69
|
+
}
|
package/src/marks.tsx
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ActionSource,
|
|
5
|
+
AutomationKind,
|
|
6
|
+
ChannelKind,
|
|
7
|
+
DeviceKind,
|
|
8
|
+
Icon,
|
|
9
|
+
Provider,
|
|
10
|
+
} from "./about";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The marks Qué puede draws, each a 16-unit stroke glyph in `currentColor`: the icons a generated
|
|
14
|
+
* line may carry, the shipped actions' marks, the kinds of automation, and the simplest faithful
|
|
15
|
+
* glyph of each app, channel and device. No icon library: a host reads nothing but this package.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
const STROKE = {
|
|
19
|
+
fill: "none",
|
|
20
|
+
stroke: "currentColor",
|
|
21
|
+
strokeWidth: 1.5,
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
interface GlyphProps {
|
|
27
|
+
/** A brand's own tint, set by the stylesheet on the mark alone. */
|
|
28
|
+
brand?: ChannelKind | undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** One glyph: the paths inside the shared frame. */
|
|
32
|
+
function Glyph({ children, brand }: GlyphProps & { children: ReactNode }) {
|
|
33
|
+
return (
|
|
34
|
+
<svg viewBox="0 0 16 16" aria-hidden data-brand={brand} {...STROKE}>
|
|
35
|
+
{children}
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const message = (
|
|
41
|
+
<path d="M3 3h10a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H7.6l-3.1 2.6V11H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z" />
|
|
42
|
+
);
|
|
43
|
+
const phone = (
|
|
44
|
+
<path d="M4.3 2.5h2l1.1 2.9-1.5 1a7.3 7.3 0 0 0 3.7 3.7l1-1.5 2.9 1.1v2a1.2 1.2 0 0 1-1.3 1.2A10.5 10.5 0 0 1 3.1 3.8a1.2 1.2 0 0 1 1.2-1.3z" />
|
|
45
|
+
);
|
|
46
|
+
const mail = (
|
|
47
|
+
<>
|
|
48
|
+
<rect x="2.5" y="3.5" width="11" height="9" rx="1.5" />
|
|
49
|
+
<path d="m2.5 5.5 5.5 3.7 5.5-3.7" />
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
const calendar = (
|
|
53
|
+
<>
|
|
54
|
+
<rect x="2.5" y="3.5" width="11" height="10" rx="1.5" />
|
|
55
|
+
<path d="M2.5 7h11M5.5 2v3M10.5 2v3" />
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
const clock = (
|
|
59
|
+
<>
|
|
60
|
+
<circle cx="8" cy="8" r="5.75" />
|
|
61
|
+
<path d="M8 4.75V8l2.2 1.4" />
|
|
62
|
+
</>
|
|
63
|
+
);
|
|
64
|
+
const search = (
|
|
65
|
+
<>
|
|
66
|
+
<circle cx="7" cy="7" r="4.25" />
|
|
67
|
+
<path d="m10.2 10.2 3.3 3.3" />
|
|
68
|
+
</>
|
|
69
|
+
);
|
|
70
|
+
const file = (
|
|
71
|
+
<>
|
|
72
|
+
<path d="M4 2.5h5l3.5 3.5v7.5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-10a1 1 0 0 1 1-1z" />
|
|
73
|
+
<path d="M9 2.5V6h3.5" />
|
|
74
|
+
</>
|
|
75
|
+
);
|
|
76
|
+
const table = (
|
|
77
|
+
<>
|
|
78
|
+
<rect x="2.5" y="3" width="11" height="10" rx="1.5" />
|
|
79
|
+
<path d="M2.5 6.5h11M6.5 6.5V13" />
|
|
80
|
+
</>
|
|
81
|
+
);
|
|
82
|
+
const bell = (
|
|
83
|
+
<>
|
|
84
|
+
<path d="M4 11V7.5a4 4 0 0 1 8 0V11l1 1.5H3z" />
|
|
85
|
+
<path d="M6.5 13.5a1.5 1.5 0 0 0 3 0" />
|
|
86
|
+
</>
|
|
87
|
+
);
|
|
88
|
+
const hand = (
|
|
89
|
+
<>
|
|
90
|
+
<path d="M5.5 8.2V4.5a1 1 0 0 1 2 0v3M7.5 7.5v-4a1 1 0 0 1 2 0v4M9.5 7.5V4.5a1 1 0 0 1 2 0v4.6" />
|
|
91
|
+
<path d="M5.5 8.2 4.4 7a1 1 0 0 0-1.6 1.2L5 11.6a3.6 3.6 0 0 0 3.1 1.9H9a2.5 2.5 0 0 0 2.5-2.5V9.1" />
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
const user = (
|
|
95
|
+
<>
|
|
96
|
+
<circle cx="8" cy="5.5" r="2.75" />
|
|
97
|
+
<path d="M3 13.5a5 5 0 0 1 10 0" />
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
const globe = (
|
|
101
|
+
<>
|
|
102
|
+
<circle cx="8" cy="8" r="5.75" />
|
|
103
|
+
<path d="M2.25 8h11.5M8 2.25c2 2.1 2 9.4 0 11.5M8 2.25c-2 2.1-2 9.4 0 11.5" />
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
const code = <path d="m5.5 5-3 3 3 3M10.5 5l3 3-3 3M9.3 3.5 6.7 12.5" />;
|
|
107
|
+
const lock = (
|
|
108
|
+
<>
|
|
109
|
+
<rect x="3.5" y="7" width="9" height="6.5" rx="1.5" />
|
|
110
|
+
<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" />
|
|
111
|
+
</>
|
|
112
|
+
);
|
|
113
|
+
const cart = (
|
|
114
|
+
<>
|
|
115
|
+
<path d="M2 3h1.8l1.4 7h7.3l1.3-5H4.4" />
|
|
116
|
+
<circle cx="6" cy="12.8" r=".9" fill="currentColor" stroke="none" />
|
|
117
|
+
<circle cx="11.5" cy="12.8" r=".9" fill="currentColor" stroke="none" />
|
|
118
|
+
</>
|
|
119
|
+
);
|
|
120
|
+
const card = (
|
|
121
|
+
<>
|
|
122
|
+
<rect x="2" y="3.5" width="12" height="9" rx="1.5" />
|
|
123
|
+
<path d="M2 6.5h12M4.5 10h3" />
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
const map = (
|
|
127
|
+
<>
|
|
128
|
+
<path d="m2.5 4.5 3.5-1.5 4 1.5 3.5-1.5v9l-3.5 1.5-4-1.5-3.5 1.5z" />
|
|
129
|
+
<path d="M6 3v9M10 4.5v9" />
|
|
130
|
+
</>
|
|
131
|
+
);
|
|
132
|
+
const check = <path d="m3.5 8.5 3 3 6-7" />;
|
|
133
|
+
const warning = (
|
|
134
|
+
<>
|
|
135
|
+
<path d="M8 2.5 14 13H2z" />
|
|
136
|
+
<path d="M8 6.5v3" />
|
|
137
|
+
<circle cx="8" cy="11.3" r=".8" fill="currentColor" stroke="none" />
|
|
138
|
+
</>
|
|
139
|
+
);
|
|
140
|
+
const sparkle = (
|
|
141
|
+
<>
|
|
142
|
+
<path d="M7 2.5c.4 2.9 1.5 4 4.4 4.4-2.9.4-4 1.5-4.4 4.4-.4-2.9-1.5-4-4.4-4.4C5.5 6.5 6.6 5.4 7 2.5z" />
|
|
143
|
+
<path d="M12.3 10.5c.2 1 .5 1.3 1.5 1.5-1 .2-1.3.5-1.5 1.5-.2-1-.5-1.3-1.5-1.5 1-.2 1.3-.5 1.5-1.5z" />
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const ICONS: Readonly<Record<Icon, ReactNode>> = {
|
|
148
|
+
message,
|
|
149
|
+
phone,
|
|
150
|
+
mail,
|
|
151
|
+
calendar,
|
|
152
|
+
clock,
|
|
153
|
+
search,
|
|
154
|
+
file,
|
|
155
|
+
table,
|
|
156
|
+
bell,
|
|
157
|
+
hand,
|
|
158
|
+
user,
|
|
159
|
+
globe,
|
|
160
|
+
code,
|
|
161
|
+
lock,
|
|
162
|
+
cart,
|
|
163
|
+
card,
|
|
164
|
+
map,
|
|
165
|
+
check,
|
|
166
|
+
warning,
|
|
167
|
+
sparkle,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/** The mark of a generated line. */
|
|
171
|
+
export const iconOf = (icon: Icon): ReactNode => <Glyph>{ICONS[icon]}</Glyph>;
|
|
172
|
+
|
|
173
|
+
const pane = (
|
|
174
|
+
<>
|
|
175
|
+
<rect x="2.5" y="3" width="11" height="10" rx="1.5" />
|
|
176
|
+
<path d="M2.5 6h11" />
|
|
177
|
+
</>
|
|
178
|
+
);
|
|
179
|
+
const brain = (
|
|
180
|
+
<>
|
|
181
|
+
<path d="M7.5 2.75a2.4 2.4 0 0 0-3.3 2.6 2.4 2.4 0 0 0-.4 4.4A2.4 2.4 0 0 0 7.5 13.3z" />
|
|
182
|
+
<path d="M8.5 2.75a2.4 2.4 0 0 1 3.3 2.6 2.4 2.4 0 0 1 .4 4.4 2.4 2.4 0 0 1-3.7 3.55z" />
|
|
183
|
+
</>
|
|
184
|
+
);
|
|
185
|
+
const book = (
|
|
186
|
+
<path d="M2.5 3.5H7a1 1 0 0 1 1 1v9a1 1 0 0 0-1-1H2.5zM13.5 3.5H9a1 1 0 0 0-1 1v9a1 1 0 0 1 1-1h4.5z" />
|
|
187
|
+
);
|
|
188
|
+
const bolt = <path d="M9 2 3.5 9h4L7 14l5.5-7h-4z" />;
|
|
189
|
+
|
|
190
|
+
/** The shipped actions' marks, by name; an own action is code, one this package does not know a bolt. */
|
|
191
|
+
const ACTIONS: Readonly<Record<string, ReactNode>> = {
|
|
192
|
+
show: pane,
|
|
193
|
+
ask_person: message,
|
|
194
|
+
escalate: hand,
|
|
195
|
+
notify: bell,
|
|
196
|
+
remember: brain,
|
|
197
|
+
recall: brain,
|
|
198
|
+
search_files: search,
|
|
199
|
+
load_skill: book,
|
|
200
|
+
browser_open: globe,
|
|
201
|
+
browser_read: globe,
|
|
202
|
+
browser_click: globe,
|
|
203
|
+
browser_fill: globe,
|
|
204
|
+
browser_scroll: globe,
|
|
205
|
+
browser_back: globe,
|
|
206
|
+
browser_submit: globe,
|
|
207
|
+
browser_hand_over: hand,
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const actionMark = (name: string, source: ActionSource): ReactNode => (
|
|
211
|
+
<Glyph>{source === "own" ? code : (ACTIONS[name] ?? bolt)}</Glyph>
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const hook = (
|
|
215
|
+
<>
|
|
216
|
+
<path d="M2.5 8h7M7 5.5 9.5 8 7 10.5" />
|
|
217
|
+
<path d="M11 3.5h1.5a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H11" />
|
|
218
|
+
</>
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
const AUTOMATIONS: Readonly<Record<AutomationKind, ReactNode>> = {
|
|
222
|
+
schedule: clock,
|
|
223
|
+
webhook: hook,
|
|
224
|
+
event: bolt,
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const automationMark = (kind: AutomationKind): ReactNode => (
|
|
228
|
+
<Glyph>{AUTOMATIONS[kind]}</Glyph>
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
/** A letter alone: the simplest monogram of an app. */
|
|
232
|
+
function Monogram({ letter }: { letter: string }) {
|
|
233
|
+
return (
|
|
234
|
+
<text
|
|
235
|
+
x="8"
|
|
236
|
+
y="12.25"
|
|
237
|
+
textAnchor="middle"
|
|
238
|
+
fontSize="12.5"
|
|
239
|
+
fontWeight="500"
|
|
240
|
+
fontFamily="inherit"
|
|
241
|
+
fill="currentColor"
|
|
242
|
+
stroke="none"
|
|
243
|
+
>
|
|
244
|
+
{letter}
|
|
245
|
+
</text>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const hexagon = (
|
|
250
|
+
<>
|
|
251
|
+
<path d="M8 1.75 13.4 4.9v6.2L8 14.25 2.6 11.1V4.9z" />
|
|
252
|
+
<circle cx="8" cy="8" r="1.4" fill="currentColor" stroke="none" />
|
|
253
|
+
</>
|
|
254
|
+
);
|
|
255
|
+
const braces = (
|
|
256
|
+
<path d="M6 2.5c-1.5 0-2 .6-2 2v1.8c0 1-.5 1.7-1.5 1.7 1 0 1.5.7 1.5 1.7v1.8c0 1.4.5 2 2 2M10 2.5c1.5 0 2 .6 2 2v1.8c0 1 .5 1.7 1.5 1.7-1 0-1.5.7-1.5 1.7v1.8c0 1.4-.5 2-2 2" />
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
const PROVIDERS: Readonly<Record<Provider, ReactNode>> = {
|
|
260
|
+
arcade: <Monogram letter="A" />,
|
|
261
|
+
composio: <Monogram letter="C" />,
|
|
262
|
+
mcp: hexagon,
|
|
263
|
+
api: braces,
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
/** An app's mark: its own, when the provider gives a URL; the provider's glyph otherwise. */
|
|
267
|
+
export const providerMark = (provider: Provider, icon: string | undefined): ReactNode =>
|
|
268
|
+
icon === undefined ? <Glyph>{PROVIDERS[provider]}</Glyph> : <img src={icon} alt="" />;
|
|
269
|
+
|
|
270
|
+
const whatsapp = (
|
|
271
|
+
<>
|
|
272
|
+
<path d="M8 2.25A5.75 5.75 0 0 0 3.1 11L2.3 13.7l2.8-.75A5.75 5.75 0 1 0 8 2.25z" />
|
|
273
|
+
<path
|
|
274
|
+
d="M6.2 5.3c.2-.3.5-.3.7-.3l.5 1.2c.1.2 0 .4-.1.5l-.4.4c.4.9 1.1 1.6 2 2l.4-.4c.1-.1.3-.2.5-.1l1.2.5c0 .2 0 .5-.3.7-.5.3-1.2.4-2.5-.5C6.9 8.4 6.3 7.3 6 6.1c-.1-.3 0-.6.2-.8z"
|
|
275
|
+
fill="currentColor"
|
|
276
|
+
stroke="none"
|
|
277
|
+
/>
|
|
278
|
+
</>
|
|
279
|
+
);
|
|
280
|
+
const instagram = (
|
|
281
|
+
<>
|
|
282
|
+
<rect x="2.5" y="2.5" width="11" height="11" rx="3" />
|
|
283
|
+
<circle cx="8" cy="8" r="2.6" />
|
|
284
|
+
<circle cx="11.2" cy="4.8" r=".7" fill="currentColor" stroke="none" />
|
|
285
|
+
</>
|
|
286
|
+
);
|
|
287
|
+
const sms = (
|
|
288
|
+
<>
|
|
289
|
+
{message}
|
|
290
|
+
<circle cx="5.5" cy="7" r=".7" fill="currentColor" stroke="none" />
|
|
291
|
+
<circle cx="8" cy="7" r=".7" fill="currentColor" stroke="none" />
|
|
292
|
+
<circle cx="10.5" cy="7" r=".7" fill="currentColor" stroke="none" />
|
|
293
|
+
</>
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
const CHANNELS: Readonly<Record<ChannelKind, ReactNode>> = {
|
|
297
|
+
whatsapp,
|
|
298
|
+
instagram,
|
|
299
|
+
email: mail,
|
|
300
|
+
sms,
|
|
301
|
+
web: globe,
|
|
302
|
+
phone,
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
/** A channel's glyph, carrying its brand for the stylesheet's tint. */
|
|
306
|
+
export const channelMark = (kind: ChannelKind): ReactNode => (
|
|
307
|
+
<Glyph brand={kind}>{CHANNELS[kind]}</Glyph>
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
const chrome = (
|
|
311
|
+
<>
|
|
312
|
+
<circle cx="8" cy="8" r="5.75" />
|
|
313
|
+
<circle cx="8" cy="8" r="2.25" />
|
|
314
|
+
<path d="M8 5.75h5.5M6.05 9.1 3.3 4.4M9.95 9.1l-2.7 4.6" />
|
|
315
|
+
</>
|
|
316
|
+
);
|
|
317
|
+
const panes = (
|
|
318
|
+
<>
|
|
319
|
+
<rect x="2.5" y="2.5" width="4.75" height="4.75" rx="1" />
|
|
320
|
+
<rect x="8.75" y="2.5" width="4.75" height="4.75" rx="1" />
|
|
321
|
+
<rect x="2.5" y="8.75" width="4.75" height="4.75" rx="1" />
|
|
322
|
+
<rect x="8.75" y="8.75" width="4.75" height="4.75" rx="1" />
|
|
323
|
+
</>
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
const DEVICES: Readonly<Record<DeviceKind, ReactNode>> = { extension: chrome, installer: panes };
|
|
327
|
+
|
|
328
|
+
export const deviceMark = (kind: DeviceKind): ReactNode => <Glyph>{DEVICES[kind]}</Glyph>;
|
package/src/reveal.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The words of a reply as they stream, shown at a reading pace. The model writes in bursts (often
|
|
5
|
+
* the whole answer in a second or two, after it has thought): drawn as they land they pop in
|
|
6
|
+
* rather than flow. Revealed a few characters a frame, faster the further behind, they flow like
|
|
7
|
+
* writing and never lag the stream by more than about a second.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** At least this many characters a frame: about 150 a second at 60 frames. */
|
|
11
|
+
export const MIN_STEP = 2.5;
|
|
12
|
+
/** Within about this many frames whatever is behind is shown. */
|
|
13
|
+
export const CATCH_UP = 60;
|
|
14
|
+
|
|
15
|
+
/** How many characters to show next frame, of `total`, having shown `shown`. */
|
|
16
|
+
export function nextShown(shown: number, total: number): number {
|
|
17
|
+
if (shown >= total) return total;
|
|
18
|
+
const behind = total - shown;
|
|
19
|
+
return Math.min(total, shown + Math.max(MIN_STEP, behind / CATCH_UP));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* `text` as far as it is revealed: from `from` characters on, a little more each frame until all
|
|
24
|
+
* of it shows. Text that starts again (a new reply) starts the reveal again; `onShown` hears how
|
|
25
|
+
* far it got, so another reveal can go on from there.
|
|
26
|
+
*/
|
|
27
|
+
export function useReveal(text: string, from = 0, onShown?: (count: number) => void): string {
|
|
28
|
+
const [shown, setShown] = useState(() => Math.min(from, text.length));
|
|
29
|
+
const told = useRef(onShown);
|
|
30
|
+
told.current = onShown;
|
|
31
|
+
const visible = Math.min(shown, text.length);
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (visible >= text.length) return undefined;
|
|
35
|
+
if (typeof requestAnimationFrame === "undefined") {
|
|
36
|
+
setShown(text.length);
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
const frame = requestAnimationFrame(() => {
|
|
40
|
+
setShown((now) => nextShown(Math.min(now, text.length), text.length));
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
cancelAnimationFrame(frame);
|
|
44
|
+
};
|
|
45
|
+
}, [visible, text.length]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
told.current?.(Math.floor(visible));
|
|
49
|
+
}, [visible]);
|
|
50
|
+
|
|
51
|
+
return text.slice(0, Math.floor(visible));
|
|
52
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ArrowUUpLeftIcon,
|
|
3
|
+
ArrowsDownUpIcon,
|
|
4
|
+
BookOpenTextIcon,
|
|
5
|
+
BookmarkSimpleIcon,
|
|
6
|
+
CameraIcon,
|
|
7
|
+
ChatTeardropTextIcon,
|
|
8
|
+
CursorClickIcon,
|
|
9
|
+
DownloadSimpleIcon,
|
|
10
|
+
FilePlusIcon,
|
|
11
|
+
FileTextIcon,
|
|
12
|
+
GlobeSimpleIcon,
|
|
13
|
+
HandIcon,
|
|
14
|
+
MagicWandIcon,
|
|
15
|
+
MagnifyingGlassIcon,
|
|
16
|
+
NotePencilIcon,
|
|
17
|
+
PaperPlaneTiltIcon,
|
|
18
|
+
PlayIcon,
|
|
19
|
+
PlugIcon,
|
|
20
|
+
SlidersHorizontalIcon,
|
|
21
|
+
TextboxIcon,
|
|
22
|
+
VideoCameraIcon,
|
|
23
|
+
WrenchIcon,
|
|
24
|
+
type Icon,
|
|
25
|
+
} from "@phosphor-icons/react";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* A step's glyph by its action: the kind of work it is, v2's (reading, writing, changing,
|
|
29
|
+
* searching, running, settings, asking, remembering, an app), so the list reads at a glance. An
|
|
30
|
+
* action this package does not know, an agent's own among them, is work: a wrench.
|
|
31
|
+
*/
|
|
32
|
+
const GLYPHS: Readonly<Record<string, Icon>> = {
|
|
33
|
+
show: WrenchIcon,
|
|
34
|
+
ask_person: ChatTeardropTextIcon,
|
|
35
|
+
escalate: ChatTeardropTextIcon,
|
|
36
|
+
notify: ChatTeardropTextIcon,
|
|
37
|
+
search_files: MagnifyingGlassIcon,
|
|
38
|
+
remember: BookmarkSimpleIcon,
|
|
39
|
+
recall: BookmarkSimpleIcon,
|
|
40
|
+
load_skill: FileTextIcon,
|
|
41
|
+
data_find: MagnifyingGlassIcon,
|
|
42
|
+
data_add: FilePlusIcon,
|
|
43
|
+
data_update: NotePencilIcon,
|
|
44
|
+
squad_agents: FileTextIcon,
|
|
45
|
+
create_agent: FilePlusIcon,
|
|
46
|
+
update_agent: NotePencilIcon,
|
|
47
|
+
set_tools: SlidersHorizontalIcon,
|
|
48
|
+
test_automation: PlayIcon,
|
|
49
|
+
switch_automation: SlidersHorizontalIcon,
|
|
50
|
+
run_automation: PlayIcon,
|
|
51
|
+
find_apps: MagnifyingGlassIcon,
|
|
52
|
+
connect_app: PlugIcon,
|
|
53
|
+
app_tools: PlugIcon,
|
|
54
|
+
app_events: PlugIcon,
|
|
55
|
+
give_app: PlugIcon,
|
|
56
|
+
take_app: PlugIcon,
|
|
57
|
+
read_code: FileTextIcon,
|
|
58
|
+
write_code: FilePlusIcon,
|
|
59
|
+
delete_code: NotePencilIcon,
|
|
60
|
+
run_action: PlayIcon,
|
|
61
|
+
create_table: FilePlusIcon,
|
|
62
|
+
give_table: SlidersHorizontalIcon,
|
|
63
|
+
take_table: SlidersHorizontalIcon,
|
|
64
|
+
ask_key: ChatTeardropTextIcon,
|
|
65
|
+
ask_builder: MagicWandIcon,
|
|
66
|
+
agent_files: MagnifyingGlassIcon,
|
|
67
|
+
keep_agent_file: FilePlusIcon,
|
|
68
|
+
browser_open: GlobeSimpleIcon,
|
|
69
|
+
browser_read: BookOpenTextIcon,
|
|
70
|
+
browser_click: CursorClickIcon,
|
|
71
|
+
browser_fill: TextboxIcon,
|
|
72
|
+
browser_scroll: ArrowsDownUpIcon,
|
|
73
|
+
browser_back: ArrowUUpLeftIcon,
|
|
74
|
+
browser_submit: PaperPlaneTiltIcon,
|
|
75
|
+
browser_hand_over: HandIcon,
|
|
76
|
+
browser_attach: FilePlusIcon,
|
|
77
|
+
browser_download: DownloadSimpleIcon,
|
|
78
|
+
browser_screenshot: CameraIcon,
|
|
79
|
+
browser_record: VideoCameraIcon,
|
|
80
|
+
browser_fill_key: TextboxIcon,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const stepGlyph = (action: string): Icon => GLYPHS[action] ?? WrenchIcon;
|