@iaforged/context-code 1.0.72 → 1.0.74
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/context-bootstrap.js +7 -8
- package/dist/src/QueryEngine.js +928 -0
- package/dist/src/Task.js +49 -0
- package/dist/src/Tool.js +56 -0
- package/dist/src/assistant/AssistantSessionChooser.js +16 -0
- package/dist/src/assistant/index.js +16 -0
- package/dist/src/assistant/sessionDiscovery.js +16 -0
- package/dist/src/assistant/sessionHistory.js +47 -0
- package/dist/src/bootstrap/state.js +1165 -0
- package/dist/src/bridge/bridgeApi.js +304 -0
- package/dist/src/bridge/bridgeConfig.js +39 -0
- package/dist/src/bridge/bridgeDebug.js +73 -0
- package/dist/src/bridge/bridgeEnabled.js +187 -0
- package/dist/src/bridge/bridgeMain.js +2289 -0
- package/dist/src/bridge/bridgeMessaging.js +353 -0
- package/dist/src/bridge/bridgePermissionCallbacks.js +10 -0
- package/dist/src/bridge/bridgePointer.js +175 -0
- package/dist/src/bridge/bridgeStatusUtil.js +105 -0
- package/dist/src/bridge/bridgeUI.js +412 -0
- package/dist/src/bridge/capacityWake.js +35 -0
- package/dist/src/bridge/codeSessionApi.js +111 -0
- package/dist/src/bridge/createSession.js +273 -0
- package/dist/src/bridge/debugUtils.js +115 -0
- package/dist/src/bridge/envLessBridgeConfig.js +121 -0
- package/dist/src/bridge/flushGate.js +65 -0
- package/dist/src/bridge/inboundAttachments.js +152 -0
- package/dist/src/bridge/inboundMessages.js +63 -0
- package/dist/src/bridge/initReplBridge.js +428 -0
- package/dist/src/bridge/jwtUtils.js +185 -0
- package/dist/src/bridge/pollConfig.js +85 -0
- package/dist/src/bridge/pollConfigDefaults.js +62 -0
- package/dist/src/bridge/remoteBridgeCore.js +712 -0
- package/dist/src/bridge/replBridge.js +1720 -0
- package/dist/src/bridge/replBridgeHandle.js +30 -0
- package/dist/src/bridge/replBridgeTransport.js +236 -0
- package/dist/src/bridge/sessionIdCompat.js +56 -0
- package/dist/src/bridge/sessionRunner.js +421 -0
- package/dist/src/bridge/trustedDevice.js +172 -0
- package/dist/src/bridge/types.js +9 -0
- package/dist/src/bridge/workSecret.js +99 -0
- package/dist/src/buddy/CompanionSprite.js +349 -0
- package/dist/src/buddy/companion.js +107 -0
- package/dist/src/buddy/prompt.js +33 -0
- package/dist/src/buddy/sprites.js +488 -0
- package/dist/src/buddy/types.js +90 -0
- package/dist/src/buddy/useBuddyNotification.js +90 -0
- package/dist/src/cli/bg.js +16 -0
- package/dist/src/cli/exit.js +30 -0
- package/dist/src/cli/handlers/agents.js +55 -0
- package/dist/src/cli/handlers/ant.js +16 -0
- package/dist/src/cli/handlers/auth.js +315 -0
- package/dist/src/cli/handlers/autoMode.js +128 -0
- package/dist/src/cli/handlers/mcp.js +334 -0
- package/dist/src/cli/handlers/plugins.js +634 -0
- package/dist/src/cli/handlers/projects_bridge.js +40 -0
- package/dist/src/cli/handlers/provider.js +42 -0
- package/dist/src/cli/handlers/templateJobs.js +16 -0
- package/dist/src/cli/handlers/util.js +76 -0
- package/dist/src/cli/ndjsonSafeStringify.js +27 -0
- package/dist/src/cli/print.js +4225 -0
- package/dist/src/cli/remoteIO.js +208 -0
- package/dist/src/cli/rollback.js +16 -0
- package/dist/src/cli/structuredIO.js +644 -0
- package/dist/src/cli/transports/HybridTransport.js +233 -0
- package/dist/src/cli/transports/SSETransport.js +538 -0
- package/dist/src/cli/transports/SerialBatchEventUploader.js +224 -0
- package/dist/src/cli/transports/Transport.js +1 -0
- package/dist/src/cli/transports/WebSocketTransport.js +613 -0
- package/dist/src/cli/transports/WorkerStateUploader.js +88 -0
- package/dist/src/cli/transports/ccrClient.js +711 -0
- package/dist/src/cli/transports/transportUtils.js +39 -0
- package/dist/src/cli/up.js +16 -0
- package/dist/src/cli/update.js +315 -0
- package/dist/src/commands/add-dir/add-dir.js +121 -0
- package/dist/src/commands/add-dir/index.js +8 -0
- package/dist/src/commands/add-dir/validation.js +76 -0
- package/dist/src/commands/advisor.js +88 -0
- package/dist/src/commands/agent/agent.js +283 -0
- package/dist/src/commands/agent/agentStore.js +120 -0
- package/dist/src/commands/agent/index.js +9 -0
- package/dist/src/commands/agents/agents.js +9 -0
- package/dist/src/commands/agents/index.js +7 -0
- package/dist/src/commands/ant-trace/index.js +1 -0
- package/dist/src/commands/assistant/assistant.js +16 -0
- package/dist/src/commands/autofix-pr/index.js +1 -0
- package/dist/src/commands/backfill-sessions/index.js +1 -0
- package/dist/src/commands/branch/branch.js +205 -0
- package/dist/src/commands/branch/index.js +11 -0
- package/dist/src/commands/break-cache/index.js +1 -0
- package/dist/src/commands/bridge/bridge.js +512 -0
- package/dist/src/commands/bridge/index.js +22 -0
- package/dist/src/commands/bridge-kick.js +179 -0
- package/dist/src/commands/brief.js +94 -0
- package/dist/src/commands/btw/btw.js +234 -0
- package/dist/src/commands/btw/index.js +9 -0
- package/dist/src/commands/bughunter/index.js +1 -0
- package/dist/src/commands/chrome/chrome.js +291 -0
- package/dist/src/commands/chrome/index.js +11 -0
- package/dist/src/commands/clear/caches.js +116 -0
- package/dist/src/commands/clear/clear.js +5 -0
- package/dist/src/commands/clear/conversation.js +191 -0
- package/dist/src/commands/clear/index.js +9 -0
- package/dist/src/commands/color/color.js +58 -0
- package/dist/src/commands/color/index.js +9 -0
- package/dist/src/commands/commit-push-pr.js +137 -0
- package/dist/src/commands/commit.js +80 -0
- package/dist/src/commands/compact/compact.js +196 -0
- package/dist/src/commands/compact/index.js +11 -0
- package/dist/src/commands/config/config.js +5 -0
- package/dist/src/commands/config/index.js +8 -0
- package/dist/src/commands/context/context-noninteractive.js +221 -0
- package/dist/src/commands/context/context.js +46 -0
- package/dist/src/commands/context/index.js +21 -0
- package/dist/src/commands/copy/copy.js +366 -0
- package/dist/src/commands/copy/index.js +7 -0
- package/dist/src/commands/cost/cost.js +21 -0
- package/dist/src/commands/cost/index.js +16 -0
- package/dist/src/commands/createMovedToPluginCommand.js +33 -0
- package/dist/src/commands/ctx_viz/index.js +1 -0
- package/dist/src/commands/debug-tool-call/index.js +1 -0
- package/dist/src/commands/desktop/desktop.js +5 -0
- package/dist/src/commands/desktop/index.js +22 -0
- package/dist/src/commands/diff/diff.js +5 -0
- package/dist/src/commands/diff/index.js +6 -0
- package/dist/src/commands/doctor/doctor.js +5 -0
- package/dist/src/commands/doctor/index.js +9 -0
- package/dist/src/commands/effort/effort.js +166 -0
- package/dist/src/commands/effort/index.js +11 -0
- package/dist/src/commands/env/index.js +1 -0
- package/dist/src/commands/exit/exit.js +31 -0
- package/dist/src/commands/exit/index.js +9 -0
- package/dist/src/commands/export/export.js +86 -0
- package/dist/src/commands/export/index.js +8 -0
- package/dist/src/commands/extra-usage/extra-usage-core.js +99 -0
- package/dist/src/commands/extra-usage/extra-usage-noninteractive.js +13 -0
- package/dist/src/commands/extra-usage/extra-usage.js +14 -0
- package/dist/src/commands/extra-usage/index.js +27 -0
- package/dist/src/commands/fast/fast.js +275 -0
- package/dist/src/commands/fast/index.js +20 -0
- package/dist/src/commands/feedback/feedback.js +10 -0
- package/dist/src/commands/feedback/index.js +21 -0
- package/dist/src/commands/files/files.js +11 -0
- package/dist/src/commands/files/index.js +9 -0
- package/dist/src/commands/good-claude/index.js +1 -0
- package/dist/src/commands/heapdump/heapdump.js +14 -0
- package/dist/src/commands/heapdump/index.js +9 -0
- package/dist/src/commands/help/help.js +5 -0
- package/dist/src/commands/help/index.js +7 -0
- package/dist/src/commands/hooks/hooks.js +11 -0
- package/dist/src/commands/hooks/index.js +8 -0
- package/dist/src/commands/ide/ide.js +615 -0
- package/dist/src/commands/ide/index.js +8 -0
- package/dist/src/commands/init-verifiers.js +258 -0
- package/dist/src/commands/init.js +249 -0
- package/dist/src/commands/insights.js +2555 -0
- package/dist/src/commands/install-github-app/ApiKeyStep.js +230 -0
- package/dist/src/commands/install-github-app/CheckExistingSecretStep.js +194 -0
- package/dist/src/commands/install-github-app/CheckGitHubStep.js +15 -0
- package/dist/src/commands/install-github-app/ChooseRepoStep.js +211 -0
- package/dist/src/commands/install-github-app/CreatingStep.js +52 -0
- package/dist/src/commands/install-github-app/ErrorStep.js +83 -0
- package/dist/src/commands/install-github-app/ExistingWorkflowStep.js +104 -0
- package/dist/src/commands/install-github-app/InstallAppStep.js +96 -0
- package/dist/src/commands/install-github-app/OAuthFlowStep.js +190 -0
- package/dist/src/commands/install-github-app/SuccessStep.js +93 -0
- package/dist/src/commands/install-github-app/WarningsStep.js +70 -0
- package/dist/src/commands/install-github-app/index.js +10 -0
- package/dist/src/commands/install-github-app/install-github-app.js +593 -0
- package/dist/src/commands/install-github-app/setupGitHubActions.js +227 -0
- package/dist/src/commands/install-slack-app/index.js +9 -0
- package/dist/src/commands/install-slack-app/install-slack-app.js +25 -0
- package/dist/src/commands/install.js +118 -0
- package/dist/src/commands/issue/index.js +1 -0
- package/dist/src/commands/keybindings/index.js +10 -0
- package/dist/src/commands/keybindings/keybindings.js +47 -0
- package/dist/src/commands/limites/index.js +8 -0
- package/dist/src/commands/limites/limites.js +214 -0
- package/dist/src/commands/login/index.js +11 -0
- package/dist/src/commands/login/login.js +120 -0
- package/dist/src/commands/login-openai/index.js +7 -0
- package/dist/src/commands/login-openai/login-openai.js +54 -0
- package/dist/src/commands/logout/index.js +8 -0
- package/dist/src/commands/logout/logout.js +72 -0
- package/dist/src/commands/mcp/addCommand.js +183 -0
- package/dist/src/commands/mcp/index.js +9 -0
- package/dist/src/commands/mcp/mcp.js +78 -0
- package/dist/src/commands/mcp/xaaIdpCommand.js +193 -0
- package/dist/src/commands/memory/index.js +7 -0
- package/dist/src/commands/memory/memory.js +71 -0
- package/dist/src/commands/mobile/index.js +9 -0
- package/dist/src/commands/mobile/mobile.js +278 -0
- package/dist/src/commands/mock-limits/index.js +1 -0
- package/dist/src/commands/model/index.js +14 -0
- package/dist/src/commands/model/model.js +297 -0
- package/dist/src/commands/oauth-refresh/index.js +1 -0
- package/dist/src/commands/onboarding/index.js +1 -0
- package/dist/src/commands/orchestrate/index.js +8 -0
- package/dist/src/commands/orchestrate/orchestrate.js +542 -0
- package/dist/src/commands/output-style/index.js +8 -0
- package/dist/src/commands/output-style/output-style.js +6 -0
- package/dist/src/commands/passes/index.js +17 -0
- package/dist/src/commands/passes/passes.js +22 -0
- package/dist/src/commands/perf-issue/index.js +1 -0
- package/dist/src/commands/permissions/index.js +8 -0
- package/dist/src/commands/permissions/permissions.js +8 -0
- package/dist/src/commands/plan/index.js +8 -0
- package/dist/src/commands/plan/plan.js +115 -0
- package/dist/src/commands/plugin/AddMarketplace.js +95 -0
- package/dist/src/commands/plugin/BrowseMarketplace.js +576 -0
- package/dist/src/commands/plugin/DiscoverPlugins.js +613 -0
- package/dist/src/commands/plugin/ManageMarketplaces.js +582 -0
- package/dist/src/commands/plugin/ManagePlugins.js +1783 -0
- package/dist/src/commands/plugin/PluginErrors.js +124 -0
- package/dist/src/commands/plugin/PluginOptionsDialog.js +367 -0
- package/dist/src/commands/plugin/PluginOptionsFlow.js +97 -0
- package/dist/src/commands/plugin/PluginSettings.js +1042 -0
- package/dist/src/commands/plugin/PluginTrustWarning.js +34 -0
- package/dist/src/commands/plugin/UnifiedInstalledCell.js +615 -0
- package/dist/src/commands/plugin/ValidatePlugin.js +95 -0
- package/dist/src/commands/plugin/index.js +10 -0
- package/dist/src/commands/plugin/parseArgs.js +71 -0
- package/dist/src/commands/plugin/plugin.js +5 -0
- package/dist/src/commands/plugin/pluginDetailsHelpers.js +89 -0
- package/dist/src/commands/plugin/usePagination.js +89 -0
- package/dist/src/commands/policy/index.js +9 -0
- package/dist/src/commands/policy/policy.js +84 -0
- package/dist/src/commands/pr_comments/index.js +49 -0
- package/dist/src/commands/privacy-settings/index.js +11 -0
- package/dist/src/commands/privacy-settings/privacy-settings.js +54 -0
- package/dist/src/commands/profile/index.js +9 -0
- package/dist/src/commands/profile/profile.js +482 -0
- package/dist/src/commands/provider/index.js +8 -0
- package/dist/src/commands/provider/provider.js +457 -0
- package/dist/src/commands/rate-limit-options/index.js +15 -0
- package/dist/src/commands/rate-limit-options/rate-limit-options.js +213 -0
- package/dist/src/commands/release-notes/index.js +9 -0
- package/dist/src/commands/release-notes/release-notes.js +38 -0
- package/dist/src/commands/reload-plugins/index.js +11 -0
- package/dist/src/commands/reload-plugins/reload-plugins.js +52 -0
- package/dist/src/commands/remote-env/index.js +12 -0
- package/dist/src/commands/remote-env/remote-env.js +5 -0
- package/dist/src/commands/remote-setup/api.js +155 -0
- package/dist/src/commands/remote-setup/index.js +15 -0
- package/dist/src/commands/remote-setup/remote-setup.js +149 -0
- package/dist/src/commands/rename/generateSessionName.js +58 -0
- package/dist/src/commands/rename/index.js +9 -0
- package/dist/src/commands/rename/rename.js +52 -0
- package/dist/src/commands/reset-limits/index.js +4 -0
- package/dist/src/commands/resume/index.js +9 -0
- package/dist/src/commands/resume/resume.js +239 -0
- package/dist/src/commands/review/UltrareviewOverageDialog.js +97 -0
- package/dist/src/commands/review/reviewRemote.js +259 -0
- package/dist/src/commands/review/ultrareviewCommand.js +57 -0
- package/dist/src/commands/review/ultrareviewEnabled.js +10 -0
- package/dist/src/commands/review.js +50 -0
- package/dist/src/commands/rewind/index.js +10 -0
- package/dist/src/commands/rewind/rewind.js +7 -0
- package/dist/src/commands/run/index.js +9 -0
- package/dist/src/commands/run/run.js +1126 -0
- package/dist/src/commands/sandbox-toggle/index.js +41 -0
- package/dist/src/commands/sandbox-toggle/sandbox-toggle.js +72 -0
- package/dist/src/commands/security-review.js +231 -0
- package/dist/src/commands/session/index.js +13 -0
- package/dist/src/commands/session/session.js +142 -0
- package/dist/src/commands/share/index.js +1 -0
- package/dist/src/commands/skills/index.js +8 -0
- package/dist/src/commands/skills/skills.js +97 -0
- package/dist/src/commands/stats/index.js +7 -0
- package/dist/src/commands/stats/stats.js +5 -0
- package/dist/src/commands/status/index.js +8 -0
- package/dist/src/commands/status/status.js +5 -0
- package/dist/src/commands/statusline.js +22 -0
- package/dist/src/commands/stickers/index.js +9 -0
- package/dist/src/commands/stickers/stickers.js +14 -0
- package/dist/src/commands/summary/index.js +1 -0
- package/dist/src/commands/tag/index.js +9 -0
- package/dist/src/commands/tag/tag.js +215 -0
- package/dist/src/commands/tasks/index.js +8 -0
- package/dist/src/commands/tasks/tasks.js +5 -0
- package/dist/src/commands/team/index.js +9 -0
- package/dist/src/commands/team/team.js +582 -0
- package/dist/src/commands/team-auto/index.js +9 -0
- package/dist/src/commands/team-auto/teamAuto.js +340 -0
- package/dist/src/commands/telegram/index.js +9 -0
- package/dist/src/commands/telegram/telegram.js +118 -0
- package/dist/src/commands/teleport/index.js +1 -0
- package/dist/src/commands/terminalSetup/index.js +18 -0
- package/dist/src/commands/terminalSetup/terminalSetup.js +491 -0
- package/dist/src/commands/theme/index.js +7 -0
- package/dist/src/commands/theme/theme.js +50 -0
- package/dist/src/commands/thinkback/index.js +9 -0
- package/dist/src/commands/thinkback/thinkback.js +527 -0
- package/dist/src/commands/thinkback-play/index.js +13 -0
- package/dist/src/commands/thinkback-play/thinkback-play.js +34 -0
- package/dist/src/commands/ultraplan.js +418 -0
- package/dist/src/commands/upgrade/index.js +12 -0
- package/dist/src/commands/upgrade/upgrade.js +37 -0
- package/dist/src/commands/version.js +18 -0
- package/dist/src/commands/vim/index.js +8 -0
- package/dist/src/commands/vim/vim.js +25 -0
- package/dist/src/commands/voice/index.js +14 -0
- package/dist/src/commands/voice/voice.js +130 -0
- package/dist/src/commands/whatsapp/index.js +9 -0
- package/dist/src/commands/whatsapp/whatsapp.js +326 -0
- package/dist/src/commands/workspace/index.js +9 -0
- package/dist/src/commands/workspace/workspace.js +701 -0
- package/dist/src/commands.js +635 -0
- package/dist/src/components/AgentProgressLine.js +111 -0
- package/dist/src/components/App.js +45 -0
- package/dist/src/components/ApproveApiKey.js +124 -0
- package/dist/src/components/AutoModeOptInDialog.js +140 -0
- package/dist/src/components/AutoUpdater.js +157 -0
- package/dist/src/components/AutoUpdaterWrapper.js +78 -0
- package/dist/src/components/AwsAuthStatusBox.js +88 -0
- package/dist/src/components/BaseTextInput.js +105 -0
- package/dist/src/components/BashModeProgress.js +48 -0
- package/dist/src/components/BridgeDialog.js +414 -0
- package/dist/src/components/BypassPermissionsModeDialog.js +87 -0
- package/dist/src/components/ChannelDowngradeDialog.js +100 -0
- package/dist/src/components/ClaudeCodeHint/PluginHintMenu.js +37 -0
- package/dist/src/components/ClaudeInChromeOnboarding.js +126 -0
- package/dist/src/components/ClaudeMdExternalIncludesDialog.js +137 -0
- package/dist/src/components/ClickableImageRef.js +64 -0
- package/dist/src/components/CompactSummary.js +119 -0
- package/dist/src/components/ConfigurableShortcutHint.js +34 -0
- package/dist/src/components/ConsoleOAuthFlow.js +758 -0
- package/dist/src/components/ContextSuggestions.js +43 -0
- package/dist/src/components/ContextVisualization.js +483 -0
- package/dist/src/components/CoordinatorAgentStatus.js +261 -0
- package/dist/src/components/CostThresholdDialog.js +48 -0
- package/dist/src/components/CtrlOToExpand.js +50 -0
- package/dist/src/components/CustomSelect/SelectMulti.js +149 -0
- package/dist/src/components/CustomSelect/index.js +2 -0
- package/dist/src/components/CustomSelect/option-map.js +32 -0
- package/dist/src/components/CustomSelect/select-input-option.js +426 -0
- package/dist/src/components/CustomSelect/select-option.js +23 -0
- package/dist/src/components/CustomSelect/select.js +518 -0
- package/dist/src/components/CustomSelect/use-multi-select-state.js +214 -0
- package/dist/src/components/CustomSelect/use-select-input.js +170 -0
- package/dist/src/components/CustomSelect/use-select-navigation.js +366 -0
- package/dist/src/components/CustomSelect/use-select-state.js +22 -0
- package/dist/src/components/DesktopHandoff.js +195 -0
- package/dist/src/components/DesktopUpsell/DesktopUpsellStartup.js +173 -0
- package/dist/src/components/DevBar.js +50 -0
- package/dist/src/components/DevChannelsDialog.js +103 -0
- package/dist/src/components/DiagnosticsDisplay.js +91 -0
- package/dist/src/components/EffortCallout.js +264 -0
- package/dist/src/components/EffortIndicator.js +29 -0
- package/dist/src/components/ExitFlow.js +40 -0
- package/dist/src/components/ExportDialog.js +101 -0
- package/dist/src/components/FallbackToolUseErrorMessage.js +115 -0
- package/dist/src/components/FallbackToolUseRejectedMessage.js +16 -0
- package/dist/src/components/FastIcon.js +42 -0
- package/dist/src/components/Feedback.js +439 -0
- package/dist/src/components/FeedbackSurvey/FeedbackSurvey.js +150 -0
- package/dist/src/components/FeedbackSurvey/FeedbackSurveyView.js +103 -0
- package/dist/src/components/FeedbackSurvey/TranscriptSharePrompt.js +83 -0
- package/dist/src/components/FeedbackSurvey/submitTranscriptShare.js +81 -0
- package/dist/src/components/FeedbackSurvey/useDebouncedDigitInput.js +51 -0
- package/dist/src/components/FeedbackSurvey/useFeedbackSurvey.js +258 -0
- package/dist/src/components/FeedbackSurvey/useMemorySurvey.js +191 -0
- package/dist/src/components/FeedbackSurvey/usePostCompactSurvey.js +202 -0
- package/dist/src/components/FeedbackSurvey/useSurveyState.js +80 -0
- package/dist/src/components/FileEditToolDiff.js +166 -0
- package/dist/src/components/FileEditToolUpdatedMessage.js +111 -0
- package/dist/src/components/FileEditToolUseRejectedMessage.js +157 -0
- package/dist/src/components/FilePathLink.js +34 -0
- package/dist/src/components/FullscreenLayout.js +578 -0
- package/dist/src/components/GlobalSearchDialog.js +339 -0
- package/dist/src/components/HelpV2/Commands.js +65 -0
- package/dist/src/components/HelpV2/General.js +24 -0
- package/dist/src/components/HelpV2/HelpV2.js +186 -0
- package/dist/src/components/HighlightedCode/Fallback.js +193 -0
- package/dist/src/components/HighlightedCode.js +184 -0
- package/dist/src/components/HistorySearchDialog.js +92 -0
- package/dist/src/components/IdeAutoConnectDialog.js +153 -0
- package/dist/src/components/IdeOnboardingDialog.js +174 -0
- package/dist/src/components/IdeStatusIndicator.js +49 -0
- package/dist/src/components/IdleReturnDialog.js +116 -0
- package/dist/src/components/InterruptedByUser.js +15 -0
- package/dist/src/components/InvalidConfigDialog.js +134 -0
- package/dist/src/components/InvalidSettingsDialog.js +84 -0
- package/dist/src/components/KeybindingWarnings.js +54 -0
- package/dist/src/components/LanguagePicker.js +84 -0
- package/dist/src/components/LogSelector.js +1579 -0
- package/dist/src/components/LogoV2/AnimatedAsterisk.js +42 -0
- package/dist/src/components/LogoV2/AnimatedClawd.js +111 -0
- package/dist/src/components/LogoV2/ChannelsNotice.js +258 -0
- package/dist/src/components/LogoV2/Clawd.js +12 -0
- package/dist/src/components/LogoV2/CondensedLogo.js +144 -0
- package/dist/src/components/LogoV2/EmergencyTip.js +47 -0
- package/dist/src/components/LogoV2/Feed.js +84 -0
- package/dist/src/components/LogoV2/FeedColumn.js +55 -0
- package/dist/src/components/LogoV2/GuestPassesUpsell.js +71 -0
- package/dist/src/components/LogoV2/LogoV2.js +564 -0
- package/dist/src/components/LogoV2/Opus1mMergeNotice.js +56 -0
- package/dist/src/components/LogoV2/OverageCreditUpsell.js +160 -0
- package/dist/src/components/LogoV2/VoiceModeNotice.js +70 -0
- package/dist/src/components/LogoV2/WelcomeV2.js +8 -0
- package/dist/src/components/LogoV2/feedConfigs.js +78 -0
- package/dist/src/components/LspRecommendation/LspRecommendationMenu.js +46 -0
- package/dist/src/components/MCPServerApprovalDialog.js +113 -0
- package/dist/src/components/MCPServerDesktopImportDialog.js +206 -0
- package/dist/src/components/MCPServerDialogCopy.js +15 -0
- package/dist/src/components/MCPServerMultiselectDialog.js +133 -0
- package/dist/src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js +149 -0
- package/dist/src/components/ManagedSettingsSecurityDialog/utils.js +105 -0
- package/dist/src/components/Markdown.js +217 -0
- package/dist/src/components/MarkdownTable.js +279 -0
- package/dist/src/components/MemoryUsageIndicator.js +27 -0
- package/dist/src/components/Message.js +566 -0
- package/dist/src/components/MessageModel.js +36 -0
- package/dist/src/components/MessageResponse.js +73 -0
- package/dist/src/components/MessageRow.js +346 -0
- package/dist/src/components/MessageSelector.js +743 -0
- package/dist/src/components/MessageTimestamp.js +57 -0
- package/dist/src/components/Messages.js +637 -0
- package/dist/src/components/ModelPicker.js +493 -0
- package/dist/src/components/NativeAutoUpdater.js +153 -0
- package/dist/src/components/NotebookEditToolUseRejectedMessage.js +83 -0
- package/dist/src/components/OffscreenFreeze.js +35 -0
- package/dist/src/components/Onboarding.js +174 -0
- package/dist/src/components/OutputStylePicker.js +102 -0
- package/dist/src/components/PackageManagerAutoUpdater.js +100 -0
- package/dist/src/components/Passes/Passes.js +113 -0
- package/dist/src/components/PrBadge.js +90 -0
- package/dist/src/components/PressEnterToContinue.js +15 -0
- package/dist/src/components/PromptInput/HistorySearchInput.js +44 -0
- package/dist/src/components/PromptInput/IssueFlagBanner.js +8 -0
- package/dist/src/components/PromptInput/Notifications.js +221 -0
- package/dist/src/components/PromptInput/PromptInput.js +1998 -0
- package/dist/src/components/PromptInput/PromptInputFooter.js +84 -0
- package/dist/src/components/PromptInput/PromptInputFooterLeftSide.js +409 -0
- package/dist/src/components/PromptInput/PromptInputFooterSuggestions.js +280 -0
- package/dist/src/components/PromptInput/PromptInputHelpMenu.js +379 -0
- package/dist/src/components/PromptInput/PromptInputModeIndicator.js +72 -0
- package/dist/src/components/PromptInput/PromptInputQueuedCommands.js +105 -0
- package/dist/src/components/PromptInput/PromptInputStashNotice.js +20 -0
- package/dist/src/components/PromptInput/SandboxPromptFooterHint.js +65 -0
- package/dist/src/components/PromptInput/ShimmeredInput.js +132 -0
- package/dist/src/components/PromptInput/VoiceIndicator.js +136 -0
- package/dist/src/components/PromptInput/inputModes.js +24 -0
- package/dist/src/components/PromptInput/inputPaste.js +62 -0
- package/dist/src/components/PromptInput/useMaybeTruncateInput.js +33 -0
- package/dist/src/components/PromptInput/usePromptInputPlaceholder.js +55 -0
- package/dist/src/components/PromptInput/useShowFastIconHint.js +23 -0
- package/dist/src/components/PromptInput/useSwarmBanner.js +112 -0
- package/dist/src/components/PromptInput/utils.js +50 -0
- package/dist/src/components/QuickOpenDialog.js +243 -0
- package/dist/src/components/RemoteCallout.js +53 -0
- package/dist/src/components/RemoteEnvironmentDialog.js +345 -0
- package/dist/src/components/ResumeTask.js +173 -0
- package/dist/src/components/SandboxViolationExpandedView.js +102 -0
- package/dist/src/components/ScrollKeybindingHandler.js +982 -0
- package/dist/src/components/SearchBox.js +55 -0
- package/dist/src/components/SentryErrorBoundary.js +16 -0
- package/dist/src/components/SessionBackgroundHint.js +104 -0
- package/dist/src/components/SessionPreview.js +200 -0
- package/dist/src/components/Settings/Config.js +1628 -0
- package/dist/src/components/Settings/Settings.js +129 -0
- package/dist/src/components/Settings/Status.js +239 -0
- package/dist/src/components/Settings/Usage.js +341 -0
- package/dist/src/components/ShowInIDEPrompt.js +151 -0
- package/dist/src/components/SkillImprovementSurvey.js +130 -0
- package/dist/src/components/Spinner/FlashingChar.js +51 -0
- package/dist/src/components/Spinner/GlimmerMessage.js +328 -0
- package/dist/src/components/Spinner/ShimmerChar.js +22 -0
- package/dist/src/components/Spinner/SpinnerAnimationRow.js +169 -0
- package/dist/src/components/Spinner/SpinnerGlyph.js +69 -0
- package/dist/src/components/Spinner/TeammateSpinnerLine.js +170 -0
- package/dist/src/components/Spinner/TeammateSpinnerTree.js +268 -0
- package/dist/src/components/Spinner/index.js +11 -0
- package/dist/src/components/Spinner/teammateSelectHint.js +1 -0
- package/dist/src/components/Spinner/useShimmerAnimation.js +22 -0
- package/dist/src/components/Spinner/useStalledAnimation.js +63 -0
- package/dist/src/components/Spinner/utils.js +77 -0
- package/dist/src/components/Spinner.js +470 -0
- package/dist/src/components/Stats.js +1000 -0
- package/dist/src/components/StatusLine.js +288 -0
- package/dist/src/components/StatusNotices.js +50 -0
- package/dist/src/components/StructuredDiff/Fallback.js +335 -0
- package/dist/src/components/StructuredDiff/colorDiff.js +26 -0
- package/dist/src/components/StructuredDiff.js +152 -0
- package/dist/src/components/StructuredDiffList.js +8 -0
- package/dist/src/components/TagTabs.js +100 -0
- package/dist/src/components/TaskListV2.js +333 -0
- package/dist/src/components/TeammateViewHeader.js +87 -0
- package/dist/src/components/TeleportError.js +191 -0
- package/dist/src/components/TeleportProgress.js +130 -0
- package/dist/src/components/TeleportRepoMismatchDialog.js +98 -0
- package/dist/src/components/TeleportResumeWrapper.js +158 -0
- package/dist/src/components/TeleportStash.js +82 -0
- package/dist/src/components/TextInput.js +108 -0
- package/dist/src/components/ThemePicker.js +330 -0
- package/dist/src/components/ThinkingToggle.js +153 -0
- package/dist/src/components/TokenWarning.js +172 -0
- package/dist/src/components/ToolUseLoader.js +34 -0
- package/dist/src/components/TrustDialog/TrustDialog.js +113 -0
- package/dist/src/components/TrustDialog/utils.js +199 -0
- package/dist/src/components/ValidationErrorsList.js +146 -0
- package/dist/src/components/VimTextInput.js +136 -0
- package/dist/src/components/VirtualMessageList.js +892 -0
- package/dist/src/components/WorkflowMultiselectDialog.js +118 -0
- package/dist/src/components/WorktreeExitDialog.js +222 -0
- package/dist/src/components/agents/AgentDetail.js +226 -0
- package/dist/src/components/agents/AgentEditor.js +146 -0
- package/dist/src/components/agents/AgentNavigationFooter.js +21 -0
- package/dist/src/components/agents/AgentsList.js +436 -0
- package/dist/src/components/agents/AgentsMenu.js +848 -0
- package/dist/src/components/agents/ColorPicker.js +110 -0
- package/dist/src/components/agents/ModelSelector.js +62 -0
- package/dist/src/components/agents/SnapshotUpdateDialog.js +16 -0
- package/dist/src/components/agents/ToolSelector.js +557 -0
- package/dist/src/components/agents/agentFileUtils.js +187 -0
- package/dist/src/components/agents/generateAgent.js +161 -0
- package/dist/src/components/agents/new-agent-creation/CreateAgentWizard.js +88 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ColorStep.js +80 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.js +386 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.js +63 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.js +126 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.js +118 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/LocationStep.js +92 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.js +120 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +79 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ModelStep.js +48 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/PromptStep.js +131 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.js +51 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/TypeStep.js +100 -0
- package/dist/src/components/agents/types.js +4 -0
- package/dist/src/components/agents/utils.js +14 -0
- package/dist/src/components/agents/validateAgent.js +79 -0
- package/dist/src/components/design-system/Byline.js +72 -0
- package/dist/src/components/design-system/Dialog.js +116 -0
- package/dist/src/components/design-system/Divider.js +109 -0
- package/dist/src/components/design-system/FuzzyPicker.js +187 -0
- package/dist/src/components/design-system/KeyboardShortcutHint.js +67 -0
- package/dist/src/components/design-system/ListItem.js +183 -0
- package/dist/src/components/design-system/LoadingState.js +68 -0
- package/dist/src/components/design-system/Pane.js +68 -0
- package/dist/src/components/design-system/ProgressBar.js +62 -0
- package/dist/src/components/design-system/Ratchet.js +71 -0
- package/dist/src/components/design-system/StatusIcon.js +69 -0
- package/dist/src/components/design-system/Tabs.js +269 -0
- package/dist/src/components/design-system/ThemeProvider.js +137 -0
- package/dist/src/components/design-system/ThemedBox.js +125 -0
- package/dist/src/components/design-system/ThemedText.js +60 -0
- package/dist/src/components/design-system/color.js +22 -0
- package/dist/src/components/diff/DiffDetailView.js +284 -0
- package/dist/src/components/diff/DiffDialog.js +387 -0
- package/dist/src/components/diff/DiffFileList.js +291 -0
- package/dist/src/components/grove/Grove.js +483 -0
- package/dist/src/components/hooks/HooksConfigMenu.js +570 -0
- package/dist/src/components/hooks/PromptDialog.js +81 -0
- package/dist/src/components/hooks/SelectEventMode.js +117 -0
- package/dist/src/components/hooks/SelectHookMode.js +93 -0
- package/dist/src/components/hooks/SelectMatcherMode.js +124 -0
- package/dist/src/components/hooks/ViewHookMode.js +197 -0
- package/dist/src/components/mcp/CapabilitiesSection.js +55 -0
- package/dist/src/components/mcp/ElicitationDialog.js +945 -0
- package/dist/src/components/mcp/MCPAgentServerMenu.js +95 -0
- package/dist/src/components/mcp/MCPListPanel.js +504 -0
- package/dist/src/components/mcp/MCPReconnect.js +168 -0
- package/dist/src/components/mcp/MCPRemoteServerMenu.js +460 -0
- package/dist/src/components/mcp/MCPSettings.js +414 -0
- package/dist/src/components/mcp/MCPStdioServerMenu.js +95 -0
- package/dist/src/components/mcp/MCPToolDetailView.js +219 -0
- package/dist/src/components/mcp/MCPToolListView.js +136 -0
- package/dist/src/components/mcp/McpParsingWarnings.js +211 -0
- package/dist/src/components/mcp/index.js +8 -0
- package/dist/src/components/mcp/types.js +3 -0
- package/dist/src/components/mcp/utils/reconnectHelpers.js +35 -0
- package/dist/src/components/memory/MemoryFileSelector.js +455 -0
- package/dist/src/components/memory/MemoryUpdateNotification.js +42 -0
- package/dist/src/components/messageActions.js +418 -0
- package/dist/src/components/messages/AdvisorMessage.js +151 -0
- package/dist/src/components/messages/AssistantRedactedThinkingMessage.js +27 -0
- package/dist/src/components/messages/AssistantTextMessage.js +274 -0
- package/dist/src/components/messages/AssistantThinkingMessage.js +69 -0
- package/dist/src/components/messages/AssistantToolUseMessage.js +323 -0
- package/dist/src/components/messages/AttachmentMessage.js +418 -0
- package/dist/src/components/messages/CollapsedReadSearchContent.js +362 -0
- package/dist/src/components/messages/CompactBoundaryMessage.js +18 -0
- package/dist/src/components/messages/GroupedToolUseContent.js +37 -0
- package/dist/src/components/messages/HighlightedThinkingText.js +164 -0
- package/dist/src/components/messages/HookProgressMessage.js +110 -0
- package/dist/src/components/messages/PlanApprovalMessage.js +212 -0
- package/dist/src/components/messages/RateLimitMessage.js +149 -0
- package/dist/src/components/messages/ShutdownMessage.js +123 -0
- package/dist/src/components/messages/SystemAPIErrorMessage.js +135 -0
- package/dist/src/components/messages/SystemTextMessage.js +843 -0
- package/dist/src/components/messages/TaskAssignmentMessage.js +71 -0
- package/dist/src/components/messages/UserAgentNotificationMessage.js +77 -0
- package/dist/src/components/messages/UserBashInputMessage.js +51 -0
- package/dist/src/components/messages/UserBashOutputMessage.js +54 -0
- package/dist/src/components/messages/UserChannelMessage.js +129 -0
- package/dist/src/components/messages/UserCommandMessage.js +106 -0
- package/dist/src/components/messages/UserImageMessage.js +53 -0
- package/dist/src/components/messages/UserLocalCommandOutputMessage.js +169 -0
- package/dist/src/components/messages/UserMemoryInputMessage.js +72 -0
- package/dist/src/components/messages/UserPlanMessage.js +37 -0
- package/dist/src/components/messages/UserPromptMessage.js +63 -0
- package/dist/src/components/messages/UserResourceUpdateMessage.js +101 -0
- package/dist/src/components/messages/UserTeammateMessage.js +156 -0
- package/dist/src/components/messages/UserTextMessage.js +271 -0
- package/dist/src/components/messages/UserToolResultMessage/RejectedPlanMessage.js +27 -0
- package/dist/src/components/messages/UserToolResultMessage/RejectedToolUseMessage.js +16 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +16 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolErrorMessage.js +91 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolRejectMessage.js +73 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolResultMessage.js +83 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +58 -0
- package/dist/src/components/messages/UserToolResultMessage/utils.js +43 -0
- package/dist/src/components/messages/nullRenderingAttachments.js +58 -0
- package/dist/src/components/messages/teamMemCollapsed.js +142 -0
- package/dist/src/components/messages/teamMemSaved.js +17 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +654 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.js +219 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.js +227 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.js +174 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.js +444 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.js +136 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/use-multiple-choice-state.js +100 -0
- package/dist/src/components/permissions/BashPermissionRequest/BashPermissionRequest.js +404 -0
- package/dist/src/components/permissions/BashPermissionRequest/bashToolUseOptions.js +110 -0
- package/dist/src/components/permissions/ComputerUseApproval/ComputerUseApproval.js +448 -0
- package/dist/src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.js +125 -0
- package/dist/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.js +649 -0
- package/dist/src/components/permissions/FallbackPermissionRequest.js +348 -0
- package/dist/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +184 -0
- package/dist/src/components/permissions/FilePermissionDialog/FilePermissionDialog.js +108 -0
- package/dist/src/components/permissions/FilePermissionDialog/ideDiffConfig.js +13 -0
- package/dist/src/components/permissions/FilePermissionDialog/permissionOptions.js +136 -0
- package/dist/src/components/permissions/FilePermissionDialog/useFilePermissionDialog.js +131 -0
- package/dist/src/components/permissions/FilePermissionDialog/usePermissionHandler.js +86 -0
- package/dist/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +163 -0
- package/dist/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +78 -0
- package/dist/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +112 -0
- package/dist/src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.js +163 -0
- package/dist/src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.js +217 -0
- package/dist/src/components/permissions/PermissionDecisionDebugInfo.js +466 -0
- package/dist/src/components/permissions/PermissionDialog.js +54 -0
- package/dist/src/components/permissions/PermissionExplanation.js +269 -0
- package/dist/src/components/permissions/PermissionPrompt.js +316 -0
- package/dist/src/components/permissions/PermissionRequest.js +160 -0
- package/dist/src/components/permissions/PermissionRequestTitle.js +57 -0
- package/dist/src/components/permissions/PermissionRuleExplanation.js +116 -0
- package/dist/src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.js +178 -0
- package/dist/src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.js +73 -0
- package/dist/src/components/permissions/SandboxPermissionRequest.js +161 -0
- package/dist/src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.js +228 -0
- package/dist/src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.js +384 -0
- package/dist/src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.js +258 -0
- package/dist/src/components/permissions/WorkerBadge.js +43 -0
- package/dist/src/components/permissions/WorkerPendingPermission.js +106 -0
- package/dist/src/components/permissions/hooks.js +163 -0
- package/dist/src/components/permissions/rules/AddPermissionRules.js +172 -0
- package/dist/src/components/permissions/rules/AddWorkspaceDirectory.js +334 -0
- package/dist/src/components/permissions/rules/PermissionRuleDescription.js +77 -0
- package/dist/src/components/permissions/rules/PermissionRuleInput.js +135 -0
- package/dist/src/components/permissions/rules/PermissionRuleList.js +1189 -0
- package/dist/src/components/permissions/rules/RecentDenialsTab.js +204 -0
- package/dist/src/components/permissions/rules/RemoveWorkspaceDirectory.js +102 -0
- package/dist/src/components/permissions/rules/WorkspaceTab.js +132 -0
- package/dist/src/components/permissions/shellPermissionHelpers.js +111 -0
- package/dist/src/components/permissions/useShellPermissionFeedback.js +108 -0
- package/dist/src/components/permissions/utils.js +14 -0
- package/dist/src/components/sandbox/SandboxConfigTab.js +47 -0
- package/dist/src/components/sandbox/SandboxDependenciesTab.js +122 -0
- package/dist/src/components/sandbox/SandboxDoctorSection.js +46 -0
- package/dist/src/components/sandbox/SandboxOverridesTab.js +192 -0
- package/dist/src/components/sandbox/SandboxSettings.js +296 -0
- package/dist/src/components/shell/ExpandShellOutputContext.js +33 -0
- package/dist/src/components/shell/OutputLine.js +110 -0
- package/dist/src/components/shell/ShellProgressMessage.js +143 -0
- package/dist/src/components/shell/ShellTimeDisplay.js +71 -0
- package/dist/src/components/skills/SkillsMenu.js +238 -0
- package/dist/src/components/tasks/AsyncAgentDetailDialog.js +234 -0
- package/dist/src/components/tasks/BackgroundTask.js +363 -0
- package/dist/src/components/tasks/BackgroundTaskStatus.js +419 -0
- package/dist/src/components/tasks/BackgroundTasksDialog.js +496 -0
- package/dist/src/components/tasks/DreamDetailDialog.js +250 -0
- package/dist/src/components/tasks/InProcessTeammateDetailDialog.js +274 -0
- package/dist/src/components/tasks/RemoteSessionDetailDialog.js +868 -0
- package/dist/src/components/tasks/RemoteSessionProgress.js +249 -0
- package/dist/src/components/tasks/ShellDetailDialog.js +403 -0
- package/dist/src/components/tasks/ShellProgress.js +76 -0
- package/dist/src/components/tasks/renderToolActivity.js +28 -0
- package/dist/src/components/tasks/taskStatusUtils.js +94 -0
- package/dist/src/components/teams/TeamStatus.js +76 -0
- package/dist/src/components/teams/TeamsDialog.js +672 -0
- package/dist/src/components/ui/ContextCard.js +5 -0
- package/dist/src/components/ui/OrderedList.js +66 -0
- package/dist/src/components/ui/OrderedListItem.js +41 -0
- package/dist/src/components/ui/TreeSelect.js +300 -0
- package/dist/src/components/wizard/WizardDialogLayout.js +47 -0
- package/dist/src/components/wizard/WizardNavigationFooter.js +10 -0
- package/dist/src/components/wizard/WizardProvider.js +217 -0
- package/dist/src/components/wizard/index.js +4 -0
- package/dist/src/components/wizard/useWizard.js +9 -0
- package/dist/src/constants/apiLimits.js +81 -0
- package/dist/src/constants/betas.js +45 -0
- package/dist/src/constants/common.js +29 -0
- package/dist/src/constants/cyberRiskInstruction.js +24 -0
- package/dist/src/constants/errorIds.js +14 -0
- package/dist/src/constants/figures.js +38 -0
- package/dist/src/constants/files.js +150 -0
- package/dist/src/constants/github-app.js +139 -0
- package/dist/src/constants/keys.js +10 -0
- package/dist/src/constants/messages.js +1 -0
- package/dist/src/constants/oauth.js +221 -0
- package/dist/src/constants/outputStyles.js +162 -0
- package/dist/src/constants/product.js +56 -0
- package/dist/src/constants/prompts.js +752 -0
- package/dist/src/constants/spinnerVerbs.js +202 -0
- package/dist/src/constants/system.js +77 -0
- package/dist/src/constants/systemPromptSections.js +39 -0
- package/dist/src/constants/toolLimits.js +50 -0
- package/dist/src/constants/tools.js +103 -0
- package/dist/src/constants/turnCompletionVerbs.js +12 -0
- package/dist/src/constants/xml.js +73 -0
- package/dist/src/context/QueuedMessageContext.js +51 -0
- package/dist/src/context/fpsMetrics.js +22 -0
- package/dist/src/context/mailbox.js +35 -0
- package/dist/src/context/modalContext.js +34 -0
- package/dist/src/context/notifications.js +199 -0
- package/dist/src/context/overlayContext.js +149 -0
- package/dist/src/context/promptOverlayContext.js +118 -0
- package/dist/src/context/stats.js +207 -0
- package/dist/src/context/voice.js +74 -0
- package/dist/src/context.js +146 -0
- package/dist/src/coordinator/coordinatorMode.js +349 -0
- package/dist/src/cost-tracker.js +208 -0
- package/dist/src/costHook.js +17 -0
- package/dist/src/daemon/main.js +16 -0
- package/dist/src/daemon/workerRegistry.js +16 -0
- package/dist/src/dialogLaunchers.js +68 -0
- package/dist/src/entrypoints/agentSdkTypes.js +202 -0
- package/dist/src/entrypoints/cli.js +252 -0
- package/dist/src/entrypoints/init.js +265 -0
- package/dist/src/entrypoints/mcp.js +142 -0
- package/dist/src/entrypoints/sandboxTypes.js +112 -0
- package/dist/src/entrypoints/sdk/controlSchemas.js +452 -0
- package/dist/src/entrypoints/sdk/controlTypes.js +1 -0
- package/dist/src/entrypoints/sdk/coreSchemas.js +1331 -0
- package/dist/src/entrypoints/sdk/coreTypes.generated.js +1 -0
- package/dist/src/entrypoints/sdk/coreTypes.js +49 -0
- package/dist/src/entrypoints/sdk/runtimeTypes.js +1 -0
- package/dist/src/entrypoints/sdk/toolTypes.js +1 -0
- package/dist/src/environment-runner/main.js +16 -0
- package/dist/src/history.js +386 -0
- package/dist/src/hooks/fileSuggestions.js +635 -0
- package/dist/src/hooks/notifs/useAutoModeUnavailableNotification.js +47 -0
- package/dist/src/hooks/notifs/useCanSwitchToExistingSubscription.js +57 -0
- package/dist/src/hooks/notifs/useDeprecationWarningNotification.js +43 -0
- package/dist/src/hooks/notifs/useFastModeNotification.js +164 -0
- package/dist/src/hooks/notifs/useIDEStatusIndicator.js +174 -0
- package/dist/src/hooks/notifs/useInstallMessages.js +27 -0
- package/dist/src/hooks/notifs/useLspInitializationNotification.js +144 -0
- package/dist/src/hooks/notifs/useMcpConnectivityStatus.js +80 -0
- package/dist/src/hooks/notifs/useModelMigrationNotifications.js +53 -0
- package/dist/src/hooks/notifs/useNpmDeprecationNotification.js +24 -0
- package/dist/src/hooks/notifs/usePluginAutoupdateNotification.js +82 -0
- package/dist/src/hooks/notifs/usePluginInstallationStatus.js +127 -0
- package/dist/src/hooks/notifs/useRateLimitWarningNotification.js +118 -0
- package/dist/src/hooks/notifs/useSettingsErrors.js +64 -0
- package/dist/src/hooks/notifs/useStartupNotification.js +33 -0
- package/dist/src/hooks/notifs/useTeammateShutdownNotification.js +64 -0
- package/dist/src/hooks/renderPlaceholder.js +26 -0
- package/dist/src/hooks/toolPermission/PermissionContext.js +211 -0
- package/dist/src/hooks/toolPermission/handlers/coordinatorHandler.js +44 -0
- package/dist/src/hooks/toolPermission/handlers/interactiveHandler.js +397 -0
- package/dist/src/hooks/toolPermission/handlers/swarmWorkerHandler.js +108 -0
- package/dist/src/hooks/toolPermission/permissionLogging.js +145 -0
- package/dist/src/hooks/unifiedSuggestions.js +130 -0
- package/dist/src/hooks/useAfterFirstRender.js +12 -0
- package/dist/src/hooks/useApiKeyVerification.js +63 -0
- package/dist/src/hooks/useArrowKeyHistory.js +203 -0
- package/dist/src/hooks/useAssistantHistory.js +194 -0
- package/dist/src/hooks/useAwaySummary.js +105 -0
- package/dist/src/hooks/useBackgroundTaskNavigation.js +204 -0
- package/dist/src/hooks/useBlink.js +28 -0
- package/dist/src/hooks/useCanUseTool.js +192 -0
- package/dist/src/hooks/useCancelRequest.js +195 -0
- package/dist/src/hooks/useChromeExtensionNotification.js +49 -0
- package/dist/src/hooks/useClaudeCodeHintRecommendation.js +117 -0
- package/dist/src/hooks/useClipboardImageHint.js +59 -0
- package/dist/src/hooks/useCommandKeybindings.js +87 -0
- package/dist/src/hooks/useCommandQueue.js +10 -0
- package/dist/src/hooks/useCopyOnSelect.js +88 -0
- package/dist/src/hooks/useDeferredHookMessages.js +43 -0
- package/dist/src/hooks/useDiffData.js +69 -0
- package/dist/src/hooks/useDiffInIDE.js +252 -0
- package/dist/src/hooks/useDirectConnect.js +150 -0
- package/dist/src/hooks/useDoublePress.js +44 -0
- package/dist/src/hooks/useDynamicConfig.js +17 -0
- package/dist/src/hooks/useElapsedTime.js +25 -0
- package/dist/src/hooks/useExitOnCtrlCD.js +57 -0
- package/dist/src/hooks/useExitOnCtrlCDWithKeybindings.js +17 -0
- package/dist/src/hooks/useFileHistorySnapshotInit.js +14 -0
- package/dist/src/hooks/useGlobalKeybindings.js +215 -0
- package/dist/src/hooks/useHistorySearch.js +241 -0
- package/dist/src/hooks/useIDEIntegration.js +56 -0
- package/dist/src/hooks/useIdeAtMentioned.js +51 -0
- package/dist/src/hooks/useIdeConnectionStatus.js +21 -0
- package/dist/src/hooks/useIdeLogging.js +29 -0
- package/dist/src/hooks/useIdeSelection.js +106 -0
- package/dist/src/hooks/useInboxPoller.js +709 -0
- package/dist/src/hooks/useInputBuffer.js +73 -0
- package/dist/src/hooks/useIssueFlagBanner.js +115 -0
- package/dist/src/hooks/useLogMessages.js +98 -0
- package/dist/src/hooks/useLspPluginRecommendation.js +176 -0
- package/dist/src/hooks/useMailboxBridge.js +15 -0
- package/dist/src/hooks/useMainLoopModel.js +25 -0
- package/dist/src/hooks/useManagePlugins.js +261 -0
- package/dist/src/hooks/useMemoryUsage.js +28 -0
- package/dist/src/hooks/useMergedClients.js +11 -0
- package/dist/src/hooks/useMergedCommands.js +10 -0
- package/dist/src/hooks/useMergedTools.js +32 -0
- package/dist/src/hooks/useMinDisplayTime.js +26 -0
- package/dist/src/hooks/useNotifyAfterTimeout.js +51 -0
- package/dist/src/hooks/useOfficialMarketplaceNotification.js +46 -0
- package/dist/src/hooks/usePasteHandler.js +188 -0
- package/dist/src/hooks/usePluginRecommendationBase.js +101 -0
- package/dist/src/hooks/usePrStatus.js +91 -0
- package/dist/src/hooks/usePromptSuggestion.js +128 -0
- package/dist/src/hooks/usePromptsFromClaudeInChrome.js +66 -0
- package/dist/src/hooks/useQueueProcessor.js +46 -0
- package/dist/src/hooks/useRemoteSession.js +431 -0
- package/dist/src/hooks/useReplBridge.js +717 -0
- package/dist/src/hooks/useSSHSession.js +167 -0
- package/dist/src/hooks/useScheduledTasks.js +104 -0
- package/dist/src/hooks/useSearchInput.js +302 -0
- package/dist/src/hooks/useSessionBackgrounding.js +132 -0
- package/dist/src/hooks/useSettings.js +10 -0
- package/dist/src/hooks/useSettingsChange.js +13 -0
- package/dist/src/hooks/useSkillImprovementSurvey.js +69 -0
- package/dist/src/hooks/useSkillsChange.js +51 -0
- package/dist/src/hooks/useSwarmInitialization.js +67 -0
- package/dist/src/hooks/useSwarmPermissionPoller.js +215 -0
- package/dist/src/hooks/useTaskListWatcher.js +157 -0
- package/dist/src/hooks/useTasksV2.js +220 -0
- package/dist/src/hooks/useTeammateViewAutoExit.js +55 -0
- package/dist/src/hooks/useTelegramMirror.js +47 -0
- package/dist/src/hooks/useTeleportResume.js +81 -0
- package/dist/src/hooks/useTerminalSize.js +9 -0
- package/dist/src/hooks/useTextInput.js +397 -0
- package/dist/src/hooks/useTimeout.js +10 -0
- package/dist/src/hooks/useTurnDiffs.js +160 -0
- package/dist/src/hooks/useTypeahead.js +1617 -0
- package/dist/src/hooks/useUpdateNotification.js +22 -0
- package/dist/src/hooks/useVimInput.js +232 -0
- package/dist/src/hooks/useVirtualScroll.js +627 -0
- package/dist/src/hooks/useVoice.js +954 -0
- package/dist/src/hooks/useVoiceEnabled.js +21 -0
- package/dist/src/hooks/useVoiceIntegration.js +631 -0
- package/dist/src/hooks/useWhatsAppMirror.js +46 -0
- package/dist/src/index.js +18 -0
- package/dist/src/ink/Ansi.js +269 -0
- package/dist/src/ink/bidi.js +117 -0
- package/dist/src/ink/clearTerminal.js +58 -0
- package/dist/src/ink/colorize.js +198 -0
- package/dist/src/ink/components/AlternateScreen.js +74 -0
- package/dist/src/ink/components/App.js +558 -0
- package/dist/src/ink/components/AppContext.js +11 -0
- package/dist/src/ink/components/Box.js +153 -0
- package/dist/src/ink/components/Button.js +166 -0
- package/dist/src/ink/components/ClockContext.js +108 -0
- package/dist/src/ink/components/CursorDeclarationContext.js +3 -0
- package/dist/src/ink/components/ErrorOverview.js +49 -0
- package/dist/src/ink/components/Link.js +33 -0
- package/dist/src/ink/components/Newline.js +29 -0
- package/dist/src/ink/components/NoSelect.js +56 -0
- package/dist/src/ink/components/RawAnsi.js +45 -0
- package/dist/src/ink/components/ScrollBox.js +170 -0
- package/dist/src/ink/components/Spacer.js +19 -0
- package/dist/src/ink/components/StdinContext.js +16 -0
- package/dist/src/ink/components/TerminalFocusContext.js +45 -0
- package/dist/src/ink/components/TerminalSizeContext.js +3 -0
- package/dist/src/ink/components/Text.js +194 -0
- package/dist/src/ink/constants.js +2 -0
- package/dist/src/ink/devtools.js +16 -0
- package/dist/src/ink/dom.js +298 -0
- package/dist/src/ink/events/click-event.js +36 -0
- package/dist/src/ink/events/dispatcher.js +172 -0
- package/dist/src/ink/events/emitter.js +31 -0
- package/dist/src/ink/events/event-handlers.js +30 -0
- package/dist/src/ink/events/event.js +9 -0
- package/dist/src/ink/events/focus-event.js +16 -0
- package/dist/src/ink/events/input-event.js +161 -0
- package/dist/src/ink/events/keyboard-event.js +45 -0
- package/dist/src/ink/events/terminal-event.js +78 -0
- package/dist/src/ink/events/terminal-focus-event.js +15 -0
- package/dist/src/ink/focus.js +158 -0
- package/dist/src/ink/frame.js +30 -0
- package/dist/src/ink/get-max-width.js +23 -0
- package/dist/src/ink/hit-test.js +113 -0
- package/dist/src/ink/hooks/use-animation-frame.js +48 -0
- package/dist/src/ink/hooks/use-app.js +7 -0
- package/dist/src/ink/hooks/use-declared-cursor.js +60 -0
- package/dist/src/ink/hooks/use-input.js +70 -0
- package/dist/src/ink/hooks/use-interval.js +54 -0
- package/dist/src/ink/hooks/use-search-highlight.js +32 -0
- package/dist/src/ink/hooks/use-selection.js +60 -0
- package/dist/src/ink/hooks/use-stdin.js +7 -0
- package/dist/src/ink/hooks/use-tab-status.js +57 -0
- package/dist/src/ink/hooks/use-terminal-focus.js +15 -0
- package/dist/src/ink/hooks/use-terminal-title.js +29 -0
- package/dist/src/ink/hooks/use-terminal-viewport.js +77 -0
- package/dist/src/ink/ink.js +1644 -0
- package/dist/src/ink/instances.js +7 -0
- package/dist/src/ink/layout/engine.js +4 -0
- package/dist/src/ink/layout/geometry.js +61 -0
- package/dist/src/ink/layout/node.js +62 -0
- package/dist/src/ink/layout/yoga.js +237 -0
- package/dist/src/ink/line-width-cache.js +19 -0
- package/dist/src/ink/log-update.js +583 -0
- package/dist/src/ink/measure-element.js +8 -0
- package/dist/src/ink/measure-text.js +35 -0
- package/dist/src/ink/node-cache.js +30 -0
- package/dist/src/ink/optimizer.js +81 -0
- package/dist/src/ink/output.js +556 -0
- package/dist/src/ink/parse-keypress.js +695 -0
- package/dist/src/ink/reconciler.js +384 -0
- package/dist/src/ink/render-border.js +134 -0
- package/dist/src/ink/render-node-to-output.js +1216 -0
- package/dist/src/ink/render-to-screen.js +171 -0
- package/dist/src/ink/renderer.js +129 -0
- package/dist/src/ink/root.js +80 -0
- package/dist/src/ink/screen.js +1132 -0
- package/dist/src/ink/searchHighlight.js +78 -0
- package/dist/src/ink/selection.js +792 -0
- package/dist/src/ink/squash-text-nodes.js +56 -0
- package/dist/src/ink/stringWidth.js +200 -0
- package/dist/src/ink/styles.js +299 -0
- package/dist/src/ink/supports-hyperlinks.js +40 -0
- package/dist/src/ink/tabstops.js +39 -0
- package/dist/src/ink/terminal-focus-state.js +35 -0
- package/dist/src/ink/terminal-querier.js +173 -0
- package/dist/src/ink/terminal.js +208 -0
- package/dist/src/ink/termio/ansi.js +70 -0
- package/dist/src/ink/termio/csi.js +260 -0
- package/dist/src/ink/termio/dec.js +53 -0
- package/dist/src/ink/termio/esc.js +55 -0
- package/dist/src/ink/termio/osc.js +432 -0
- package/dist/src/ink/termio/parser.js +356 -0
- package/dist/src/ink/termio/sgr.js +292 -0
- package/dist/src/ink/termio/tokenize.js +264 -0
- package/dist/src/ink/termio/types.js +55 -0
- package/dist/src/ink/termio.js +24 -0
- package/dist/src/ink/useTerminalNotification.js +57 -0
- package/dist/src/ink/warn.js +10 -0
- package/dist/src/ink/widest-line.js +14 -0
- package/dist/src/ink/wrap-text.js +54 -0
- package/dist/src/ink/wrapAnsi.js +6 -0
- package/dist/src/ink.js +50 -0
- package/dist/src/interactiveHelpers.js +317 -0
- package/dist/src/keybindings/KeybindingContext.js +184 -0
- package/dist/src/keybindings/KeybindingProviderSetup.js +259 -0
- package/dist/src/keybindings/defaultBindings.js +333 -0
- package/dist/src/keybindings/loadUserBindings.js +393 -0
- package/dist/src/keybindings/match.js +111 -0
- package/dist/src/keybindings/parser.js +184 -0
- package/dist/src/keybindings/reservedShortcuts.js +109 -0
- package/dist/src/keybindings/resolver.js +182 -0
- package/dist/src/keybindings/schema.js +205 -0
- package/dist/src/keybindings/shortcutFormat.js +48 -0
- package/dist/src/keybindings/template.js +40 -0
- package/dist/src/keybindings/useKeybinding.js +161 -0
- package/dist/src/keybindings/useShortcutDisplay.js +43 -0
- package/dist/src/keybindings/validate.js +395 -0
- package/dist/src/main.js +4080 -0
- package/dist/src/memdir/findRelevantMemories.js +101 -0
- package/dist/src/memdir/memdir.js +408 -0
- package/dist/src/memdir/memoryAge.js +52 -0
- package/dist/src/memdir/memoryScan.js +65 -0
- package/dist/src/memdir/memoryTypes.js +260 -0
- package/dist/src/memdir/paths.js +236 -0
- package/dist/src/memdir/teamMemPaths.js +261 -0
- package/dist/src/memdir/teamMemPrompts.js +82 -0
- package/dist/src/migrations/migrateAutoUpdatesToSettings.js +47 -0
- package/dist/src/migrations/migrateBypassPermissionsAcceptedToSettings.js +32 -0
- package/dist/src/migrations/migrateEnableAllProjectMcpServersToSettings.js +83 -0
- package/dist/src/migrations/migrateFennecToOpus.js +39 -0
- package/dist/src/migrations/migrateLegacyOpusToCurrent.js +44 -0
- package/dist/src/migrations/migrateOpusToOpus1m.js +31 -0
- package/dist/src/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.js +23 -0
- package/dist/src/migrations/migrateSonnet1mToSonnet45.js +38 -0
- package/dist/src/migrations/migrateSonnet45ToSonnet46.js +48 -0
- package/dist/src/migrations/resetAutoModeOptInForDefaultOffer.js +47 -0
- package/dist/src/migrations/resetProToOpusDefault.js +46 -0
- package/dist/src/mirrors/shared.js +186 -0
- package/dist/src/moreright/useMoreRight.js +13 -0
- package/dist/src/native-ts/color-diff/index.js +821 -0
- package/dist/src/native-ts/file-index/index.js +328 -0
- package/dist/src/native-ts/yoga-layout/enums.js +101 -0
- package/dist/src/native-ts/yoga-layout/index.js +2113 -0
- package/dist/src/outputStyles/loadOutputStylesDir.js +73 -0
- package/dist/src/plugins/builtinPlugins.js +132 -0
- package/dist/src/plugins/bundled/index.js +22 -0
- package/dist/src/projectOnboardingState.js +61 -0
- package/dist/src/query/config.js +17 -0
- package/dist/src/query/deps.js +12 -0
- package/dist/src/query/stopHooks.js +334 -0
- package/dist/src/query/tokenBudget.js +49 -0
- package/dist/src/query.js +1330 -0
- package/dist/src/recovery/bunBundleShim.js +11 -0
- package/dist/src/remote/RemoteSessionManager.js +195 -0
- package/dist/src/remote/SessionsWebSocket.js +305 -0
- package/dist/src/remote/remotePermissionBridge.js +70 -0
- package/dist/src/remote/sdkMessageAdapter.js +227 -0
- package/dist/src/replLauncher.js +6 -0
- package/dist/src/schemas/hooks.js +174 -0
- package/dist/src/screens/Doctor.js +581 -0
- package/dist/src/screens/REPL.js +4434 -0
- package/dist/src/screens/ResumeConversation.js +341 -0
- package/dist/src/self-hosted-runner/main.js +16 -0
- package/dist/src/server/backends/dangerousBackend.js +16 -0
- package/dist/src/server/connectHeadless.js +16 -0
- package/dist/src/server/createDirectConnectSession.js +62 -0
- package/dist/src/server/directConnectManager.js +153 -0
- package/dist/src/server/lockfile.js +16 -0
- package/dist/src/server/parseConnectUrl.js +16 -0
- package/dist/src/server/server.js +16 -0
- package/dist/src/server/serverBanner.js +16 -0
- package/dist/src/server/serverLog.js +16 -0
- package/dist/src/server/sessionManager.js +16 -0
- package/dist/src/server/types.js +7 -0
- package/dist/src/services/AgentSummary/agentSummary.js +147 -0
- package/dist/src/services/MagicDocs/magicDocs.js +193 -0
- package/dist/src/services/MagicDocs/prompts.js +110 -0
- package/dist/src/services/PromptSuggestion/promptSuggestion.js +402 -0
- package/dist/src/services/PromptSuggestion/speculation.js +643 -0
- package/dist/src/services/SessionMemory/prompts.js +254 -0
- package/dist/src/services/SessionMemory/sessionMemory.js +358 -0
- package/dist/src/services/SessionMemory/sessionMemoryUtils.js +157 -0
- package/dist/src/services/analytics/config.js +33 -0
- package/dist/src/services/analytics/datadog.js +259 -0
- package/dist/src/services/analytics/firstPartyEventLogger.js +342 -0
- package/dist/src/services/analytics/firstPartyEventLoggingExporter.js +594 -0
- package/dist/src/services/analytics/growthbook.js +952 -0
- package/dist/src/services/analytics/index.js +114 -0
- package/dist/src/services/analytics/metadata.js +698 -0
- package/dist/src/services/analytics/sink.js +95 -0
- package/dist/src/services/analytics/sinkKillswitch.js +19 -0
- package/dist/src/services/api/adminRequests.js +57 -0
- package/dist/src/services/api/bootstrap.js +149 -0
- package/dist/src/services/api/claude.js +2461 -0
- package/dist/src/services/api/client.js +325 -0
- package/dist/src/services/api/dumpPrompts.js +174 -0
- package/dist/src/services/api/emptyUsage.js +20 -0
- package/dist/src/services/api/errorUtils.js +203 -0
- package/dist/src/services/api/errors.js +934 -0
- package/dist/src/services/api/filesApi.js +523 -0
- package/dist/src/services/api/firstTokenDate.js +49 -0
- package/dist/src/services/api/grove.js +272 -0
- package/dist/src/services/api/index.js +23 -0
- package/dist/src/services/api/logging.js +484 -0
- package/dist/src/services/api/metricsOptOut.js +129 -0
- package/dist/src/services/api/openai.js +1187 -0
- package/dist/src/services/api/openrouter.js +30 -0
- package/dist/src/services/api/overageCreditGrant.js +123 -0
- package/dist/src/services/api/promptCacheBreakDetection.js +510 -0
- package/dist/src/services/api/referral.js +219 -0
- package/dist/src/services/api/sessionIngress.js +358 -0
- package/dist/src/services/api/ultrareviewQuota.js +29 -0
- package/dist/src/services/api/usage.js +31 -0
- package/dist/src/services/api/withRetry.js +599 -0
- package/dist/src/services/autoDream/autoDream.js +244 -0
- package/dist/src/services/autoDream/config.js +17 -0
- package/dist/src/services/autoDream/consolidationLock.js +122 -0
- package/dist/src/services/autoDream/consolidationPrompt.js +56 -0
- package/dist/src/services/awaySummary.js +61 -0
- package/dist/src/services/claudeAiLimits.js +331 -0
- package/dist/src/services/claudeAiLimitsHook.js +15 -0
- package/dist/src/services/compact/apiMicrocompact.js +97 -0
- package/dist/src/services/compact/autoCompact.js +236 -0
- package/dist/src/services/compact/cachedMicrocompact.js +16 -0
- package/dist/src/services/compact/compact.js +1258 -0
- package/dist/src/services/compact/compactWarningHook.js +12 -0
- package/dist/src/services/compact/compactWarningState.js +15 -0
- package/dist/src/services/compact/grouping.js +58 -0
- package/dist/src/services/compact/microCompact.js +414 -0
- package/dist/src/services/compact/postCompactCleanup.js +72 -0
- package/dist/src/services/compact/prompt.js +327 -0
- package/dist/src/services/compact/sessionMemoryCompact.js +467 -0
- package/dist/src/services/compact/timeBasedMCConfig.js +11 -0
- package/dist/src/services/diagnosticTracking.js +282 -0
- package/dist/src/services/extractMemories/extractMemories.js +444 -0
- package/dist/src/services/extractMemories/prompts.js +129 -0
- package/dist/src/services/internalLogging.js +68 -0
- package/dist/src/services/limits/adapters/claude.js +219 -0
- package/dist/src/services/limits/adapters/minimax.js +177 -0
- package/dist/src/services/limits/adapters/ollama.js +189 -0
- package/dist/src/services/limits/adapters/openai.js +167 -0
- package/dist/src/services/limits/adapters/openrouter.js +166 -0
- package/dist/src/services/limits/adapters/zai.js +154 -0
- package/dist/src/services/limits/index.js +2 -0
- package/dist/src/services/limits/registry.js +179 -0
- package/dist/src/services/limits/sessionCounter.js +168 -0
- package/dist/src/services/limits/types.js +1 -0
- package/dist/src/services/lsp/LSPClient.js +306 -0
- package/dist/src/services/lsp/LSPDiagnosticRegistry.js +277 -0
- package/dist/src/services/lsp/LSPServerInstance.js +390 -0
- package/dist/src/services/lsp/LSPServerManager.js +305 -0
- package/dist/src/services/lsp/config.js +57 -0
- package/dist/src/services/lsp/manager.js +246 -0
- package/dist/src/services/lsp/passiveFeedback.js +226 -0
- package/dist/src/services/mcp/InProcessTransport.js +54 -0
- package/dist/src/services/mcp/MCPConnectionManager.js +50 -0
- package/dist/src/services/mcp/SdkControlTransport.js +115 -0
- package/dist/src/services/mcp/auth.js +1882 -0
- package/dist/src/services/mcp/channelAllowlist.js +57 -0
- package/dist/src/services/mcp/channelNotification.js +236 -0
- package/dist/src/services/mcp/channelPermissions.js +192 -0
- package/dist/src/services/mcp/claudeai.js +123 -0
- package/dist/src/services/mcp/client.js +2480 -0
- package/dist/src/services/mcp/config.js +1277 -0
- package/dist/src/services/mcp/elicitationHandler.js +192 -0
- package/dist/src/services/mcp/envExpansion.js +30 -0
- package/dist/src/services/mcp/headersHelper.js +94 -0
- package/dist/src/services/mcp/mcpStringUtils.js +85 -0
- package/dist/src/services/mcp/normalization.js +21 -0
- package/dist/src/services/mcp/oauthPort.js +69 -0
- package/dist/src/services/mcp/officialRegistry.js +58 -0
- package/dist/src/services/mcp/types.js +94 -0
- package/dist/src/services/mcp/useManageMCPConnections.js +820 -0
- package/dist/src/services/mcp/utils.js +433 -0
- package/dist/src/services/mcp/vscodeSdkMcp.js +69 -0
- package/dist/src/services/mcp/xaa.js +342 -0
- package/dist/src/services/mcp/xaaIdpLogin.js +377 -0
- package/dist/src/services/mcpServerApproval.js +29 -0
- package/dist/src/services/mockRateLimits.js +666 -0
- package/dist/src/services/notifier.js +114 -0
- package/dist/src/services/oauth/auth-code-listener.js +236 -0
- package/dist/src/services/oauth/client.js +545 -0
- package/dist/src/services/oauth/crypto.js +19 -0
- package/dist/src/services/oauth/getOauthProfile.js +48 -0
- package/dist/src/services/oauth/index.js +152 -0
- package/dist/src/services/oauth/types.js +1 -0
- package/dist/src/services/orchestration/execution/AgentTaskExecutor.js +315 -0
- package/dist/src/services/orchestration/execution/OrchestrationExecutionRuntime.js +1147 -0
- package/dist/src/services/orchestration/execution/index.js +2 -0
- package/dist/src/services/orchestration/execution/types.js +1 -0
- package/dist/src/services/orchestration/global/GlobalOrchestratorRuntime.js +140 -0
- package/dist/src/services/orchestration/global/index.js +3 -0
- package/dist/src/services/orchestration/global/reporting.js +541 -0
- package/dist/src/services/orchestration/global/types.js +1 -0
- package/dist/src/services/orchestration/index.js +4 -0
- package/dist/src/services/orchestration/policy/index.js +2 -0
- package/dist/src/services/orchestration/policy/scoring.js +291 -0
- package/dist/src/services/orchestration/policy/types.js +1 -0
- package/dist/src/services/orchestration/squad/SquadOrchestratorRuntime.js +198 -0
- package/dist/src/services/orchestration/squad/index.js +3 -0
- package/dist/src/services/orchestration/squad/reporting.js +525 -0
- package/dist/src/services/orchestration/squad/types.js +1 -0
- package/dist/src/services/plugins/PluginInstallationManager.js +139 -0
- package/dist/src/services/plugins/pluginCliCommands.js +230 -0
- package/dist/src/services/plugins/pluginOperations.js +826 -0
- package/dist/src/services/policyLimits/index.js +547 -0
- package/dist/src/services/policyLimits/types.js +9 -0
- package/dist/src/services/preventSleep.js +143 -0
- package/dist/src/services/rateLimitMessages.js +271 -0
- package/dist/src/services/rateLimitMocking.js +91 -0
- package/dist/src/services/remoteManagedSettings/index.js +534 -0
- package/dist/src/services/remoteManagedSettings/securityCheck.js +59 -0
- package/dist/src/services/remoteManagedSettings/syncCache.js +90 -0
- package/dist/src/services/remoteManagedSettings/syncCacheState.js +89 -0
- package/dist/src/services/remoteManagedSettings/types.js +12 -0
- package/dist/src/services/settingsSync/index.js +478 -0
- package/dist/src/services/settingsSync/types.js +35 -0
- package/dist/src/services/teamMemorySync/index.js +976 -0
- package/dist/src/services/teamMemorySync/secretScanner.js +275 -0
- package/dist/src/services/teamMemorySync/teamMemSecretGuard.js +35 -0
- package/dist/src/services/teamMemorySync/types.js +47 -0
- package/dist/src/services/teamMemorySync/watcher.js +326 -0
- package/dist/src/services/tips/tipHistory.js +17 -0
- package/dist/src/services/tips/tipRegistry.js +589 -0
- package/dist/src/services/tips/tipScheduler.js +40 -0
- package/dist/src/services/tokenEstimation.js +365 -0
- package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +87 -0
- package/dist/src/services/tools/StreamingToolExecutor.js +413 -0
- package/dist/src/services/tools/toolExecution.js +1218 -0
- package/dist/src/services/tools/toolHooks.js +454 -0
- package/dist/src/services/tools/toolOrchestration.js +110 -0
- package/dist/src/services/vcr.js +291 -0
- package/dist/src/services/voice.js +394 -0
- package/dist/src/services/voiceKeyterms.js +94 -0
- package/dist/src/services/voiceStreamSTT.js +406 -0
- package/dist/src/setup.js +349 -0
- package/dist/src/skills/bundled/batch.js +114 -0
- package/dist/src/skills/bundled/claudeApi.js +145 -0
- package/dist/src/skills/bundled/claudeApiContent.js +14 -0
- package/dist/src/skills/bundled/claudeInChrome.js +27 -0
- package/dist/src/skills/bundled/debug.js +99 -0
- package/dist/src/skills/bundled/index.js +5 -0
- package/dist/src/skills/bundled/keybindings.js +292 -0
- package/dist/src/skills/bundled/loop.js +81 -0
- package/dist/src/skills/bundled/loremIpsum.js +266 -0
- package/dist/src/skills/bundled/remember.js +75 -0
- package/dist/src/skills/bundled/scheduleRemoteAgents.js +373 -0
- package/dist/src/skills/bundled/simplify.js +66 -0
- package/dist/src/skills/bundled/skillify.js +184 -0
- package/dist/src/skills/bundled/stuck.js +75 -0
- package/dist/src/skills/bundled/updateConfig.js +463 -0
- package/dist/src/skills/bundled/verify.js +25 -0
- package/dist/src/skills/bundled/verifyContent.js +7 -0
- package/dist/src/skills/bundledSkills.js +159 -0
- package/dist/src/skills/loadSkillsDir.js +751 -0
- package/dist/src/skills/mcpSkillBuilders.js +10 -0
- package/dist/src/ssh/createSSHSession.js +16 -0
- package/dist/src/state/AppState.js +184 -0
- package/dist/src/state/AppStateStore.js +120 -0
- package/dist/src/state/onChangeAppState.js +132 -0
- package/dist/src/state/selectors.js +51 -0
- package/dist/src/state/store.js +21 -0
- package/dist/src/state/teammateViewHelpers.js +124 -0
- package/dist/src/tasks/DreamTask/DreamTask.js +99 -0
- package/dist/src/tasks/InProcessTeammateTask/InProcessTeammateTask.js +116 -0
- package/dist/src/tasks/InProcessTeammateTask/types.js +35 -0
- package/dist/src/tasks/LocalAgentTask/LocalAgentTask.js +507 -0
- package/dist/src/tasks/LocalMainSessionTask.js +338 -0
- package/dist/src/tasks/LocalShellTask/LocalShellTask.js +475 -0
- package/dist/src/tasks/LocalShellTask/guards.js +9 -0
- package/dist/src/tasks/LocalShellTask/killShellTasks.js +59 -0
- package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +742 -0
- package/dist/src/tasks/pillLabel.js +69 -0
- package/dist/src/tasks/stopTask.js +67 -0
- package/dist/src/tasks/types.js +18 -0
- package/dist/src/tasks.js +39 -0
- package/dist/src/telegram/bridge.js +329 -0
- package/dist/src/telegram/config.js +89 -0
- package/dist/src/telegram/mirror.js +91 -0
- package/dist/src/tools/AgentTool/AgentTool.js +1222 -0
- package/dist/src/tools/AgentTool/UI.js +592 -0
- package/dist/src/tools/AgentTool/agentColorManager.js +43 -0
- package/dist/src/tools/AgentTool/agentDisplay.js +72 -0
- package/dist/src/tools/AgentTool/agentMemory.js +139 -0
- package/dist/src/tools/AgentTool/agentMemorySnapshot.js +136 -0
- package/dist/src/tools/AgentTool/agentToolUtils.js +456 -0
- package/dist/src/tools/AgentTool/built-in/claudeCodeGuideAgent.js +175 -0
- package/dist/src/tools/AgentTool/built-in/exploreAgent.js +76 -0
- package/dist/src/tools/AgentTool/built-in/generalPurposeAgent.js +28 -0
- package/dist/src/tools/AgentTool/built-in/planAgent.js +87 -0
- package/dist/src/tools/AgentTool/built-in/statuslineSetup.js +140 -0
- package/dist/src/tools/AgentTool/built-in/verificationAgent.js +146 -0
- package/dist/src/tools/AgentTool/builtInAgents.js +59 -0
- package/dist/src/tools/AgentTool/constants.js +11 -0
- package/dist/src/tools/AgentTool/forkSubagent.js +177 -0
- package/dist/src/tools/AgentTool/loadAgentsDir.js +497 -0
- package/dist/src/tools/AgentTool/prompt.js +262 -0
- package/dist/src/tools/AgentTool/resumeAgent.js +182 -0
- package/dist/src/tools/AgentTool/runAgent.js +629 -0
- package/dist/src/tools/AskUserQuestionTool/AskUserQuestionTool.js +237 -0
- package/dist/src/tools/AskUserQuestionTool/prompt.js +38 -0
- package/dist/src/tools/BashTool/BashTool.js +1008 -0
- package/dist/src/tools/BashTool/BashToolResultMessage.js +168 -0
- package/dist/src/tools/BashTool/UI.js +133 -0
- package/dist/src/tools/BashTool/bashCommandHelpers.js +184 -0
- package/dist/src/tools/BashTool/bashPermissions.js +2023 -0
- package/dist/src/tools/BashTool/bashSecurity.js +2267 -0
- package/dist/src/tools/BashTool/commandSemantics.js +105 -0
- package/dist/src/tools/BashTool/commentLabel.js +14 -0
- package/dist/src/tools/BashTool/destructiveCommandWarning.js +88 -0
- package/dist/src/tools/BashTool/modeValidation.js +86 -0
- package/dist/src/tools/BashTool/pathValidation.js +1080 -0
- package/dist/src/tools/BashTool/prompt.js +334 -0
- package/dist/src/tools/BashTool/readOnlyValidation.js +1794 -0
- package/dist/src/tools/BashTool/sedEditParser.js +282 -0
- package/dist/src/tools/BashTool/sedValidation.js +580 -0
- package/dist/src/tools/BashTool/shouldUseSandbox.js +125 -0
- package/dist/src/tools/BashTool/toolName.js +2 -0
- package/dist/src/tools/BashTool/utils.js +180 -0
- package/dist/src/tools/BriefTool/BriefTool.js +172 -0
- package/dist/src/tools/BriefTool/UI.js +66 -0
- package/dist/src/tools/BriefTool/attachments.js +86 -0
- package/dist/src/tools/BriefTool/prompt.js +19 -0
- package/dist/src/tools/BriefTool/upload.js +136 -0
- package/dist/src/tools/ConfigTool/ConfigTool.js +398 -0
- package/dist/src/tools/ConfigTool/UI.js +24 -0
- package/dist/src/tools/ConfigTool/constants.js +1 -0
- package/dist/src/tools/ConfigTool/prompt.js +82 -0
- package/dist/src/tools/ConfigTool/supportedSettings.js +180 -0
- package/dist/src/tools/EnterPlanModeTool/EnterPlanModeTool.js +98 -0
- package/dist/src/tools/EnterPlanModeTool/UI.js +13 -0
- package/dist/src/tools/EnterPlanModeTool/constants.js +1 -0
- package/dist/src/tools/EnterPlanModeTool/prompt.js +164 -0
- package/dist/src/tools/EnterWorktreeTool/EnterWorktreeTool.js +104 -0
- package/dist/src/tools/EnterWorktreeTool/UI.js +8 -0
- package/dist/src/tools/EnterWorktreeTool/constants.js +1 -0
- package/dist/src/tools/EnterWorktreeTool/prompt.js +30 -0
- package/dist/src/tools/ExitPlanModeTool/ExitPlanModeV2Tool.js +385 -0
- package/dist/src/tools/ExitPlanModeTool/UI.js +31 -0
- package/dist/src/tools/ExitPlanModeTool/constants.js +2 -0
- package/dist/src/tools/ExitPlanModeTool/prompt.js +27 -0
- package/dist/src/tools/ExitWorktreeTool/ExitWorktreeTool.js +257 -0
- package/dist/src/tools/ExitWorktreeTool/UI.js +9 -0
- package/dist/src/tools/ExitWorktreeTool/constants.js +1 -0
- package/dist/src/tools/ExitWorktreeTool/prompt.js +32 -0
- package/dist/src/tools/FileEditTool/FileEditTool.js +480 -0
- package/dist/src/tools/FileEditTool/UI.js +201 -0
- package/dist/src/tools/FileEditTool/constants.js +7 -0
- package/dist/src/tools/FileEditTool/prompt.js +24 -0
- package/dist/src/tools/FileEditTool/types.js +50 -0
- package/dist/src/tools/FileEditTool/utils.js +579 -0
- package/dist/src/tools/FileReadTool/FileReadTool.js +889 -0
- package/dist/src/tools/FileReadTool/UI.js +125 -0
- package/dist/src/tools/FileReadTool/imageProcessor.js +46 -0
- package/dist/src/tools/FileReadTool/limits.js +70 -0
- package/dist/src/tools/FileReadTool/prompt.js +31 -0
- package/dist/src/tools/FileWriteTool/FileWriteTool.js +341 -0
- package/dist/src/tools/FileWriteTool/UI.js +338 -0
- package/dist/src/tools/FileWriteTool/prompt.js +15 -0
- package/dist/src/tools/GlobTool/GlobTool.js +161 -0
- package/dist/src/tools/GlobTool/UI.js +39 -0
- package/dist/src/tools/GlobTool/prompt.js +6 -0
- package/dist/src/tools/GrepTool/GrepTool.js +439 -0
- package/dist/src/tools/GrepTool/UI.js +154 -0
- package/dist/src/tools/GrepTool/prompt.js +16 -0
- package/dist/src/tools/LSPTool/LSPTool.js +660 -0
- package/dist/src/tools/LSPTool/UI.js +204 -0
- package/dist/src/tools/LSPTool/formatters.js +445 -0
- package/dist/src/tools/LSPTool/prompt.js +20 -0
- package/dist/src/tools/LSPTool/schemas.js +197 -0
- package/dist/src/tools/LSPTool/symbolContext.js +75 -0
- package/dist/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +100 -0
- package/dist/src/tools/ListMcpResourcesTool/UI.js +16 -0
- package/dist/src/tools/ListMcpResourcesTool/prompt.js +18 -0
- package/dist/src/tools/MCPTool/MCPTool.js +60 -0
- package/dist/src/tools/MCPTool/UI.js +342 -0
- package/dist/src/tools/MCPTool/classifyForCollapse.js +597 -0
- package/dist/src/tools/MCPTool/prompt.js +3 -0
- package/dist/src/tools/McpAuthTool/McpAuthTool.js +162 -0
- package/dist/src/tools/NotebookEditTool/NotebookEditTool.js +421 -0
- package/dist/src/tools/NotebookEditTool/UI.js +40 -0
- package/dist/src/tools/NotebookEditTool/constants.js +2 -0
- package/dist/src/tools/NotebookEditTool/prompt.js +2 -0
- package/dist/src/tools/PowerShellTool/PowerShellTool.js +899 -0
- package/dist/src/tools/PowerShellTool/UI.js +57 -0
- package/dist/src/tools/PowerShellTool/clmTypes.js +207 -0
- package/dist/src/tools/PowerShellTool/commandSemantics.js +115 -0
- package/dist/src/tools/PowerShellTool/commonParameters.js +27 -0
- package/dist/src/tools/PowerShellTool/destructiveCommandWarning.js +92 -0
- package/dist/src/tools/PowerShellTool/gitSafety.js +185 -0
- package/dist/src/tools/PowerShellTool/modeValidation.js +357 -0
- package/dist/src/tools/PowerShellTool/pathValidation.js +1712 -0
- package/dist/src/tools/PowerShellTool/powershellPermissions.js +1351 -0
- package/dist/src/tools/PowerShellTool/powershellSecurity.js +942 -0
- package/dist/src/tools/PowerShellTool/prompt.js +134 -0
- package/dist/src/tools/PowerShellTool/readOnlyValidation.js +1633 -0
- package/dist/src/tools/PowerShellTool/toolName.js +2 -0
- package/dist/src/tools/REPLTool/constants.js +43 -0
- package/dist/src/tools/REPLTool/primitiveTools.js +36 -0
- package/dist/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +112 -0
- package/dist/src/tools/ReadMcpResourceTool/UI.js +23 -0
- package/dist/src/tools/ReadMcpResourceTool/prompt.js +15 -0
- package/dist/src/tools/RemoteTriggerTool/RemoteTriggerTool.js +142 -0
- package/dist/src/tools/RemoteTriggerTool/UI.js +11 -0
- package/dist/src/tools/RemoteTriggerTool/prompt.js +12 -0
- package/dist/src/tools/ScheduleCronTool/CronCreateTool.js +120 -0
- package/dist/src/tools/ScheduleCronTool/CronDeleteTool.js +74 -0
- package/dist/src/tools/ScheduleCronTool/CronListTool.js +77 -0
- package/dist/src/tools/ScheduleCronTool/UI.js +28 -0
- package/dist/src/tools/ScheduleCronTool/prompt.js +115 -0
- package/dist/src/tools/SendMessageTool/SendMessageTool.js +675 -0
- package/dist/src/tools/SendMessageTool/UI.js +23 -0
- package/dist/src/tools/SendMessageTool/constants.js +1 -0
- package/dist/src/tools/SendMessageTool/prompt.js +47 -0
- package/dist/src/tools/SkillTool/SkillTool.js +827 -0
- package/dist/src/tools/SkillTool/UI.js +60 -0
- package/dist/src/tools/SkillTool/constants.js +1 -0
- package/dist/src/tools/SkillTool/prompt.js +184 -0
- package/dist/src/tools/SleepTool/prompt.js +14 -0
- package/dist/src/tools/SyntheticOutputTool/SyntheticOutputTool.js +138 -0
- package/dist/src/tools/TaskCreateTool/TaskCreateTool.js +104 -0
- package/dist/src/tools/TaskCreateTool/constants.js +1 -0
- package/dist/src/tools/TaskCreateTool/prompt.js +52 -0
- package/dist/src/tools/TaskGetTool/TaskGetTool.js +106 -0
- package/dist/src/tools/TaskGetTool/constants.js +1 -0
- package/dist/src/tools/TaskGetTool/prompt.js +23 -0
- package/dist/src/tools/TaskListTool/TaskListTool.js +89 -0
- package/dist/src/tools/TaskListTool/constants.js +1 -0
- package/dist/src/tools/TaskListTool/prompt.js +44 -0
- package/dist/src/tools/TaskOutputTool/TaskOutputTool.js +535 -0
- package/dist/src/tools/TaskOutputTool/constants.js +1 -0
- package/dist/src/tools/TaskStopTool/TaskStopTool.js +110 -0
- package/dist/src/tools/TaskStopTool/UI.js +30 -0
- package/dist/src/tools/TaskStopTool/prompt.js +7 -0
- package/dist/src/tools/TaskUpdateTool/TaskUpdateTool.js +301 -0
- package/dist/src/tools/TaskUpdateTool/constants.js +1 -0
- package/dist/src/tools/TaskUpdateTool/prompt.js +76 -0
- package/dist/src/tools/TeamCreateTool/TeamCreateTool.js +177 -0
- package/dist/src/tools/TeamCreateTool/UI.js +4 -0
- package/dist/src/tools/TeamCreateTool/constants.js +1 -0
- package/dist/src/tools/TeamCreateTool/prompt.js +113 -0
- package/dist/src/tools/TeamDeleteTool/TeamDeleteTool.js +102 -0
- package/dist/src/tools/TeamDeleteTool/UI.js +13 -0
- package/dist/src/tools/TeamDeleteTool/constants.js +1 -0
- package/dist/src/tools/TeamDeleteTool/prompt.js +16 -0
- package/dist/src/tools/TodoWriteTool/TodoWriteTool.js +99 -0
- package/dist/src/tools/TodoWriteTool/constants.js +1 -0
- package/dist/src/tools/TodoWriteTool/prompt.js +181 -0
- package/dist/src/tools/ToolSearchTool/ToolSearchTool.js +357 -0
- package/dist/src/tools/ToolSearchTool/constants.js +1 -0
- package/dist/src/tools/ToolSearchTool/prompt.js +99 -0
- package/dist/src/tools/TungstenTool/TungstenLiveMonitor.js +7 -0
- package/dist/src/tools/TungstenTool/TungstenTool.js +3 -0
- package/dist/src/tools/WebFetchTool/UI.js +30 -0
- package/dist/src/tools/WebFetchTool/WebFetchTool.js +246 -0
- package/dist/src/tools/WebFetchTool/preapproved.js +155 -0
- package/dist/src/tools/WebFetchTool/prompt.js +39 -0
- package/dist/src/tools/WebFetchTool/utils.js +381 -0
- package/dist/src/tools/WebSearchTool/UI.js +66 -0
- package/dist/src/tools/WebSearchTool/WebSearchTool.js +352 -0
- package/dist/src/tools/WebSearchTool/prompt.js +32 -0
- package/dist/src/tools/WorkflowTool/constants.js +2 -0
- package/dist/src/tools/shared/gitOperationTracking.js +220 -0
- package/dist/src/tools/shared/spawnMultiAgent.js +805 -0
- package/dist/src/tools/testing/TestingPermissionTool.js +72 -0
- package/dist/src/tools/utils.js +24 -0
- package/dist/src/tools.js +332 -0
- package/dist/src/types/command.js +10 -0
- package/dist/src/types/connectorText.js +2 -0
- package/dist/src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.js +673 -0
- package/dist/src/types/generated/events_mono/common/v1/auth.js +49 -0
- package/dist/src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.js +147 -0
- package/dist/src/types/generated/google/protobuf/timestamp.js +38 -0
- package/dist/src/types/hooks.js +153 -0
- package/dist/src/types/ids.js +27 -0
- package/dist/src/types/logs.js +11 -0
- package/dist/src/types/message.js +1 -0
- package/dist/src/types/permissions.js +25 -0
- package/dist/src/types/plugin.js +72 -0
- package/dist/src/types/textInputTypes.js +20 -0
- package/dist/src/types/utils.js +5 -0
- package/dist/src/upstreamproxy/relay.js +346 -0
- package/dist/src/upstreamproxy/upstreamproxy.js +236 -0
- package/dist/src/utils/CircularBuffer.js +75 -0
- package/dist/src/utils/Cursor.js +1229 -0
- package/dist/src/utils/QueryGuard.js +115 -0
- package/dist/src/utils/Shell.js +374 -0
- package/dist/src/utils/ShellCommand.js +338 -0
- package/dist/src/utils/abortController.js +74 -0
- package/dist/src/utils/activityManager.js +127 -0
- package/dist/src/utils/advisor.js +77 -0
- package/dist/src/utils/agentContext.js +91 -0
- package/dist/src/utils/agentId.js +83 -0
- package/dist/src/utils/agentSwarmsEnabled.js +37 -0
- package/dist/src/utils/agenticSessionSearch.js +255 -0
- package/dist/src/utils/analyzeContext.js +848 -0
- package/dist/src/utils/ansiToPng.js +259 -0
- package/dist/src/utils/ansiToSvg.js +207 -0
- package/dist/src/utils/api.js +555 -0
- package/dist/src/utils/apiPreconnect.js +62 -0
- package/dist/src/utils/appleTerminalBackup.js +95 -0
- package/dist/src/utils/argumentSubstitution.js +114 -0
- package/dist/src/utils/array.js +12 -0
- package/dist/src/utils/asciicast.js +200 -0
- package/dist/src/utils/attachments.js +2514 -0
- package/dist/src/utils/attribution.js +308 -0
- package/dist/src/utils/attributionHooks.js +16 -0
- package/dist/src/utils/attributionTrailer.js +16 -0
- package/dist/src/utils/auth.js +2022 -0
- package/dist/src/utils/authFileDescriptor.js +152 -0
- package/dist/src/utils/authPortable.js +14 -0
- package/dist/src/utils/autoModeDenials.js +15 -0
- package/dist/src/utils/autoRunIssue.js +112 -0
- package/dist/src/utils/autoUpdater.js +461 -0
- package/dist/src/utils/aws.js +44 -0
- package/dist/src/utils/awsAuthStatusManager.js +66 -0
- package/dist/src/utils/background/remote/preconditions.js +175 -0
- package/dist/src/utils/background/remote/remoteSession.js +53 -0
- package/dist/src/utils/backgroundHousekeeping.js +66 -0
- package/dist/src/utils/bash/ParsedCommand.js +241 -0
- package/dist/src/utils/bash/ShellSnapshot.js +489 -0
- package/dist/src/utils/bash/ast.js +2590 -0
- package/dist/src/utils/bash/bashParser.js +4355 -0
- package/dist/src/utils/bash/bashPipeCommand.js +249 -0
- package/dist/src/utils/bash/commands.js +1131 -0
- package/dist/src/utils/bash/heredoc.js +647 -0
- package/dist/src/utils/bash/parser.js +195 -0
- package/dist/src/utils/bash/prefix.js +154 -0
- package/dist/src/utils/bash/registry.js +23 -0
- package/dist/src/utils/bash/shellCompletion.js +196 -0
- package/dist/src/utils/bash/shellPrefix.js +25 -0
- package/dist/src/utils/bash/shellQuote.js +253 -0
- package/dist/src/utils/bash/shellQuoting.js +106 -0
- package/dist/src/utils/bash/specs/alias.js +11 -0
- package/dist/src/utils/bash/specs/index.js +16 -0
- package/dist/src/utils/bash/specs/nohup.js +10 -0
- package/dist/src/utils/bash/specs/pyright.js +88 -0
- package/dist/src/utils/bash/specs/sleep.js +10 -0
- package/dist/src/utils/bash/specs/srun.js +28 -0
- package/dist/src/utils/bash/specs/time.js +10 -0
- package/dist/src/utils/bash/specs/timeout.js +17 -0
- package/dist/src/utils/bash/treeSitterAnalysis.js +407 -0
- package/dist/src/utils/betas.js +332 -0
- package/dist/src/utils/billing.js +54 -0
- package/dist/src/utils/binaryCheck.js +40 -0
- package/dist/src/utils/browser.js +58 -0
- package/dist/src/utils/bufferedWriter.js +77 -0
- package/dist/src/utils/bundledMode.js +19 -0
- package/dist/src/utils/caCerts.js +93 -0
- package/dist/src/utils/caCertsConfig.js +77 -0
- package/dist/src/utils/cachePaths.js +28 -0
- package/dist/src/utils/ccshareResume.js +16 -0
- package/dist/src/utils/classifierApprovals.js +66 -0
- package/dist/src/utils/classifierApprovalsHook.js +10 -0
- package/dist/src/utils/claudeCodeHints.js +142 -0
- package/dist/src/utils/claudeDesktop.js +108 -0
- package/dist/src/utils/claudeInChrome/chromeNativeHost.js +416 -0
- package/dist/src/utils/claudeInChrome/common.js +466 -0
- package/dist/src/utils/claudeInChrome/mcpServer.js +237 -0
- package/dist/src/utils/claudeInChrome/prompt.js +79 -0
- package/dist/src/utils/claudeInChrome/setup.js +320 -0
- package/dist/src/utils/claudeInChrome/setupPortable.js +172 -0
- package/dist/src/utils/claudeInChrome/toolRendering.js +234 -0
- package/dist/src/utils/claudemd.js +1054 -0
- package/dist/src/utils/cleanup.js +514 -0
- package/dist/src/utils/cleanupRegistry.js +22 -0
- package/dist/src/utils/cliArgs.js +53 -0
- package/dist/src/utils/cliHighlight.js +45 -0
- package/dist/src/utils/codeIndexing.js +149 -0
- package/dist/src/utils/collapseBackgroundBashNotifications.js +70 -0
- package/dist/src/utils/collapseHookSummaries.js +48 -0
- package/dist/src/utils/collapseReadSearch.js +871 -0
- package/dist/src/utils/collapseTeammateShutdowns.js +44 -0
- package/dist/src/utils/combinedAbortSignal.js +40 -0
- package/dist/src/utils/commandLifecycle.js +7 -0
- package/dist/src/utils/commitAttribution.js +720 -0
- package/dist/src/utils/completionCache.js +138 -0
- package/dist/src/utils/computerUse/appNames.js +170 -0
- package/dist/src/utils/computerUse/cleanup.js +66 -0
- package/dist/src/utils/computerUse/common.js +56 -0
- package/dist/src/utils/computerUse/computerUseLock.js +183 -0
- package/dist/src/utils/computerUse/drainRunLoop.js +71 -0
- package/dist/src/utils/computerUse/escHotkey.js +53 -0
- package/dist/src/utils/computerUse/executor.js +480 -0
- package/dist/src/utils/computerUse/gates.js +55 -0
- package/dist/src/utils/computerUse/hostAdapter.js +62 -0
- package/dist/src/utils/computerUse/inputLoader.js +27 -0
- package/dist/src/utils/computerUse/mcpServer.js +84 -0
- package/dist/src/utils/computerUse/setup.js +42 -0
- package/dist/src/utils/computerUse/swiftLoader.js +20 -0
- package/dist/src/utils/computerUse/toolRendering.js +100 -0
- package/dist/src/utils/computerUse/wrapper.js +318 -0
- package/dist/src/utils/concurrentSessions.js +179 -0
- package/dist/src/utils/config.js +1084 -0
- package/dist/src/utils/configConstants.js +18 -0
- package/dist/src/utils/contentArray.js +45 -0
- package/dist/src/utils/context.js +185 -0
- package/dist/src/utils/contextAnalysis.js +171 -0
- package/dist/src/utils/contextSuggestions.js +158 -0
- package/dist/src/utils/controlMessageCompat.js +31 -0
- package/dist/src/utils/conversationRecovery.js +436 -0
- package/dist/src/utils/cron.js +260 -0
- package/dist/src/utils/cronJitterConfig.js +62 -0
- package/dist/src/utils/cronScheduler.js +388 -0
- package/dist/src/utils/cronTasks.js +332 -0
- package/dist/src/utils/cronTasksLock.js +164 -0
- package/dist/src/utils/crossProjectResume.js +46 -0
- package/dist/src/utils/crypto.js +13 -0
- package/dist/src/utils/cwd.js +29 -0
- package/dist/src/utils/databaseMcp/common.js +48 -0
- package/dist/src/utils/databaseMcp/mcpServer.js +2 -0
- package/dist/src/utils/databaseMcp/server/connection.js +243 -0
- package/dist/src/utils/databaseMcp/server/index.js +1442 -0
- package/dist/src/utils/databaseMcp/server/queries.js +683 -0
- package/dist/src/utils/databaseMcp/server/types.js +7 -0
- package/dist/src/utils/databaseMcp/setup.js +28 -0
- package/dist/src/utils/debug.js +220 -0
- package/dist/src/utils/debugFilter.js +125 -0
- package/dist/src/utils/deepLink/banner.js +103 -0
- package/dist/src/utils/deepLink/parseDeepLink.js +138 -0
- package/dist/src/utils/deepLink/protocolHandler.js +119 -0
- package/dist/src/utils/deepLink/registerProtocol.js +291 -0
- package/dist/src/utils/deepLink/terminalLauncher.js +455 -0
- package/dist/src/utils/deepLink/terminalPreference.js +51 -0
- package/dist/src/utils/desktopDeepLink.js +208 -0
- package/dist/src/utils/detectRepository.js +157 -0
- package/dist/src/utils/diagLogs.js +74 -0
- package/dist/src/utils/diff.js +108 -0
- package/dist/src/utils/directMemberMessage.js +34 -0
- package/dist/src/utils/displayTags.js +46 -0
- package/dist/src/utils/doctorContextWarnings.js +179 -0
- package/dist/src/utils/doctorDiagnostic.js +495 -0
- package/dist/src/utils/dxt/helpers.js +64 -0
- package/dist/src/utils/dxt/zip.js +167 -0
- package/dist/src/utils/earlyInput.js +166 -0
- package/dist/src/utils/editor.js +163 -0
- package/dist/src/utils/effort.js +278 -0
- package/dist/src/utils/embeddedTools.js +26 -0
- package/dist/src/utils/env.js +358 -0
- package/dist/src/utils/envDynamic.js +130 -0
- package/dist/src/utils/envUtils.js +192 -0
- package/dist/src/utils/envValidation.js +26 -0
- package/dist/src/utils/errorLogSink.js +197 -0
- package/dist/src/utils/errors.js +207 -0
- package/dist/src/utils/eventLoopStallDetector.js +16 -0
- package/dist/src/utils/exampleCommands.js +165 -0
- package/dist/src/utils/execFileNoThrow.js +93 -0
- package/dist/src/utils/execFileNoThrowPortable.js +111 -0
- package/dist/src/utils/execSyncWrapper.js +68 -0
- package/dist/src/utils/exportRenderer.js +71 -0
- package/dist/src/utils/extraUsage.js +19 -0
- package/dist/src/utils/fastMode.js +393 -0
- package/dist/src/utils/file.js +467 -0
- package/dist/src/utils/fileHistory.js +851 -0
- package/dist/src/utils/fileOperationAnalytics.js +45 -0
- package/dist/src/utils/filePersistence/filePersistence.js +212 -0
- package/dist/src/utils/filePersistence/outputsScanner.js +104 -0
- package/dist/src/utils/filePersistence/types.js +5 -0
- package/dist/src/utils/fileRead.js +81 -0
- package/dist/src/utils/fileReadCache.js +78 -0
- package/dist/src/utils/fileStateCache.js +99 -0
- package/dist/src/utils/findExecutable.js +13 -0
- package/dist/src/utils/fingerprint.js +59 -0
- package/dist/src/utils/forkedAgent.js +410 -0
- package/dist/src/utils/format.js +238 -0
- package/dist/src/utils/formatBriefTimestamp.js +72 -0
- package/dist/src/utils/fpsTracker.js +34 -0
- package/dist/src/utils/frontmatterParser.js +260 -0
- package/dist/src/utils/fsOperations.js +834 -0
- package/dist/src/utils/fullscreen.js +194 -0
- package/dist/src/utils/generatedFiles.js +122 -0
- package/dist/src/utils/generators.js +67 -0
- package/dist/src/utils/genericProcessUtils.js +155 -0
- package/dist/src/utils/getWorktreePaths.js +56 -0
- package/dist/src/utils/getWorktreePathsPortable.js +23 -0
- package/dist/src/utils/ghPrStatus.js +71 -0
- package/dist/src/utils/git/gitConfigParser.js +226 -0
- package/dist/src/utils/git/gitFilesystem.js +606 -0
- package/dist/src/utils/git/gitignore.js +84 -0
- package/dist/src/utils/git.js +725 -0
- package/dist/src/utils/gitDiff.js +395 -0
- package/dist/src/utils/gitSettings.js +18 -0
- package/dist/src/utils/github/ghAuthStatus.js +23 -0
- package/dist/src/utils/githubRepoPathMapping.js +135 -0
- package/dist/src/utils/glob.js +90 -0
- package/dist/src/utils/gracefulShutdown.js +447 -0
- package/dist/src/utils/groupToolUses.js +126 -0
- package/dist/src/utils/handlePromptSubmit.js +398 -0
- package/dist/src/utils/hash.js +46 -0
- package/dist/src/utils/headlessProfiler.js +147 -0
- package/dist/src/utils/heapDumpService.js +202 -0
- package/dist/src/utils/heatmap.js +151 -0
- package/dist/src/utils/highlightMatch.js +28 -0
- package/dist/src/utils/hooks/AsyncHookRegistry.js +187 -0
- package/dist/src/utils/hooks/apiQueryHookHelper.js +77 -0
- package/dist/src/utils/hooks/execAgentHook.js +257 -0
- package/dist/src/utils/hooks/execHttpHook.js +184 -0
- package/dist/src/utils/hooks/execPromptHook.js +171 -0
- package/dist/src/utils/hooks/fileChangedWatcher.js +161 -0
- package/dist/src/utils/hooks/hookEvents.js +111 -0
- package/dist/src/utils/hooks/hookHelpers.js +60 -0
- package/dist/src/utils/hooks/hooksConfigManager.js +323 -0
- package/dist/src/utils/hooks/hooksConfigSnapshot.js +114 -0
- package/dist/src/utils/hooks/hooksSettings.js +204 -0
- package/dist/src/utils/hooks/postSamplingHooks.js +39 -0
- package/dist/src/utils/hooks/registerFrontmatterHooks.js +47 -0
- package/dist/src/utils/hooks/registerSkillHooks.js +40 -0
- package/dist/src/utils/hooks/sessionHooks.js +252 -0
- package/dist/src/utils/hooks/skillImprovement.js +211 -0
- package/dist/src/utils/hooks/ssrfGuard.js +258 -0
- package/dist/src/utils/hooks.js +3668 -0
- package/dist/src/utils/horizontalScroll.js +108 -0
- package/dist/src/utils/http.js +121 -0
- package/dist/src/utils/hyperlink.js +28 -0
- package/dist/src/utils/iTermBackup.js +48 -0
- package/dist/src/utils/ide.js +1235 -0
- package/dist/src/utils/idePathConversion.js +66 -0
- package/dist/src/utils/idleTimeout.js +44 -0
- package/dist/src/utils/imagePaste.js +329 -0
- package/dist/src/utils/imageResizer.js +664 -0
- package/dist/src/utils/imageStore.js +150 -0
- package/dist/src/utils/imageValidation.js +92 -0
- package/dist/src/utils/immediateCommand.js +12 -0
- package/dist/src/utils/inProcessTeammateHelpers.js +71 -0
- package/dist/src/utils/ink.js +20 -0
- package/dist/src/utils/intl.js +83 -0
- package/dist/src/utils/jetbrains.js +152 -0
- package/dist/src/utils/json.js +295 -0
- package/dist/src/utils/jsonRead.js +14 -0
- package/dist/src/utils/keyboardShortcuts.js +11 -0
- package/dist/src/utils/lazySchema.js +8 -0
- package/dist/src/utils/listSessionsImpl.js +332 -0
- package/dist/src/utils/localInstaller.js +131 -0
- package/dist/src/utils/lockfile.js +22 -0
- package/dist/src/utils/log.js +280 -0
- package/dist/src/utils/logoV2Utils.js +290 -0
- package/dist/src/utils/mailbox.js +50 -0
- package/dist/src/utils/managedEnv.js +160 -0
- package/dist/src/utils/managedEnvConstants.js +200 -0
- package/dist/src/utils/markdown.js +300 -0
- package/dist/src/utils/markdownConfigLoader.js +494 -0
- package/dist/src/utils/mcp/dateTimeParser.js +102 -0
- package/dist/src/utils/mcp/elicitationValidation.js +259 -0
- package/dist/src/utils/mcpInstructionsDelta.js +97 -0
- package/dist/src/utils/mcpOutputStorage.js +159 -0
- package/dist/src/utils/mcpValidation.js +165 -0
- package/dist/src/utils/mcpWebSocketTransport.js +180 -0
- package/dist/src/utils/memoize.js +205 -0
- package/dist/src/utils/memory/types.js +9 -0
- package/dist/src/utils/memory/versions.js +7 -0
- package/dist/src/utils/memoryFileDetection.js +247 -0
- package/dist/src/utils/messagePredicates.js +6 -0
- package/dist/src/utils/messageQueueManager.js +430 -0
- package/dist/src/utils/messages/mappers.js +240 -0
- package/dist/src/utils/messages/systemInit.js +74 -0
- package/dist/src/utils/messages.js +4273 -0
- package/dist/src/utils/model/agent.js +128 -0
- package/dist/src/utils/model/aliases.js +21 -0
- package/dist/src/utils/model/antModels.js +25 -0
- package/dist/src/utils/model/bedrock.js +220 -0
- package/dist/src/utils/model/check1mAccess.js +64 -0
- package/dist/src/utils/model/configs.js +93 -0
- package/dist/src/utils/model/contextWindowUpgradeCheck.js +41 -0
- package/dist/src/utils/model/deprecation.js +72 -0
- package/dist/src/utils/model/model.js +641 -0
- package/dist/src/utils/model/modelAllowlist.js +148 -0
- package/dist/src/utils/model/modelCapabilities.js +107 -0
- package/dist/src/utils/model/modelOptions.js +645 -0
- package/dist/src/utils/model/modelStrings.js +144 -0
- package/dist/src/utils/model/modelSupportOverrides.js +40 -0
- package/dist/src/utils/model/openrouter.js +51 -0
- package/dist/src/utils/model/providerBaseUrls.js +77 -0
- package/dist/src/utils/model/providerCatalog.js +81 -0
- package/dist/src/utils/model/providerModels.js +334 -0
- package/dist/src/utils/model/providerProfiles.js +392 -0
- package/dist/src/utils/model/providerProfilesDb.js +886 -0
- package/dist/src/utils/model/providerSwitch.js +50 -0
- package/dist/src/utils/model/providerWorkspaces.js +36 -0
- package/dist/src/utils/model/providers.js +199 -0
- package/dist/src/utils/model/validateModel.js +257 -0
- package/dist/src/utils/modelCost.js +160 -0
- package/dist/src/utils/modifiers.js +35 -0
- package/dist/src/utils/mtls.js +134 -0
- package/dist/src/utils/nativeInstaller/download.js +370 -0
- package/dist/src/utils/nativeInstaller/index.js +8 -0
- package/dist/src/utils/nativeInstaller/installer.js +1396 -0
- package/dist/src/utils/nativeInstaller/packageManagers.js +258 -0
- package/dist/src/utils/nativeInstaller/pidLock.js +347 -0
- package/dist/src/utils/notebook.js +176 -0
- package/dist/src/utils/objectGroupBy.js +15 -0
- package/dist/src/utils/orchestration/store/index.js +6 -0
- package/dist/src/utils/orchestration/store/orchestrationDb.js +42 -0
- package/dist/src/utils/orchestration/store/providerAgentStore.js +244 -0
- package/dist/src/utils/orchestration/store/providerWorkspaceStore.js +125 -0
- package/dist/src/utils/orchestration/store/runStore.js +486 -0
- package/dist/src/utils/orchestration/store/teamStore.js +285 -0
- package/dist/src/utils/orchestration/store/types.js +1 -0
- package/dist/src/utils/pasteStore.js +93 -0
- package/dist/src/utils/path.js +140 -0
- package/dist/src/utils/pdf.js +236 -0
- package/dist/src/utils/pdfUtils.js +61 -0
- package/dist/src/utils/peerAddress.js +20 -0
- package/dist/src/utils/permissions/PermissionMode.js +95 -0
- package/dist/src/utils/permissions/PermissionPromptToolResultSchema.js +85 -0
- package/dist/src/utils/permissions/PermissionResult.js +11 -0
- package/dist/src/utils/permissions/PermissionRule.js +19 -0
- package/dist/src/utils/permissions/PermissionUpdate.js +330 -0
- package/dist/src/utils/permissions/PermissionUpdateSchema.js +61 -0
- package/dist/src/utils/permissions/autoModeState.js +34 -0
- package/dist/src/utils/permissions/bashClassifier.js +30 -0
- package/dist/src/utils/permissions/bypassPermissionsKillswitch.js +115 -0
- package/dist/src/utils/permissions/classifierDecision.js +88 -0
- package/dist/src/utils/permissions/classifierShared.js +28 -0
- package/dist/src/utils/permissions/dangerousPatterns.js +78 -0
- package/dist/src/utils/permissions/denialTracking.js +34 -0
- package/dist/src/utils/permissions/filesystem.js +1426 -0
- package/dist/src/utils/permissions/getNextPermissionMode.js +74 -0
- package/dist/src/utils/permissions/pathValidation.js +351 -0
- package/dist/src/utils/permissions/permissionExplainer.js +188 -0
- package/dist/src/utils/permissions/permissionRuleParser.js +177 -0
- package/dist/src/utils/permissions/permissionSetup.js +1164 -0
- package/dist/src/utils/permissions/permissions.js +1106 -0
- package/dist/src/utils/permissions/permissionsDb.js +322 -0
- package/dist/src/utils/permissions/permissionsLoader.js +217 -0
- package/dist/src/utils/permissions/shadowedRuleDetection.js +149 -0
- package/dist/src/utils/permissions/shellRuleMatching.js +174 -0
- package/dist/src/utils/permissions/yoloClassifier.js +1195 -0
- package/dist/src/utils/planModeV2.js +75 -0
- package/dist/src/utils/plans.js +334 -0
- package/dist/src/utils/platform.js +122 -0
- package/dist/src/utils/plugins/addDirPluginSettings.js +53 -0
- package/dist/src/utils/plugins/cacheUtils.js +174 -0
- package/dist/src/utils/plugins/dependencyResolver.js +244 -0
- package/dist/src/utils/plugins/fetchTelemetry.js +108 -0
- package/dist/src/utils/plugins/gitAvailability.js +65 -0
- package/dist/src/utils/plugins/headlessPluginInstall.js +136 -0
- package/dist/src/utils/plugins/hintRecommendation.js +136 -0
- package/dist/src/utils/plugins/installCounts.js +218 -0
- package/dist/src/utils/plugins/installedPluginsManager.js +1003 -0
- package/dist/src/utils/plugins/loadPluginAgents.js +219 -0
- package/dist/src/utils/plugins/loadPluginCommands.js +595 -0
- package/dist/src/utils/plugins/loadPluginHooks.js +239 -0
- package/dist/src/utils/plugins/loadPluginOutputStyles.js +112 -0
- package/dist/src/utils/plugins/lspPluginIntegration.js +293 -0
- package/dist/src/utils/plugins/lspRecommendation.js +278 -0
- package/dist/src/utils/plugins/managedPlugins.js +26 -0
- package/dist/src/utils/plugins/marketplaceHelpers.js +470 -0
- package/dist/src/utils/plugins/marketplaceManager.js +1939 -0
- package/dist/src/utils/plugins/mcpPluginIntegration.js +465 -0
- package/dist/src/utils/plugins/mcpbHandler.js +708 -0
- package/dist/src/utils/plugins/officialMarketplace.js +21 -0
- package/dist/src/utils/plugins/officialMarketplaceGcs.js +195 -0
- package/dist/src/utils/plugins/officialMarketplaceStartupCheck.js +338 -0
- package/dist/src/utils/plugins/orphanedPluginFilter.js +96 -0
- package/dist/src/utils/plugins/parseMarketplaceInput.js +143 -0
- package/dist/src/utils/plugins/performStartupChecks.js +66 -0
- package/dist/src/utils/plugins/pluginAutoupdate.js +210 -0
- package/dist/src/utils/plugins/pluginBlocklist.js +93 -0
- package/dist/src/utils/plugins/pluginDirectories.js +172 -0
- package/dist/src/utils/plugins/pluginFlagging.js +173 -0
- package/dist/src/utils/plugins/pluginIdentifier.js +78 -0
- package/dist/src/utils/plugins/pluginInstallationHelpers.js +400 -0
- package/dist/src/utils/plugins/pluginLoader.js +2426 -0
- package/dist/src/utils/plugins/pluginOptionsStorage.js +311 -0
- package/dist/src/utils/plugins/pluginPolicy.js +18 -0
- package/dist/src/utils/plugins/pluginStartupCheck.js +261 -0
- package/dist/src/utils/plugins/pluginVersioning.js +128 -0
- package/dist/src/utils/plugins/reconciler.js +181 -0
- package/dist/src/utils/plugins/refresh.js +162 -0
- package/dist/src/utils/plugins/schemas.js +1283 -0
- package/dist/src/utils/plugins/validatePlugin.js +765 -0
- package/dist/src/utils/plugins/walkPluginMarkdown.js +49 -0
- package/dist/src/utils/plugins/zipCache.js +346 -0
- package/dist/src/utils/plugins/zipCacheAdapters.js +133 -0
- package/dist/src/utils/postCommitAttribution.js +16 -0
- package/dist/src/utils/powershell/dangerousCmdlets.js +174 -0
- package/dist/src/utils/powershell/parser.js +1357 -0
- package/dist/src/utils/powershell/staticPrefix.js +277 -0
- package/dist/src/utils/preflightChecks.js +147 -0
- package/dist/src/utils/privacyLevel.js +49 -0
- package/dist/src/utils/process.js +56 -0
- package/dist/src/utils/processUserInput/processBashCommand.js +119 -0
- package/dist/src/utils/processUserInput/processSlashCommand.js +859 -0
- package/dist/src/utils/processUserInput/processTextPrompt.js +68 -0
- package/dist/src/utils/processUserInput/processUserInput.js +326 -0
- package/dist/src/utils/profilerBase.js +29 -0
- package/dist/src/utils/promptCategory.js +39 -0
- package/dist/src/utils/promptEditor.js +151 -0
- package/dist/src/utils/promptShellExecution.js +119 -0
- package/dist/src/utils/proxy.js +347 -0
- package/dist/src/utils/queryContext.js +110 -0
- package/dist/src/utils/queryHelpers.js +436 -0
- package/dist/src/utils/queryProfiler.js +242 -0
- package/dist/src/utils/queueProcessor.js +70 -0
- package/dist/src/utils/readEditContext.js +176 -0
- package/dist/src/utils/readFileInRange.js +278 -0
- package/dist/src/utils/releaseNotes.js +304 -0
- package/dist/src/utils/renderOptions.js +67 -0
- package/dist/src/utils/ripgrep.js +540 -0
- package/dist/src/utils/sandbox/sandbox-adapter.js +751 -0
- package/dist/src/utils/sandbox/sandbox-ui-utils.js +11 -0
- package/dist/src/utils/sanitization.js +72 -0
- package/dist/src/utils/screenshotClipboard.js +89 -0
- package/dist/src/utils/sdkEventQueue.js +49 -0
- package/dist/src/utils/sdkHeapDumpMonitor.js +16 -0
- package/dist/src/utils/secureStorage/fallbackStorage.js +59 -0
- package/dist/src/utils/secureStorage/index.js +14 -0
- package/dist/src/utils/secureStorage/keychainPrefetch.js +91 -0
- package/dist/src/utils/secureStorage/macOsKeychainHelpers.js +91 -0
- package/dist/src/utils/secureStorage/macOsKeychainStorage.js +192 -0
- package/dist/src/utils/secureStorage/plainTextStorage.js +81 -0
- package/dist/src/utils/secureStorage/secureStoreDefs.js +1 -0
- package/dist/src/utils/secureStorage/sqliteStorage.js +224 -0
- package/dist/src/utils/secureStorage/types.js +1 -0
- package/dist/src/utils/semanticBoolean.js +23 -0
- package/dist/src/utils/semanticNumber.js +34 -0
- package/dist/src/utils/semver.js +53 -0
- package/dist/src/utils/sequential.js +43 -0
- package/dist/src/utils/sessionActivity.js +120 -0
- package/dist/src/utils/sessionDataUploader.js +16 -0
- package/dist/src/utils/sessionEnvVars.js +18 -0
- package/dist/src/utils/sessionEnvironment.js +131 -0
- package/dist/src/utils/sessionFileAccessHooks.js +207 -0
- package/dist/src/utils/sessionIngressAuth.js +113 -0
- package/dist/src/utils/sessionRestore.js +359 -0
- package/dist/src/utils/sessionStart.js +165 -0
- package/dist/src/utils/sessionState.js +76 -0
- package/dist/src/utils/sessionStorage.js +4162 -0
- package/dist/src/utils/sessionStoragePortable.js +665 -0
- package/dist/src/utils/sessionTitle.js +120 -0
- package/dist/src/utils/sessionUrl.js +50 -0
- package/dist/src/utils/set.js +50 -0
- package/dist/src/utils/settings/allErrors.js +29 -0
- package/dist/src/utils/settings/applySettingsChange.js +65 -0
- package/dist/src/utils/settings/changeDetector.js +409 -0
- package/dist/src/utils/settings/constants.js +166 -0
- package/dist/src/utils/settings/internalWrites.js +33 -0
- package/dist/src/utils/settings/managedPath.js +29 -0
- package/dist/src/utils/settings/mdm/constants.js +62 -0
- package/dist/src/utils/settings/mdm/rawRead.js +97 -0
- package/dist/src/utils/settings/mdm/settings.js +254 -0
- package/dist/src/utils/settings/permissionValidation.js +224 -0
- package/dist/src/utils/settings/pluginOnlyPolicy.js +53 -0
- package/dist/src/utils/settings/schemaOutput.js +7 -0
- package/dist/src/utils/settings/settings.js +844 -0
- package/dist/src/utils/settings/settingsCache.js +47 -0
- package/dist/src/utils/settings/toolValidationConfig.js +76 -0
- package/dist/src/utils/settings/types.js +846 -0
- package/dist/src/utils/settings/validateEditTool.js +34 -0
- package/dist/src/utils/settings/validation.js +192 -0
- package/dist/src/utils/settings/validationTips.js +111 -0
- package/dist/src/utils/shell/bashProvider.js +202 -0
- package/dist/src/utils/shell/outputLimits.js +7 -0
- package/dist/src/utils/shell/powershellDetection.js +96 -0
- package/dist/src/utils/shell/powershellProvider.js +104 -0
- package/dist/src/utils/shell/prefix.js +246 -0
- package/dist/src/utils/shell/readOnlyCommandValidation.js +1776 -0
- package/dist/src/utils/shell/resolveDefaultShell.js +13 -0
- package/dist/src/utils/shell/shellProvider.js +2 -0
- package/dist/src/utils/shell/shellToolUtils.js +21 -0
- package/dist/src/utils/shell/specPrefix.js +198 -0
- package/dist/src/utils/shellConfig.js +136 -0
- package/dist/src/utils/sideQuery.js +195 -0
- package/dist/src/utils/sideQuestion.js +121 -0
- package/dist/src/utils/signal.js +34 -0
- package/dist/src/utils/sinks.js +15 -0
- package/dist/src/utils/skills/skillChangeDetector.js +266 -0
- package/dist/src/utils/slashCommandParsing.js +46 -0
- package/dist/src/utils/sleep.js +72 -0
- package/dist/src/utils/sliceAnsi.js +74 -0
- package/dist/src/utils/slowOperations.js +323 -0
- package/dist/src/utils/standaloneAgent.js +20 -0
- package/dist/src/utils/startupProfiler.js +158 -0
- package/dist/src/utils/staticRender.js +103 -0
- package/dist/src/utils/stats.js +802 -0
- package/dist/src/utils/statsCache.js +330 -0
- package/dist/src/utils/status.js +552 -0
- package/dist/src/utils/statusNoticeDefinitions.js +112 -0
- package/dist/src/utils/statusNoticeHelpers.js +15 -0
- package/dist/src/utils/stream.js +73 -0
- package/dist/src/utils/streamJsonStdoutGuard.js +107 -0
- package/dist/src/utils/streamlinedTransform.js +162 -0
- package/dist/src/utils/stringUtils.js +202 -0
- package/dist/src/utils/subprocessEnv.js +87 -0
- package/dist/src/utils/suggestions/commandSuggestions.js +458 -0
- package/dist/src/utils/suggestions/directoryCompletion.js +191 -0
- package/dist/src/utils/suggestions/shellHistoryCompletion.js +95 -0
- package/dist/src/utils/suggestions/skillUsageTracking.js +50 -0
- package/dist/src/utils/suggestions/slackChannelSuggestions.js +169 -0
- package/dist/src/utils/swarm/It2SetupPrompt.js +386 -0
- package/dist/src/utils/swarm/backends/ITermBackend.js +276 -0
- package/dist/src/utils/swarm/backends/InProcessBackend.js +237 -0
- package/dist/src/utils/swarm/backends/PaneBackendExecutor.js +250 -0
- package/dist/src/utils/swarm/backends/TmuxBackend.js +574 -0
- package/dist/src/utils/swarm/backends/detection.js +112 -0
- package/dist/src/utils/swarm/backends/it2Setup.js +185 -0
- package/dist/src/utils/swarm/backends/registry.js +369 -0
- package/dist/src/utils/swarm/backends/teammateModeSnapshot.js +68 -0
- package/dist/src/utils/swarm/backends/types.js +9 -0
- package/dist/src/utils/swarm/constants.js +29 -0
- package/dist/src/utils/swarm/inProcessRunner.js +1021 -0
- package/dist/src/utils/swarm/leaderPermissionBridge.js +31 -0
- package/dist/src/utils/swarm/permissionSync.js +667 -0
- package/dist/src/utils/swarm/reconnection.js +82 -0
- package/dist/src/utils/swarm/spawnInProcess.js +218 -0
- package/dist/src/utils/swarm/spawnUtils.js +123 -0
- package/dist/src/utils/swarm/teamHelpers.js +484 -0
- package/dist/src/utils/swarm/teammateInit.js +87 -0
- package/dist/src/utils/swarm/teammateLayoutManager.js +82 -0
- package/dist/src/utils/swarm/teammateModel.js +9 -0
- package/dist/src/utils/swarm/teammatePromptAddendum.js +17 -0
- package/dist/src/utils/systemDirectories.js +51 -0
- package/dist/src/utils/systemPrompt.js +91 -0
- package/dist/src/utils/systemPromptType.js +9 -0
- package/dist/src/utils/systemTheme.js +108 -0
- package/dist/src/utils/systemThemeWatcher.js +16 -0
- package/dist/src/utils/taggedId.js +49 -0
- package/dist/src/utils/task/TaskOutput.js +320 -0
- package/dist/src/utils/task/diskOutput.js +387 -0
- package/dist/src/utils/task/framework.js +236 -0
- package/dist/src/utils/task/outputFormatting.js +24 -0
- package/dist/src/utils/task/sdkProgress.js +24 -0
- package/dist/src/utils/tasks.js +672 -0
- package/dist/src/utils/teamDiscovery.js +48 -0
- package/dist/src/utils/teamMemoryOps.js +67 -0
- package/dist/src/utils/teammate.js +237 -0
- package/dist/src/utils/teammateContext.js +56 -0
- package/dist/src/utils/teammateMailbox.js +793 -0
- package/dist/src/utils/telemetry/betaSessionTracing.js +371 -0
- package/dist/src/utils/telemetry/bigqueryExporter.js +181 -0
- package/dist/src/utils/telemetry/events.js +57 -0
- package/dist/src/utils/telemetry/instrumentation.js +617 -0
- package/dist/src/utils/telemetry/logger.js +25 -0
- package/dist/src/utils/telemetry/perfettoTracing.js +882 -0
- package/dist/src/utils/telemetry/pluginTelemetry.js +157 -0
- package/dist/src/utils/telemetry/sessionTracing.js +693 -0
- package/dist/src/utils/telemetry/skillLoadedEvent.js +26 -0
- package/dist/src/utils/telemetryAttributes.js +57 -0
- package/dist/src/utils/teleport/api.js +299 -0
- package/dist/src/utils/teleport/environmentSelection.js +55 -0
- package/dist/src/utils/teleport/environments.js +84 -0
- package/dist/src/utils/teleport/gitBundle.js +192 -0
- package/dist/src/utils/teleport.js +1041 -0
- package/dist/src/utils/tempfile.js +26 -0
- package/dist/src/utils/terminal.js +105 -0
- package/dist/src/utils/terminalPanel.js +155 -0
- package/dist/src/utils/textHighlighting.js +113 -0
- package/dist/src/utils/theme.js +525 -0
- package/dist/src/utils/thinking.js +130 -0
- package/dist/src/utils/timeouts.js +35 -0
- package/dist/src/utils/tmuxSocket.js +373 -0
- package/dist/src/utils/todo/types.js +9 -0
- package/dist/src/utils/tokenBudget.js +62 -0
- package/dist/src/utils/tokens.js +223 -0
- package/dist/src/utils/toolErrors.js +101 -0
- package/dist/src/utils/toolPool.js +63 -0
- package/dist/src/utils/toolResultStorage.js +769 -0
- package/dist/src/utils/toolSchemaCache.js +7 -0
- package/dist/src/utils/toolSearch.js +551 -0
- package/dist/src/utils/transcriptSearch.js +200 -0
- package/dist/src/utils/treeify.js +111 -0
- package/dist/src/utils/truncate.js +164 -0
- package/dist/src/utils/udsClient.js +16 -0
- package/dist/src/utils/udsMessaging.js +16 -0
- package/dist/src/utils/ultraplan/ccrSession.js +264 -0
- package/dist/src/utils/ultraplan/keyword.js +122 -0
- package/dist/src/utils/ultraplan/prompt.txt +1 -0
- package/dist/src/utils/unaryLogging.js +16 -0
- package/dist/src/utils/undercover.js +89 -0
- package/dist/src/utils/user.js +138 -0
- package/dist/src/utils/userAgent.js +13 -0
- package/dist/src/utils/userPromptKeywords.js +21 -0
- package/dist/src/utils/uuid.js +22 -0
- package/dist/src/utils/warningHandler.js +97 -0
- package/dist/src/utils/which.js +75 -0
- package/dist/src/utils/windowsPaths.js +150 -0
- package/dist/src/utils/withResolvers.js +13 -0
- package/dist/src/utils/words.js +793 -0
- package/dist/src/utils/workloadContext.js +42 -0
- package/dist/src/utils/worktree.js +1145 -0
- package/dist/src/utils/worktreeModeEnabled.js +11 -0
- package/dist/src/utils/xdg.js +52 -0
- package/dist/src/utils/xml.js +15 -0
- package/dist/src/utils/yaml.js +16 -0
- package/dist/src/utils/zodToJsonSchema.js +19 -0
- package/dist/src/vim/motions.js +73 -0
- package/dist/src/vim/operators.js +401 -0
- package/dist/src/vim/textObjects.js +153 -0
- package/dist/src/vim/transitions.js +340 -0
- package/dist/src/vim/types.js +93 -0
- package/dist/src/voice/voiceModeEnabled.js +48 -0
- package/dist/src/whatsapp/bridge.js +267 -0
- package/dist/src/whatsapp/config.js +153 -0
- package/dist/src/whatsapp/markdown.js +37 -0
- package/dist/src/whatsapp/mirror.js +74 -0
- package/dist/src/whatsapp/session.js +142 -0
- package/package.json +2 -1
|
@@ -0,0 +1,1132 @@
|
|
|
1
|
+
import { ansiCodesToString, diffAnsiCodes, } from '@alcalzone/ansi-tokenize';
|
|
2
|
+
import { unionRect, } from './layout/geometry.js';
|
|
3
|
+
import { BEL, ESC, SEP } from './termio/ansi.js';
|
|
4
|
+
import * as warn from './warn.js';
|
|
5
|
+
// --- Shared Pools (interning for memory efficiency) ---
|
|
6
|
+
// Character string pool shared across all screens.
|
|
7
|
+
// With a shared pool, interned char IDs are valid across screens,
|
|
8
|
+
// so blitRegion can copy IDs directly (no re-interning) and
|
|
9
|
+
// diffEach can compare IDs as integers (no string lookup).
|
|
10
|
+
export class CharPool {
|
|
11
|
+
strings = [' ', '']; // Index 0 = space, 1 = empty (spacer)
|
|
12
|
+
stringMap = new Map([
|
|
13
|
+
[' ', 0],
|
|
14
|
+
['', 1],
|
|
15
|
+
]);
|
|
16
|
+
ascii = initCharAscii(); // charCode → index, -1 = not interned
|
|
17
|
+
intern(char) {
|
|
18
|
+
// ASCII fast-path: direct array lookup instead of Map.get
|
|
19
|
+
if (char.length === 1) {
|
|
20
|
+
const code = char.charCodeAt(0);
|
|
21
|
+
if (code < 128) {
|
|
22
|
+
const cached = this.ascii[code];
|
|
23
|
+
if (cached !== -1)
|
|
24
|
+
return cached;
|
|
25
|
+
const index = this.strings.length;
|
|
26
|
+
this.strings.push(char);
|
|
27
|
+
this.ascii[code] = index;
|
|
28
|
+
return index;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const existing = this.stringMap.get(char);
|
|
32
|
+
if (existing !== undefined)
|
|
33
|
+
return existing;
|
|
34
|
+
const index = this.strings.length;
|
|
35
|
+
this.strings.push(char);
|
|
36
|
+
this.stringMap.set(char, index);
|
|
37
|
+
return index;
|
|
38
|
+
}
|
|
39
|
+
get(index) {
|
|
40
|
+
return this.strings[index] ?? ' ';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Hyperlink string pool shared across all screens.
|
|
44
|
+
// Index 0 = no hyperlink.
|
|
45
|
+
export class HyperlinkPool {
|
|
46
|
+
strings = ['']; // Index 0 = no hyperlink
|
|
47
|
+
stringMap = new Map();
|
|
48
|
+
intern(hyperlink) {
|
|
49
|
+
if (!hyperlink)
|
|
50
|
+
return 0;
|
|
51
|
+
let id = this.stringMap.get(hyperlink);
|
|
52
|
+
if (id === undefined) {
|
|
53
|
+
id = this.strings.length;
|
|
54
|
+
this.strings.push(hyperlink);
|
|
55
|
+
this.stringMap.set(hyperlink, id);
|
|
56
|
+
}
|
|
57
|
+
return id;
|
|
58
|
+
}
|
|
59
|
+
get(id) {
|
|
60
|
+
return id === 0 ? undefined : this.strings[id];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// SGR 7 (inverse) as an AnsiCode. endCode '\x1b[27m' flags VISIBLE_ON_SPACE
|
|
64
|
+
// so bit 0 of the resulting styleId is set → renderer won't skip inverted
|
|
65
|
+
// spaces as invisible.
|
|
66
|
+
const INVERSE_CODE = {
|
|
67
|
+
type: 'ansi',
|
|
68
|
+
code: '\x1b[7m',
|
|
69
|
+
endCode: '\x1b[27m',
|
|
70
|
+
};
|
|
71
|
+
// Bold (SGR 1) — stacks cleanly, no reflow in monospace. endCode 22
|
|
72
|
+
// also cancels dim (SGR 2); harmless here since we never add dim.
|
|
73
|
+
const BOLD_CODE = {
|
|
74
|
+
type: 'ansi',
|
|
75
|
+
code: '\x1b[1m',
|
|
76
|
+
endCode: '\x1b[22m',
|
|
77
|
+
};
|
|
78
|
+
// Underline (SGR 4). Kept alongside yellow+bold — the underline is the
|
|
79
|
+
// unambiguous visible-on-any-theme marker. Yellow-bg-via-inverse can
|
|
80
|
+
// clash with existing bg colors (user-prompt style, tool chrome, syntax
|
|
81
|
+
// bg). If you see underline but no yellow, the yellow is being lost in
|
|
82
|
+
// the existing cell styling — the overlay IS finding the match.
|
|
83
|
+
const UNDERLINE_CODE = {
|
|
84
|
+
type: 'ansi',
|
|
85
|
+
code: '\x1b[4m',
|
|
86
|
+
endCode: '\x1b[24m',
|
|
87
|
+
};
|
|
88
|
+
// fg→yellow (SGR 33). With inverse already in the stack, the terminal
|
|
89
|
+
// swaps fg↔bg at render — so yellow-fg becomes yellow-BG. Original bg
|
|
90
|
+
// becomes fg (readable on most themes: dark-bg → dark-text on yellow).
|
|
91
|
+
// endCode 39 is 'default fg' — cancels any prior fg color cleanly.
|
|
92
|
+
const YELLOW_FG_CODE = {
|
|
93
|
+
type: 'ansi',
|
|
94
|
+
code: '\x1b[33m',
|
|
95
|
+
endCode: '\x1b[39m',
|
|
96
|
+
};
|
|
97
|
+
export class StylePool {
|
|
98
|
+
ids = new Map();
|
|
99
|
+
styles = [];
|
|
100
|
+
transitionCache = new Map();
|
|
101
|
+
none;
|
|
102
|
+
constructor() {
|
|
103
|
+
this.none = this.intern([]);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Intern a style and return its ID. Bit 0 of the ID encodes whether the
|
|
107
|
+
* style has a visible effect on space characters (background, inverse,
|
|
108
|
+
* underline, etc.). Foreground-only styles get even IDs; styles visible
|
|
109
|
+
* on spaces get odd IDs. This lets the renderer skip invisible spaces
|
|
110
|
+
* with a single bitmask check on the packed word.
|
|
111
|
+
*/
|
|
112
|
+
intern(styles) {
|
|
113
|
+
const key = styles.length === 0 ? '' : styles.map(s => s.code).join('\0');
|
|
114
|
+
let id = this.ids.get(key);
|
|
115
|
+
if (id === undefined) {
|
|
116
|
+
const rawId = this.styles.length;
|
|
117
|
+
this.styles.push(styles.length === 0 ? [] : styles);
|
|
118
|
+
id =
|
|
119
|
+
(rawId << 1) |
|
|
120
|
+
(styles.length > 0 && hasVisibleSpaceEffect(styles) ? 1 : 0);
|
|
121
|
+
this.ids.set(key, id);
|
|
122
|
+
}
|
|
123
|
+
return id;
|
|
124
|
+
}
|
|
125
|
+
/** Recover styles from an encoded ID. Strips the bit-0 flag via >>> 1. */
|
|
126
|
+
get(id) {
|
|
127
|
+
return this.styles[id >>> 1] ?? [];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns the pre-serialized ANSI string to transition from one style to
|
|
131
|
+
* another. Cached by (fromId, toId) — zero allocations after first call
|
|
132
|
+
* for a given pair.
|
|
133
|
+
*/
|
|
134
|
+
transition(fromId, toId) {
|
|
135
|
+
if (fromId === toId)
|
|
136
|
+
return '';
|
|
137
|
+
const key = fromId * 0x100000 + toId;
|
|
138
|
+
let str = this.transitionCache.get(key);
|
|
139
|
+
if (str === undefined) {
|
|
140
|
+
str = ansiCodesToString(diffAnsiCodes(this.get(fromId), this.get(toId)));
|
|
141
|
+
this.transitionCache.set(key, str);
|
|
142
|
+
}
|
|
143
|
+
return str;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Intern a style that is `base + inverse`. Cached by base ID so
|
|
147
|
+
* repeated calls for the same underlying style don't re-scan the
|
|
148
|
+
* AnsiCode[] array. Used by the selection overlay.
|
|
149
|
+
*/
|
|
150
|
+
inverseCache = new Map();
|
|
151
|
+
withInverse(baseId) {
|
|
152
|
+
let id = this.inverseCache.get(baseId);
|
|
153
|
+
if (id === undefined) {
|
|
154
|
+
const baseCodes = this.get(baseId);
|
|
155
|
+
// If already inverted, use as-is (avoids SGR 7 stacking)
|
|
156
|
+
const hasInverse = baseCodes.some(c => c.endCode === '\x1b[27m');
|
|
157
|
+
id = hasInverse ? baseId : this.intern([...baseCodes, INVERSE_CODE]);
|
|
158
|
+
this.inverseCache.set(baseId, id);
|
|
159
|
+
}
|
|
160
|
+
return id;
|
|
161
|
+
}
|
|
162
|
+
/** Inverse + bold + yellow-bg-via-fg-swap for the CURRENT search match.
|
|
163
|
+
* OTHER matches are plain inverse — bg inherits from the theme. Current
|
|
164
|
+
* gets a distinct yellow bg (via fg-then-inverse swap) plus bold weight
|
|
165
|
+
* so it stands out in a sea of inverse. Underline was too subtle. Zero
|
|
166
|
+
* reflow risk: all pure SGR overlays, per-cell, post-layout. The yellow
|
|
167
|
+
* overrides any existing fg (syntax highlighting) on those cells — fine,
|
|
168
|
+
* the "you are here" signal IS the point, syntax color can yield. */
|
|
169
|
+
currentMatchCache = new Map();
|
|
170
|
+
withCurrentMatch(baseId) {
|
|
171
|
+
let id = this.currentMatchCache.get(baseId);
|
|
172
|
+
if (id === undefined) {
|
|
173
|
+
const baseCodes = this.get(baseId);
|
|
174
|
+
// Filter BOTH fg + bg so yellow-via-inverse is unambiguous.
|
|
175
|
+
// User-prompt cells have an explicit bg (grey box); with that bg
|
|
176
|
+
// still set, inverse swaps yellow-fg↔grey-bg → grey-on-yellow on
|
|
177
|
+
// SOME terminals, yellow-on-grey on others (inverse semantics vary
|
|
178
|
+
// when both colors are explicit). Filtering both gives clean
|
|
179
|
+
// yellow-bg + terminal-default-fg everywhere. Bold/dim/italic
|
|
180
|
+
// coexist — keep those.
|
|
181
|
+
const codes = baseCodes.filter(c => c.endCode !== '\x1b[39m' && c.endCode !== '\x1b[49m');
|
|
182
|
+
// fg-yellow FIRST so inverse swaps it to bg. Bold after inverse is
|
|
183
|
+
// fine — SGR 1 is fg-attribute-only, order-independent vs 7.
|
|
184
|
+
codes.push(YELLOW_FG_CODE);
|
|
185
|
+
if (!baseCodes.some(c => c.endCode === '\x1b[27m'))
|
|
186
|
+
codes.push(INVERSE_CODE);
|
|
187
|
+
if (!baseCodes.some(c => c.endCode === '\x1b[22m'))
|
|
188
|
+
codes.push(BOLD_CODE);
|
|
189
|
+
// Underline as the unambiguous marker — yellow-bg can clash with
|
|
190
|
+
// existing bg styling (user-prompt bg, syntax bg). If you see
|
|
191
|
+
// underline but no yellow on a match, the overlay IS finding it;
|
|
192
|
+
// the yellow is just losing a styling fight.
|
|
193
|
+
if (!baseCodes.some(c => c.endCode === '\x1b[24m'))
|
|
194
|
+
codes.push(UNDERLINE_CODE);
|
|
195
|
+
id = this.intern(codes);
|
|
196
|
+
this.currentMatchCache.set(baseId, id);
|
|
197
|
+
}
|
|
198
|
+
return id;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Selection overlay: REPLACE the cell's background with a solid color
|
|
202
|
+
* while preserving its foreground (color, bold, italic, dim, underline).
|
|
203
|
+
* Matches native terminal selection — a dedicated bg color, not SGR-7
|
|
204
|
+
* inverse. Inverse swaps fg/bg per-cell, which fragments visually over
|
|
205
|
+
* syntax-highlighted text (every fg color becomes a different bg stripe).
|
|
206
|
+
*
|
|
207
|
+
* Strips any existing bg (endCode 49m — REPLACES, so diff-added green
|
|
208
|
+
* etc. don't bleed through) and any existing inverse (endCode 27m —
|
|
209
|
+
* inverse on top of a solid bg would re-swap and look wrong).
|
|
210
|
+
*
|
|
211
|
+
* bg is set via setSelectionBg(); null → fallback to withInverse() so the
|
|
212
|
+
* overlay still works before theme wiring sets a color (tests, first frame).
|
|
213
|
+
* Cache is keyed by baseId only — setSelectionBg() clears it on change.
|
|
214
|
+
*/
|
|
215
|
+
selectionBgCode = null;
|
|
216
|
+
selectionBgCache = new Map();
|
|
217
|
+
setSelectionBg(bg) {
|
|
218
|
+
if (this.selectionBgCode?.code === bg?.code)
|
|
219
|
+
return;
|
|
220
|
+
this.selectionBgCode = bg;
|
|
221
|
+
this.selectionBgCache.clear();
|
|
222
|
+
}
|
|
223
|
+
withSelectionBg(baseId) {
|
|
224
|
+
const bg = this.selectionBgCode;
|
|
225
|
+
if (bg === null)
|
|
226
|
+
return this.withInverse(baseId);
|
|
227
|
+
let id = this.selectionBgCache.get(baseId);
|
|
228
|
+
if (id === undefined) {
|
|
229
|
+
// Keep everything except bg (49m) and inverse (27m). Fg, bold, dim,
|
|
230
|
+
// italic, underline, strikethrough all preserved.
|
|
231
|
+
const kept = this.get(baseId).filter(c => c.endCode !== '\x1b[49m' && c.endCode !== '\x1b[27m');
|
|
232
|
+
kept.push(bg);
|
|
233
|
+
id = this.intern(kept);
|
|
234
|
+
this.selectionBgCache.set(baseId, id);
|
|
235
|
+
}
|
|
236
|
+
return id;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// endCodes that produce visible effects on space characters
|
|
240
|
+
const VISIBLE_ON_SPACE = new Set([
|
|
241
|
+
'\x1b[49m', // background color
|
|
242
|
+
'\x1b[27m', // inverse
|
|
243
|
+
'\x1b[24m', // underline
|
|
244
|
+
'\x1b[29m', // strikethrough
|
|
245
|
+
'\x1b[55m', // overline
|
|
246
|
+
]);
|
|
247
|
+
function hasVisibleSpaceEffect(styles) {
|
|
248
|
+
for (const style of styles) {
|
|
249
|
+
if (VISIBLE_ON_SPACE.has(style.endCode))
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
// Constants for empty/spacer cells to enable fast comparisons
|
|
255
|
+
// These are indices into the charStrings table, not codepoints
|
|
256
|
+
const EMPTY_CHAR_INDEX = 0; // ' ' (space)
|
|
257
|
+
const SPACER_CHAR_INDEX = 1; // '' (empty string for spacer cells)
|
|
258
|
+
// Unwritten cells are [EMPTY_CHAR_INDEX=0, packWord1(emptyStyleId=0,0,0)=0].
|
|
259
|
+
// Since StylePool.none is always 0 (first intern), unwritten cells are
|
|
260
|
+
// indistinguishable from explicitly-cleared cells in the packed array.
|
|
261
|
+
// This is intentional: diffEach can compare raw ints with zero normalization.
|
|
262
|
+
// isEmptyCellByIndex checks if both words are 0 to identify "never visually written" cells.
|
|
263
|
+
function initCharAscii() {
|
|
264
|
+
const table = new Int32Array(128);
|
|
265
|
+
table.fill(-1);
|
|
266
|
+
table[32] = EMPTY_CHAR_INDEX; // ' ' (space)
|
|
267
|
+
return table;
|
|
268
|
+
}
|
|
269
|
+
// --- Packed cell layout ---
|
|
270
|
+
// Each cell is 2 consecutive Int32 elements in the cells array:
|
|
271
|
+
// word0 (cells[ci]): charId (full 32 bits)
|
|
272
|
+
// word1 (cells[ci + 1]): styleId[31:17] | hyperlinkId[16:2] | width[1:0]
|
|
273
|
+
const STYLE_SHIFT = 17;
|
|
274
|
+
const HYPERLINK_SHIFT = 2;
|
|
275
|
+
const HYPERLINK_MASK = 0x7fff; // 15 bits
|
|
276
|
+
const WIDTH_MASK = 3; // 2 bits
|
|
277
|
+
// Pack styleId, hyperlinkId, and width into a single Int32
|
|
278
|
+
function packWord1(styleId, hyperlinkId, width) {
|
|
279
|
+
return (styleId << STYLE_SHIFT) | (hyperlinkId << HYPERLINK_SHIFT) | width;
|
|
280
|
+
}
|
|
281
|
+
// Unwritten cell as BigInt64 — both words are 0, so the 64-bit value is 0n.
|
|
282
|
+
// Used by BigInt64Array.fill() for bulk clears (resetScreen, clearRegion).
|
|
283
|
+
// Not used for comparison — BigInt element reads cause heap allocation.
|
|
284
|
+
const EMPTY_CELL_VALUE = 0n;
|
|
285
|
+
function isEmptyCellByIndex(screen, index) {
|
|
286
|
+
// An empty/unwritten cell has both words === 0:
|
|
287
|
+
// word0 = EMPTY_CHAR_INDEX (0), word1 = packWord1(emptyStyleId=0, 0, 0) = 0.
|
|
288
|
+
const ci = index << 1;
|
|
289
|
+
return screen.cells[ci] === 0 && screen.cells[ci | 1] === 0;
|
|
290
|
+
}
|
|
291
|
+
export function isEmptyCellAt(screen, x, y) {
|
|
292
|
+
if (x < 0 || y < 0 || x >= screen.width || y >= screen.height)
|
|
293
|
+
return true;
|
|
294
|
+
return isEmptyCellByIndex(screen, y * screen.width + x);
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Check if a Cell (view object) represents an empty cell.
|
|
298
|
+
*/
|
|
299
|
+
export function isCellEmpty(screen, cell) {
|
|
300
|
+
// Check if cell looks like an empty cell (space, empty style, narrow, no link).
|
|
301
|
+
// Note: After cellAt mapping, unwritten cells have emptyStyleId, so this
|
|
302
|
+
// returns true for both unwritten AND cleared cells. Use isEmptyCellAt
|
|
303
|
+
// for the internal distinction.
|
|
304
|
+
return (cell.char === ' ' &&
|
|
305
|
+
cell.styleId === screen.emptyStyleId &&
|
|
306
|
+
cell.width === 0 /* CellWidth.Narrow */ &&
|
|
307
|
+
!cell.hyperlink);
|
|
308
|
+
}
|
|
309
|
+
// Intern a hyperlink string and return its ID (0 = no hyperlink)
|
|
310
|
+
function internHyperlink(screen, hyperlink) {
|
|
311
|
+
return screen.hyperlinkPool.intern(hyperlink);
|
|
312
|
+
}
|
|
313
|
+
// ---
|
|
314
|
+
export function createScreen(width, height, styles, charPool, hyperlinkPool) {
|
|
315
|
+
// Warn if dimensions are not valid integers (likely bad yoga layout output)
|
|
316
|
+
warn.ifNotInteger(width, 'createScreen width');
|
|
317
|
+
warn.ifNotInteger(height, 'createScreen height');
|
|
318
|
+
// Ensure width and height are valid integers to prevent crashes
|
|
319
|
+
if (!Number.isInteger(width) || width < 0) {
|
|
320
|
+
width = Math.max(0, Math.floor(width) || 0);
|
|
321
|
+
}
|
|
322
|
+
if (!Number.isInteger(height) || height < 0) {
|
|
323
|
+
height = Math.max(0, Math.floor(height) || 0);
|
|
324
|
+
}
|
|
325
|
+
const size = width * height;
|
|
326
|
+
// Allocate one buffer, two views: Int32Array for per-word access,
|
|
327
|
+
// BigInt64Array for bulk fill in resetScreen/clearRegion.
|
|
328
|
+
// ArrayBuffer is zero-filled, which is exactly the empty cell value:
|
|
329
|
+
// [EMPTY_CHAR_INDEX=0, packWord1(emptyStyleId=0,0,0)=0].
|
|
330
|
+
const buf = new ArrayBuffer(size << 3); // 8 bytes per cell
|
|
331
|
+
const cells = new Int32Array(buf);
|
|
332
|
+
const cells64 = new BigInt64Array(buf);
|
|
333
|
+
return {
|
|
334
|
+
width,
|
|
335
|
+
height,
|
|
336
|
+
cells,
|
|
337
|
+
cells64,
|
|
338
|
+
charPool,
|
|
339
|
+
hyperlinkPool,
|
|
340
|
+
emptyStyleId: styles.none,
|
|
341
|
+
damage: undefined,
|
|
342
|
+
noSelect: new Uint8Array(size),
|
|
343
|
+
softWrap: new Int32Array(height),
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Reset an existing screen for reuse, avoiding allocation of new typed arrays.
|
|
348
|
+
* Resizes if needed and clears all cells to empty/unwritten state.
|
|
349
|
+
*
|
|
350
|
+
* For double-buffering, this allows swapping between front and back buffers
|
|
351
|
+
* without allocating new Screen objects each frame.
|
|
352
|
+
*/
|
|
353
|
+
export function resetScreen(screen, width, height) {
|
|
354
|
+
// Warn if dimensions are not valid integers
|
|
355
|
+
warn.ifNotInteger(width, 'resetScreen width');
|
|
356
|
+
warn.ifNotInteger(height, 'resetScreen height');
|
|
357
|
+
// Ensure width and height are valid integers to prevent crashes
|
|
358
|
+
if (!Number.isInteger(width) || width < 0) {
|
|
359
|
+
width = Math.max(0, Math.floor(width) || 0);
|
|
360
|
+
}
|
|
361
|
+
if (!Number.isInteger(height) || height < 0) {
|
|
362
|
+
height = Math.max(0, Math.floor(height) || 0);
|
|
363
|
+
}
|
|
364
|
+
const size = width * height;
|
|
365
|
+
// Resize if needed (only grow, to avoid reallocations)
|
|
366
|
+
if (screen.cells64.length < size) {
|
|
367
|
+
const buf = new ArrayBuffer(size << 3);
|
|
368
|
+
screen.cells = new Int32Array(buf);
|
|
369
|
+
screen.cells64 = new BigInt64Array(buf);
|
|
370
|
+
screen.noSelect = new Uint8Array(size);
|
|
371
|
+
}
|
|
372
|
+
if (screen.softWrap.length < height) {
|
|
373
|
+
screen.softWrap = new Int32Array(height);
|
|
374
|
+
}
|
|
375
|
+
// Reset all cells — single fill call, no loop
|
|
376
|
+
screen.cells64.fill(EMPTY_CELL_VALUE, 0, size);
|
|
377
|
+
screen.noSelect.fill(0, 0, size);
|
|
378
|
+
screen.softWrap.fill(0, 0, height);
|
|
379
|
+
// Update dimensions
|
|
380
|
+
screen.width = width;
|
|
381
|
+
screen.height = height;
|
|
382
|
+
// Shared pools accumulate — no clearing needed. Unique char/hyperlink sets are bounded.
|
|
383
|
+
// Clear damage tracking
|
|
384
|
+
screen.damage = undefined;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Re-intern a screen's char and hyperlink IDs into new pools.
|
|
388
|
+
* Used for generational pool reset — after migrating, the screen's
|
|
389
|
+
* typed arrays contain valid IDs for the new pools, and the old pools
|
|
390
|
+
* can be GC'd.
|
|
391
|
+
*
|
|
392
|
+
* O(width * height) but only called occasionally (e.g., between conversation turns).
|
|
393
|
+
*/
|
|
394
|
+
export function migrateScreenPools(screen, charPool, hyperlinkPool) {
|
|
395
|
+
const oldCharPool = screen.charPool;
|
|
396
|
+
const oldHyperlinkPool = screen.hyperlinkPool;
|
|
397
|
+
if (oldCharPool === charPool && oldHyperlinkPool === hyperlinkPool)
|
|
398
|
+
return;
|
|
399
|
+
const size = screen.width * screen.height;
|
|
400
|
+
const cells = screen.cells;
|
|
401
|
+
// Re-intern chars and hyperlinks in a single pass, stride by 2
|
|
402
|
+
for (let ci = 0; ci < size << 1; ci += 2) {
|
|
403
|
+
// Re-intern charId (word0)
|
|
404
|
+
const oldCharId = cells[ci];
|
|
405
|
+
cells[ci] = charPool.intern(oldCharPool.get(oldCharId));
|
|
406
|
+
// Re-intern hyperlinkId (packed in word1)
|
|
407
|
+
const word1 = cells[ci + 1];
|
|
408
|
+
const oldHyperlinkId = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK;
|
|
409
|
+
if (oldHyperlinkId !== 0) {
|
|
410
|
+
const oldStr = oldHyperlinkPool.get(oldHyperlinkId);
|
|
411
|
+
const newHyperlinkId = hyperlinkPool.intern(oldStr);
|
|
412
|
+
// Repack word1 with new hyperlinkId, preserving styleId and width
|
|
413
|
+
const styleId = word1 >>> STYLE_SHIFT;
|
|
414
|
+
const width = word1 & WIDTH_MASK;
|
|
415
|
+
cells[ci + 1] = packWord1(styleId, newHyperlinkId, width);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
screen.charPool = charPool;
|
|
419
|
+
screen.hyperlinkPool = hyperlinkPool;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Get a Cell view at the given position. Returns a new object each call -
|
|
423
|
+
* this is intentional as cells are stored packed, not as objects.
|
|
424
|
+
*/
|
|
425
|
+
export function cellAt(screen, x, y) {
|
|
426
|
+
if (x < 0 || y < 0 || x >= screen.width || y >= screen.height)
|
|
427
|
+
return undefined;
|
|
428
|
+
return cellAtIndex(screen, y * screen.width + x);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Get a Cell view by pre-computed array index. Skips bounds checks and
|
|
432
|
+
* index computation — caller must ensure index is valid.
|
|
433
|
+
*/
|
|
434
|
+
export function cellAtIndex(screen, index) {
|
|
435
|
+
const ci = index << 1;
|
|
436
|
+
const word1 = screen.cells[ci + 1];
|
|
437
|
+
const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK;
|
|
438
|
+
return {
|
|
439
|
+
// Unwritten cells have charIndex=0 (EMPTY_CHAR_INDEX); charPool.get(0) returns ' '
|
|
440
|
+
char: screen.charPool.get(screen.cells[ci]),
|
|
441
|
+
styleId: word1 >>> STYLE_SHIFT,
|
|
442
|
+
width: word1 & WIDTH_MASK,
|
|
443
|
+
hyperlink: hid === 0 ? undefined : screen.hyperlinkPool.get(hid),
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Get a Cell at the given index, or undefined if it has no visible content.
|
|
448
|
+
* Returns undefined for spacer cells (charId 1), empty unstyled spaces, and
|
|
449
|
+
* fg-only styled spaces that match lastRenderedStyleId (cursor-forward
|
|
450
|
+
* produces an identical visual result, avoiding a Cell allocation).
|
|
451
|
+
*
|
|
452
|
+
* @param lastRenderedStyleId - styleId of the last rendered cell on this
|
|
453
|
+
* line, or -1 if none yet.
|
|
454
|
+
*/
|
|
455
|
+
export function visibleCellAtIndex(cells, charPool, hyperlinkPool, index, lastRenderedStyleId) {
|
|
456
|
+
const ci = index << 1;
|
|
457
|
+
const charId = cells[ci];
|
|
458
|
+
if (charId === 1)
|
|
459
|
+
return undefined; // spacer
|
|
460
|
+
const word1 = cells[ci + 1];
|
|
461
|
+
// For spaces: 0x3fffc masks bits 2-17 (hyperlinkId + styleId visibility
|
|
462
|
+
// bit). If zero, the space has no hyperlink and at most a fg-only style.
|
|
463
|
+
// Then word1 >>> STYLE_SHIFT is the foreground style — skip if it's zero
|
|
464
|
+
// (truly invisible) or matches the last rendered style on this line.
|
|
465
|
+
if (charId === 0 && (word1 & 0x3fffc) === 0) {
|
|
466
|
+
const fgStyle = word1 >>> STYLE_SHIFT;
|
|
467
|
+
if (fgStyle === 0 || fgStyle === lastRenderedStyleId)
|
|
468
|
+
return undefined;
|
|
469
|
+
}
|
|
470
|
+
const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK;
|
|
471
|
+
return {
|
|
472
|
+
char: charPool.get(charId),
|
|
473
|
+
styleId: word1 >>> STYLE_SHIFT,
|
|
474
|
+
width: word1 & WIDTH_MASK,
|
|
475
|
+
hyperlink: hid === 0 ? undefined : hyperlinkPool.get(hid),
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Write cell data into an existing Cell object to avoid allocation.
|
|
480
|
+
* Caller must ensure index is valid.
|
|
481
|
+
*/
|
|
482
|
+
function cellAtCI(screen, ci, out) {
|
|
483
|
+
const w1 = ci | 1;
|
|
484
|
+
const word1 = screen.cells[w1];
|
|
485
|
+
out.char = screen.charPool.get(screen.cells[ci]);
|
|
486
|
+
out.styleId = word1 >>> STYLE_SHIFT;
|
|
487
|
+
out.width = word1 & WIDTH_MASK;
|
|
488
|
+
const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK;
|
|
489
|
+
out.hyperlink = hid === 0 ? undefined : screen.hyperlinkPool.get(hid);
|
|
490
|
+
}
|
|
491
|
+
export function charInCellAt(screen, x, y) {
|
|
492
|
+
if (x < 0 || y < 0 || x >= screen.width || y >= screen.height)
|
|
493
|
+
return undefined;
|
|
494
|
+
const ci = (y * screen.width + x) << 1;
|
|
495
|
+
return screen.charPool.get(screen.cells[ci]);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Set a cell, optionally creating a spacer for wide characters.
|
|
499
|
+
*
|
|
500
|
+
* Wide characters (CJK, emoji) occupy 2 cells in the buffer:
|
|
501
|
+
* 1. First cell: Contains the actual character with width = Wide
|
|
502
|
+
* 2. Second cell: Spacer cell with width = SpacerTail (empty, not rendered)
|
|
503
|
+
*
|
|
504
|
+
* If the cell has width = Wide, this function automatically creates the
|
|
505
|
+
* corresponding SpacerTail in the next column. This two-cell model keeps
|
|
506
|
+
* the buffer aligned to visual columns, making cursor positioning
|
|
507
|
+
* straightforward.
|
|
508
|
+
*
|
|
509
|
+
* TODO: When soft-wrapping is implemented, SpacerHead cells will be explicitly
|
|
510
|
+
* placed by the wrapping logic at line-end positions where wide characters
|
|
511
|
+
* wrap to the next line. This function doesn't need to handle SpacerHead
|
|
512
|
+
* automatically - it will be set directly by the wrapping code.
|
|
513
|
+
*/
|
|
514
|
+
export function setCellAt(screen, x, y, cell) {
|
|
515
|
+
if (x < 0 || y < 0 || x >= screen.width || y >= screen.height)
|
|
516
|
+
return;
|
|
517
|
+
const ci = (y * screen.width + x) << 1;
|
|
518
|
+
const cells = screen.cells;
|
|
519
|
+
// When a Wide char is overwritten by a Narrow char, its SpacerTail remains
|
|
520
|
+
// as a ghost cell that the diff/render pipeline skips, causing stale content
|
|
521
|
+
// to leak through from previous frames.
|
|
522
|
+
const prevWidth = cells[ci + 1] & WIDTH_MASK;
|
|
523
|
+
if (prevWidth === 1 /* CellWidth.Wide */ && cell.width !== 1 /* CellWidth.Wide */) {
|
|
524
|
+
const spacerX = x + 1;
|
|
525
|
+
if (spacerX < screen.width) {
|
|
526
|
+
const spacerCI = ci + 2;
|
|
527
|
+
if ((cells[spacerCI + 1] & WIDTH_MASK) === 2 /* CellWidth.SpacerTail */) {
|
|
528
|
+
cells[spacerCI] = EMPTY_CHAR_INDEX;
|
|
529
|
+
cells[spacerCI + 1] = packWord1(screen.emptyStyleId, 0, 0 /* CellWidth.Narrow */);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
// Track cleared Wide position for damage expansion below
|
|
534
|
+
let clearedWideX = -1;
|
|
535
|
+
if (prevWidth === 2 /* CellWidth.SpacerTail */ &&
|
|
536
|
+
cell.width !== 2 /* CellWidth.SpacerTail */) {
|
|
537
|
+
// Overwriting a SpacerTail: clear the orphaned Wide char at (x-1).
|
|
538
|
+
// Keeping the wide character with Narrow width would cause the terminal
|
|
539
|
+
// to still render it with width 2, desyncing the cursor model.
|
|
540
|
+
if (x > 0) {
|
|
541
|
+
const wideCI = ci - 2;
|
|
542
|
+
if ((cells[wideCI + 1] & WIDTH_MASK) === 1 /* CellWidth.Wide */) {
|
|
543
|
+
cells[wideCI] = EMPTY_CHAR_INDEX;
|
|
544
|
+
cells[wideCI + 1] = packWord1(screen.emptyStyleId, 0, 0 /* CellWidth.Narrow */);
|
|
545
|
+
clearedWideX = x - 1;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
// Pack cell data into cells array
|
|
550
|
+
cells[ci] = internCharString(screen, cell.char);
|
|
551
|
+
cells[ci + 1] = packWord1(cell.styleId, internHyperlink(screen, cell.hyperlink), cell.width);
|
|
552
|
+
// Track damage - expand bounds in place instead of allocating new objects
|
|
553
|
+
// Include the main cell position and any cleared orphan cells
|
|
554
|
+
const minX = clearedWideX >= 0 ? Math.min(x, clearedWideX) : x;
|
|
555
|
+
const damage = screen.damage;
|
|
556
|
+
if (damage) {
|
|
557
|
+
const right = damage.x + damage.width;
|
|
558
|
+
const bottom = damage.y + damage.height;
|
|
559
|
+
if (minX < damage.x) {
|
|
560
|
+
damage.width += damage.x - minX;
|
|
561
|
+
damage.x = minX;
|
|
562
|
+
}
|
|
563
|
+
else if (x >= right) {
|
|
564
|
+
damage.width = x - damage.x + 1;
|
|
565
|
+
}
|
|
566
|
+
if (y < damage.y) {
|
|
567
|
+
damage.height += damage.y - y;
|
|
568
|
+
damage.y = y;
|
|
569
|
+
}
|
|
570
|
+
else if (y >= bottom) {
|
|
571
|
+
damage.height = y - damage.y + 1;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
else {
|
|
575
|
+
screen.damage = { x: minX, y, width: x - minX + 1, height: 1 };
|
|
576
|
+
}
|
|
577
|
+
// If this is a wide character, create a spacer in the next column
|
|
578
|
+
if (cell.width === 1 /* CellWidth.Wide */) {
|
|
579
|
+
const spacerX = x + 1;
|
|
580
|
+
if (spacerX < screen.width) {
|
|
581
|
+
const spacerCI = ci + 2;
|
|
582
|
+
// If the cell we're overwriting with our SpacerTail is itself Wide,
|
|
583
|
+
// clear ITS SpacerTail at x+2 too. Otherwise the orphan SpacerTail
|
|
584
|
+
// makes diffEach report it as `added` and log-update's skip-spacer
|
|
585
|
+
// rule prevents clearing whatever prev content was at that column.
|
|
586
|
+
// Scenario: [a, 💻, spacer] → [本, spacer, ORPHAN spacer] when
|
|
587
|
+
// yoga squishes a💻 to height 0 and 本 renders at the same y.
|
|
588
|
+
if ((cells[spacerCI + 1] & WIDTH_MASK) === 1 /* CellWidth.Wide */) {
|
|
589
|
+
const orphanCI = spacerCI + 2;
|
|
590
|
+
if (spacerX + 1 < screen.width &&
|
|
591
|
+
(cells[orphanCI + 1] & WIDTH_MASK) === 2 /* CellWidth.SpacerTail */) {
|
|
592
|
+
cells[orphanCI] = EMPTY_CHAR_INDEX;
|
|
593
|
+
cells[orphanCI + 1] = packWord1(screen.emptyStyleId, 0, 0 /* CellWidth.Narrow */);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
cells[spacerCI] = SPACER_CHAR_INDEX;
|
|
597
|
+
cells[spacerCI + 1] = packWord1(screen.emptyStyleId, 0, 2 /* CellWidth.SpacerTail */);
|
|
598
|
+
// Expand damage to include SpacerTail so diff() scans it
|
|
599
|
+
const d = screen.damage;
|
|
600
|
+
if (d && spacerX >= d.x + d.width) {
|
|
601
|
+
d.width = spacerX - d.x + 1;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Replace the styleId of a cell in-place without disturbing char, width,
|
|
608
|
+
* or hyperlink. Preserves empty cells as-is (char stays ' '). Tracks damage
|
|
609
|
+
* for the cell so diffEach picks up the change.
|
|
610
|
+
*/
|
|
611
|
+
export function setCellStyleId(screen, x, y, styleId) {
|
|
612
|
+
if (x < 0 || y < 0 || x >= screen.width || y >= screen.height)
|
|
613
|
+
return;
|
|
614
|
+
const ci = (y * screen.width + x) << 1;
|
|
615
|
+
const cells = screen.cells;
|
|
616
|
+
const word1 = cells[ci + 1];
|
|
617
|
+
const width = word1 & WIDTH_MASK;
|
|
618
|
+
// Skip spacer cells — inverse on the head cell visually covers both columns
|
|
619
|
+
if (width === 2 /* CellWidth.SpacerTail */ || width === 3 /* CellWidth.SpacerHead */)
|
|
620
|
+
return;
|
|
621
|
+
const hid = (word1 >>> HYPERLINK_SHIFT) & HYPERLINK_MASK;
|
|
622
|
+
cells[ci + 1] = packWord1(styleId, hid, width);
|
|
623
|
+
// Expand damage so diffEach scans this cell
|
|
624
|
+
const d = screen.damage;
|
|
625
|
+
if (d) {
|
|
626
|
+
screen.damage = unionRect(d, { x, y, width: 1, height: 1 });
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
screen.damage = { x, y, width: 1, height: 1 };
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Intern a character string via the screen's shared CharPool.
|
|
634
|
+
* Supports grapheme clusters like family emoji.
|
|
635
|
+
*/
|
|
636
|
+
function internCharString(screen, char) {
|
|
637
|
+
return screen.charPool.intern(char);
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* Bulk-copy a rectangular region from src to dst using TypedArray.set().
|
|
641
|
+
* Single cells.set() call per row (or one call for contiguous blocks).
|
|
642
|
+
* Damage is computed once for the whole region.
|
|
643
|
+
*
|
|
644
|
+
* Clamps negative regionX/regionY to 0 (matching clearRegion) — absolute-
|
|
645
|
+
* positioned overlays in tiny terminals can compute negative screen coords.
|
|
646
|
+
* maxX/maxY should already be clamped to both screen bounds by the caller.
|
|
647
|
+
*/
|
|
648
|
+
export function blitRegion(dst, src, regionX, regionY, maxX, maxY) {
|
|
649
|
+
regionX = Math.max(0, regionX);
|
|
650
|
+
regionY = Math.max(0, regionY);
|
|
651
|
+
if (regionX >= maxX || regionY >= maxY)
|
|
652
|
+
return;
|
|
653
|
+
const rowLen = maxX - regionX;
|
|
654
|
+
const srcStride = src.width << 1;
|
|
655
|
+
const dstStride = dst.width << 1;
|
|
656
|
+
const rowBytes = rowLen << 1; // 2 Int32s per cell
|
|
657
|
+
const srcCells = src.cells;
|
|
658
|
+
const dstCells = dst.cells;
|
|
659
|
+
const srcNoSel = src.noSelect;
|
|
660
|
+
const dstNoSel = dst.noSelect;
|
|
661
|
+
// softWrap is per-row — copy the row range regardless of stride/width.
|
|
662
|
+
// Partial-width blits still carry the row's wrap provenance since the
|
|
663
|
+
// blitted content (a cached ink-text node) is what set the bit.
|
|
664
|
+
dst.softWrap.set(src.softWrap.subarray(regionY, maxY), regionY);
|
|
665
|
+
// Fast path: contiguous memory when copying full-width rows at same stride
|
|
666
|
+
if (regionX === 0 && maxX === src.width && src.width === dst.width) {
|
|
667
|
+
const srcStart = regionY * srcStride;
|
|
668
|
+
const totalBytes = (maxY - regionY) * srcStride;
|
|
669
|
+
dstCells.set(srcCells.subarray(srcStart, srcStart + totalBytes), srcStart);
|
|
670
|
+
// noSelect is 1 byte/cell vs cells' 8 — same region, different scale
|
|
671
|
+
const nsStart = regionY * src.width;
|
|
672
|
+
const nsLen = (maxY - regionY) * src.width;
|
|
673
|
+
dstNoSel.set(srcNoSel.subarray(nsStart, nsStart + nsLen), nsStart);
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
// Per-row copy for partial-width or mismatched-stride regions
|
|
677
|
+
let srcRowCI = regionY * srcStride + (regionX << 1);
|
|
678
|
+
let dstRowCI = regionY * dstStride + (regionX << 1);
|
|
679
|
+
let srcRowNS = regionY * src.width + regionX;
|
|
680
|
+
let dstRowNS = regionY * dst.width + regionX;
|
|
681
|
+
for (let y = regionY; y < maxY; y++) {
|
|
682
|
+
dstCells.set(srcCells.subarray(srcRowCI, srcRowCI + rowBytes), dstRowCI);
|
|
683
|
+
dstNoSel.set(srcNoSel.subarray(srcRowNS, srcRowNS + rowLen), dstRowNS);
|
|
684
|
+
srcRowCI += srcStride;
|
|
685
|
+
dstRowCI += dstStride;
|
|
686
|
+
srcRowNS += src.width;
|
|
687
|
+
dstRowNS += dst.width;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
// Compute damage once for the whole region
|
|
691
|
+
const regionRect = {
|
|
692
|
+
x: regionX,
|
|
693
|
+
y: regionY,
|
|
694
|
+
width: rowLen,
|
|
695
|
+
height: maxY - regionY,
|
|
696
|
+
};
|
|
697
|
+
if (dst.damage) {
|
|
698
|
+
dst.damage = unionRect(dst.damage, regionRect);
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
dst.damage = regionRect;
|
|
702
|
+
}
|
|
703
|
+
// Handle wide char at right edge: spacer might be outside blit region
|
|
704
|
+
// but still within dst bounds. Per-row check only at the boundary column.
|
|
705
|
+
if (maxX < dst.width) {
|
|
706
|
+
let srcLastCI = (regionY * src.width + (maxX - 1)) << 1;
|
|
707
|
+
let dstSpacerCI = (regionY * dst.width + maxX) << 1;
|
|
708
|
+
let wroteSpacerOutsideRegion = false;
|
|
709
|
+
for (let y = regionY; y < maxY; y++) {
|
|
710
|
+
if ((srcCells[srcLastCI + 1] & WIDTH_MASK) === 1 /* CellWidth.Wide */) {
|
|
711
|
+
dstCells[dstSpacerCI] = SPACER_CHAR_INDEX;
|
|
712
|
+
dstCells[dstSpacerCI + 1] = packWord1(dst.emptyStyleId, 0, 2 /* CellWidth.SpacerTail */);
|
|
713
|
+
wroteSpacerOutsideRegion = true;
|
|
714
|
+
}
|
|
715
|
+
srcLastCI += srcStride;
|
|
716
|
+
dstSpacerCI += dstStride;
|
|
717
|
+
}
|
|
718
|
+
// Expand damage to include SpacerTail column if we wrote any
|
|
719
|
+
if (wroteSpacerOutsideRegion && dst.damage) {
|
|
720
|
+
const rightEdge = dst.damage.x + dst.damage.width;
|
|
721
|
+
if (rightEdge === maxX) {
|
|
722
|
+
dst.damage = { ...dst.damage, width: dst.damage.width + 1 };
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Bulk-clear a rectangular region of the screen.
|
|
729
|
+
* Uses BigInt64Array.fill() for fast row clears.
|
|
730
|
+
* Handles wide character boundary cleanup at region edges.
|
|
731
|
+
*/
|
|
732
|
+
export function clearRegion(screen, regionX, regionY, regionWidth, regionHeight) {
|
|
733
|
+
const startX = Math.max(0, regionX);
|
|
734
|
+
const startY = Math.max(0, regionY);
|
|
735
|
+
const maxX = Math.min(regionX + regionWidth, screen.width);
|
|
736
|
+
const maxY = Math.min(regionY + regionHeight, screen.height);
|
|
737
|
+
if (startX >= maxX || startY >= maxY)
|
|
738
|
+
return;
|
|
739
|
+
const cells = screen.cells;
|
|
740
|
+
const cells64 = screen.cells64;
|
|
741
|
+
const screenWidth = screen.width;
|
|
742
|
+
const rowBase = startY * screenWidth;
|
|
743
|
+
let damageMinX = startX;
|
|
744
|
+
let damageMaxX = maxX;
|
|
745
|
+
// EMPTY_CELL_VALUE (0n) matches the zero-initialized state:
|
|
746
|
+
// word0=EMPTY_CHAR_INDEX(0), word1=packWord1(0,0,0)=0
|
|
747
|
+
if (startX === 0 && maxX === screenWidth) {
|
|
748
|
+
// Full-width: single fill, no boundary checks needed
|
|
749
|
+
cells64.fill(EMPTY_CELL_VALUE, rowBase, rowBase + (maxY - startY) * screenWidth);
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
// Partial-width: single loop handles boundary cleanup and fill per row.
|
|
753
|
+
const stride = screenWidth << 1; // 2 Int32s per cell
|
|
754
|
+
const rowLen = maxX - startX;
|
|
755
|
+
const checkLeft = startX > 0;
|
|
756
|
+
const checkRight = maxX < screenWidth;
|
|
757
|
+
let leftEdge = (rowBase + startX) << 1;
|
|
758
|
+
let rightEdge = (rowBase + maxX - 1) << 1;
|
|
759
|
+
let fillStart = rowBase + startX;
|
|
760
|
+
for (let y = startY; y < maxY; y++) {
|
|
761
|
+
// Left boundary: if cell at startX is a SpacerTail, the Wide char
|
|
762
|
+
// at startX-1 (outside the region) will be orphaned. Clear it.
|
|
763
|
+
if (checkLeft) {
|
|
764
|
+
// leftEdge points to word0 of cell at startX; +1 is its word1
|
|
765
|
+
if ((cells[leftEdge + 1] & WIDTH_MASK) === 2 /* CellWidth.SpacerTail */) {
|
|
766
|
+
// word1 of cell at startX-1 is leftEdge-1; word0 is leftEdge-2
|
|
767
|
+
const prevW1 = leftEdge - 1;
|
|
768
|
+
if ((cells[prevW1] & WIDTH_MASK) === 1 /* CellWidth.Wide */) {
|
|
769
|
+
cells[prevW1 - 1] = EMPTY_CHAR_INDEX;
|
|
770
|
+
cells[prevW1] = packWord1(screen.emptyStyleId, 0, 0 /* CellWidth.Narrow */);
|
|
771
|
+
damageMinX = startX - 1;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
// Right boundary: if cell at maxX-1 is Wide, its SpacerTail at maxX
|
|
776
|
+
// (outside the region) will be orphaned. Clear it.
|
|
777
|
+
if (checkRight) {
|
|
778
|
+
// rightEdge points to word0 of cell at maxX-1; +1 is its word1
|
|
779
|
+
if ((cells[rightEdge + 1] & WIDTH_MASK) === 1 /* CellWidth.Wide */) {
|
|
780
|
+
// word1 of cell at maxX is rightEdge+3 (+2 to next word0, +1 to word1)
|
|
781
|
+
const nextW1 = rightEdge + 3;
|
|
782
|
+
if ((cells[nextW1] & WIDTH_MASK) === 2 /* CellWidth.SpacerTail */) {
|
|
783
|
+
cells[nextW1 - 1] = EMPTY_CHAR_INDEX;
|
|
784
|
+
cells[nextW1] = packWord1(screen.emptyStyleId, 0, 0 /* CellWidth.Narrow */);
|
|
785
|
+
damageMaxX = maxX + 1;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
cells64.fill(EMPTY_CELL_VALUE, fillStart, fillStart + rowLen);
|
|
790
|
+
leftEdge += stride;
|
|
791
|
+
rightEdge += stride;
|
|
792
|
+
fillStart += screenWidth;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
// Update damage once for the whole region
|
|
796
|
+
const regionRect = {
|
|
797
|
+
x: damageMinX,
|
|
798
|
+
y: startY,
|
|
799
|
+
width: damageMaxX - damageMinX,
|
|
800
|
+
height: maxY - startY,
|
|
801
|
+
};
|
|
802
|
+
if (screen.damage) {
|
|
803
|
+
screen.damage = unionRect(screen.damage, regionRect);
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
screen.damage = regionRect;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Shift full-width rows within [top, bottom] (inclusive, 0-indexed) by n.
|
|
811
|
+
* n > 0 shifts UP (simulating CSI n S); n < 0 shifts DOWN (CSI n T).
|
|
812
|
+
* Vacated rows are cleared. Does NOT update damage. Both cells and the
|
|
813
|
+
* noSelect bitmap are shifted so text-selection markers stay aligned when
|
|
814
|
+
* this is applied to next.screen during scroll fast path.
|
|
815
|
+
*/
|
|
816
|
+
export function shiftRows(screen, top, bottom, n) {
|
|
817
|
+
if (n === 0 || top < 0 || bottom >= screen.height || top > bottom)
|
|
818
|
+
return;
|
|
819
|
+
const w = screen.width;
|
|
820
|
+
const cells64 = screen.cells64;
|
|
821
|
+
const noSel = screen.noSelect;
|
|
822
|
+
const sw = screen.softWrap;
|
|
823
|
+
const absN = Math.abs(n);
|
|
824
|
+
if (absN > bottom - top) {
|
|
825
|
+
cells64.fill(EMPTY_CELL_VALUE, top * w, (bottom + 1) * w);
|
|
826
|
+
noSel.fill(0, top * w, (bottom + 1) * w);
|
|
827
|
+
sw.fill(0, top, bottom + 1);
|
|
828
|
+
return;
|
|
829
|
+
}
|
|
830
|
+
if (n > 0) {
|
|
831
|
+
// SU: row top+n..bottom → top..bottom-n; clear bottom-n+1..bottom
|
|
832
|
+
cells64.copyWithin(top * w, (top + n) * w, (bottom + 1) * w);
|
|
833
|
+
noSel.copyWithin(top * w, (top + n) * w, (bottom + 1) * w);
|
|
834
|
+
sw.copyWithin(top, top + n, bottom + 1);
|
|
835
|
+
cells64.fill(EMPTY_CELL_VALUE, (bottom - n + 1) * w, (bottom + 1) * w);
|
|
836
|
+
noSel.fill(0, (bottom - n + 1) * w, (bottom + 1) * w);
|
|
837
|
+
sw.fill(0, bottom - n + 1, bottom + 1);
|
|
838
|
+
}
|
|
839
|
+
else {
|
|
840
|
+
// SD: row top..bottom+n → top-n..bottom; clear top..top-n-1
|
|
841
|
+
cells64.copyWithin((top - n) * w, top * w, (bottom + n + 1) * w);
|
|
842
|
+
noSel.copyWithin((top - n) * w, top * w, (bottom + n + 1) * w);
|
|
843
|
+
sw.copyWithin(top - n, top, bottom + n + 1);
|
|
844
|
+
cells64.fill(EMPTY_CELL_VALUE, top * w, (top - n) * w);
|
|
845
|
+
noSel.fill(0, top * w, (top - n) * w);
|
|
846
|
+
sw.fill(0, top, top - n);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
// Matches OSC 8 ; ; URI BEL
|
|
850
|
+
const OSC8_REGEX = new RegExp(`^${ESC}\\]8${SEP}${SEP}([^${BEL}]*)${BEL}$`);
|
|
851
|
+
// OSC8 prefix: ESC ] 8 ; — cheap check to skip regex for the vast majority of styles (SGR = ESC [)
|
|
852
|
+
export const OSC8_PREFIX = `${ESC}]8${SEP}`;
|
|
853
|
+
export function extractHyperlinkFromStyles(styles) {
|
|
854
|
+
for (const style of styles) {
|
|
855
|
+
const code = style.code;
|
|
856
|
+
if (code.length < 5 || !code.startsWith(OSC8_PREFIX))
|
|
857
|
+
continue;
|
|
858
|
+
const match = code.match(OSC8_REGEX);
|
|
859
|
+
if (match) {
|
|
860
|
+
return match[1] || null;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
export function filterOutHyperlinkStyles(styles) {
|
|
866
|
+
return styles.filter(style => !style.code.startsWith(OSC8_PREFIX) || !OSC8_REGEX.test(style.code));
|
|
867
|
+
}
|
|
868
|
+
// ---
|
|
869
|
+
/**
|
|
870
|
+
* Returns an array of all changes between two screens. Used by tests.
|
|
871
|
+
* Production code should use diffEach() to avoid allocations.
|
|
872
|
+
*/
|
|
873
|
+
export function diff(prev, next) {
|
|
874
|
+
const output = [];
|
|
875
|
+
diffEach(prev, next, (x, y, removed, added) => {
|
|
876
|
+
// Copy cells since diffEach reuses the objects
|
|
877
|
+
output.push([
|
|
878
|
+
{ x, y },
|
|
879
|
+
removed ? { ...removed } : undefined,
|
|
880
|
+
added ? { ...added } : undefined,
|
|
881
|
+
]);
|
|
882
|
+
});
|
|
883
|
+
return output;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Like diff(), but calls a callback for each change instead of building an array.
|
|
887
|
+
* Reuses two Cell objects to avoid per-change allocations. The callback must not
|
|
888
|
+
* retain references to the Cell objects — their contents are overwritten each call.
|
|
889
|
+
*
|
|
890
|
+
* Returns true if the callback ever returned true (early exit signal).
|
|
891
|
+
*/
|
|
892
|
+
export function diffEach(prev, next, cb) {
|
|
893
|
+
const prevWidth = prev.width;
|
|
894
|
+
const nextWidth = next.width;
|
|
895
|
+
const prevHeight = prev.height;
|
|
896
|
+
const nextHeight = next.height;
|
|
897
|
+
let region;
|
|
898
|
+
if (prevWidth === 0 && prevHeight === 0) {
|
|
899
|
+
region = { x: 0, y: 0, width: nextWidth, height: nextHeight };
|
|
900
|
+
}
|
|
901
|
+
else if (next.damage) {
|
|
902
|
+
region = next.damage;
|
|
903
|
+
if (prev.damage) {
|
|
904
|
+
region = unionRect(region, prev.damage);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
else if (prev.damage) {
|
|
908
|
+
region = prev.damage;
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
region = { x: 0, y: 0, width: 0, height: 0 };
|
|
912
|
+
}
|
|
913
|
+
if (prevHeight > nextHeight) {
|
|
914
|
+
region = unionRect(region, {
|
|
915
|
+
x: 0,
|
|
916
|
+
y: nextHeight,
|
|
917
|
+
width: prevWidth,
|
|
918
|
+
height: prevHeight - nextHeight,
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
if (prevWidth > nextWidth) {
|
|
922
|
+
region = unionRect(region, {
|
|
923
|
+
x: nextWidth,
|
|
924
|
+
y: 0,
|
|
925
|
+
width: prevWidth - nextWidth,
|
|
926
|
+
height: prevHeight,
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
const maxHeight = Math.max(prevHeight, nextHeight);
|
|
930
|
+
const maxWidth = Math.max(prevWidth, nextWidth);
|
|
931
|
+
const endY = Math.min(region.y + region.height, maxHeight);
|
|
932
|
+
const endX = Math.min(region.x + region.width, maxWidth);
|
|
933
|
+
if (prevWidth === nextWidth) {
|
|
934
|
+
return diffSameWidth(prev, next, region.x, endX, region.y, endY, cb);
|
|
935
|
+
}
|
|
936
|
+
return diffDifferentWidth(prev, next, region.x, endX, region.y, endY, cb);
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Scan for the next cell that differs between two Int32Arrays.
|
|
940
|
+
* Returns the number of matching cells before the first difference,
|
|
941
|
+
* or `count` if all cells match. Tiny and pure for JIT inlining.
|
|
942
|
+
*/
|
|
943
|
+
function findNextDiff(a, b, w0, count) {
|
|
944
|
+
for (let i = 0; i < count; i++, w0 += 2) {
|
|
945
|
+
const w1 = w0 | 1;
|
|
946
|
+
if (a[w0] !== b[w0] || a[w1] !== b[w1])
|
|
947
|
+
return i;
|
|
948
|
+
}
|
|
949
|
+
return count;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Diff one row where both screens are in bounds.
|
|
953
|
+
* Scans for differences with findNextDiff, unpacks and calls cb for each.
|
|
954
|
+
*/
|
|
955
|
+
function diffRowBoth(prevCells, nextCells, prev, next, ci, y, startX, endX, prevCell, nextCell, cb) {
|
|
956
|
+
let x = startX;
|
|
957
|
+
while (x < endX) {
|
|
958
|
+
const skip = findNextDiff(prevCells, nextCells, ci, endX - x);
|
|
959
|
+
x += skip;
|
|
960
|
+
ci += skip << 1;
|
|
961
|
+
if (x >= endX)
|
|
962
|
+
break;
|
|
963
|
+
cellAtCI(prev, ci, prevCell);
|
|
964
|
+
cellAtCI(next, ci, nextCell);
|
|
965
|
+
if (cb(x, y, prevCell, nextCell))
|
|
966
|
+
return true;
|
|
967
|
+
x++;
|
|
968
|
+
ci += 2;
|
|
969
|
+
}
|
|
970
|
+
return false;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Emit removals for a row that only exists in prev (height shrank).
|
|
974
|
+
* Cannot skip empty cells — the terminal still has content from the
|
|
975
|
+
* previous frame that needs to be cleared.
|
|
976
|
+
*/
|
|
977
|
+
function diffRowRemoved(prev, ci, y, startX, endX, prevCell, cb) {
|
|
978
|
+
for (let x = startX; x < endX; x++, ci += 2) {
|
|
979
|
+
cellAtCI(prev, ci, prevCell);
|
|
980
|
+
if (cb(x, y, prevCell, undefined))
|
|
981
|
+
return true;
|
|
982
|
+
}
|
|
983
|
+
return false;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Emit additions for a row that only exists in next (height grew).
|
|
987
|
+
* Skips empty/unwritten cells.
|
|
988
|
+
*/
|
|
989
|
+
function diffRowAdded(nextCells, next, ci, y, startX, endX, nextCell, cb) {
|
|
990
|
+
for (let x = startX; x < endX; x++, ci += 2) {
|
|
991
|
+
if (nextCells[ci] === 0 && nextCells[ci | 1] === 0)
|
|
992
|
+
continue;
|
|
993
|
+
cellAtCI(next, ci, nextCell);
|
|
994
|
+
if (cb(x, y, undefined, nextCell))
|
|
995
|
+
return true;
|
|
996
|
+
}
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Diff two screens with identical width.
|
|
1001
|
+
* Dispatches each row to a small, JIT-friendly function.
|
|
1002
|
+
*/
|
|
1003
|
+
function diffSameWidth(prev, next, startX, endX, startY, endY, cb) {
|
|
1004
|
+
const prevCells = prev.cells;
|
|
1005
|
+
const nextCells = next.cells;
|
|
1006
|
+
const width = prev.width;
|
|
1007
|
+
const prevHeight = prev.height;
|
|
1008
|
+
const nextHeight = next.height;
|
|
1009
|
+
const stride = width << 1;
|
|
1010
|
+
const prevCell = {
|
|
1011
|
+
char: ' ',
|
|
1012
|
+
styleId: 0,
|
|
1013
|
+
width: 0 /* CellWidth.Narrow */,
|
|
1014
|
+
hyperlink: undefined,
|
|
1015
|
+
};
|
|
1016
|
+
const nextCell = {
|
|
1017
|
+
char: ' ',
|
|
1018
|
+
styleId: 0,
|
|
1019
|
+
width: 0 /* CellWidth.Narrow */,
|
|
1020
|
+
hyperlink: undefined,
|
|
1021
|
+
};
|
|
1022
|
+
const rowEndX = Math.min(endX, width);
|
|
1023
|
+
let rowCI = (startY * width + startX) << 1;
|
|
1024
|
+
for (let y = startY; y < endY; y++) {
|
|
1025
|
+
const prevIn = y < prevHeight;
|
|
1026
|
+
const nextIn = y < nextHeight;
|
|
1027
|
+
if (prevIn && nextIn) {
|
|
1028
|
+
if (diffRowBoth(prevCells, nextCells, prev, next, rowCI, y, startX, rowEndX, prevCell, nextCell, cb))
|
|
1029
|
+
return true;
|
|
1030
|
+
}
|
|
1031
|
+
else if (prevIn) {
|
|
1032
|
+
if (diffRowRemoved(prev, rowCI, y, startX, rowEndX, prevCell, cb))
|
|
1033
|
+
return true;
|
|
1034
|
+
}
|
|
1035
|
+
else if (nextIn) {
|
|
1036
|
+
if (diffRowAdded(nextCells, next, rowCI, y, startX, rowEndX, nextCell, cb))
|
|
1037
|
+
return true;
|
|
1038
|
+
}
|
|
1039
|
+
rowCI += stride;
|
|
1040
|
+
}
|
|
1041
|
+
return false;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Fallback: diff two screens with different widths (resize).
|
|
1045
|
+
* Separate indices for prev and next cells arrays.
|
|
1046
|
+
*/
|
|
1047
|
+
function diffDifferentWidth(prev, next, startX, endX, startY, endY, cb) {
|
|
1048
|
+
const prevWidth = prev.width;
|
|
1049
|
+
const nextWidth = next.width;
|
|
1050
|
+
const prevCells = prev.cells;
|
|
1051
|
+
const nextCells = next.cells;
|
|
1052
|
+
const prevCell = {
|
|
1053
|
+
char: ' ',
|
|
1054
|
+
styleId: 0,
|
|
1055
|
+
width: 0 /* CellWidth.Narrow */,
|
|
1056
|
+
hyperlink: undefined,
|
|
1057
|
+
};
|
|
1058
|
+
const nextCell = {
|
|
1059
|
+
char: ' ',
|
|
1060
|
+
styleId: 0,
|
|
1061
|
+
width: 0 /* CellWidth.Narrow */,
|
|
1062
|
+
hyperlink: undefined,
|
|
1063
|
+
};
|
|
1064
|
+
const prevStride = prevWidth << 1;
|
|
1065
|
+
const nextStride = nextWidth << 1;
|
|
1066
|
+
let prevRowCI = (startY * prevWidth + startX) << 1;
|
|
1067
|
+
let nextRowCI = (startY * nextWidth + startX) << 1;
|
|
1068
|
+
for (let y = startY; y < endY; y++) {
|
|
1069
|
+
const prevIn = y < prev.height;
|
|
1070
|
+
const nextIn = y < next.height;
|
|
1071
|
+
const prevEndX = prevIn ? Math.min(endX, prevWidth) : startX;
|
|
1072
|
+
const nextEndX = nextIn ? Math.min(endX, nextWidth) : startX;
|
|
1073
|
+
const bothEndX = Math.min(prevEndX, nextEndX);
|
|
1074
|
+
let prevCI = prevRowCI;
|
|
1075
|
+
let nextCI = nextRowCI;
|
|
1076
|
+
for (let x = startX; x < bothEndX; x++) {
|
|
1077
|
+
if (prevCells[prevCI] === nextCells[nextCI] &&
|
|
1078
|
+
prevCells[prevCI + 1] === nextCells[nextCI + 1]) {
|
|
1079
|
+
prevCI += 2;
|
|
1080
|
+
nextCI += 2;
|
|
1081
|
+
continue;
|
|
1082
|
+
}
|
|
1083
|
+
cellAtCI(prev, prevCI, prevCell);
|
|
1084
|
+
cellAtCI(next, nextCI, nextCell);
|
|
1085
|
+
prevCI += 2;
|
|
1086
|
+
nextCI += 2;
|
|
1087
|
+
if (cb(x, y, prevCell, nextCell))
|
|
1088
|
+
return true;
|
|
1089
|
+
}
|
|
1090
|
+
if (prevEndX > bothEndX) {
|
|
1091
|
+
prevCI = prevRowCI + ((bothEndX - startX) << 1);
|
|
1092
|
+
for (let x = bothEndX; x < prevEndX; x++) {
|
|
1093
|
+
cellAtCI(prev, prevCI, prevCell);
|
|
1094
|
+
prevCI += 2;
|
|
1095
|
+
if (cb(x, y, prevCell, undefined))
|
|
1096
|
+
return true;
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
if (nextEndX > bothEndX) {
|
|
1100
|
+
nextCI = nextRowCI + ((bothEndX - startX) << 1);
|
|
1101
|
+
for (let x = bothEndX; x < nextEndX; x++) {
|
|
1102
|
+
if (nextCells[nextCI] === 0 && nextCells[nextCI | 1] === 0) {
|
|
1103
|
+
nextCI += 2;
|
|
1104
|
+
continue;
|
|
1105
|
+
}
|
|
1106
|
+
cellAtCI(next, nextCI, nextCell);
|
|
1107
|
+
nextCI += 2;
|
|
1108
|
+
if (cb(x, y, undefined, nextCell))
|
|
1109
|
+
return true;
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
prevRowCI += prevStride;
|
|
1113
|
+
nextRowCI += nextStride;
|
|
1114
|
+
}
|
|
1115
|
+
return false;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Mark a rectangular region as noSelect (exclude from text selection).
|
|
1119
|
+
* Clamps to screen bounds. Called from output.ts when a <NoSelect> box
|
|
1120
|
+
* renders. No damage tracking — noSelect doesn't affect terminal output,
|
|
1121
|
+
* only getSelectedText/applySelectionOverlay which read it directly.
|
|
1122
|
+
*/
|
|
1123
|
+
export function markNoSelectRegion(screen, x, y, width, height) {
|
|
1124
|
+
const maxX = Math.min(x + width, screen.width);
|
|
1125
|
+
const maxY = Math.min(y + height, screen.height);
|
|
1126
|
+
const noSel = screen.noSelect;
|
|
1127
|
+
const stride = screen.width;
|
|
1128
|
+
for (let row = Math.max(0, y); row < maxY; row++) {
|
|
1129
|
+
const rowStart = row * stride;
|
|
1130
|
+
noSel.fill(1, rowStart + Math.max(0, x), rowStart + maxX);
|
|
1131
|
+
}
|
|
1132
|
+
}
|