lcclaude 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +21 -0
- package/README.en.md +333 -0
- package/README.md +333 -0
- package/bin/lcclaude.js +30 -0
- package/dist/preload.js +15 -0
- package/dist/runtime/bun-bundle-shim.js +10 -0
- package/dist/runtime/bun-wrap-shim.js +63 -0
- package/dist/src/QueryEngine.js +804 -0
- package/dist/src/Task.js +40 -0
- package/dist/src/Tool.js +33 -0
- package/dist/src/assistant/sessionHistory.js +39 -0
- package/dist/src/bootstrap/state.js +985 -0
- package/dist/src/bridge/bridgeApi.js +254 -0
- package/dist/src/bridge/bridgeConfig.js +14 -0
- package/dist/src/bridge/bridgeDebug.js +64 -0
- package/dist/src/bridge/bridgeEnabled.js +55 -0
- package/dist/src/bridge/bridgeMain.js +1547 -0
- package/dist/src/bridge/bridgeMessaging.js +249 -0
- package/dist/src/bridge/bridgePermissionCallbacks.js +7 -0
- package/dist/src/bridge/bridgePointer.js +105 -0
- package/dist/src/bridge/bridgeStatusUtil.js +81 -0
- package/dist/src/bridge/bridgeUI.js +375 -0
- package/dist/src/bridge/capacityWake.js +26 -0
- package/dist/src/bridge/codeSessionApi.js +78 -0
- package/dist/src/bridge/createSession.js +227 -0
- package/dist/src/bridge/debugUtils.js +80 -0
- package/dist/src/bridge/envLessBridgeConfig.js +61 -0
- package/dist/src/bridge/flushGate.js +32 -0
- package/dist/src/bridge/inboundAttachments.js +106 -0
- package/dist/src/bridge/inboundMessages.js +38 -0
- package/dist/src/bridge/initReplBridge.js +276 -0
- package/dist/src/bridge/jwtUtils.js +131 -0
- package/dist/src/bridge/pollConfig.js +28 -0
- package/dist/src/bridge/pollConfigDefaults.js +15 -0
- package/dist/src/bridge/remoteBridgeCore.js +511 -0
- package/dist/src/bridge/replBridge.js +1098 -0
- package/dist/src/bridge/replBridgeHandle.js +14 -0
- package/dist/src/bridge/replBridgeTransport.js +147 -0
- package/dist/src/bridge/sessionIdCompat.js +16 -0
- package/dist/src/bridge/sessionRunner.js +349 -0
- package/dist/src/bridge/trustedDevice.js +113 -0
- package/dist/src/bridge/types.js +6 -0
- package/dist/src/bridge/workSecret.js +51 -0
- package/dist/src/buddy/CompanionSprite.js +435 -0
- package/dist/src/buddy/companion.js +104 -0
- package/dist/src/buddy/prompt.js +31 -0
- package/dist/src/buddy/sprites.js +500 -0
- package/dist/src/buddy/types.js +85 -0
- package/dist/src/buddy/useBuddyNotification.js +93 -0
- package/dist/src/cli/exit.js +13 -0
- package/dist/src/cli/handlers/agents.js +55 -0
- package/dist/src/cli/handlers/auth.js +255 -0
- package/dist/src/cli/handlers/autoMode.js +117 -0
- package/dist/src/cli/handlers/mcp.js +304 -0
- package/dist/src/cli/handlers/plugins.js +538 -0
- package/dist/src/cli/handlers/util.js +119 -0
- package/dist/src/cli/ndjsonSafeStringify.js +8 -0
- package/dist/src/cli/print.js +3112 -0
- package/dist/src/cli/remoteIO.js +161 -0
- package/dist/src/cli/structuredIO.js +489 -0
- package/dist/src/cli/transports/HybridTransport.js +145 -0
- package/dist/src/cli/transports/SSETransport.js +403 -0
- package/dist/src/cli/transports/SerialBatchEventUploader.js +154 -0
- package/dist/src/cli/transports/WebSocketTransport.js +497 -0
- package/dist/src/cli/transports/WorkerStateUploader.js +69 -0
- package/dist/src/cli/transports/ccrClient.js +522 -0
- package/dist/src/cli/transports/transportUtils.js +25 -0
- package/dist/src/cli/update.js +361 -0
- package/dist/src/commands/add-dir/add-dir.js +140 -0
- package/dist/src/commands/add-dir/index.js +8 -0
- package/dist/src/commands/add-dir/validation.js +67 -0
- package/dist/src/commands/advisor.js +96 -0
- package/dist/src/commands/agents/agents.js +12 -0
- package/dist/src/commands/agents/index.js +7 -0
- package/dist/src/commands/ant-trace/index.js +1 -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 +168 -0
- package/dist/src/commands/branch/index.js +9 -0
- package/dist/src/commands/break-cache/index.js +1 -0
- package/dist/src/commands/bridge/bridge.js +519 -0
- package/dist/src/commands/bridge/index.js +21 -0
- package/dist/src/commands/bridge-kick.js +145 -0
- package/dist/src/commands/brief.js +66 -0
- package/dist/src/commands/btw/btw.js +281 -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 +394 -0
- package/dist/src/commands/chrome/index.js +10 -0
- package/dist/src/commands/clear/caches.js +69 -0
- package/dist/src/commands/clear/clear.js +5 -0
- package/dist/src/commands/clear/conversation.js +156 -0
- package/dist/src/commands/clear/index.js +9 -0
- package/dist/src/commands/color/color.js +57 -0
- package/dist/src/commands/color/index.js +9 -0
- package/dist/src/commands/commit-push-pr.js +145 -0
- package/dist/src/commands/commit.js +83 -0
- package/dist/src/commands/compact/compact.js +161 -0
- package/dist/src/commands/compact/index.js +11 -0
- package/dist/src/commands/config/config.js +9 -0
- package/dist/src/commands/config/index.js +8 -0
- package/dist/src/commands/context/context-noninteractive.js +256 -0
- package/dist/src/commands/context/context.js +33 -0
- package/dist/src/commands/context/index.js +21 -0
- package/dist/src/commands/copy/copy.js +397 -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 +15 -0
- package/dist/src/commands/createMovedToPluginCommand.js +40 -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 +7 -0
- package/dist/src/commands/desktop/index.js +22 -0
- package/dist/src/commands/diff/diff.js +10 -0
- package/dist/src/commands/diff/index.js +6 -0
- package/dist/src/commands/doctor/doctor.js +7 -0
- package/dist/src/commands/doctor/index.js +9 -0
- package/dist/src/commands/effort/effort.js +181 -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 +25 -0
- package/dist/src/commands/exit/index.js +9 -0
- package/dist/src/commands/export/export.js +79 -0
- package/dist/src/commands/export/index.js +8 -0
- package/dist/src/commands/extra-usage/extra-usage-core.js +85 -0
- package/dist/src/commands/extra-usage/extra-usage-noninteractive.js +11 -0
- package/dist/src/commands/extra-usage/extra-usage.js +17 -0
- package/dist/src/commands/extra-usage/index.js +27 -0
- package/dist/src/commands/fast/fast.js +345 -0
- package/dist/src/commands/fast/index.js +23 -0
- package/dist/src/commands/feedback/feedback.js +15 -0
- package/dist/src/commands/feedback/index.js +13 -0
- package/dist/src/commands/files/files.js +13 -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 +15 -0
- package/dist/src/commands/heapdump/index.js +9 -0
- package/dist/src/commands/help/help.js +12 -0
- package/dist/src/commands/help/index.js +7 -0
- package/dist/src/commands/hooks/hooks.js +14 -0
- package/dist/src/commands/hooks/index.js +8 -0
- package/dist/src/commands/ide/ide.js +702 -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 +240 -0
- package/dist/src/commands/insights.js +2212 -0
- package/dist/src/commands/install-github-app/ApiKeyStep.js +290 -0
- package/dist/src/commands/install-github-app/CheckExistingSecretStep.js +265 -0
- package/dist/src/commands/install-github-app/CheckGitHubStep.js +16 -0
- package/dist/src/commands/install-github-app/ChooseRepoStep.js +282 -0
- package/dist/src/commands/install-github-app/CreatingStep.js +87 -0
- package/dist/src/commands/install-github-app/ErrorStep.js +157 -0
- package/dist/src/commands/install-github-app/ExistingWorkflowStep.js +164 -0
- package/dist/src/commands/install-github-app/InstallAppStep.js +166 -0
- package/dist/src/commands/install-github-app/OAuthFlowStep.js +335 -0
- package/dist/src/commands/install-github-app/SuccessStep.js +173 -0
- package/dist/src/commands/install-github-app/WarningsStep.js +140 -0
- package/dist/src/commands/install-github-app/index.js +10 -0
- package/dist/src/commands/install-github-app/install-github-app.js +612 -0
- package/dist/src/commands/install-github-app/setupGitHubActions.js +223 -0
- package/dist/src/commands/install-slack-app/index.js +9 -0
- package/dist/src/commands/install-slack-app/install-slack-app.js +23 -0
- package/dist/src/commands/install.js +348 -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 +43 -0
- package/dist/src/commands/login/index.js +9 -0
- package/dist/src/commands/login/login.js +105 -0
- package/dist/src/commands/logout/index.js +8 -0
- package/dist/src/commands/logout/logout.js +68 -0
- package/dist/src/commands/mcp/addCommand.js +157 -0
- package/dist/src/commands/mcp/index.js +9 -0
- package/dist/src/commands/mcp/mcp.js +85 -0
- package/dist/src/commands/mcp/xaaIdpCommand.js +135 -0
- package/dist/src/commands/memory/index.js +7 -0
- package/dist/src/commands/memory/memory.js +95 -0
- package/dist/src/commands/mobile/index.js +8 -0
- package/dist/src/commands/mobile/mobile.js +324 -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 +289 -0
- package/dist/src/commands/oauth-refresh/index.js +1 -0
- package/dist/src/commands/onboarding/index.js +1 -0
- package/dist/src/commands/output-style/index.js +8 -0
- package/dist/src/commands/output-style/output-style.js +5 -0
- package/dist/src/commands/passes/index.js +20 -0
- package/dist/src/commands/passes/passes.js +23 -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 +11 -0
- package/dist/src/commands/plan/index.js +8 -0
- package/dist/src/commands/plan/plan.js +151 -0
- package/dist/src/commands/plugin/AddMarketplace.js +202 -0
- package/dist/src/commands/plugin/BrowseMarketplace.js +918 -0
- package/dist/src/commands/plugin/DiscoverPlugins.js +935 -0
- package/dist/src/commands/plugin/ManageMarketplaces.js +1018 -0
- package/dist/src/commands/plugin/ManagePlugins.js +2230 -0
- package/dist/src/commands/plugin/PluginErrors.js +118 -0
- package/dist/src/commands/plugin/PluginOptionsDialog.js +396 -0
- package/dist/src/commands/plugin/PluginOptionsFlow.js +80 -0
- package/dist/src/commands/plugin/PluginSettings.js +1313 -0
- package/dist/src/commands/plugin/PluginTrustWarning.js +50 -0
- package/dist/src/commands/plugin/UnifiedInstalledCell.js +749 -0
- package/dist/src/commands/plugin/ValidatePlugin.js +113 -0
- package/dist/src/commands/plugin/index.js +9 -0
- package/dist/src/commands/plugin/parseArgs.js +61 -0
- package/dist/src/commands/plugin/plugin.js +8 -0
- package/dist/src/commands/plugin/pluginDetailsHelpers.js +114 -0
- package/dist/src/commands/plugin/usePagination.js +75 -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 +58 -0
- package/dist/src/commands/rate-limit-options/index.js +15 -0
- package/dist/src/commands/rate-limit-options/rate-limit-options.js +211 -0
- package/dist/src/commands/release-notes/index.js +8 -0
- package/dist/src/commands/release-notes/release-notes.js +38 -0
- package/dist/src/commands/reload-plugins/index.js +8 -0
- package/dist/src/commands/reload-plugins/reload-plugins.js +27 -0
- package/dist/src/commands/remote-env/index.js +12 -0
- package/dist/src/commands/remote-env/remote-env.js +7 -0
- package/dist/src/commands/remote-setup/api.js +121 -0
- package/dist/src/commands/remote-setup/index.js +14 -0
- package/dist/src/commands/remote-setup/remote-setup.js +173 -0
- package/dist/src/commands/rename/generateSessionName.js +51 -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 +281 -0
- package/dist/src/commands/review/UltrareviewOverageDialog.js +112 -0
- package/dist/src/commands/review/reviewRemote.js +193 -0
- package/dist/src/commands/review/ultrareviewCommand.js +50 -0
- package/dist/src/commands/review/ultrareviewEnabled.js +5 -0
- package/dist/src/commands/review.js +45 -0
- package/dist/src/commands/rewind/index.js +10 -0
- package/dist/src/commands/rewind/rewind.js +6 -0
- package/dist/src/commands/sandbox-toggle/index.js +35 -0
- package/dist/src/commands/sandbox-toggle/sandbox-toggle.js +61 -0
- package/dist/src/commands/security-review.js +228 -0
- package/dist/src/commands/session/index.js +13 -0
- package/dist/src/commands/session/session.js +185 -0
- package/dist/src/commands/share/index.js +1 -0
- package/dist/src/commands/skills/index.js +7 -0
- package/dist/src/commands/skills/skills.js +8 -0
- package/dist/src/commands/stats/index.js +7 -0
- package/dist/src/commands/stats/stats.js +7 -0
- package/dist/src/commands/status/index.js +8 -0
- package/dist/src/commands/status/status.js +9 -0
- package/dist/src/commands/statusline.js +20 -0
- package/dist/src/commands/stickers/index.js +8 -0
- package/dist/src/commands/stickers/stickers.js +13 -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 +250 -0
- package/dist/src/commands/tasks/index.js +8 -0
- package/dist/src/commands/tasks/tasks.js +8 -0
- package/dist/src/commands/teleport/index.js +1 -0
- package/dist/src/commands/terminalSetup/index.js +15 -0
- package/dist/src/commands/terminalSetup/terminalSetup.js +425 -0
- package/dist/src/commands/theme/index.js +7 -0
- package/dist/src/commands/theme/theme.js +58 -0
- package/dist/src/commands/thinkback/index.js +9 -0
- package/dist/src/commands/thinkback/thinkback.js +569 -0
- package/dist/src/commands/thinkback-play/index.js +11 -0
- package/dist/src/commands/thinkback-play/thinkback-play.js +31 -0
- package/dist/src/commands/ultraplan.js +361 -0
- package/dist/src/commands/upgrade/index.js +11 -0
- package/dist/src/commands/upgrade/upgrade.js +37 -0
- package/dist/src/commands/usage/index.js +7 -0
- package/dist/src/commands/usage/usage.js +9 -0
- package/dist/src/commands/version.js +15 -0
- package/dist/src/commands/vim/index.js +8 -0
- package/dist/src/commands/vim/vim.js +24 -0
- package/dist/src/commands/voice/index.js +17 -0
- package/dist/src/commands/voice/voice.js +117 -0
- package/dist/src/commands.js +476 -0
- package/dist/src/components/AgentProgressLine.js +202 -0
- package/dist/src/components/App.js +53 -0
- package/dist/src/components/ApproveApiKey.js +156 -0
- package/dist/src/components/AutoModeOptInDialog.js +154 -0
- package/dist/src/components/AutoUpdater.js +178 -0
- package/dist/src/components/AutoUpdaterWrapper.js +91 -0
- package/dist/src/components/AwsAuthStatusBox.js +119 -0
- package/dist/src/components/BaseTextInput.js +158 -0
- package/dist/src/components/BashModeProgress.js +65 -0
- package/dist/src/components/BridgeDialog.js +460 -0
- package/dist/src/components/BypassPermissionsModeDialog.js +111 -0
- package/dist/src/components/ChannelDowngradeDialog.js +114 -0
- package/dist/src/components/ClaudeCodeHint/PluginHintMenu.js +120 -0
- package/dist/src/components/ClaudeInChromeOnboarding.js +176 -0
- package/dist/src/components/ClaudeMdExternalIncludesDialog.js +172 -0
- package/dist/src/components/ClickableImageRef.js +74 -0
- package/dist/src/components/CompactSummary.js +220 -0
- package/dist/src/components/ConfigurableShortcutHint.js +33 -0
- package/dist/src/components/ConsoleOAuthFlow.js +841 -0
- package/dist/src/components/ContextSuggestions.js +85 -0
- package/dist/src/components/ContextVisualization.js +878 -0
- package/dist/src/components/CoordinatorAgentStatus.js +304 -0
- package/dist/src/components/CostThresholdDialog.js +66 -0
- package/dist/src/components/CtrlOToExpand.js +56 -0
- package/dist/src/components/CustomSelect/SelectMulti.js +246 -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 +558 -0
- package/dist/src/components/CustomSelect/select-option.js +39 -0
- package/dist/src/components/CustomSelect/select.js +803 -0
- package/dist/src/components/CustomSelect/use-multi-select-state.js +175 -0
- package/dist/src/components/CustomSelect/use-select-input.js +163 -0
- package/dist/src/components/CustomSelect/use-select-navigation.js +334 -0
- package/dist/src/components/CustomSelect/use-select-state.js +30 -0
- package/dist/src/components/DesktopHandoff.js +214 -0
- package/dist/src/components/DesktopUpsell/DesktopUpsellStartup.js +185 -0
- package/dist/src/components/DevBar.js +53 -0
- package/dist/src/components/DevChannelsDialog.js +128 -0
- package/dist/src/components/DiagnosticsDisplay.js +149 -0
- package/dist/src/components/EffortCallout.js +302 -0
- package/dist/src/components/EffortIndicator.js +30 -0
- package/dist/src/components/ExitFlow.js +45 -0
- package/dist/src/components/ExportDialog.js +160 -0
- package/dist/src/components/FallbackToolUseErrorMessage.js +149 -0
- package/dist/src/components/FallbackToolUseRejectedMessage.js +18 -0
- package/dist/src/components/FastIcon.js +49 -0
- package/dist/src/components/Feedback.js +589 -0
- package/dist/src/components/FeedbackSurvey/FeedbackSurvey.js +219 -0
- package/dist/src/components/FeedbackSurvey/FeedbackSurveyView.js +168 -0
- package/dist/src/components/FeedbackSurvey/TranscriptSharePrompt.js +147 -0
- package/dist/src/components/FeedbackSurvey/submitTranscriptShare.js +70 -0
- package/dist/src/components/FeedbackSurvey/useDebouncedDigitInput.js +45 -0
- package/dist/src/components/FeedbackSurvey/useFeedbackSurvey.js +242 -0
- package/dist/src/components/FeedbackSurvey/useMemorySurvey.js +188 -0
- package/dist/src/components/FeedbackSurvey/usePostCompactSurvey.js +200 -0
- package/dist/src/components/FeedbackSurvey/useSurveyState.js +81 -0
- package/dist/src/components/FileEditToolDiff.js +193 -0
- package/dist/src/components/FileEditToolUpdatedMessage.js +162 -0
- package/dist/src/components/FileEditToolUseRejectedMessage.js +215 -0
- package/dist/src/components/FilePathLink.js +33 -0
- package/dist/src/components/FullscreenLayout.js +592 -0
- package/dist/src/components/GlobalSearchDialog.js +371 -0
- package/dist/src/components/HelpV2/Commands.js +99 -0
- package/dist/src/components/HelpV2/General.js +48 -0
- package/dist/src/components/HelpV2/HelpV2.js +231 -0
- package/dist/src/components/HighlightedCode/Fallback.js +200 -0
- package/dist/src/components/HighlightedCode.js +219 -0
- package/dist/src/components/HistorySearchDialog.js +144 -0
- package/dist/src/components/IdeAutoConnectDialog.js +172 -0
- package/dist/src/components/IdeOnboardingDialog.js +249 -0
- package/dist/src/components/IdeStatusIndicator.js +68 -0
- package/dist/src/components/IdleReturnDialog.js +126 -0
- package/dist/src/components/InterruptedByUser.js +25 -0
- package/dist/src/components/InvalidConfigDialog.js +173 -0
- package/dist/src/components/InvalidSettingsDialog.js +94 -0
- package/dist/src/components/KeybindingWarnings.js +144 -0
- package/dist/src/components/LanguagePicker.js +112 -0
- package/dist/src/components/LogSelector.js +1775 -0
- package/dist/src/components/LogoV2/AnimatedAsterisk.js +49 -0
- package/dist/src/components/LogoV2/AnimatedClawd.js +105 -0
- package/dist/src/components/LogoV2/ChannelsNotice.js +334 -0
- package/dist/src/components/LogoV2/Clawd.js +285 -0
- package/dist/src/components/LogoV2/CondensedLogo.js +218 -0
- package/dist/src/components/LogoV2/EmergencyTip.js +47 -0
- package/dist/src/components/LogoV2/Feed.js +140 -0
- package/dist/src/components/LogoV2/FeedColumn.js +67 -0
- package/dist/src/components/LogoV2/GuestPassesUpsell.js +90 -0
- package/dist/src/components/LogoV2/LogoV2.js +774 -0
- package/dist/src/components/LogoV2/Opus1mMergeNotice.js +68 -0
- package/dist/src/components/LogoV2/OverageCreditUpsell.js +154 -0
- package/dist/src/components/LogoV2/VoiceModeNotice.js +75 -0
- package/dist/src/components/LogoV2/WelcomeV2.js +976 -0
- package/dist/src/components/LogoV2/feedConfigs.js +89 -0
- package/dist/src/components/LspRecommendation/LspRecommendationMenu.js +128 -0
- package/dist/src/components/MCPServerApprovalDialog.js +121 -0
- package/dist/src/components/MCPServerDesktopImportDialog.js +249 -0
- package/dist/src/components/MCPServerDialogCopy.js +24 -0
- package/dist/src/components/MCPServerMultiselectDialog.js +173 -0
- package/dist/src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.js +199 -0
- package/dist/src/components/ManagedSettingsSecurityDialog/utils.js +75 -0
- package/dist/src/components/Markdown.js +200 -0
- package/dist/src/components/MarkdownTable.js +215 -0
- package/dist/src/components/MemoryUsageIndicator.js +33 -0
- package/dist/src/components/Message.js +638 -0
- package/dist/src/components/MessageModel.js +43 -0
- package/dist/src/components/MessageResponse.js +99 -0
- package/dist/src/components/MessageRow.js +350 -0
- package/dist/src/components/MessageSelector.js +1021 -0
- package/dist/src/components/MessageTimestamp.js +63 -0
- package/dist/src/components/Messages.js +576 -0
- package/dist/src/components/ModelPicker.js +582 -0
- package/dist/src/components/NativeAutoUpdater.js +169 -0
- package/dist/src/components/NotebookEditToolUseRejectedMessage.js +123 -0
- package/dist/src/components/OffscreenFreeze.js +21 -0
- package/dist/src/components/Onboarding.js +307 -0
- package/dist/src/components/OutputStylePicker.js +128 -0
- package/dist/src/components/PackageManagerAutoUpdater.js +116 -0
- package/dist/src/components/Passes/Passes.js +242 -0
- package/dist/src/components/PrBadge.js +119 -0
- package/dist/src/components/PressEnterToContinue.js +24 -0
- package/dist/src/components/PromptInput/HistorySearchInput.js +64 -0
- package/dist/src/components/PromptInput/IssueFlagBanner.js +6 -0
- package/dist/src/components/PromptInput/Notifications.js +343 -0
- package/dist/src/components/PromptInput/PromptInput.js +1837 -0
- package/dist/src/components/PromptInput/PromptInputFooter.js +192 -0
- package/dist/src/components/PromptInput/PromptInputFooterLeftSide.js +504 -0
- package/dist/src/components/PromptInput/PromptInputFooterSuggestions.js +296 -0
- package/dist/src/components/PromptInput/PromptInputHelpMenu.js +508 -0
- package/dist/src/components/PromptInput/PromptInputModeIndicator.js +92 -0
- package/dist/src/components/PromptInput/PromptInputQueuedCommands.js +90 -0
- package/dist/src/components/PromptInput/PromptInputStashNotice.js +30 -0
- package/dist/src/components/PromptInput/SandboxPromptFooterHint.js +80 -0
- package/dist/src/components/PromptInput/ShimmeredInput.js +157 -0
- package/dist/src/components/PromptInput/VoiceIndicator.js +138 -0
- package/dist/src/components/PromptInput/inputModes.js +24 -0
- package/dist/src/components/PromptInput/inputPaste.js +46 -0
- package/dist/src/components/PromptInput/useMaybeTruncateInput.js +36 -0
- package/dist/src/components/PromptInput/usePromptInputPlaceholder.js +39 -0
- package/dist/src/components/PromptInput/useShowFastIconHint.js +19 -0
- package/dist/src/components/PromptInput/useSwarmBanner.js +99 -0
- package/dist/src/components/PromptInput/utils.js +25 -0
- package/dist/src/components/QuickOpenDialog.js +272 -0
- package/dist/src/components/RemoteCallout.js +81 -0
- package/dist/src/components/RemoteEnvironmentDialog.js +451 -0
- package/dist/src/components/ResumeTask.js +361 -0
- package/dist/src/components/SandboxViolationExpandedView.js +134 -0
- package/dist/src/components/ScrollKeybindingHandler.js +589 -0
- package/dist/src/components/SearchBox.js +111 -0
- package/dist/src/components/SentryErrorBoundary.js +17 -0
- package/dist/src/components/SessionBackgroundHint.js +103 -0
- package/dist/src/components/SessionPreview.js +263 -0
- package/dist/src/components/Settings/Config.js +1776 -0
- package/dist/src/components/Settings/Settings.js +159 -0
- package/dist/src/components/Settings/Status.js +315 -0
- package/dist/src/components/Settings/Usage.js +503 -0
- package/dist/src/components/ShowInIDEPrompt.js +212 -0
- package/dist/src/components/SkillImprovementSurvey.js +204 -0
- package/dist/src/components/Spinner/FlashingChar.js +60 -0
- package/dist/src/components/Spinner/GlimmerMessage.js +391 -0
- package/dist/src/components/Spinner/ShimmerChar.js +30 -0
- package/dist/src/components/Spinner/SpinnerAnimationRow.js +248 -0
- package/dist/src/components/Spinner/SpinnerGlyph.js +105 -0
- package/dist/src/components/Spinner/TeammateSpinnerLine.js +243 -0
- package/dist/src/components/Spinner/TeammateSpinnerTree.js +360 -0
- package/dist/src/components/Spinner/index.js +7 -0
- package/dist/src/components/Spinner/teammateSelectHint.js +1 -0
- package/dist/src/components/Spinner/useShimmerAnimation.js +17 -0
- package/dist/src/components/Spinner/useStalledAnimation.js +47 -0
- package/dist/src/components/Spinner/utils.js +65 -0
- package/dist/src/components/Spinner.js +596 -0
- package/dist/src/components/Stats.js +1415 -0
- package/dist/src/components/StatusLine.js +264 -0
- package/dist/src/components/StatusNotices.js +50 -0
- package/dist/src/components/StructuredDiff/Fallback.js +379 -0
- package/dist/src/components/StructuredDiff/colorDiff.js +21 -0
- package/dist/src/components/StructuredDiff.js +170 -0
- package/dist/src/components/StructuredDiffList.js +30 -0
- package/dist/src/components/TagTabs.js +124 -0
- package/dist/src/components/TaskListV2.js +430 -0
- package/dist/src/components/TeammateViewHeader.js +112 -0
- package/dist/src/components/TeleportError.js +200 -0
- package/dist/src/components/TeleportProgress.js +175 -0
- package/dist/src/components/TeleportRepoMismatchDialog.js +160 -0
- package/dist/src/components/TeleportResumeWrapper.js +207 -0
- package/dist/src/components/TeleportStash.js +159 -0
- package/dist/src/components/TextInput.js +94 -0
- package/dist/src/components/ThemePicker.js +428 -0
- package/dist/src/components/ThinkingToggle.js +233 -0
- package/dist/src/components/TokenWarning.js +165 -0
- package/dist/src/components/ToolUseLoader.js +44 -0
- package/dist/src/components/TrustDialog/TrustDialog.js +337 -0
- package/dist/src/components/TrustDialog/utils.js +149 -0
- package/dist/src/components/ValidationErrorsList.js +169 -0
- package/dist/src/components/VimTextInput.js +142 -0
- package/dist/src/components/VirtualMessageList.js +745 -0
- package/dist/src/components/WorkflowMultiselectDialog.js +173 -0
- package/dist/src/components/WorktreeExitDialog.js +228 -0
- package/dist/src/components/agents/AgentDetail.js +371 -0
- package/dist/src/components/agents/AgentEditor.js +191 -0
- package/dist/src/components/agents/AgentNavigationFooter.js +28 -0
- package/dist/src/components/agents/AgentsList.js +623 -0
- package/dist/src/components/agents/AgentsMenu.js +897 -0
- package/dist/src/components/agents/ColorPicker.js +170 -0
- package/dist/src/components/agents/ModelSelector.js +79 -0
- package/dist/src/components/agents/ToolSelector.js +581 -0
- package/dist/src/components/agents/agentFileUtils.js +142 -0
- package/dist/src/components/agents/generateAgent.js +160 -0
- package/dist/src/components/agents/new-agent-creation/CreateAgentWizard.js +101 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ColorStep.js +108 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.js +551 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.js +73 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.js +176 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.js +176 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/LocationStep.js +104 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.js +136 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/MethodStep.js +105 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ModelStep.js +75 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/PromptStep.js +185 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.js +81 -0
- package/dist/src/components/agents/new-agent-creation/wizard-steps/TypeStep.js +146 -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 +66 -0
- package/dist/src/components/design-system/Byline.js +53 -0
- package/dist/src/components/design-system/Dialog.js +171 -0
- package/dist/src/components/design-system/Divider.js +107 -0
- package/dist/src/components/design-system/FuzzyPicker.js +316 -0
- package/dist/src/components/design-system/KeyboardShortcutHint.js +63 -0
- package/dist/src/components/design-system/ListItem.js +186 -0
- package/dist/src/components/design-system/LoadingState.js +72 -0
- package/dist/src/components/design-system/Pane.js +67 -0
- package/dist/src/components/design-system/ProgressBar.js +67 -0
- package/dist/src/components/design-system/Ratchet.js +83 -0
- package/dist/src/components/design-system/StatusIcon.js +60 -0
- package/dist/src/components/design-system/Tabs.js +332 -0
- package/dist/src/components/design-system/ThemeProvider.js +117 -0
- package/dist/src/components/design-system/ThemedBox.js +123 -0
- package/dist/src/components/design-system/ThemedText.js +68 -0
- package/dist/src/components/design-system/color.js +13 -0
- package/dist/src/components/diff/DiffDetailView.js +388 -0
- package/dist/src/components/diff/DiffDialog.js +489 -0
- package/dist/src/components/diff/DiffFileList.js +359 -0
- package/dist/src/components/grove/Grove.js +710 -0
- package/dist/src/components/hooks/HooksConfigMenu.js +626 -0
- package/dist/src/components/hooks/PromptDialog.js +96 -0
- package/dist/src/components/hooks/SelectEventMode.js +169 -0
- package/dist/src/components/hooks/SelectHookMode.js +127 -0
- package/dist/src/components/hooks/SelectMatcherMode.js +156 -0
- package/dist/src/components/hooks/ViewHookMode.js +275 -0
- package/dist/src/components/mcp/CapabilitiesSection.js +68 -0
- package/dist/src/components/mcp/ElicitationDialog.js +1330 -0
- package/dist/src/components/mcp/MCPAgentServerMenu.js +275 -0
- package/dist/src/components/mcp/MCPListPanel.js +671 -0
- package/dist/src/components/mcp/MCPReconnect.js +210 -0
- package/dist/src/components/mcp/MCPRemoteServerMenu.js +906 -0
- package/dist/src/components/mcp/MCPSettings.js +415 -0
- package/dist/src/components/mcp/MCPStdioServerMenu.js +276 -0
- package/dist/src/components/mcp/MCPToolDetailView.js +316 -0
- package/dist/src/components/mcp/MCPToolListView.js +169 -0
- package/dist/src/components/mcp/McpParsingWarnings.js +319 -0
- package/dist/src/components/mcp/index.js +8 -0
- package/dist/src/components/mcp/utils/reconnectHelpers.js +28 -0
- package/dist/src/components/memory/MemoryFileSelector.js +459 -0
- package/dist/src/components/memory/MemoryUpdateNotification.js +51 -0
- package/dist/src/components/messageActions.js +464 -0
- package/dist/src/components/messages/AdvisorMessage.js +202 -0
- package/dist/src/components/messages/AssistantRedactedThinkingMessage.js +34 -0
- package/dist/src/components/messages/AssistantTextMessage.js +373 -0
- package/dist/src/components/messages/AssistantThinkingMessage.js +105 -0
- package/dist/src/components/messages/AssistantToolUseMessage.js +414 -0
- package/dist/src/components/messages/AttachmentMessage.js +764 -0
- package/dist/src/components/messages/CollapsedReadSearchContent.js +651 -0
- package/dist/src/components/messages/CompactBoundaryMessage.js +27 -0
- package/dist/src/components/messages/GroupedToolUseContent.js +42 -0
- package/dist/src/components/messages/HighlightedThinkingText.js +215 -0
- package/dist/src/components/messages/HookProgressMessage.js +150 -0
- package/dist/src/components/messages/PlanApprovalMessage.js +294 -0
- package/dist/src/components/messages/RateLimitMessage.js +164 -0
- package/dist/src/components/messages/ShutdownMessage.js +180 -0
- package/dist/src/components/messages/SystemAPIErrorMessage.js +162 -0
- package/dist/src/components/messages/SystemTextMessage.js +1145 -0
- package/dist/src/components/messages/TaskAssignmentMessage.js +100 -0
- package/dist/src/components/messages/UserAgentNotificationMessage.js +89 -0
- package/dist/src/components/messages/UserBashInputMessage.js +67 -0
- package/dist/src/components/messages/UserBashOutputMessage.js +56 -0
- package/dist/src/components/messages/UserChannelMessage.js +145 -0
- package/dist/src/components/messages/UserCommandMessage.js +146 -0
- package/dist/src/components/messages/UserImageMessage.js +59 -0
- package/dist/src/components/messages/UserLocalCommandOutputMessage.js +226 -0
- package/dist/src/components/messages/UserMemoryInputMessage.js +101 -0
- package/dist/src/components/messages/UserPlanMessage.js +56 -0
- package/dist/src/components/messages/UserPromptMessage.js +54 -0
- package/dist/src/components/messages/UserResourceUpdateMessage.js +131 -0
- package/dist/src/components/messages/UserTeammateMessage.js +215 -0
- package/dist/src/components/messages/UserTextMessage.js +207 -0
- package/dist/src/components/messages/UserToolResultMessage/RejectedPlanMessage.js +46 -0
- package/dist/src/components/messages/UserToolResultMessage/RejectedToolUseMessage.js +21 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +18 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolErrorMessage.js +90 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolRejectMessage.js +80 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolResultMessage.js +116 -0
- package/dist/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +73 -0
- package/dist/src/components/messages/UserToolResultMessage/utils.js +41 -0
- package/dist/src/components/messages/nullRenderingAttachments.js +40 -0
- package/dist/src/components/messages/teamMemCollapsed.js +160 -0
- package/dist/src/components/messages/teamMemSaved.js +9 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +696 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.js +263 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.js +384 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.js +228 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.js +611 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.js +218 -0
- package/dist/src/components/permissions/AskUserQuestionPermissionRequest/use-multiple-choice-state.js +98 -0
- package/dist/src/components/permissions/BashPermissionRequest/BashPermissionRequest.js +458 -0
- package/dist/src/components/permissions/BashPermissionRequest/bashToolUseOptions.js +90 -0
- package/dist/src/components/permissions/ComputerUseApproval/ComputerUseApproval.js +567 -0
- package/dist/src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.js +175 -0
- package/dist/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.js +728 -0
- package/dist/src/components/permissions/FallbackPermissionRequest.js +385 -0
- package/dist/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +205 -0
- package/dist/src/components/permissions/FilePermissionDialog/FilePermissionDialog.js +188 -0
- package/dist/src/components/permissions/FilePermissionDialog/ideDiffConfig.js +13 -0
- package/dist/src/components/permissions/FilePermissionDialog/permissionOptions.js +159 -0
- package/dist/src/components/permissions/FilePermissionDialog/useFilePermissionDialog.js +129 -0
- package/dist/src/components/permissions/FilePermissionDialog/usePermissionHandler.js +100 -0
- package/dist/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +186 -0
- package/dist/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +110 -0
- package/dist/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +143 -0
- package/dist/src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.js +194 -0
- package/dist/src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.js +278 -0
- package/dist/src/components/permissions/PermissionDecisionDebugInfo.js +709 -0
- package/dist/src/components/permissions/PermissionDialog.js +90 -0
- package/dist/src/components/permissions/PermissionExplanation.js +298 -0
- package/dist/src/components/permissions/PermissionPrompt.js +327 -0
- package/dist/src/components/permissions/PermissionRequest.js +164 -0
- package/dist/src/components/permissions/PermissionRequestTitle.js +85 -0
- package/dist/src/components/permissions/PermissionRuleExplanation.js +112 -0
- package/dist/src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.js +263 -0
- package/dist/src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.js +70 -0
- package/dist/src/components/permissions/SandboxPermissionRequest.js +205 -0
- package/dist/src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.js +259 -0
- package/dist/src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.js +424 -0
- package/dist/src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.js +299 -0
- package/dist/src/components/permissions/WorkerBadge.js +56 -0
- package/dist/src/components/permissions/WorkerPendingPermission.js +158 -0
- package/dist/src/components/permissions/hooks.js +128 -0
- package/dist/src/components/permissions/rules/AddPermissionRules.js +203 -0
- package/dist/src/components/permissions/rules/AddWorkspaceDirectory.js +437 -0
- package/dist/src/components/permissions/rules/PermissionRuleDescription.js +101 -0
- package/dist/src/components/permissions/rules/PermissionRuleInput.js +208 -0
- package/dist/src/components/permissions/rules/PermissionRuleList.js +1382 -0
- package/dist/src/components/permissions/rules/RecentDenialsTab.js +229 -0
- package/dist/src/components/permissions/rules/RemoveWorkspaceDirectory.js +123 -0
- package/dist/src/components/permissions/rules/WorkspaceTab.js +161 -0
- package/dist/src/components/permissions/shellPermissionHelpers.js +219 -0
- package/dist/src/components/permissions/useShellPermissionFeedback.js +98 -0
- package/dist/src/components/permissions/utils.js +18 -0
- package/dist/src/components/sandbox/SandboxConfigTab.js +195 -0
- package/dist/src/components/sandbox/SandboxDependenciesTab.js +265 -0
- package/dist/src/components/sandbox/SandboxDoctorSection.js +80 -0
- package/dist/src/components/sandbox/SandboxOverridesTab.js +272 -0
- package/dist/src/components/sandbox/SandboxSettings.js +374 -0
- package/dist/src/components/shell/ExpandShellOutputContext.js +25 -0
- package/dist/src/components/shell/OutputLine.js +107 -0
- package/dist/src/components/shell/ShellProgressMessage.js +189 -0
- package/dist/src/components/shell/ShellTimeDisplay.js +78 -0
- package/dist/src/components/skills/SkillsMenu.js +310 -0
- package/dist/src/components/tasks/AsyncAgentDetailDialog.js +353 -0
- package/dist/src/components/tasks/BackgroundTask.js +428 -0
- package/dist/src/components/tasks/BackgroundTaskStatus.js +522 -0
- package/dist/src/components/tasks/BackgroundTasksDialog.js +784 -0
- package/dist/src/components/tasks/DreamDetailDialog.js +353 -0
- package/dist/src/components/tasks/InProcessTeammateDetailDialog.js +393 -0
- package/dist/src/components/tasks/RemoteSessionDetailDialog.js +1188 -0
- package/dist/src/components/tasks/RemoteSessionProgress.js +310 -0
- package/dist/src/components/tasks/ShellDetailDialog.js +511 -0
- package/dist/src/components/tasks/ShellProgress.js +93 -0
- package/dist/src/components/tasks/renderToolActivity.js +34 -0
- package/dist/src/components/tasks/taskStatusUtils.js +77 -0
- package/dist/src/components/teams/TeamStatus.js +95 -0
- package/dist/src/components/teams/TeamsDialog.js +734 -0
- package/dist/src/components/ui/OrderedList.js +74 -0
- package/dist/src/components/ui/OrderedListItem.js +53 -0
- package/dist/src/components/ui/TreeSelect.js +307 -0
- package/dist/src/components/wizard/WizardDialogLayout.js +71 -0
- package/dist/src/components/wizard/WizardNavigationFooter.js +36 -0
- package/dist/src/components/wizard/WizardProvider.js +211 -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 +11 -0
- package/dist/src/constants/betas.js +28 -0
- package/dist/src/constants/common.js +16 -0
- package/dist/src/constants/cyberRiskInstruction.js +1 -0
- package/dist/src/constants/errorIds.js +1 -0
- package/dist/src/constants/figures.js +31 -0
- package/dist/src/constants/files.js +115 -0
- package/dist/src/constants/github-app.js +139 -0
- package/dist/src/constants/keys.js +4 -0
- package/dist/src/constants/messages.js +1 -0
- package/dist/src/constants/oauth.js +141 -0
- package/dist/src/constants/outputStyles.js +155 -0
- package/dist/src/constants/product.js +25 -0
- package/dist/src/constants/prompts.js +544 -0
- package/dist/src/constants/spinnerVerbs.js +201 -0
- package/dist/src/constants/system.js +46 -0
- package/dist/src/constants/systemPromptSections.js +27 -0
- package/dist/src/constants/toolLimits.js +6 -0
- package/dist/src/constants/tools.js +75 -0
- package/dist/src/constants/turnCompletionVerbs.js +10 -0
- package/dist/src/constants/xml.js +54 -0
- package/dist/src/context/QueuedMessageContext.js +57 -0
- package/dist/src/context/fpsMetrics.js +26 -0
- package/dist/src/context/mailbox.js +37 -0
- package/dist/src/context/modalContext.js +26 -0
- package/dist/src/context/notifications.js +176 -0
- package/dist/src/context/overlayContext.js +92 -0
- package/dist/src/context/promptOverlayContext.js +99 -0
- package/dist/src/context/stats.js +203 -0
- package/dist/src/context/voice.js +62 -0
- package/dist/src/context.js +119 -0
- package/dist/src/coordinator/coordinatorMode.js +323 -0
- package/dist/src/cost-tracker.js +234 -0
- package/dist/src/costHook.js +19 -0
- package/dist/src/dialogLaunchers.js +92 -0
- package/dist/src/entrypoints/agentSdkTypes.js +51 -0
- package/dist/src/entrypoints/cli.js +92 -0
- package/dist/src/entrypoints/init.js +199 -0
- package/dist/src/entrypoints/mcp.js +132 -0
- package/dist/src/entrypoints/npm-bin.js +6 -0
- package/dist/src/entrypoints/sandboxTypes.js +34 -0
- package/dist/src/entrypoints/sdk/controlSchemas.js +347 -0
- package/dist/src/entrypoints/sdk/coreSchemas.js +1019 -0
- package/dist/src/entrypoints/sdk/coreTypes.generated.js +1 -0
- package/dist/src/entrypoints/sdk/coreTypes.js +38 -0
- package/dist/src/entrypoints/sdk/runtimeTypes.js +1 -0
- package/dist/src/entrypoints/sdk/settingsTypes.generated.js +1 -0
- package/dist/src/entrypoints/sdk/toolTypes.js +1 -0
- package/dist/src/history.js +297 -0
- package/dist/src/hooks/fileSuggestions.js +460 -0
- package/dist/src/hooks/notifs/useAutoModeUnavailableNotification.js +39 -0
- package/dist/src/hooks/notifs/useCanSwitchToExistingSubscription.js +64 -0
- package/dist/src/hooks/notifs/useDeprecationWarningNotification.js +43 -0
- package/dist/src/hooks/notifs/useFastModeNotification.js +161 -0
- package/dist/src/hooks/notifs/useIDEStatusIndicator.js +187 -0
- package/dist/src/hooks/notifs/useInstallMessages.js +25 -0
- package/dist/src/hooks/notifs/useLspInitializationNotification.js +147 -0
- package/dist/src/hooks/notifs/useMcpConnectivityStatus.js +154 -0
- package/dist/src/hooks/notifs/useModelMigrationNotifications.js +45 -0
- package/dist/src/hooks/notifs/useNpmDeprecationNotification.js +24 -0
- package/dist/src/hooks/notifs/usePluginAutoupdateNotification.js +93 -0
- package/dist/src/hooks/notifs/usePluginInstallationStatus.js +143 -0
- package/dist/src/hooks/notifs/useRateLimitWarningNotification.js +118 -0
- package/dist/src/hooks/notifs/useSettingsErrors.js +67 -0
- package/dist/src/hooks/notifs/useStartupNotification.js +24 -0
- package/dist/src/hooks/notifs/useTeammateShutdownNotification.js +61 -0
- package/dist/src/hooks/renderPlaceholder.js +27 -0
- package/dist/src/hooks/toolPermission/PermissionContext.js +186 -0
- package/dist/src/hooks/toolPermission/handlers/coordinatorHandler.js +22 -0
- package/dist/src/hooks/toolPermission/handlers/interactiveHandler.js +194 -0
- package/dist/src/hooks/toolPermission/handlers/swarmWorkerHandler.js +79 -0
- package/dist/src/hooks/toolPermission/permissionLogging.js +114 -0
- package/dist/src/hooks/unifiedSuggestions.js +115 -0
- package/dist/src/hooks/useAfterFirstRender.js +12 -0
- package/dist/src/hooks/useApiKeyVerification.js +58 -0
- package/dist/src/hooks/useArrowKeyHistory.js +176 -0
- package/dist/src/hooks/useAssistantHistory.js +150 -0
- package/dist/src/hooks/useAwaySummary.js +95 -0
- package/dist/src/hooks/useBackgroundTaskNavigation.js +163 -0
- package/dist/src/hooks/useBlink.js +10 -0
- package/dist/src/hooks/useCanUseTool.js +144 -0
- package/dist/src/hooks/useCancelRequest.js +165 -0
- package/dist/src/hooks/useChromeExtensionNotification.js +55 -0
- package/dist/src/hooks/useClaudeCodeHintRecommendation.js +113 -0
- package/dist/src/hooks/useClipboardImageHint.js +45 -0
- package/dist/src/hooks/useCommandKeybindings.js +81 -0
- package/dist/src/hooks/useCommandQueue.js +8 -0
- package/dist/src/hooks/useCopyOnSelect.js +44 -0
- package/dist/src/hooks/useDeferredHookMessages.js +35 -0
- package/dist/src/hooks/useDiffData.js +62 -0
- package/dist/src/hooks/useDiffInIDE.js +197 -0
- package/dist/src/hooks/useDirectConnect.js +154 -0
- package/dist/src/hooks/useDoublePress.js +36 -0
- package/dist/src/hooks/useDynamicConfig.js +10 -0
- package/dist/src/hooks/useElapsedTime.js +12 -0
- package/dist/src/hooks/useExitOnCtrlCD.js +27 -0
- package/dist/src/hooks/useExitOnCtrlCDWithKeybindings.js +5 -0
- package/dist/src/hooks/useFileHistorySnapshotInit.js +17 -0
- package/dist/src/hooks/useGlobalKeybindings.js +132 -0
- package/dist/src/hooks/useHistorySearch.js +219 -0
- package/dist/src/hooks/useIDEIntegration.js +60 -0
- package/dist/src/hooks/useIdeAtMentioned.js +42 -0
- package/dist/src/hooks/useIdeConnectionStatus.js +18 -0
- package/dist/src/hooks/useIdeLogging.js +26 -0
- package/dist/src/hooks/useIdeSelection.js +78 -0
- package/dist/src/hooks/useInboxPoller.js +626 -0
- package/dist/src/hooks/useInputBuffer.js +69 -0
- package/dist/src/hooks/useIssueFlagBanner.js +101 -0
- package/dist/src/hooks/useLogMessages.js +47 -0
- package/dist/src/hooks/useLspPluginRecommendation.js +163 -0
- package/dist/src/hooks/useMailboxBridge.js +15 -0
- package/dist/src/hooks/useMainLoopModel.js +15 -0
- package/dist/src/hooks/useManagePlugins.js +195 -0
- package/dist/src/hooks/useMemoryUsage.js +17 -0
- package/dist/src/hooks/useMergedClients.js +11 -0
- package/dist/src/hooks/useMergedCommands.js +10 -0
- package/dist/src/hooks/useMergedTools.js +18 -0
- package/dist/src/hooks/useMinDisplayTime.js +19 -0
- package/dist/src/hooks/useNotifyAfterTimeout.js +34 -0
- package/dist/src/hooks/useOfficialMarketplaceNotification.js +50 -0
- package/dist/src/hooks/usePasteHandler.js +129 -0
- package/dist/src/hooks/usePluginRecommendationBase.js +98 -0
- package/dist/src/hooks/usePrStatus.js +77 -0
- package/dist/src/hooks/usePromptSuggestion.js +124 -0
- package/dist/src/hooks/usePromptsFromClaudeInChrome.js +60 -0
- package/dist/src/hooks/useQueueProcessor.js +29 -0
- package/dist/src/hooks/useRemoteSession.js +313 -0
- package/dist/src/hooks/useReplBridge.js +59 -0
- package/dist/src/hooks/useSSHSession.js +161 -0
- package/dist/src/hooks/useScheduledTasks.js +68 -0
- package/dist/src/hooks/useSearchInput.js +285 -0
- package/dist/src/hooks/useSessionBackgrounding.js +120 -0
- package/dist/src/hooks/useSettings.js +4 -0
- package/dist/src/hooks/useSettingsChange.js +10 -0
- package/dist/src/hooks/useSkillImprovementSurvey.js +61 -0
- package/dist/src/hooks/useSkillsChange.js +39 -0
- package/dist/src/hooks/useSwarmInitialization.js +39 -0
- package/dist/src/hooks/useSwarmPermissionPoller.js +141 -0
- package/dist/src/hooks/useTaskListWatcher.js +124 -0
- package/dist/src/hooks/useTasksV2.js +161 -0
- package/dist/src/hooks/useTeammateViewAutoExit.js +35 -0
- package/dist/src/hooks/useTeleportResume.js +75 -0
- package/dist/src/hooks/useTerminalSize.js +11 -0
- package/dist/src/hooks/useTextInput.js +353 -0
- package/dist/src/hooks/useTimeout.js +10 -0
- package/dist/src/hooks/useTurnDiffs.js +131 -0
- package/dist/src/hooks/useTypeahead.js +993 -0
- package/dist/src/hooks/useUpdateNotification.js +21 -0
- package/dist/src/hooks/useVimInput.js +210 -0
- package/dist/src/hooks/useVirtualScroll.js +282 -0
- package/dist/src/hooks/useVoice.js +675 -0
- package/dist/src/hooks/useVoiceEnabled.js +12 -0
- package/dist/src/hooks/useVoiceIntegration.js +391 -0
- package/dist/src/ink/Ansi.js +290 -0
- package/dist/src/ink/bidi.js +72 -0
- package/dist/src/ink/clearTerminal.js +42 -0
- package/dist/src/ink/colorize.js +119 -0
- package/dist/src/ink/components/AlternateScreen.js +60 -0
- package/dist/src/ink/components/App.js +375 -0
- package/dist/src/ink/components/AppContext.js +6 -0
- package/dist/src/ink/components/Box.js +181 -0
- package/dist/src/ink/components/Button.js +167 -0
- package/dist/src/ink/components/ClockContext.js +100 -0
- package/dist/src/ink/components/CursorDeclarationContext.js +3 -0
- package/dist/src/ink/components/ErrorOverview.js +152 -0
- package/dist/src/ink/components/Link.js +42 -0
- package/dist/src/ink/components/Newline.js +29 -0
- package/dist/src/ink/components/NoSelect.js +40 -0
- package/dist/src/ink/components/RawAnsi.js +36 -0
- package/dist/src/ink/components/ScrollBox.js +139 -0
- package/dist/src/ink/components/Spacer.js +16 -0
- package/dist/src/ink/components/StdinContext.js +12 -0
- package/dist/src/ink/components/TerminalFocusContext.js +43 -0
- package/dist/src/ink/components/TerminalSizeContext.js +2 -0
- package/dist/src/ink/components/Text.js +196 -0
- package/dist/src/ink/constants.js +1 -0
- package/dist/src/ink/dom.js +230 -0
- package/dist/src/ink/events/click-event.js +15 -0
- package/dist/src/ink/events/dispatcher.js +126 -0
- package/dist/src/ink/events/emitter.js +26 -0
- package/dist/src/ink/events/event-handlers.js +22 -0
- package/dist/src/ink/events/event.js +9 -0
- package/dist/src/ink/events/focus-event.js +9 -0
- package/dist/src/ink/events/input-event.js +83 -0
- package/dist/src/ink/events/keyboard-event.js +31 -0
- package/dist/src/ink/events/terminal-event.js +60 -0
- package/dist/src/ink/events/terminal-focus-event.js +9 -0
- package/dist/src/ink/focus.js +127 -0
- package/dist/src/ink/frame.js +22 -0
- package/dist/src/ink/get-max-width.js +5 -0
- package/dist/src/ink/hit-test.js +76 -0
- package/dist/src/ink/hooks/use-animation-frame.js +23 -0
- package/dist/src/ink/hooks/use-app.js +4 -0
- package/dist/src/ink/hooks/use-declared-cursor.js +27 -0
- package/dist/src/ink/hooks/use-input.js +31 -0
- package/dist/src/ink/hooks/use-interval.js +38 -0
- package/dist/src/ink/hooks/use-search-highlight.js +21 -0
- package/dist/src/ink/hooks/use-selection.js +47 -0
- package/dist/src/ink/hooks/use-stdin.js +4 -0
- package/dist/src/ink/hooks/use-tab-status.js +48 -0
- package/dist/src/ink/hooks/use-terminal-focus.js +6 -0
- package/dist/src/ink/hooks/use-terminal-title.js +17 -0
- package/dist/src/ink/hooks/use-terminal-viewport.js +40 -0
- package/dist/src/ink/ink.js +978 -0
- package/dist/src/ink/instances.js +2 -0
- package/dist/src/ink/layout/engine.js +4 -0
- package/dist/src/ink/layout/geometry.js +55 -0
- package/dist/src/ink/layout/node.js +60 -0
- package/dist/src/ink/layout/yoga.js +232 -0
- package/dist/src/ink/line-width-cache.js +14 -0
- package/dist/src/ink/log-update.js +408 -0
- package/dist/src/ink/measure-element.js +5 -0
- package/dist/src/ink/measure-text.js +30 -0
- package/dist/src/ink/node-cache.js +19 -0
- package/dist/src/ink/optimizer.js +52 -0
- package/dist/src/ink/output.js +399 -0
- package/dist/src/ink/parse-keypress.js +525 -0
- package/dist/src/ink/reconciler.js +359 -0
- package/dist/src/ink/render-border.js +110 -0
- package/dist/src/ink/render-node-to-output.js +710 -0
- package/dist/src/ink/render-to-screen.js +124 -0
- package/dist/src/ink/renderer.js +73 -0
- package/dist/src/ink/root.js +73 -0
- package/dist/src/ink/screen.js +823 -0
- package/dist/src/ink/searchHighlight.js +48 -0
- package/dist/src/ink/selection.js +507 -0
- package/dist/src/ink/squash-text-nodes.js +40 -0
- package/dist/src/ink/stringWidth.js +134 -0
- package/dist/src/ink/styles.js +279 -0
- package/dist/src/ink/supports-hyperlinks.js +29 -0
- package/dist/src/ink/tabstops.js +35 -0
- package/dist/src/ink/terminal-focus-state.js +33 -0
- package/dist/src/ink/terminal-querier.js +89 -0
- package/dist/src/ink/terminal.js +128 -0
- package/dist/src/ink/termio/ansi.js +53 -0
- package/dist/src/ink/termio/csi.js +158 -0
- package/dist/src/ink/termio/dec.js +31 -0
- package/dist/src/ink/termio/esc.js +36 -0
- package/dist/src/ink/termio/osc.js +275 -0
- package/dist/src/ink/termio/parser.js +293 -0
- package/dist/src/ink/termio/sgr.js +264 -0
- package/dist/src/ink/termio/tokenize.js +176 -0
- package/dist/src/ink/termio/types.js +33 -0
- package/dist/src/ink/termio.js +2 -0
- package/dist/src/ink/useTerminalNotification.js +61 -0
- package/dist/src/ink/warn.js +10 -0
- package/dist/src/ink/widest-line.js +15 -0
- package/dist/src/ink/wrap-text.js +50 -0
- package/dist/src/ink/wrapAnsi.js +5 -0
- package/dist/src/ink.js +55 -0
- package/dist/src/interactiveHelpers.js +231 -0
- package/dist/src/keybindings/KeybindingContext.js +170 -0
- package/dist/src/keybindings/KeybindingProviderSetup.js +225 -0
- package/dist/src/keybindings/defaultBindings.js +228 -0
- package/dist/src/keybindings/loadUserBindings.js +276 -0
- package/dist/src/keybindings/match.js +73 -0
- package/dist/src/keybindings/parser.js +152 -0
- package/dist/src/keybindings/reservedShortcuts.js +82 -0
- package/dist/src/keybindings/resolver.js +116 -0
- package/dist/src/keybindings/schema.js +143 -0
- package/dist/src/keybindings/shortcutFormat.js +24 -0
- package/dist/src/keybindings/template.js +28 -0
- package/dist/src/keybindings/useKeybinding.js +100 -0
- package/dist/src/keybindings/useShortcutDisplay.js +24 -0
- package/dist/src/keybindings/validate.js +313 -0
- package/dist/src/localRecoveryCli.js +256 -0
- package/dist/src/main.js +2489 -0
- package/dist/src/memdir/findRelevantMemories.js +76 -0
- package/dist/src/memdir/memdir.js +264 -0
- package/dist/src/memdir/memoryAge.js +24 -0
- package/dist/src/memdir/memoryScan.js +36 -0
- package/dist/src/memdir/memoryTypes.js +190 -0
- package/dist/src/memdir/paths.js +106 -0
- package/dist/src/memdir/teamMemPaths.js +133 -0
- package/dist/src/memdir/teamMemPrompts.js +87 -0
- package/dist/src/migrations/migrateAutoUpdatesToSettings.js +41 -0
- package/dist/src/migrations/migrateBypassPermissionsAcceptedToSettings.js +29 -0
- package/dist/src/migrations/migrateEnableAllProjectMcpServersToSettings.js +70 -0
- package/dist/src/migrations/migrateFennecToOpus.js +27 -0
- package/dist/src/migrations/migrateLegacyOpusToCurrent.js +30 -0
- package/dist/src/migrations/migrateOpusToOpus1m.js +23 -0
- package/dist/src/migrations/migrateReplBridgeEnabledToRemoteControlAtStartup.js +13 -0
- package/dist/src/migrations/migrateSonnet1mToSonnet45.js +29 -0
- package/dist/src/migrations/migrateSonnet45ToSonnet46.js +41 -0
- package/dist/src/migrations/resetAutoModeOptInForDefaultOffer.js +11 -0
- package/dist/src/migrations/resetProToOpusDefault.js +42 -0
- package/dist/src/moreright/useMoreRight.js +7 -0
- package/dist/src/native-ts/color-diff/index.js +729 -0
- package/dist/src/native-ts/file-index/index.js +246 -0
- package/dist/src/native-ts/yoga-layout/enums.js +96 -0
- package/dist/src/native-ts/yoga-layout/index.js +1638 -0
- package/dist/src/outputStyles/loadOutputStylesDir.js +47 -0
- package/dist/src/plugins/builtinPlugins.js +86 -0
- package/dist/src/plugins/bundled/index.js +1 -0
- package/dist/src/projectOnboardingState.js +56 -0
- package/dist/src/query/config.js +14 -0
- package/dist/src/query/deps.js +12 -0
- package/dist/src/query/stopHooks.js +251 -0
- package/dist/src/query/tokenBudget.js +47 -0
- package/dist/src/query.js +813 -0
- package/dist/src/remote/RemoteSessionManager.js +144 -0
- package/dist/src/remote/SessionsWebSocket.js +231 -0
- package/dist/src/remote/remotePermissionBridge.js +57 -0
- package/dist/src/remote/sdkMessageAdapter.js +161 -0
- package/dist/src/replLauncher.js +15 -0
- package/dist/src/schemas/hooks.js +71 -0
- package/dist/src/screens/Doctor.js +988 -0
- package/dist/src/screens/REPL.js +3588 -0
- package/dist/src/screens/ResumeConversation.js +396 -0
- package/dist/src/server/createDirectConnectSession.js +55 -0
- package/dist/src/server/directConnectManager.js +131 -0
- package/dist/src/server/types.js +7 -0
- package/dist/src/services/AgentSummary/agentSummary.js +114 -0
- package/dist/src/services/MagicDocs/magicDocs.js +151 -0
- package/dist/src/services/MagicDocs/prompts.js +85 -0
- package/dist/src/services/PromptSuggestion/promptSuggestion.js +350 -0
- package/dist/src/services/PromptSuggestion/speculation.js +590 -0
- package/dist/src/services/SessionMemory/prompts.js +220 -0
- package/dist/src/services/SessionMemory/sessionMemory.js +277 -0
- package/dist/src/services/SessionMemory/sessionMemoryUtils.js +94 -0
- package/dist/src/services/analytics/config.js +8 -0
- package/dist/src/services/analytics/datadog.js +217 -0
- package/dist/src/services/analytics/firstPartyEventLogger.js +223 -0
- package/dist/src/services/analytics/firstPartyEventLoggingExporter.js +500 -0
- package/dist/src/services/analytics/growthbook.js +597 -0
- package/dist/src/services/analytics/index.js +56 -0
- package/dist/src/services/analytics/metadata.js +507 -0
- package/dist/src/services/analytics/sink.js +44 -0
- package/dist/src/services/analytics/sinkKillswitch.js +6 -0
- package/dist/src/services/api/adminRequests.js +40 -0
- package/dist/src/services/api/bootstrap.js +104 -0
- package/dist/src/services/api/claude.js +1851 -0
- package/dist/src/services/api/client.js +209 -0
- package/dist/src/services/api/dumpPrompts.js +145 -0
- package/dist/src/services/api/emptyUsage.js +15 -0
- package/dist/src/services/api/errorUtils.js +137 -0
- package/dist/src/services/api/errors.js +641 -0
- package/dist/src/services/api/filesApi.js +409 -0
- package/dist/src/services/api/firstTokenDate.js +42 -0
- package/dist/src/services/api/grove.js +222 -0
- package/dist/src/services/api/logging.js +478 -0
- package/dist/src/services/api/metricsOptOut.js +87 -0
- package/dist/src/services/api/overageCreditGrant.js +83 -0
- package/dist/src/services/api/promptCacheBreakDetection.js +411 -0
- package/dist/src/services/api/referral.js +178 -0
- package/dist/src/services/api/sessionIngress.js +264 -0
- package/dist/src/services/api/ultrareviewQuota.js +23 -0
- package/dist/src/services/api/usage.js +34 -0
- package/dist/src/services/api/withRetry.js +454 -0
- package/dist/src/services/autoDream/autoDream.js +197 -0
- package/dist/src/services/autoDream/config.js +9 -0
- package/dist/src/services/autoDream/consolidationLock.js +76 -0
- package/dist/src/services/autoDream/consolidationPrompt.js +61 -0
- package/dist/src/services/awaySummary.js +58 -0
- package/dist/src/services/claudeAiLimits.js +269 -0
- package/dist/src/services/claudeAiLimitsHook.js +18 -0
- package/dist/src/services/compact/apiMicrocompact.js +82 -0
- package/dist/src/services/compact/autoCompact.js +151 -0
- package/dist/src/services/compact/compact.js +957 -0
- package/dist/src/services/compact/compactWarningHook.js +5 -0
- package/dist/src/services/compact/compactWarningState.js +8 -0
- package/dist/src/services/compact/grouping.js +20 -0
- package/dist/src/services/compact/microCompact.js +265 -0
- package/dist/src/services/compact/postCompactCleanup.js +23 -0
- package/dist/src/services/compact/prompt.js +303 -0
- package/dist/src/services/compact/sessionMemoryCompact.js +316 -0
- package/dist/src/services/compact/timeBasedMCConfig.js +9 -0
- package/dist/src/services/diagnosticTracking.js +195 -0
- package/dist/src/services/extractMemories/extractMemories.js +309 -0
- package/dist/src/services/extractMemories/prompts.js +113 -0
- package/dist/src/services/internalLogging.js +53 -0
- package/dist/src/services/lsp/LSPClient.js +252 -0
- package/dist/src/services/lsp/LSPDiagnosticRegistry.js +179 -0
- package/dist/src/services/lsp/LSPServerInstance.js +245 -0
- package/dist/src/services/lsp/LSPServerManager.js +217 -0
- package/dist/src/services/lsp/config.js +38 -0
- package/dist/src/services/lsp/manager.js +132 -0
- package/dist/src/services/lsp/passiveFeedback.js +150 -0
- package/dist/src/services/mcp/InProcessTransport.js +37 -0
- package/dist/src/services/mcp/MCPConnectionManager.js +56 -0
- package/dist/src/services/mcp/SdkControlTransport.js +54 -0
- package/dist/src/services/mcp/auth.js +1419 -0
- package/dist/src/services/mcp/channelAllowlist.js +24 -0
- package/dist/src/services/mcp/channelNotification.js +118 -0
- package/dist/src/services/mcp/channelPermissions.js +89 -0
- package/dist/src/services/mcp/claudeai.js +95 -0
- package/dist/src/services/mcp/client.js +1896 -0
- package/dist/src/services/mcp/config.js +942 -0
- package/dist/src/services/mcp/elicitationHandler.js +171 -0
- package/dist/src/services/mcp/envExpansion.js +19 -0
- package/dist/src/services/mcp/headersHelper.js +64 -0
- package/dist/src/services/mcp/mcpStringUtils.js +33 -0
- package/dist/src/services/mcp/normalization.js +8 -0
- package/dist/src/services/mcp/oauthPort.js +47 -0
- package/dist/src/services/mcp/officialRegistry.js +42 -0
- package/dist/src/services/mcp/types.js +82 -0
- package/dist/src/services/mcp/useManageMCPConnections.js +536 -0
- package/dist/src/services/mcp/utils.js +284 -0
- package/dist/src/services/mcp/vscodeSdkMcp.js +55 -0
- package/dist/src/services/mcp/xaa.js +237 -0
- package/dist/src/services/mcp/xaaIdpLogin.js +286 -0
- package/dist/src/services/mcpServerApproval.js +39 -0
- package/dist/src/services/mockRateLimits.js +548 -0
- package/dist/src/services/notifier.js +112 -0
- package/dist/src/services/oauth/auth-code-listener.js +129 -0
- package/dist/src/services/oauth/client.js +341 -0
- package/dist/src/services/oauth/crypto.js +15 -0
- package/dist/src/services/oauth/getOauthProfile.js +44 -0
- package/dist/src/services/oauth/index.js +98 -0
- package/dist/src/services/plugins/PluginInstallationManager.js +111 -0
- package/dist/src/services/plugins/pluginCliCommands.js +173 -0
- package/dist/src/services/plugins/pluginOperations.js +597 -0
- package/dist/src/services/policyLimits/index.js +418 -0
- package/dist/src/services/policyLimits/types.js +5 -0
- package/dist/src/services/preventSleep.js +95 -0
- package/dist/src/services/rateLimitMessages.js +194 -0
- package/dist/src/services/rateLimitMocking.js +58 -0
- package/dist/src/services/remoteManagedSettings/index.js +368 -0
- package/dist/src/services/remoteManagedSettings/securityCheck.js +52 -0
- package/dist/src/services/remoteManagedSettings/syncCache.js +50 -0
- package/dist/src/services/remoteManagedSettings/syncCacheState.js +48 -0
- package/dist/src/services/remoteManagedSettings/types.js +7 -0
- package/dist/src/services/settingsSync/index.js +368 -0
- package/dist/src/services/settingsSync/types.js +18 -0
- package/dist/src/services/teamMemorySync/index.js +731 -0
- package/dist/src/services/teamMemorySync/secretScanner.js +210 -0
- package/dist/src/services/teamMemorySync/teamMemSecretGuard.js +4 -0
- package/dist/src/services/teamMemorySync/types.js +23 -0
- package/dist/src/services/teamMemorySync/watcher.js +197 -0
- package/dist/src/services/tips/tipHistory.js +17 -0
- package/dist/src/services/tips/tipRegistry.js +578 -0
- package/dist/src/services/tips/tipScheduler.js +37 -0
- package/dist/src/services/tokenEstimation.js +283 -0
- package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +75 -0
- package/dist/src/services/tools/StreamingToolExecutor.js +311 -0
- package/dist/src/services/tools/toolExecution.js +1009 -0
- package/dist/src/services/tools/toolHooks.js +384 -0
- package/dist/src/services/tools/toolOrchestration.js +96 -0
- package/dist/src/services/vcr.js +233 -0
- package/dist/src/services/voice.js +315 -0
- package/dist/src/services/voiceKeyterms.js +57 -0
- package/dist/src/services/voiceStreamSTT.js +265 -0
- package/dist/src/setup.js +235 -0
- package/dist/src/skills/bundled/batch.js +114 -0
- package/dist/src/skills/bundled/claudeApi.js +149 -0
- package/dist/src/skills/bundled/claudeApiContent.js +63 -0
- package/dist/src/skills/bundled/claudeInChrome.js +31 -0
- package/dist/src/skills/bundled/debug.js +89 -0
- package/dist/src/skills/bundled/index.js +22 -0
- package/dist/src/skills/bundled/keybindings.js +303 -0
- package/dist/src/skills/bundled/loop.js +86 -0
- package/dist/src/skills/bundled/loremIpsum.js +257 -0
- package/dist/src/skills/bundled/remember.js +78 -0
- package/dist/src/skills/bundled/scheduleRemoteAgents.js +360 -0
- package/dist/src/skills/bundled/simplify.js +70 -0
- package/dist/src/skills/bundled/skillify.js +179 -0
- package/dist/src/skills/bundled/stuck.js +76 -0
- package/dist/src/skills/bundled/updateConfig.js +471 -0
- package/dist/src/skills/bundled/verify/SKILL.md.js +1 -0
- package/dist/src/skills/bundled/verify/examples/cli.md.js +1 -0
- package/dist/src/skills/bundled/verify/examples/server.md.js +1 -0
- package/dist/src/skills/bundled/verify.js +27 -0
- package/dist/src/skills/bundled/verifyContent.js +8 -0
- package/dist/src/skills/bundledSkills.js +114 -0
- package/dist/src/skills/loadSkillsDir.js +583 -0
- package/dist/src/skills/mcpSkillBuilders.js +10 -0
- package/dist/src/state/AppState.js +153 -0
- package/dist/src/state/AppStateStore.js +115 -0
- package/dist/src/state/onChangeAppState.js +94 -0
- package/dist/src/state/selectors.js +29 -0
- package/dist/src/state/store.js +21 -0
- package/dist/src/state/teammateViewHelpers.js +89 -0
- package/dist/src/tasks/DreamTask/DreamTask.js +79 -0
- package/dist/src/tasks/InProcessTeammateTask/InProcessTeammateTask.js +70 -0
- package/dist/src/tasks/InProcessTeammateTask/types.js +15 -0
- package/dist/src/tasks/LocalAgentTask/LocalAgentTask.js +444 -0
- package/dist/src/tasks/LocalMainSessionTask.js +262 -0
- package/dist/src/tasks/LocalShellTask/LocalShellTask.js +419 -0
- package/dist/src/tasks/LocalShellTask/guards.js +3 -0
- package/dist/src/tasks/LocalShellTask/killShellTasks.js +44 -0
- package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +550 -0
- package/dist/src/tasks/pillLabel.js +53 -0
- package/dist/src/tasks/stopTask.js +53 -0
- package/dist/src/tasks/types.js +9 -0
- package/dist/src/tasks.js +22 -0
- package/dist/src/tools/AgentTool/AgentTool.js +919 -0
- package/dist/src/tools/AgentTool/UI.js +912 -0
- package/dist/src/tools/AgentTool/agentColorManager.js +42 -0
- package/dist/src/tools/AgentTool/agentDisplay.js +45 -0
- package/dist/src/tools/AgentTool/agentMemory.js +85 -0
- package/dist/src/tools/AgentTool/agentMemorySnapshot.js +109 -0
- package/dist/src/tools/AgentTool/agentToolUtils.js +387 -0
- package/dist/src/tools/AgentTool/built-in/claudeCodeGuideAgent.js +159 -0
- package/dist/src/tools/AgentTool/built-in/exploreAgent.js +66 -0
- package/dist/src/tools/AgentTool/built-in/generalPurposeAgent.js +26 -0
- package/dist/src/tools/AgentTool/built-in/planAgent.js +81 -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 +32 -0
- package/dist/src/tools/AgentTool/constants.js +7 -0
- package/dist/src/tools/AgentTool/forkSubagent.js +108 -0
- package/dist/src/tools/AgentTool/loadAgentsDir.js +409 -0
- package/dist/src/tools/AgentTool/prompt.js +194 -0
- package/dist/src/tools/AgentTool/resumeAgent.js +169 -0
- package/dist/src/tools/AgentTool/runAgent.js +457 -0
- package/dist/src/tools/AskUserQuestionTool/AskUserQuestionTool.js +282 -0
- package/dist/src/tools/AskUserQuestionTool/prompt.js +38 -0
- package/dist/src/tools/BashTool/BashTool.js +867 -0
- package/dist/src/tools/BashTool/BashToolResultMessage.js +208 -0
- package/dist/src/tools/BashTool/UI.js +189 -0
- package/dist/src/tools/BashTool/bashCommandHelpers.js +145 -0
- package/dist/src/tools/BashTool/bashPermissions.js +1193 -0
- package/dist/src/tools/BashTool/bashSecurity.js +1464 -0
- package/dist/src/tools/BashTool/commandSemantics.js +70 -0
- package/dist/src/tools/BashTool/commentLabel.js +8 -0
- package/dist/src/tools/BashTool/destructiveCommandWarning.js +74 -0
- package/dist/src/tools/BashTool/modeValidation.js +65 -0
- package/dist/src/tools/BashTool/pathValidation.js +771 -0
- package/dist/src/tools/BashTool/prompt.js +307 -0
- package/dist/src/tools/BashTool/readOnlyValidation.js +1312 -0
- package/dist/src/tools/BashTool/sedEditParser.js +179 -0
- package/dist/src/tools/BashTool/sedValidation.js +379 -0
- package/dist/src/tools/BashTool/shouldUseSandbox.js +102 -0
- package/dist/src/tools/BashTool/toolName.js +1 -0
- package/dist/src/tools/BashTool/utils.js +145 -0
- package/dist/src/tools/BriefTool/BriefTool.js +106 -0
- package/dist/src/tools/BriefTool/UI.js +158 -0
- package/dist/src/tools/BriefTool/attachments.js +54 -0
- package/dist/src/tools/BriefTool/prompt.js +19 -0
- package/dist/src/tools/BriefTool/upload.js +37 -0
- package/dist/src/tools/ConfigTool/ConfigTool.js +304 -0
- package/dist/src/tools/ConfigTool/UI.js +76 -0
- package/dist/src/tools/ConfigTool/constants.js +1 -0
- package/dist/src/tools/ConfigTool/prompt.js +76 -0
- package/dist/src/tools/ConfigTool/supportedSettings.js +141 -0
- package/dist/src/tools/EnterPlanModeTool/EnterPlanModeTool.js +91 -0
- package/dist/src/tools/EnterPlanModeTool/UI.js +49 -0
- package/dist/src/tools/EnterPlanModeTool/constants.js +1 -0
- package/dist/src/tools/EnterPlanModeTool/prompt.js +154 -0
- package/dist/src/tools/EnterWorktreeTool/EnterWorktreeTool.js +97 -0
- package/dist/src/tools/EnterWorktreeTool/UI.js +25 -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 +287 -0
- package/dist/src/tools/ExitPlanModeTool/UI.js +128 -0
- package/dist/src/tools/ExitPlanModeTool/constants.js +2 -0
- package/dist/src/tools/ExitPlanModeTool/prompt.js +25 -0
- package/dist/src/tools/ExitWorktreeTool/ExitWorktreeTool.js +217 -0
- package/dist/src/tools/ExitWorktreeTool/UI.js +36 -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 +447 -0
- package/dist/src/tools/FileEditTool/UI.js +289 -0
- package/dist/src/tools/FileEditTool/constants.js +4 -0
- package/dist/src/tools/FileEditTool/prompt.js +22 -0
- package/dist/src/tools/FileEditTool/types.js +37 -0
- package/dist/src/tools/FileEditTool/utils.js +411 -0
- package/dist/src/tools/FileReadTool/FileReadTool.js +759 -0
- package/dist/src/tools/FileReadTool/UI.js +232 -0
- package/dist/src/tools/FileReadTool/imageProcessor.js +34 -0
- package/dist/src/tools/FileReadTool/limits.js +28 -0
- package/dist/src/tools/FileReadTool/prompt.js +25 -0
- package/dist/src/tools/FileWriteTool/FileWriteTool.js +300 -0
- package/dist/src/tools/FileWriteTool/UI.js +460 -0
- package/dist/src/tools/FileWriteTool/prompt.js +16 -0
- package/dist/src/tools/GlobTool/GlobTool.js +155 -0
- package/dist/src/tools/GlobTool/UI.js +58 -0
- package/dist/src/tools/GlobTool/prompt.js +6 -0
- package/dist/src/tools/GrepTool/GrepTool.js +390 -0
- package/dist/src/tools/GrepTool/UI.js +254 -0
- package/dist/src/tools/GrepTool/prompt.js +16 -0
- package/dist/src/tools/LSPTool/LSPTool.js +541 -0
- package/dist/src/tools/LSPTool/UI.js +275 -0
- package/dist/src/tools/LSPTool/formatters.js +353 -0
- package/dist/src/tools/LSPTool/prompt.js +20 -0
- package/dist/src/tools/LSPTool/schemas.js +82 -0
- package/dist/src/tools/LSPTool/symbolContext.js +43 -0
- package/dist/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.js +91 -0
- package/dist/src/tools/ListMcpResourcesTool/UI.js +26 -0
- package/dist/src/tools/ListMcpResourcesTool/prompt.js +18 -0
- package/dist/src/tools/MCPTool/MCPTool.js +57 -0
- package/dist/src/tools/MCPTool/UI.js +433 -0
- package/dist/src/tools/MCPTool/classifyForCollapse.js +509 -0
- package/dist/src/tools/MCPTool/prompt.js +2 -0
- package/dist/src/tools/McpAuthTool/McpAuthTool.js +139 -0
- package/dist/src/tools/NotebookEditTool/NotebookEditTool.js +364 -0
- package/dist/src/tools/NotebookEditTool/UI.js +115 -0
- package/dist/src/tools/NotebookEditTool/constants.js +1 -0
- package/dist/src/tools/NotebookEditTool/prompt.js +2 -0
- package/dist/src/tools/PowerShellTool/PowerShellTool.js +700 -0
- package/dist/src/tools/PowerShellTool/UI.js +154 -0
- package/dist/src/tools/PowerShellTool/clmTypes.js +147 -0
- package/dist/src/tools/PowerShellTool/commandSemantics.js +37 -0
- package/dist/src/tools/PowerShellTool/commonParameters.js +17 -0
- package/dist/src/tools/PowerShellTool/destructiveCommandWarning.js +70 -0
- package/dist/src/tools/PowerShellTool/gitSafety.js +102 -0
- package/dist/src/tools/PowerShellTool/modeValidation.js +203 -0
- package/dist/src/tools/PowerShellTool/pathValidation.js +1259 -0
- package/dist/src/tools/PowerShellTool/powershellPermissions.js +791 -0
- package/dist/src/tools/PowerShellTool/powershellSecurity.js +612 -0
- package/dist/src/tools/PowerShellTool/prompt.js +130 -0
- package/dist/src/tools/PowerShellTool/readOnlyValidation.js +1000 -0
- package/dist/src/tools/PowerShellTool/toolName.js +1 -0
- package/dist/src/tools/REPLTool/constants.js +27 -0
- package/dist/src/tools/REPLTool/primitiveTools.js +21 -0
- package/dist/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.js +115 -0
- package/dist/src/tools/ReadMcpResourceTool/UI.js +37 -0
- package/dist/src/tools/ReadMcpResourceTool/prompt.js +15 -0
- package/dist/src/tools/RemoteTriggerTool/RemoteTriggerTool.js +138 -0
- package/dist/src/tools/RemoteTriggerTool/UI.js +28 -0
- package/dist/src/tools/RemoteTriggerTool/prompt.js +12 -0
- package/dist/src/tools/ScheduleCronTool/CronCreateTool.js +117 -0
- package/dist/src/tools/ScheduleCronTool/CronDeleteTool.js +83 -0
- package/dist/src/tools/ScheduleCronTool/CronListTool.js +77 -0
- package/dist/src/tools/ScheduleCronTool/UI.js +73 -0
- package/dist/src/tools/ScheduleCronTool/prompt.js +67 -0
- package/dist/src/tools/SendMessageTool/SendMessageTool.js +561 -0
- package/dist/src/tools/SendMessageTool/UI.js +30 -0
- package/dist/src/tools/SendMessageTool/constants.js +1 -0
- package/dist/src/tools/SendMessageTool/prompt.js +32 -0
- package/dist/src/tools/SkillTool/SkillTool.js +614 -0
- package/dist/src/tools/SkillTool/UI.js +141 -0
- package/dist/src/tools/SkillTool/constants.js +1 -0
- package/dist/src/tools/SkillTool/prompt.js +161 -0
- package/dist/src/tools/SleepTool/prompt.js +14 -0
- package/dist/src/tools/SyntheticOutputTool/SyntheticOutputTool.js +120 -0
- package/dist/src/tools/TaskCreateTool/TaskCreateTool.js +106 -0
- package/dist/src/tools/TaskCreateTool/constants.js +1 -0
- package/dist/src/tools/TaskCreateTool/prompt.js +48 -0
- package/dist/src/tools/TaskGetTool/TaskGetTool.js +110 -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 +92 -0
- package/dist/src/tools/TaskListTool/constants.js +1 -0
- package/dist/src/tools/TaskListTool/prompt.js +38 -0
- package/dist/src/tools/TaskOutputTool/TaskOutputTool.js +688 -0
- package/dist/src/tools/TaskOutputTool/constants.js +1 -0
- package/dist/src/tools/TaskStopTool/TaskStopTool.js +97 -0
- package/dist/src/tools/TaskStopTool/UI.js +39 -0
- package/dist/src/tools/TaskStopTool/prompt.js +7 -0
- package/dist/src/tools/TaskUpdateTool/TaskUpdateTool.js +279 -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 +161 -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 +96 -0
- package/dist/src/tools/TeamDeleteTool/UI.js +14 -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 +86 -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 +266 -0
- package/dist/src/tools/ToolSearchTool/constants.js +1 -0
- package/dist/src/tools/ToolSearchTool/prompt.js +40 -0
- package/dist/src/tools/TungstenTool/TungstenLiveMonitor.js +4 -0
- package/dist/src/tools/TungstenTool/TungstenTool.js +39 -0
- package/dist/src/tools/WebFetchTool/UI.js +91 -0
- package/dist/src/tools/WebFetchTool/WebFetchTool.js +234 -0
- package/dist/src/tools/WebFetchTool/preapproved.js +122 -0
- package/dist/src/tools/WebFetchTool/prompt.js +37 -0
- package/dist/src/tools/WebFetchTool/utils.js +303 -0
- package/dist/src/tools/WebSearchTool/UI.js +109 -0
- package/dist/src/tools/WebSearchTool/WebSearchTool.js +313 -0
- package/dist/src/tools/WebSearchTool/prompt.js +32 -0
- package/dist/src/tools/WorkflowTool/constants.js +1 -0
- package/dist/src/tools/shared/gitOperationTracking.js +158 -0
- package/dist/src/tools/shared/spawnMultiAgent.js +630 -0
- package/dist/src/tools/testing/TestingPermissionTool.js +66 -0
- package/dist/src/tools/utils.js +15 -0
- package/dist/src/tools.js +184 -0
- package/dist/src/types/command.js +6 -0
- package/dist/src/types/connectorText.js +3 -0
- package/dist/src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.js +525 -0
- package/dist/src/types/generated/events_mono/common/v1/auth.js +38 -0
- package/dist/src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.js +112 -0
- package/dist/src/types/generated/google/protobuf/timestamp.js +33 -0
- package/dist/src/types/hooks.js +121 -0
- package/dist/src/types/ids.js +10 -0
- package/dist/src/types/logs.js +9 -0
- package/dist/src/types/permissions.js +12 -0
- package/dist/src/types/plugin.js +64 -0
- package/dist/src/types/textInputTypes.js +10 -0
- package/dist/src/upstreamproxy/relay.js +274 -0
- package/dist/src/upstreamproxy/upstreamproxy.js +161 -0
- package/dist/src/utils/CircularBuffer.js +51 -0
- package/dist/src/utils/Cursor.js +1006 -0
- package/dist/src/utils/QueryGuard.js +57 -0
- package/dist/src/utils/Shell.js +260 -0
- package/dist/src/utils/ShellCommand.js +277 -0
- package/dist/src/utils/abortController.js +31 -0
- package/dist/src/utils/activityManager.js +91 -0
- package/dist/src/utils/advisor.js +63 -0
- package/dist/src/utils/agentContext.js +36 -0
- package/dist/src/utils/agentId.js +36 -0
- package/dist/src/utils/agentSwarmsEnabled.js +17 -0
- package/dist/src/utils/agenticSessionSearch.js +194 -0
- package/dist/src/utils/analyzeContext.js +692 -0
- package/dist/src/utils/ansiToPng.js +211 -0
- package/dist/src/utils/ansiToSvg.js +171 -0
- package/dist/src/utils/api.js +435 -0
- package/dist/src/utils/apiPreconnect.js +19 -0
- package/dist/src/utils/appleTerminalBackup.js +91 -0
- package/dist/src/utils/argumentSubstitution.js +58 -0
- package/dist/src/utils/array.js +12 -0
- package/dist/src/utils/asciicast.js +149 -0
- package/dist/src/utils/attachments.js +1854 -0
- package/dist/src/utils/attribution.js +215 -0
- package/dist/src/utils/auth.js +1197 -0
- package/dist/src/utils/authFileDescriptor.js +106 -0
- package/dist/src/utils/authPortable.js +14 -0
- package/dist/src/utils/autoModeDenials.js +10 -0
- package/dist/src/utils/autoRunIssue.js +126 -0
- package/dist/src/utils/autoUpdater.js +339 -0
- package/dist/src/utils/aws.js +30 -0
- package/dist/src/utils/awsAuthStatusManager.js +55 -0
- package/dist/src/utils/background/remote/preconditions.js +134 -0
- package/dist/src/utils/background/remote/remoteSession.js +42 -0
- package/dist/src/utils/backgroundHousekeeping.js +47 -0
- package/dist/src/utils/bash/ParsedCommand.js +194 -0
- package/dist/src/utils/bash/ShellSnapshot.js +333 -0
- package/dist/src/utils/bash/ast.js +1422 -0
- package/dist/src/utils/bash/bashParser.js +3625 -0
- package/dist/src/utils/bash/bashPipeCommand.js +138 -0
- package/dist/src/utils/bash/commands.js +668 -0
- package/dist/src/utils/bash/heredoc.js +288 -0
- package/dist/src/utils/bash/parser.js +110 -0
- package/dist/src/utils/bash/prefix.js +119 -0
- package/dist/src/utils/bash/registry.js +20 -0
- package/dist/src/utils/bash/shellCompletion.js +127 -0
- package/dist/src/utils/bash/shellPrefix.js +11 -0
- package/dist/src/utils/bash/shellQuote.js +159 -0
- package/dist/src/utils/bash/shellQuoting.js +43 -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 +259 -0
- package/dist/src/utils/betas.js +199 -0
- package/dist/src/utils/billing.js +47 -0
- package/dist/src/utils/binaryCheck.js +25 -0
- package/dist/src/utils/browser.js +47 -0
- package/dist/src/utils/bufferedWriter.js +73 -0
- package/dist/src/utils/bundledMode.js +6 -0
- package/dist/src/utils/caCerts.js +47 -0
- package/dist/src/utils/caCertsConfig.js +32 -0
- package/dist/src/utils/cachePaths.js +22 -0
- package/dist/src/utils/classifierApprovals.js +61 -0
- package/dist/src/utils/classifierApprovalsHook.js +8 -0
- package/dist/src/utils/claudeCodeHints.js +83 -0
- package/dist/src/utils/claudeDesktop.js +87 -0
- package/dist/src/utils/claudeInChrome/chromeNativeHost.js +353 -0
- package/dist/src/utils/claudeInChrome/common.js +416 -0
- package/dist/src/utils/claudeInChrome/mcpServer.js +190 -0
- package/dist/src/utils/claudeInChrome/prompt.js +60 -0
- package/dist/src/utils/claudeInChrome/setup.js +239 -0
- package/dist/src/utils/claudeInChrome/setupPortable.js +133 -0
- package/dist/src/utils/claudeInChrome/toolRendering.js +224 -0
- package/dist/src/utils/claudemd.js +727 -0
- package/dist/src/utils/cleanup.js +423 -0
- package/dist/src/utils/cleanupRegistry.js +8 -0
- package/dist/src/utils/cliArgs.js +21 -0
- package/dist/src/utils/cliHighlight.js +27 -0
- package/dist/src/utils/codeIndexing.js +92 -0
- package/dist/src/utils/collapseBackgroundBashNotifications.js +58 -0
- package/dist/src/utils/collapseHookSummaries.js +38 -0
- package/dist/src/utils/collapseReadSearch.js +569 -0
- package/dist/src/utils/collapseTeammateShutdowns.js +34 -0
- package/dist/src/utils/combinedAbortSignal.js +28 -0
- package/dist/src/utils/commandLifecycle.js +7 -0
- package/dist/src/utils/commitAttribution.js +510 -0
- package/dist/src/utils/completionCache.js +126 -0
- package/dist/src/utils/computerUse/appNames.js +104 -0
- package/dist/src/utils/computerUse/cleanup.js +37 -0
- package/dist/src/utils/computerUse/common.js +25 -0
- package/dist/src/utils/computerUse/computerUseLock.js +117 -0
- package/dist/src/utils/computerUse/drainRunLoop.js +44 -0
- package/dist/src/utils/computerUse/escHotkey.js +33 -0
- package/dist/src/utils/computerUse/executor.js +303 -0
- package/dist/src/utils/computerUse/gates.js +40 -0
- package/dist/src/utils/computerUse/hostAdapter.js +48 -0
- package/dist/src/utils/computerUse/inputLoader.js +10 -0
- package/dist/src/utils/computerUse/mcpServer.js +61 -0
- package/dist/src/utils/computerUse/setup.js +25 -0
- package/dist/src/utils/computerUse/swiftLoader.js +7 -0
- package/dist/src/utils/computerUse/toolRendering.js +96 -0
- package/dist/src/utils/computerUse/wrapper.js +242 -0
- package/dist/src/utils/concurrentSessions.js +108 -0
- package/dist/src/utils/config.js +801 -0
- package/dist/src/utils/configConstants.js +11 -0
- package/dist/src/utils/contentArray.js +19 -0
- package/dist/src/utils/context.js +135 -0
- package/dist/src/utils/contextAnalysis.js +152 -0
- package/dist/src/utils/contextSuggestions.js +141 -0
- package/dist/src/utils/controlMessageCompat.js +17 -0
- package/dist/src/utils/conversationRecovery.js +278 -0
- package/dist/src/utils/cron.js +182 -0
- package/dist/src/utils/cronJitterConfig.js +22 -0
- package/dist/src/utils/cronScheduler.js +295 -0
- package/dist/src/utils/cronTasks.js +183 -0
- package/dist/src/utils/cronTasksLock.js +116 -0
- package/dist/src/utils/crossProjectResume.js +36 -0
- package/dist/src/utils/crypto.js +3 -0
- package/dist/src/utils/cwd.js +16 -0
- package/dist/src/utils/debug.js +170 -0
- package/dist/src/utils/debugFilter.js +69 -0
- package/dist/src/utils/deepLink/banner.js +52 -0
- package/dist/src/utils/deepLink/parseDeepLink.js +68 -0
- package/dist/src/utils/deepLink/protocolHandler.js +66 -0
- package/dist/src/utils/deepLink/registerProtocol.js +206 -0
- package/dist/src/utils/deepLink/terminalLauncher.js +321 -0
- package/dist/src/utils/deepLink/terminalPreference.js +26 -0
- package/dist/src/utils/desktopDeepLink.js +154 -0
- package/dist/src/utils/detectRepository.js +98 -0
- package/dist/src/utils/diagLogs.js +47 -0
- package/dist/src/utils/diff.js +92 -0
- package/dist/src/utils/directMemberMessage.js +27 -0
- package/dist/src/utils/displayTags.js +12 -0
- package/dist/src/utils/doctorContextWarnings.js +151 -0
- package/dist/src/utils/doctorDiagnostic.js +388 -0
- package/dist/src/utils/dxt/helpers.js +36 -0
- package/dist/src/utils/dxt/zip.js +112 -0
- package/dist/src/utils/earlyInput.js +98 -0
- package/dist/src/utils/editor.js +105 -0
- package/dist/src/utils/effort.js +188 -0
- package/dist/src/utils/embeddedTools.js +10 -0
- package/dist/src/utils/env.js +284 -0
- package/dist/src/utils/envDynamic.js +91 -0
- package/dist/src/utils/envUtils.js +88 -0
- package/dist/src/utils/envValidation.js +26 -0
- package/dist/src/utils/errorLogSink.js +142 -0
- package/dist/src/utils/errors.js +123 -0
- package/dist/src/utils/exampleCommands.js +133 -0
- package/dist/src/utils/execFileNoThrow.js +82 -0
- package/dist/src/utils/execFileNoThrowPortable.js +52 -0
- package/dist/src/utils/execSyncWrapper.js +16 -0
- package/dist/src/utils/exportRenderer.js +78 -0
- package/dist/src/utils/extraUsage.js +16 -0
- package/dist/src/utils/fastMode.js +331 -0
- package/dist/src/utils/file.js +318 -0
- package/dist/src/utils/fileHistory.js +662 -0
- package/dist/src/utils/fileOperationAnalytics.js +23 -0
- package/dist/src/utils/filePersistence/filePersistence.js +165 -0
- package/dist/src/utils/filePersistence/outputsScanner.js +72 -0
- package/dist/src/utils/filePersistence/types.js +3 -0
- package/dist/src/utils/fileRead.js +53 -0
- package/dist/src/utils/fileReadCache.js +54 -0
- package/dist/src/utils/fileStateCache.js +79 -0
- package/dist/src/utils/findExecutable.js +5 -0
- package/dist/src/utils/fingerprint.js +30 -0
- package/dist/src/utils/forkedAgent.js +253 -0
- package/dist/src/utils/format.js +200 -0
- package/dist/src/utils/formatBriefTimestamp.js +49 -0
- package/dist/src/utils/fpsTracker.js +32 -0
- package/dist/src/utils/frontmatterParser.js +159 -0
- package/dist/src/utils/fsOperations.js +548 -0
- package/dist/src/utils/fullscreen.js +83 -0
- package/dist/src/utils/generatedFiles.js +96 -0
- package/dist/src/utils/generators.js +60 -0
- package/dist/src/utils/genericProcessUtils.js +96 -0
- package/dist/src/utils/getWorktreePaths.js +30 -0
- package/dist/src/utils/getWorktreePathsPortable.js +14 -0
- package/dist/src/utils/ghPrStatus.js +51 -0
- package/dist/src/utils/git/gitConfigParser.js +166 -0
- package/dist/src/utils/git/gitFilesystem.js +413 -0
- package/dist/src/utils/git/gitignore.js +52 -0
- package/dist/src/utils/git.js +520 -0
- package/dist/src/utils/gitDiff.js +291 -0
- package/dist/src/utils/gitSettings.js +10 -0
- package/dist/src/utils/github/ghAuthStatus.js +15 -0
- package/dist/src/utils/githubRepoPathMapping.js +92 -0
- package/dist/src/utils/glob.js +65 -0
- package/dist/src/utils/gracefulShutdown.js +274 -0
- package/dist/src/utils/groupToolUses.js +107 -0
- package/dist/src/utils/handlePromptSubmit.js +323 -0
- package/dist/src/utils/hash.js +21 -0
- package/dist/src/utils/headlessProfiler.js +95 -0
- package/dist/src/utils/heapDumpService.js +157 -0
- package/dist/src/utils/heatmap.js +118 -0
- package/dist/src/utils/highlightMatch.js +28 -0
- package/dist/src/utils/hooks/AsyncHookRegistry.js +190 -0
- package/dist/src/utils/hooks/apiQueryHookHelper.js +67 -0
- package/dist/src/utils/hooks/execAgentHook.js +216 -0
- package/dist/src/utils/hooks/execHttpHook.js +106 -0
- package/dist/src/utils/hooks/execPromptHook.js +153 -0
- package/dist/src/utils/hooks/fileChangedWatcher.js +154 -0
- package/dist/src/utils/hooks/hookEvents.js +92 -0
- package/dist/src/utils/hooks/hookHelpers.js +43 -0
- package/dist/src/utils/hooks/hooksConfigManager.js +386 -0
- package/dist/src/utils/hooks/hooksConfigSnapshot.js +52 -0
- package/dist/src/utils/hooks/hooksSettings.js +175 -0
- package/dist/src/utils/hooks/postSamplingHooks.js +26 -0
- package/dist/src/utils/hooks/registerFrontmatterHooks.js +34 -0
- package/dist/src/utils/hooks/registerSkillHooks.js +24 -0
- package/dist/src/utils/hooks/sessionHooks.js +176 -0
- package/dist/src/utils/hooks/skillImprovement.js +200 -0
- package/dist/src/utils/hooks/ssrfGuard.js +157 -0
- package/dist/src/utils/hooks.js +2879 -0
- package/dist/src/utils/horizontalScroll.js +72 -0
- package/dist/src/utils/http.js +80 -0
- package/dist/src/utils/hyperlink.js +13 -0
- package/dist/src/utils/iTermBackup.js +46 -0
- package/dist/src/utils/ide.js +938 -0
- package/dist/src/utils/idePathConversion.js +47 -0
- package/dist/src/utils/idleTimeout.js +33 -0
- package/dist/src/utils/imagePaste.js +190 -0
- package/dist/src/utils/imageResizer.js +459 -0
- package/dist/src/utils/imageStore.js +109 -0
- package/dist/src/utils/imageValidation.js +61 -0
- package/dist/src/utils/immediateCommand.js +4 -0
- package/dist/src/utils/inProcessTeammateHelpers.js +28 -0
- package/dist/src/utils/ink.js +14 -0
- package/dist/src/utils/intl.js +61 -0
- package/dist/src/utils/jetbrains.js +130 -0
- package/dist/src/utils/json.js +182 -0
- package/dist/src/utils/jsonRead.js +4 -0
- package/dist/src/utils/keyboardShortcuts.js +8 -0
- package/dist/src/utils/lazySchema.js +4 -0
- package/dist/src/utils/listSessionsImpl.js +219 -0
- package/dist/src/utils/localInstaller.js +86 -0
- package/dist/src/utils/lockfile.js +19 -0
- package/dist/src/utils/log.js +164 -0
- package/dist/src/utils/logoV2Utils.js +192 -0
- package/dist/src/utils/mailbox.js +51 -0
- package/dist/src/utils/managedEnv.js +90 -0
- package/dist/src/utils/managedEnvConstants.js +136 -0
- package/dist/src/utils/markdown.js +216 -0
- package/dist/src/utils/markdownConfigLoader.js +293 -0
- package/dist/src/utils/mcp/dateTimeParser.js +73 -0
- package/dist/src/utils/mcp/elicitationValidation.js +208 -0
- package/dist/src/utils/mcpInstructionsDelta.js +71 -0
- package/dist/src/utils/mcpOutputStorage.js +124 -0
- package/dist/src/utils/mcpValidation.js +138 -0
- package/dist/src/utils/mcpWebSocketTransport.js +152 -0
- package/dist/src/utils/memoize.js +125 -0
- package/dist/src/utils/memory/types.js +8 -0
- package/dist/src/utils/memory/versions.js +4 -0
- package/dist/src/utils/memoryFileDetection.js +151 -0
- package/dist/src/utils/messagePredicates.js +3 -0
- package/dist/src/utils/messageQueueManager.js +267 -0
- package/dist/src/utils/messages/mappers.js +198 -0
- package/dist/src/utils/messages/systemInit.js +47 -0
- package/dist/src/utils/messages.js +3450 -0
- package/dist/src/utils/model/agent.js +91 -0
- package/dist/src/utils/model/aliases.js +16 -0
- package/dist/src/utils/model/antModels.js +23 -0
- package/dist/src/utils/model/bedrock.js +158 -0
- package/dist/src/utils/model/check1mAccess.js +49 -0
- package/dist/src/utils/model/configs.js +81 -0
- package/dist/src/utils/model/contextWindowUpgradeCheck.js +32 -0
- package/dist/src/utils/model/deprecation.js +56 -0
- package/dist/src/utils/model/model.js +377 -0
- package/dist/src/utils/model/modelAllowlist.js +91 -0
- package/dist/src/utils/model/modelCapabilities.js +97 -0
- package/dist/src/utils/model/modelOptions.js +403 -0
- package/dist/src/utils/model/modelStrings.js +112 -0
- package/dist/src/utils/model/modelSupportOverrides.js +32 -0
- package/dist/src/utils/model/providers.js +23 -0
- package/dist/src/utils/model/validateModel.js +108 -0
- package/dist/src/utils/modelCost.js +135 -0
- package/dist/src/utils/modifiers.js +22 -0
- package/dist/src/utils/mtls.js +101 -0
- package/dist/src/utils/nativeInstaller/download.js +309 -0
- package/dist/src/utils/nativeInstaller/index.js +9 -0
- package/dist/src/utils/nativeInstaller/installer.js +1104 -0
- package/dist/src/utils/nativeInstaller/packageManagers.js +174 -0
- package/dist/src/utils/nativeInstaller/pidLock.js +230 -0
- package/dist/src/utils/notebook.js +170 -0
- package/dist/src/utils/objectGroupBy.js +12 -0
- package/dist/src/utils/pasteStore.js +61 -0
- package/dist/src/utils/path.js +65 -0
- package/dist/src/utils/pdf.js +199 -0
- package/dist/src/utils/pdfUtils.js +36 -0
- package/dist/src/utils/peerAddress.js +9 -0
- package/dist/src/utils/permissions/PermissionMode.js +82 -0
- package/dist/src/utils/permissions/PermissionPromptToolResultSchema.js +62 -0
- package/dist/src/utils/permissions/PermissionResult.js +10 -0
- package/dist/src/utils/permissions/PermissionRule.js +7 -0
- package/dist/src/utils/permissions/PermissionUpdate.js +219 -0
- package/dist/src/utils/permissions/PermissionUpdateSchema.js +49 -0
- package/dist/src/utils/permissions/autoModeState.js +26 -0
- package/dist/src/utils/permissions/bashClassifier.js +29 -0
- package/dist/src/utils/permissions/bypassPermissionsKillswitch.js +69 -0
- package/dist/src/utils/permissions/classifierDecision.js +56 -0
- package/dist/src/utils/permissions/classifierShared.js +14 -0
- package/dist/src/utils/permissions/dangerousPatterns.js +44 -0
- package/dist/src/utils/permissions/denialTracking.js +28 -0
- package/dist/src/utils/permissions/filesystem.js +889 -0
- package/dist/src/utils/permissions/getNextPermissionMode.js +51 -0
- package/dist/src/utils/permissions/pathValidation.js +230 -0
- package/dist/src/utils/permissions/permissionExplainer.js +162 -0
- package/dist/src/utils/permissions/permissionRuleParser.js +90 -0
- package/dist/src/utils/permissions/permissionSetup.js +770 -0
- package/dist/src/utils/permissions/permissions.js +585 -0
- package/dist/src/utils/permissions/permissionsLoader.js +160 -0
- package/dist/src/utils/permissions/shadowedRuleDetection.js +81 -0
- package/dist/src/utils/permissions/shellRuleMatching.js +108 -0
- package/dist/src/utils/permissions/yoloClassifier.js +868 -0
- package/dist/src/utils/planModeV2.js +45 -0
- package/dist/src/utils/plans.js +232 -0
- package/dist/src/utils/platform.js +102 -0
- package/dist/src/utils/plugins/addDirPluginSettings.js +30 -0
- package/dist/src/utils/plugins/cacheUtils.js +144 -0
- package/dist/src/utils/plugins/dependencyResolver.js +118 -0
- package/dist/src/utils/plugins/fetchTelemetry.js +65 -0
- package/dist/src/utils/plugins/gitAvailability.js +18 -0
- package/dist/src/utils/plugins/headlessPluginInstall.js +92 -0
- package/dist/src/utils/plugins/hintRecommendation.js +95 -0
- package/dist/src/utils/plugins/installCounts.js +144 -0
- package/dist/src/utils/plugins/installedPluginsManager.js +645 -0
- package/dist/src/utils/plugins/loadPluginAgents.js +197 -0
- package/dist/src/utils/plugins/loadPluginCommands.js +488 -0
- package/dist/src/utils/plugins/loadPluginHooks.js +170 -0
- package/dist/src/utils/plugins/loadPluginOutputStyles.js +98 -0
- package/dist/src/utils/plugins/lspPluginIntegration.js +216 -0
- package/dist/src/utils/plugins/lspRecommendation.js +193 -0
- package/dist/src/utils/plugins/managedPlugins.js +18 -0
- package/dist/src/utils/plugins/marketplaceHelpers.js +309 -0
- package/dist/src/utils/plugins/marketplaceManager.js +1225 -0
- package/dist/src/utils/plugins/mcpPluginIntegration.js +336 -0
- package/dist/src/utils/plugins/mcpbHandler.js +487 -0
- package/dist/src/utils/plugins/officialMarketplace.js +5 -0
- package/dist/src/utils/plugins/officialMarketplaceGcs.js +118 -0
- package/dist/src/utils/plugins/officialMarketplaceStartupCheck.js +267 -0
- package/dist/src/utils/plugins/orphanedPluginFilter.js +47 -0
- package/dist/src/utils/plugins/parseMarketplaceInput.js +75 -0
- package/dist/src/utils/plugins/performStartupChecks.js +34 -0
- package/dist/src/utils/plugins/pluginAutoupdate.js +130 -0
- package/dist/src/utils/plugins/pluginBlocklist.js +66 -0
- package/dist/src/utils/plugins/pluginDirectories.js +78 -0
- package/dist/src/utils/plugins/pluginFlagging.js +122 -0
- package/dist/src/utils/plugins/pluginIdentifier.js +37 -0
- package/dist/src/utils/plugins/pluginInstallationHelpers.js +281 -0
- package/dist/src/utils/plugins/pluginLoader.js +1596 -0
- package/dist/src/utils/plugins/pluginOptionsStorage.js +162 -0
- package/dist/src/utils/plugins/pluginPolicy.js +5 -0
- package/dist/src/utils/plugins/pluginStartupCheck.js +176 -0
- package/dist/src/utils/plugins/pluginVersioning.js +53 -0
- package/dist/src/utils/plugins/reconciler.js +133 -0
- package/dist/src/utils/plugins/refresh.js +96 -0
- package/dist/src/utils/plugins/schemas.js +411 -0
- package/dist/src/utils/plugins/validatePlugin.js +573 -0
- package/dist/src/utils/plugins/walkPluginMarkdown.js +30 -0
- package/dist/src/utils/plugins/zipCache.js +211 -0
- package/dist/src/utils/plugins/zipCacheAdapters.js +93 -0
- package/dist/src/utils/powershell/dangerousCmdlets.js +97 -0
- package/dist/src/utils/powershell/parser.js +929 -0
- package/dist/src/utils/powershell/staticPrefix.js +142 -0
- package/dist/src/utils/preflightChecks.js +196 -0
- package/dist/src/utils/privacyLevel.js +21 -0
- package/dist/src/utils/process.js +42 -0
- package/dist/src/utils/processUserInput/processBashCommand.js +109 -0
- package/dist/src/utils/processUserInput/processSlashCommand.js +600 -0
- package/dist/src/utils/processUserInput/processTextPrompt.js +54 -0
- package/dist/src/utils/processUserInput/processUserInput.js +272 -0
- package/dist/src/utils/profilerBase.js +15 -0
- package/dist/src/utils/promptCategory.js +21 -0
- package/dist/src/utils/promptEditor.js +115 -0
- package/dist/src/utils/promptShellExecution.js +76 -0
- package/dist/src/utils/proxy.js +228 -0
- package/dist/src/utils/queryContext.js +83 -0
- package/dist/src/utils/queryHelpers.js +329 -0
- package/dist/src/utils/queryProfiler.js +177 -0
- package/dist/src/utils/queueProcessor.js +41 -0
- package/dist/src/utils/readEditContext.js +131 -0
- package/dist/src/utils/readFileInRange.js +212 -0
- package/dist/src/utils/releaseNotes.js +186 -0
- package/dist/src/utils/renderOptions.js +45 -0
- package/dist/src/utils/ripgrep.js +383 -0
- package/dist/src/utils/sandbox/sandbox-adapter.js +505 -0
- package/dist/src/utils/sandbox/sandbox-ui-utils.js +3 -0
- package/dist/src/utils/sanitization.js +33 -0
- package/dist/src/utils/screenshotClipboard.js +73 -0
- package/dist/src/utils/sdkEventQueue.js +36 -0
- package/dist/src/utils/secureStorage/fallbackStorage.js +45 -0
- package/dist/src/utils/secureStorage/index.js +9 -0
- package/dist/src/utils/secureStorage/keychainPrefetch.js +43 -0
- package/dist/src/utils/secureStorage/macOsKeychainHelpers.js +42 -0
- package/dist/src/utils/secureStorage/macOsKeychainStorage.js +147 -0
- package/dist/src/utils/secureStorage/plainTextStorage.js +77 -0
- package/dist/src/utils/semanticBoolean.js +4 -0
- package/dist/src/utils/semanticNumber.js +11 -0
- package/dist/src/utils/semver.js +43 -0
- package/dist/src/utils/sequential.js +30 -0
- package/dist/src/utils/sessionActivity.js +95 -0
- package/dist/src/utils/sessionEnvVars.js +13 -0
- package/dist/src/utils/sessionEnvironment.js +113 -0
- package/dist/src/utils/sessionFileAccessHooks.js +150 -0
- package/dist/src/utils/sessionIngressAuth.js +79 -0
- package/dist/src/utils/sessionRestore.js +205 -0
- package/dist/src/utils/sessionStart.js +119 -0
- package/dist/src/utils/sessionState.js +48 -0
- package/dist/src/utils/sessionStorage.js +2891 -0
- package/dist/src/utils/sessionStoragePortable.js +486 -0
- package/dist/src/utils/sessionTitle.js +89 -0
- package/dist/src/utils/sessionUrl.js +33 -0
- package/dist/src/utils/set.js +38 -0
- package/dist/src/utils/settings/allErrors.js +11 -0
- package/dist/src/utils/settings/applySettingsChange.js +40 -0
- package/dist/src/utils/settings/changeDetector.js +279 -0
- package/dist/src/utils/settings/constants.js +119 -0
- package/dist/src/utils/settings/internalWrites.js +15 -0
- package/dist/src/utils/settings/managedPath.js +19 -0
- package/dist/src/utils/settings/mdm/constants.js +33 -0
- package/dist/src/utils/settings/mdm/rawRead.js +72 -0
- package/dist/src/utils/settings/mdm/settings.js +160 -0
- package/dist/src/utils/settings/permissionValidation.js +169 -0
- package/dist/src/utils/settings/pluginOnlyPolicy.js +19 -0
- package/dist/src/utils/settings/schemaOutput.js +7 -0
- package/dist/src/utils/settings/settings.js +530 -0
- package/dist/src/utils/settings/settingsCache.js +36 -0
- package/dist/src/utils/settings/toolValidationConfig.js +58 -0
- package/dist/src/utils/settings/types.js +224 -0
- package/dist/src/utils/settings/validateEditTool.js +26 -0
- package/dist/src/utils/settings/validation.js +160 -0
- package/dist/src/utils/settings/validationTips.js +94 -0
- package/dist/src/utils/shell/bashProvider.js +123 -0
- package/dist/src/utils/shell/outputLimits.js +7 -0
- package/dist/src/utils/shell/powershellDetection.js +50 -0
- package/dist/src/utils/shell/powershellProvider.js +50 -0
- package/dist/src/utils/shell/prefix.js +183 -0
- package/dist/src/utils/shell/readOnlyCommandValidation.js +1347 -0
- package/dist/src/utils/shell/resolveDefaultShell.js +4 -0
- package/dist/src/utils/shell/shellProvider.js +2 -0
- package/dist/src/utils/shell/shellToolUtils.js +10 -0
- package/dist/src/utils/shell/specPrefix.js +152 -0
- package/dist/src/utils/shellConfig.js +88 -0
- package/dist/src/utils/sideQuery.js +108 -0
- package/dist/src/utils/sideQuestion.js +78 -0
- package/dist/src/utils/signal.js +18 -0
- package/dist/src/utils/sinks.js +6 -0
- package/dist/src/utils/skills/skillChangeDetector.js +184 -0
- package/dist/src/utils/slashCommandParsing.js +25 -0
- package/dist/src/utils/sleep.js +43 -0
- package/dist/src/utils/sliceAnsi.js +48 -0
- package/dist/src/utils/slowOperations.js +165 -0
- package/dist/src/utils/standaloneAgent.js +7 -0
- package/dist/src/utils/startupProfiler.js +106 -0
- package/dist/src/utils/staticRender.js +78 -0
- package/dist/src/utils/stats.js +598 -0
- package/dist/src/utils/statsCache.js +223 -0
- package/dist/src/utils/status.js +361 -0
- package/dist/src/utils/statusNoticeDefinitions.js +280 -0
- package/dist/src/utils/statusNoticeHelpers.js +10 -0
- package/dist/src/utils/stream.js +72 -0
- package/dist/src/utils/streamJsonStdoutGuard.js +73 -0
- package/dist/src/utils/streamlinedTransform.js +130 -0
- package/dist/src/utils/stringUtils.js +108 -0
- package/dist/src/utils/subprocessEnv.js +42 -0
- package/dist/src/utils/suggestions/commandSuggestions.js +301 -0
- package/dist/src/utils/suggestions/directoryCompletion.js +134 -0
- package/dist/src/utils/suggestions/shellHistoryCompletion.js +65 -0
- package/dist/src/utils/suggestions/skillUsageTracking.js +33 -0
- package/dist/src/utils/suggestions/slackChannelSuggestions.js +141 -0
- package/dist/src/utils/swarm/It2SetupPrompt.js +537 -0
- package/dist/src/utils/swarm/backends/ITermBackend.js +153 -0
- package/dist/src/utils/swarm/backends/InProcessBackend.js +160 -0
- package/dist/src/utils/swarm/backends/PaneBackendExecutor.js +171 -0
- package/dist/src/utils/swarm/backends/TmuxBackend.js +458 -0
- package/dist/src/utils/swarm/backends/detection.js +43 -0
- package/dist/src/utils/swarm/backends/it2Setup.js +134 -0
- package/dist/src/utils/swarm/backends/registry.js +220 -0
- package/dist/src/utils/swarm/backends/teammateModeSnapshot.js +33 -0
- package/dist/src/utils/swarm/backends/types.js +3 -0
- package/dist/src/utils/swarm/constants.js +11 -0
- package/dist/src/utils/swarm/inProcessRunner.js +818 -0
- package/dist/src/utils/swarm/leaderPermissionBridge.js +20 -0
- package/dist/src/utils/swarm/permissionSync.js +474 -0
- package/dist/src/utils/swarm/reconnection.js +55 -0
- package/dist/src/utils/swarm/spawnInProcess.js +164 -0
- package/dist/src/utils/swarm/spawnUtils.js +76 -0
- package/dist/src/utils/swarm/teamHelpers.js +320 -0
- package/dist/src/utils/swarm/teammateInit.js +65 -0
- package/dist/src/utils/swarm/teammateLayoutManager.js +40 -0
- package/dist/src/utils/swarm/teammateModel.js +5 -0
- package/dist/src/utils/swarm/teammatePromptAddendum.js +11 -0
- package/dist/src/utils/systemDirectories.js +42 -0
- package/dist/src/utils/systemPrompt.js +41 -0
- package/dist/src/utils/systemPromptType.js +3 -0
- package/dist/src/utils/systemTheme.js +61 -0
- package/dist/src/utils/taggedId.js +27 -0
- package/dist/src/utils/task/TaskOutput.js +244 -0
- package/dist/src/utils/task/diskOutput.js +267 -0
- package/dist/src/utils/task/framework.js +178 -0
- package/dist/src/utils/task/outputFormatting.js +21 -0
- package/dist/src/utils/task/sdkProgress.js +18 -0
- package/dist/src/utils/tasks.js +481 -0
- package/dist/src/utils/teamDiscovery.js +33 -0
- package/dist/src/utils/teamMemoryOps.js +40 -0
- package/dist/src/utils/teammate.js +132 -0
- package/dist/src/utils/teammateContext.js +17 -0
- package/dist/src/utils/teammateMailbox.js +541 -0
- package/dist/src/utils/telemetry/betaSessionTracing.js +255 -0
- package/dist/src/utils/telemetry/bigqueryExporter.js +162 -0
- package/dist/src/utils/telemetry/events.js +46 -0
- package/dist/src/utils/telemetry/instrumentation.js +534 -0
- package/dist/src/utils/telemetry/logger.js +26 -0
- package/dist/src/utils/telemetry/perfettoTracing.js +636 -0
- package/dist/src/utils/telemetry/pluginTelemetry.js +99 -0
- package/dist/src/utils/telemetry/sessionTracing.js +564 -0
- package/dist/src/utils/telemetry/skillLoadedEvent.js +22 -0
- package/dist/src/utils/telemetryAttributes.js +50 -0
- package/dist/src/utils/teleport/api.js +236 -0
- package/dist/src/utils/teleport/environmentSelection.js +42 -0
- package/dist/src/utils/teleport/environments.js +74 -0
- package/dist/src/utils/teleport/gitBundle.js +153 -0
- package/dist/src/utils/teleport.js +856 -0
- package/dist/src/utils/tempfile.js +7 -0
- package/dist/src/utils/terminal.js +65 -0
- package/dist/src/utils/terminalPanel.js +133 -0
- package/dist/src/utils/textHighlighting.js +109 -0
- package/dist/src/utils/theme.js +465 -0
- package/dist/src/utils/thinking.js +92 -0
- package/dist/src/utils/timeouts.js +22 -0
- package/dist/src/utils/tmuxSocket.js +216 -0
- package/dist/src/utils/todo/types.js +9 -0
- package/dist/src/utils/tokenBudget.js +54 -0
- package/dist/src/utils/tokens.js +123 -0
- package/dist/src/utils/toolErrors.js +87 -0
- package/dist/src/utils/toolPool.js +22 -0
- package/dist/src/utils/toolResultStorage.js +444 -0
- package/dist/src/utils/toolSchemaCache.js +7 -0
- package/dist/src/utils/toolSearch.js +314 -0
- package/dist/src/utils/transcriptSearch.js +143 -0
- package/dist/src/utils/treeify.js +89 -0
- package/dist/src/utils/truncate.js +113 -0
- package/dist/src/utils/ultraplan/ccrSession.js +187 -0
- package/dist/src/utils/ultraplan/keyword.js +81 -0
- package/dist/src/utils/ultraplan/prompt.txt.js +1 -0
- package/dist/src/utils/unaryLogging.js +15 -0
- package/dist/src/utils/undercover.js +57 -0
- package/dist/src/utils/user.js +111 -0
- package/dist/src/utils/userAgent.js +3 -0
- package/dist/src/utils/userPromptKeywords.js +13 -0
- package/dist/src/utils/uuid.js +11 -0
- package/dist/src/utils/warningHandler.js +74 -0
- package/dist/src/utils/which.js +50 -0
- package/dist/src/utils/windowsPaths.js +104 -0
- package/dist/src/utils/withResolvers.js +9 -0
- package/dist/src/utils/words.js +763 -0
- package/dist/src/utils/workloadContext.js +9 -0
- package/dist/src/utils/worktree.js +841 -0
- package/dist/src/utils/worktreeModeEnabled.js +3 -0
- package/dist/src/utils/xdg.js +24 -0
- package/dist/src/utils/xml.js +6 -0
- package/dist/src/utils/yaml.js +6 -0
- package/dist/src/utils/zodToJsonSchema.js +10 -0
- package/dist/src/vim/motions.js +54 -0
- package/dist/src/vim/operators.js +329 -0
- package/dist/src/vim/textObjects.js +137 -0
- package/dist/src/vim/transitions.js +324 -0
- package/dist/src/vim/types.js +60 -0
- package/dist/src/voice/voiceModeEnabled.js +18 -0
- package/dist/stubs/ant-claude-for-chrome-mcp.js +6 -0
- package/dist/stubs/color-diff-napi.js +30 -0
- package/litellm.yaml +25 -0
- package/package.json +93 -0
|
@@ -0,0 +1,1638 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Align,
|
|
3
|
+
BoxSizing,
|
|
4
|
+
Dimension,
|
|
5
|
+
Direction,
|
|
6
|
+
Display,
|
|
7
|
+
Edge,
|
|
8
|
+
Errata,
|
|
9
|
+
ExperimentalFeature,
|
|
10
|
+
FlexDirection,
|
|
11
|
+
Gutter,
|
|
12
|
+
Justify,
|
|
13
|
+
MeasureMode,
|
|
14
|
+
Overflow,
|
|
15
|
+
PositionType,
|
|
16
|
+
Unit,
|
|
17
|
+
Wrap
|
|
18
|
+
} from "./enums.js";
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
Align,
|
|
22
|
+
BoxSizing,
|
|
23
|
+
Dimension,
|
|
24
|
+
Direction,
|
|
25
|
+
Display,
|
|
26
|
+
Edge,
|
|
27
|
+
Errata,
|
|
28
|
+
ExperimentalFeature,
|
|
29
|
+
FlexDirection,
|
|
30
|
+
Gutter,
|
|
31
|
+
Justify,
|
|
32
|
+
MeasureMode,
|
|
33
|
+
Overflow,
|
|
34
|
+
PositionType,
|
|
35
|
+
Unit,
|
|
36
|
+
Wrap
|
|
37
|
+
};
|
|
38
|
+
const UNDEFINED_VALUE = { unit: Unit.Undefined, value: NaN };
|
|
39
|
+
const AUTO_VALUE = { unit: Unit.Auto, value: NaN };
|
|
40
|
+
function pointValue(v) {
|
|
41
|
+
return { unit: Unit.Point, value: v };
|
|
42
|
+
}
|
|
43
|
+
function percentValue(v) {
|
|
44
|
+
return { unit: Unit.Percent, value: v };
|
|
45
|
+
}
|
|
46
|
+
function resolveValue(v, ownerSize) {
|
|
47
|
+
switch (v.unit) {
|
|
48
|
+
case Unit.Point:
|
|
49
|
+
return v.value;
|
|
50
|
+
case Unit.Percent:
|
|
51
|
+
return isNaN(ownerSize) ? NaN : v.value * ownerSize / 100;
|
|
52
|
+
default:
|
|
53
|
+
return NaN;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function isDefined(n) {
|
|
57
|
+
return !isNaN(n);
|
|
58
|
+
}
|
|
59
|
+
function sameFloat(a, b) {
|
|
60
|
+
return a === b || a !== a && b !== b;
|
|
61
|
+
}
|
|
62
|
+
function defaultStyle() {
|
|
63
|
+
return {
|
|
64
|
+
direction: Direction.Inherit,
|
|
65
|
+
flexDirection: FlexDirection.Column,
|
|
66
|
+
justifyContent: Justify.FlexStart,
|
|
67
|
+
alignItems: Align.Stretch,
|
|
68
|
+
alignSelf: Align.Auto,
|
|
69
|
+
alignContent: Align.FlexStart,
|
|
70
|
+
flexWrap: Wrap.NoWrap,
|
|
71
|
+
overflow: Overflow.Visible,
|
|
72
|
+
display: Display.Flex,
|
|
73
|
+
positionType: PositionType.Relative,
|
|
74
|
+
flexGrow: 0,
|
|
75
|
+
flexShrink: 0,
|
|
76
|
+
flexBasis: AUTO_VALUE,
|
|
77
|
+
margin: new Array(9).fill(UNDEFINED_VALUE),
|
|
78
|
+
padding: new Array(9).fill(UNDEFINED_VALUE),
|
|
79
|
+
border: new Array(9).fill(UNDEFINED_VALUE),
|
|
80
|
+
position: new Array(9).fill(UNDEFINED_VALUE),
|
|
81
|
+
gap: new Array(3).fill(UNDEFINED_VALUE),
|
|
82
|
+
width: AUTO_VALUE,
|
|
83
|
+
height: AUTO_VALUE,
|
|
84
|
+
minWidth: UNDEFINED_VALUE,
|
|
85
|
+
minHeight: UNDEFINED_VALUE,
|
|
86
|
+
maxWidth: UNDEFINED_VALUE,
|
|
87
|
+
maxHeight: UNDEFINED_VALUE
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const EDGE_LEFT = 0;
|
|
91
|
+
const EDGE_TOP = 1;
|
|
92
|
+
const EDGE_RIGHT = 2;
|
|
93
|
+
const EDGE_BOTTOM = 3;
|
|
94
|
+
function resolveEdge(edges, physicalEdge, ownerSize, allowAuto = false) {
|
|
95
|
+
let v = edges[physicalEdge];
|
|
96
|
+
if (v.unit === Unit.Undefined) {
|
|
97
|
+
if (physicalEdge === EDGE_LEFT || physicalEdge === EDGE_RIGHT) {
|
|
98
|
+
v = edges[Edge.Horizontal];
|
|
99
|
+
} else {
|
|
100
|
+
v = edges[Edge.Vertical];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (v.unit === Unit.Undefined) {
|
|
104
|
+
v = edges[Edge.All];
|
|
105
|
+
}
|
|
106
|
+
if (v.unit === Unit.Undefined) {
|
|
107
|
+
if (physicalEdge === EDGE_LEFT)
|
|
108
|
+
v = edges[Edge.Start];
|
|
109
|
+
if (physicalEdge === EDGE_RIGHT)
|
|
110
|
+
v = edges[Edge.End];
|
|
111
|
+
}
|
|
112
|
+
if (v.unit === Unit.Undefined)
|
|
113
|
+
return 0;
|
|
114
|
+
if (v.unit === Unit.Auto)
|
|
115
|
+
return allowAuto ? NaN : 0;
|
|
116
|
+
return resolveValue(v, ownerSize);
|
|
117
|
+
}
|
|
118
|
+
function resolveEdgeRaw(edges, physicalEdge) {
|
|
119
|
+
let v = edges[physicalEdge];
|
|
120
|
+
if (v.unit === Unit.Undefined) {
|
|
121
|
+
if (physicalEdge === EDGE_LEFT || physicalEdge === EDGE_RIGHT) {
|
|
122
|
+
v = edges[Edge.Horizontal];
|
|
123
|
+
} else {
|
|
124
|
+
v = edges[Edge.Vertical];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (v.unit === Unit.Undefined)
|
|
128
|
+
v = edges[Edge.All];
|
|
129
|
+
if (v.unit === Unit.Undefined) {
|
|
130
|
+
if (physicalEdge === EDGE_LEFT)
|
|
131
|
+
v = edges[Edge.Start];
|
|
132
|
+
if (physicalEdge === EDGE_RIGHT)
|
|
133
|
+
v = edges[Edge.End];
|
|
134
|
+
}
|
|
135
|
+
return v;
|
|
136
|
+
}
|
|
137
|
+
function isMarginAuto(edges, physicalEdge) {
|
|
138
|
+
return resolveEdgeRaw(edges, physicalEdge).unit === Unit.Auto;
|
|
139
|
+
}
|
|
140
|
+
function hasAnyAutoEdge(edges) {
|
|
141
|
+
for (let i = 0;i < 9; i++)
|
|
142
|
+
if (edges[i].unit === 3)
|
|
143
|
+
return true;
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
function hasAnyDefinedEdge(edges) {
|
|
147
|
+
for (let i = 0;i < 9; i++)
|
|
148
|
+
if (edges[i].unit !== 0)
|
|
149
|
+
return true;
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
function resolveEdges4Into(edges, ownerSize, out) {
|
|
153
|
+
const eH = edges[6];
|
|
154
|
+
const eV = edges[7];
|
|
155
|
+
const eA = edges[8];
|
|
156
|
+
const eS = edges[4];
|
|
157
|
+
const eE = edges[5];
|
|
158
|
+
const pctDenom = isNaN(ownerSize) ? NaN : ownerSize / 100;
|
|
159
|
+
let v = edges[0];
|
|
160
|
+
if (v.unit === 0)
|
|
161
|
+
v = eH;
|
|
162
|
+
if (v.unit === 0)
|
|
163
|
+
v = eA;
|
|
164
|
+
if (v.unit === 0)
|
|
165
|
+
v = eS;
|
|
166
|
+
out[0] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0;
|
|
167
|
+
v = edges[1];
|
|
168
|
+
if (v.unit === 0)
|
|
169
|
+
v = eV;
|
|
170
|
+
if (v.unit === 0)
|
|
171
|
+
v = eA;
|
|
172
|
+
out[1] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0;
|
|
173
|
+
v = edges[2];
|
|
174
|
+
if (v.unit === 0)
|
|
175
|
+
v = eH;
|
|
176
|
+
if (v.unit === 0)
|
|
177
|
+
v = eA;
|
|
178
|
+
if (v.unit === 0)
|
|
179
|
+
v = eE;
|
|
180
|
+
out[2] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0;
|
|
181
|
+
v = edges[3];
|
|
182
|
+
if (v.unit === 0)
|
|
183
|
+
v = eV;
|
|
184
|
+
if (v.unit === 0)
|
|
185
|
+
v = eA;
|
|
186
|
+
out[3] = v.unit === 1 ? v.value : v.unit === 2 ? v.value * pctDenom : 0;
|
|
187
|
+
}
|
|
188
|
+
function isRow(dir) {
|
|
189
|
+
return dir === FlexDirection.Row || dir === FlexDirection.RowReverse;
|
|
190
|
+
}
|
|
191
|
+
function isReverse(dir) {
|
|
192
|
+
return dir === FlexDirection.RowReverse || dir === FlexDirection.ColumnReverse;
|
|
193
|
+
}
|
|
194
|
+
function crossAxis(dir) {
|
|
195
|
+
return isRow(dir) ? FlexDirection.Column : FlexDirection.Row;
|
|
196
|
+
}
|
|
197
|
+
function leadingEdge(dir) {
|
|
198
|
+
switch (dir) {
|
|
199
|
+
case FlexDirection.Row:
|
|
200
|
+
return EDGE_LEFT;
|
|
201
|
+
case FlexDirection.RowReverse:
|
|
202
|
+
return EDGE_RIGHT;
|
|
203
|
+
case FlexDirection.Column:
|
|
204
|
+
return EDGE_TOP;
|
|
205
|
+
case FlexDirection.ColumnReverse:
|
|
206
|
+
return EDGE_BOTTOM;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function trailingEdge(dir) {
|
|
210
|
+
switch (dir) {
|
|
211
|
+
case FlexDirection.Row:
|
|
212
|
+
return EDGE_RIGHT;
|
|
213
|
+
case FlexDirection.RowReverse:
|
|
214
|
+
return EDGE_LEFT;
|
|
215
|
+
case FlexDirection.Column:
|
|
216
|
+
return EDGE_BOTTOM;
|
|
217
|
+
case FlexDirection.ColumnReverse:
|
|
218
|
+
return EDGE_TOP;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
function createConfig() {
|
|
222
|
+
const config = {
|
|
223
|
+
pointScaleFactor: 1,
|
|
224
|
+
errata: Errata.None,
|
|
225
|
+
useWebDefaults: false,
|
|
226
|
+
free() {},
|
|
227
|
+
isExperimentalFeatureEnabled() {
|
|
228
|
+
return false;
|
|
229
|
+
},
|
|
230
|
+
setExperimentalFeatureEnabled() {},
|
|
231
|
+
setPointScaleFactor(f) {
|
|
232
|
+
config.pointScaleFactor = f;
|
|
233
|
+
},
|
|
234
|
+
getErrata() {
|
|
235
|
+
return config.errata;
|
|
236
|
+
},
|
|
237
|
+
setErrata(e) {
|
|
238
|
+
config.errata = e;
|
|
239
|
+
},
|
|
240
|
+
setUseWebDefaults(v) {
|
|
241
|
+
config.useWebDefaults = v;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
return config;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export class Node {
|
|
248
|
+
style;
|
|
249
|
+
layout;
|
|
250
|
+
parent;
|
|
251
|
+
children;
|
|
252
|
+
measureFunc;
|
|
253
|
+
config;
|
|
254
|
+
isDirty_;
|
|
255
|
+
isReferenceBaseline_;
|
|
256
|
+
_flexBasis = 0;
|
|
257
|
+
_mainSize = 0;
|
|
258
|
+
_crossSize = 0;
|
|
259
|
+
_lineIndex = 0;
|
|
260
|
+
_hasAutoMargin = false;
|
|
261
|
+
_hasPosition = false;
|
|
262
|
+
_hasPadding = false;
|
|
263
|
+
_hasBorder = false;
|
|
264
|
+
_hasMargin = false;
|
|
265
|
+
_lW = NaN;
|
|
266
|
+
_lH = NaN;
|
|
267
|
+
_lWM = 0;
|
|
268
|
+
_lHM = 0;
|
|
269
|
+
_lOW = NaN;
|
|
270
|
+
_lOH = NaN;
|
|
271
|
+
_lFW = false;
|
|
272
|
+
_lFH = false;
|
|
273
|
+
_lOutW = NaN;
|
|
274
|
+
_lOutH = NaN;
|
|
275
|
+
_hasL = false;
|
|
276
|
+
_mW = NaN;
|
|
277
|
+
_mH = NaN;
|
|
278
|
+
_mWM = 0;
|
|
279
|
+
_mHM = 0;
|
|
280
|
+
_mOW = NaN;
|
|
281
|
+
_mOH = NaN;
|
|
282
|
+
_mOutW = NaN;
|
|
283
|
+
_mOutH = NaN;
|
|
284
|
+
_hasM = false;
|
|
285
|
+
_fbBasis = NaN;
|
|
286
|
+
_fbOwnerW = NaN;
|
|
287
|
+
_fbOwnerH = NaN;
|
|
288
|
+
_fbAvailMain = NaN;
|
|
289
|
+
_fbAvailCross = NaN;
|
|
290
|
+
_fbCrossMode = 0;
|
|
291
|
+
_fbGen = -1;
|
|
292
|
+
_cIn = null;
|
|
293
|
+
_cOut = null;
|
|
294
|
+
_cGen = -1;
|
|
295
|
+
_cN = 0;
|
|
296
|
+
_cWr = 0;
|
|
297
|
+
constructor(config) {
|
|
298
|
+
this.style = defaultStyle();
|
|
299
|
+
this.layout = {
|
|
300
|
+
left: 0,
|
|
301
|
+
top: 0,
|
|
302
|
+
width: 0,
|
|
303
|
+
height: 0,
|
|
304
|
+
border: [0, 0, 0, 0],
|
|
305
|
+
padding: [0, 0, 0, 0],
|
|
306
|
+
margin: [0, 0, 0, 0]
|
|
307
|
+
};
|
|
308
|
+
this.parent = null;
|
|
309
|
+
this.children = [];
|
|
310
|
+
this.measureFunc = null;
|
|
311
|
+
this.config = config ?? DEFAULT_CONFIG;
|
|
312
|
+
this.isDirty_ = true;
|
|
313
|
+
this.isReferenceBaseline_ = false;
|
|
314
|
+
_yogaLiveNodes++;
|
|
315
|
+
}
|
|
316
|
+
insertChild(child, index) {
|
|
317
|
+
child.parent = this;
|
|
318
|
+
this.children.splice(index, 0, child);
|
|
319
|
+
this.markDirty();
|
|
320
|
+
}
|
|
321
|
+
removeChild(child) {
|
|
322
|
+
const idx = this.children.indexOf(child);
|
|
323
|
+
if (idx >= 0) {
|
|
324
|
+
this.children.splice(idx, 1);
|
|
325
|
+
child.parent = null;
|
|
326
|
+
this.markDirty();
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
getChild(index) {
|
|
330
|
+
return this.children[index];
|
|
331
|
+
}
|
|
332
|
+
getChildCount() {
|
|
333
|
+
return this.children.length;
|
|
334
|
+
}
|
|
335
|
+
getParent() {
|
|
336
|
+
return this.parent;
|
|
337
|
+
}
|
|
338
|
+
free() {
|
|
339
|
+
this.parent = null;
|
|
340
|
+
this.children = [];
|
|
341
|
+
this.measureFunc = null;
|
|
342
|
+
this._cIn = null;
|
|
343
|
+
this._cOut = null;
|
|
344
|
+
_yogaLiveNodes--;
|
|
345
|
+
}
|
|
346
|
+
freeRecursive() {
|
|
347
|
+
for (const c of this.children)
|
|
348
|
+
c.freeRecursive();
|
|
349
|
+
this.free();
|
|
350
|
+
}
|
|
351
|
+
reset() {
|
|
352
|
+
this.style = defaultStyle();
|
|
353
|
+
this.children = [];
|
|
354
|
+
this.parent = null;
|
|
355
|
+
this.measureFunc = null;
|
|
356
|
+
this.isDirty_ = true;
|
|
357
|
+
this._hasAutoMargin = false;
|
|
358
|
+
this._hasPosition = false;
|
|
359
|
+
this._hasPadding = false;
|
|
360
|
+
this._hasBorder = false;
|
|
361
|
+
this._hasMargin = false;
|
|
362
|
+
this._hasL = false;
|
|
363
|
+
this._hasM = false;
|
|
364
|
+
this._cN = 0;
|
|
365
|
+
this._cWr = 0;
|
|
366
|
+
this._fbBasis = NaN;
|
|
367
|
+
}
|
|
368
|
+
markDirty() {
|
|
369
|
+
this.isDirty_ = true;
|
|
370
|
+
if (this.parent && !this.parent.isDirty_)
|
|
371
|
+
this.parent.markDirty();
|
|
372
|
+
}
|
|
373
|
+
isDirty() {
|
|
374
|
+
return this.isDirty_;
|
|
375
|
+
}
|
|
376
|
+
hasNewLayout() {
|
|
377
|
+
return true;
|
|
378
|
+
}
|
|
379
|
+
markLayoutSeen() {}
|
|
380
|
+
setMeasureFunc(fn) {
|
|
381
|
+
this.measureFunc = fn;
|
|
382
|
+
this.markDirty();
|
|
383
|
+
}
|
|
384
|
+
unsetMeasureFunc() {
|
|
385
|
+
this.measureFunc = null;
|
|
386
|
+
this.markDirty();
|
|
387
|
+
}
|
|
388
|
+
getComputedLeft() {
|
|
389
|
+
return this.layout.left;
|
|
390
|
+
}
|
|
391
|
+
getComputedTop() {
|
|
392
|
+
return this.layout.top;
|
|
393
|
+
}
|
|
394
|
+
getComputedWidth() {
|
|
395
|
+
return this.layout.width;
|
|
396
|
+
}
|
|
397
|
+
getComputedHeight() {
|
|
398
|
+
return this.layout.height;
|
|
399
|
+
}
|
|
400
|
+
getComputedRight() {
|
|
401
|
+
const p = this.parent;
|
|
402
|
+
return p ? p.layout.width - this.layout.left - this.layout.width : 0;
|
|
403
|
+
}
|
|
404
|
+
getComputedBottom() {
|
|
405
|
+
const p = this.parent;
|
|
406
|
+
return p ? p.layout.height - this.layout.top - this.layout.height : 0;
|
|
407
|
+
}
|
|
408
|
+
getComputedLayout() {
|
|
409
|
+
return {
|
|
410
|
+
left: this.layout.left,
|
|
411
|
+
top: this.layout.top,
|
|
412
|
+
right: this.getComputedRight(),
|
|
413
|
+
bottom: this.getComputedBottom(),
|
|
414
|
+
width: this.layout.width,
|
|
415
|
+
height: this.layout.height
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
getComputedBorder(edge) {
|
|
419
|
+
return this.layout.border[physicalEdge(edge)];
|
|
420
|
+
}
|
|
421
|
+
getComputedPadding(edge) {
|
|
422
|
+
return this.layout.padding[physicalEdge(edge)];
|
|
423
|
+
}
|
|
424
|
+
getComputedMargin(edge) {
|
|
425
|
+
return this.layout.margin[physicalEdge(edge)];
|
|
426
|
+
}
|
|
427
|
+
setWidth(v) {
|
|
428
|
+
this.style.width = parseDimension(v);
|
|
429
|
+
this.markDirty();
|
|
430
|
+
}
|
|
431
|
+
setWidthPercent(v) {
|
|
432
|
+
this.style.width = percentValue(v);
|
|
433
|
+
this.markDirty();
|
|
434
|
+
}
|
|
435
|
+
setWidthAuto() {
|
|
436
|
+
this.style.width = AUTO_VALUE;
|
|
437
|
+
this.markDirty();
|
|
438
|
+
}
|
|
439
|
+
setHeight(v) {
|
|
440
|
+
this.style.height = parseDimension(v);
|
|
441
|
+
this.markDirty();
|
|
442
|
+
}
|
|
443
|
+
setHeightPercent(v) {
|
|
444
|
+
this.style.height = percentValue(v);
|
|
445
|
+
this.markDirty();
|
|
446
|
+
}
|
|
447
|
+
setHeightAuto() {
|
|
448
|
+
this.style.height = AUTO_VALUE;
|
|
449
|
+
this.markDirty();
|
|
450
|
+
}
|
|
451
|
+
setMinWidth(v) {
|
|
452
|
+
this.style.minWidth = parseDimension(v);
|
|
453
|
+
this.markDirty();
|
|
454
|
+
}
|
|
455
|
+
setMinWidthPercent(v) {
|
|
456
|
+
this.style.minWidth = percentValue(v);
|
|
457
|
+
this.markDirty();
|
|
458
|
+
}
|
|
459
|
+
setMinHeight(v) {
|
|
460
|
+
this.style.minHeight = parseDimension(v);
|
|
461
|
+
this.markDirty();
|
|
462
|
+
}
|
|
463
|
+
setMinHeightPercent(v) {
|
|
464
|
+
this.style.minHeight = percentValue(v);
|
|
465
|
+
this.markDirty();
|
|
466
|
+
}
|
|
467
|
+
setMaxWidth(v) {
|
|
468
|
+
this.style.maxWidth = parseDimension(v);
|
|
469
|
+
this.markDirty();
|
|
470
|
+
}
|
|
471
|
+
setMaxWidthPercent(v) {
|
|
472
|
+
this.style.maxWidth = percentValue(v);
|
|
473
|
+
this.markDirty();
|
|
474
|
+
}
|
|
475
|
+
setMaxHeight(v) {
|
|
476
|
+
this.style.maxHeight = parseDimension(v);
|
|
477
|
+
this.markDirty();
|
|
478
|
+
}
|
|
479
|
+
setMaxHeightPercent(v) {
|
|
480
|
+
this.style.maxHeight = percentValue(v);
|
|
481
|
+
this.markDirty();
|
|
482
|
+
}
|
|
483
|
+
setFlexDirection(dir) {
|
|
484
|
+
this.style.flexDirection = dir;
|
|
485
|
+
this.markDirty();
|
|
486
|
+
}
|
|
487
|
+
setFlexGrow(v) {
|
|
488
|
+
this.style.flexGrow = v ?? 0;
|
|
489
|
+
this.markDirty();
|
|
490
|
+
}
|
|
491
|
+
setFlexShrink(v) {
|
|
492
|
+
this.style.flexShrink = v ?? 0;
|
|
493
|
+
this.markDirty();
|
|
494
|
+
}
|
|
495
|
+
setFlex(v) {
|
|
496
|
+
if (v === undefined || isNaN(v)) {
|
|
497
|
+
this.style.flexGrow = 0;
|
|
498
|
+
this.style.flexShrink = 0;
|
|
499
|
+
} else if (v > 0) {
|
|
500
|
+
this.style.flexGrow = v;
|
|
501
|
+
this.style.flexShrink = 1;
|
|
502
|
+
this.style.flexBasis = pointValue(0);
|
|
503
|
+
} else if (v < 0) {
|
|
504
|
+
this.style.flexGrow = 0;
|
|
505
|
+
this.style.flexShrink = -v;
|
|
506
|
+
} else {
|
|
507
|
+
this.style.flexGrow = 0;
|
|
508
|
+
this.style.flexShrink = 0;
|
|
509
|
+
}
|
|
510
|
+
this.markDirty();
|
|
511
|
+
}
|
|
512
|
+
setFlexBasis(v) {
|
|
513
|
+
this.style.flexBasis = parseDimension(v);
|
|
514
|
+
this.markDirty();
|
|
515
|
+
}
|
|
516
|
+
setFlexBasisPercent(v) {
|
|
517
|
+
this.style.flexBasis = percentValue(v);
|
|
518
|
+
this.markDirty();
|
|
519
|
+
}
|
|
520
|
+
setFlexBasisAuto() {
|
|
521
|
+
this.style.flexBasis = AUTO_VALUE;
|
|
522
|
+
this.markDirty();
|
|
523
|
+
}
|
|
524
|
+
setFlexWrap(wrap) {
|
|
525
|
+
this.style.flexWrap = wrap;
|
|
526
|
+
this.markDirty();
|
|
527
|
+
}
|
|
528
|
+
setAlignItems(a) {
|
|
529
|
+
this.style.alignItems = a;
|
|
530
|
+
this.markDirty();
|
|
531
|
+
}
|
|
532
|
+
setAlignSelf(a) {
|
|
533
|
+
this.style.alignSelf = a;
|
|
534
|
+
this.markDirty();
|
|
535
|
+
}
|
|
536
|
+
setAlignContent(a) {
|
|
537
|
+
this.style.alignContent = a;
|
|
538
|
+
this.markDirty();
|
|
539
|
+
}
|
|
540
|
+
setJustifyContent(j) {
|
|
541
|
+
this.style.justifyContent = j;
|
|
542
|
+
this.markDirty();
|
|
543
|
+
}
|
|
544
|
+
setDisplay(d) {
|
|
545
|
+
this.style.display = d;
|
|
546
|
+
this.markDirty();
|
|
547
|
+
}
|
|
548
|
+
getDisplay() {
|
|
549
|
+
return this.style.display;
|
|
550
|
+
}
|
|
551
|
+
setPositionType(t) {
|
|
552
|
+
this.style.positionType = t;
|
|
553
|
+
this.markDirty();
|
|
554
|
+
}
|
|
555
|
+
setPosition(edge, v) {
|
|
556
|
+
this.style.position[edge] = parseDimension(v);
|
|
557
|
+
this._hasPosition = hasAnyDefinedEdge(this.style.position);
|
|
558
|
+
this.markDirty();
|
|
559
|
+
}
|
|
560
|
+
setPositionPercent(edge, v) {
|
|
561
|
+
this.style.position[edge] = percentValue(v);
|
|
562
|
+
this._hasPosition = true;
|
|
563
|
+
this.markDirty();
|
|
564
|
+
}
|
|
565
|
+
setPositionAuto(edge) {
|
|
566
|
+
this.style.position[edge] = AUTO_VALUE;
|
|
567
|
+
this._hasPosition = true;
|
|
568
|
+
this.markDirty();
|
|
569
|
+
}
|
|
570
|
+
setOverflow(o) {
|
|
571
|
+
this.style.overflow = o;
|
|
572
|
+
this.markDirty();
|
|
573
|
+
}
|
|
574
|
+
setDirection(d) {
|
|
575
|
+
this.style.direction = d;
|
|
576
|
+
this.markDirty();
|
|
577
|
+
}
|
|
578
|
+
setBoxSizing(_) {}
|
|
579
|
+
setMargin(edge, v) {
|
|
580
|
+
const val = parseDimension(v);
|
|
581
|
+
this.style.margin[edge] = val;
|
|
582
|
+
if (val.unit === Unit.Auto)
|
|
583
|
+
this._hasAutoMargin = true;
|
|
584
|
+
else
|
|
585
|
+
this._hasAutoMargin = hasAnyAutoEdge(this.style.margin);
|
|
586
|
+
this._hasMargin = this._hasAutoMargin || hasAnyDefinedEdge(this.style.margin);
|
|
587
|
+
this.markDirty();
|
|
588
|
+
}
|
|
589
|
+
setMarginPercent(edge, v) {
|
|
590
|
+
this.style.margin[edge] = percentValue(v);
|
|
591
|
+
this._hasAutoMargin = hasAnyAutoEdge(this.style.margin);
|
|
592
|
+
this._hasMargin = true;
|
|
593
|
+
this.markDirty();
|
|
594
|
+
}
|
|
595
|
+
setMarginAuto(edge) {
|
|
596
|
+
this.style.margin[edge] = AUTO_VALUE;
|
|
597
|
+
this._hasAutoMargin = true;
|
|
598
|
+
this._hasMargin = true;
|
|
599
|
+
this.markDirty();
|
|
600
|
+
}
|
|
601
|
+
setPadding(edge, v) {
|
|
602
|
+
this.style.padding[edge] = parseDimension(v);
|
|
603
|
+
this._hasPadding = hasAnyDefinedEdge(this.style.padding);
|
|
604
|
+
this.markDirty();
|
|
605
|
+
}
|
|
606
|
+
setPaddingPercent(edge, v) {
|
|
607
|
+
this.style.padding[edge] = percentValue(v);
|
|
608
|
+
this._hasPadding = true;
|
|
609
|
+
this.markDirty();
|
|
610
|
+
}
|
|
611
|
+
setBorder(edge, v) {
|
|
612
|
+
this.style.border[edge] = v === undefined ? UNDEFINED_VALUE : pointValue(v);
|
|
613
|
+
this._hasBorder = hasAnyDefinedEdge(this.style.border);
|
|
614
|
+
this.markDirty();
|
|
615
|
+
}
|
|
616
|
+
setGap(gutter, v) {
|
|
617
|
+
this.style.gap[gutter] = parseDimension(v);
|
|
618
|
+
this.markDirty();
|
|
619
|
+
}
|
|
620
|
+
setGapPercent(gutter, v) {
|
|
621
|
+
this.style.gap[gutter] = percentValue(v);
|
|
622
|
+
this.markDirty();
|
|
623
|
+
}
|
|
624
|
+
getFlexDirection() {
|
|
625
|
+
return this.style.flexDirection;
|
|
626
|
+
}
|
|
627
|
+
getJustifyContent() {
|
|
628
|
+
return this.style.justifyContent;
|
|
629
|
+
}
|
|
630
|
+
getAlignItems() {
|
|
631
|
+
return this.style.alignItems;
|
|
632
|
+
}
|
|
633
|
+
getAlignSelf() {
|
|
634
|
+
return this.style.alignSelf;
|
|
635
|
+
}
|
|
636
|
+
getAlignContent() {
|
|
637
|
+
return this.style.alignContent;
|
|
638
|
+
}
|
|
639
|
+
getFlexGrow() {
|
|
640
|
+
return this.style.flexGrow;
|
|
641
|
+
}
|
|
642
|
+
getFlexShrink() {
|
|
643
|
+
return this.style.flexShrink;
|
|
644
|
+
}
|
|
645
|
+
getFlexBasis() {
|
|
646
|
+
return this.style.flexBasis;
|
|
647
|
+
}
|
|
648
|
+
getFlexWrap() {
|
|
649
|
+
return this.style.flexWrap;
|
|
650
|
+
}
|
|
651
|
+
getWidth() {
|
|
652
|
+
return this.style.width;
|
|
653
|
+
}
|
|
654
|
+
getHeight() {
|
|
655
|
+
return this.style.height;
|
|
656
|
+
}
|
|
657
|
+
getOverflow() {
|
|
658
|
+
return this.style.overflow;
|
|
659
|
+
}
|
|
660
|
+
getPositionType() {
|
|
661
|
+
return this.style.positionType;
|
|
662
|
+
}
|
|
663
|
+
getDirection() {
|
|
664
|
+
return this.style.direction;
|
|
665
|
+
}
|
|
666
|
+
copyStyle(_) {}
|
|
667
|
+
setDirtiedFunc(_) {}
|
|
668
|
+
unsetDirtiedFunc() {}
|
|
669
|
+
setIsReferenceBaseline(v) {
|
|
670
|
+
this.isReferenceBaseline_ = v;
|
|
671
|
+
this.markDirty();
|
|
672
|
+
}
|
|
673
|
+
isReferenceBaseline() {
|
|
674
|
+
return this.isReferenceBaseline_;
|
|
675
|
+
}
|
|
676
|
+
setAspectRatio(_) {}
|
|
677
|
+
getAspectRatio() {
|
|
678
|
+
return NaN;
|
|
679
|
+
}
|
|
680
|
+
setAlwaysFormsContainingBlock(_) {}
|
|
681
|
+
calculateLayout(ownerWidth, ownerHeight, _direction) {
|
|
682
|
+
_yogaNodesVisited = 0;
|
|
683
|
+
_yogaMeasureCalls = 0;
|
|
684
|
+
_yogaCacheHits = 0;
|
|
685
|
+
_generation++;
|
|
686
|
+
const w = ownerWidth === undefined ? NaN : ownerWidth;
|
|
687
|
+
const h = ownerHeight === undefined ? NaN : ownerHeight;
|
|
688
|
+
layoutNode(this, w, h, isDefined(w) ? MeasureMode.Exactly : MeasureMode.Undefined, isDefined(h) ? MeasureMode.Exactly : MeasureMode.Undefined, w, h, true);
|
|
689
|
+
const mar = this.layout.margin;
|
|
690
|
+
const posL = resolveValue(resolveEdgeRaw(this.style.position, EDGE_LEFT), isDefined(w) ? w : 0);
|
|
691
|
+
const posT = resolveValue(resolveEdgeRaw(this.style.position, EDGE_TOP), isDefined(w) ? w : 0);
|
|
692
|
+
this.layout.left = mar[EDGE_LEFT] + (isDefined(posL) ? posL : 0);
|
|
693
|
+
this.layout.top = mar[EDGE_TOP] + (isDefined(posT) ? posT : 0);
|
|
694
|
+
roundLayout(this, this.config.pointScaleFactor, 0, 0);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
const DEFAULT_CONFIG = createConfig();
|
|
698
|
+
const CACHE_SLOTS = 4;
|
|
699
|
+
function cacheWrite(node, aW, aH, wM, hM, oW, oH, fW, fH, wasDirty) {
|
|
700
|
+
if (!node._cIn) {
|
|
701
|
+
node._cIn = new Float64Array(CACHE_SLOTS * 8);
|
|
702
|
+
node._cOut = new Float64Array(CACHE_SLOTS * 2);
|
|
703
|
+
}
|
|
704
|
+
if (wasDirty && node._cGen !== _generation) {
|
|
705
|
+
node._cN = 0;
|
|
706
|
+
node._cWr = 0;
|
|
707
|
+
}
|
|
708
|
+
const i = node._cWr++ % CACHE_SLOTS;
|
|
709
|
+
if (node._cN < CACHE_SLOTS)
|
|
710
|
+
node._cN = node._cWr;
|
|
711
|
+
const o = i * 8;
|
|
712
|
+
const cIn = node._cIn;
|
|
713
|
+
cIn[o] = aW;
|
|
714
|
+
cIn[o + 1] = aH;
|
|
715
|
+
cIn[o + 2] = wM;
|
|
716
|
+
cIn[o + 3] = hM;
|
|
717
|
+
cIn[o + 4] = oW;
|
|
718
|
+
cIn[o + 5] = oH;
|
|
719
|
+
cIn[o + 6] = fW ? 1 : 0;
|
|
720
|
+
cIn[o + 7] = fH ? 1 : 0;
|
|
721
|
+
node._cOut[i * 2] = node.layout.width;
|
|
722
|
+
node._cOut[i * 2 + 1] = node.layout.height;
|
|
723
|
+
node._cGen = _generation;
|
|
724
|
+
}
|
|
725
|
+
function commitCacheOutputs(node, performLayout) {
|
|
726
|
+
if (performLayout) {
|
|
727
|
+
node._lOutW = node.layout.width;
|
|
728
|
+
node._lOutH = node.layout.height;
|
|
729
|
+
} else {
|
|
730
|
+
node._mOutW = node.layout.width;
|
|
731
|
+
node._mOutH = node.layout.height;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
let _generation = 0;
|
|
735
|
+
let _yogaNodesVisited = 0;
|
|
736
|
+
let _yogaMeasureCalls = 0;
|
|
737
|
+
let _yogaCacheHits = 0;
|
|
738
|
+
let _yogaLiveNodes = 0;
|
|
739
|
+
export function getYogaCounters() {
|
|
740
|
+
return {
|
|
741
|
+
visited: _yogaNodesVisited,
|
|
742
|
+
measured: _yogaMeasureCalls,
|
|
743
|
+
cacheHits: _yogaCacheHits,
|
|
744
|
+
live: _yogaLiveNodes
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
function layoutNode(node, availableWidth, availableHeight, widthMode, heightMode, ownerWidth, ownerHeight, performLayout, forceWidth = false, forceHeight = false) {
|
|
748
|
+
_yogaNodesVisited++;
|
|
749
|
+
const style = node.style;
|
|
750
|
+
const layout = node.layout;
|
|
751
|
+
const sameGen = node._cGen === _generation && !performLayout;
|
|
752
|
+
if (!node.isDirty_ || sameGen) {
|
|
753
|
+
if (!node.isDirty_ && node._hasL && node._lWM === widthMode && node._lHM === heightMode && node._lFW === forceWidth && node._lFH === forceHeight && sameFloat(node._lW, availableWidth) && sameFloat(node._lH, availableHeight) && sameFloat(node._lOW, ownerWidth) && sameFloat(node._lOH, ownerHeight)) {
|
|
754
|
+
_yogaCacheHits++;
|
|
755
|
+
layout.width = node._lOutW;
|
|
756
|
+
layout.height = node._lOutH;
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
if (node._cN > 0 && (sameGen || !node.isDirty_)) {
|
|
760
|
+
const cIn = node._cIn;
|
|
761
|
+
for (let i = 0;i < node._cN; i++) {
|
|
762
|
+
const o = i * 8;
|
|
763
|
+
if (cIn[o + 2] === widthMode && cIn[o + 3] === heightMode && cIn[o + 6] === (forceWidth ? 1 : 0) && cIn[o + 7] === (forceHeight ? 1 : 0) && sameFloat(cIn[o], availableWidth) && sameFloat(cIn[o + 1], availableHeight) && sameFloat(cIn[o + 4], ownerWidth) && sameFloat(cIn[o + 5], ownerHeight)) {
|
|
764
|
+
layout.width = node._cOut[i * 2];
|
|
765
|
+
layout.height = node._cOut[i * 2 + 1];
|
|
766
|
+
_yogaCacheHits++;
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
if (!node.isDirty_ && !performLayout && node._hasM && node._mWM === widthMode && node._mHM === heightMode && sameFloat(node._mW, availableWidth) && sameFloat(node._mH, availableHeight) && sameFloat(node._mOW, ownerWidth) && sameFloat(node._mOH, ownerHeight)) {
|
|
772
|
+
layout.width = node._mOutW;
|
|
773
|
+
layout.height = node._mOutH;
|
|
774
|
+
_yogaCacheHits++;
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
const wasDirty = node.isDirty_;
|
|
779
|
+
if (performLayout) {
|
|
780
|
+
node._lW = availableWidth;
|
|
781
|
+
node._lH = availableHeight;
|
|
782
|
+
node._lWM = widthMode;
|
|
783
|
+
node._lHM = heightMode;
|
|
784
|
+
node._lOW = ownerWidth;
|
|
785
|
+
node._lOH = ownerHeight;
|
|
786
|
+
node._lFW = forceWidth;
|
|
787
|
+
node._lFH = forceHeight;
|
|
788
|
+
node._hasL = true;
|
|
789
|
+
node.isDirty_ = false;
|
|
790
|
+
if (wasDirty)
|
|
791
|
+
node._hasM = false;
|
|
792
|
+
} else {
|
|
793
|
+
node._mW = availableWidth;
|
|
794
|
+
node._mH = availableHeight;
|
|
795
|
+
node._mWM = widthMode;
|
|
796
|
+
node._mHM = heightMode;
|
|
797
|
+
node._mOW = ownerWidth;
|
|
798
|
+
node._mOH = ownerHeight;
|
|
799
|
+
node._hasM = true;
|
|
800
|
+
if (wasDirty)
|
|
801
|
+
node._hasL = false;
|
|
802
|
+
}
|
|
803
|
+
const pad = layout.padding;
|
|
804
|
+
const bor = layout.border;
|
|
805
|
+
const mar = layout.margin;
|
|
806
|
+
if (node._hasPadding)
|
|
807
|
+
resolveEdges4Into(style.padding, ownerWidth, pad);
|
|
808
|
+
else
|
|
809
|
+
pad[0] = pad[1] = pad[2] = pad[3] = 0;
|
|
810
|
+
if (node._hasBorder)
|
|
811
|
+
resolveEdges4Into(style.border, ownerWidth, bor);
|
|
812
|
+
else
|
|
813
|
+
bor[0] = bor[1] = bor[2] = bor[3] = 0;
|
|
814
|
+
if (node._hasMargin)
|
|
815
|
+
resolveEdges4Into(style.margin, ownerWidth, mar);
|
|
816
|
+
else
|
|
817
|
+
mar[0] = mar[1] = mar[2] = mar[3] = 0;
|
|
818
|
+
const paddingBorderWidth = pad[0] + pad[2] + bor[0] + bor[2];
|
|
819
|
+
const paddingBorderHeight = pad[1] + pad[3] + bor[1] + bor[3];
|
|
820
|
+
const styleWidth = forceWidth ? NaN : resolveValue(style.width, ownerWidth);
|
|
821
|
+
const styleHeight = forceHeight ? NaN : resolveValue(style.height, ownerHeight);
|
|
822
|
+
let width = availableWidth;
|
|
823
|
+
let height = availableHeight;
|
|
824
|
+
let wMode = widthMode;
|
|
825
|
+
let hMode = heightMode;
|
|
826
|
+
if (isDefined(styleWidth)) {
|
|
827
|
+
width = styleWidth;
|
|
828
|
+
wMode = MeasureMode.Exactly;
|
|
829
|
+
}
|
|
830
|
+
if (isDefined(styleHeight)) {
|
|
831
|
+
height = styleHeight;
|
|
832
|
+
hMode = MeasureMode.Exactly;
|
|
833
|
+
}
|
|
834
|
+
width = boundAxis(style, true, width, ownerWidth, ownerHeight);
|
|
835
|
+
height = boundAxis(style, false, height, ownerWidth, ownerHeight);
|
|
836
|
+
if (node.measureFunc && node.children.length === 0) {
|
|
837
|
+
const innerW = wMode === MeasureMode.Undefined ? NaN : Math.max(0, width - paddingBorderWidth);
|
|
838
|
+
const innerH = hMode === MeasureMode.Undefined ? NaN : Math.max(0, height - paddingBorderHeight);
|
|
839
|
+
_yogaMeasureCalls++;
|
|
840
|
+
const measured = node.measureFunc(innerW, wMode, innerH, hMode);
|
|
841
|
+
node.layout.width = wMode === MeasureMode.Exactly ? width : boundAxis(style, true, (measured.width ?? 0) + paddingBorderWidth, ownerWidth, ownerHeight);
|
|
842
|
+
node.layout.height = hMode === MeasureMode.Exactly ? height : boundAxis(style, false, (measured.height ?? 0) + paddingBorderHeight, ownerWidth, ownerHeight);
|
|
843
|
+
commitCacheOutputs(node, performLayout);
|
|
844
|
+
cacheWrite(node, availableWidth, availableHeight, widthMode, heightMode, ownerWidth, ownerHeight, forceWidth, forceHeight, wasDirty);
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
if (node.children.length === 0) {
|
|
848
|
+
node.layout.width = wMode === MeasureMode.Exactly ? width : boundAxis(style, true, paddingBorderWidth, ownerWidth, ownerHeight);
|
|
849
|
+
node.layout.height = hMode === MeasureMode.Exactly ? height : boundAxis(style, false, paddingBorderHeight, ownerWidth, ownerHeight);
|
|
850
|
+
commitCacheOutputs(node, performLayout);
|
|
851
|
+
cacheWrite(node, availableWidth, availableHeight, widthMode, heightMode, ownerWidth, ownerHeight, forceWidth, forceHeight, wasDirty);
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
const mainAxis = style.flexDirection;
|
|
855
|
+
const crossAx = crossAxis(mainAxis);
|
|
856
|
+
const isMainRow = isRow(mainAxis);
|
|
857
|
+
const mainSize = isMainRow ? width : height;
|
|
858
|
+
const crossSize = isMainRow ? height : width;
|
|
859
|
+
const mainMode = isMainRow ? wMode : hMode;
|
|
860
|
+
const crossMode = isMainRow ? hMode : wMode;
|
|
861
|
+
const mainPadBorder = isMainRow ? paddingBorderWidth : paddingBorderHeight;
|
|
862
|
+
const crossPadBorder = isMainRow ? paddingBorderHeight : paddingBorderWidth;
|
|
863
|
+
const innerMainSize = isDefined(mainSize) ? Math.max(0, mainSize - mainPadBorder) : NaN;
|
|
864
|
+
const innerCrossSize = isDefined(crossSize) ? Math.max(0, crossSize - crossPadBorder) : NaN;
|
|
865
|
+
const gapMain = resolveGap(style, isMainRow ? Gutter.Column : Gutter.Row, innerMainSize);
|
|
866
|
+
const flowChildren = [];
|
|
867
|
+
const absChildren = [];
|
|
868
|
+
collectLayoutChildren(node, flowChildren, absChildren);
|
|
869
|
+
const ownerW = isDefined(width) ? width : NaN;
|
|
870
|
+
const ownerH = isDefined(height) ? height : NaN;
|
|
871
|
+
const isWrap = style.flexWrap !== Wrap.NoWrap;
|
|
872
|
+
const gapCross = resolveGap(style, isMainRow ? Gutter.Row : Gutter.Column, innerCrossSize);
|
|
873
|
+
for (const c of flowChildren) {
|
|
874
|
+
c._flexBasis = computeFlexBasis(c, mainAxis, innerMainSize, innerCrossSize, crossMode, ownerW, ownerH);
|
|
875
|
+
}
|
|
876
|
+
const lines = [];
|
|
877
|
+
if (!isWrap || !isDefined(innerMainSize) || flowChildren.length === 0) {
|
|
878
|
+
for (const c of flowChildren)
|
|
879
|
+
c._lineIndex = 0;
|
|
880
|
+
lines.push(flowChildren);
|
|
881
|
+
} else {
|
|
882
|
+
let lineStart = 0;
|
|
883
|
+
let lineLen = 0;
|
|
884
|
+
for (let i = 0;i < flowChildren.length; i++) {
|
|
885
|
+
const c = flowChildren[i];
|
|
886
|
+
const hypo = boundAxis(c.style, isMainRow, c._flexBasis, ownerW, ownerH);
|
|
887
|
+
const outer = Math.max(0, hypo) + childMarginForAxis(c, mainAxis, ownerW);
|
|
888
|
+
const withGap = i > lineStart ? gapMain : 0;
|
|
889
|
+
if (i > lineStart && lineLen + withGap + outer > innerMainSize) {
|
|
890
|
+
lines.push(flowChildren.slice(lineStart, i));
|
|
891
|
+
lineStart = i;
|
|
892
|
+
lineLen = outer;
|
|
893
|
+
} else {
|
|
894
|
+
lineLen += withGap + outer;
|
|
895
|
+
}
|
|
896
|
+
c._lineIndex = lines.length;
|
|
897
|
+
}
|
|
898
|
+
lines.push(flowChildren.slice(lineStart));
|
|
899
|
+
}
|
|
900
|
+
const lineCount = lines.length;
|
|
901
|
+
const isBaseline = isBaselineLayout(node, flowChildren);
|
|
902
|
+
const lineConsumedMain = new Array(lineCount);
|
|
903
|
+
const lineCrossSizes = new Array(lineCount);
|
|
904
|
+
const lineMaxAscent = isBaseline ? new Array(lineCount).fill(0) : [];
|
|
905
|
+
let maxLineMain = 0;
|
|
906
|
+
let totalLinesCross = 0;
|
|
907
|
+
for (let li = 0;li < lineCount; li++) {
|
|
908
|
+
const line = lines[li];
|
|
909
|
+
const lineGap = line.length > 1 ? gapMain * (line.length - 1) : 0;
|
|
910
|
+
let lineBasis = lineGap;
|
|
911
|
+
for (const c of line) {
|
|
912
|
+
lineBasis += c._flexBasis + childMarginForAxis(c, mainAxis, ownerW);
|
|
913
|
+
}
|
|
914
|
+
let availMain = innerMainSize;
|
|
915
|
+
if (!isDefined(availMain)) {
|
|
916
|
+
const mainOwner = isMainRow ? ownerWidth : ownerHeight;
|
|
917
|
+
const minM = resolveValue(isMainRow ? style.minWidth : style.minHeight, mainOwner);
|
|
918
|
+
const maxM = resolveValue(isMainRow ? style.maxWidth : style.maxHeight, mainOwner);
|
|
919
|
+
if (isDefined(maxM) && lineBasis > maxM - mainPadBorder) {
|
|
920
|
+
availMain = Math.max(0, maxM - mainPadBorder);
|
|
921
|
+
} else if (isDefined(minM) && lineBasis < minM - mainPadBorder) {
|
|
922
|
+
availMain = Math.max(0, minM - mainPadBorder);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
resolveFlexibleLengths(line, availMain, lineBasis, isMainRow, ownerW, ownerH);
|
|
926
|
+
let lineCross = 0;
|
|
927
|
+
for (const c of line) {
|
|
928
|
+
const cStyle = c.style;
|
|
929
|
+
const childAlign = cStyle.alignSelf === Align.Auto ? style.alignItems : cStyle.alignSelf;
|
|
930
|
+
const cMarginCross = childMarginForAxis(c, crossAx, ownerW);
|
|
931
|
+
let childCrossSize = NaN;
|
|
932
|
+
let childCrossMode = MeasureMode.Undefined;
|
|
933
|
+
const resolvedCrossStyle = resolveValue(isMainRow ? cStyle.height : cStyle.width, isMainRow ? ownerH : ownerW);
|
|
934
|
+
const crossLeadE = isMainRow ? EDGE_TOP : EDGE_LEFT;
|
|
935
|
+
const crossTrailE = isMainRow ? EDGE_BOTTOM : EDGE_RIGHT;
|
|
936
|
+
const hasCrossAutoMargin = c._hasAutoMargin && (isMarginAuto(cStyle.margin, crossLeadE) || isMarginAuto(cStyle.margin, crossTrailE));
|
|
937
|
+
if (isDefined(resolvedCrossStyle)) {
|
|
938
|
+
childCrossSize = resolvedCrossStyle;
|
|
939
|
+
childCrossMode = MeasureMode.Exactly;
|
|
940
|
+
} else if (childAlign === Align.Stretch && !hasCrossAutoMargin && !isWrap && isDefined(innerCrossSize) && crossMode === MeasureMode.Exactly) {
|
|
941
|
+
childCrossSize = Math.max(0, innerCrossSize - cMarginCross);
|
|
942
|
+
childCrossMode = MeasureMode.Exactly;
|
|
943
|
+
} else if (!isWrap && isDefined(innerCrossSize)) {
|
|
944
|
+
childCrossSize = Math.max(0, innerCrossSize - cMarginCross);
|
|
945
|
+
childCrossMode = MeasureMode.AtMost;
|
|
946
|
+
}
|
|
947
|
+
const cw = isMainRow ? c._mainSize : childCrossSize;
|
|
948
|
+
const ch = isMainRow ? childCrossSize : c._mainSize;
|
|
949
|
+
layoutNode(c, cw, ch, isMainRow ? MeasureMode.Exactly : childCrossMode, isMainRow ? childCrossMode : MeasureMode.Exactly, ownerW, ownerH, performLayout, isMainRow, !isMainRow);
|
|
950
|
+
c._crossSize = isMainRow ? c.layout.height : c.layout.width;
|
|
951
|
+
lineCross = Math.max(lineCross, c._crossSize + cMarginCross);
|
|
952
|
+
}
|
|
953
|
+
if (isBaseline) {
|
|
954
|
+
let maxAscent = 0;
|
|
955
|
+
let maxDescent = 0;
|
|
956
|
+
for (const c of line) {
|
|
957
|
+
if (resolveChildAlign(node, c) !== Align.Baseline)
|
|
958
|
+
continue;
|
|
959
|
+
const mTop = resolveEdge(c.style.margin, EDGE_TOP, ownerW);
|
|
960
|
+
const mBot = resolveEdge(c.style.margin, EDGE_BOTTOM, ownerW);
|
|
961
|
+
const ascent = calculateBaseline(c) + mTop;
|
|
962
|
+
const descent = c.layout.height + mTop + mBot - ascent;
|
|
963
|
+
if (ascent > maxAscent)
|
|
964
|
+
maxAscent = ascent;
|
|
965
|
+
if (descent > maxDescent)
|
|
966
|
+
maxDescent = descent;
|
|
967
|
+
}
|
|
968
|
+
lineMaxAscent[li] = maxAscent;
|
|
969
|
+
if (maxAscent + maxDescent > lineCross) {
|
|
970
|
+
lineCross = maxAscent + maxDescent;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
const mainLead = leadingEdge(mainAxis);
|
|
974
|
+
const mainTrail = trailingEdge(mainAxis);
|
|
975
|
+
let consumed = lineGap;
|
|
976
|
+
for (const c of line) {
|
|
977
|
+
const cm = c.layout.margin;
|
|
978
|
+
consumed += c._mainSize + cm[mainLead] + cm[mainTrail];
|
|
979
|
+
}
|
|
980
|
+
lineConsumedMain[li] = consumed;
|
|
981
|
+
lineCrossSizes[li] = lineCross;
|
|
982
|
+
maxLineMain = Math.max(maxLineMain, consumed);
|
|
983
|
+
totalLinesCross += lineCross;
|
|
984
|
+
}
|
|
985
|
+
const totalCrossGap = lineCount > 1 ? gapCross * (lineCount - 1) : 0;
|
|
986
|
+
totalLinesCross += totalCrossGap;
|
|
987
|
+
const isScroll = style.overflow === Overflow.Scroll;
|
|
988
|
+
const contentMain = maxLineMain + mainPadBorder;
|
|
989
|
+
const finalMainSize = mainMode === MeasureMode.Exactly ? mainSize : mainMode === MeasureMode.AtMost && isScroll ? Math.max(Math.min(mainSize, contentMain), mainPadBorder) : isWrap && lineCount > 1 && mainMode === MeasureMode.AtMost ? mainSize : contentMain;
|
|
990
|
+
const contentCross = totalLinesCross + crossPadBorder;
|
|
991
|
+
const finalCrossSize = crossMode === MeasureMode.Exactly ? crossSize : crossMode === MeasureMode.AtMost && isScroll ? Math.max(Math.min(crossSize, contentCross), crossPadBorder) : contentCross;
|
|
992
|
+
node.layout.width = boundAxis(style, true, isMainRow ? finalMainSize : finalCrossSize, ownerWidth, ownerHeight);
|
|
993
|
+
node.layout.height = boundAxis(style, false, isMainRow ? finalCrossSize : finalMainSize, ownerWidth, ownerHeight);
|
|
994
|
+
commitCacheOutputs(node, performLayout);
|
|
995
|
+
cacheWrite(node, availableWidth, availableHeight, widthMode, heightMode, ownerWidth, ownerHeight, forceWidth, forceHeight, wasDirty);
|
|
996
|
+
if (!performLayout)
|
|
997
|
+
return;
|
|
998
|
+
const actualInnerMain = (isMainRow ? node.layout.width : node.layout.height) - mainPadBorder;
|
|
999
|
+
const actualInnerCross = (isMainRow ? node.layout.height : node.layout.width) - crossPadBorder;
|
|
1000
|
+
const mainLeadEdgePhys = leadingEdge(mainAxis);
|
|
1001
|
+
const mainTrailEdgePhys = trailingEdge(mainAxis);
|
|
1002
|
+
const crossLeadEdgePhys = isMainRow ? EDGE_TOP : EDGE_LEFT;
|
|
1003
|
+
const crossTrailEdgePhys = isMainRow ? EDGE_BOTTOM : EDGE_RIGHT;
|
|
1004
|
+
const reversed = isReverse(mainAxis);
|
|
1005
|
+
const mainContainerSize = isMainRow ? node.layout.width : node.layout.height;
|
|
1006
|
+
const crossLead = pad[crossLeadEdgePhys] + bor[crossLeadEdgePhys];
|
|
1007
|
+
let lineCrossOffset = crossLead;
|
|
1008
|
+
let betweenLines = gapCross;
|
|
1009
|
+
const freeCross = actualInnerCross - totalLinesCross;
|
|
1010
|
+
if (lineCount === 1 && !isWrap && !isBaseline) {
|
|
1011
|
+
lineCrossSizes[0] = actualInnerCross;
|
|
1012
|
+
} else {
|
|
1013
|
+
const remCross = Math.max(0, freeCross);
|
|
1014
|
+
switch (style.alignContent) {
|
|
1015
|
+
case Align.FlexStart:
|
|
1016
|
+
break;
|
|
1017
|
+
case Align.Center:
|
|
1018
|
+
lineCrossOffset += freeCross / 2;
|
|
1019
|
+
break;
|
|
1020
|
+
case Align.FlexEnd:
|
|
1021
|
+
lineCrossOffset += freeCross;
|
|
1022
|
+
break;
|
|
1023
|
+
case Align.Stretch:
|
|
1024
|
+
if (lineCount > 0 && remCross > 0) {
|
|
1025
|
+
const add = remCross / lineCount;
|
|
1026
|
+
for (let i = 0;i < lineCount; i++)
|
|
1027
|
+
lineCrossSizes[i] += add;
|
|
1028
|
+
}
|
|
1029
|
+
break;
|
|
1030
|
+
case Align.SpaceBetween:
|
|
1031
|
+
if (lineCount > 1)
|
|
1032
|
+
betweenLines += remCross / (lineCount - 1);
|
|
1033
|
+
break;
|
|
1034
|
+
case Align.SpaceAround:
|
|
1035
|
+
if (lineCount > 0) {
|
|
1036
|
+
betweenLines += remCross / lineCount;
|
|
1037
|
+
lineCrossOffset += remCross / lineCount / 2;
|
|
1038
|
+
}
|
|
1039
|
+
break;
|
|
1040
|
+
case Align.SpaceEvenly:
|
|
1041
|
+
if (lineCount > 0) {
|
|
1042
|
+
betweenLines += remCross / (lineCount + 1);
|
|
1043
|
+
lineCrossOffset += remCross / (lineCount + 1);
|
|
1044
|
+
}
|
|
1045
|
+
break;
|
|
1046
|
+
default:
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const wrapReverse = style.flexWrap === Wrap.WrapReverse;
|
|
1051
|
+
const crossContainerSize = isMainRow ? node.layout.height : node.layout.width;
|
|
1052
|
+
let lineCrossPos = lineCrossOffset;
|
|
1053
|
+
for (let li = 0;li < lineCount; li++) {
|
|
1054
|
+
const line = lines[li];
|
|
1055
|
+
const lineCross = lineCrossSizes[li];
|
|
1056
|
+
const consumedMain = lineConsumedMain[li];
|
|
1057
|
+
const n = line.length;
|
|
1058
|
+
if (isWrap || crossMode !== MeasureMode.Exactly) {
|
|
1059
|
+
for (const c of line) {
|
|
1060
|
+
const cStyle = c.style;
|
|
1061
|
+
const childAlign = cStyle.alignSelf === Align.Auto ? style.alignItems : cStyle.alignSelf;
|
|
1062
|
+
const crossStyleDef = isDefined(resolveValue(isMainRow ? cStyle.height : cStyle.width, isMainRow ? ownerH : ownerW));
|
|
1063
|
+
const hasCrossAutoMargin = c._hasAutoMargin && (isMarginAuto(cStyle.margin, crossLeadEdgePhys) || isMarginAuto(cStyle.margin, crossTrailEdgePhys));
|
|
1064
|
+
if (childAlign === Align.Stretch && !crossStyleDef && !hasCrossAutoMargin) {
|
|
1065
|
+
const cMarginCross = childMarginForAxis(c, crossAx, ownerW);
|
|
1066
|
+
const target = Math.max(0, lineCross - cMarginCross);
|
|
1067
|
+
if (c._crossSize !== target) {
|
|
1068
|
+
const cw = isMainRow ? c._mainSize : target;
|
|
1069
|
+
const ch = isMainRow ? target : c._mainSize;
|
|
1070
|
+
layoutNode(c, cw, ch, MeasureMode.Exactly, MeasureMode.Exactly, ownerW, ownerH, performLayout, isMainRow, !isMainRow);
|
|
1071
|
+
c._crossSize = target;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
let mainOffset = pad[mainLeadEdgePhys] + bor[mainLeadEdgePhys];
|
|
1077
|
+
let betweenMain = gapMain;
|
|
1078
|
+
let numAutoMarginsMain = 0;
|
|
1079
|
+
for (const c of line) {
|
|
1080
|
+
if (!c._hasAutoMargin)
|
|
1081
|
+
continue;
|
|
1082
|
+
if (isMarginAuto(c.style.margin, mainLeadEdgePhys))
|
|
1083
|
+
numAutoMarginsMain++;
|
|
1084
|
+
if (isMarginAuto(c.style.margin, mainTrailEdgePhys))
|
|
1085
|
+
numAutoMarginsMain++;
|
|
1086
|
+
}
|
|
1087
|
+
const freeMain = actualInnerMain - consumedMain;
|
|
1088
|
+
const remainingMain = Math.max(0, freeMain);
|
|
1089
|
+
const autoMarginMainSize = numAutoMarginsMain > 0 && remainingMain > 0 ? remainingMain / numAutoMarginsMain : 0;
|
|
1090
|
+
if (numAutoMarginsMain === 0) {
|
|
1091
|
+
switch (style.justifyContent) {
|
|
1092
|
+
case Justify.FlexStart:
|
|
1093
|
+
break;
|
|
1094
|
+
case Justify.Center:
|
|
1095
|
+
mainOffset += freeMain / 2;
|
|
1096
|
+
break;
|
|
1097
|
+
case Justify.FlexEnd:
|
|
1098
|
+
mainOffset += freeMain;
|
|
1099
|
+
break;
|
|
1100
|
+
case Justify.SpaceBetween:
|
|
1101
|
+
if (n > 1)
|
|
1102
|
+
betweenMain += remainingMain / (n - 1);
|
|
1103
|
+
break;
|
|
1104
|
+
case Justify.SpaceAround:
|
|
1105
|
+
if (n > 0) {
|
|
1106
|
+
betweenMain += remainingMain / n;
|
|
1107
|
+
mainOffset += remainingMain / n / 2;
|
|
1108
|
+
}
|
|
1109
|
+
break;
|
|
1110
|
+
case Justify.SpaceEvenly:
|
|
1111
|
+
if (n > 0) {
|
|
1112
|
+
betweenMain += remainingMain / (n + 1);
|
|
1113
|
+
mainOffset += remainingMain / (n + 1);
|
|
1114
|
+
}
|
|
1115
|
+
break;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
const effectiveLineCrossPos = wrapReverse ? crossContainerSize - lineCrossPos - lineCross : lineCrossPos;
|
|
1119
|
+
let pos = mainOffset;
|
|
1120
|
+
for (const c of line) {
|
|
1121
|
+
const cMargin = c.style.margin;
|
|
1122
|
+
const cLayoutMargin = c.layout.margin;
|
|
1123
|
+
let autoMainLead = false;
|
|
1124
|
+
let autoMainTrail = false;
|
|
1125
|
+
let autoCrossLead = false;
|
|
1126
|
+
let autoCrossTrail = false;
|
|
1127
|
+
let mMainLead;
|
|
1128
|
+
let mMainTrail;
|
|
1129
|
+
let mCrossLead;
|
|
1130
|
+
let mCrossTrail;
|
|
1131
|
+
if (c._hasAutoMargin) {
|
|
1132
|
+
autoMainLead = isMarginAuto(cMargin, mainLeadEdgePhys);
|
|
1133
|
+
autoMainTrail = isMarginAuto(cMargin, mainTrailEdgePhys);
|
|
1134
|
+
autoCrossLead = isMarginAuto(cMargin, crossLeadEdgePhys);
|
|
1135
|
+
autoCrossTrail = isMarginAuto(cMargin, crossTrailEdgePhys);
|
|
1136
|
+
mMainLead = autoMainLead ? autoMarginMainSize : cLayoutMargin[mainLeadEdgePhys];
|
|
1137
|
+
mMainTrail = autoMainTrail ? autoMarginMainSize : cLayoutMargin[mainTrailEdgePhys];
|
|
1138
|
+
mCrossLead = autoCrossLead ? 0 : cLayoutMargin[crossLeadEdgePhys];
|
|
1139
|
+
mCrossTrail = autoCrossTrail ? 0 : cLayoutMargin[crossTrailEdgePhys];
|
|
1140
|
+
} else {
|
|
1141
|
+
mMainLead = cLayoutMargin[mainLeadEdgePhys];
|
|
1142
|
+
mMainTrail = cLayoutMargin[mainTrailEdgePhys];
|
|
1143
|
+
mCrossLead = cLayoutMargin[crossLeadEdgePhys];
|
|
1144
|
+
mCrossTrail = cLayoutMargin[crossTrailEdgePhys];
|
|
1145
|
+
}
|
|
1146
|
+
const mainPos = reversed ? mainContainerSize - (pos + mMainLead) - c._mainSize : pos + mMainLead;
|
|
1147
|
+
const childAlign = c.style.alignSelf === Align.Auto ? style.alignItems : c.style.alignSelf;
|
|
1148
|
+
let crossPos = effectiveLineCrossPos + mCrossLead;
|
|
1149
|
+
const crossFree = lineCross - c._crossSize - mCrossLead - mCrossTrail;
|
|
1150
|
+
if (autoCrossLead && autoCrossTrail) {
|
|
1151
|
+
crossPos += Math.max(0, crossFree) / 2;
|
|
1152
|
+
} else if (autoCrossLead) {
|
|
1153
|
+
crossPos += Math.max(0, crossFree);
|
|
1154
|
+
} else if (autoCrossTrail) {} else {
|
|
1155
|
+
switch (childAlign) {
|
|
1156
|
+
case Align.FlexStart:
|
|
1157
|
+
case Align.Stretch:
|
|
1158
|
+
if (wrapReverse)
|
|
1159
|
+
crossPos += crossFree;
|
|
1160
|
+
break;
|
|
1161
|
+
case Align.Center:
|
|
1162
|
+
crossPos += crossFree / 2;
|
|
1163
|
+
break;
|
|
1164
|
+
case Align.FlexEnd:
|
|
1165
|
+
if (!wrapReverse)
|
|
1166
|
+
crossPos += crossFree;
|
|
1167
|
+
break;
|
|
1168
|
+
case Align.Baseline:
|
|
1169
|
+
if (isBaseline) {
|
|
1170
|
+
crossPos = effectiveLineCrossPos + lineMaxAscent[li] - calculateBaseline(c);
|
|
1171
|
+
}
|
|
1172
|
+
break;
|
|
1173
|
+
default:
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
let relX = 0;
|
|
1178
|
+
let relY = 0;
|
|
1179
|
+
if (c._hasPosition) {
|
|
1180
|
+
const relLeft = resolveValue(resolveEdgeRaw(c.style.position, EDGE_LEFT), ownerW);
|
|
1181
|
+
const relRight = resolveValue(resolveEdgeRaw(c.style.position, EDGE_RIGHT), ownerW);
|
|
1182
|
+
const relTop = resolveValue(resolveEdgeRaw(c.style.position, EDGE_TOP), ownerW);
|
|
1183
|
+
const relBottom = resolveValue(resolveEdgeRaw(c.style.position, EDGE_BOTTOM), ownerW);
|
|
1184
|
+
relX = isDefined(relLeft) ? relLeft : isDefined(relRight) ? -relRight : 0;
|
|
1185
|
+
relY = isDefined(relTop) ? relTop : isDefined(relBottom) ? -relBottom : 0;
|
|
1186
|
+
}
|
|
1187
|
+
if (isMainRow) {
|
|
1188
|
+
c.layout.left = mainPos + relX;
|
|
1189
|
+
c.layout.top = crossPos + relY;
|
|
1190
|
+
} else {
|
|
1191
|
+
c.layout.left = crossPos + relX;
|
|
1192
|
+
c.layout.top = mainPos + relY;
|
|
1193
|
+
}
|
|
1194
|
+
pos += c._mainSize + mMainLead + mMainTrail + betweenMain;
|
|
1195
|
+
}
|
|
1196
|
+
lineCrossPos += lineCross + betweenLines;
|
|
1197
|
+
}
|
|
1198
|
+
for (const c of absChildren) {
|
|
1199
|
+
layoutAbsoluteChild(node, c, node.layout.width, node.layout.height, pad, bor);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
function layoutAbsoluteChild(parent, child, parentWidth, parentHeight, pad, bor) {
|
|
1203
|
+
const cs = child.style;
|
|
1204
|
+
const posLeft = resolveEdgeRaw(cs.position, EDGE_LEFT);
|
|
1205
|
+
const posRight = resolveEdgeRaw(cs.position, EDGE_RIGHT);
|
|
1206
|
+
const posTop = resolveEdgeRaw(cs.position, EDGE_TOP);
|
|
1207
|
+
const posBottom = resolveEdgeRaw(cs.position, EDGE_BOTTOM);
|
|
1208
|
+
const rLeft = resolveValue(posLeft, parentWidth);
|
|
1209
|
+
const rRight = resolveValue(posRight, parentWidth);
|
|
1210
|
+
const rTop = resolveValue(posTop, parentHeight);
|
|
1211
|
+
const rBottom = resolveValue(posBottom, parentHeight);
|
|
1212
|
+
const paddingBoxW = parentWidth - bor[0] - bor[2];
|
|
1213
|
+
const paddingBoxH = parentHeight - bor[1] - bor[3];
|
|
1214
|
+
let cw = resolveValue(cs.width, paddingBoxW);
|
|
1215
|
+
let ch = resolveValue(cs.height, paddingBoxH);
|
|
1216
|
+
if (!isDefined(cw) && isDefined(rLeft) && isDefined(rRight)) {
|
|
1217
|
+
cw = paddingBoxW - rLeft - rRight;
|
|
1218
|
+
}
|
|
1219
|
+
if (!isDefined(ch) && isDefined(rTop) && isDefined(rBottom)) {
|
|
1220
|
+
ch = paddingBoxH - rTop - rBottom;
|
|
1221
|
+
}
|
|
1222
|
+
layoutNode(child, cw, ch, isDefined(cw) ? MeasureMode.Exactly : MeasureMode.Undefined, isDefined(ch) ? MeasureMode.Exactly : MeasureMode.Undefined, paddingBoxW, paddingBoxH, true);
|
|
1223
|
+
const mL = resolveEdge(cs.margin, EDGE_LEFT, parentWidth);
|
|
1224
|
+
const mT = resolveEdge(cs.margin, EDGE_TOP, parentWidth);
|
|
1225
|
+
const mR = resolveEdge(cs.margin, EDGE_RIGHT, parentWidth);
|
|
1226
|
+
const mB = resolveEdge(cs.margin, EDGE_BOTTOM, parentWidth);
|
|
1227
|
+
const mainAxis = parent.style.flexDirection;
|
|
1228
|
+
const reversed = isReverse(mainAxis);
|
|
1229
|
+
const mainRow = isRow(mainAxis);
|
|
1230
|
+
const wrapReverse = parent.style.flexWrap === Wrap.WrapReverse;
|
|
1231
|
+
const alignment = cs.alignSelf === Align.Auto ? parent.style.alignItems : cs.alignSelf;
|
|
1232
|
+
let left;
|
|
1233
|
+
if (isDefined(rLeft)) {
|
|
1234
|
+
left = bor[0] + rLeft + mL;
|
|
1235
|
+
} else if (isDefined(rRight)) {
|
|
1236
|
+
left = parentWidth - bor[2] - rRight - child.layout.width - mR;
|
|
1237
|
+
} else if (mainRow) {
|
|
1238
|
+
const lead = pad[0] + bor[0];
|
|
1239
|
+
const trail = parentWidth - pad[2] - bor[2];
|
|
1240
|
+
left = reversed ? trail - child.layout.width - mR : justifyAbsolute(parent.style.justifyContent, lead, trail, child.layout.width) + mL;
|
|
1241
|
+
} else {
|
|
1242
|
+
left = alignAbsolute(alignment, pad[0] + bor[0], parentWidth - pad[2] - bor[2], child.layout.width, wrapReverse) + mL;
|
|
1243
|
+
}
|
|
1244
|
+
let top;
|
|
1245
|
+
if (isDefined(rTop)) {
|
|
1246
|
+
top = bor[1] + rTop + mT;
|
|
1247
|
+
} else if (isDefined(rBottom)) {
|
|
1248
|
+
top = parentHeight - bor[3] - rBottom - child.layout.height - mB;
|
|
1249
|
+
} else if (mainRow) {
|
|
1250
|
+
top = alignAbsolute(alignment, pad[1] + bor[1], parentHeight - pad[3] - bor[3], child.layout.height, wrapReverse) + mT;
|
|
1251
|
+
} else {
|
|
1252
|
+
const lead = pad[1] + bor[1];
|
|
1253
|
+
const trail = parentHeight - pad[3] - bor[3];
|
|
1254
|
+
top = reversed ? trail - child.layout.height - mB : justifyAbsolute(parent.style.justifyContent, lead, trail, child.layout.height) + mT;
|
|
1255
|
+
}
|
|
1256
|
+
child.layout.left = left;
|
|
1257
|
+
child.layout.top = top;
|
|
1258
|
+
}
|
|
1259
|
+
function justifyAbsolute(justify, leadEdge, trailEdge, childSize) {
|
|
1260
|
+
switch (justify) {
|
|
1261
|
+
case Justify.Center:
|
|
1262
|
+
return leadEdge + (trailEdge - leadEdge - childSize) / 2;
|
|
1263
|
+
case Justify.FlexEnd:
|
|
1264
|
+
return trailEdge - childSize;
|
|
1265
|
+
default:
|
|
1266
|
+
return leadEdge;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
function alignAbsolute(align, leadEdge, trailEdge, childSize, wrapReverse) {
|
|
1270
|
+
switch (align) {
|
|
1271
|
+
case Align.Center:
|
|
1272
|
+
return leadEdge + (trailEdge - leadEdge - childSize) / 2;
|
|
1273
|
+
case Align.FlexEnd:
|
|
1274
|
+
return wrapReverse ? leadEdge : trailEdge - childSize;
|
|
1275
|
+
default:
|
|
1276
|
+
return wrapReverse ? trailEdge - childSize : leadEdge;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
function computeFlexBasis(child, mainAxis, availableMain, availableCross, crossMode, ownerWidth, ownerHeight) {
|
|
1280
|
+
const sameGen = child._fbGen === _generation;
|
|
1281
|
+
if ((sameGen || !child.isDirty_) && child._fbCrossMode === crossMode && sameFloat(child._fbOwnerW, ownerWidth) && sameFloat(child._fbOwnerH, ownerHeight) && sameFloat(child._fbAvailMain, availableMain) && sameFloat(child._fbAvailCross, availableCross)) {
|
|
1282
|
+
return child._fbBasis;
|
|
1283
|
+
}
|
|
1284
|
+
const cs = child.style;
|
|
1285
|
+
const isMainRow = isRow(mainAxis);
|
|
1286
|
+
const basis = resolveValue(cs.flexBasis, availableMain);
|
|
1287
|
+
if (isDefined(basis)) {
|
|
1288
|
+
const b = Math.max(0, basis);
|
|
1289
|
+
child._fbBasis = b;
|
|
1290
|
+
child._fbOwnerW = ownerWidth;
|
|
1291
|
+
child._fbOwnerH = ownerHeight;
|
|
1292
|
+
child._fbAvailMain = availableMain;
|
|
1293
|
+
child._fbAvailCross = availableCross;
|
|
1294
|
+
child._fbCrossMode = crossMode;
|
|
1295
|
+
child._fbGen = _generation;
|
|
1296
|
+
return b;
|
|
1297
|
+
}
|
|
1298
|
+
const mainStyleDim = isMainRow ? cs.width : cs.height;
|
|
1299
|
+
const mainOwner = isMainRow ? ownerWidth : ownerHeight;
|
|
1300
|
+
const resolved = resolveValue(mainStyleDim, mainOwner);
|
|
1301
|
+
if (isDefined(resolved)) {
|
|
1302
|
+
const b = Math.max(0, resolved);
|
|
1303
|
+
child._fbBasis = b;
|
|
1304
|
+
child._fbOwnerW = ownerWidth;
|
|
1305
|
+
child._fbOwnerH = ownerHeight;
|
|
1306
|
+
child._fbAvailMain = availableMain;
|
|
1307
|
+
child._fbAvailCross = availableCross;
|
|
1308
|
+
child._fbCrossMode = crossMode;
|
|
1309
|
+
child._fbGen = _generation;
|
|
1310
|
+
return b;
|
|
1311
|
+
}
|
|
1312
|
+
const crossStyleDim = isMainRow ? cs.height : cs.width;
|
|
1313
|
+
const crossOwner = isMainRow ? ownerHeight : ownerWidth;
|
|
1314
|
+
let crossConstraint = resolveValue(crossStyleDim, crossOwner);
|
|
1315
|
+
let crossConstraintMode = isDefined(crossConstraint) ? MeasureMode.Exactly : MeasureMode.Undefined;
|
|
1316
|
+
if (!isDefined(crossConstraint) && isDefined(availableCross)) {
|
|
1317
|
+
crossConstraint = availableCross;
|
|
1318
|
+
crossConstraintMode = crossMode === MeasureMode.Exactly && isStretchAlign(child) ? MeasureMode.Exactly : MeasureMode.AtMost;
|
|
1319
|
+
}
|
|
1320
|
+
let mainConstraint = NaN;
|
|
1321
|
+
let mainConstraintMode = MeasureMode.Undefined;
|
|
1322
|
+
if (isMainRow && isDefined(availableMain) && hasMeasureFuncInSubtree(child)) {
|
|
1323
|
+
mainConstraint = availableMain;
|
|
1324
|
+
mainConstraintMode = MeasureMode.AtMost;
|
|
1325
|
+
}
|
|
1326
|
+
const mw = isMainRow ? mainConstraint : crossConstraint;
|
|
1327
|
+
const mh = isMainRow ? crossConstraint : mainConstraint;
|
|
1328
|
+
const mwMode = isMainRow ? mainConstraintMode : crossConstraintMode;
|
|
1329
|
+
const mhMode = isMainRow ? crossConstraintMode : mainConstraintMode;
|
|
1330
|
+
layoutNode(child, mw, mh, mwMode, mhMode, ownerWidth, ownerHeight, false);
|
|
1331
|
+
const b = isMainRow ? child.layout.width : child.layout.height;
|
|
1332
|
+
child._fbBasis = b;
|
|
1333
|
+
child._fbOwnerW = ownerWidth;
|
|
1334
|
+
child._fbOwnerH = ownerHeight;
|
|
1335
|
+
child._fbAvailMain = availableMain;
|
|
1336
|
+
child._fbAvailCross = availableCross;
|
|
1337
|
+
child._fbCrossMode = crossMode;
|
|
1338
|
+
child._fbGen = _generation;
|
|
1339
|
+
return b;
|
|
1340
|
+
}
|
|
1341
|
+
function hasMeasureFuncInSubtree(node) {
|
|
1342
|
+
if (node.measureFunc)
|
|
1343
|
+
return true;
|
|
1344
|
+
for (const c of node.children) {
|
|
1345
|
+
if (hasMeasureFuncInSubtree(c))
|
|
1346
|
+
return true;
|
|
1347
|
+
}
|
|
1348
|
+
return false;
|
|
1349
|
+
}
|
|
1350
|
+
function resolveFlexibleLengths(children, availableInnerMain, totalFlexBasis, isMainRow, ownerW, ownerH) {
|
|
1351
|
+
const n = children.length;
|
|
1352
|
+
const frozen = new Array(n).fill(false);
|
|
1353
|
+
const initialFree = isDefined(availableInnerMain) ? availableInnerMain - totalFlexBasis : 0;
|
|
1354
|
+
for (let i = 0;i < n; i++) {
|
|
1355
|
+
const c = children[i];
|
|
1356
|
+
const clamped = boundAxis(c.style, isMainRow, c._flexBasis, ownerW, ownerH);
|
|
1357
|
+
const inflexible = !isDefined(availableInnerMain) || (initialFree >= 0 ? c.style.flexGrow === 0 : c.style.flexShrink === 0);
|
|
1358
|
+
if (inflexible) {
|
|
1359
|
+
c._mainSize = Math.max(0, clamped);
|
|
1360
|
+
frozen[i] = true;
|
|
1361
|
+
} else {
|
|
1362
|
+
c._mainSize = c._flexBasis;
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
const unclamped = new Array(n);
|
|
1366
|
+
for (let iter = 0;iter <= n; iter++) {
|
|
1367
|
+
let frozenDelta = 0;
|
|
1368
|
+
let totalGrow = 0;
|
|
1369
|
+
let totalShrinkScaled = 0;
|
|
1370
|
+
let unfrozenCount = 0;
|
|
1371
|
+
for (let i = 0;i < n; i++) {
|
|
1372
|
+
const c = children[i];
|
|
1373
|
+
if (frozen[i]) {
|
|
1374
|
+
frozenDelta += c._mainSize - c._flexBasis;
|
|
1375
|
+
} else {
|
|
1376
|
+
totalGrow += c.style.flexGrow;
|
|
1377
|
+
totalShrinkScaled += c.style.flexShrink * c._flexBasis;
|
|
1378
|
+
unfrozenCount++;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
if (unfrozenCount === 0)
|
|
1382
|
+
break;
|
|
1383
|
+
let remaining = initialFree - frozenDelta;
|
|
1384
|
+
if (remaining > 0 && totalGrow > 0 && totalGrow < 1) {
|
|
1385
|
+
const scaled = initialFree * totalGrow;
|
|
1386
|
+
if (scaled < remaining)
|
|
1387
|
+
remaining = scaled;
|
|
1388
|
+
} else if (remaining < 0 && totalShrinkScaled > 0) {
|
|
1389
|
+
let totalShrink = 0;
|
|
1390
|
+
for (let i = 0;i < n; i++) {
|
|
1391
|
+
if (!frozen[i])
|
|
1392
|
+
totalShrink += children[i].style.flexShrink;
|
|
1393
|
+
}
|
|
1394
|
+
if (totalShrink < 1) {
|
|
1395
|
+
const scaled = initialFree * totalShrink;
|
|
1396
|
+
if (scaled > remaining)
|
|
1397
|
+
remaining = scaled;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
let totalViolation = 0;
|
|
1401
|
+
for (let i = 0;i < n; i++) {
|
|
1402
|
+
if (frozen[i])
|
|
1403
|
+
continue;
|
|
1404
|
+
const c = children[i];
|
|
1405
|
+
let t = c._flexBasis;
|
|
1406
|
+
if (remaining > 0 && totalGrow > 0) {
|
|
1407
|
+
t += remaining * c.style.flexGrow / totalGrow;
|
|
1408
|
+
} else if (remaining < 0 && totalShrinkScaled > 0) {
|
|
1409
|
+
t += remaining * (c.style.flexShrink * c._flexBasis) / totalShrinkScaled;
|
|
1410
|
+
}
|
|
1411
|
+
unclamped[i] = t;
|
|
1412
|
+
const clamped = Math.max(0, boundAxis(c.style, isMainRow, t, ownerW, ownerH));
|
|
1413
|
+
c._mainSize = clamped;
|
|
1414
|
+
totalViolation += clamped - t;
|
|
1415
|
+
}
|
|
1416
|
+
if (totalViolation === 0)
|
|
1417
|
+
break;
|
|
1418
|
+
let anyFrozen = false;
|
|
1419
|
+
for (let i = 0;i < n; i++) {
|
|
1420
|
+
if (frozen[i])
|
|
1421
|
+
continue;
|
|
1422
|
+
const v = children[i]._mainSize - unclamped[i];
|
|
1423
|
+
if (totalViolation > 0 && v > 0 || totalViolation < 0 && v < 0) {
|
|
1424
|
+
frozen[i] = true;
|
|
1425
|
+
anyFrozen = true;
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
if (!anyFrozen)
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
function isStretchAlign(child) {
|
|
1433
|
+
const p = child.parent;
|
|
1434
|
+
if (!p)
|
|
1435
|
+
return false;
|
|
1436
|
+
const align = child.style.alignSelf === Align.Auto ? p.style.alignItems : child.style.alignSelf;
|
|
1437
|
+
return align === Align.Stretch;
|
|
1438
|
+
}
|
|
1439
|
+
function resolveChildAlign(parent, child) {
|
|
1440
|
+
return child.style.alignSelf === Align.Auto ? parent.style.alignItems : child.style.alignSelf;
|
|
1441
|
+
}
|
|
1442
|
+
function calculateBaseline(node) {
|
|
1443
|
+
let baselineChild = null;
|
|
1444
|
+
for (const c of node.children) {
|
|
1445
|
+
if (c._lineIndex > 0)
|
|
1446
|
+
break;
|
|
1447
|
+
if (c.style.positionType === PositionType.Absolute)
|
|
1448
|
+
continue;
|
|
1449
|
+
if (c.style.display === Display.None)
|
|
1450
|
+
continue;
|
|
1451
|
+
if (resolveChildAlign(node, c) === Align.Baseline || c.isReferenceBaseline_) {
|
|
1452
|
+
baselineChild = c;
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
if (baselineChild === null)
|
|
1456
|
+
baselineChild = c;
|
|
1457
|
+
}
|
|
1458
|
+
if (baselineChild === null)
|
|
1459
|
+
return node.layout.height;
|
|
1460
|
+
return calculateBaseline(baselineChild) + baselineChild.layout.top;
|
|
1461
|
+
}
|
|
1462
|
+
function isBaselineLayout(node, flowChildren) {
|
|
1463
|
+
if (!isRow(node.style.flexDirection))
|
|
1464
|
+
return false;
|
|
1465
|
+
if (node.style.alignItems === Align.Baseline)
|
|
1466
|
+
return true;
|
|
1467
|
+
for (const c of flowChildren) {
|
|
1468
|
+
if (c.style.alignSelf === Align.Baseline)
|
|
1469
|
+
return true;
|
|
1470
|
+
}
|
|
1471
|
+
return false;
|
|
1472
|
+
}
|
|
1473
|
+
function childMarginForAxis(child, axis, ownerWidth) {
|
|
1474
|
+
if (!child._hasMargin)
|
|
1475
|
+
return 0;
|
|
1476
|
+
const lead = resolveEdge(child.style.margin, leadingEdge(axis), ownerWidth);
|
|
1477
|
+
const trail = resolveEdge(child.style.margin, trailingEdge(axis), ownerWidth);
|
|
1478
|
+
return lead + trail;
|
|
1479
|
+
}
|
|
1480
|
+
function resolveGap(style, gutter, ownerSize) {
|
|
1481
|
+
let v = style.gap[gutter];
|
|
1482
|
+
if (v.unit === Unit.Undefined)
|
|
1483
|
+
v = style.gap[Gutter.All];
|
|
1484
|
+
const r = resolveValue(v, ownerSize);
|
|
1485
|
+
return isDefined(r) ? Math.max(0, r) : 0;
|
|
1486
|
+
}
|
|
1487
|
+
function boundAxis(style, isWidth, value, ownerWidth, ownerHeight) {
|
|
1488
|
+
const minV = isWidth ? style.minWidth : style.minHeight;
|
|
1489
|
+
const maxV = isWidth ? style.maxWidth : style.maxHeight;
|
|
1490
|
+
const minU = minV.unit;
|
|
1491
|
+
const maxU = maxV.unit;
|
|
1492
|
+
if (minU === 0 && maxU === 0)
|
|
1493
|
+
return value;
|
|
1494
|
+
const owner = isWidth ? ownerWidth : ownerHeight;
|
|
1495
|
+
let v = value;
|
|
1496
|
+
if (maxU === 1) {
|
|
1497
|
+
if (v > maxV.value)
|
|
1498
|
+
v = maxV.value;
|
|
1499
|
+
} else if (maxU === 2) {
|
|
1500
|
+
const m = maxV.value * owner / 100;
|
|
1501
|
+
if (m === m && v > m)
|
|
1502
|
+
v = m;
|
|
1503
|
+
}
|
|
1504
|
+
if (minU === 1) {
|
|
1505
|
+
if (v < minV.value)
|
|
1506
|
+
v = minV.value;
|
|
1507
|
+
} else if (minU === 2) {
|
|
1508
|
+
const m = minV.value * owner / 100;
|
|
1509
|
+
if (m === m && v < m)
|
|
1510
|
+
v = m;
|
|
1511
|
+
}
|
|
1512
|
+
return v;
|
|
1513
|
+
}
|
|
1514
|
+
function zeroLayoutRecursive(node) {
|
|
1515
|
+
for (const c of node.children) {
|
|
1516
|
+
c.layout.left = 0;
|
|
1517
|
+
c.layout.top = 0;
|
|
1518
|
+
c.layout.width = 0;
|
|
1519
|
+
c.layout.height = 0;
|
|
1520
|
+
c.isDirty_ = true;
|
|
1521
|
+
c._hasL = false;
|
|
1522
|
+
c._hasM = false;
|
|
1523
|
+
zeroLayoutRecursive(c);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
function collectLayoutChildren(node, flow, abs) {
|
|
1527
|
+
for (const c of node.children) {
|
|
1528
|
+
const disp = c.style.display;
|
|
1529
|
+
if (disp === Display.None) {
|
|
1530
|
+
c.layout.left = 0;
|
|
1531
|
+
c.layout.top = 0;
|
|
1532
|
+
c.layout.width = 0;
|
|
1533
|
+
c.layout.height = 0;
|
|
1534
|
+
zeroLayoutRecursive(c);
|
|
1535
|
+
} else if (disp === Display.Contents) {
|
|
1536
|
+
c.layout.left = 0;
|
|
1537
|
+
c.layout.top = 0;
|
|
1538
|
+
c.layout.width = 0;
|
|
1539
|
+
c.layout.height = 0;
|
|
1540
|
+
collectLayoutChildren(c, flow, abs);
|
|
1541
|
+
} else if (c.style.positionType === PositionType.Absolute) {
|
|
1542
|
+
abs.push(c);
|
|
1543
|
+
} else {
|
|
1544
|
+
flow.push(c);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
function roundLayout(node, scale, absLeft, absTop) {
|
|
1549
|
+
if (scale === 0)
|
|
1550
|
+
return;
|
|
1551
|
+
const l = node.layout;
|
|
1552
|
+
const nodeLeft = l.left;
|
|
1553
|
+
const nodeTop = l.top;
|
|
1554
|
+
const nodeWidth = l.width;
|
|
1555
|
+
const nodeHeight = l.height;
|
|
1556
|
+
const absNodeLeft = absLeft + nodeLeft;
|
|
1557
|
+
const absNodeTop = absTop + nodeTop;
|
|
1558
|
+
const isText = node.measureFunc !== null;
|
|
1559
|
+
l.left = roundValue(nodeLeft, scale, false, isText);
|
|
1560
|
+
l.top = roundValue(nodeTop, scale, false, isText);
|
|
1561
|
+
const absRight = absNodeLeft + nodeWidth;
|
|
1562
|
+
const absBottom = absNodeTop + nodeHeight;
|
|
1563
|
+
const hasFracW = !isWholeNumber(nodeWidth * scale);
|
|
1564
|
+
const hasFracH = !isWholeNumber(nodeHeight * scale);
|
|
1565
|
+
l.width = roundValue(absRight, scale, isText && hasFracW, isText && !hasFracW) - roundValue(absNodeLeft, scale, false, isText);
|
|
1566
|
+
l.height = roundValue(absBottom, scale, isText && hasFracH, isText && !hasFracH) - roundValue(absNodeTop, scale, false, isText);
|
|
1567
|
+
for (const c of node.children) {
|
|
1568
|
+
roundLayout(c, scale, absNodeLeft, absNodeTop);
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
function isWholeNumber(v) {
|
|
1572
|
+
const frac = v - Math.floor(v);
|
|
1573
|
+
return frac < 0.0001 || frac > 0.9999;
|
|
1574
|
+
}
|
|
1575
|
+
function roundValue(v, scale, forceCeil, forceFloor) {
|
|
1576
|
+
let scaled = v * scale;
|
|
1577
|
+
let frac = scaled - Math.floor(scaled);
|
|
1578
|
+
if (frac < 0)
|
|
1579
|
+
frac += 1;
|
|
1580
|
+
if (frac < 0.0001) {
|
|
1581
|
+
scaled = Math.floor(scaled);
|
|
1582
|
+
} else if (frac > 0.9999) {
|
|
1583
|
+
scaled = Math.ceil(scaled);
|
|
1584
|
+
} else if (forceCeil) {
|
|
1585
|
+
scaled = Math.ceil(scaled);
|
|
1586
|
+
} else if (forceFloor) {
|
|
1587
|
+
scaled = Math.floor(scaled);
|
|
1588
|
+
} else {
|
|
1589
|
+
scaled = Math.floor(scaled) + (frac >= 0.4999 ? 1 : 0);
|
|
1590
|
+
}
|
|
1591
|
+
return scaled / scale;
|
|
1592
|
+
}
|
|
1593
|
+
function parseDimension(v) {
|
|
1594
|
+
if (v === undefined)
|
|
1595
|
+
return UNDEFINED_VALUE;
|
|
1596
|
+
if (v === "auto")
|
|
1597
|
+
return AUTO_VALUE;
|
|
1598
|
+
if (typeof v === "number") {
|
|
1599
|
+
return Number.isFinite(v) ? pointValue(v) : UNDEFINED_VALUE;
|
|
1600
|
+
}
|
|
1601
|
+
if (typeof v === "string" && v.endsWith("%")) {
|
|
1602
|
+
return percentValue(parseFloat(v));
|
|
1603
|
+
}
|
|
1604
|
+
const n = parseFloat(v);
|
|
1605
|
+
return isNaN(n) ? UNDEFINED_VALUE : pointValue(n);
|
|
1606
|
+
}
|
|
1607
|
+
function physicalEdge(edge) {
|
|
1608
|
+
switch (edge) {
|
|
1609
|
+
case Edge.Left:
|
|
1610
|
+
case Edge.Start:
|
|
1611
|
+
return EDGE_LEFT;
|
|
1612
|
+
case Edge.Top:
|
|
1613
|
+
return EDGE_TOP;
|
|
1614
|
+
case Edge.Right:
|
|
1615
|
+
case Edge.End:
|
|
1616
|
+
return EDGE_RIGHT;
|
|
1617
|
+
case Edge.Bottom:
|
|
1618
|
+
return EDGE_BOTTOM;
|
|
1619
|
+
default:
|
|
1620
|
+
return EDGE_LEFT;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
const YOGA_INSTANCE = {
|
|
1624
|
+
Config: {
|
|
1625
|
+
create: createConfig,
|
|
1626
|
+
destroy() {}
|
|
1627
|
+
},
|
|
1628
|
+
Node: {
|
|
1629
|
+
create: (config) => new Node(config),
|
|
1630
|
+
createDefault: () => new Node,
|
|
1631
|
+
createWithConfig: (config) => new Node(config),
|
|
1632
|
+
destroy() {}
|
|
1633
|
+
}
|
|
1634
|
+
};
|
|
1635
|
+
export function loadYoga() {
|
|
1636
|
+
return Promise.resolve(YOGA_INSTANCE);
|
|
1637
|
+
}
|
|
1638
|
+
export default YOGA_INSTANCE;
|