@adecore/agents-react 0.31.11 → 0.32.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/dist/agents/AccountDot.js +57 -6
- package/dist/agents/AgentIcon.js +88 -12
- package/dist/agents/ModelOptionControl.js +153 -18
- package/dist/agents/ProviderLogo.js +49 -4
- package/dist/agents/account-limits.js +17 -14
- package/dist/agents/accounts.js +99 -67
- package/dist/agents/agent-marks.js +5 -3
- package/dist/agents/model-name.js +42 -31
- package/dist/agents/model-options.js +8 -8
- package/dist/agents/model-requirement.js +17 -14
- package/dist/agents/option-words.d.ts +7 -0
- package/dist/agents/option-words.js +35 -0
- package/dist/agents/provider-paths.js +6 -6
- package/dist/agents/status-look.js +32 -12
- package/dist/chat/account-choice.d.ts +13 -0
- package/dist/chat/account-choice.js +90 -20
- package/dist/chat/actions.js +126 -59
- package/dist/chat/activity.js +5 -5
- package/dist/chat/attachments.js +74 -53
- package/dist/chat/bookmarks.js +58 -48
- package/dist/chat/chat-client.js +344 -263
- package/dist/chat/chat-references.js +3 -3
- package/dist/chat/composer-effort.d.ts +5 -0
- package/dist/chat/composer-effort.js +26 -0
- package/dist/chat/composer-send.js +13 -13
- package/dist/chat/drafts.js +115 -79
- package/dist/chat/forks.js +81 -24
- package/dist/chat/guards.js +15 -43
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.js +3 -2
- package/dist/chat/logic/ansi.js +170 -167
- package/dist/chat/logic/answers.js +2 -2
- package/dist/chat/logic/bookmarks.js +19 -19
- package/dist/chat/logic/command-looks.js +138 -96
- package/dist/chat/logic/context-usage.js +13 -9
- package/dist/chat/logic/continue-after-stop.js +15 -19
- package/dist/chat/logic/effort.d.ts +14 -0
- package/dist/chat/logic/effort.js +34 -0
- package/dist/chat/logic/embedded-code.js +387 -326
- package/dist/chat/logic/fork.js +134 -110
- package/dist/chat/logic/generated-image.js +54 -23
- package/dist/chat/logic/goal.js +28 -20
- package/dist/chat/logic/handback.js +6 -6
- package/dist/chat/logic/json.js +2 -2
- package/dist/chat/logic/limit.js +46 -30
- package/dist/chat/logic/picker-entries.d.ts +5 -3
- package/dist/chat/logic/picker-entries.js +83 -43
- package/dist/chat/logic/resume-compaction.d.ts +14 -1
- package/dist/chat/logic/resume-compaction.js +93 -24
- package/dist/chat/logic/scrubber.js +188 -136
- package/dist/chat/logic/thought.js +13 -16
- package/dist/chat/logic/thread-cards.js +60 -48
- package/dist/chat/logic/timeline-copy.js +30 -38
- package/dist/chat/logic/timeline-target.js +92 -63
- package/dist/chat/logic/timeline.js +499 -355
- package/dist/chat/logic/tool-catalog.js +54 -34
- package/dist/chat/logic/tools.js +106 -82
- package/dist/chat/logic/visual-height.js +18 -18
- package/dist/chat/logic/visual-viewport.js +6 -3
- package/dist/chat/logic/welcome.js +9 -9
- package/dist/chat/logic/workflow.js +45 -34
- package/dist/chat/mentions.js +149 -109
- package/dist/chat/persisted-json.js +51 -54
- package/dist/chat/preferences.d.ts +4 -0
- package/dist/chat/preferences.js +162 -84
- package/dist/chat/prompt-hold.js +9 -9
- package/dist/chat/quote.js +21 -30
- package/dist/chat/reading-width.js +12 -10
- package/dist/chat/recent-messages.js +34 -21
- package/dist/chat/resume-compaction-dismissals.js +25 -5
- package/dist/chat/runtime-modes.js +3 -3
- package/dist/chat/send-key.js +11 -7
- package/dist/chat/stash.js +89 -69
- package/dist/chat/subagent-conversation.js +181 -139
- package/dist/chat/subagent-list.js +65 -67
- package/dist/chat/subagent-support.js +12 -7
- package/dist/chat/subagent-view.js +132 -44
- package/dist/chat/thumbnails.js +88 -60
- package/dist/chat/timeline-flash.js +24 -12
- package/dist/chat/timeline-scroll.js +116 -86
- package/dist/chat/ui/AccountPill.js +126 -15
- package/dist/chat/ui/AnsiOutput.js +62 -6
- package/dist/chat/ui/BookmarkMarker.js +231 -41
- package/dist/chat/ui/BookmarkSubmenu.js +165 -18
- package/dist/chat/ui/ChatActivity.js +649 -70
- package/dist/chat/ui/ChatReferenceChip.js +104 -9
- package/dist/chat/ui/CodeBlock.js +132 -58
- package/dist/chat/ui/Composer.js +866 -132
- package/dist/chat/ui/ComposerInput.js +309 -120
- package/dist/chat/ui/DiffPool.js +75 -14
- package/dist/chat/ui/EditDiff.js +160 -21
- package/dist/chat/ui/FadingWords.js +32 -3
- package/dist/chat/ui/GoalDock.js +235 -42
- package/dist/chat/ui/ImageView.js +617 -61
- package/dist/chat/ui/LimitState.js +446 -72
- package/dist/chat/ui/Markdown.js +991 -173
- package/dist/chat/ui/MermaidBlock.js +238 -68
- package/dist/chat/ui/MessageActions.js +251 -39
- package/dist/chat/ui/ModelMarks.js +55 -5
- package/dist/chat/ui/Pickers.js +664 -113
- package/dist/chat/ui/PromptComposer.js +281 -51
- package/dist/chat/ui/QuoteButton.js +151 -57
- package/dist/chat/ui/ResumeCompactionDock.d.ts +6 -2
- package/dist/chat/ui/ResumeCompactionDock.js +141 -6
- package/dist/chat/ui/RowTime.js +59 -5
- package/dist/chat/ui/RunSettings.js +1744 -154
- package/dist/chat/ui/Scrubber.js +517 -88
- package/dist/chat/ui/ShellCommand.js +183 -107
- package/dist/chat/ui/SubagentControls.js +212 -24
- package/dist/chat/ui/SubagentInfo.js +170 -13
- package/dist/chat/ui/SubagentStopButton.js +115 -24
- package/dist/chat/ui/SubagentTimeline.js +357 -91
- package/dist/chat/ui/Timeline.js +988 -476
- package/dist/chat/ui/TimelineMenu.js +552 -37
- package/dist/chat/ui/UnifiedDiff.js +234 -27
- package/dist/chat/ui/UploadThumb.js +37 -7
- package/dist/chat/ui/VisualDialogs.js +251 -20
- package/dist/chat/ui/VisualFrame.js +321 -95
- package/dist/chat/ui/Welcome.js +72 -7
- package/dist/chat/ui/chips.js +1 -1
- package/dist/chat/ui/code-lines.js +36 -36
- package/dist/chat/ui/code-streaming.js +1 -1
- package/dist/chat/ui/code-theme.js +7 -7
- package/dist/chat/ui/composer/ComposerControls.js +329 -21
- package/dist/chat/ui/composer/ComposerMenu.js +358 -30
- package/dist/chat/ui/composer/DraftParts.js +185 -11
- package/dist/chat/ui/composer/QueuedMessages.js +138 -13
- package/dist/chat/ui/composer/chips.js +29 -19
- package/dist/chat/ui/composer/editor.js +79 -63
- package/dist/chat/ui/composer/insert.js +26 -12
- package/dist/chat/ui/composer/key-handler.js +180 -127
- package/dist/chat/ui/composer/keys.js +90 -73
- package/dist/chat/ui/composer/menu-aria.js +18 -9
- package/dist/chat/ui/composer/placeholder.js +78 -31
- package/dist/chat/ui/composer/surface.js +13 -37
- package/dist/chat/ui/composer/use-chat-controls.js +230 -90
- package/dist/chat/ui/composer/use-compaction-offer.js +50 -18
- package/dist/chat/ui/composer/use-composer-draft.js +65 -34
- package/dist/chat/ui/composer/use-composer-menus.js +478 -193
- package/dist/chat/ui/composer/use-composer-submit.js +251 -109
- package/dist/chat/ui/composer/use-continuable-turn.js +33 -6
- package/dist/chat/ui/composer/use-draft-files.js +245 -93
- package/dist/chat/ui/composer/use-effort-stepper.d.ts +13 -0
- package/dist/chat/ui/composer/use-effort-stepper.js +88 -0
- package/dist/chat/ui/composer/use-notice.js +61 -16
- package/dist/chat/ui/composer/use-pending-requests.js +38 -17
- package/dist/chat/ui/composer/use-prompt-history.js +117 -45
- package/dist/chat/ui/composer/use-prompt-hold.js +119 -35
- package/dist/chat/ui/composer/use-take-back.js +94 -72
- package/dist/chat/ui/diff/ApprovalReview.js +101 -23
- package/dist/chat/ui/diff/DiffFallbackBoundary.js +21 -13
- package/dist/chat/ui/diff/DiffOmitted.js +56 -6
- package/dist/chat/ui/diff/DiffStack.js +92 -8
- package/dist/chat/ui/diff/DiffUnavailable.js +56 -6
- package/dist/chat/ui/diff/EditorEditDiff.js +263 -51
- package/dist/chat/ui/diff/EditorPatchDiff.js +39 -14
- package/dist/chat/ui/diff/LegacyDiffPool.js +27 -10
- package/dist/chat/ui/diff/LegacyEditDiff.js +97 -20
- package/dist/chat/ui/diff/LegacyUnifiedDiff.js +172 -42
- package/dist/chat/ui/diff/RawDiff.js +65 -5
- package/dist/chat/ui/diff/ReviewDiff.js +77 -5
- package/dist/chat/ui/diff/diff-props.js +1 -1
- package/dist/chat/ui/diff/diff-source-budget.js +46 -35
- package/dist/chat/ui/diff/editor-edit-model.js +18 -14
- package/dist/chat/ui/diff/review-plan.js +63 -40
- package/dist/chat/ui/diff/review-settle.js +24 -9
- package/dist/chat/ui/diff/syntax-runtime.js +236 -201
- package/dist/chat/ui/diff/use-review-stack.js +146 -25
- package/dist/chat/ui/diff-syntax.js +70 -58
- package/dist/chat/ui/diff-theme.js +31 -12
- package/dist/chat/ui/file-links.js +39 -10
- package/dist/chat/ui/find-reveal.js +29 -8
- package/dist/chat/ui/full-diff.js +17 -12
- package/dist/chat/ui/highlighter.js +143 -113
- package/dist/chat/ui/icons.js +16 -7
- package/dist/chat/ui/index.js +1 -1
- package/dist/chat/ui/intelligent-ui/UiBlockFrame.js +556 -82
- package/dist/chat/ui/intelligent-ui/UiFallbackPart.js +73 -5
- package/dist/chat/ui/intelligent-ui/UiReply.js +666 -262
- package/dist/chat/ui/intelligent-ui/block-local.js +59 -31
- package/dist/chat/ui/intelligent-ui/chart-data.js +77 -67
- package/dist/chat/ui/intelligent-ui/node-text.js +77 -91
- package/dist/chat/ui/intelligent-ui/registry.js +46 -46
- package/dist/chat/ui/intelligent-ui/render-context.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/base-land.js +1 -1
- package/dist/chat/ui/intelligent-ui/renderers/binding.js +3 -3
- package/dist/chat/ui/intelligent-ui/renderers/chart.js +1223 -123
- package/dist/chat/ui/intelligent-ui/renderers/choices.js +312 -34
- package/dist/chat/ui/intelligent-ui/renderers/content.js +1241 -86
- package/dist/chat/ui/intelligent-ui/renderers/data.js +619 -54
- package/dist/chat/ui/intelligent-ui/renderers/inputs.js +868 -67
- package/dist/chat/ui/intelligent-ui/renderers/links.js +366 -62
- package/dist/chat/ui/intelligent-ui/renderers/map-slots.js +118 -60
- package/dist/chat/ui/intelligent-ui/renderers/map-style.js +85 -78
- package/dist/chat/ui/intelligent-ui/renderers/map-view.js +282 -217
- package/dist/chat/ui/intelligent-ui/renderers/map.js +621 -69
- package/dist/chat/ui/intelligent-ui/renderers/place-point.js +15 -8
- package/dist/chat/ui/intelligent-ui/renderers/structure.js +262 -20
- package/dist/chat/ui/intelligent-ui/renderers/text.js +674 -49
- package/dist/chat/ui/intelligent-ui/reply-parts.js +24 -15
- package/dist/chat/ui/intelligent-ui/table-data.js +97 -57
- package/dist/chat/ui/intelligent-ui/tones.js +31 -31
- package/dist/chat/ui/intelligent-ui/use-in-view.js +30 -12
- package/dist/chat/ui/intelligent-ui/use-later.js +28 -13
- package/dist/chat/ui/intelligent-ui/use-truncated.js +45 -21
- package/dist/chat/ui/intelligent-ui/use-ui-links.js +296 -109
- package/dist/chat/ui/intelligent-ui/use-ui-queries.js +256 -246
- package/dist/chat/ui/markdown-blocks.js +296 -262
- package/dist/chat/ui/mermaid.js +60 -72
- package/dist/chat/ui/quote-selection.js +32 -29
- package/dist/chat/ui/rehype-chips.js +35 -23
- package/dist/chat/ui/rehype-fade.js +28 -17
- package/dist/chat/ui/remark-html-as-text.js +22 -15
- package/dist/chat/ui/reply-context.js +1 -1
- package/dist/chat/ui/reveal.js +161 -72
- package/dist/chat/ui/rows/ForksRow.js +226 -24
- package/dist/chat/ui/rows/GeneratedImageRow.js +541 -87
- package/dist/chat/ui/rows/MessageRows.js +1706 -159
- package/dist/chat/ui/rows/RowContainer.js +57 -7
- package/dist/chat/ui/rows/Rows.js +463 -54
- package/dist/chat/ui/rows/SubagentRow.js +577 -60
- package/dist/chat/ui/rows/TaskRow.js +359 -40
- package/dist/chat/ui/rows/VisualRow.js +233 -11
- package/dist/chat/ui/rows/WorkRows.js +1946 -163
- package/dist/chat/ui/rows/WorkflowRow.js +293 -34
- package/dist/chat/ui/rows/row-rhythm.js +27 -17
- package/dist/chat/ui/theme-watch.js +26 -23
- package/dist/chat/ui/timestamp-format.js +4 -1
- package/dist/chat/ui/use-diff-source-tokens.js +70 -34
- package/dist/chat/ui/useToggleSet.js +51 -19
- package/dist/chat/ui/visual-theme.js +153 -128
- package/dist/chat/visual-bridge.js +123 -123
- package/dist/chat/visual-viewport.js +94 -83
- package/dist/chat/visuals.js +13 -5
- package/dist/host-hooks.d.ts +29 -0
- package/dist/host-hooks.js +78 -0
- package/dist/host.js +120 -48
- package/dist/index.js +1 -1
- package/dist/lazy.js +38 -32
- package/dist/locales/en/agent-chat.d.ts +35 -0
- package/dist/locales/en/agent-chat.js +747 -712
- package/dist/locales/en/agent-prompts.js +42 -42
- package/dist/locales/en/agent-providers.d.ts +1 -0
- package/dist/locales/en/agent-providers.js +166 -165
- package/dist/locales/en/agent-usage.d.ts +6 -0
- package/dist/locales/en/agent-usage.js +129 -123
- package/dist/locales/nl/agent-chat.d.ts +35 -0
- package/dist/locales/nl/agent-chat.js +747 -712
- package/dist/locales/nl/agent-prompts.js +42 -42
- package/dist/locales/nl/agent-providers.d.ts +1 -0
- package/dist/locales/nl/agent-providers.js +166 -165
- package/dist/locales/nl/agent-usage.d.ts +6 -0
- package/dist/locales/nl/agent-usage.js +129 -123
- package/dist/locales.js +14 -14
- package/dist/mounted-registry.js +31 -30
- package/dist/port-transport.js +122 -111
- package/dist/prompts/index.js +1 -1
- package/dist/prompts/logic/focus.js +15 -14
- package/dist/prompts/logic/keys.js +93 -59
- package/dist/prompts/logic/prompts.js +27 -14
- package/dist/prompts/logic/subjects.js +60 -46
- package/dist/prompts/logic/useFocusAfterAnswer.js +60 -20
- package/dist/prompts/logic/usePromptSession.js +88 -77
- package/dist/prompts/ui/ApprovalBody.js +246 -25
- package/dist/prompts/ui/PromptActions.js +215 -9
- package/dist/prompts/ui/PromptCard.js +215 -36
- package/dist/prompts/ui/PromptView.js +372 -34
- package/dist/prompts/ui/QuestionBody.js +269 -73
- package/dist/providers/AccountColors.js +36 -5
- package/dist/providers/AccountDetail.js +683 -50
- package/dist/providers/AccountVariables.js +139 -32
- package/dist/providers/AddAccountForm.js +125 -38
- package/dist/providers/CliDetail.js +343 -36
- package/dist/providers/InstallPage.js +644 -59
- package/dist/providers/ProviderList.d.ts +2 -1
- package/dist/providers/ProviderList.js +215 -23
- package/dist/providers/ProvidersPane.d.ts +4 -2
- package/dist/providers/ProvidersPane.js +244 -64
- package/dist/providers/account-actions.js +54 -30
- package/dist/providers/index.js +1 -1
- package/dist/providers/install-steps.js +12 -9
- package/dist/providers/pane-target.d.ts +3 -0
- package/dist/providers/pane-target.js +34 -13
- package/dist/providers/parts.js +62 -12
- package/dist/providers/provider-abilities.js +5 -5
- package/dist/providers/provider-groups.js +75 -40
- package/dist/providers/variables.js +73 -39
- package/dist/scope.js +6 -6
- package/dist/settings/sections.js +18 -18
- package/dist/state/chats.d.ts +1 -0
- package/dist/state/chats.js +408 -192
- package/dist/state/index.js +1 -1
- package/dist/state/provider-accounts.js +70 -47
- package/dist/state/providers.js +45 -16
- package/dist/state/usage.js +154 -77
- package/dist/storage.js +69 -68
- package/dist/testing/index.js +1 -1
- package/dist/testing/prompts.js +105 -67
- package/dist/transport.js +10 -10
- package/dist/ui/PlainTextarea.js +27 -3
- package/dist/usage/LimitsList.js +646 -40
- package/dist/usage/UsageBreakdown.js +879 -38
- package/dist/usage/UsageChart.js +311 -32
- package/dist/usage/UsageDialog.js +46 -4
- package/dist/usage/UsageLimits.js +467 -34
- package/dist/usage/UsageLimitsCard.js +95 -11
- package/dist/usage/UsagePage.js +817 -96
- package/dist/usage/UsagePane.js +164 -10
- package/dist/usage/UsageSummary.js +151 -6
- package/dist/usage/UsageTiles.js +164 -14
- package/dist/usage/format.js +32 -32
- package/dist/usage/index.d.ts +1 -1
- package/dist/usage/index.js +2 -1
- package/dist/usage/limit-groups.d.ts +2 -0
- package/dist/usage/limit-groups.js +77 -59
- package/dist/usage/limits.js +78 -43
- package/dist/usage/money.js +20 -4
- package/dist/usage/summary.js +85 -64
- package/package.json +8 -8
- package/src/agents/ModelOptionControl.tsx +3 -1
- package/src/agents/option-words.ts +27 -0
- package/src/chat/account-choice.ts +41 -1
- package/src/chat/composer-effort.ts +32 -0
- package/src/chat/forks.ts +4 -5
- package/src/chat/index.ts +3 -1
- package/src/chat/logic/effort.ts +32 -0
- package/src/chat/logic/picker-entries.ts +45 -10
- package/src/chat/logic/resume-compaction.ts +95 -17
- package/src/chat/logic/timeline.ts +11 -3
- package/src/chat/preferences.ts +35 -0
- package/src/chat/subagent-view.ts +2 -3
- package/src/chat/ui/AnsiOutput.tsx +1 -2
- package/src/chat/ui/BookmarkSubmenu.tsx +3 -3
- package/src/chat/ui/ChatActivity.tsx +14 -22
- package/src/chat/ui/ChatReferenceChip.tsx +2 -3
- package/src/chat/ui/Composer.tsx +15 -7
- package/src/chat/ui/EditDiff.tsx +2 -3
- package/src/chat/ui/LimitState.tsx +2 -2
- package/src/chat/ui/Markdown.tsx +10 -8
- package/src/chat/ui/MermaidBlock.tsx +2 -3
- package/src/chat/ui/Pickers.tsx +49 -29
- package/src/chat/ui/PromptComposer.tsx +7 -9
- package/src/chat/ui/ResumeCompactionDock.tsx +16 -4
- package/src/chat/ui/RunSettings.tsx +67 -28
- package/src/chat/ui/Scrubber.tsx +3 -3
- package/src/chat/ui/ShellCommand.tsx +2 -0
- package/src/chat/ui/SubagentInfo.tsx +2 -3
- package/src/chat/ui/SubagentTimeline.tsx +12 -16
- package/src/chat/ui/Timeline.tsx +6 -6
- package/src/chat/ui/UnifiedDiff.tsx +3 -4
- package/src/chat/ui/VisualFrame.tsx +5 -8
- package/src/chat/ui/code-theme.ts +4 -4
- package/src/chat/ui/composer/placeholder.ts +2 -2
- package/src/chat/ui/composer/use-compaction-offer.ts +36 -16
- package/src/chat/ui/composer/use-composer-menus.ts +4 -9
- package/src/chat/ui/composer/use-composer-submit.ts +2 -1
- package/src/chat/ui/composer/use-effort-stepper.ts +56 -0
- package/src/chat/ui/composer/use-notice.ts +2 -2
- package/src/chat/ui/diff/EditorEditDiff.tsx +9 -13
- package/src/chat/ui/diff/LegacyEditDiff.tsx +12 -17
- package/src/chat/ui/diff/LegacyUnifiedDiff.tsx +13 -21
- package/src/chat/ui/diff/use-review-stack.ts +4 -4
- package/src/chat/ui/diff-theme.ts +3 -3
- package/src/chat/ui/file-links.ts +2 -2
- package/src/chat/ui/intelligent-ui/UiReply.tsx +2 -0
- package/src/chat/ui/intelligent-ui/renderers/chart.tsx +3 -3
- package/src/chat/ui/intelligent-ui/renderers/content.tsx +5 -6
- package/src/chat/ui/intelligent-ui/renderers/map-view.tsx +2 -1
- package/src/chat/ui/intelligent-ui/renderers/map.tsx +2 -1
- package/src/chat/ui/intelligent-ui/use-truncated.ts +16 -19
- package/src/chat/ui/intelligent-ui/use-ui-links.ts +3 -3
- package/src/chat/ui/rows/ForksRow.tsx +3 -5
- package/src/chat/ui/rows/GeneratedImageRow.tsx +2 -1
- package/src/chat/ui/rows/MessageRows.tsx +12 -21
- package/src/chat/ui/rows/SubagentRow.tsx +3 -3
- package/src/chat/ui/rows/TaskRow.tsx +1 -1
- package/src/chat/ui/rows/WorkRows.tsx +20 -7
- package/src/chat/ui/useToggleSet.ts +15 -18
- package/src/chat/ui/visual-theme.ts +2 -3
- package/src/host-hooks.ts +113 -0
- package/src/lazy.tsx +2 -0
- package/src/locales/en/agent-chat.ts +135 -108
- package/src/locales/en/agent-prompts.ts +7 -7
- package/src/locales/en/agent-providers.ts +35 -34
- package/src/locales/en/agent-usage.ts +26 -20
- package/src/locales/nl/agent-chat.ts +127 -100
- package/src/locales/nl/agent-prompts.ts +5 -5
- package/src/locales/nl/agent-providers.ts +33 -32
- package/src/locales/nl/agent-usage.ts +25 -20
- package/src/prompts/ui/ApprovalBody.tsx +3 -1
- package/src/providers/CliDetail.tsx +2 -1
- package/src/providers/InstallPage.tsx +2 -4
- package/src/providers/ProviderList.tsx +12 -2
- package/src/providers/ProvidersPane.tsx +45 -15
- package/src/providers/pane-target.ts +20 -4
- package/src/state/chats.ts +7 -2
- package/src/usage/LimitsList.tsx +12 -13
- package/src/usage/UsageBreakdown.tsx +17 -6
- package/src/usage/UsageLimits.tsx +2 -1
- package/src/usage/UsagePage.tsx +3 -3
- package/src/usage/index.ts +1 -1
- package/src/usage/limit-groups.ts +12 -0
- package/src/usage/limits.ts +2 -2
- package/src/usage/money.ts +1 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { useEffect, useId, useMemo, useState } from 'react';
|
|
2
3
|
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { ensureSyntaxTree, syntaxTree } from '@codemirror/language';
|
|
@@ -8,6 +9,7 @@ import { usableSlashCommands } from '../../guards.js';
|
|
|
8
9
|
import { dropQuery, findMentionQuery, findSkillQuery, insertMention, insertSkill, mentionPick, NO_MENTION_SEARCH } from '../../mentions.js';
|
|
9
10
|
import { inCode } from './keys.js';
|
|
10
11
|
import { clampMenuIndex, composerMenuAria } from './menu-aria.js';
|
|
12
|
+
import { useHostReferableChats } from '../../../host-hooks.js';
|
|
11
13
|
const SEARCH_DEBOUNCE_MS = 80;
|
|
12
14
|
// What fits above the composer without turning the picker into a file tree.
|
|
13
15
|
const MENTION_RESULTS = 8;
|
|
@@ -16,217 +18,500 @@ const CHAT_RESULTS = 4;
|
|
|
16
18
|
// Commands the composer handles itself; the CLI's own ones are sent through as text.
|
|
17
19
|
export const LOCAL_COMMANDS = ['model', 'compact', 'clear'];
|
|
18
20
|
function sameQuery(left, right) {
|
|
19
|
-
|
|
21
|
+
return left?.start === right?.start && left?.query === right?.query;
|
|
20
22
|
}
|
|
21
23
|
/*
|
|
22
24
|
* The pickers over the box: `/` for a command, `$` for a skill and `@` for a file or another chat.
|
|
23
25
|
* One is open at a time, and the arrow keys and the editor's ARIA attributes follow that one.
|
|
24
26
|
*/
|
|
25
|
-
export function useComposerMenus(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
export function useComposerMenus(t0) {
|
|
28
|
+
const $ = _c(105);
|
|
29
|
+
const {
|
|
30
|
+
chatId,
|
|
31
|
+
info,
|
|
32
|
+
capabilities,
|
|
33
|
+
providerName,
|
|
34
|
+
draft: t1,
|
|
35
|
+
inputRef
|
|
36
|
+
} = t0;
|
|
37
|
+
const {
|
|
38
|
+
draft,
|
|
39
|
+
setDraft,
|
|
40
|
+
setText
|
|
41
|
+
} = t1;
|
|
42
|
+
const {
|
|
43
|
+
t
|
|
44
|
+
} = useTranslation("agent-chat");
|
|
45
|
+
const scope = useChatScope();
|
|
46
|
+
const host = useChatHost();
|
|
47
|
+
const {
|
|
48
|
+
searchFiles
|
|
49
|
+
} = host;
|
|
50
|
+
const chats = useHostReferableChats();
|
|
51
|
+
const [menuIndex, setMenuIndex] = useState(0);
|
|
52
|
+
const [mention, setMention] = useState(null);
|
|
53
|
+
const [skillQuery, setSkillQuery] = useState(null);
|
|
54
|
+
let t2;
|
|
55
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56
|
+
t2 = [];
|
|
57
|
+
$[0] = t2;
|
|
58
|
+
} else {
|
|
59
|
+
t2 = $[0];
|
|
60
|
+
}
|
|
61
|
+
const [skills, setSkills] = useState(t2);
|
|
62
|
+
const [searched, setSearched] = useState(NO_MENTION_SEARCH);
|
|
63
|
+
const text = draft.text;
|
|
64
|
+
const goals = capabilities?.goals;
|
|
65
|
+
let t3;
|
|
66
|
+
if ($[1] !== info.cwd || $[2] !== mention || $[3] !== scope.id || $[4] !== searchFiles) {
|
|
67
|
+
t3 = () => {
|
|
68
|
+
if (mention === null) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
let stale = false;
|
|
72
|
+
const search = () => {
|
|
73
|
+
if (searchFiles === null) {
|
|
74
|
+
return;
|
|
42
75
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
.catch(() => undefined);
|
|
56
|
-
};
|
|
57
|
-
// A bare `@` is not a keystroke in a query. It opens the list of what is there, at once.
|
|
58
|
-
if (mention.query === '') {
|
|
59
|
-
search();
|
|
60
|
-
return () => {
|
|
61
|
-
stale = true;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
const timer = setTimeout(search, SEARCH_DEBOUNCE_MS);
|
|
65
|
-
return () => {
|
|
66
|
-
stale = true;
|
|
67
|
-
clearTimeout(timer);
|
|
68
|
-
};
|
|
69
|
-
}, [scope, info.cwd, mention, searchFiles]);
|
|
70
|
-
/*
|
|
71
|
-
* The host's skill list, once per chat, again once the CLI announced its own after the first message,
|
|
72
|
-
* and again when its process comes or goes, which is when a restart reads new skills.
|
|
73
|
-
*/
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
let stale = false;
|
|
76
|
-
scope.chats
|
|
77
|
-
.listSkills(chatId)
|
|
78
|
-
.then((found) => {
|
|
79
|
-
if (!stale) {
|
|
80
|
-
setSkills(found);
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
.catch(() => undefined);
|
|
76
|
+
searchFiles(scope.id, info.cwd, mention.query, MENTION_RESULTS).then(files => {
|
|
77
|
+
if (!stale) {
|
|
78
|
+
setSearched({
|
|
79
|
+
query: mention.query,
|
|
80
|
+
files
|
|
81
|
+
});
|
|
82
|
+
setMenuIndex(0);
|
|
83
|
+
}
|
|
84
|
+
}).catch(_temp);
|
|
85
|
+
};
|
|
86
|
+
if (mention.query === "") {
|
|
87
|
+
search();
|
|
84
88
|
return () => {
|
|
85
|
-
|
|
89
|
+
stale = true;
|
|
86
90
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
}
|
|
92
|
+
const timer = setTimeout(search, SEARCH_DEBOUNCE_MS);
|
|
93
|
+
return () => {
|
|
94
|
+
stale = true;
|
|
95
|
+
clearTimeout(timer);
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
$[1] = info.cwd;
|
|
99
|
+
$[2] = mention;
|
|
100
|
+
$[3] = scope.id;
|
|
101
|
+
$[4] = searchFiles;
|
|
102
|
+
$[5] = t3;
|
|
103
|
+
} else {
|
|
104
|
+
t3 = $[5];
|
|
105
|
+
}
|
|
106
|
+
let t4;
|
|
107
|
+
if ($[6] !== info.cwd || $[7] !== mention || $[8] !== scope || $[9] !== searchFiles) {
|
|
108
|
+
t4 = [scope, info.cwd, mention, searchFiles];
|
|
109
|
+
$[6] = info.cwd;
|
|
110
|
+
$[7] = mention;
|
|
111
|
+
$[8] = scope;
|
|
112
|
+
$[9] = searchFiles;
|
|
113
|
+
$[10] = t4;
|
|
114
|
+
} else {
|
|
115
|
+
t4 = $[10];
|
|
116
|
+
}
|
|
117
|
+
useEffect(t3, t4);
|
|
118
|
+
let t5;
|
|
119
|
+
if ($[11] !== chatId || $[12] !== scope.chats) {
|
|
120
|
+
t5 = () => {
|
|
121
|
+
let stale_0 = false;
|
|
122
|
+
scope.chats.listSkills(chatId).then(found => {
|
|
123
|
+
if (!stale_0) {
|
|
124
|
+
setSkills(found);
|
|
110
125
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
|
|
116
|
-
const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
|
|
117
|
-
// Results belong to the query that asked for them; a closed picker shows none while the next answer is on its way.
|
|
118
|
-
const files = mention === null ? [] : searched.files;
|
|
119
|
-
const chatMatches = useMemo(() => (mention === null ? [] : chatSuggestions(chats, mention.query, [chatId, ...draft.chats], CHAT_RESULTS)), [chatId, chats, draft.chats, mention]);
|
|
120
|
-
const mentionCount = chatMatches.length + files.length;
|
|
121
|
-
// One menu is open at a time, so they share an id.
|
|
122
|
-
const listId = useId();
|
|
123
|
-
const menuOpen = commandMenuOpen || skillMenuOpen || mentionMenuOpen;
|
|
124
|
-
const menuCount = commandMenuOpen ? commands.length : skillMenuOpen ? skillMatches.length : mentionCount;
|
|
125
|
-
// The list can shrink under a stale index; every reader takes the one that still points at an option.
|
|
126
|
-
const activeIndex = clampMenuIndex(menuIndex, menuCount);
|
|
127
|
-
const inputAria = useMemo(() => composerMenuAria({ label: t('composer.inputLabel'), listId, open: menuOpen, activeIndex, count: menuCount }), [t, listId, menuOpen, activeIndex, menuCount]);
|
|
128
|
-
/* Which picker the caret opens: `@` for a file, `$` for a skill, or neither. In code a sigil is just text. */
|
|
129
|
-
const trackTriggers = (value, selection, state) => {
|
|
130
|
-
const empty = selection.from === selection.to;
|
|
131
|
-
const tree = empty ? (ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state)) : null;
|
|
132
|
-
const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
|
|
133
|
-
const skill = caret === null ? null : findSkillQuery(value, caret);
|
|
134
|
-
setSkillQuery((current) => (sameQuery(current, skill) ? current : skill));
|
|
135
|
-
// A CLI that does not expand `@path` gets the text as it is, so the picker stays out of the way.
|
|
136
|
-
const next = caret === null || capabilities?.mentions === false ? null : findMentionQuery(value, caret);
|
|
137
|
-
setMention((current) => (sameQuery(current, next) ? current : next));
|
|
126
|
+
}).catch(_temp2);
|
|
127
|
+
return () => {
|
|
128
|
+
stale_0 = true;
|
|
129
|
+
};
|
|
138
130
|
};
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
131
|
+
$[11] = chatId;
|
|
132
|
+
$[12] = scope.chats;
|
|
133
|
+
$[13] = t5;
|
|
134
|
+
} else {
|
|
135
|
+
t5 = $[13];
|
|
136
|
+
}
|
|
137
|
+
let t6;
|
|
138
|
+
if ($[14] !== chatId || $[15] !== info.running || $[16] !== info.skills || $[17] !== scope) {
|
|
139
|
+
t6 = [scope, chatId, info.skills, info.running];
|
|
140
|
+
$[14] = chatId;
|
|
141
|
+
$[15] = info.running;
|
|
142
|
+
$[16] = info.skills;
|
|
143
|
+
$[17] = scope;
|
|
144
|
+
$[18] = t6;
|
|
145
|
+
} else {
|
|
146
|
+
t6 = $[18];
|
|
147
|
+
}
|
|
148
|
+
useEffect(t5, t6);
|
|
149
|
+
let t7;
|
|
150
|
+
if ($[19] !== text) {
|
|
151
|
+
t7 = text.startsWith("/") && !text.includes("\n") ? text.slice(1).trim().toLowerCase() : null;
|
|
152
|
+
$[19] = text;
|
|
153
|
+
$[20] = t7;
|
|
154
|
+
} else {
|
|
155
|
+
t7 = $[20];
|
|
156
|
+
}
|
|
157
|
+
const commandQuery = t7;
|
|
158
|
+
let t8;
|
|
159
|
+
bb0: {
|
|
160
|
+
if (commandQuery === null) {
|
|
161
|
+
let t9;
|
|
162
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
+
t9 = [];
|
|
164
|
+
$[21] = t9;
|
|
165
|
+
} else {
|
|
166
|
+
t9 = $[21];
|
|
167
|
+
}
|
|
168
|
+
t8 = t9;
|
|
169
|
+
break bb0;
|
|
170
|
+
}
|
|
171
|
+
let t9;
|
|
172
|
+
if ($[22] !== skills) {
|
|
173
|
+
t9 = new Set(skills.map(_temp3));
|
|
174
|
+
$[22] = skills;
|
|
175
|
+
$[23] = t9;
|
|
176
|
+
} else {
|
|
177
|
+
t9 = $[23];
|
|
178
|
+
}
|
|
179
|
+
const known = t9;
|
|
180
|
+
let t10;
|
|
181
|
+
if ($[24] !== commandQuery || $[25] !== goals || $[26] !== info.slashCommands || $[27] !== known || $[28] !== providerName || $[29] !== t) {
|
|
182
|
+
const own = LOCAL_COMMANDS.map(name => ({
|
|
183
|
+
name,
|
|
184
|
+
hint: t(`composer.commands.${name}`),
|
|
185
|
+
local: true,
|
|
186
|
+
skill: false
|
|
187
|
+
}));
|
|
188
|
+
const goal = goals === undefined ? [] : [{
|
|
189
|
+
name: "goal",
|
|
190
|
+
hint: t("composer.commands.goal"),
|
|
191
|
+
local: false,
|
|
192
|
+
skill: false
|
|
193
|
+
}];
|
|
194
|
+
const cli = usableSlashCommands(info.slashCommands).filter(name_0 => !LOCAL_COMMANDS.includes(name_0) && (goals === undefined || name_0 !== "goal")).map(name_1 => ({
|
|
195
|
+
name: name_1,
|
|
196
|
+
hint: known.has(name_1) ? t("composer.commands.skill") : t("composer.commands.cli", {
|
|
197
|
+
cli: providerName ?? t("composer.commands.anyCli")
|
|
198
|
+
}),
|
|
199
|
+
local: false,
|
|
200
|
+
skill: known.has(name_1)
|
|
201
|
+
}));
|
|
202
|
+
t10 = [...own, ...goal, ...cli].filter(command => command.name.startsWith(commandQuery)).slice(0, 8);
|
|
203
|
+
$[24] = commandQuery;
|
|
204
|
+
$[25] = goals;
|
|
205
|
+
$[26] = info.slashCommands;
|
|
206
|
+
$[27] = known;
|
|
207
|
+
$[28] = providerName;
|
|
208
|
+
$[29] = t;
|
|
209
|
+
$[30] = t10;
|
|
210
|
+
} else {
|
|
211
|
+
t10 = $[30];
|
|
212
|
+
}
|
|
213
|
+
t8 = t10;
|
|
214
|
+
}
|
|
215
|
+
const commands = t8;
|
|
216
|
+
let t9;
|
|
217
|
+
bb1: {
|
|
218
|
+
if (skillQuery === null) {
|
|
219
|
+
let t10;
|
|
220
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
221
|
+
t10 = [];
|
|
222
|
+
$[31] = t10;
|
|
223
|
+
} else {
|
|
224
|
+
t10 = $[31];
|
|
225
|
+
}
|
|
226
|
+
t9 = t10;
|
|
227
|
+
break bb1;
|
|
228
|
+
}
|
|
229
|
+
let t10;
|
|
230
|
+
if ($[32] !== skillQuery.query || $[33] !== skills) {
|
|
231
|
+
const query = skillQuery.query.toLowerCase();
|
|
232
|
+
t10 = skills.filter(skill_0 => skill_0.name.toLowerCase().includes(query)).slice(0, 8);
|
|
233
|
+
$[32] = skillQuery.query;
|
|
234
|
+
$[33] = skills;
|
|
235
|
+
$[34] = t10;
|
|
236
|
+
} else {
|
|
237
|
+
t10 = $[34];
|
|
238
|
+
}
|
|
239
|
+
t9 = t10;
|
|
240
|
+
}
|
|
241
|
+
const skillMatches = t9;
|
|
242
|
+
const commandMenuOpen = commandQuery !== null && commands.length > 0;
|
|
243
|
+
const skillMenuOpen = !commandMenuOpen && skillQuery !== null && skillMatches.length > 0;
|
|
244
|
+
const mentionMenuOpen = !commandMenuOpen && !skillMenuOpen && mention !== null;
|
|
245
|
+
let t10;
|
|
246
|
+
if ($[35] !== mention || $[36] !== searched) {
|
|
247
|
+
t10 = mention === null ? [] : searched.files;
|
|
248
|
+
$[35] = mention;
|
|
249
|
+
$[36] = searched;
|
|
250
|
+
$[37] = t10;
|
|
251
|
+
} else {
|
|
252
|
+
t10 = $[37];
|
|
253
|
+
}
|
|
254
|
+
const files_0 = t10;
|
|
255
|
+
let t11;
|
|
256
|
+
if ($[38] !== chatId || $[39] !== chats || $[40] !== draft.chats || $[41] !== mention) {
|
|
257
|
+
t11 = mention === null ? [] : chatSuggestions(chats, mention.query, [chatId, ...draft.chats], CHAT_RESULTS);
|
|
258
|
+
$[38] = chatId;
|
|
259
|
+
$[39] = chats;
|
|
260
|
+
$[40] = draft.chats;
|
|
261
|
+
$[41] = mention;
|
|
262
|
+
$[42] = t11;
|
|
263
|
+
} else {
|
|
264
|
+
t11 = $[42];
|
|
265
|
+
}
|
|
266
|
+
const chatMatches = t11;
|
|
267
|
+
const mentionCount = chatMatches.length + files_0.length;
|
|
268
|
+
const listId = useId();
|
|
269
|
+
const menuOpen = commandMenuOpen || skillMenuOpen || mentionMenuOpen;
|
|
270
|
+
const menuCount = commandMenuOpen ? commands.length : skillMenuOpen ? skillMatches.length : mentionCount;
|
|
271
|
+
let activeIndex;
|
|
272
|
+
let t12;
|
|
273
|
+
if ($[43] !== listId || $[44] !== menuCount || $[45] !== menuIndex || $[46] !== menuOpen || $[47] !== t) {
|
|
274
|
+
activeIndex = clampMenuIndex(menuIndex, menuCount);
|
|
275
|
+
t12 = composerMenuAria({
|
|
276
|
+
label: t("composer.inputLabel"),
|
|
277
|
+
listId,
|
|
278
|
+
open: menuOpen,
|
|
279
|
+
activeIndex,
|
|
280
|
+
count: menuCount
|
|
281
|
+
});
|
|
282
|
+
$[43] = listId;
|
|
283
|
+
$[44] = menuCount;
|
|
284
|
+
$[45] = menuIndex;
|
|
285
|
+
$[46] = menuOpen;
|
|
286
|
+
$[47] = t;
|
|
287
|
+
$[48] = activeIndex;
|
|
288
|
+
$[49] = t12;
|
|
289
|
+
} else {
|
|
290
|
+
activeIndex = $[48];
|
|
291
|
+
t12 = $[49];
|
|
292
|
+
}
|
|
293
|
+
const inputAria = t12;
|
|
294
|
+
let t13;
|
|
295
|
+
if ($[50] !== capabilities?.mentions) {
|
|
296
|
+
t13 = (value, selection, state) => {
|
|
297
|
+
const empty = selection.from === selection.to;
|
|
298
|
+
const tree = empty ? ensureSyntaxTree(state, selection.from, 50) ?? syntaxTree(state) : null;
|
|
299
|
+
const caret = tree !== null && !inCode(tree, value, selection.from) ? selection.from : null;
|
|
300
|
+
const skill_1 = caret === null ? null : findSkillQuery(value, caret);
|
|
301
|
+
setSkillQuery(current => sameQuery(current, skill_1) ? current : skill_1);
|
|
302
|
+
const next = caret === null || capabilities?.mentions === false ? null : findMentionQuery(value, caret);
|
|
303
|
+
setMention(current_0 => sameQuery(current_0, next) ? current_0 : next);
|
|
142
304
|
};
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
305
|
+
$[50] = capabilities?.mentions;
|
|
306
|
+
$[51] = t13;
|
|
307
|
+
} else {
|
|
308
|
+
t13 = $[51];
|
|
309
|
+
}
|
|
310
|
+
const trackTriggers = t13;
|
|
311
|
+
let t14;
|
|
312
|
+
if ($[52] !== inputRef) {
|
|
313
|
+
t14 = caret_0 => {
|
|
314
|
+
requestAnimationFrame(() => inputRef.current?.setCaret(caret_0));
|
|
146
315
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
316
|
+
$[52] = inputRef;
|
|
317
|
+
$[53] = t14;
|
|
318
|
+
} else {
|
|
319
|
+
t14 = $[53];
|
|
320
|
+
}
|
|
321
|
+
const moveCaret = t14;
|
|
322
|
+
let t15;
|
|
323
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
324
|
+
t15 = () => {
|
|
325
|
+
setMention(null);
|
|
326
|
+
setSkillQuery(null);
|
|
155
327
|
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
328
|
+
$[54] = t15;
|
|
329
|
+
} else {
|
|
330
|
+
t15 = $[54];
|
|
331
|
+
}
|
|
332
|
+
const close = t15;
|
|
333
|
+
let t16;
|
|
334
|
+
if ($[55] !== draft.mentions || $[56] !== mention || $[57] !== moveCaret || $[58] !== setText || $[59] !== text) {
|
|
335
|
+
t16 = path => {
|
|
336
|
+
if (!mention) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
const result = insertMention(text, mention, path);
|
|
340
|
+
setText(result.text, draft.mentions.includes(path) ? draft.mentions : [...draft.mentions, path]);
|
|
341
|
+
setMention(null);
|
|
342
|
+
moveCaret(result.caret);
|
|
165
343
|
};
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
344
|
+
$[55] = draft.mentions;
|
|
345
|
+
$[56] = mention;
|
|
346
|
+
$[57] = moveCaret;
|
|
347
|
+
$[58] = setText;
|
|
348
|
+
$[59] = text;
|
|
349
|
+
$[60] = t16;
|
|
350
|
+
} else {
|
|
351
|
+
t16 = $[60];
|
|
352
|
+
}
|
|
353
|
+
const chooseMention = t16;
|
|
354
|
+
let t17;
|
|
355
|
+
if ($[61] !== mention || $[62] !== moveCaret || $[63] !== setDraft || $[64] !== text) {
|
|
356
|
+
t17 = id => {
|
|
357
|
+
if (!mention) {
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
const result_0 = dropQuery(text, mention);
|
|
361
|
+
setDraft(current_1 => ({
|
|
362
|
+
...current_1,
|
|
363
|
+
text: result_0.text,
|
|
364
|
+
chats: current_1.chats.includes(id) ? current_1.chats : [...current_1.chats, id]
|
|
365
|
+
}));
|
|
366
|
+
setMention(null);
|
|
367
|
+
moveCaret(result_0.caret);
|
|
368
|
+
};
|
|
369
|
+
$[61] = mention;
|
|
370
|
+
$[62] = moveCaret;
|
|
371
|
+
$[63] = setDraft;
|
|
372
|
+
$[64] = text;
|
|
373
|
+
$[65] = t17;
|
|
374
|
+
} else {
|
|
375
|
+
t17 = $[65];
|
|
376
|
+
}
|
|
377
|
+
const chooseChat = t17;
|
|
378
|
+
let t18;
|
|
379
|
+
if ($[66] !== chatMatches || $[67] !== chooseChat || $[68] !== chooseMention || $[69] !== mention || $[70] !== searched) {
|
|
380
|
+
t18 = index => {
|
|
381
|
+
const pick = mention === null ? null : mentionPick(index, chatMatches, searched, mention.query);
|
|
382
|
+
if (pick?.kind === "chat") {
|
|
383
|
+
chooseChat(pick.chat.id);
|
|
384
|
+
} else {
|
|
385
|
+
if (pick?.kind === "file") {
|
|
386
|
+
chooseMention(pick.path);
|
|
173
387
|
}
|
|
388
|
+
}
|
|
174
389
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
390
|
+
$[66] = chatMatches;
|
|
391
|
+
$[67] = chooseChat;
|
|
392
|
+
$[68] = chooseMention;
|
|
393
|
+
$[69] = mention;
|
|
394
|
+
$[70] = searched;
|
|
395
|
+
$[71] = t18;
|
|
396
|
+
} else {
|
|
397
|
+
t18 = $[71];
|
|
398
|
+
}
|
|
399
|
+
const chooseMentionAt = t18;
|
|
400
|
+
let t19;
|
|
401
|
+
if ($[72] !== draft.mentions || $[73] !== draft.skills || $[74] !== moveCaret || $[75] !== setText || $[76] !== skillQuery || $[77] !== text) {
|
|
402
|
+
t19 = name_2 => {
|
|
403
|
+
const result_1 = skillQuery ? insertSkill(text, skillQuery, name_2) : {
|
|
404
|
+
text: `$${name_2} `,
|
|
405
|
+
caret: name_2.length + 2
|
|
406
|
+
};
|
|
407
|
+
setText(result_1.text, draft.mentions, draft.skills.includes(name_2) ? draft.skills : [...draft.skills, name_2]);
|
|
408
|
+
setSkillQuery(null);
|
|
409
|
+
moveCaret(result_1.caret);
|
|
184
410
|
};
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
411
|
+
$[72] = draft.mentions;
|
|
412
|
+
$[73] = draft.skills;
|
|
413
|
+
$[74] = moveCaret;
|
|
414
|
+
$[75] = setText;
|
|
415
|
+
$[76] = skillQuery;
|
|
416
|
+
$[77] = text;
|
|
417
|
+
$[78] = t19;
|
|
418
|
+
} else {
|
|
419
|
+
t19 = $[78];
|
|
420
|
+
}
|
|
421
|
+
const chooseSkill = t19;
|
|
422
|
+
let t20;
|
|
423
|
+
if ($[79] !== chooseSkill || $[80] !== inputRef || $[81] !== setText) {
|
|
424
|
+
t20 = (command_0, index_0) => {
|
|
425
|
+
setMenuIndex(index_0);
|
|
426
|
+
if (command_0.skill) {
|
|
427
|
+
chooseSkill(command_0.name);
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
setText(`/${command_0.name}`);
|
|
431
|
+
inputRef.current?.focus();
|
|
194
432
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
433
|
+
$[79] = chooseSkill;
|
|
434
|
+
$[80] = inputRef;
|
|
435
|
+
$[81] = setText;
|
|
436
|
+
$[82] = t20;
|
|
437
|
+
} else {
|
|
438
|
+
t20 = $[82];
|
|
439
|
+
}
|
|
440
|
+
const pickCommand = t20;
|
|
441
|
+
let t21;
|
|
442
|
+
if ($[83] === Symbol.for("react.memo_cache_sentinel")) {
|
|
443
|
+
t21 = (key, count) => {
|
|
444
|
+
if (key === "ArrowDown") {
|
|
445
|
+
setMenuIndex(i => (i + 1) % count);
|
|
446
|
+
return true;
|
|
447
|
+
}
|
|
448
|
+
if (key === "ArrowUp") {
|
|
449
|
+
setMenuIndex(i_0 => (i_0 - 1 + count) % count);
|
|
450
|
+
return true;
|
|
451
|
+
}
|
|
452
|
+
return false;
|
|
206
453
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
454
|
+
$[83] = t21;
|
|
455
|
+
} else {
|
|
456
|
+
t21 = $[83];
|
|
457
|
+
}
|
|
458
|
+
const moveInMenu = t21;
|
|
459
|
+
const t22 = skills.length > 0;
|
|
460
|
+
let t23;
|
|
461
|
+
if ($[84] !== activeIndex || $[85] !== chatMatches || $[86] !== chooseChat || $[87] !== chooseMention || $[88] !== chooseMentionAt || $[89] !== chooseSkill || $[90] !== commandMenuOpen || $[91] !== commandQuery || $[92] !== commands || $[93] !== files_0 || $[94] !== inputAria || $[95] !== listId || $[96] !== mention || $[97] !== mentionCount || $[98] !== mentionMenuOpen || $[99] !== pickCommand || $[100] !== skillMatches || $[101] !== skillMenuOpen || $[102] !== t22 || $[103] !== trackTriggers) {
|
|
462
|
+
t23 = {
|
|
463
|
+
listId,
|
|
464
|
+
activeIndex,
|
|
465
|
+
inputAria,
|
|
466
|
+
hasSkills: t22,
|
|
467
|
+
commandQuery,
|
|
468
|
+
commands,
|
|
469
|
+
commandMenuOpen,
|
|
470
|
+
skillMatches,
|
|
471
|
+
skillMenuOpen,
|
|
472
|
+
mention,
|
|
473
|
+
mentionMenuOpen,
|
|
474
|
+
mentionCount,
|
|
475
|
+
chatMatches,
|
|
476
|
+
files: files_0,
|
|
477
|
+
setMenuIndex,
|
|
478
|
+
trackTriggers,
|
|
479
|
+
close,
|
|
480
|
+
chooseMention,
|
|
481
|
+
chooseChat,
|
|
482
|
+
chooseMentionAt,
|
|
483
|
+
chooseSkill,
|
|
484
|
+
pickCommand,
|
|
485
|
+
moveInMenu
|
|
231
486
|
};
|
|
487
|
+
$[84] = activeIndex;
|
|
488
|
+
$[85] = chatMatches;
|
|
489
|
+
$[86] = chooseChat;
|
|
490
|
+
$[87] = chooseMention;
|
|
491
|
+
$[88] = chooseMentionAt;
|
|
492
|
+
$[89] = chooseSkill;
|
|
493
|
+
$[90] = commandMenuOpen;
|
|
494
|
+
$[91] = commandQuery;
|
|
495
|
+
$[92] = commands;
|
|
496
|
+
$[93] = files_0;
|
|
497
|
+
$[94] = inputAria;
|
|
498
|
+
$[95] = listId;
|
|
499
|
+
$[96] = mention;
|
|
500
|
+
$[97] = mentionCount;
|
|
501
|
+
$[98] = mentionMenuOpen;
|
|
502
|
+
$[99] = pickCommand;
|
|
503
|
+
$[100] = skillMatches;
|
|
504
|
+
$[101] = skillMenuOpen;
|
|
505
|
+
$[102] = t22;
|
|
506
|
+
$[103] = trackTriggers;
|
|
507
|
+
$[104] = t23;
|
|
508
|
+
} else {
|
|
509
|
+
t23 = $[104];
|
|
510
|
+
}
|
|
511
|
+
return t23;
|
|
512
|
+
}
|
|
513
|
+
function _temp3(skill) {
|
|
514
|
+
return skill.name;
|
|
232
515
|
}
|
|
516
|
+
function _temp2() {}
|
|
517
|
+
function _temp() {}
|