@adecore/agents-react 0.31.12 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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.d.ts +10 -0
- package/dist/chat/logic/workflow.js +130 -32
- 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 +285 -79
- 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.d.ts +8 -20
- package/dist/chat/ui/mermaid.js +47 -84
- 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.d.ts +3 -0
- package/dist/chat/ui/rows/WorkRows.js +1945 -164
- package/dist/chat/ui/rows/WorkflowRow.js +756 -37
- 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 +42 -0
- package/dist/locales/en/agent-chat.js +755 -713
- 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 +42 -0
- package/dist/locales/nl/agent-chat.js +755 -713
- 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 -27
- 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.js +404 -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 +9 -9
- 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/logic/workflow.ts +86 -4
- 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 +57 -49
- 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/mermaid.ts +52 -96
- 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 +11 -6
- package/src/chat/ui/rows/WorkflowRow.tsx +144 -54
- 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 +142 -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 +134 -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/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 +2 -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,19 +1,23 @@
|
|
|
1
1
|
import { diffRows } from '@adecore/merge';
|
|
2
2
|
// Larger rendering tiers need native production measurements before this gate expands.
|
|
3
3
|
export const EDITOR_DIFF_WORK = 4_000_000;
|
|
4
|
-
export const EDITOR_DIFF_LIMITS = {
|
|
4
|
+
export const EDITOR_DIFF_LIMITS = {
|
|
5
|
+
rows: 2000,
|
|
6
|
+
characters: 2000000,
|
|
7
|
+
lineLength: 10000
|
|
8
|
+
};
|
|
5
9
|
export function canRenderEditorDiff(document) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
const text = row.new === undefined ? document.sides.old[row.old.index] : document.sides.new[row.new.index];
|
|
13
|
-
characters += text.length + (rows > 0 ? 1 : 0);
|
|
14
|
-
if (++rows > EDITOR_DIFF_LIMITS.rows || characters > EDITOR_DIFF_LIMITS.characters || text.length > EDITOR_DIFF_LIMITS.lineLength) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
10
|
+
let rows = 0;
|
|
11
|
+
let characters = 0;
|
|
12
|
+
for (const row of diffRows(document, 'unified')) {
|
|
13
|
+
if (row.kind === 'gap') {
|
|
14
|
+
continue;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const text = row.new === undefined ? document.sides.old[row.old.index] : document.sides.new[row.new.index];
|
|
17
|
+
characters += text.length + (rows > 0 ? 1 : 0);
|
|
18
|
+
if (++rows > EDITOR_DIFF_LIMITS.rows || characters > EDITOR_DIFF_LIMITS.characters || text.length > EDITOR_DIFF_LIMITS.lineLength) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
@@ -1,48 +1,71 @@
|
|
|
1
|
-
export const REVIEW_BUDGET = {
|
|
1
|
+
export const REVIEW_BUDGET = {
|
|
2
|
+
editors: 3,
|
|
3
|
+
rows: 2000,
|
|
4
|
+
characters: 2000000
|
|
5
|
+
};
|
|
2
6
|
export function reviewEntries(patches, edits) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
return [...patches.map((patch, index) => ({
|
|
8
|
+
key: `patch:${index}:${patch.path}`,
|
|
9
|
+
path: patch.path,
|
|
10
|
+
change: {
|
|
11
|
+
kind: 'patch',
|
|
12
|
+
patch
|
|
13
|
+
}
|
|
14
|
+
})), ...edits.map((edit, index) => ({
|
|
15
|
+
key: `edit:${index}:${edit.path}`,
|
|
16
|
+
path: edit.path,
|
|
17
|
+
change: {
|
|
18
|
+
kind: 'edit',
|
|
19
|
+
edit
|
|
20
|
+
}
|
|
21
|
+
}))];
|
|
7
22
|
}
|
|
8
23
|
export function reviewSize(entry, budget = REVIEW_BUDGET) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
24
|
+
const texts = entry.change.kind === 'edit' ? [entry.change.edit.before, entry.change.edit.after] : [entry.change.patch.diff];
|
|
25
|
+
const characters = texts.reduce((sum, text) => sum + text.length, 0);
|
|
26
|
+
if (characters > budget.characters) {
|
|
27
|
+
return {
|
|
28
|
+
rows: budget.rows + 1,
|
|
29
|
+
characters
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
let rows = 0;
|
|
33
|
+
for (const text of texts) {
|
|
34
|
+
if (text.length > 0) {
|
|
35
|
+
rows++;
|
|
13
36
|
}
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return { rows, characters };
|
|
22
|
-
}
|
|
23
|
-
}
|
|
37
|
+
for (let index = text.indexOf('\n'); index >= 0; index = text.indexOf('\n', index + 1)) {
|
|
38
|
+
if (++rows > budget.rows) {
|
|
39
|
+
return {
|
|
40
|
+
rows,
|
|
41
|
+
characters
|
|
42
|
+
};
|
|
43
|
+
}
|
|
24
44
|
}
|
|
25
|
-
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
rows,
|
|
48
|
+
characters
|
|
49
|
+
};
|
|
26
50
|
}
|
|
27
51
|
export function planReview(entries, promoted, budget = REVIEW_BUDGET) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
slots.set(entry.key, 'deferred');
|
|
45
|
-
}
|
|
52
|
+
const priority = entries.find(entry => entry.key === promoted);
|
|
53
|
+
const ordered = priority === undefined ? entries : [priority, ...entries.filter(entry => entry !== priority)];
|
|
54
|
+
const slots = new Map();
|
|
55
|
+
let editors = 0;
|
|
56
|
+
let rows = 0;
|
|
57
|
+
let characters = 0;
|
|
58
|
+
for (const entry of ordered) {
|
|
59
|
+
const size = reviewSize(entry, budget);
|
|
60
|
+
// The first review keeps its own omission and error handling, even when the group estimate exceeds the budget.
|
|
61
|
+
if (editors === 0 || editors < budget.editors && rows + size.rows <= budget.rows && characters + size.characters <= budget.characters) {
|
|
62
|
+
slots.set(entry.key, 'editor');
|
|
63
|
+
editors++;
|
|
64
|
+
rows += size.rows;
|
|
65
|
+
characters += size.characters;
|
|
66
|
+
} else {
|
|
67
|
+
slots.set(entry.key, 'deferred');
|
|
46
68
|
}
|
|
47
|
-
|
|
48
|
-
|
|
69
|
+
}
|
|
70
|
+
return slots;
|
|
71
|
+
}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
2
|
import { createContext, useContext, useEffect } from 'react';
|
|
2
3
|
export const ReviewSettleContext = createContext(null);
|
|
3
4
|
export function useReviewSettled() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const $ = _c(4);
|
|
6
|
+
const scope = useContext(ReviewSettleContext);
|
|
7
|
+
const key = scope?.key;
|
|
8
|
+
const settle = scope?.settle;
|
|
9
|
+
let t0;
|
|
10
|
+
let t1;
|
|
11
|
+
if ($[0] !== key || $[1] !== settle) {
|
|
12
|
+
t0 = () => {
|
|
13
|
+
if (key !== undefined) {
|
|
14
|
+
settle?.(key);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
t1 = [key, settle];
|
|
18
|
+
$[0] = key;
|
|
19
|
+
$[1] = settle;
|
|
20
|
+
$[2] = t0;
|
|
21
|
+
$[3] = t1;
|
|
22
|
+
} else {
|
|
23
|
+
t0 = $[2];
|
|
24
|
+
t1 = $[3];
|
|
25
|
+
}
|
|
26
|
+
useEffect(t0, t1);
|
|
27
|
+
}
|
|
@@ -3,213 +3,248 @@ let nextGeneration = 0;
|
|
|
3
3
|
const shared = new WeakMap();
|
|
4
4
|
/* The runtime of a host's `code`, made on first use and shared by every diff under that host. */
|
|
5
5
|
export function diffSyntaxRuntime(code) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
let runtime = shared.get(code);
|
|
7
|
+
if (runtime === undefined) {
|
|
8
|
+
runtime = createDiffSyntaxRuntime({
|
|
9
|
+
workerFactory: code.syntaxWorker,
|
|
10
|
+
themes: () => code.custom,
|
|
11
|
+
highlighter: code.highlighter
|
|
12
|
+
});
|
|
13
|
+
shared.set(code, runtime);
|
|
14
|
+
}
|
|
15
|
+
return runtime;
|
|
12
16
|
}
|
|
13
17
|
export function createDiffSyntaxRuntime(options) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
18
|
+
const sessions = new Map();
|
|
19
|
+
let worker;
|
|
20
|
+
let fallback;
|
|
21
|
+
let highlighter;
|
|
22
|
+
let started = false;
|
|
23
|
+
let stopped = false;
|
|
24
|
+
// The names of the custom themes the current worker or fallback has, each sent once.
|
|
25
|
+
const sentThemes = new Set();
|
|
26
|
+
const themes = () => typeof options.themes === 'function' ? options.themes() : options.themes;
|
|
27
|
+
const settle = session => {
|
|
28
|
+
for (const pending of session.pending.values()) {
|
|
29
|
+
pending.resolve(null);
|
|
30
|
+
}
|
|
31
|
+
session.pending.clear();
|
|
32
|
+
};
|
|
33
|
+
const stopWorker = () => {
|
|
34
|
+
worker?.removeEventListener('message', onMessage);
|
|
35
|
+
worker?.removeEventListener('error', onError);
|
|
36
|
+
worker?.removeEventListener('messageerror', onError);
|
|
37
|
+
worker?.terminate();
|
|
38
|
+
worker = undefined;
|
|
39
|
+
};
|
|
40
|
+
const loadHighlighter = () => {
|
|
41
|
+
highlighter ??= import('shiki').then(({
|
|
42
|
+
createHighlighter
|
|
43
|
+
}) => createHighlighter({
|
|
44
|
+
langs: [],
|
|
45
|
+
themes: []
|
|
46
|
+
}));
|
|
47
|
+
return highlighter;
|
|
48
|
+
};
|
|
49
|
+
const start = () => {
|
|
50
|
+
const current = themes();
|
|
51
|
+
sentThemes.clear();
|
|
52
|
+
for (const theme of current) {
|
|
53
|
+
if (theme.name !== undefined) {
|
|
54
|
+
sentThemes.add(theme.name);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
dispatch({
|
|
58
|
+
type: 'start',
|
|
59
|
+
themes: current,
|
|
60
|
+
maxLines: 100000
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
/* Sends a custom theme the host added after the start, ahead of the first request drawn in it. */
|
|
64
|
+
const sendTheme = name => {
|
|
65
|
+
if (sentThemes.has(name)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const theme = themes().find(candidate => candidate.name === name);
|
|
69
|
+
if (theme !== undefined) {
|
|
70
|
+
sentThemes.add(name);
|
|
71
|
+
dispatch({
|
|
72
|
+
type: 'themes',
|
|
73
|
+
themes: [theme]
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const startFallback = () => {
|
|
78
|
+
stopWorker();
|
|
79
|
+
if (fallback !== undefined || stopped) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
fallback = createSyntaxService({
|
|
83
|
+
highlighter: options.highlighter ?? loadHighlighter,
|
|
84
|
+
send: receive
|
|
85
|
+
});
|
|
86
|
+
start();
|
|
87
|
+
for (const [generation, session] of sessions) {
|
|
88
|
+
session.sent = false;
|
|
89
|
+
for (const index of session.pending.keys()) {
|
|
90
|
+
request(generation, session, index);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const onError = event => {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
startFallback();
|
|
97
|
+
};
|
|
98
|
+
const onMessage = event => {
|
|
99
|
+
receive(event.data);
|
|
100
|
+
};
|
|
101
|
+
const initialize = () => {
|
|
102
|
+
if (started || stopped) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
started = true;
|
|
106
|
+
if (options.workerFactory !== undefined) {
|
|
107
|
+
try {
|
|
108
|
+
worker = options.workerFactory();
|
|
109
|
+
worker.addEventListener('message', onMessage);
|
|
110
|
+
worker.addEventListener('error', onError);
|
|
111
|
+
worker.addEventListener('messageerror', onError);
|
|
67
112
|
start();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
for (const index of session.pending.keys()) {
|
|
71
|
-
request(generation, session, index);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const onError = (event) => {
|
|
76
|
-
event.preventDefault();
|
|
113
|
+
return;
|
|
114
|
+
} catch {
|
|
77
115
|
startFallback();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
startFallback();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
startFallback();
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const dispatch = (message) => {
|
|
105
|
-
if (stopped) {
|
|
106
|
-
return;
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
startFallback();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const dispatch = message => {
|
|
122
|
+
if (stopped) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (worker !== undefined) {
|
|
126
|
+
try {
|
|
127
|
+
worker.postMessage(message);
|
|
128
|
+
} catch {
|
|
129
|
+
startFallback();
|
|
130
|
+
}
|
|
131
|
+
} else if (fallback !== undefined) {
|
|
132
|
+
void fallback.handle(message).catch(() => {
|
|
133
|
+
for (const session of sessions.values()) {
|
|
134
|
+
settle(session);
|
|
107
135
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const request = (generation, session, index, resend = false) => {
|
|
140
|
+
const document = !session.sent || resend ? session.definition : undefined;
|
|
141
|
+
if (document !== undefined) {
|
|
142
|
+
sendTheme(document.theme);
|
|
143
|
+
}
|
|
144
|
+
session.sent = true;
|
|
145
|
+
dispatch({
|
|
146
|
+
type: 'request',
|
|
147
|
+
generation,
|
|
148
|
+
index,
|
|
149
|
+
...(document ? {
|
|
150
|
+
document
|
|
151
|
+
} : {})
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
const receive = message => {
|
|
155
|
+
if (stopped || message.type === 'ready') {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (message.type === 'error') {
|
|
159
|
+
if (worker !== undefined) {
|
|
160
|
+
startFallback();
|
|
161
|
+
} else {
|
|
162
|
+
for (const session of sessions.values()) {
|
|
163
|
+
settle(session);
|
|
115
164
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
165
|
+
}
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const session = sessions.get(message.generation);
|
|
169
|
+
const pending = session?.pending.get(message.index);
|
|
170
|
+
if (session === undefined || pending === undefined) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (message.type === 'failed' && message.reason === 'missing' && !pending.resent) {
|
|
174
|
+
pending.resent = true;
|
|
175
|
+
request(message.generation, session, message.index, true);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
session.pending.delete(message.index);
|
|
179
|
+
pending.resolve(message.type === 'tokens' ? message : null);
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
open(document) {
|
|
183
|
+
const generation = ++nextGeneration;
|
|
184
|
+
const session = {
|
|
185
|
+
definition: document,
|
|
186
|
+
pending: new Map(),
|
|
187
|
+
sent: false
|
|
188
|
+
};
|
|
189
|
+
sessions.set(generation, session);
|
|
190
|
+
return {
|
|
191
|
+
request(index) {
|
|
192
|
+
if (stopped || !sessions.has(generation)) {
|
|
193
|
+
return Promise.resolve(null);
|
|
194
|
+
}
|
|
195
|
+
const existing = session.pending.get(index);
|
|
196
|
+
if (existing !== undefined) {
|
|
197
|
+
return existing.promise;
|
|
198
|
+
}
|
|
199
|
+
let resolve;
|
|
200
|
+
const promise = new Promise(done => {
|
|
201
|
+
resolve = done;
|
|
202
|
+
});
|
|
203
|
+
session.pending.set(index, {
|
|
204
|
+
promise,
|
|
205
|
+
resolve,
|
|
206
|
+
resent: false
|
|
207
|
+
});
|
|
208
|
+
const initialized = started;
|
|
209
|
+
initialize();
|
|
210
|
+
// Fallback initialization replays pending requests, including this first one.
|
|
211
|
+
if (initialized || worker !== undefined) {
|
|
212
|
+
request(generation, session, index);
|
|
213
|
+
}
|
|
214
|
+
return promise;
|
|
215
|
+
},
|
|
216
|
+
cancel() {
|
|
217
|
+
settle(session);
|
|
218
|
+
if (started) {
|
|
219
|
+
dispatch({
|
|
220
|
+
type: 'cancel',
|
|
221
|
+
generation
|
|
121
222
|
});
|
|
122
|
-
|
|
123
|
-
};
|
|
124
|
-
const request = (generation, session, index, resend = false) => {
|
|
125
|
-
const document = !session.sent || resend ? session.definition : undefined;
|
|
126
|
-
if (document !== undefined) {
|
|
127
|
-
sendTheme(document.theme);
|
|
128
|
-
}
|
|
129
|
-
session.sent = true;
|
|
130
|
-
dispatch({ type: 'request', generation, index, ...(document ? { document } : {}) });
|
|
131
|
-
};
|
|
132
|
-
const receive = (message) => {
|
|
133
|
-
if (stopped || message.type === 'ready') {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (message.type === 'error') {
|
|
137
|
-
if (worker !== undefined) {
|
|
138
|
-
startFallback();
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
for (const session of sessions.values()) {
|
|
142
|
-
settle(session);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
const session = sessions.get(message.generation);
|
|
148
|
-
const pending = session?.pending.get(message.index);
|
|
149
|
-
if (session === undefined || pending === undefined) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (message.type === 'failed' && message.reason === 'missing' && !pending.resent) {
|
|
153
|
-
pending.resent = true;
|
|
154
|
-
request(message.generation, session, message.index, true);
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
session.pending.delete(message.index);
|
|
158
|
-
pending.resolve(message.type === 'tokens' ? message : null);
|
|
159
|
-
};
|
|
160
|
-
return {
|
|
161
|
-
open(document) {
|
|
162
|
-
const generation = ++nextGeneration;
|
|
163
|
-
const session = { definition: document, pending: new Map(), sent: false };
|
|
164
|
-
sessions.set(generation, session);
|
|
165
|
-
return {
|
|
166
|
-
request(index) {
|
|
167
|
-
if (stopped || !sessions.has(generation)) {
|
|
168
|
-
return Promise.resolve(null);
|
|
169
|
-
}
|
|
170
|
-
const existing = session.pending.get(index);
|
|
171
|
-
if (existing !== undefined) {
|
|
172
|
-
return existing.promise;
|
|
173
|
-
}
|
|
174
|
-
let resolve;
|
|
175
|
-
const promise = new Promise((done) => {
|
|
176
|
-
resolve = done;
|
|
177
|
-
});
|
|
178
|
-
session.pending.set(index, { promise, resolve, resent: false });
|
|
179
|
-
const initialized = started;
|
|
180
|
-
initialize();
|
|
181
|
-
// Fallback initialization replays pending requests, including this first one.
|
|
182
|
-
if (initialized || worker !== undefined) {
|
|
183
|
-
request(generation, session, index);
|
|
184
|
-
}
|
|
185
|
-
return promise;
|
|
186
|
-
},
|
|
187
|
-
cancel() {
|
|
188
|
-
settle(session);
|
|
189
|
-
if (started) {
|
|
190
|
-
dispatch({ type: 'cancel', generation });
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
dispose() {
|
|
194
|
-
settle(session);
|
|
195
|
-
sessions.delete(generation);
|
|
196
|
-
if (started) {
|
|
197
|
-
dispatch({ type: 'dispose', generation });
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
223
|
+
}
|
|
201
224
|
},
|
|
202
225
|
dispose() {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
settle(session);
|
|
227
|
+
sessions.delete(generation);
|
|
228
|
+
if (started) {
|
|
229
|
+
dispatch({
|
|
230
|
+
type: 'dispose',
|
|
231
|
+
generation
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
dispose() {
|
|
238
|
+
stopped = true;
|
|
239
|
+
for (const session of sessions.values()) {
|
|
240
|
+
settle(session);
|
|
241
|
+
}
|
|
242
|
+
sessions.clear();
|
|
243
|
+
stopWorker();
|
|
244
|
+
fallback?.dispose();
|
|
245
|
+
if (options.highlighter === undefined) {
|
|
246
|
+
void highlighter?.then(loaded => loaded.dispose(), () => undefined);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|