claude-code-zanii 2.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -0
- package/dist/chunks/AddWorkspaceDirectory-y_rd6sRl.js +1 -0
- package/dist/chunks/App-DgWSavG1.js +1 -0
- package/dist/chunks/ApproveApiKey-CJKWha-a.js +1 -0
- package/dist/chunks/ApproveApiKey-DTs2ExZH.js +1 -0
- package/dist/chunks/AssistantSessionChooser-BAhVk4id.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-XU_JPh7R.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DV0Pi7ys.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-6erm_8Fn.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CjBvzB5s.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-ts0XnWwl.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-DySPdSqQ.js +1 -0
- package/dist/chunks/CustomSelect-DqZxzBZP.js +1 -0
- package/dist/chunks/DesktopHandoff-5c90JK88.js +1 -0
- package/dist/chunks/DevChannelsDialog-DCMderzu.js +1 -0
- package/dist/chunks/Dialog-Dgg8bqcG.js +1 -0
- package/dist/chunks/DiffDialog-BU765aqh.js +6 -0
- package/dist/chunks/Doctor-B73iDB-d.js +3 -0
- package/dist/chunks/Doctor-CLZDdNRo.js +1 -0
- package/dist/chunks/ExitFlow-DBqn2mUf.js +2 -0
- package/dist/chunks/Feedback-D-JHabwi.js +2 -0
- package/dist/chunks/Grove-D-uQNMMo.js +11 -0
- package/dist/chunks/HybridTransport-B-G4QJcy.js +4 -0
- package/dist/chunks/ITermBackend-KP1vKsRN.js +1 -0
- package/dist/chunks/InProcessTransport-ByBEKxrQ.js +1 -0
- package/dist/chunks/InvalidConfigDialog-CMqiZ5nG.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-CjPCKzVZ.js +1 -0
- package/dist/chunks/ListItem-B6MyhHvM.js +1 -0
- package/dist/chunks/MCPConnectionManager-BJ8PcYPe.js +1 -0
- package/dist/chunks/Message-DNxJ_tMS.js +1 -0
- package/dist/chunks/MessageSelector-D79Ug71B.js +3 -0
- package/dist/chunks/Messages-CtIbkB2M.js +11 -0
- package/dist/chunks/Onboarding-DVrgKrI9.js +1 -0
- package/dist/chunks/OverageCreditUpsell-D_td1ss4.js +1 -0
- package/dist/chunks/PermissionDialog-BCS22yEO.js +1 -0
- package/dist/chunks/PermissionDialog-C5O1fL53.js +1 -0
- package/dist/chunks/PermissionRequestTitle-CtlbBU9t.js +1 -0
- package/dist/chunks/PluginSettings-OPrg-_3N.js +17 -0
- package/dist/chunks/PressEnterToContinue-DmzxIgbZ.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-CcsKj5DK.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-JedFdsxU.js +1 -0
- package/dist/chunks/REPL-ByhyIRnf.js +1 -0
- package/dist/chunks/REPL-Clve-8zC.js +157 -0
- package/dist/chunks/RemoteCallout-BZcabEKb.js +1 -0
- package/dist/chunks/RemoteSessionManager-C2PIFDHt.js +1 -0
- package/dist/chunks/ResumeConversation-D3ZRTFcF.js +1 -0
- package/dist/chunks/SSETransport-DmZWnH0k.js +4 -0
- package/dist/chunks/SearchBox-DQg2Ph0V.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-CLO4nt6N.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BVfBaOOU.js +2 -0
- package/dist/chunks/SentryErrorBoundary-DIaVFad-.js +1 -0
- package/dist/chunks/Settings-rOCxQdS8.js +2 -0
- package/dist/chunks/TeleportProgress-CP8IY6bz.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DMmHgBqo.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-D5wEAW1-.js +1 -0
- package/dist/chunks/ThemePicker-Bgr7yOQB.js +1 -0
- package/dist/chunks/TmuxBackend-BzbtUtP1.js +9 -0
- package/dist/chunks/TrustDialog-BI5U3BQ0.js +1 -0
- package/dist/chunks/TungstenTool-CiQclNwj.js +1 -0
- package/dist/chunks/TungstenTool-kMqy-ifa.js +1 -0
- package/dist/chunks/ValidationErrorsList-DprGtB2w.js +2 -0
- package/dist/chunks/WelcomeV2-C4vfBnIy.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-BSoezOCE.js +2 -0
- package/dist/chunks/add-dir-DpOmv6kv.js +1 -0
- package/dist/chunks/agentDisplay-DuYEwOwO.js +1 -0
- package/dist/chunks/agents-BlurXZrF.js +2 -0
- package/dist/chunks/agents-DhZf7ftU.js +103 -0
- package/dist/chunks/ajv-CDrSAj3O.js +8 -0
- package/dist/chunks/analytics-i6X1et4O.js +1 -0
- package/dist/chunks/ant-D9hd_iYy.js +1 -0
- package/dist/chunks/api-CoaOHwDQ.js +4 -0
- package/dist/chunks/api-DvyGR-L7.js +1 -0
- package/dist/chunks/api-YHYC4Zdk.js +1 -0
- package/dist/chunks/artifacts-BMAYdaqh.js +1 -0
- package/dist/chunks/asciicast-DpHRoebc.js +1 -0
- package/dist/chunks/asciicast-HG1EoAQe.js +4 -0
- package/dist/chunks/assistant-D4-qcNT1.js +1 -0
- package/dist/chunks/assistant-DO2ZmZn1.js +1 -0
- package/dist/chunks/assistant-Dd86NmJM.js +1 -0
- package/dist/chunks/attributionHooks-BUmHrLhB.js +1 -0
- package/dist/chunks/attributionTrailer-r2Pbpu2N.js +1 -0
- package/dist/chunks/auth-CF3BGNYT.js +1 -0
- package/dist/chunks/auth-DwWwG43F.js +1 -0
- package/dist/chunks/auth-V_Xk2iea.js +1 -0
- package/dist/chunks/autoMode-DUksX5_i.js +45 -0
- package/dist/chunks/autoModeDenials-0CPO-Jbu.js +1 -0
- package/dist/chunks/autonomy-C5mNhAdz.js +21 -0
- package/dist/chunks/autonomy-CLt1dWaC.js +1 -0
- package/dist/chunks/autonomyPanel-rioFnrQO.js +1 -0
- package/dist/chunks/axios-DPuSPBlH.js +1 -0
- package/dist/chunks/axios-Zh7qGPze.js +12 -0
- package/dist/chunks/backgroundHousekeeping-BGtfqu-J.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BqKZEvy0.js +17 -0
- package/dist/chunks/banner-BGLr3KYQ.js +2 -0
- package/dist/chunks/base64-js-B1tFNiG0.js +1 -0
- package/dist/chunks/bedrockClient-BFzWuhQK.js +15 -0
- package/dist/chunks/bg-B-YgGwLj.js +9 -0
- package/dist/chunks/bg-IU4gG3jc.js +1 -0
- package/dist/chunks/branch-BWY5W7hf.js +3 -0
- package/dist/chunks/break-cache-CY-O23fJ.js +8 -0
- package/dist/chunks/bridge-CqWd70vK.js +2 -0
- package/dist/chunks/bridgeConfig-CWO8AmCY.js +1 -0
- package/dist/chunks/bridgeConfig-D38y9eXn.js +1 -0
- package/dist/chunks/bridgeConfig-EwUq__ct.js +1 -0
- package/dist/chunks/bridgeConfig-GYR-LUiu.js +1 -0
- package/dist/chunks/bridgeEnabled-DKqmLnKO.js +1 -0
- package/dist/chunks/bridgeEnabled-DZIGDtfY.js +1 -0
- package/dist/chunks/bridgeMain-CXVks2ND.js +1 -0
- package/dist/chunks/bridgeMain-D4nsECwJ.js +68 -0
- package/dist/chunks/bridgeMessaging-BUOZU_ba.js +1 -0
- package/dist/chunks/bridgePointer-BpzIEsD_.js +1 -0
- package/dist/chunks/browser-D1vC3BNd.js +1 -0
- package/dist/chunks/btw-CVXJwoXo.js +1 -0
- package/dist/chunks/buddy-BLcvL8lP.js +3 -0
- package/dist/chunks/bundledMode-DQNSSQbt.js +1 -0
- package/dist/chunks/caches-BrfvzKn5.js +1 -0
- package/dist/chunks/caches-CkSv3MfC.js +3 -0
- package/dist/chunks/capacityWake-BWCSatN6.js +1 -0
- package/dist/chunks/changeDetector-DEZU6tum.js +1 -0
- package/dist/chunks/changeDetector-Df7c6U3d.js +1 -0
- package/dist/chunks/channelAllowlist-BApjAS0V.js +1 -0
- package/dist/chunks/channelNotification-BjWwF85R.js +1 -0
- package/dist/chunks/channelNotification-D01YVwNj.js +1 -0
- package/dist/chunks/chokidar-DPwMBcWI.js +1 -0
- package/dist/chunks/chokidar-DkDXNCTz.js +1 -0
- package/dist/chunks/chrome-D7coxEOI.js +1 -0
- package/dist/chunks/chromeNativeHost-CPj9M_4-.js +1 -0
- package/dist/chunks/chunk-DR8-3Aex.js +1 -0
- package/dist/chunks/classPrivateFieldSet2-DZkxcFPS.js +1 -0
- package/dist/chunks/claudeAiLimitsHook-ATshVrOH.js +1 -0
- package/dist/chunks/claudeDesktop-PVa9tWsM.js +1 -0
- package/dist/chunks/cleanup-C-PGmKpV.js +1 -0
- package/dist/chunks/clear-CxGE9Ntr.js +1 -0
- package/dist/chunks/cliLaunch-CMXoY_LO.js +1 -0
- package/dist/chunks/client-BWED8Tbu.js +35 -0
- package/dist/chunks/client-CinDjeSq.js +7 -0
- package/dist/chunks/client-CpXGg9e0.js +1 -0
- package/dist/chunks/color-B3w_VQTn.js +1 -0
- package/dist/chunks/color-convert-BQZnVz_5.js +1 -0
- package/dist/chunks/commands-DFp48zwy.js +1 -0
- package/dist/chunks/commitAttribution-B0cXmbvv.js +2 -0
- package/dist/chunks/commitAttribution-DRSKRoH6.js +1 -0
- package/dist/chunks/common-BX7bn3hg.js +1 -0
- package/dist/chunks/common-Ce3LanTX.js +1 -0
- package/dist/chunks/common-DdLQuE2_.js +1 -0
- package/dist/chunks/common-HfKcqOYK.js +1 -0
- package/dist/chunks/compact-C8ljGMdo.js +3 -0
- package/dist/chunks/companion-mD1jw6xX.js +1 -0
- package/dist/chunks/completionCache-BqQXVTa9.js +1 -0
- package/dist/chunks/completionCache-BtP4vfAi.js +4 -0
- package/dist/chunks/computerUseLock-ADE_PhIK.js +1 -0
- package/dist/chunks/config-CmyaIIOY.js +1 -0
- package/dist/chunks/config-Rl1Y_Dtq.js +1 -0
- package/dist/chunks/connectHeadless-MFABhXpz.js +1 -0
- package/dist/chunks/constants-BM62Vf_X.js +1 -0
- package/dist/chunks/constants-BfXy-5cI.js +1 -0
- package/dist/chunks/context-BeiZkUNq.js +1 -0
- package/dist/chunks/context-noninteractive-CRdF3iv8.js +54 -0
- package/dist/chunks/controlMessageCompat-591iGHUK.js +1 -0
- package/dist/chunks/conversation-BoguXZEI.js +1 -0
- package/dist/chunks/conversation-yhs7tT-g.js +1 -0
- package/dist/chunks/copy-BpeUcqku.js +7 -0
- package/dist/chunks/createSSHSession-B3JOB4TE.js +6 -0
- package/dist/chunks/createSession-BJSnFBGt.js +1 -0
- package/dist/chunks/createSession-CnRHI3RU.js +1 -0
- package/dist/chunks/cron-iqTFGIos.js +1 -0
- package/dist/chunks/cronScheduler-zRXhgEEU.js +6 -0
- package/dist/chunks/cronTasks-CMJldfoP.js +2 -0
- package/dist/chunks/crossProjectResume-DxO6TX30.js +40 -0
- package/dist/chunks/cwd-B2guYBbl.js +1 -0
- package/dist/chunks/cwd-B5bbyUwz.js +1 -0
- package/dist/chunks/cwd-BXiaJzLh.js +1 -0
- package/dist/chunks/daemon-B3v4OoOu.js +2 -0
- package/dist/chunks/dangerousBackend-OmCzoW35.js +1 -0
- package/dist/chunks/datadog-3-Vvz0yz.js +1 -0
- package/dist/chunks/datadog-BQlp3bTs.js +1 -0
- package/dist/chunks/debug-BDBIipC1.js +2 -0
- package/dist/chunks/debug-C7tW7DFW.js +1 -0
- package/dist/chunks/debug-CjIaNjpK.js +5 -0
- package/dist/chunks/debugUtils-Dsg-UHeg.js +1 -0
- package/dist/chunks/defineProperty-CaCI0a5T.js +1 -0
- package/dist/chunks/desktop-C_SS0068.js +1 -0
- package/dist/chunks/detached-B7RNZeyl.js +5 -0
- package/dist/chunks/detect-libc-DFFGDzPC.js +1 -0
- package/dist/chunks/detectRepository-BnTCJAXR.js +1 -0
- package/dist/chunks/detectRepository-Gobn9eFt.js +1 -0
- package/dist/chunks/detection-CN_uLGU2.js +1 -0
- package/dist/chunks/detection-DW6grIlc.js +1 -0
- package/dist/chunks/diff-B8YmRG5T.js +1 -0
- package/dist/chunks/directoryCompletion-J560aATd.js +1 -0
- package/dist/chunks/dist-B1wOprSs.js +29 -0
- package/dist/chunks/dist-DZQOarNX.js +5 -0
- package/dist/chunks/dist-HZfkKiUF.js +20 -0
- package/dist/chunks/dist-es-4xyrZoNc2.js +1 -0
- package/dist/chunks/dist-es-6kjvVbJd.js +1 -0
- package/dist/chunks/dist-es-BJldFHbt.js +3 -0
- package/dist/chunks/dist-es-BM013UFT.js +1 -0
- package/dist/chunks/dist-es-BPPewn1A.js +1 -0
- package/dist/chunks/dist-es-BZGG3Hnm.js +1 -0
- package/dist/chunks/dist-es-BZjJL64k2.js +1 -0
- package/dist/chunks/dist-es-BctcPxLN.js +1 -0
- package/dist/chunks/dist-es-Bf2jR30y.js +1 -0
- package/dist/chunks/dist-es-BgLoR-hQ.js +1 -0
- package/dist/chunks/dist-es-BismPcTW.js +1 -0
- package/dist/chunks/dist-es-BrPzXmSP.js +1 -0
- package/dist/chunks/dist-es-Bu21Wvhs.js +1 -0
- package/dist/chunks/dist-es-BuWNNAXW.js +1 -0
- package/dist/chunks/dist-es-Bz11sFiK2.js +1 -0
- package/dist/chunks/dist-es-C5VplyPL2.js +5 -0
- package/dist/chunks/dist-es-C66BuLgn.js +1 -0
- package/dist/chunks/dist-es-CCIzgNln2.js +1 -0
- package/dist/chunks/dist-es-CLyx7Kge2.js +1 -0
- package/dist/chunks/dist-es-CUbatGdn.js +1 -0
- package/dist/chunks/dist-es-CYe_-TbD.js +1 -0
- package/dist/chunks/dist-es-C_IHUdzL.js +1 -0
- package/dist/chunks/dist-es-Ci_rKlMr.js +1 -0
- package/dist/chunks/dist-es-ClDZBAj7.js +1 -0
- package/dist/chunks/dist-es-Cp--qjOi.js +1 -0
- package/dist/chunks/dist-es-CzE4kW1L.js +9 -0
- package/dist/chunks/dist-es-DUg5w7-v.js +1 -0
- package/dist/chunks/dist-es-Dl0ZRczY.js +1 -0
- package/dist/chunks/dist-es-Do_155z5.js +1 -0
- package/dist/chunks/dist-es-DxIM0jd82.js +1 -0
- package/dist/chunks/dist-es-Fav2oBDs.js +1 -0
- package/dist/chunks/dist-es-TZjwPaGn.js +1 -0
- package/dist/chunks/dist-es-W22ud2el2.js +1 -0
- package/dist/chunks/dist-es-aU8-02YH.js +1 -0
- package/dist/chunks/dist-es-b3yZSGx82.js +1 -0
- package/dist/chunks/dist-es-dIP5JtXz.js +5 -0
- package/dist/chunks/dist-es-mQ4HvnYs2.js +1 -0
- package/dist/chunks/distRoot-CJaacAHy.js +1 -0
- package/dist/chunks/doctor-DLZPF4iY.js +1 -0
- package/dist/chunks/earlyInput-BTI1CSNt.js +2 -0
- package/dist/chunks/earlyInput-BwGtzhhP.js +1 -0
- package/dist/chunks/effort-BaHvpBWr.js +9 -0
- package/dist/chunks/entry-_e-lyRwv.js +14 -0
- package/dist/chunks/env-CesrOJJq.js +1 -0
- package/dist/chunks/envLessBridgeConfig-4oys0_9A.js +1 -0
- package/dist/chunks/envLessBridgeConfig-DJ1Sts3F.js +1 -0
- package/dist/chunks/envUtils-CFG7IQID.js +1 -0
- package/dist/chunks/errorLogSink-Ti4Suoz6.js +2 -0
- package/dist/chunks/escHotkey-CVn_80xM.js +259 -0
- package/dist/chunks/esm-BFnjHW38.js +1 -0
- package/dist/chunks/esm-BQg_LX3V.js +1 -0
- package/dist/chunks/esm-BtC6CMmM.js +1 -0
- package/dist/chunks/esm-BwzC0MQp.js +1 -0
- package/dist/chunks/esm-CFybeQ_Q.js +1 -0
- package/dist/chunks/esm-CK-5CT5X.js +1 -0
- package/dist/chunks/esm-CL1OwlZB.js +1 -0
- package/dist/chunks/esm-CMzgSTAl.js +1 -0
- package/dist/chunks/esm-CPE_H2Lx.js +1 -0
- package/dist/chunks/esm-CcWquv5a.js +10 -0
- package/dist/chunks/esm-CeNEpRZt.js +1 -0
- package/dist/chunks/esm-D7hykoRB.js +1 -0
- package/dist/chunks/esm-DUtcefEV.js +1 -0
- package/dist/chunks/esm-DhrUwJBp.js +1 -0
- package/dist/chunks/esm-Duu1fRQ8.js +1 -0
- package/dist/chunks/esm-Ght2BaU2.js +1 -0
- package/dist/chunks/esm-Q6Yz2GMx.js +56 -0
- package/dist/chunks/esm-WONEiurY.js +13 -0
- package/dist/chunks/event-streams-BumpU1aB.js +1 -0
- package/dist/chunks/eventLoopStallDetector-DxyFdg1h.js +1 -0
- package/dist/chunks/execAsync-ChKxDZ8C.js +1 -0
- package/dist/chunks/execFileNoThrow-DdmR1mBS.js +1 -0
- package/dist/chunks/execSyncWrapper-Ch4TNj8u.js +1 -0
- package/dist/chunks/execa-BMaINL7N.js +34 -0
- package/dist/chunks/executor-C7INr19-.js +1 -0
- package/dist/chunks/executor-Dnf3YYma.js +1604 -0
- package/dist/chunks/exit-BakzsOD0.js +1 -0
- package/dist/chunks/exit-CiDn2tN9.js +2 -0
- package/dist/chunks/export-b-6pqMqz.js +2 -0
- package/dist/chunks/exportRenderer-RxtEIyTm.js +1 -0
- package/dist/chunks/extra-usage-7EPJNjNW.js +1 -0
- package/dist/chunks/extra-usage-ChvuewCq.js +1 -0
- package/dist/chunks/extra-usage-core-BVhLtoDF.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-_Njh6q-q.js +1 -0
- package/dist/chunks/extraUsage-qOBMQB6g.js +1 -0
- package/dist/chunks/extractMemories-CRBVNiG1.js +1 -0
- package/dist/chunks/fast-C4uw_g7o.js +1 -0
- package/dist/chunks/fast-CEaIzaPl.js +1 -0
- package/dist/chunks/featureCheck-B1GSTyhh.js +1 -0
- package/dist/chunks/featureCheck-DKigAPal.js +1 -0
- package/dist/chunks/feedback-Bf3TjjuD.js +1 -0
- package/dist/chunks/figures-fES5sASd.js +1 -0
- package/dist/chunks/fileStateCache-DAsLEZau.js +1 -0
- package/dist/chunks/files-B-m_4X8b.js +2 -0
- package/dist/chunks/findExecutable-D8vJrFnO.js +1 -0
- package/dist/chunks/firstPartyEventLogger-BtrGagNa.js +1 -0
- package/dist/chunks/flushGate-2zqab-Pp.js +1 -0
- package/dist/chunks/foundry-sdk-CtX8C0x3.js +1 -0
- package/dist/chunks/fpsMetrics-ts_jaF3g.js +1 -0
- package/dist/chunks/fuse-ivQ_eRwF.js +1 -0
- package/dist/chunks/gates-CmKoQ0O-.js +1 -0
- package/dist/chunks/gates-_wbPDQ3M.js +1 -0
- package/dist/chunks/gemini-DRx495gn.js +3 -0
- package/dist/chunks/generateRecap-Cv8gd_QF.js +1 -0
- package/dist/chunks/generateSessionName-Dpjg-u_x.js +1 -0
- package/dist/chunks/genericProcessUtils-BFJMxLqn.js +23 -0
- package/dist/chunks/getMachineId-bsd-C9pL9Ajr.js +1 -0
- package/dist/chunks/getMachineId-darwin-Ma4F9rJg.js +2 -0
- package/dist/chunks/getMachineId-linux-C0lXMqsj.js +1 -0
- package/dist/chunks/getMachineId-unsupported-ByHQTXat.js +1 -0
- package/dist/chunks/getMachineId-win-DZsXZmTz.js +1 -0
- package/dist/chunks/git-Bj8Ow4pJ.js +6 -0
- package/dist/chunks/git-Q_b4oZ17.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DGivBX9h.js +1 -0
- package/dist/chunks/goal-BrHEJv8o.js +3 -0
- package/dist/chunks/goalStorage-CsuPOQbk.js +1 -0
- package/dist/chunks/graceful-fs-BuPWC-vB.js +2 -0
- package/dist/chunks/grok-CDkDDaY_.js +1 -0
- package/dist/chunks/growthbook-D3_Cr9n-.js +1 -0
- package/dist/chunks/growthbook-p4aJ_UMv.js +32 -0
- package/dist/chunks/hash-KW-tVnPp.js +1 -0
- package/dist/chunks/heapdump-CloylIZ9.js +5 -0
- package/dist/chunks/help-DpSJlHIc.js +1 -0
- package/dist/chunks/hooks-2pogt8nv.js +79 -0
- package/dist/chunks/hooks-BBODdwnE.js +1 -0
- package/dist/chunks/hostAdapter-B5KTUqhv.js +1 -0
- package/dist/chunks/hostGuard-DyWr2TwE.js +1 -0
- package/dist/chunks/httpAuthSchemes-CgPbtGos.js +13 -0
- package/dist/chunks/ide-CJEcfBZq.js +2 -0
- package/dist/chunks/inboundAttachments-RNpYpRTO.js +1 -0
- package/dist/chunks/index.min-DCDiLq-j.js +1 -0
- package/dist/chunks/initReplBridge-D2E6IM2B.js +1 -0
- package/dist/chunks/initReplBridge-p2uwDBPx.js +1 -0
- package/dist/chunks/insights-DnpZScKs.js +822 -0
- package/dist/chunks/install-D_vTxUlG.js +1 -0
- package/dist/chunks/install-github-app-BK8A7g3i.js +147 -0
- package/dist/chunks/install-slack-app-C47R9VoI.js +1 -0
- package/dist/chunks/instinctParser-DxKdI3JC.js +1 -0
- package/dist/chunks/instrumentation-DkdAJFrZ.js +12 -0
- package/dist/chunks/intl-Pse97ORk.js +1 -0
- package/dist/chunks/isObject-DaxDnPKm.js +1 -0
- package/dist/chunks/isSymbol-D7QeUnS5.js +1 -0
- package/dist/chunks/job-opl00C4l.js +2 -0
- package/dist/chunks/json-bigint-BRRVs1dv.js +8 -0
- package/dist/chunks/jsx-runtime-BTgGEFjL.js +1 -0
- package/dist/chunks/jws-B_ieuaZg.js +3 -0
- package/dist/chunks/jwtUtils-D-tJzoJY.js +1 -0
- package/dist/chunks/keybindings-mRf9VSe8.js +2 -0
- package/dist/chunks/lang-eH4EJErj.js +1 -0
- package/dist/chunks/language-DD9ar6RA.js +1 -0
- package/dist/chunks/language-EZLNdETg.js +1 -0
- package/dist/chunks/launchAgentsPlatform-Cq0_7-IM.js +1 -0
- package/dist/chunks/launchAutofixPr-Bw7aUHUs.js +18 -0
- package/dist/chunks/launchCommand-Bk1Fn-qZ.js +1 -0
- package/dist/chunks/launchLocalMemory-CLBCUgwd.js +3 -0
- package/dist/chunks/launchLocalVault-BfWJWrBg.js +3 -0
- package/dist/chunks/launchMemoryStores-DdnSVSDZ.js +1 -0
- package/dist/chunks/launchOnboarding-ziCEX3GI.js +8 -0
- package/dist/chunks/launchSchedule-G_c7sgmy.js +1 -0
- package/dist/chunks/launchSkillStore-Z1Kd7nCg.js +1 -0
- package/dist/chunks/launchTeleport-Dp9AFbPx.js +3 -0
- package/dist/chunks/launchVault-hwK-Ljek.js +1 -0
- package/dist/chunks/lazySchema-2sOku3cX.js +1 -0
- package/dist/chunks/lib-BHRYgENJ.js +8 -0
- package/dist/chunks/lib-DRyNc7xD.js +2 -0
- package/dist/chunks/lib-Ddq71jM5.js +14 -0
- package/dist/chunks/loadAgentsDir-Bz0FfcVt.js +5620 -0
- package/dist/chunks/loadAgentsDir-CLM0ws7u.js +1 -0
- package/dist/chunks/loadPluginHooks-B5SIS2uo.js +1 -0
- package/dist/chunks/loadSso-RY87rrJO.js +1 -0
- package/dist/chunks/localSearch-BLF6PSv2.js +1 -0
- package/dist/chunks/localSearch-CTycGe3E.js +1 -0
- package/dist/chunks/localSearch-inDahM8I.js +1 -0
- package/dist/chunks/lockfile--gk1HDM6.js +1 -0
- package/dist/chunks/log-B-Nj3Yed.js +1 -0
- package/dist/chunks/log-DVv8YiNo.js +1 -0
- package/dist/chunks/login-BeLvLowc.js +1 -0
- package/dist/chunks/login-DUUOeNoz.js +1 -0
- package/dist/chunks/logoV2Utils-D5SpeZ3C.js +1 -0
- package/dist/chunks/logout-C2QuTBdS.js +1 -0
- package/dist/chunks/magicDocs-CUXKi-Wv.js +57 -0
- package/dist/chunks/main-CFhpWtpC.js +1420 -0
- package/dist/chunks/main-sboa5RKc.js +31 -0
- package/dist/chunks/mappers-DLkk0PZz.js +1 -0
- package/dist/chunks/mcp-C2f6IgAp.js +2 -0
- package/dist/chunks/mcp-Djui9m3_.js +6 -0
- package/dist/chunks/mcp-DvTSxrJ4.js +1 -0
- package/dist/chunks/mcpServer-DMA0bdFC.js +1 -0
- package/dist/chunks/mcpServer-DxEHfW2v.js +1 -0
- package/dist/chunks/memoize-Bg2dXTzV.js +1 -0
- package/dist/chunks/memoize-DNnuA2aU.js +1 -0
- package/dist/chunks/memory-B9io9Zcv.js +1 -0
- package/dist/chunks/mobile-CPnnvkQV.js +2 -0
- package/dist/chunks/modalContext-B1b0Gsro.js +1 -0
- package/dist/chunks/mode-BDgwh_Xb.js +2 -0
- package/dist/chunks/model-B6cpEh-s.js +1 -0
- package/dist/chunks/model-BcunOCC9.js +1 -0
- package/dist/chunks/modelOptions-CHUHQ9WG.js +1 -0
- package/dist/chunks/normalization-cjPqid31.js +1 -0
- package/dist/chunks/oauth-CnBLewrU.js +1 -0
- package/dist/chunks/oauth-DMPGYAoZ.js +1 -0
- package/dist/chunks/observationStore-DVBxrSdI.js +4 -0
- package/dist/chunks/onChangeAppState-M61XDN6V.js +1 -0
- package/dist/chunks/open-CsUNPSNx.js +1 -0
- package/dist/chunks/openai-BHvlYW3m.js +2 -0
- package/dist/chunks/output-style-BtKuBrs4.js +1 -0
- package/dist/chunks/outputStyles-hHuIBkRB.js +84 -0
- package/dist/chunks/overageCreditGrant-BLFT-rF3.js +1 -0
- package/dist/chunks/p-map-C-WNcN6g.js +1 -0
- package/dist/chunks/p-map-CQ2NythB.js +1 -0
- package/dist/chunks/package-9IAs5Qf0.js +1 -0
- package/dist/chunks/panel-27xLZI7c.js +1 -0
- package/dist/chunks/panel-NoDfShEZ.js +1 -0
- package/dist/chunks/panelCall-CEOWVNCM.js +1 -0
- package/dist/chunks/parseConnectUrl-CxU4IX9o.js +1 -0
- package/dist/chunks/parser-DGlAnaNj.js +1 -0
- package/dist/chunks/parser-DGoLe2RS.js +1 -0
- package/dist/chunks/passes-CExcqu66.js +1 -0
- package/dist/chunks/path-uaxlnhva.js +1 -0
- package/dist/chunks/permissions-B3PceQul.js +1 -0
- package/dist/chunks/permissions-DezIL2xF.js +3 -0
- package/dist/chunks/permissions-DnpI8Whh.js +1 -0
- package/dist/chunks/pipeTransport-CB_Wq_Kx.js +1 -0
- package/dist/chunks/plan-cfZBclh9.js +1 -0
- package/dist/chunks/platform-BXz_rgpy.js +2 -0
- package/dist/chunks/plist-DLGDWBD6.js +6 -0
- package/dist/chunks/plugin-CuhENLRs.js +1 -0
- package/dist/chunks/pluginAutoupdate-wTeOXfQe.js +1 -0
- package/dist/chunks/pluginBlocklist-D6pkKfXr.js +1 -0
- package/dist/chunks/pluginCliCommands-DqxdCwsq.js +1 -0
- package/dist/chunks/pluginFlagging-CjH48f-K.js +1 -0
- package/dist/chunks/pluginOperations-DMFYB3pK.js +2 -0
- package/dist/chunks/pluginStartupCheck-BW3_KfZz.js +1 -0
- package/dist/chunks/pluginStartupCheck-Cj2BMjVw.js +1 -0
- package/dist/chunks/plugins-CarsG2v8.js +4 -0
- package/dist/chunks/policyLimits-DFn1vHkN.js +1 -0
- package/dist/chunks/pollConfig-C8nODJY1.js +1 -0
- package/dist/chunks/poller-DXZJ-dUP.js +1 -0
- package/dist/chunks/poor-C7GQ4a5X.js +1 -0
- package/dist/chunks/poorMode-CBe0rfxB.js +1 -0
- package/dist/chunks/poorMode-CbZTudtw.js +1 -0
- package/dist/chunks/postCommitAttribution--vvAWIqD.js +1 -0
- package/dist/chunks/print-CwwtGSbK.js +114 -0
- package/dist/chunks/privacy-settings-Bz8cAVp5.js +11 -0
- package/dist/chunks/privacyLevel-CRCHhztk.js +1 -0
- package/dist/chunks/process-CnhUplBr.js +1 -0
- package/dist/chunks/process-X4vCP9x0.js +1 -0
- package/dist/chunks/processBashCommand-NL0YEUqW.js +3 -0
- package/dist/chunks/processSlashCommand-FPMWElsI.js +6 -0
- package/dist/chunks/processSlashCommand-_oJs6_w8.js +6 -0
- package/dist/chunks/processUserInput-QAJK0XSn.js +1 -0
- package/dist/chunks/projectContext-B21hXj9q.js +1 -0
- package/dist/chunks/projectContext-DbTQHQS3.js +1 -0
- package/dist/chunks/prompt-C6eleu4x.js +1 -0
- package/dist/chunks/prompt-CUdoQXyN.js +1 -0
- package/dist/chunks/prompt-CsBCtw4l.js +228 -0
- package/dist/chunks/prompt-hnIDYhP4.js +54 -0
- package/dist/chunks/promptEditor-CrlVcc17.js +4 -0
- package/dist/chunks/protectedNamespace-Cn4901XG.js +1 -0
- package/dist/chunks/protocolHandler-DM_w7sJ5.js +13 -0
- package/dist/chunks/protocols-CpoQzjyI.js +7 -0
- package/dist/chunks/proxy-9WvtUy8E.js +99 -0
- package/dist/chunks/rate-limit-options-BehQ3MoX.js +1 -0
- package/dist/chunks/rcDebugLog-BbHlIxCm.js +11 -0
- package/dist/chunks/referral-BfAZEIZL.js +1 -0
- package/dist/chunks/refresh-Bl3Miver.js +1 -0
- package/dist/chunks/registerProtocol-BHZ3vZED.js +36 -0
- package/dist/chunks/registerSkillHooks-BR7v5qDA.js +1 -0
- package/dist/chunks/registry-C2igpRd-.js +1 -0
- package/dist/chunks/release-notes-C_Cou6ye.js +4 -0
- package/dist/chunks/releaseNotes-DveQShyB.js +2 -0
- package/dist/chunks/reload-plugins-D-pAUoB5.js +1 -0
- package/dist/chunks/remote-env-C_dBgbgo.js +1 -0
- package/dist/chunks/remoteBridgeCore-BxWhTy1u.js +1 -0
- package/dist/chunks/remoteControlServer-D3OjUlB-.js +3 -0
- package/dist/chunks/rename-f3m0ETSt.js +1 -0
- package/dist/chunks/renderOptions-QZLxGnh_.js +1 -0
- package/dist/chunks/replBridge-qeVmCJOb.js +1 -0
- package/dist/chunks/resume-CM_8p9Iu.js +2 -0
- package/dist/chunks/rewind-0cB7o6fx.js +1 -0
- package/dist/chunks/ripgrep-BEWqxrpl.js +5 -0
- package/dist/chunks/ripgrep-G82m12Ng.js +1 -0
- package/dist/chunks/rollback-CVo2gqgR.js +11 -0
- package/dist/chunks/runtimeObserver-1EdvvoYw.js +1 -0
- package/dist/chunks/runtimeObserver-CX6vepq9.js +10 -0
- package/dist/chunks/sandbox-adapter-DzHfW2tH.js +1 -0
- package/dist/chunks/sandbox-toggle-N6KgmH2T.js +1 -0
- package/dist/chunks/sanitization-CIBpY9KT.js +1 -0
- package/dist/chunks/satisfies-B7ZvBUQP.js +1 -0
- package/dist/chunks/schemas-Bwt-7U5W.js +40 -0
- package/dist/chunks/sdk-Drp69kIx.js +1 -0
- package/dist/chunks/sdkHeapDumpMonitor-B9GVkISU.js +1 -0
- package/dist/chunks/searchExtraTools-BphNJsl8.js +1 -0
- package/dist/chunks/semver-BsItM2Z4.js +1 -0
- package/dist/chunks/semver-D3lOjiBN.js +1 -0
- package/dist/chunks/sentry-ySzRCXGd.js +1 -0
- package/dist/chunks/server-C8nMDji6.js +1 -0
- package/dist/chunks/server-XZG51Slr.js +1 -0
- package/dist/chunks/serverBanner-D68EBGzH.js +1 -0
- package/dist/chunks/serverLog-hv2hc5US.js +1 -0
- package/dist/chunks/session-CVoGFb8a.js +2 -0
- package/dist/chunks/sessionDataUploader-BaD1Q7v3.js +1 -0
- package/dist/chunks/sessionDiscovery-D7g66TX6.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-9lPjspRX.js +1 -0
- package/dist/chunks/sessionManager-BhOjMNAP.js +1 -0
- package/dist/chunks/sessionMemory-BA6cdxqP.js +1 -0
- package/dist/chunks/sessionMemory-CtEhIRGF.js +1 -0
- package/dist/chunks/sessionMemoryUtils-D_B92ypa.js +1 -0
- package/dist/chunks/sessionObserver-CESI-uVZ.js +1 -0
- package/dist/chunks/sessionObserver-SpE_eglb.js +20 -0
- package/dist/chunks/sessionRestore-DqsqYK4K.js +1 -0
- package/dist/chunks/sessionState-Dgky34M4.js +1 -0
- package/dist/chunks/sessionStorage-DJb5HKhQ.js +1 -0
- package/dist/chunks/sessionStorage-DSMfHTcg.js +1 -0
- package/dist/chunks/sessionStoragePortable-DyM_hZnp.js +3 -0
- package/dist/chunks/sessionTitle-Bzxk_EW9.js +14 -0
- package/dist/chunks/sessionTracing-DR8O0686.js +12 -0
- package/dist/chunks/setup-BHNS9sBS.js +9 -0
- package/dist/chunks/setup-BafJxZ0F.js +4 -0
- package/dist/chunks/setup-MLNNYLi6.js +1 -0
- package/dist/chunks/shadowedRuleDetection-Ch9gTxfD.js +1 -0
- package/dist/chunks/shellQuote-3s6tV-hK.js +1 -0
- package/dist/chunks/sideQuestion-BBn6XIOD.js +20 -0
- package/dist/chunks/signal-BTxmab6r.js +1 -0
- package/dist/chunks/signin-ChbUAEGq.js +1 -0
- package/dist/chunks/sink-B1qICbRh.js +1 -0
- package/dist/chunks/sink-yBIcxQf1.js +1 -0
- package/dist/chunks/sinks-C7weduDR.js +1 -0
- package/dist/chunks/skill-learning-08nEdOJ2.js +5 -0
- package/dist/chunks/skillGapStore-CuvWGqFb.js +5 -0
- package/dist/chunks/skillGapStore-DmMuDXKO.js +1 -0
- package/dist/chunks/skillGenerator-mEMjcmmm.js +8 -0
- package/dist/chunks/skillLearning-B3a-8Ys3.js +1 -0
- package/dist/chunks/skillLearning-q5T6o0mH.js +1 -0
- package/dist/chunks/skillPanel-BuUMhONI.js +28 -0
- package/dist/chunks/skillSearchPanel-BUEv7Sm9.js +21 -0
- package/dist/chunks/skillUsageTracking-BBTiWOKB.js +1 -0
- package/dist/chunks/skills-DvQuQfDW.js +1 -0
- package/dist/chunks/slashCommandParsing-BkTC3GRb.js +1 -0
- package/dist/chunks/sleep-CC8jykQd.js +1 -0
- package/dist/chunks/slowOperations-niPqC54V.js +1 -0
- package/dist/chunks/sprites-C5X62Vyh.js +1 -0
- package/dist/chunks/src-58uAJYF_.js +6 -0
- package/dist/chunks/src-7Y8fx6gl.js +2 -0
- package/dist/chunks/src-BuserDTl.js +1 -0
- package/dist/chunks/src-CMY4XoRy.js +1 -0
- package/dist/chunks/src-CfeAM1FB.js +1 -0
- package/dist/chunks/src-CxT2FDXy.js +1 -0
- package/dist/chunks/src-CyQf7rVu.js +26 -0
- package/dist/chunks/src-DJLbU8sT.js +1 -0
- package/dist/chunks/src-DJQlyVK6.js +5 -0
- package/dist/chunks/src-DNHWYkls.js +53 -0
- package/dist/chunks/src-DU_g0n_Q.js +1 -0
- package/dist/chunks/src-DhqzQjMg.js +19 -0
- package/dist/chunks/src-Duzv1Znh.js +1 -0
- package/dist/chunks/src-OBx6GAig.js +1 -0
- package/dist/chunks/src-WjnK2Dbo.js +1 -0
- package/dist/chunks/src-hjAMxWFj.js +7 -0
- package/dist/chunks/src-lLwoqdC0.js +9 -0
- package/dist/chunks/src-yRsWbJp_.js +2 -0
- package/dist/chunks/sso-oidc-yfC-A2A2.js +1 -0
- package/dist/chunks/startupProfiler-4P7GdVw6.js +3 -0
- package/dist/chunks/startupProfiler-CipS0otN.js +1 -0
- package/dist/chunks/state-9wSimHaL.js +1 -0
- package/dist/chunks/state-BQkyHx88.js +1 -0
- package/dist/chunks/state-CEAUTY3A.js +1 -0
- package/dist/chunks/state-CUZTq6r0.js +1 -0
- package/dist/chunks/state-U0HNbTx8.js +1 -0
- package/dist/chunks/staticRender-BB3CisKd.js +1 -0
- package/dist/chunks/stats-Dyi2U_mq.js +1 -0
- package/dist/chunks/status-CSL-GMou.js +1 -0
- package/dist/chunks/statusNoticeHelpers-BaXE951d.js +1 -0
- package/dist/chunks/stdio-BuUJYJFs.js +3 -0
- package/dist/chunks/stdio-iX0TTmbp.js +1 -0
- package/dist/chunks/stickers-2CRSckfH.js +1 -0
- package/dist/chunks/store-DdfsZvtr.js +1 -0
- package/dist/chunks/stringUtils-U7kMYMJq.js +4 -0
- package/dist/chunks/sts-CJmdeT7s.js +1 -0
- package/dist/chunks/subprocessEnv-DKTILev5.js +1 -0
- package/dist/chunks/subprocessEnv-WjRguKWf.js +1 -0
- package/dist/chunks/supports-color-DaytqqjM.js +1 -0
- package/dist/chunks/systemPromptSections-BnrxBWdc.js +1 -0
- package/dist/chunks/systemPromptSections-Dk6azdAb.js +1 -0
- package/dist/chunks/systemTheme-C1GNqIfy.js +1 -0
- package/dist/chunks/tag-C4cH016L.js +11 -0
- package/dist/chunks/tasks-CEdUW3RQ.js +1 -0
- package/dist/chunks/teamHelpers-CTA_CtTT.js +1 -0
- package/dist/chunks/teamHelpers-D65qZInv.js +1 -0
- package/dist/chunks/teammate-C-FiRloZ.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DWRG5-Us.js +1 -0
- package/dist/chunks/teammateModeSnapshot-DtgsNj1G.js +1 -0
- package/dist/chunks/teleport-C_UgMy0V.js +1 -0
- package/dist/chunks/templateJobs-CMbS0tuk.js +12 -0
- package/dist/chunks/terminalSetup--jwGVap8.js +33 -0
- package/dist/chunks/terminalSetup-zID-wokH.js +1 -0
- package/dist/chunks/theme-C6XwTpVy.js +1 -0
- package/dist/chunks/thinkback-CVLnmLAT.js +1 -0
- package/dist/chunks/thinkback-MeOOO7gf.js +1 -0
- package/dist/chunks/thinkback-play-D7G260F4.js +1 -0
- package/dist/chunks/tmux-DtYJuTWh.js +1 -0
- package/dist/chunks/toolEventObserver-BtC9xDYY.js +1 -0
- package/dist/chunks/toolEventObserver-MfsHAt8h.js +1 -0
- package/dist/chunks/toolPool-CEi_2xIH.js +1 -0
- package/dist/chunks/toolPool-CdYJcCnc.js +1 -0
- package/dist/chunks/trustedDevice-CjQTGAa4.js +1 -0
- package/dist/chunks/trustedDevice-DADcxAAs.js +1 -0
- package/dist/chunks/tui-B8Ijq4Pk.js +6 -0
- package/dist/chunks/turndown.es-T-Xe93nc.js +69 -0
- package/dist/chunks/types-BVelRhgb.js +17 -0
- package/dist/chunks/types-Bqp3meR4.js +1 -0
- package/dist/chunks/types-CNmINIu3.js +1 -0
- package/dist/chunks/types-DgzOOCDl.js +3 -0
- package/dist/chunks/udsClient-ClY_0CKr.js +1 -0
- package/dist/chunks/ultrareviewCommand-CqvHj9Io.js +3 -0
- package/dist/chunks/undercover-CVCVOSrs.js +1 -0
- package/dist/chunks/undercover-CbxiJO2b.js +31 -0
- package/dist/chunks/up-CBJhVVbd.js +12 -0
- package/dist/chunks/updateCCB-DPPpquAw.js +11 -0
- package/dist/chunks/upgrade-DaaHOvft.js +1 -0
- package/dist/chunks/upgrade-k7ZvAWZ0.js +1 -0
- package/dist/chunks/upload-CEDxwMa1.js +1 -0
- package/dist/chunks/upstreamproxy-BtGJ2LRi.js +11 -0
- package/dist/chunks/usage-CsUSu4fb.js +1 -0
- package/dist/chunks/usage-oABvixCs.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CBce_-hb.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CLYjTZXb.js +1 -0
- package/dist/chunks/useKeybinding-DAQL_dB_.js +1 -0
- package/dist/chunks/useMainLoopModel-QC_H3esG.js +1 -0
- package/dist/chunks/useManageMCPConnections-bf-VfJGD.js +1 -0
- package/dist/chunks/useManagePlugins-CXdYUpit.js +1 -0
- package/dist/chunks/useMergedTools-DERzhQOJ.js +1 -0
- package/dist/chunks/useSearchInput-nqhdILI2.js +1 -0
- package/dist/chunks/useTerminalSize-DzV4aaTi.js +1 -0
- package/dist/chunks/useVoice-CO69xtWC.js +1 -0
- package/dist/chunks/util-C8wqPqv0.js +1 -0
- package/dist/chunks/utils-CDFsSXHr.js +1 -0
- package/dist/chunks/utils-ZO5TryVH.js +1 -0
- package/dist/chunks/v4-DLhvDPkt.js +1 -0
- package/dist/chunks/validatePlugin-C4cd71Yz.js +1 -0
- package/dist/chunks/vertex-sdk-CC3U26o7.js +9 -0
- package/dist/chunks/vim-BNiQx5Vf.js +1 -0
- package/dist/chunks/voice-BCbnJzYL.js +8 -0
- package/dist/chunks/voice-BJyz9KZO.js +8 -0
- package/dist/chunks/voice-CP2ULpju.js +2 -0
- package/dist/chunks/voiceModeEnabled-C-pa8B3Q.js +1 -0
- package/dist/chunks/voiceModeEnabled-CMtRN2pa.js +1 -0
- package/dist/chunks/voiceStreamSTT-31b2u0rj.js +1 -0
- package/dist/chunks/voiceStreamSTT-Fkhm6Ftg.js +1 -0
- package/dist/chunks/voiceStreamSTT-sI-hg-aP.js +1 -0
- package/dist/chunks/web-tools-CLmlPgLk.js +1 -0
- package/dist/chunks/which-C0ex-06E.js +1 -0
- package/dist/chunks/windowsPaths-C5TNvKYu.js +1 -0
- package/dist/chunks/windowsPaths-Kue_7s52.js +1 -0
- package/dist/chunks/workSecret-Dh5Ayceu.js +1 -0
- package/dist/chunks/workerRegistry-B5iWYqpK.js +1 -0
- package/dist/chunks/worktree-BypJA0GB.js +1 -0
- package/dist/chunks/worktreeModeEnabled-DPTdK3JV.js +1 -0
- package/dist/chunks/worktreeModeEnabled-Dtrcn7eD.js +1 -0
- package/dist/chunks/wrapper-BDPb4PTV.js +6 -0
- package/dist/chunks/wrapper-DRTs77RK.js +1 -0
- package/dist/chunks/xdg-BaVL-FHd.js +1 -0
- package/dist/chunks/xml-E8VMPwdJ.js +1 -0
- package/dist/chunks/zod-B_P2Eo_D.js +1 -0
- package/dist/cli-bun.js +2 -0
- package/dist/cli-node.js +2 -0
- package/dist/cli.js +2 -0
- package/dist/vendor/audio-capture/arm64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/arm64-win32/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-darwin/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-linux/audio-capture.node +0 -0
- package/dist/vendor/audio-capture/x64-win32/audio-capture.node +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/package.json +233 -0
- package/scripts/postinstall.cjs +389 -0
- package/scripts/run-parallel.mjs +10 -0
- package/scripts/setup-chrome-mcp.mjs +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Claude Code Zanii (CCZ)
|
|
2
|
+
|
|
3
|
+
[](https://github.com/vigilancetrent/claude-code-zanii/stargazers)
|
|
4
|
+
[](https://github.com/vigilancetrent/claude-code-zanii/graphs/contributors)
|
|
5
|
+
[](https://github.com/vigilancetrent/claude-code-zanii/issues)
|
|
6
|
+
[](https://github.com/vigilancetrent/claude-code-zanii/blob/main/LICENSE)
|
|
7
|
+
[](https://github.com/vigilancetrent/claude-code-zanii/commits/main)
|
|
8
|
+
[](https://bun.sh/)
|
|
9
|
+
[](https://discord.gg/uApuzJWGKX)
|
|
10
|
+
|
|
11
|
+
A fully restored, open build of Anthropic's [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI — every core loop rebuilt in TypeScript on Bun, with the telemetry and lock-ins removed and a few things added that upstream doesn't have. Compatible with existing `CLAUDE.md` / `.claude` setups out of the box.
|
|
12
|
+
|
|
13
|
+
中文文档:[ccb.agent-aura.top](https://ccb.agent-aura.top/) · [社区项目留影](./Friends.md)
|
|
14
|
+
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
## Proof of action
|
|
18
|
+
|
|
19
|
+
Every session can leave a verifiable trail. Claude Code Zanii integrates [Zanii](https://ledger.zanii.agency), a transparency log for AI agents: each tool call becomes a signed, hash-chained receipt in an append-only Merkle log that is periodically anchored on-chain. Only a **hash** of each action is stored — your code and file contents never leave the machine.
|
|
20
|
+
|
|
21
|
+
There is no signup form to fill. On first launch CCZ derives an identity from your hardware (SMBIOS UUID, so it survives OS reinstalls), registers an org named `zaniicode-<fingerprint>`, issues its own ingest key, and keeps everything under `~/.zaniicode/`. From then on, the banner shows live proof state:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
zanii ✓ proof verified · log #6156 · root 54874cc8
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
**What this buys you.** Anyone — you, your client, an auditor — can take a receipt hash or export the full history at `https://ledger.zanii.agency/export/<agent DID>` and verify it offline: signature, delegation scope, Merkle inclusion, chain consistency. No trust in the server required. "What exactly did the agent run?" becomes a checkable question instead of a promise.
|
|
30
|
+
|
|
31
|
+
| File | Contents |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `~/.zaniicode/zanii-account.json` | org id, admin key, `zk_live_` ingest key |
|
|
34
|
+
| `~/.zaniicode/zanii-agent.json` | Ed25519 agent keys, owner-signed delegation cert |
|
|
35
|
+
|
|
36
|
+
| Setting | Default | Meaning |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `ZANII_PROOF` | on | set `0` to disable all ledger activity |
|
|
39
|
+
| `ZANII_API_KEY` | auto-provisioned | bring your own ingest key |
|
|
40
|
+
| `ZANII_SERVER_URL` | `https://ledger.zanii.agency` | point at your own log |
|
|
41
|
+
|
|
42
|
+
Receipts record *that* a tool ran and whether it succeeded — not what was in it. Full details: [`docs/features/zanii-proof.md`](docs/features/zanii-proof.md).
|
|
43
|
+
|
|
44
|
+
## What's inside
|
|
45
|
+
|
|
46
|
+
| | | |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| **Goal mode** — `/goal` drives the agent across turns until done; token budgets, pause/resume, blocked-attempt audits | **Ultracode orchestration** — deterministic JS workflows (`agent`/`pipeline`/`parallel`) with journal replay and a live monitor panel | **Multi-provider login** — Anthropic, Bedrock, Vertex, Foundry, plus OpenAI/Gemini/Grok-compatible endpoints via `/login` |
|
|
49
|
+
| **Remote Control** — self-hosted Docker control panel, run sessions from your phone ([docs](https://ccb.agent-aura.top/docs/features/remote-control-self-hosting)) | **ACP support** — first-class Zed/Cursor integration with session resume and permission bridging ([docs](https://ccb.agent-aura.top/docs/features/acp-zed)) | **Langfuse tracing** — inspect every agent-loop step, export runs as datasets ([docs](https://ccb.agent-aura.top/docs/features/langfuse-monitoring)) |
|
|
50
|
+
| **Pipe IPC & LAN swarm** — multi-instance collaboration on one machine or across the LAN ([docs](https://ccb.agent-aura.top/docs/features/uds-inbox)) | **Web search** — built-in Bing/Brave search tool ([docs](https://ccb.agent-aura.top/docs/features/web-browser-tool)) | **Computer & Chrome use** — screenshots, keyboard/mouse, browser automation ([docs](https://ccb.agent-aura.top/docs/features/computer-use)) |
|
|
51
|
+
| **Poor mode** — `/poor` cuts memory extraction and suggestions to slash request volume | **Channels** — push external messages into a session (Slack, Discord, 飞书, WeChat) ([docs](https://ccb.agent-aura.top/docs/features/channels)) | **Teach-me skill** — `/teach-me <topic>` walks you through this codebase Socratically |
|
|
52
|
+
|
|
53
|
+
## Install
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
npm i -g claude-code-zanii
|
|
57
|
+
|
|
58
|
+
ccz # Node.js entry
|
|
59
|
+
ccz-bun # Bun entry
|
|
60
|
+
ccz update
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If install or update misbehaves: `npm rm -g claude-code-best && npm i -g claude-code-zanii@latest`.
|
|
64
|
+
|
|
65
|
+
## Run from source
|
|
66
|
+
|
|
67
|
+
Requires [Bun](https://bun.sh/) ≥ 1.3.11 — use the newest version, older ones produce confusing failures.
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
# Linux / macOS
|
|
71
|
+
curl -fsSL https://bun.sh/install | bash
|
|
72
|
+
# Windows (PowerShell)
|
|
73
|
+
powershell -c "irm bun.sh/install.ps1 | iex"
|
|
74
|
+
|
|
75
|
+
git clone https://github.com/vigilancetrent/claude-code-zanii.git
|
|
76
|
+
cd claude-code-zanii
|
|
77
|
+
bun install
|
|
78
|
+
|
|
79
|
+
bun run dev # dev mode — version ending in .888 means you're set
|
|
80
|
+
bun run build # production bundle → dist/ (runs under both Bun and Node.js)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### First-run login
|
|
84
|
+
|
|
85
|
+
Type `/login` in the REPL and pick **Anthropic Compatible**, OpenAI, or Gemini. For the compatible path you'll need:
|
|
86
|
+
|
|
87
|
+
| Field | Example |
|
|
88
|
+
|---|---|
|
|
89
|
+
| Base URL | `https://api.example.com/v1` |
|
|
90
|
+
| API Key | `sk-xxx` |
|
|
91
|
+
| Haiku / Sonnet / Opus model IDs | `claude-haiku-4-5-20251001`, `claude-sonnet-4-6`, `claude-opus-4-6` |
|
|
92
|
+
|
|
93
|
+
Tab / Shift+Tab moves between fields, Enter confirms.
|
|
94
|
+
|
|
95
|
+
### Config home
|
|
96
|
+
|
|
97
|
+
CCZ uses `~/.zaniicode/` by default and never touches official Claude Code's `~/.claude` — settings, credentials, and session history stay separate even when both tools are installed. Project-level `.claude/` folders are still read, as usual. Override with `CLAUDE_CONFIG_DIR` if needed.
|
|
98
|
+
|
|
99
|
+
### Feature flags
|
|
100
|
+
|
|
101
|
+
Everything is compiled behind named flags, defaulting per build config:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
FEATURE_BUDDY=1 FEATURE_GOAL=1 bun run dev
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The registry lives in [`scripts/defines.ts`](scripts/defines.ts).
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
bun run typecheck # strict tsc, must be clean
|
|
113
|
+
bun test # 6000+ tests across ~450 files
|
|
114
|
+
bun run lint # Biome
|
|
115
|
+
bun run precheck # all of the above
|
|
116
|
+
bun run dev:inspect # debugger for attach mode
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
TUI debugging needs a real terminal, so use attach: start `bun run dev:inspect`, then F5 → "Attach to Bun (TUI debug)" in VS Code with breakpoints set under `src/`.
|
|
120
|
+
|
|
121
|
+
Architecture notes and module map: [AGENTS.md](AGENTS.md) · [DeepWiki](https://deepwiki.com/vigilancetrent/claude-code-zanii)
|
|
122
|
+
|
|
123
|
+
## Contributors
|
|
124
|
+
|
|
125
|
+
<a href="https://github.com/vigilancetrent/claude-code-zanii/graphs/contributors">
|
|
126
|
+
<img src="contributors.svg" alt="Contributors" />
|
|
127
|
+
</a>
|
|
128
|
+
|
|
129
|
+
## Star history
|
|
130
|
+
|
|
131
|
+
<a href="https://www.star-history.com/?repos=vigilancetrent%2Fclaude-code-zanii&type=date&legend=top-left">
|
|
132
|
+
<picture>
|
|
133
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=vigilancetrent/claude-code-zanii&type=date&theme=dark&legend=top-left" />
|
|
134
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=vigilancetrent/claude-code-zanii&type=date&legend=top-left" />
|
|
135
|
+
<img alt="Star History Chart" src="https://api.star-history.com/image?repos=vigilancetrent/claude-code-zanii&type=date&legend=top-left" />
|
|
136
|
+
</picture>
|
|
137
|
+
</a>
|
|
138
|
+
|
|
139
|
+
## Acknowledgments
|
|
140
|
+
|
|
141
|
+
- [doubaoime-asr](https://github.com/starccy/doubaoime-asr) — ASR SDK powering Voice Mode without Anthropic OAuth
|
|
142
|
+
- [Zanii](https://ledger.zanii.agency) — the transparency-log protocol behind proof of action
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
For study and research only. Claude Code and all related rights belong to [Anthropic](https://www.anthropic.com/).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-fES5sASd.js";import{Ct as i,Rn as a,b as o,f as s,g as c,h as l,t as u,tt as d,wt as f,x as p}from"./src-DNHWYkls.js";import{t as m}from"./jsx-runtime-BTgGEFjL.js";import{GT as h,Jh as g,RT as _,WT as v,Yh as y,lD as b,qh as x,uD as S,zT as C}from"./loadAgentsDir-Bz0FfcVt.js";import{t as w}from"./useKeybinding-DAQL_dB_.js";import{r as T,t as E}from"./directoryCompletion-J560aATd.js";import{r as D,t as O}from"./PromptInputFooterSuggestions-CcsKj5DK.js";function k(){return(0,P.jsx)(o,{dimColor:!0,children:`Claude Code will be able to read files in this directory and make edits when auto-accept edits is on.`})}function A({path:e}){return(0,P.jsxs)(p,{flexDirection:`column`,paddingX:2,gap:1,children:[(0,P.jsx)(o,{color:`permission`,children:e}),(0,P.jsx)(k,{})]})}function j({value:e,onChange:t,onSubmit:n,error:i,suggestions:a,selectedSuggestion:s}){return(0,P.jsxs)(p,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:`Enter the path to the directory:`}),(0,P.jsx)(p,{borderDimColor:!0,borderStyle:`round`,marginY:1,paddingLeft:1,children:(0,P.jsx)(v,{showCursor:!0,placeholder:`Directory path${r.ellipsis}`,value:e,onChange:t,onSubmit:n,columns:80,cursorOffset:e.length,onChangeCursorOffset:()=>{}})}),a.length>0&&(0,P.jsx)(p,{marginBottom:1,children:(0,P.jsx)(O,{suggestions:a,selectedSuggestion:s})}),i&&(0,P.jsx)(o,{color:`error`,children:i})]})}function M({onAddDirectory:e,onCancel:t,permissionContext:n,directoryPath:r}){let[i,a]=(0,N.useState)(``),[u,m]=(0,N.useState)(null),[h,g]=(0,N.useState)([]),[v,S]=(0,N.useState)(0),C=(0,N.useMemo)(()=>F,[]),w=f((0,N.useCallback)(async e=>{if(!e){g([]),S(0);return}g(await E(e)),S(0)},[]),100);(0,N.useEffect)(()=>{w(i)},[i,w]);let T=(0,N.useCallback)(e=>{a(e.id+`/`),m(null)},[]),D=(0,N.useCallback)(async t=>{let r=await y(t,n);r.resultType===`success`?e(r.absolutePath,!1):m(x(r))},[n,e]);d(`confirm:no`,t,{context:`Settings`});let O=(0,N.useCallback)(e=>{if(h.length>0){if(e.key===`tab`){e.preventDefault();let t=h[v];t&&T(t);return}if(e.key===`return`){e.preventDefault();let t=h[v];t&&D(t.id+`/`);return}if(e.key===`up`||e.ctrl&&e.key===`p`){e.preventDefault(),S(e=>e<=0?h.length-1:e-1);return}if(e.key===`down`||e.ctrl&&e.key===`n`){e.preventDefault(),S(e=>e>=h.length-1?0:e+1);return}}},[h,v,T,D]),M=(0,N.useCallback)(n=>{if(r)switch(n){case`yes-session`:e(r,!1);break;case`yes-remember`:e(r,!0);break;case`no`:t();break}},[r,e,t]);return(0,P.jsx)(p,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:O,children:(0,P.jsx)(s,{title:`Add directory to workspace`,onCancel:t,color:`permission`,isCancelActive:!1,inputGuide:r?void 0:e=>e.pending?(0,P.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):(0,P.jsxs)(l,{children:[(0,P.jsx)(c,{shortcut:`Tab`,action:`complete`}),(0,P.jsx)(c,{shortcut:`Enter`,action:`add`}),(0,P.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]}),children:r?(0,P.jsxs)(p,{flexDirection:`column`,gap:1,children:[(0,P.jsx)(A,{path:r}),(0,P.jsx)(_,{options:C,onChange:M,onCancel:()=>M(`no`)})]}):(0,P.jsxs)(p,{flexDirection:`column`,gap:1,marginX:2,children:[(0,P.jsx)(k,{}),(0,P.jsx)(j,{value:i,onChange:a,onSubmit:D,error:u,suggestions:h,selectedSuggestion:v})]})})})}var N,P,F,I=e((()=>{n(),a(),N=t(a(),1),i(),g(),h(),u(),w(),T(),S(),C(),D(),P=m(),F=[{value:`yes-session`,label:`Yes, for this session`},{value:`yes-remember`,label:`Yes, and remember this directory`},{value:`no`,label:`No`}]}));export{I as n,M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Rn as e,S as t,t as n}from"./src-DNHWYkls.js";import{t as r}from"./jsx-runtime-BTgGEFjL.js";import{_s as i,ls as a,xs as o}from"./growthbook-p4aJ_UMv.js";import{LE as s,zE as c}from"./loadAgentsDir-Bz0FfcVt.js";import{t as l}from"./onChangeAppState-M61XDN6V.js";import{t as u}from"./fpsMetrics-ts_jaF3g.js";import{t as d}from"./stats-Dyi2U_mq.js";e(),c(),n(),i();var f=r();function p({getFpsMetrics:e,stats:n,initialState:r,children:i}){return(0,f.jsx)(u,{getFpsMetrics:e,children:(0,f.jsx)(d,{store:n,children:(0,f.jsx)(s,{initialState:r,onChangeAppState:l,children:(0,f.jsx)(t,{initialState:a().theme,onThemeSave:e=>o(t=>({...t,theme:e})),children:i})})})})}export{p as App};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ApproveApiKey-DTs2ExZH.js";export{e as ApproveApiKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Rn as e,b as t,f as n,t as r}from"./src-DNHWYkls.js";import{t as i}from"./jsx-runtime-BTgGEFjL.js";import{_s as a,xs as o}from"./growthbook-p4aJ_UMv.js";import{RT as s,vw as c}from"./loadAgentsDir-Bz0FfcVt.js";e(),r(),a(),c();var l=i();function u({customApiKeyTruncated:e,onDone:r}){function i(t){switch(t){case`yes`:o(t=>({...t,customApiKeyResponses:{...t.customApiKeyResponses,approved:[...t.customApiKeyResponses?.approved??[],e]}})),r(!0);break;case`no`:o(t=>({...t,customApiKeyResponses:{...t.customApiKeyResponses,rejected:[...t.customApiKeyResponses?.rejected??[],e]}})),r(!1);break}}return(0,l.jsxs)(n,{title:`Detected a custom API key in your environment`,color:`warning`,onCancel:()=>i(`no`),children:[(0,l.jsxs)(t,{children:[(0,l.jsx)(t,{bold:!0,children:`ANTHROPIC_API_KEY`}),(0,l.jsxs)(t,{children:[`: sk-ant-...`,e]})]}),(0,l.jsx)(t,{children:`Do you want to use this API key?`}),(0,l.jsx)(s,{defaultValue:`no`,defaultFocusValue:`no`,options:[{label:`Yes`,value:`yes`},{label:(0,l.jsxs)(t,{children:[`No (`,(0,l.jsx)(t,{bold:!0,children:`recommended`}),`)`]}),value:`no`}],onChange:e=>i(e),onCancel:()=>i(`no`)})]})}export{u as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,d as r,f as i,nt as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{BT as l,UT as u}from"./loadAgentsDir-Bz0FfcVt.js";import{t as d}from"./useKeybinding-DAQL_dB_.js";import{t as f}from"./Dialog-Dgg8bqcG.js";import{t as p}from"./ListItem-B6MyhHvM.js";var m=e(t(),1);o(),f(),p(),l(),d();var h=c();function g({sessions:e,onSelect:t,onCancel:o}){u(`assistant-session-chooser`);let[c,l]=(0,m.useState)(0);return a({"select:next":()=>l(t=>(t+1)%e.length),"select:previous":()=>l(t=>(t-1+e.length)%e.length),"select:accept":()=>t(e[c].id)},{context:`Select`}),(0,h.jsx)(i,{title:`Select Assistant Session`,onCancel:o,hideInputGuide:!0,children:(0,h.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,h.jsx)(n,{children:`Multiple sessions found. Select one to attach:`}),(0,h.jsx)(s,{flexDirection:`column`,children:e.map((e,t)=>(0,h.jsx)(r,{isFocused:c===t,children:(0,h.jsxs)(s,{children:[(0,h.jsx)(n,{children:e.title||e.id.slice(0,20)}),(0,h.jsxs)(n,{dimColor:!0,children:[` [`,e.status,`]`]})]})},e.id))}),(0,h.jsx)(n,{dimColor:!0,children:`↑↓ navigate · Enter select · Esc cancel`})]})})}export{g as AssistantSessionChooser};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{n as i,t as a}from"./figures-fES5sASd.js";import{B as o,F as s,Q as c,Rn as l,T as u,b as d,f,g as p,h as m,nt as h,t as g,x as _}from"./src-DNHWYkls.js";import{t as v}from"./jsx-runtime-BTgGEFjL.js";import{Fc as y,wl as b}from"./growthbook-p4aJ_UMv.js";import{S as x,U as S,_ as C,l as w,p as T,z as ee}from"./debug-CjIaNjpK.js";import{D as E,O as D}from"./teammate-C-FiRloZ.js";import{a as O,c as k}from"./stringUtils-U7kMYMJq.js";import{n as te,r as ne}from"./analytics-i6X1et4O.js";import{f as re,l as ie,u as ae,w as A,x as j,y as M}from"./startupProfiler-4P7GdVw6.js";import{$I as N,AC as oe,BT as se,Dw as P,FE as ce,F_ as le,IE as ue,Ig as de,JE as fe,Kj as pe,Lf as me,Lg as he,Nc as ge,OC as _e,Ow as F,P_ as ve,QI as ye,QS as be,RT as xe,R_ as Se,Rf as Ce,TC as we,UT as Te,XE as Ee,YS as De,ZI as Oe,Zc as ke,_n as Ae,_p as je,aA as Me,aT as Ne,ac as Pe,al as Fe,bN as Ie,bp as Le,eA as Re,eF as ze,fn as Be,gA as I,hA as Ve,hL as He,hn as Ue,is as We,jy as Ge,mA as Ke,mL as qe,mn as Je,nA as Ye,nf as Xe,ng as Ze,ns as Qe,oA as $e,oT as et,pn as tt,qE as nt,qj as rt,rf as it,rg as at,tA as ot,tF as st,vp as ct,wC as lt,yN as ut,yn as dt,yp as ft,zP as pt,zT as mt,z_ as ht}from"./loadAgentsDir-Bz0FfcVt.js";import{_n as gt,sn as _t}from"./prompt-CsBCtw4l.js";import{t as L}from"./useKeybinding-DAQL_dB_.js";import{t as vt}from"./useTerminalSize-DzV4aaTi.js";import{n as yt,t as bt}from"./browser-D1vC3BNd.js";import{t as xt}from"./Dialog-Dgg8bqcG.js";import{i as St,n as Ct}from"./mappers-DLkk0PZz.js";import{r as wt,t as Tt}from"./Message-DNxJ_tMS.js";function Et(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`local_agent`}function Dt(e){return{...e,retain:!1,messages:void 0,diskLoaded:!1,evictAfter:Ue(e.status)?Date.now()+At:void 0}}function Ot(e,t){ne(`tengu_transcript_view_enter`,{}),t(t=>{let n=t.tasks[e],r=t.viewingAgentTaskId,i=r===void 0?void 0:t.tasks[r],a=r!==void 0&&r!==e&&Et(i)&&i.retain,o=Et(n)&&(!n.retain||n.evictAfter!==void 0),s=t.viewingAgentTaskId!==e||t.viewSelectionMode!==`viewing-agent`;if(!o&&!s&&!a)return t;let c=t.tasks;return(a||o)&&(c={...t.tasks},a&&(c[r]=Dt(i)),o&&(c[e]={...n,retain:!0,evictAfter:void 0})),{...t,viewingAgentTaskId:e,viewSelectionMode:`viewing-agent`,tasks:c}})}function kt(e){ne(`tengu_transcript_view_exit`,{}),e(e=>{let t=e.viewingAgentTaskId,n={...e,viewingAgentTaskId:void 0,viewSelectionMode:`none`};if(t===void 0)return e.viewSelectionMode===`none`?e:n;let r=e.tasks[t];return!Et(r)||!r.retain?n:{...n,tasks:{...e.tasks,[t]:Dt(r)}}})}var At,jt=t((()=>{te(),Je(),At=3e4})),Mt,Nt=t((()=>{De(),Je(),Ke(),Mt={name:`DreamTask`,type:`dream`,async kill(e,t){let n;I(e,t,e=>e.status===`running`?(e.abortController?.abort(),n=e.priorMtime,{...e,status:`killed`,endTime:Date.now(),notified:!0,abortController:void 0}):e),n!==void 0&&await be(n)}}}));function R(e){return!(e.status!==`running`&&e.status!==`pending`||`isBackgrounded`in e&&e.isBackgrounded===!1)}var Pt=t((()=>{}));function Ft(e,t,n){let r=Oe(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,It.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var It,Lt=t((()=>{l(),g(),N(),It=v()}));function Rt(e){return e===`completed`||e===`failed`||e===`killed`}function zt(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:o}=t??{};return i?a.cross:r?a.questionMarkPrefix:o?a.warning:e===`running`?n?a.ellipsis:a.play:e===`completed`?a.tick:e===`failed`||e===`killed`?a.cross:a.bullet}function Bt(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function Vt(e){return e.shutdownRequested?`stopping`:e.awaitingPlanApproval?`awaiting approval`:e.isIdle?`idle`:(e.progress?.recentActivities&&at(e.progress.recentActivities))??e.progress?.lastActivity?.activityDescription??`working`}function Ht(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!R(t)||process.env.USER_TYPE===`ant`&&Ye(t))&&(n=!0,t.type!==`in_process_teammate`))return!1;return n}var Ut=t((()=>{i(),ot(),Pt(),Ze()}));function Wt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=u(),a=(0,Gt.useMemo)(()=>me(ye()),[]),o=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let s=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},c=ge(e.prompt,`plan`),l=e.prompt.length>300?e.prompt.substring(0,297)+`…`:e.prompt,g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,z.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:(0,z.jsx)(f,{title:(0,z.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,z.jsxs)(d,{children:[e.status!==`running`&&(0,z.jsxs)(d,{color:Bt(e.status),children:[zt(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,z.jsxs)(d,{dimColor:!0,children:[o,g!==void 0&&g>0&&(0,z.jsxs)(z.Fragment,{children:[` · `,re(g),` tokens`]}),v!==void 0&&v>0&&(0,z.jsxs)(z.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,z.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,z.jsxs)(m,{children:[r&&(0,z.jsx)(p,{shortcut:`←`,action:`go back`}),(0,z.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,z.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,z.jsxs)(_,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,z.jsxs)(_,{flexDirection:`column`,children:[(0,z.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,z.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,Ft(t,a,i)]},n))]}),c?(0,z.jsx)(_,{marginTop:1,children:(0,z.jsx)(de,{addMargin:!1,planContent:c})}):(0,z.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,z.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,z.jsx)(d,{wrap:`wrap`,children:l})]}),e.status===`failed`&&e.error&&(0,z.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,z.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,z.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var Gt,z,Kt=t((()=>{Gt=n(l(),1),P(),g(),L(),N(),Ce(),M(),ke(),he(),Lt(),Ut(),z=v()}));function qt(e,t,n,r){if(!e)return`${t} found · ${n} verified`;if(e===`synthesizing`){let e=[`${n} verified`];return r>0&&e.push(`${r} refuted`),e.push(`deduping`),e.join(` · `)}if(e===`verifying`){let e=[`${t} found`,`${n} verified`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return t>0?`${t} found`:`finding`}function Jt({text:e,phase:t=0}){return(0,B.jsx)(B.Fragment,{children:[...e].map((e,n)=>(0,B.jsx)(d,{color:qe(n+t),children:e},n))})}function Yt(e,t,n){let r=(0,Qt.useRef)(e),i=(0,Qt.useRef)(t);return n||e<r.current?r.current=e:e>r.current&&t!==i.current&&(r.current+=1,i.current=t),r.current}function Xt({session:e}){let t=ue().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=o(r&&!t?$t:null),a=n?.bugsFound??0,s=n?.bugsVerified??0,c=n?.bugsRefuted??0,l=t||!r,u=Yt(a,i,l),f=Yt(s,i,l),p=Yt(c,i,l),m=Math.floor(i/($t*3))%7;if(e.status===`completed`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,B.jsx)(Jt,{text:`ultrareview`,phase:0}),(0,B.jsx)(d,{dimColor:!0,children:` ready · shift+↓ to view`})]});if(e.status===`failed`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,B.jsx)(Jt,{text:`ultrareview`,phase:0}),(0,B.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?qt(n.stage,u,f,p):`setting up`;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,B.jsx)(Jt,{text:`ultrareview`,phase:r?m:0}),(0,B.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function Zt({session:e}){if(e.isRemoteReview)return(0,B.jsx)(Xt,{session:e});if(e.status===`completed`)return(0,B.jsx)(d,{bold:!0,color:`success`,dimColor:!0,children:`done`});if(e.status===`failed`)return(0,B.jsx)(d,{bold:!0,color:`error`,dimColor:!0,children:`error`});if(!e.todoList.length)return(0,B.jsxs)(d,{dimColor:!0,children:[e.status,`…`]});let t=E(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,B.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var Qt,B,$t,en=t((()=>{Qt=n(l(),1),b(),ce(),g(),D(),He(),B=v(),$t=80}));function V({status:e,label:t,suffix:n}){return(0,H.jsxs)(d,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function tn({shell:e}){switch(e.status){case`completed`:return(0,H.jsx)(V,{status:`completed`,label:`done`});case`failed`:return(0,H.jsx)(V,{status:`failed`,label:`error`});case`killed`:return(0,H.jsx)(V,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,H.jsx)(V,{status:`running`})}}var H,nn=t((()=>{g(),H=v()}));function rn({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,U.jsxs)(d,{children:[j(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,U.jsx)(tn,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,U.jsx)(d,{children:(0,U.jsx)(Zt,{session:e})}):(0,U.jsxs)(d,{children:[(0,U.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),j(e.title,n,!0),(0,U.jsx)(d,{dimColor:!0,children:` · `}),(0,U.jsx)(Zt,{session:e})]});case`local_agent`:return(0,U.jsxs)(d,{children:[j(e.description,n,!0),` `,(0,U.jsx)(V,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`in_process_teammate`:{let t=Vt(e);return(0,U.jsxs)(d,{children:[(0,U.jsxs)(d,{color:et(e.identity.color),children:[`@`,e.identity.agentName]}),(0,U.jsxs)(d,{dimColor:!0,children:[`: `,j(t,n,!0)]})]})}case`local_workflow`:{let t=e;return(0,U.jsxs)(d,{children:[j(t.workflowName??e.summary??e.description,n,!0),` `,(0,U.jsx)(V,{status:e.status,label:e.status===`running`?`${t.agentCount} ${Ie(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`monitor_mcp`:return(0,U.jsxs)(d,{children:[j(e.description,n,!0),` `,(0,U.jsx)(V,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${Ie(t,`file`)}`:`${e.sessionsReviewing} ${Ie(e.sessionsReviewing,`session`)}`;return(0,U.jsxs)(d,{children:[e.description,` `,(0,U.jsxs)(d,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,U.jsx)(V,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var U,an=t((()=>{l(),g(),Ne(),pt(),ut(),b(),en(),nn(),Ut(),U=v()}));function on({task:e,onDone:t,onBack:n,onKill:r}){let i=F(e.startTime,e.status===`running`,1e3,0);h({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},o=e.turns.filter(e=>e.text!==``),s=o.slice(-sn),c=o.length-s.length;return(0,W.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,W.jsx)(f,{title:`Memory consolidation`,subtitle:(0,W.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,k(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,W.jsxs)(W.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,k(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,W.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,W.jsxs)(m,{children:[n&&(0,W.jsx)(p,{shortcut:`←`,action:`go back`}),(0,W.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,W.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,W.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,W.jsxs)(d,{children:[(0,W.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,W.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,W.jsx)(d,{color:`success`,children:e.status}):(0,W.jsx)(d,{color:`error`,children:e.status})]}),s.length===0?(0,W.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,W.jsxs)(W.Fragment,{children:[c>0&&(0,W.jsxs)(d,{dimColor:!0,children:[`(`,c,` earlier `,k(c,`turn`),`)`]}),s.map((e,t)=>(0,W.jsxs)(_,{flexDirection:`column`,children:[(0,W.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,W.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,k(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var W,sn,cn=t((()=>{l(),P(),g(),L(),O(),W=v(),sn=6}));function ln({teammate:e,onDone:t,onKill:n,onBack:r,onForeground:i}){let[a]=u(),o=(0,un.useMemo)(()=>me(ye()),[]),s=F(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);h({"confirm:yes":t},{context:`Confirmation`});let c=a=>{a.key===` `?(a.preventDefault(),t()):a.key===`left`&&r?(a.preventDefault(),r()):a.key===`x`&&e.status===`running`&&n?(a.preventDefault(),n()):a.key===`f`&&e.status===`running`&&i&&(a.preventDefault(),i())},l=Vt(e),g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount,y=A(e.prompt,300);return(0,G.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:c,children:(0,G.jsxs)(f,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:et(e.identity.color),children:[`@`,e.identity.agentName]}),l&&(0,G.jsxs)(d,{dimColor:!0,children:[` (`,l,`)`]})]}),subtitle:(0,G.jsxs)(d,{children:[e.status!==`running`&&(0,G.jsxs)(d,{color:e.status===`completed`?`success`:e.status===`killed`?`warning`:`error`,children:[e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,G.jsxs)(d,{dimColor:!0,children:[s,g!==void 0&&g>0&&(0,G.jsxs)(G.Fragment,{children:[` · `,re(g),` tokens`]}),v!==void 0&&v>0&&(0,G.jsxs)(G.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,G.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,G.jsxs)(m,{children:[r&&(0,G.jsx)(p,{shortcut:`←`,action:`go back`}),(0,G.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,G.jsx)(p,{shortcut:`x`,action:`stop`}),e.status===`running`&&i&&(0,G.jsx)(p,{shortcut:`f`,action:`foreground`})]}),children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,children:[(0,G.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,G.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,Ft(t,o,a)]},n))]}),(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,G.jsx)(d,{wrap:`wrap`,children:y})]}),e.status===`failed`&&e.error&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,G.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})}var un,G,dn=t((()=>{un=n(l(),1),P(),g(),L(),N(),Ce(),M(),Ne(),Lt(),Ut(),G=v()}));function fn(e,t){if(e===`ExitPlanMode`)return`Review the plan in Claude Code on the web`;if(!t||typeof t!=`object`)return e;if(e===`AskUserQuestion`&&`questions`in t){let e=t.questions;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`){let t=`question`in e[0]&&typeof e[0].question==`string`&&e[0].question?e[0].question:`header`in e[0]&&typeof e[0].header==`string`?e[0].header:null;if(t)return`Answer in browser: ${A(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${A(n.replace(/\s+/g,` `).trim(),60)}`;return e}function pn({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?vn[o]:`running`:e.status,l=F(e.startTime,i,1e3,0,e.endTime),{agentsWorking:u,toolCalls:p,lastToolCall:m}=(0,K.useMemo)(()=>{let t=0,n=0,r=null;for(let i of e.log){if(i.type!==`assistant`)continue;let e=i.message?.content??[];for(let i of e)i.type===`tool_use`&&(n++,r=i,(i.name===`Agent`||i.name===`Task`)&&t++)}return{agentsWorking:1+t,toolCalls:n,lastToolCall:r?fn(r.name,r.input):null}},[e.log]),h=Se(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,K.useState)(!1);return v?(0,q.jsx)(f,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,q.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{dimColor:!0,children:`This will terminate the Claude Code on the web session.`}),(0,q.jsx)(xe,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,q.jsx)(f,{title:(0,q.jsxs)(d,{children:[(0,q.jsxs)(d,{color:`background`,children:[o===`plan_ready`?`◆`:`◇`,` `]}),(0,q.jsx)(d,{bold:!0,children:`ultraplan`}),(0,q.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,s]})]}),onCancel:g,color:`background`,children:(0,q.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,q.jsxs)(d,{children:[o===`plan_ready`&&(0,q.jsxs)(d,{color:`success`,children:[a.tick,` `]}),u,` `,k(u,`agent`),` `,o?yn[o]:`working`,` · `,p,` tool`,` `,k(p,`call`)]}),m&&(0,q.jsx)(d,{dimColor:!0,children:m}),(0,q.jsx)(c,{url:h,children:(0,q.jsx)(d,{dimColor:!0,children:h})}),(0,q.jsx)(xe,{options:[{label:`Review in Claude Code on the web`,value:`open`},...r&&i?[{label:`Stop ultraplan`,value:`stop`}]:[],{label:`Back`,value:`back`}],onChange:e=>{switch(e){case`open`:yt(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function mn({stage:e,completed:t,hasProgress:n}){let r=e?bn.indexOf(e):-1,i=!t&&!n;return(0,q.jsxs)(d,{children:[i?(0,q.jsx)(d,{color:`background`,children:`Setup`}):(0,q.jsx)(d,{dimColor:!0,children:`Setup`}),(0,q.jsx)(d,{dimColor:!0,children:` → `}),bn.map((e,n)=>{let a=!t&&!i&&n===r;return(0,q.jsxs)(K.Fragment,{children:[n>0&&(0,q.jsx)(d,{dimColor:!0,children:` → `}),a?(0,q.jsx)(d,{color:`background`,children:xn[e]}):(0,q.jsx)(d,{dimColor:!0,children:xn[e]})]},e)}),t&&(0,q.jsx)(d,{color:`success`,children:` ✓`})]})}function hn(e){let t=e.reviewProgress;if(!t)return e.status===`completed`?`done`:`setting up`;let n=t.bugsVerified,r=t.bugsRefuted??0;if(e.status===`completed`){let e=[`${n} ${k(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return qt(t.stage,t.bugsFound,n,r)}function gn({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[o,s]=(0,K.useState)(!1),l=F(e.startTime,a,1e3,0,e.endTime),u=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??u,g=Se(e.sessionId),v=i?`ready`:a?`running`:e.status;if(o)return(0,q.jsx)(f,{title:`Stop ultrareview?`,onCancel:()=>s(!1),color:`background`,children:(0,q.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{dimColor:!0,children:`This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded.`}),(0,q.jsx)(xe,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):s(!1)}})]})});let y=i?[{label:`Open in Claude Code on the web`,value:`open`},{label:`Dismiss`,value:`dismiss`}]:[{label:`Open in Claude Code on the web`,value:`open`},...r&&a?[{label:`Stop ultrareview`,value:`stop`}]:[],{label:`Back`,value:`back`}];return(0,q.jsx)(f,{title:(0,q.jsxs)(d,{children:[(0,q.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,q.jsx)(d,{bold:!0,children:`ultrareview`}),(0,q.jsxs)(d,{dimColor:!0,children:[` · `,l,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,q.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,q.jsxs)(m,{children:[(0,q.jsx)(p,{shortcut:`Enter`,action:`select`}),(0,q.jsx)(p,{shortcut:`Esc`,action:`go back`})]}),children:(0,q.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(mn,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,q.jsxs)(_,{flexDirection:`column`,children:[(0,q.jsx)(d,{children:hn(e)}),(0,q.jsx)(c,{url:g,children:(0,q.jsx)(d,{dimColor:!0,children:g})})]}),(0,q.jsx)(xe,{options:y,onChange:e=>{switch(e){case`open`:yt(g),t();break;case`stop`:s(!0);break;case`back`:h();break;case`dismiss`:u();break}}})]})})}function _n({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,o]=(0,K.useState)(!1),[s,l]=(0,K.useState)(null),u=(0,K.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:Fe(St(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,q.jsx)(pn,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,q.jsx)(gn,{session:e,onDone:n,onBack:r,onKill:i});let h=()=>n(`Remote session details dismissed`,{display:`system`}),g=e=>{e.key===` `?(e.preventDefault(),n(`Remote session details dismissed`,{display:`system`})):e.key===`left`&&r?(e.preventDefault(),r()):e.key===`t`&&!a?(e.preventDefault(),v()):e.key===`return`&&(e.preventDefault(),h())};async function v(){o(!0),l(null);try{await oe(e.sessionId)}catch(e){l(ee(e))}finally{o(!1)}}let y=A(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,q.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,q.jsxs)(f,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,q.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,q.jsxs)(m,{children:[r&&(0,q.jsx)(p,{shortcut:`←`,action:`go back`}),(0,q.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,q.jsx)(p,{shortcut:`t`,action:`teleport`})]}),children:[(0,q.jsxs)(_,{flexDirection:`column`,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,q.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,q.jsx)(d,{color:`success`,children:b}):(0,q.jsx)(d,{color:`error`,children:b})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Runtime`}),`: `,ie((e.endTime??Date.now())-e.startTime)]}),(0,q.jsxs)(d,{wrap:`truncate-end`,children:[(0,q.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,q.jsx)(Zt,{session:e})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,q.jsx)(c,{url:Se(e.sessionId),children:(0,q.jsx)(d,{dimColor:!0,children:Se(e.sessionId)})})]})]}),e.log.length>0&&(0,q.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,q.jsx)(_,{flexDirection:`column`,height:10,overflowY:`hidden`,children:u.map((e,n)=>(0,q.jsx)(Tt,{message:e,lookups:Pe,addMargin:n>0,tools:t.options.tools,commands:t.options.commands,verbose:t.options.verbose,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,style:`condensed`,isTranscriptMode:!1,isStatic:!0},n))}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,u.length,` of `,e.log.length,` messages`]})})]}),s&&(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(d,{color:`error`,children:[`Teleport failed: `,s]})}),a&&(0,q.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var K,q,vn,yn,bn,xn,Sn=t((()=>{i(),K=n(l(),1),b(),P(),g(),ht(),y(),_t(),gt(),bt(),S(),M(),Ct(),ke(),O(),_e(),mt(),wt(),en(),q=v(),vn={needs_input:`input required`,plan_ready:`ready`},yn={needs_input:`waiting`,plan_ready:`done`},bn=[`finding`,`verifying`,`synthesizing`],xn={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function Cn(e){let t=Ae(e.id);try{let e=await x(t,En);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function wn({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=s(),[a,o]=(0,J.useState)(()=>Cn(e)),c=(0,J.useDeferredValue)(a);(0,J.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(Cn(t)),1e3,o,e);return()=>clearInterval(t)},[e.id,e.status]);let l=()=>t(`Shell details dismissed`,{display:`system`});h({"confirm:yes":l},{context:`Confirmation`});let u=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},g=e.kind===`monitor`,v=A(e.command,280);return(0,Y.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:u,children:(0,Y.jsxs)(f,{title:g?`Monitor details`:`Shell details`,onCancel:l,color:`background`,inputGuide:t=>t.pending?(0,Y.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,Y.jsxs)(m,{children:[r&&(0,Y.jsx)(p,{shortcut:`←`,action:`go back`}),(0,Y.jsx)(p,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,Y.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:[(0,Y.jsxs)(_,{flexDirection:`column`,children:[(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,Y.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,Y.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,Y.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,Y.jsxs)(d,{children:[(0,Y.jsx)(d,{bold:!0,children:`Runtime:`}),` `,ie((e.endTime??Date.now())-e.startTime)]}),(0,Y.jsxs)(d,{wrap:`wrap`,children:[(0,Y.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,Y.jsxs)(_,{flexDirection:`column`,children:[(0,Y.jsx)(d,{bold:!0,children:`Output:`}),(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,Y.jsx)(Tn,{outputPromise:c,columns:i})})]})]})})}function Tn({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,J.use)(e);if(!n)return(0,Y.jsx)(d,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
|
|
2
|
+
`,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(_,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,Y.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,Y.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${ae(r)}`:``]})]})}var J,Y,En,Dn=t((()=>{J=n(l(),1),vt(),g(),L(),M(),C(),dt(),Y=v(),En=8192})),On=r({LocalWorkflowTask:()=>Ln,completeWorkflowTask:()=>jn,failWorkflowTask:()=>Mn,isLocalWorkflowTask:()=>kn,killWorkflowTask:()=>Nn,killWorkflowTasksForAgent:()=>In,registerLocalWorkflowTask:()=>An,retryWorkflowAgent:()=>Fn,skipWorkflowAgent:()=>Pn});function kn(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`local_workflow`}function An(e,t){let n=tt(`local_workflow`);return Ve({...Be(n,`local_workflow`,t.description,t.toolUseId),type:`local_workflow`,status:`running`,workflowName:t.workflowName,workflowFile:t.workflowFile,summary:t.summary,agentId:t.agentId,abortController:t.abortController},e),n}function jn(e,t){I(e,t,e=>({...e,status:`completed`,endTime:Date.now(),notified:!0,abortController:void 0}))}function Mn(e,t,n){I(e,t,e=>({...e,status:`failed`,endTime:Date.now(),notified:!0,abortController:void 0,...n===void 0?{}:{error:n}}))}function Nn(e,t){I(e,t,e=>e.status===`running`?(e.abortController?.abort(),{...e,status:`killed`,endTime:Date.now(),notified:!0,abortController:void 0}):e)}function Pn(e,t,n){T(`skipWorkflowAgent: skipping agent ${t} in workflow task ${e}`),I(e,n,e=>e.status===`running`?{...e,pendingAgentAction:{kind:`skip`,agentId:t,requestedAt:Date.now()}}:e)}function Fn(e,t,n){T(`retryWorkflowAgent: retrying agent ${t} in workflow task ${e}`),I(e,n,e=>e.status===`running`?{...e,pendingAgentAction:{kind:`retry`,agentId:t,requestedAt:Date.now()}}:e)}function In(e,t,n){let r=t().tasks??{};for(let[t,i]of Object.entries(r))kn(i)&&i.agentId===e&&i.status===`running`&&(T(`killWorkflowTasksForAgent: killing orphaned workflow task ${t} (agent ${e} exiting)`),Nn(t,n))}var Ln,Rn=t((()=>{Je(),w(),Ke(),Ln={name:`LocalWorkflowTask`,type:`local_workflow`,async kill(e,t){Nn(e,t)}}})),zn=t((()=>{g()})),Bn=t((()=>{g()})),Vn=r({MonitorMcpDetailDialog:()=>Hn});function Hn({task:e,onBack:t,onKill:n}){let r=F(e.startTime,e.status===`running`,1e3,0);return h({},{context:`MonitorMcpDetail`}),(0,X.jsx)(_,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:r=>{r.key===`left`&&t?(r.preventDefault(),t()):r.key===`x`&&e.status===`running`&&n&&(r.preventDefault(),n())},children:(0,X.jsx)(f,{title:`MCP Monitor`,subtitle:(0,X.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,X.jsxs)(m,{children:[t&&(0,X.jsx)(p,{shortcut:`←`,action:`go back`}),(0,X.jsx)(p,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,X.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:(0,X.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,X.jsxs)(d,{children:[(0,X.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,X.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,X.jsx)(d,{color:`ansi:green`,children:e.status}):(0,X.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,X.jsxs)(d,{children:[(0,X.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,X.jsxs)(d,{children:[(0,X.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,X.jsxs)(d,{children:[(0,X.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,X.jsxs)(d,{children:[(0,X.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var X,Un=t((()=>{l(),P(),g(),L(),zn(),xt(),Bn(),X=v()}));function Wn(e,t){return Object.values(e??{}).filter(R).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Gn({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=fe(e=>e.tasks),i=fe(e=>e.foregroundedTaskId),a=fe(e=>e.expandedView)===`teammates`,o=Ee(),s=st(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),c=r,l=(0,Q.useRef)(!1),[u,g]=(0,Q.useState)(()=>{if(n)return l.current=!0,{mode:`detail`,itemId:n};let e=Wn(c,i);return e.length===1?(l.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[v,y]=(0,Q.useState)(0);Te(`background-tasks-dialog`);let{bashTasks:b,remoteSessions:x,agentTasks:S,teammateTasks:C,workflowTasks:w,mcpMonitors:T,dreamTasks:ee,allSelectableItems:D}=(0,Q.useMemo)(()=>{let e=Object.values(c??{}).filter(R).map(Kn).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`remote_agent`),r=e.filter(e=>e.type===`local_agent`&&e.id!==i),o=e.filter(e=>e.type===`local_workflow`),s=e.filter(e=>e.type===`monitor_mcp`),l=e.filter(e=>e.type===`dream`),u=a?[]:e.filter(e=>e.type===`in_process_teammate`),d=u.length>0?[{id:`__leader__`,type:`leader`,label:`@${ft}`,status:`running`}]:[];return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:o,mcpMonitors:s,dreamTasks:l,teammateTasks:[...d,...u],allSelectableItems:[...d,...u,...t,...s,...n,...r,...o,...l]}},[c,i,a]),O=D[v]??null;h({"confirm:previous":()=>y(e=>Math.max(0,e-1)),"confirm:next":()=>y(e=>Math.min(D.length-1,e+1)),"confirm:yes":()=>{let t=D[v];t&&(t.type===`leader`?(kt(o),e(`Viewing leader`,{display:`system`})):g({mode:`detail`,itemId:t.id}))}},{context:`Confirmation`,isActive:u.mode===`list`});let k=t=>{if(u.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=D[v];n&&(t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?te(n.id):n.type===`local_agent`&&n.status===`running`?ne(n.id):n.type===`in_process_teammate`&&n.status===`running`?re(n.id):n.type===`local_workflow`&&n.status===`running`&&Jn?Jn(n.id,o):n.type===`monitor_mcp`&&n.status===`running`&&Yn?Yn(n.id,o):n.type===`dream`&&n.status===`running`?ie(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?We(n.id,n.task.sessionId,o):ae(n.id))),t.key===`f`&&(n.type===`in_process_teammate`&&n.status===`running`?(t.preventDefault(),Ot(n.id,o),e(`Viewing teammate`,{display:`system`})):n.type===`leader`&&(t.preventDefault(),kt(o),e(`Viewing leader`,{display:`system`}))))};async function te(e){await Xe.kill(e,o)}async function ne(e){await Re.kill(e,o)}async function re(e){await je.kill(e,o)}async function ie(e){await Mt.kill(e,o)}async function ae(e){await lt.kill(e,o)}let A=(0,Q.useEffectEvent)(e);(0,Q.useEffect)(()=>{if(u.mode!==`list`){let e=(c??{})[u.itemId];(!e||e.type!==`local_workflow`&&!R(e))&&(l.current?A(`Background tasks dialog dismissed`,{display:`system`}):g({mode:`list`}))}let e=D.length;v>=e&&e>0&&y(e-1)},[u,c,v,D,A]);let j=()=>{l.current&&D.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(l.current=!1,g({mode:`list`}))};if(u.mode!==`list`&&c){let n=c[u.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,$.jsx)(wn,{shell:n,onDone:e,onKillShell:()=>void te(n.id),onBack:j},`shell-${n.id}`);case`local_agent`:return(0,$.jsx)(Wt,{agent:n,onDone:e,onKillAgent:()=>void ne(n.id),onBack:j},`agent-${n.id}`);case`remote_agent`:return(0,$.jsx)(_n,{session:n,onDone:e,toolUseContext:t,onBack:j,onKill:n.status===`running`?n.isUltraplan?()=>void We(n.id,n.sessionId,o):()=>void ae(n.id):void 0},`session-${n.id}`);case`in_process_teammate`:return(0,$.jsx)(ln,{teammate:n,onDone:e,onKill:n.status===`running`?()=>void re(n.id):void 0,onBack:j,onForeground:n.status===`running`?()=>{Ot(n.id,o),e(`Viewing teammate`,{display:`system`})}:void 0},`teammate-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&Jn?()=>Jn(n.id,o):void 0;return(0,$.jsx)(_,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),j()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,$.jsx)(f,{title:n.workflowName,subtitle:(0,$.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:j,inputGuide:()=>(0,$.jsxs)(m,{children:[(0,$.jsx)(p,{shortcut:`←`,action:`go back`}),(0,$.jsx)(p,{shortcut:`Esc`,action:`close`}),e&&(0,$.jsx)(p,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,$.jsxs)(_,{flexDirection:`column`,children:[(0,$.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,$.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,$.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Xn?(0,$.jsx)(Xn,{task:n,onKill:n.status===`running`&&Yn?()=>Yn(n.id,o):void 0,onBack:j},`monitor-mcp-${n.id}`):null;case`dream`:return(0,$.jsx)(on,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:j,onKill:n.status===`running`?()=>void ie(n.id):void 0},`dream-${n.id}`)}}let M=E(b,e=>e.status===`running`),N=E(x,e=>e.status===`running`||e.status===`pending`)+E(S,e=>e.status===`running`),oe=E(C,e=>e.status===`running`),se=rt([...oe>0?[(0,$.jsxs)(d,{children:[oe,` `,oe===1?`agent`:`agents`]},`teammates`)]:[],...M>0?[(0,$.jsxs)(d,{children:[M,` `,M===1?`active shell`:`active shells`]},`shells`)]:[],...N>0?[(0,$.jsxs)(d,{children:[N,` `,N===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,$.jsx)(d,{children:` · `},`separator-${e}`)),P=[(0,$.jsx)(p,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,$.jsx)(p,{shortcut:`Enter`,action:`view`},`enter`),...O?.type===`in_process_teammate`&&O.status===`running`?[(0,$.jsx)(p,{shortcut:`f`,action:`foreground`},`foreground`)]:[],...(O?.type===`local_bash`||O?.type===`local_agent`||O?.type===`in_process_teammate`||O?.type===`local_workflow`||O?.type===`monitor_mcp`||O?.type===`dream`||O?.type===`remote_agent`)&&O.status===`running`?[(0,$.jsx)(p,{shortcut:`x`,action:`stop`},`kill`)]:[],...S.some(e=>e.status===`running`)?[(0,$.jsx)(p,{shortcut:s,action:`stop all agents`},`kill-all`)]:[],(0,$.jsx)(p,{shortcut:`←/Esc`,action:`close`},`esc`)],ce=()=>e(`Background tasks dialog dismissed`,{display:`system`});function le(e){return e.pending?(0,$.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,$.jsx)(m,{children:P})}return(0,$.jsx)(_,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:k,children:(0,$.jsx)(f,{title:`Background tasks`,subtitle:(0,$.jsx)($.Fragment,{children:se}),onCancel:ce,color:`background`,inputGuide:le,children:D.length===0?(0,$.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,$.jsxs)(_,{flexDirection:`column`,children:[C.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,children:[(b.length>0||x.length>0||S.length>0)&&(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Agents`]}),` (`,E(C,e=>e.type!==`leader`),`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:(0,$.jsx)(qn,{teammateTasks:C,currentSelectionId:O?.id})})]}),b.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0),children:[(C.length>0||x.length>0||S.length>0)&&(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,b.length,`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:b.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})]}),T.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0),children:[(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,T.length,`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:T.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})]}),x.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0),children:[(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,x.length,`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:x.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})]}),S.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0),children:[(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,S.length,`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:S.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})]}),w.length>0&&(0,$.jsxs)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0),children:[(0,$.jsxs)(d,{dimColor:!0,children:[(0,$.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,w.length,`)`]}),(0,$.jsx)(_,{flexDirection:`column`,children:w.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})]}),ee.length>0&&(0,$.jsx)(_,{flexDirection:`column`,marginTop:+(C.length>0||b.length>0||T.length>0||x.length>0||S.length>0||w.length>0),children:(0,$.jsx)(_,{flexDirection:`column`,children:ee.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===O?.id},e.id))})})]})})})}function Kn(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.kind===`monitor`?e.description:e.command,status:e.status,task:e};case`remote_agent`:return{id:e.id,type:`remote_agent`,label:e.title,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`in_process_teammate`:return{id:e.id,type:`in_process_teammate`,label:`@${e.identity.agentName}`,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`monitor_mcp`:return{id:e.id,type:`monitor_mcp`,label:e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function Z({item:e,isSelected:t}){let{columns:n}=s(),r=Math.max(30,n-26),i=$e();return(0,$.jsxs)(_,{flexDirection:`row`,children:[(0,$.jsx)(d,{dimColor:i&&t,children:t?a.pointer+` `:` `}),(0,$.jsx)(d,{color:t&&!i?`suggestion`:void 0,children:e.type===`leader`?(0,$.jsxs)(d,{children:[`@`,ft]}):(0,$.jsx)(rn,{task:e.task,maxActivityWidth:r})})]})}function qn({teammateTasks:e,currentSelectionId:t}){let n=e.filter(e=>e.type===`leader`),r=e.filter(e=>e.type===`in_process_teammate`),i=new Map;for(let e of r){let t=e.task.identity.teamName,n=i.get(t);n?n.push(e):i.set(t,[e])}return(0,$.jsx)($.Fragment,{children:[...i.entries()].map(([e,r])=>(0,$.jsxs)(_,{flexDirection:`column`,children:[(0,$.jsxs)(d,{dimColor:!0,children:[` `,`Team: `,e,` (`,r.length+n.length,`)`]}),n.map(n=>(0,$.jsx)(Z,{item:n,isSelected:n.id===t},`${n.id}-${e}`)),r.map(e=>(0,$.jsx)(Z,{item:e,isSelected:e.id===t},e.id))]},e))})}var Q,$,Jn,Yn,Xn,Zn=t((()=>{i(),Q=n(l(),1),Me(),Ge(),nt(),jt(),Nt(),ct(),ot(),it(),we(),Pt(),pe(),Le(),Qe(),se(),g(),L(),ze(),D(),Kt(),an(),cn(),dn(),Sn(),Dn(),$=v(),Jn=(Rn(),e(On))?.killWorkflowTask??null,Yn=(le(),e(ve))?.killMonitorMcp??null,Xn=(Un(),e(Vn)).MonitorMcpDetailDialog}));export{Ht as a,Ot as c,Rt as i,kt as l,Zn as n,Pt as o,Ut as r,R as s,Gn as t,jt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{J as t,Q as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{Gs as l,Js as u}from"./growthbook-p4aJ_UMv.js";import{d,f}from"./stringUtils-U7kMYMJq.js";import{RT as p,_k as m,gk as h,vw as g}from"./loadAgentsDir-Bz0FfcVt.js";var _=e(r(),1);d(),o(),m(),l(),g();var v=c();function y({onAccept:e}){let[r,o]=_.useState(null);_.useEffect(()=>{if(r!==null){let e=r,t=setTimeout(()=>h(e));return()=>clearTimeout(t)}},[r]),_.useEffect(()=>{f(`tengu_bypass_permissions_mode_dialog_shown`,{})},[]);function c(t){switch(t){case`accept`:f(`tengu_bypass_permissions_mode_dialog_accept`,{}),u(`userSettings`,{skipDangerousModePermissionPrompt:!0}),e();break;case`decline`:o(1);break}}let l=(0,_.useCallback)(()=>{o(0)},[]);return r===null?(0,v.jsxs)(a,{title:`WARNING: Claude Code running in Bypass Permissions mode`,color:`error`,onCancel:l,children:[(0,v.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,v.jsxs)(i,{children:[`In Bypass Permissions mode, Claude Code will not ask for your approval before running potentially dangerous commands.`,(0,v.jsx)(t,{}),`This mode should only be used in a sandboxed container/VM that has restricted internet access and can easily be restored if damaged.`]}),(0,v.jsx)(i,{children:`By proceeding, you accept all responsibility for actions taken while running in Bypass Permissions mode.`}),(0,v.jsx)(n,{url:`https://code.claude.com/docs/en/security`})]}),(0,v.jsx)(p,{options:[{label:`No, exit`,value:`decline`},{label:`Yes, I accept`,value:`accept`}],onChange:e=>c(e)})]}):null}export{y as BypassPermissionsModeDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{J as t,Q as n,Rn as r,b as i,f as a,t as o,x as s,xt as c}from"./src-DNHWYkls.js";import{t as l}from"./jsx-runtime-BTgGEFjL.js";import{_s as u,xs as d}from"./growthbook-p4aJ_UMv.js";import{d as f,f as p}from"./stringUtils-U7kMYMJq.js";import{n as m,t as h}from"./setup-BHNS9sBS.js";var g=e(r(),1);f(),o(),h(),u();var _=l(),v=`https://claude.ai/chrome`,y=`https://clau.de/chrome/permissions`;function b({onDone:e}){let[r,o]=g.useState(!1);return g.useEffect(()=>{p(`tengu_claude_in_chrome_onboarding_shown`,{}),m().then(o),d(e=>({...e,hasCompletedClaudeInChromeOnboarding:!0}))},[]),c((t,n)=>{n.return&&e()}),(0,_.jsx)(a,{title:`Claude in Chrome (Beta)`,onCancel:e,color:`chromeYellow`,children:(0,_.jsxs)(s,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(i,{children:[`Claude in Chrome works with the Chrome extension to let you control your browser directly from Claude Code. You can navigate websites, fill forms, capture screenshots, record GIFs, and debug with console logs and network requests.`,!r&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(t,{}),(0,_.jsx)(t,{}),`Requires the Chrome extension. Get started at `,(0,_.jsx)(n,{url:v})]})]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Site-level permissions are inherited from the Chrome extension. Manage permissions in the Chrome extension settings to control which sites Claude can browse, click, and type on`,r&&(0,_.jsxs)(_.Fragment,{children:[` `,`(`,(0,_.jsx)(n,{url:y}),`)`]}),`.`]}),(0,_.jsxs)(i,{dimColor:!0,children:[`For more info, use`,` `,(0,_.jsx)(i,{bold:!0,color:`chromeYellow`,children:`/chrome`}),` `,`or visit `,(0,_.jsx)(n,{url:`https://code.claude.com/docs/en/chrome`})]})]})})}export{b as ClaudeInChromeOnboarding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./ClaudeMdExternalIncludesDialog-ts0XnWwl.js";e();export{t as ClaudeMdExternalIncludesDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Q as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{_s as l,bs as u}from"./growthbook-p4aJ_UMv.js";import{d,f}from"./stringUtils-U7kMYMJq.js";import{RT as p,vw as m}from"./loadAgentsDir-Bz0FfcVt.js";function h({onDone:e,isStandaloneDialog:t,externalIncludes:r}){g.useEffect(()=>{f(`tengu_claude_md_includes_dialog_shown`,{})},[]);let o=(0,g.useCallback)(t=>{t===`no`?(f(`tengu_claude_md_external_includes_dialog_declined`,{}),u(e=>({...e,hasClaudeMdExternalIncludesApproved:!1,hasClaudeMdExternalIncludesWarningShown:!0}))):(f(`tengu_claude_md_external_includes_dialog_accepted`,{}),u(e=>({...e,hasClaudeMdExternalIncludesApproved:!0,hasClaudeMdExternalIncludesWarningShown:!0}))),e()},[e]);return(0,_.jsxs)(a,{title:`Allow external CLAUDE.md file imports?`,color:`warning`,onCancel:(0,g.useCallback)(()=>{o(`no`)},[o]),hideBorder:!t,hideInputGuide:!t,children:[(0,_.jsx)(i,{children:`This project's CLAUDE.md imports files outside the current working directory. Never allow this for third-party repositories.`}),r&&r.length>0&&(0,_.jsxs)(s,{flexDirection:`column`,children:[(0,_.jsx)(i,{dimColor:!0,children:`External imports:`}),r.map((e,t)=>(0,_.jsxs)(i,{dimColor:!0,children:[` `,e.path]},t))]}),(0,_.jsxs)(i,{dimColor:!0,children:[`Important: Only use Claude Code with files you trust. Accessing untrusted files may pose security risks`,` `,(0,_.jsx)(n,{url:`https://code.claude.com/docs/en/security`}),` `]}),(0,_.jsx)(p,{options:[{label:`Yes, allow external imports`,value:`yes`},{label:`No, disable external imports`,value:`no`}],onChange:e=>o(e)})]})}var g,_,v=e((()=>{g=t(r(),1),d(),o(),l(),m(),_=c()}));export{v as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Sw as e,xw as t}from"./loadAgentsDir-Bz0FfcVt.js";e();export{t as ConsoleOAuthFlow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{bw as t,zT as n}from"./loadAgentsDir-Bz0FfcVt.js";var r=e((()=>{t(),n()}));export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{t as n}from"./semver-BsItM2Z4.js";import{Rn as r,b as i,l as a,t as o,x as s,xt as c}from"./src-DNHWYkls.js";import{t as l}from"./jsx-runtime-BTgGEFjL.js";import{Ht as u,at as d}from"./state-CUZTq6r0.js";import{Ql as f,nu as p}from"./growthbook-p4aJ_UMv.js";import{U as m,l as h,p as g,z as _}from"./debug-CjIaNjpK.js";import{n as v,t as y}from"./cwd-B2guYBbl.js";import{r as b,t as x}from"./execFileNoThrow-DdmR1mBS.js";import{Qn as S,_k as C,br as w,hk as T}from"./loadAgentsDir-Bz0FfcVt.js";import{n as E,t as D}from"./browser-D1vC3BNd.js";import{n as O,r as k}from"./semver-D3lOjiBN.js";import{join as A}from"path";import{readdir as j}from"fs/promises";function M(){let e=[process.argv[1]||``,process.execPath||``],t=[`/build-ant/`,`/build-ant-native/`,`/build-external/`,`/build-external-native/`];return e.some(e=>t.some(t=>e.includes(t)))}function N(e){let t=M()?`claude-dev`:`claude`,n=new URL(`${t}://resume`);return n.searchParams.set(`session`,e),n.searchParams.set(`cwd`,y()),n.toString()}async function P(){if(M())return!0;let e=process.platform;if(e===`darwin`)return p(`/Applications/Claude.app`);if(e===`linux`){let{code:e,stdout:t}=await x(`xdg-mime`,[`query`,`default`,`x-scheme-handler/claude`]);return e===0&&t.trim().length>0}else if(e===`win32`){let{code:e}=await x(`reg`,[`query`,`HKEY_CLASSES_ROOT\\claude`,`/ve`]);return e===0}return!1}async function F(){let e=process.platform;if(e===`darwin`){let{code:e,stdout:t}=await x(`defaults`,[`read`,`/Applications/Claude.app/Contents/Info.plist`,`CFBundleShortVersionString`]);if(e!==0)return null;let n=t.trim();return n.length>0?n:null}else if(e===`win32`){let e=process.env.LOCALAPPDATA;if(!e)return null;let t=A(e,`AnthropicClaude`);try{let e=(await j(t)).filter(e=>e.startsWith(`app-`)).map(e=>e.slice(4)).filter(e=>(0,z.coerce)(e)!==null).sort((e,t)=>{let n=(0,z.coerce)(e),r=(0,z.coerce)(t);return n.compare(r)});return e.length>0?e[e.length-1]:null}catch{return null}}return null}async function I(){if(!await P())return{status:`not-installed`};let e;try{e=await F()}catch{return{status:`ready`,version:`unknown`}}if(!e)return{status:`ready`,version:`unknown`};let t=(0,z.coerce)(e);return!t||!O(t.version,B)?{status:`version-too-old`,version:e}:{status:`ready`,version:e}}async function L(e){let t=process.platform;if(g(`Opening deep link: ${e}`),t===`darwin`){if(M()){let{code:t}=await x(`osascript`,[`-e`,`tell application "Electron" to open location "${e}"`]);return t===0}let{code:t}=await x(`open`,[e]);return t===0}else if(t===`linux`){let{code:t}=await x(`xdg-open`,[e]);return t===0}else if(t===`win32`){let{code:t}=await x(`cmd`,[`/c`,`start`,``,e]);return t===0}return!1}async function R(){let e=d();if(!await P())return{success:!1,error:`Claude Desktop is not installed. Install it from https://claude.ai/download`};let t=N(e);return await L(t)?{success:!0,deepLinkUrl:t}:{success:!1,error:`Failed to open Claude Desktop. Please try opening it manually.`,deepLinkUrl:t}}var z,B,V=e((()=>{z=n(),u(),v(),h(),b(),f(),k(),B=`1.1.2396`}));function H(){switch(process.platform){case`win32`:return`https://claude.ai/api/desktop/win32/x64/exe/latest/redirect`;default:return`https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect`}}function U({onDone:e}){let[t,n]=(0,W.useState)(`checking`),[r,o]=(0,W.useState)(null),[l,u]=(0,W.useState)(``);return c(n=>{if(t===`error`){e(r??`Unknown error`,{display:`system`});return}t===`prompt-download`&&(n===`y`||n===`Y`?(E(H()).catch(()=>{}),e(`Starting download. Re-run /desktop once you\u2019ve installed the app.\nLearn more at ${K}`,{display:`system`})):(n===`n`||n===`N`)&&e(`The desktop app is required for /desktop. Learn more at ${K}`,{display:`system`}))}),(0,W.useEffect)(()=>{async function t(){n(`checking`);let t=await I();if(t.status===`not-installed`){u(`Claude Desktop is not installed.`),n(`prompt-download`);return}if(t.status===`version-too-old`){u(`Claude Desktop needs to be updated (found v${t.version}, need v1.1.2396+).`),n(`prompt-download`);return}n(`flushing`),await S(),n(`opening`);let r=await R();if(!r.success){o(r.error??`Failed to open Claude Desktop`),n(`error`);return}n(`success`),setTimeout(async e=>{e(`Session transferred to Claude Desktop`,{display:`system`}),await T(0,`other`)},500,e)}t().catch(e=>{o(_(e)),n(`error`)})},[e]),t===`error`?(0,G.jsxs)(s,{flexDirection:`column`,paddingX:2,children:[(0,G.jsxs)(i,{color:`error`,children:[`Error: `,r]}),(0,G.jsx)(i,{dimColor:!0,children:`Press any key to continue…`})]}):t===`prompt-download`?(0,G.jsxs)(s,{flexDirection:`column`,paddingX:2,children:[(0,G.jsx)(i,{children:l}),(0,G.jsx)(i,{children:`Download now? (y/n)`})]}):(0,G.jsx)(a,{message:{checking:`Checking for Claude Desktop…`,flushing:`Saving session…`,opening:`Opening Claude Desktop…`,success:`Opening in Claude Desktop…`}[t]})}var W,G,K,q=e((()=>{W=t(r(),1),o(),V(),D(),m(),C(),w(),G=l(),K=`https://clau.de/desktop`}));export{q as n,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,f as r,t as i,x as a}from"./src-DNHWYkls.js";import{t as o}from"./jsx-runtime-BTgGEFjL.js";import{RT as s,_k as c,gk as l,vw as u}from"./loadAgentsDir-Bz0FfcVt.js";var d=e(t(),1);i(),c(),u();var f=o();function p({channels:e,onAccept:t}){let[i,o]=d.useState(null);d.useEffect(()=>{if(i!==null){let e=i,t=setTimeout(()=>l(e));return()=>clearTimeout(t)}},[i]);function c(e){switch(e){case`accept`:t();break;case`exit`:o(1);break}}let u=(0,d.useCallback)(()=>{o(0)},[]);return i===null?(0,f.jsxs)(r,{title:`WARNING: Loading development channels`,color:`error`,onCancel:u,children:[(0,f.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,f.jsx)(n,{children:`--dangerously-load-development-channels is for local channel development only. Do not use this option to run channels you have downloaded off the internet.`}),(0,f.jsx)(n,{children:`Please use --channels to run a list of approved channels.`}),(0,f.jsxs)(n,{dimColor:!0,children:[`Channels:`,` `,e.map(e=>e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`).join(`, `)]})]}),(0,f.jsx)(s,{options:[{label:`I am using this for local development`,value:`accept`},{label:`Exit`,value:`exit`}],onChange:e=>c(e)})]}):null}export{p as DevChannelsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./src-DNHWYkls.js";var n=e((()=>{t()}));export{n as t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-fES5sASd.js";import{F as i,Rn as a,b as o,f as s,h as c,m as l,nt as u,t as d,x as f}from"./src-DNHWYkls.js";import{t as p}from"./jsx-runtime-BTgGEFjL.js";import{Ql as m,iu as h}from"./growthbook-p4aJ_UMv.js";import{n as g,t as _}from"./cwd-B2guYBbl.js";import{_ as v,f as y,s as b,v as x}from"./git-Bj8Ow4pJ.js";import{r as S,t as C}from"./execFileNoThrow-DdmR1mBS.js";import{a as w,c as T}from"./stringUtils-U7kMYMJq.js";import{C as E,y as D}from"./startupProfiler-4P7GdVw6.js";import{BT as O,Ty as k,UT as ee,eF as A,tF as te,wy as ne}from"./loadAgentsDir-Bz0FfcVt.js";import{t as re}from"./useKeybinding-DAQL_dB_.js";import{t as j}from"./useTerminalSize-DzV4aaTi.js";import{a as M}from"./detectRepository-Gobn9eFt.js";import{join as ie,resolve as ae}from"path";import{access as oe}from"fs/promises";async function se(){if(!await y()||await F())return null;let{stdout:e,code:t}=await C(v(),[`--no-optional-locks`,`diff`,`HEAD`,`--shortstat`],{timeout:I,preserveOutputOnError:!1});if(t===0){let t=ue(e);if(t&&t.filesCount>B)return{stats:t,perFileStats:new Map,hunks:new Map}}let{stdout:n,code:r}=await C(v(),[`--no-optional-locks`,`diff`,`HEAD`,`--numstat`],{timeout:I,preserveOutputOnError:!1});if(r!==0)return null;let{stats:i,perFileStats:a}=P(n),o=L-a.size;if(o>0){let e=await le(o);if(e){i.filesCount+=e.size;for(let[t,n]of e)a.set(t,n)}}return{stats:i,perFileStats:a,hunks:new Map}}async function N(){if(!await y()||await F())return new Map;let{stdout:e,code:t}=await C(v(),[`--no-optional-locks`,`diff`,`HEAD`],{timeout:I,preserveOutputOnError:!1});return t===0?ce(e):new Map}function P(e){let t=e.trim().split(`
|
|
2
|
+
`).filter(Boolean),n=0,r=0,i=0,a=new Map;for(let e of t){let t=e.split(` `);if(t.length<3)continue;i++;let o=t[0],s=t[1],c=t.slice(2).join(` `),l=o===`-`||s===`-`,u=l?0:parseInt(o??`0`,10)||0,d=l?0:parseInt(s??`0`,10)||0;n+=u,r+=d,a.size<L&&a.set(c,{added:u,removed:d,isBinary:l})}return{stats:{filesCount:i,linesAdded:n,linesRemoved:r},perFileStats:a}}function ce(e){let t=new Map;if(!e.trim())return t;let n=e.split(/^diff --git /m).filter(Boolean);for(let e of n){if(t.size>=L)break;if(e.length>R)continue;let n=e.split(`
|
|
3
|
+
`),r=n[0]?.match(/^a\/(.+?) b\/(.+)$/);if(!r)continue;let i=r[2]??r[1]??``,a=[],o=null,s=0;for(let e=1;e<n.length;e++){let t=n[e]??``,r=t.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);if(r){o&&a.push(o),o={oldStart:parseInt(r[1]??`0`,10),oldLines:parseInt(r[2]??`1`,10),newStart:parseInt(r[3]??`0`,10),newLines:parseInt(r[4]??`1`,10),lines:[]};continue}if(!(t.startsWith(`index `)||t.startsWith(`---`)||t.startsWith(`+++`)||t.startsWith(`new file`)||t.startsWith(`deleted file`)||t.startsWith(`old mode`)||t.startsWith(`new mode`)||t.startsWith(`Binary files`))&&o&&(t.startsWith(`+`)||t.startsWith(`-`)||t.startsWith(` `)||t===``)){if(s>=z)continue;o.lines.push(``+t),s++}}o&&a.push(o),a.length>0&&t.set(i,a)}return t}async function F(){let e=await b(_());return e?(await Promise.all([`MERGE_HEAD`,`REBASE_HEAD`,`CHERRY_PICK_HEAD`,`REVERT_HEAD`].map(t=>oe(ie(e,t)).then(()=>!0).catch(()=>!1)))).some(Boolean):!1}async function le(e){let{stdout:t,code:n}=await C(v(),[`--no-optional-locks`,`ls-files`,`--others`,`--exclude-standard`],{timeout:I,preserveOutputOnError:!1});if(n!==0||!t.trim())return null;let r=t.trim().split(`
|
|
4
|
+
`).filter(Boolean);if(r.length===0)return null;let i=new Map;for(let t of r.slice(0,e))i.set(t,{added:0,removed:0,isBinary:!1,isUntracked:!0});return i}function ue(e){let t=e.match(/(\d+)\s+files?\s+changed(?:,\s+(\d+)\s+insertions?\(\+\))?(?:,\s+(\d+)\s+deletions?\(-\))?/);return t?{filesCount:parseInt(t[1]??`0`,10),linesAdded:parseInt(t[2]??`0`,10),linesRemoved:parseInt(t[3]??`0`,10)}:null}var I,L,R,z,B,V=e((()=>{g(),M(),S(),m(),x(),I=5e3,L=50,R=1e6,z=400,B=500}));function H(){let[e,t]=(0,U.useState)(null),[n,r]=(0,U.useState)(new Map),[i,a]=(0,U.useState)(!0);return(0,U.useEffect)(()=>{let e=!1;async function n(){try{let[n,i]=await Promise.all([se(),N()]);e||(t(n),r(i),a(!1))}catch{e||(t(null),r(new Map),a(!1))}}return n(),()=>{e=!0}},[]),(0,U.useMemo)(()=>{if(!e)return{stats:null,files:[],hunks:new Map,loading:i};let{stats:t,perFileStats:r}=e,a=[];for(let[e,t]of r){let r=n.get(e),i=t.isUntracked??!1,o=!t.isBinary&&!i&&!r,s=t.added+t.removed,c=!o&&!t.isBinary&&s>W;a.push({path:e,linesAdded:t.added,linesRemoved:t.removed,isBinary:t.isBinary,isLargeFile:o,isTruncated:c,isUntracked:i})}return a.sort((e,t)=>e.path.localeCompare(t.path)),{stats:t,files:a,hunks:n,loading:!1}},[e,n,i])}var U,W,de=e((()=>{U=t(a(),1),V(),W=400}));function fe(e){if(!e||typeof e!=`object`)return!1;let t=e,n=typeof t.filePath==`string`,r=Array.isArray(t.structuredPatch)&&t.structuredPatch.length>0,i=t.type===`create`&&typeof t.content==`string`;return n&&(r||i)}function pe(e){return`type`in e&&(e.type===`create`||e.type===`update`)}function me(e){let t=0,n=0;for(let r of e)for(let e of r.lines)e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{added:t,removed:n}}function he(e){if(e.type!==`user`)return``;let t=e.message.content,n=typeof t==`string`?t:``;return n.length<=30?n:n.slice(0,29)+`…`}function G(e){let t=0,n=0;for(let r of e.files.values())t+=r.linesAdded,n+=r.linesRemoved;e.stats={filesChanged:e.files.size,linesAdded:t,linesRemoved:n}}function ge(e){let t=(0,K.useRef)({completedTurns:[],currentTurn:null,lastProcessedIndex:0,lastTurnIndex:0});return(0,K.useMemo)(()=>{let n=t.current;e.length<n.lastProcessedIndex&&(n.completedTurns=[],n.currentTurn=null,n.lastProcessedIndex=0,n.lastTurnIndex=0);for(let t=n.lastProcessedIndex;t<e.length;t++){let r=e[t];if(!(!r||r.type!==`user`)){if(!(r.toolUseResult||Array.isArray(r.message.content)&&r.message.content[0]?.type===`tool_result`)&&!r.isMeta)n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),n.completedTurns.push(n.currentTurn)),n.lastTurnIndex++,n.currentTurn={turnIndex:n.lastTurnIndex,userPromptPreview:he(r),timestamp:r.timestamp,files:new Map,stats:{filesChanged:0,linesAdded:0,linesRemoved:0}};else if(n.currentTurn&&r.toolUseResult){let e=r.toolUseResult;if(fe(e)){let{filePath:t,structuredPatch:r}=e,i=`type`in e&&e.type===`create`,a=n.currentTurn.files.get(t);if(a||(a={filePath:t,hunks:[],isNewFile:i,linesAdded:0,linesRemoved:0},n.currentTurn.files.set(t,a)),i&&r.length===0&&pe(e)){let t=e.content.split(`
|
|
5
|
+
`),n={oldStart:0,oldLines:0,newStart:1,newLines:t.length,lines:t.map(e=>`+`+e)};a.hunks.push(n),a.linesAdded+=t.length}else{a.hunks.push(...r);let{added:e,removed:t}=me(r);a.linesAdded+=e,a.linesRemoved+=t}i&&(a.isNewFile=!0)}}}}n.lastProcessedIndex=e.length;let r=[...n.completedTurns];return n.currentTurn&&n.currentTurn.files.size>0&&(G(n.currentTurn),r.push(n.currentTurn)),r.reverse()},[e])}var K,_e=e((()=>{K=t(a(),1)}));function ve({filePath:e,hunks:t,isLargeFile:n,isBinary:r,isTruncated:a,isUntracked:s}){let{columns:c}=i(),{firstLine:u,fileContent:d}=(0,q.useMemo)(()=>{if(!e)return{firstLine:null,fileContent:void 0};let t=h(ae(_(),e));return{firstLine:t?.split(`
|
|
6
|
+
`)[0]??null,fileContent:t??void 0}},[e]);return s?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(o,{bold:!0,children:e}),(0,J.jsx)(o,{dimColor:!0,children:` (untracked)`})]}),(0,J.jsx)(l,{padding:4}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`New file not yet staged.`}),(0,J.jsxs)(o,{dimColor:!0,italic:!0,children:["Run `git add ",e,"` to see line counts."]})]})]}):r?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(o,{bold:!0,children:e})}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`Binary file - cannot display diff`})})]}):n?(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(f,{children:(0,J.jsx)(o,{bold:!0,children:e})}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`Large file - diff exceeds 1 MB limit`})})]}):(0,J.jsxs)(f,{flexDirection:`column`,width:`100%`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(o,{bold:!0,children:e}),a&&(0,J.jsx)(o,{dimColor:!0,children:` (truncated)`})]}),(0,J.jsx)(l,{padding:4}),(0,J.jsx)(f,{flexDirection:`column`,children:t.length===0?(0,J.jsx)(o,{dimColor:!0,children:`No diff content`}):t.map((t,n)=>(0,J.jsx)(ne,{patch:t,filePath:e,firstLine:u,fileContent:d,dim:!1,width:c-2-2},n))}),a&&(0,J.jsx)(o,{dimColor:!0,italic:!0,children:`… diff truncated (exceeded 400 line limit)`})]})}var q,J,ye=e((()=>{q=t(a(),1),j(),d(),g(),m(),k(),J=p()}));function be({files:e,selectedIndex:t}){let{columns:n}=i(),{startIndex:r,endIndex:a}=(0,Y.useMemo)(()=>{if(e.length===0||e.length<=Z)return{startIndex:0,endIndex:e.length};let n=Math.max(0,t-Math.floor(Z/2)),r=n+Z;return r>e.length&&(r=e.length,n=Math.max(0,r-Z)),{startIndex:n,endIndex:r}},[e.length,t]);if(e.length===0)return(0,X.jsx)(o,{dimColor:!0,children:`No changed files`});let s=e.slice(r,a),c=r>0,l=a<e.length,u=e.length>Z,d=Math.max(20,n-16-3-4);return(0,X.jsxs)(f,{flexDirection:`column`,children:[u&&(0,X.jsx)(o,{dimColor:!0,children:c?` ↑ ${r} more ${T(r,`file`)}`:` `}),s.map((e,n)=>(0,X.jsx)(xe,{file:e,isSelected:r+n===t,maxPathWidth:d},e.path)),u&&(0,X.jsx)(o,{dimColor:!0,children:l?` ↓ ${e.length-a} more ${T(e.length-a,`file`)}`:` `})]})}function xe({file:e,isSelected:t,maxPathWidth:n}){let i=E(e.path,n),a=`${t?r.pointer+` `:` `}${i}`;return(0,X.jsxs)(f,{flexDirection:`row`,children:[(0,X.jsx)(o,{bold:t,color:t?`background`:void 0,inverse:t,children:a}),(0,X.jsx)(f,{flexGrow:1}),(0,X.jsx)(Se,{file:e,isSelected:t})]})}function Se({file:e,isSelected:t}){return e.isUntracked?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`untracked`}):e.isBinary?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Binary file`}):e.isLargeFile?(0,X.jsx)(o,{dimColor:!t,italic:!0,children:`Large file modified`}):(0,X.jsxs)(o,{children:[e.linesAdded>0&&(0,X.jsxs)(o,{color:`diffAddedWord`,bold:t,children:[`+`,e.linesAdded]}),e.linesAdded>0&&e.linesRemoved>0&&` `,e.linesRemoved>0&&(0,X.jsxs)(o,{color:`diffRemovedWord`,bold:t,children:[`-`,e.linesRemoved]}),e.isTruncated&&(0,X.jsx)(o,{dimColor:!t,children:` (truncated)`})]})}var Y,X,Z,Ce=e((()=>{n(),Y=t(a(),1),j(),d(),D(),w(),X=p(),Z=5}));function we(e){let t=Array.from(e.files.values()).map(e=>({path:e.filePath,linesAdded:e.linesAdded,linesRemoved:e.linesRemoved,isBinary:!1,isLargeFile:!1,isTruncated:!1,isNewFile:e.isNewFile})).sort((e,t)=>e.path.localeCompare(t.path)),n=new Map;for(let t of e.files.values())n.set(t.filePath,t.hunks);return{stats:{filesCount:e.stats.filesChanged,linesAdded:e.stats.linesAdded,linesRemoved:e.stats.linesRemoved},files:t,hunks:n,loading:!1}}function Te({messages:e,onDone:t}){let n=H(),r=ge(e),[i,a]=(0,Q.useState)(`list`),[l,d]=(0,Q.useState)(0),[p,m]=(0,Q.useState)(0),h=(0,Q.useMemo)(()=>[{type:`current`},...r.map(e=>({type:`turn`,turn:e}))],[r]),g=h[p],_=g?.type===`turn`?g.turn:null,v=(0,Q.useMemo)(()=>_?we(_):n,[_,n]),y=v.files[l],b=(0,Q.useMemo)(()=>y&&v.hunks.get(y.path)||[],[y,v.hunks]);(0,Q.useEffect)(()=>{p>=h.length&&m(Math.max(0,h.length-1))},[h.length,p]);let x=(0,Q.useRef)(p);(0,Q.useEffect)(()=>{x.current!==p&&(d(0),x.current=p)},[p]),ee(`diff-dialog`),u({"diff:previousSource":()=>{i===`detail`?a(`list`):i===`list`&&h.length>1&&m(e=>Math.max(0,e-1))},"diff:nextSource":()=>{i===`list`&&h.length>1&&m(e=>Math.min(h.length-1,e+1))},"diff:back":()=>{i===`detail`&&a(`list`)},"diff:viewDetails":()=>{i===`list`&&y&&a(`detail`)},"diff:previousFile":()=>{i===`list`&&d(e=>Math.max(0,e-1))},"diff:nextFile":()=>{i===`list`&&d(e=>Math.min(v.files.length-1,e+1))}},{context:`DiffDialog`});let S=v.stats?(0,$.jsxs)(o,{dimColor:!0,children:[v.stats.filesCount,` `,T(v.stats.filesCount,`file`),` changed`,v.stats.linesAdded>0&&(0,$.jsxs)(o,{color:`diffAddedWord`,children:[` +`,v.stats.linesAdded]}),v.stats.linesRemoved>0&&(0,$.jsxs)(o,{color:`diffRemovedWord`,children:[` -`,v.stats.linesRemoved]})]}):null,C=_?`Turn ${_.turnIndex}`:`Uncommitted changes`,w=_?_.userPromptPreview?`"${_.userPromptPreview}"`:``:`(git diff HEAD)`,E=h.length>1?(0,$.jsxs)(f,{children:[p>0&&(0,$.jsx)(o,{dimColor:!0,children:`◀ `}),h.map((e,t)=>{let n=t===p,r=e.type===`current`?`Current`:`T${e.turn.turnIndex}`;return(0,$.jsxs)(o,{dimColor:!n,bold:n,children:[t>0?` · `:``,r]},t)}),p<h.length-1&&(0,$.jsx)(o,{dimColor:!0,children:` ▶`})]}):null,D=te(`diff:dismiss`,`DiffDialog`,`esc`),O=v.loading?`Loading diff…`:_?`No file changes in this turn`:v.stats&&v.stats.filesCount>0&&v.files.length===0?`Too many files to display details`:`Working tree is clean`,k=(0,$.jsxs)(o,{children:[C,w&&(0,$.jsxs)(o,{dimColor:!0,children:[` `,w]})]});function A(){i===`detail`?a(`list`):t(`Diff dialog dismissed`,{display:`system`})}return(0,$.jsxs)(s,{title:k,onCancel:A,color:`background`,inputGuide:e=>e.pending?(0,$.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):i===`list`?(0,$.jsxs)(c,{children:[h.length>1&&(0,$.jsx)(o,{children:`←/→ source`}),(0,$.jsx)(o,{children:`↑/↓ select`}),(0,$.jsx)(o,{children:`Enter view`}),(0,$.jsxs)(o,{children:[D,` close`]})]}):(0,$.jsxs)(c,{children:[(0,$.jsx)(o,{children:`← back`}),(0,$.jsxs)(o,{children:[D,` close`]})]}),children:[E,S,v.files.length===0?(0,$.jsx)(f,{marginTop:1,children:(0,$.jsx)(o,{dimColor:!0,children:O})}):i===`list`?(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(be,{files:v.files,selectedIndex:l})}):(0,$.jsx)(f,{flexDirection:`column`,marginTop:1,children:(0,$.jsx)(ve,{filePath:y?.path||``,hunks:b,isLargeFile:y?.isLargeFile,isBinary:y?.isBinary,isTruncated:y?.isTruncated,isUntracked:y?.isUntracked})})]})}var Q,$;e((()=>{Q=t(a(),1),O(),de(),_e(),d(),re(),A(),w(),ye(),Ce(),$=p()}))();export{Te as DiffDialog};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-fES5sASd.js";import{Q as i,Rn as a,b as o,nt as s,p as c,t as l,x as u}from"./src-DNHWYkls.js";import{t as d}from"./jsx-runtime-BTgGEFjL.js";import{Ht as f,K as ee,P as p}from"./state-CUZTq6r0.js";import{Gs as m,Jr as h,Ms as te,Ql as g,Vr as _,gc as v,nu as y,yc as b}from"./growthbook-p4aJ_UMv.js";import{a as x,c as S}from"./stringUtils-U7kMYMJq.js";import{d as ne,f as C}from"./oauth-DMPGYAoZ.js";import{$N as w,BE as T,CS as E,FO as re,Fb as ie,Gv as ae,IO as D,Ib as O,JO as oe,LD as k,LI as se,LO as A,Lb as j,ME as ce,NO as le,PO as ue,Pb as de,QN as fe,RD as pe,RI as me,RO as he,Rb as ge,Wv as _e,XO as ve,Xu as M,YN as N,YO as P,Yu as F,cF as ye,cd as be,eP as xe,gI as I,jE as Se,lF as Ce,ld as we,nD as Te,oF as Ee,pI as L,sF as De,tD as Oe,xS as R,yn as ke,zE as Ae}from"./loadAgentsDir-Bz0FfcVt.js";import{t as je}from"./useKeybinding-DAQL_dB_.js";import{a as Me,i as Ne}from"./xdg-BaVL-FHd.js";import{n as Pe,t as z}from"./useExitOnCtrlCDWithKeybindings-CBce_-hb.js";import{n as Fe,o as Ie,s as Le}from"./utils-ZO5TryVH.js";import{n as Re,t as ze}from"./PressEnterToContinue-DmzxIgbZ.js";import{n as Be,t as Ve}from"./ValidationErrorsList-DprGtB2w.js";import{n as He,t as Ue}from"./shadowedRuleDetection-Ch9gTxfD.js";import{n as We,r as Ge,t as B}from"./statusNoticeHelpers-BaXE951d.js";import{join as V}from"path";function Ke(){if(!Ce())return null;let e=Ee();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,H.jsxs)(u,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,H.jsx)(o,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,H.jsxs)(u,{children:[(0,H.jsx)(o,{dimColor:!0,children:`Location: `}),(0,H.jsx)(o,{dimColor:!0,children:De()})]}),(0,H.jsxs)(u,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,H.jsxs)(u,{flexDirection:`column`,children:[(0,H.jsxs)(u,{children:[(0,H.jsx)(o,{dimColor:!0,children:`└ `}),(0,H.jsx)(o,{color:`error`,children:`[Error]`}),(0,H.jsxs)(o,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,H.jsx)(u,{marginLeft:3,children:(0,H.jsxs)(o,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,H.jsxs)(u,{flexDirection:`column`,children:[(0,H.jsxs)(u,{children:[(0,H.jsx)(o,{dimColor:!0,children:`└ `}),(0,H.jsx)(o,{color:`warning`,children:`[Warning]`}),(0,H.jsxs)(o,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,H.jsx)(u,{marginLeft:3,children:(0,H.jsxs)(o,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var H,qe=e((()=>{a(),l(),ye(),H=d()}));function Je({scope:e,parsingErrors:t,warnings:n}){let r=t.length>0,i=n.length>0;return!r&&!i?null:(0,G.jsxs)(u,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(u,{children:[(r||i)&&(0,G.jsxs)(o,{color:r?`error`:`warning`,children:[`[`,r?`Failed to parse`:`Contains warnings`,`] `]}),(0,G.jsx)(o,{children:Ie(e)})]}),(0,G.jsxs)(u,{children:[(0,G.jsx)(o,{dimColor:!0,children:`Location: `}),(0,G.jsx)(o,{dimColor:!0,children:Fe(e)})]}),(0,G.jsxs)(u,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,G.jsx)(u,{children:(0,G.jsxs)(o,{children:[(0,G.jsx)(o,{dimColor:!0,children:`└ `}),(0,G.jsx)(o,{color:`error`,children:`[Error]`}),(0,G.jsxs)(o,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),n.map((e,t)=>{let n=e.mcpErrorMetadata?.serverName;return(0,G.jsx)(u,{children:(0,G.jsxs)(o,{children:[(0,G.jsx)(o,{dimColor:!0,children:`└ `}),(0,G.jsx)(o,{color:`warning`,children:`[Warning]`}),(0,G.jsxs)(o,{dimColor:!0,children:[` `,n&&`[${n}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function Ye(){let e=(0,W.useMemo)(()=>[{scope:`user`,config:R(`user`)},{scope:`project`,config:R(`project`)},{scope:`local`,config:R(`local`)},{scope:`enterprise`,config:R(`enterprise`)}],[]),t=e.some(({config:e})=>U(e.errors,`fatal`).length>0),n=e.some(({config:e})=>U(e.errors,`warning`).length>0);return!t&&!n?null:(0,G.jsxs)(u,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,G.jsx)(o,{bold:!0,children:`MCP Config Diagnostics`}),(0,G.jsx)(u,{marginTop:1,children:(0,G.jsxs)(o,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,G.jsx)(i,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,G.jsx)(Je,{scope:e,parsingErrors:U(t.errors,`fatal`),warnings:U(t.errors,`warning`)},e))]})}function U(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var W,G,Xe=e((()=>{W=t(a()),E(),Le(),l(),G=d()}));function Ze(){if(!L.isSupportedPlatform()||!L.isSandboxEnabledInSettings())return null;let e=L.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,K.jsxs)(u,{flexDirection:`column`,children:[(0,K.jsx)(o,{bold:!0,children:`Sandbox`}),(0,K.jsxs)(o,{children:[`└ Status: `,(0,K.jsx)(o,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,K.jsxs)(o,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,K.jsxs)(o,{color:`warning`,children:[`└ `,e]},t)),t&&(0,K.jsx)(o,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var K,Qe=e((()=>{a(),l(),I(),K=d()}));function $e(){let{addNotification:e,removeNotification:t}=ce(),[n,r]=(0,q.useState)(()=>{let{errors:e}=k();return e});return Te((0,q.useCallback)(()=>{let{errors:e}=k();r(e)},[])),(0,q.useEffect)(()=>{p()||(n.length>0?e({key:J,text:`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`,color:`warning`,priority:`high`,timeoutMs:6e4}):t(J))},[n,e,t]),n}var q,J,et=e((()=>{q=t(a(),1),Se(),f(),pe(),Oe(),J=`settings-errors`}));async function tt(){let e=fe(await w());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`claudemd_files`,severity:`warning`,message:e.length===1?`Large CLAUDE.md file detected (${e[0].content.length.toLocaleString()} chars > ${N.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${N.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:N}}async function nt(e){if(!e)return null;let t=We(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:M(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${B.toLocaleString()})`,details:r,currentValue:t,threshold:B}}async function rt(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await be(e,t,n,_());if(r<=Y)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Y.toLocaleString()})`,details:s,currentValue:r,threshold:Y}}catch{let e=r.reduce((e,t)=>e+M(((t.name?.length||0)+t.description.length).toString()),0);return e<=Y?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Y.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Y}}}async function it(e){let t=Ue(await e(),{sandboxAutoAllowEnabled:L.isSandboxingEnabled()&&L.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${b(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${S(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function at(e,t,n){let[r,i,a,o]=await Promise.all([tt(),nt(t),rt(e,n,t),it(n)]);return{claudeMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Y,ot=e((()=>{F(),we(),xe(),h(),v(),He(),I(),Ge(),x(),Y=25e3})),X,Z,st=e((()=>{j(),ke(),X=16e4,Z=32e3}));function ct({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(o,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(o,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(o,{dimColor:!0,children:`└ Failed to fetch versions`})}function lt({onDone:e}){let t=T(e=>e.agentDefinitions),n=T(e=>e.mcp.tools),i=T(e=>e.toolPermissionContext),a=T(e=>e.plugins.errors);Pe();let l=(0,Q.useMemo)(()=>n||[],[n]),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),b=$e(),x=(0,Q.useMemo)(()=>A().then(e=>(e.installationType===`native`?oe:P)().catch(()=>({latest:null,stable:null}))),[]),S=te()?.autoUpdatesChannel??`latest`,C=b.filter(e=>e.mcpErrorMetadata===void 0),w=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:de,upperLimit:ie},{name:`TASK_MAX_OUTPUT_LENGTH`,default:Z,upperLimit:X},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,..._e(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=ge(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{A().then(f),(async()=>{let e=V(ne(),`agents`),n=V(ee(),`.claude`,`agents`),{activeAgents:r,allAgents:a,failedFiles:o}=t,[s,c]=await Promise.all([y(e),y(n)]);if(m({activeAgents:r.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:n,userDirExists:s,projectDirExists:c,failedFiles:o}),g(await at(l,{activeAgents:r,allAgents:a,failedFiles:o},async()=>i)),D()){let e=V(Ne(),`claude`,`locks`),t=le(e);v({enabled:!0,locks:ue(e),locksDir:e,staleLocksCleaned:t})}else v({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,l,t]);let E=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return s({"confirm:yes":E,"confirm:no":E},{context:`Confirmation`}),d?(0,$.jsxs)(c,{children:[(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(o,{children:[`└ Currently running: `,d.installationType,` (`,d.version,`)`]}),d.packageManager&&(0,$.jsxs)(o,{children:[`└ Package manager: `,d.packageManager]}),(0,$.jsxs)(o,{children:[`└ Path: `,d.installationPath]}),(0,$.jsxs)(o,{children:[`└ Invoked: `,d.invokedBinary]}),(0,$.jsxs)(o,{children:[`└ Config install method: `,d.configInstallMethod]}),(0,$.jsxs)(o,{children:[`└ Search: `,d.ripgrepStatus.working?`OK`:`Not working`,` (`,d.ripgrepStatus.mode===`embedded`?`bundled`:d.ripgrepStatus.mode===`builtin`?`vendor`:d.ripgrepStatus.systemPath||`system`,`)`]}),d.ripgrepStatus.note&&(0,$.jsxs)(o,{color:`warning`,children:[`└ Note: `,d.ripgrepStatus.note]}),d.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{}),(0,$.jsxs)(o,{color:`warning`,children:[`Recommendation: `,d.recommendation.split(`
|
|
2
|
+
`)[0]]}),(0,$.jsx)(o,{dimColor:!0,children:d.recommendation.split(`
|
|
3
|
+
`)[1]})]}),d.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{}),(0,$.jsx)(o,{color:`warning`,children:`Warning: Multiple installations found`}),d.multipleInstallations.map((e,t)=>(0,$.jsxs)(o,{children:[`└ `,e.type,` at `,e.path]},t))]}),d.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(o,{}),d.warnings.map((e,t)=>(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsxs)(o,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(o,{children:[`Fix: `,e.fix]})]},t))]}),C.length>0&&(0,$.jsxs)(u,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(o,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(Ve,{errors:C})]})]}),(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,children:`Updates`}),(0,$.jsxs)(o,{children:[`└ Auto-updates: `,d.packageManager?`Managed by package manager`:d.autoUpdates]}),d.hasUpdatePermissions!==null&&(0,$.jsxs)(o,{children:[`└ Update permissions: `,d.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(o,{children:[`└ Auto-update channel: `,S]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(ct,{promise:x})})]}),(0,$.jsx)(Ze,{}),(0,$.jsx)(Ye,{}),(0,$.jsx)(Ke,{}),w.length>0&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,children:`Environment Variables`}),w.map((e,t)=>(0,$.jsxs)(o,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(o,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),_?.enabled&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,children:`Version Locks`}),_.staleLocksCleaned>0&&(0,$.jsxs)(o,{dimColor:!0,children:[`└ Cleaned `,_.staleLocksCleaned,` stale lock(s)`]}),_.locks.length===0?(0,$.jsx)(o,{dimColor:!0,children:`└ No active version locks`}):_.locks.map((e,t)=>(0,$.jsxs)(o,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(o,{children:`(running)`}):(0,$.jsx)(o,{color:`warning`,children:`(stale)`})]},t))]}),p?.failedFiles&&p.failedFiles.length>0&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(o,{color:`error`,children:[`└ Failed to parse `,p.failedFiles.length,` agent file(s):`]}),p.failedFiles.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),a.length>0&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(o,{color:`error`,children:[`└ `,a.length,` plugin error(s) detected:`]}),a.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,se(e)]},t))]}),h?.unreachableRulesWarning&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(o,{children:[`└`,` `,(0,$.jsxs)(o,{color:`warning`,children:[r.warning,` `,h.unreachableRulesWarning.message]})]}),h.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e]},t))]}),h&&(h.claudeMdWarning||h.agentWarning||h.mcpWarning)&&(0,$.jsxs)(u,{flexDirection:`column`,children:[(0,$.jsx)(o,{bold:!0,children:`Context Usage Warnings`}),h.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(o,{children:[`└`,` `,(0,$.jsxs)(o,{color:`warning`,children:[r.warning,` `,h.claudeMdWarning.message]})]}),(0,$.jsxs)(o,{children:[` `,`└ Files:`]}),h.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e]},t))]}),h.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(o,{children:[`└`,` `,(0,$.jsxs)(o,{color:`warning`,children:[r.warning,` `,h.agentWarning.message]})]}),(0,$.jsxs)(o,{children:[` `,`└ Top contributors:`]}),h.agentWarning.details.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e]},t))]}),h.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(o,{children:[`└`,` `,(0,$.jsxs)(o,{color:`warning`,children:[r.warning,` `,h.mcpWarning.message]})]}),(0,$.jsxs)(o,{children:[` `,`└ MCP servers:`]}),h.mcpWarning.details.map((e,t)=>(0,$.jsxs)(o,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(u,{children:(0,$.jsx)(ze,{})})]}):(0,$.jsx)(c,{children:(0,$.jsx)(o,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,ut=e((()=>{n(),Q=t(a(),1),qe(),Xe(),ae(),C(),f(),l(),Re(),Qe(),Be(),et(),z(),je(),Ae(),me(),ve(),ot(),he(),j(),g(),re(),m(),O(),st(),Me(),$=d()}));export{ut as n,lt as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./Doctor-B73iDB-d.js";e();export{t as Doctor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as e,n as t,o as n}from"./chunk-DR8-3Aex.js";import{Rn as r,b as i,f as a,t as o,x as s}from"./src-DNHWYkls.js";import{t as c}from"./jsx-runtime-BTgGEFjL.js";import{Ru as l,zu as u}from"./growthbook-p4aJ_UMv.js";import{r as d,t as f}from"./execFileNoThrow-DdmR1mBS.js";import{d as p,f as m}from"./stringUtils-U7kMYMJq.js";import{DF as h,EF as g,Ew as _,RT as v,_k as y,br as b,bt as x,ct as S,fs as C,hi as w,hk as T,ht as E,ps as D,vt as O,ww as k,xt as A,zT as j}from"./loadAgentsDir-Bz0FfcVt.js";import{o as M,r as N}from"./debug-BDBIipC1.js";function P(){(b(),e(w)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,r]=(0,I.useState)(`loading`),[o,c]=(0,I.useState)([]),[l,u]=(0,I.useState)(0),[d,p]=(0,I.useState)(),h=E();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await f(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
|
|
2
|
+
`).filter(e=>e.trim()!==``),c(e)),h){let{stdout:t}=await f(`git`,[`rev-list`,`--count`,`${h.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(u(n),e.length===0&&n===0){r(`removing`),S().then(()=>{process.chdir(h.originalCwd),D(h.originalCwd),P(),g.cache.clear?.(),p(`Worktree removed (no changes)`)}).catch(e=>{M(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`)}).then(()=>{r(`done`)});return}else r(`asking`)}}e()},[h]),(0,I.useEffect)(()=>{n===`done`&&e(d)},[n,e,d]),!h)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function _(e){if(!h)return;let t=!!h.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)r(`keeping`),m(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),await x(),process.chdir(h.originalCwd),D(h.originalCwd),P(),g.cache.clear?.(),p(t?`Worktree kept. Your work is saved at ${h.worktreePath} on branch ${h.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${h.tmuxSessionName}`:`Worktree kept. Your work is saved at ${h.worktreePath} on branch ${h.worktreeBranch}`),r(`done`);else if(e===`keep-kill-tmux`)r(`keeping`),m(`tengu_worktree_kept`,{commits:l,changed_files:o.length}),h.tmuxSessionName&&await A(h.tmuxSessionName),await x(),process.chdir(h.originalCwd),D(h.originalCwd),P(),g.cache.clear?.(),p(`Worktree kept at ${h.worktreePath} on branch ${h.worktreeBranch}. Tmux session terminated.`),r(`done`);else if(e===`remove`||e===`remove-with-tmux`){r(`removing`),m(`tengu_worktree_removed`,{commits:l,changed_files:o.length}),h.tmuxSessionName&&await A(h.tmuxSessionName);try{await S(),process.chdir(h.originalCwd),D(h.originalCwd),P(),g.cache.clear?.()}catch(e){M(`Failed to clean up worktree: ${e}`,{level:`error`}),p(`Worktree cleanup failed, exiting anyway`),r(`done`);return}let e=t?` Tmux session terminated.`:``;l>0&&o.length>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):l>0?p(`Worktree removed. ${l} ${l===1?`commit`:`commits`} on ${h.worktreeBranch} ${l===1?`was`:`were`} discarded.${e}`):o.length>0?p(`Worktree removed. Uncommitted changes were discarded.${e}`):p(`Worktree removed.${e}`),r(`done`)}}if(n===`keeping`)return(0,L.jsxs)(s,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(k,{}),(0,L.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(s,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(k,{}),(0,L.jsx)(i,{children:`Removing worktree…`})]});let y=h.worktreeBranch,b=o.length>0,C=l>0,w=``;w=b&&C?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${l} ${l===1?`commit`:`commits`} on ${y}. All will be lost if you remove.`:b?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:C?`You have ${l} ${l===1?`commit`:`commits`} on ${y}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function T(){if(t){t();return}_(`keep`)}let O=b||C?`All changes and commits will be lost.`:`Clean up the worktree directory.`,j=!!h.tmuxSessionName,N=j?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${h.worktreePath}. Reattach with: tmux attach -t ${h.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${h.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${h.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(a,{title:`Exiting worktree session`,subtitle:w,onCancel:T,children:(0,L.jsx)(v,{defaultFocusValue:j?`keep-with-tmux`:`keep`,options:N,onChange:_})})}var I,L,R=t((()=>{I=n(r(),1),p(),N(),o(),d(),h(),C(),O(),j(),_(),L=c()}));function z(){return u(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await T(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{l(),r(),y(),R(),V=c(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-Zh7qGPze.js";import{F as i,Rn as a,b as o,f as s,g as c,h as l,t as u,tt as d,x as f,xt as ee}from"./src-DNHWYkls.js";import{t as p}from"./jsx-runtime-BTgGEFjL.js";import{$a as m,A as h,C as g,E as _,Ja as v,T as y,_r as b,_s as x,br as S,m as C,no as w,nt as T,ps as E,qa as D,vr as O,xr as te,yr as ne}from"./growthbook-p4aJ_UMv.js";import{E as k,O as A,l as j,p as M}from"./debug-CjIaNjpK.js";import{L as re,g as ie}from"./state-BQkyHx88.js";import{c as N,f as ae,v as oe}from"./git-Bj8Ow4pJ.js";import{n as se,r as ce}from"./privacyLevel-CRCHhztk.js";import{i as le,o as P,s as F}from"./log-DVv8YiNo.js";import{o as ue}from"./platform-BXz_rgpy.js";import{d as de,f as I}from"./stringUtils-U7kMYMJq.js";import{n as L}from"./startupProfiler-4P7GdVw6.js";import{a as R,n as z}from"./env-CesrOJJq.js";import{GT as B,HF as V,Mr as H,VF as fe,WT as pe,X as me,Yn as he,Z as ge,br as _e,dN as ve,hr as ye,ia as be,lD as U,na as xe,ra as Se,uD as Ce}from"./loadAgentsDir-Bz0FfcVt.js";import{H as we}from"./rcDebugLog-BbHlIxCm.js";import{t as Te}from"./useKeybinding-DAQL_dB_.js";import{t as W}from"./useTerminalSize-DzV4aaTi.js";import{n as Ee,t as De}from"./browser-D1vC3BNd.js";import{randomUUID as Oe}from"crypto";import{readFile as ke,stat as Ae}from"fs/promises";function je(){return!v()}async function Me(e,t,n={}){try{let r=await S({model:n.model,betas:n.betas}),i={event_name:t,event_id:Oe(),core_metadata:r,user_metadata:m(!0),event_metadata:n},a=E();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&M(`[ANT-ONLY] 1P event: ${t} ${A(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&F(e)}}function Ne(e,t={}){je()&&(!G||O(`firstParty`)||Me(G,e,t))}var G,Pe=e((()=>{x(),j(),P(),ue(),k(),L(),w(),D(),ne(),C(),te(),b(),G=null}));function K(e){let t=e;return t=t.replace(/"(sk-ant[^\s"']{24,})"/g,`"[REDACTED_API_KEY]"`),t=t.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g,`[REDACTED_API_KEY]`),t=t.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g,`AWS key: "[REDACTED_AWS_KEY]"`),t=t.replace(/(AKIA[A-Z0-9]{16})/g,`[REDACTED_AWS_KEY]`),t=t.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g,`[REDACTED_GCP_KEY]`),t=t.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g,`[REDACTED_GCP_SERVICE_ACCOUNT]`),t=t.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi,`$1[REDACTED_API_KEY]`),t=t.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi,`$1[REDACTED_TOKEN]`),t=t.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_AWS_VALUE]`),t=t.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_GCP_VALUE]`),t=t.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED]`),t}function q(){return le().map(e=>{let t={...e};return t&&typeof t.error==`string`&&(t.error=K(t.error)),t})}async function Fe(){try{let e=ye(),{size:t}=await Ae(e);return t>52428800?(M(`Skipping raw transcript read: file too large (${t} bytes)`,{level:`warn`}),null):await ke(e,`utf-8`)}catch{return null}}function Ie({abortSignal:e,messages:t,initialDescription:n,onDone:r,backgroundTasks:a={}}){let[u,p]=(0,X.useState)(`userInput`),[m,h]=(0,X.useState)(0),[g,_]=(0,X.useState)(n??``),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)({isGit:!1,gitState:null}),[w,T]=(0,X.useState)(null),E=i().columns-4;(0,X.useEffect)(()=>{async function e(){let e=await ae(),t=null;e&&(t=await N()),C({isGit:e,gitState:t})}e()},[]);let D=(0,X.useCallback)(async()=>{p(`submitting`),x(null),y(null);let n=q(),r=xe(t)?.requestId??null,[i,o]=await Promise.all([H(),Fe()]),s=he(a),c={...i,...s},l={latestAssistantMessageId:r,message_count:t.length,datetime:new Date().toISOString(),description:g,platform:z.platform,gitRepo:S.isGit,terminal:z.terminal,version:`2.8.4`,transcript:be(t),errors:n,lastApiRequest:ie(),...Object.keys(c).length>0&&{subagentTranscripts:c},...o&&{rawTranscriptJsonl:o}},[u,d]=await Promise.all([ze(l,e),Re(g,e)]);T(d),u.success?(u.feedbackId&&(y(u.feedbackId),I(`tengu_bug_report_submitted`,{feedback_id:u.feedbackId,last_assistant_message_id:r}),Ne(`tengu_bug_report_description`,{feedback_id:u.feedbackId,description:K(g)})),p(`done`)):(u.isZdrOrg?x(`Feedback collection is not available for organizations with custom data retention policies.`):x(`Could not submit feedback. Please try again later.`),p(`userInput`))},[g,S.isGit,t]),O=(0,X.useCallback)(()=>{if(u===`done`){r(b?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}r(`Feedback / bug report cancelled`,{display:`system`})},[u,b,r]);return d(`confirm:no`,O,{context:`Settings`,isActive:u===`userInput`}),ee((e,t)=>{if(u===`done`){t.return&&w&&Ee(Le(v??``,w,g,q())),r(b?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}if(b&&u!==`userInput`){r(`Error submitting feedback / bug report`,{display:`system`});return}u===`consent`&&(t.return||e===` `)&&D()}),(0,Z.jsxs)(s,{title:`Submit Feedback / Bug Report`,onCancel:O,isCancelActive:u!==`userInput`,inputGuide:e=>e.pending?(0,Z.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):u===`userInput`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(U,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):u===`consent`?(0,Z.jsxs)(l,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`submit`}),(0,Z.jsx)(U,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):null,children:[u===`userInput`&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{children:`Describe the issue below:`}),(0,Z.jsx)(pe,{value:g,onChange:e=>{_(e),b&&x(null)},columns:E,onSubmit:()=>p(`consent`),onExitMessage:()=>r(`Feedback cancelled`,{display:`system`}),cursorOffset:m,onChangeCursorOffset:h,showCursor:!0}),b&&(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{color:`error`,children:b}),(0,Z.jsx)(o,{dimColor:!0,children:`Edit and press Enter to retry, or Esc to cancel`})]})]}),u===`consent`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[(0,Z.jsx)(o,{children:`This report will include:`}),(0,Z.jsxs)(f,{marginLeft:2,flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[`- Your feedback / bug description: `,(0,Z.jsx)(o,{dimColor:!0,children:g})]}),(0,Z.jsxs)(o,{children:[`- Environment info:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[z.platform,`, `,z.terminal,`, v`,`2.8.4`]})]}),S.gitState&&(0,Z.jsxs)(o,{children:[`- Git repo metadata:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[S.gitState.branchName,S.gitState.commitHash?`, ${S.gitState.commitHash.slice(0,7)}`:``,S.gitState.remoteUrl?` @ ${S.gitState.remoteUrl}`:``,!S.gitState.isHeadOnRemote&&`, not synced`,!S.gitState.isClean&&`, has local changes`]})]}),(0,Z.jsx)(o,{children:`- Current session transcript`})]}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsx)(o,{wrap:`wrap`,dimColor:!0,children:`We will use your feedback to debug related issues or to improve Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).`})}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsxs)(o,{children:[`Press `,(0,Z.jsx)(o,{bold:!0,children:`Enter`}),` to confirm and submit.`]})})]}),u===`submitting`&&(0,Z.jsx)(f,{flexDirection:`row`,gap:1,children:(0,Z.jsx)(o,{children:`Submitting report…`})}),u===`done`&&(0,Z.jsxs)(f,{flexDirection:`column`,children:[b?(0,Z.jsx)(o,{color:`error`,children:b}):(0,Z.jsx)(o,{color:`success`,children:`Thank you for your report!`}),v&&(0,Z.jsxs)(o,{dimColor:!0,children:[`Feedback ID: `,v]}),(0,Z.jsxs)(f,{marginTop:1,children:[(0,Z.jsx)(o,{children:`Press `}),(0,Z.jsx)(o,{bold:!0,children:`Enter `}),(0,Z.jsx)(o,{children:`to open your browser and draft a GitHub issue, or any other key to close.`})]})]})]})}function Le(e,t,n,r){let i=K(t),a=`**Bug Description**\n${K(n)}\n\n**Environment Info**\n- Platform: ${z.platform}\n- Terminal: ${z.terminal}\n- Version: 2.8.4\n- Feedback ID: ${e}\n\n**Errors**\n\`\`\`json\n`,o=A(r),s=`${$}/new?title=${encodeURIComponent(i)}&labels=user-reported,bug&body=`,c=encodeURIComponent(a),l=encodeURIComponent(o),u=Q-s.length-c.length-15-46;if(u<=0){let e=Q-s.length-9-46-50,t=a+o+"\n```\n",n=encodeURIComponent(t);if(n.length>e){n=n.slice(0,e);let t=n.lastIndexOf(`%`);t>=n.length-2&&(n=n.slice(0,t))}return s+n+`%E2%80%A6%0A**Note%3A**%20Content%20was%20truncated.%0A`}if(l.length<=u)return s+c+l+`%0A%60%60%60%0A`;let d=l.slice(0,u-9-50),f=d.lastIndexOf(`%`);return f>=d.length-2&&(d=d.slice(0,f)),s+c+d+`%E2%80%A6%0A%60%60%60%0A%0A**Note%3A**%20Content%20was%20truncated.%0A`}async function Re(e,t){try{let n=(await ge({systemPrompt:we([`Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.`,`Claude Code is an agentic coding CLI based on the Anthropic API.`,`The title should:`,`- Include the type of issue [Bug] or [Feature Request] as the first thing in the title`,`- Be concise, specific and descriptive of the actual problem`,`- Use technical terminology appropriate for a software issue`,`- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)`,`- Be direct and clear for developers to understand the problem`,`- If you cannot determine a clear issue, use "Bug Report: [brief description]"`,`- Any LLM API errors are from the Anthropic API, not from any other model provider`,`Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination`,`Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] Anthropic API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"`]),userPrompt:e,signal:t,options:{hasAppendSystemPrompt:!1,toolChoice:void 0,isNonInteractiveSession:!1,agents:[],querySource:`feedback`,mcpTools:[]}}))?.message?.content?.[0],r=n?.type===`text`?n.text:`Bug Report`;return V(r)?J(e):r}catch(t){return F(t),J(e)}}function J(e){let t=e.split(`
|
|
2
|
+
`)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function Y(e){if(e instanceof Error){let t=Error(K(e.message));e.stack&&(t.stack=K(e.stack)),F(t)}else{let t=K(String(e));F(Error(t))}}async function ze(e,t){if(ce())return{success:!1};try{await h();let r=g();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":y(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:A(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(Y(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return Y(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return Y(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return Y(e),{success:!1}}}var X,Z,Q,$,Be=e((()=>{r(),a(),X=t(a(),1),re(),Pe(),de(),Se(),W(),u(),Te(),me(),fe(),T(),De(),j(),R(),oe(),_(),P(),se(),_e(),k(),ve(),Ce(),B(),Z=p(),Q=7250,$=process.env.USER_TYPE===`ant`?`https://github.com/anthropics/claude-cli-internal/issues`:`https://github.com/anthropics/claude-code/issues`}));export{Be as n,K as r,Ie as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{Q as t,Rn as n,b as r,f as i,g as a,h as o,t as s,x as c}from"./src-DNHWYkls.js";import{t as l}from"./jsx-runtime-BTgGEFjL.js";import{d as u,f as d}from"./stringUtils-U7kMYMJq.js";import{Ak as f,Dk as p,Mk as m,Nk as h,Ok as g,RT as _,kk as v,vw as y}from"./loadAgentsDir-Bz0FfcVt.js";var b=e(n());u(),s(),f(),y();var x=l(),S=` _____________
|
|
2
|
+
| \\ \\
|
|
3
|
+
| NEW TERMS \\__\\
|
|
4
|
+
| |
|
|
5
|
+
| ---------- |
|
|
6
|
+
| ---------- |
|
|
7
|
+
| ---------- |
|
|
8
|
+
| ---------- |
|
|
9
|
+
| ---------- |
|
|
10
|
+
| |
|
|
11
|
+
|______________|`;function C(){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(r,{children:[`An update to our Consumer Terms and Privacy Policy will take effect on `,(0,x.jsx)(r,{bold:!0,children:`October 8, 2025`}),`. You can accept the updated terms today.`]}),(0,x.jsxs)(c,{flexDirection:`column`,children:[(0,x.jsx)(r,{children:`What's changing?`}),(0,x.jsx)(c,{paddingLeft:1,children:(0,x.jsxs)(r,{children:[(0,x.jsx)(r,{children:`· `}),(0,x.jsx)(r,{bold:!0,children:`You can help improve Claude `}),(0,x.jsxs)(r,{children:[`— Allow the use of your chats and coding sessions to train and improve Anthropic AI models. Change anytime in your Privacy Settings (`,(0,x.jsx)(t,{url:`https://claude.ai/settings/data-privacy-controls`}),`).`]})]})}),(0,x.jsx)(c,{paddingLeft:1,children:(0,x.jsxs)(r,{children:[(0,x.jsx)(r,{children:`· `}),(0,x.jsx)(r,{bold:!0,children:`Updates to data retention `}),(0,x.jsx)(r,{children:`— To help us improve our AI models and safety protections, we're extending data retention to 5 years.`})]})})]}),(0,x.jsxs)(r,{children:[`Learn more (`,(0,x.jsx)(t,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,x.jsx)(t,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,x.jsx)(t,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function w(){return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(r,{children:`We've updated our Consumer Terms and Privacy Policy.`}),(0,x.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(r,{children:`What's changing?`}),(0,x.jsxs)(c,{flexDirection:`column`,children:[(0,x.jsx)(r,{bold:!0,children:`Help improve Claude`}),(0,x.jsx)(r,{children:`Allow the use of your chats and coding sessions to train and improve Anthropic AI models. You can change this anytime in Privacy Settings`}),(0,x.jsx)(t,{url:`https://claude.ai/settings/data-privacy-controls`})]}),(0,x.jsxs)(c,{flexDirection:`column`,children:[(0,x.jsx)(r,{bold:!0,children:`How this affects data retention`}),(0,x.jsx)(r,{children:`Turning ON the improve Claude setting extends data retention from 30 days to 5 years. Turning it OFF keeps the default 30-day data retention. Delete data anytime.`})]})]}),(0,x.jsxs)(r,{children:[`Learn more (`,(0,x.jsx)(t,{url:`https://www.anthropic.com/news/updates-to-our-consumer-terms`}),`) or read the updated Consumer Terms (`,(0,x.jsx)(t,{url:`https://anthropic.com/legal/terms`}),`) and Privacy Policy (`,(0,x.jsx)(t,{url:`https://anthropic.com/legal/privacy`}),`)`]})]})}function T({showIfAlreadyViewed:e,location:t,onDone:n}){let[s,l]=(0,b.useState)(null),[u,f]=(0,b.useState)(null);if((0,b.useEffect)(()=>{async function r(){let[r,i]=await Promise.all([v(),g()]),a=i.success?i.data:null;f(a);let o=p(r,i,e);if(l(o),!o){n(`skip_rendering`);return}m(),d(`tengu_grove_policy_viewed`,{location:t,dismissable:a?.notice_is_grace_period})}r()},[e,t,n]),s===null||!s)return null;async function y(e){switch(e){case`accept_opt_in`:await h(!0),d(`tengu_grove_policy_submitted`,{state:!0,dismissable:u?.notice_is_grace_period});break;case`accept_opt_out`:await h(!1),d(`tengu_grove_policy_submitted`,{state:!1,dismissable:u?.notice_is_grace_period});break;case`defer`:d(`tengu_grove_policy_dismissed`,{state:!0});break;case`escape`:d(`tengu_grove_policy_escaped`,{});break}n(e)}let T=u?.domain_excluded?[{label:`Accept terms · Help improve Claude: OFF (for emails with your domain)`,value:`accept_opt_out`}]:[{label:`Accept terms · Help improve Claude: ON`,value:`accept_opt_in`},{label:`Accept terms · Help improve Claude: OFF`,value:`accept_opt_out`}];function E(){if(u?.notice_is_grace_period){y(`defer`);return}y(`escape`)}return(0,x.jsxs)(i,{title:`Updates to Consumer Terms and Policies`,color:`professionalBlue`,onCancel:E,inputGuide:e=>e.pending?(0,x.jsxs)(r,{children:[`Press `,e.keyName,` again to exit`]}):(0,x.jsxs)(o,{children:[(0,x.jsx)(a,{shortcut:`Enter`,action:`confirm`}),(0,x.jsx)(a,{shortcut:`Esc`,action:`cancel`})]}),children:[(0,x.jsxs)(c,{flexDirection:`row`,children:[(0,x.jsx)(c,{flexDirection:`column`,gap:1,flexGrow:1,children:u?.notice_is_grace_period?(0,x.jsx)(C,{}):(0,x.jsx)(w,{})}),(0,x.jsx)(c,{flexShrink:0,children:(0,x.jsx)(r,{color:`professionalBlue`,children:S})})]}),(0,x.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,x.jsxs)(c,{flexDirection:`column`,children:[(0,x.jsx)(r,{bold:!0,children:`Please select how you'd like to continue`}),(0,x.jsx)(r,{children:`Your choice takes effect immediately upon confirmation.`})]}),(0,x.jsx)(_,{options:[...T,...u?.notice_is_grace_period?[{label:`Not now`,value:`defer`}]:[]],onChange:e=>y(e),onCancel:E})]})]})}export{T as GroveDialog};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{s as e,u as t}from"./envUtils-CFG7IQID.js";import{n,t as r}from"./defineProperty-CaCI0a5T.js";import{n as i,t as a}from"./axios-Zh7qGPze.js";import{E as o,O as s,l as c,p as l}from"./debug-CjIaNjpK.js";import{M as u,j as d}from"./git-Bj8Ow4pJ.js";import{n as f,r as p}from"./analytics-i6X1et4O.js";import{_ as m,c as h,g,l as _,u as v}from"./proxy-9WvtUy8E.js";import{Bb as y,zb as b}from"./loadAgentsDir-Bz0FfcVt.js";import{f as x,g as S,n as C,t as w,u as T,v as E,y as D}from"./rcDebugLog-BbHlIxCm.js";import{i as O}from"./SSETransport-DmZWnH0k.js";a(),D(),f(),y(),c(),w(),d(),e(),m(),v(),T(),o(),n();var k=`{"type":"keep_alive"}
|
|
2
|
+
`,A=1e3,j=1e3,M=3e4,N=6e5,P=1e4,F=12e4,I=M*2,L=new Set([1002,4001,4003]),R=class{constructor(e,t={},n,i,a){r(this,`ws`,null),r(this,`lastSentId`,null),r(this,`url`,void 0),r(this,`state`,`idle`),r(this,`onData`,void 0),r(this,`onCloseCallback`,void 0),r(this,`onConnectCallback`,void 0),r(this,`headers`,void 0),r(this,`sessionId`,void 0),r(this,`autoReconnect`,void 0),r(this,`isBridge`,void 0),r(this,`reconnectAttempts`,0),r(this,`reconnectStartTime`,null),r(this,`reconnectTimer`,null),r(this,`lastReconnectAttemptTime`,null),r(this,`lastActivityTime`,0),r(this,`pingInterval`,null),r(this,`pongReceived`,!0),r(this,`keepAliveInterval`,null),r(this,`messageBuffer`,void 0),r(this,`isBunWs`,!1),r(this,`connectStartTime`,0),r(this,`refreshHeaders`,void 0),r(this,`onBunOpen`,()=>{this.handleOpenEvent(),this.lastSentId&&this.replayBufferedMessages(``)}),r(this,`onBunMessage`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.lastActivityTime=Date.now(),u(`info`,`cli_websocket_message_received`,{length:t.length}),this.onData&&this.onData(t)}),r(this,`onBunError`,()=>{l(`WebSocketTransport: Error`,{level:`error`}),u(`error`,`cli_websocket_connect_error`)}),r(this,`onBunClose`,e=>{let t=e.code===1e3||e.code===1001;l(`WebSocketTransport: Closed: ${e.code}`,t?void 0:{level:`error`}),u(`error`,`cli_websocket_connect_closed`),this.handleConnectionError(e.code)}),r(this,`onNodeOpen`,()=>{let e=this.ws;if(this.handleOpenEvent(),!e)return;let t=e.upgradeReq;if(t?.headers?.[`x-last-request-id`]){let e=t.headers[`x-last-request-id`];this.replayBufferedMessages(e)}}),r(this,`onNodeMessage`,e=>{let t=e.toString();this.lastActivityTime=Date.now(),u(`info`,`cli_websocket_message_received`,{length:t.length}),this.onData&&this.onData(t)}),r(this,`onNodeError`,e=>{l(`WebSocketTransport: Error: ${e.message}`,{level:`error`}),u(`error`,`cli_websocket_connect_error`)}),r(this,`onNodeClose`,(e,t)=>{let n=e===1e3||e===1001;l(`WebSocketTransport: Closed: ${e}`,n?void 0:{level:`error`}),u(`error`,`cli_websocket_connect_closed`),this.handleConnectionError(e)}),r(this,`onPong`,()=>{this.pongReceived=!0}),this.url=e,this.headers=t,this.sessionId=n,this.refreshHeaders=i,this.autoReconnect=a?.autoReconnect??!0,this.isBridge=a?.isBridge??!1,this.messageBuffer=new b(A)}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`WebSocketTransport: Cannot connect, current state is ${this.state}`,{level:`error`}),u(`error`,`cli_websocket_connect_failed`);return}this.state=`reconnecting`,this.connectStartTime=Date.now(),l(`WebSocketTransport: Opening ${this.url.href}`),u(`info`,`cli_websocket_connect_opening`);let e={...this.headers};if(this.lastSentId&&(e[`X-Last-Request-Id`]=this.lastSentId,l(`WebSocketTransport: Adding X-Last-Request-Id header: ${this.lastSentId}`)),typeof Bun<`u`){let t=new globalThis.WebSocket(this.url.href,{headers:e,proxy:_(this.url.href),tls:g()||void 0});this.ws=t,this.isBunWs=!0,t.addEventListener(`open`,this.onBunOpen),t.addEventListener(`message`,this.onBunMessage),t.addEventListener(`error`,this.onBunError),t.addEventListener(`close`,this.onBunClose),t.addEventListener(`pong`,this.onPong)}else{let{default:t}=await import(`./wrapper-DRTs77RK.js`),n=new t(this.url.href,{headers:e,agent:h(this.url.href),...g()});this.ws=n,this.isBunWs=!1,n.on(`open`,this.onNodeOpen),n.on(`message`,this.onNodeMessage),n.on(`error`,this.onNodeError),n.on(`close`,this.onNodeClose),n.on(`pong`,this.onPong)}}handleOpenEvent(){let e=Date.now()-this.connectStartTime;l(`WebSocketTransport: Connected`),u(`info`,`cli_websocket_connect_connected`,{duration_ms:e}),this.isBridge&&this.reconnectStartTime!==null&&p(`tengu_ws_transport_reconnected`,{attempts:this.reconnectAttempts,downtimeMs:Date.now()-this.reconnectStartTime}),this.reconnectAttempts=0,this.reconnectStartTime=null,this.lastReconnectAttemptTime=null,this.lastActivityTime=Date.now(),this.state=`connected`,this.onConnectCallback?.(),this.startPingInterval(),this.startKeepaliveInterval(),x(()=>{this.write({type:`keep_alive`})})}sendLine(e){if(!this.ws||this.state!==`connected`)return l(`WebSocketTransport: Not connected`),u(`info`,`cli_websocket_send_not_connected`),!1;try{return this.ws.send(e),this.lastActivityTime=Date.now(),!0}catch(e){return l(`WebSocketTransport: Failed to send: ${e}`,{level:`error`}),u(`error`,`cli_websocket_send_error`),this.handleConnectionError(),!1}}removeWsListeners(e){if(this.isBunWs){let t=e;t.removeEventListener(`open`,this.onBunOpen),t.removeEventListener(`message`,this.onBunMessage),t.removeEventListener(`error`,this.onBunError),t.removeEventListener(`close`,this.onBunClose),t.removeEventListener(`pong`,this.onPong)}else{let t=e;t.off(`open`,this.onNodeOpen),t.off(`message`,this.onNodeMessage),t.off(`error`,this.onNodeError),t.off(`close`,this.onNodeClose),t.off(`pong`,this.onPong)}}doDisconnect(){this.stopPingInterval(),this.stopKeepaliveInterval(),S(),this.ws&&(this.removeWsListeners(this.ws),this.ws.close(),this.ws=null)}handleConnectionError(e){if(C(`WS handleConnectionError: code=${e} state=${this.state} url=${this.url.href.replace(/token=[^&]+/,`token=***`)} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1} reconnectAttempts=${this.reconnectAttempts}`),l(`WebSocketTransport: Disconnected from ${this.url.href}`+(e==null?``:` (code ${e})`)),u(`info`,`cli_websocket_disconnected`),this.isBridge&&p(`tengu_ws_transport_closed`,{closeCode:e,msSinceLastActivity:this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1,wasConnected:this.state===`connected`,reconnectAttempts:this.reconnectAttempts}),this.doDisconnect(),this.state===`closing`||this.state===`closed`)return;let t=!1;if(e===4003&&this.refreshHeaders){let e=this.refreshHeaders();e.Authorization!==this.headers.Authorization&&(Object.assign(this.headers,e),t=!0,l(`WebSocketTransport: 4003 received but headers refreshed, scheduling reconnect`),u(`info`,`cli_websocket_4003_token_refreshed`))}if(e!=null&&L.has(e)&&!t){l(`WebSocketTransport: Permanent close code ${e}, not reconnecting`,{level:`error`}),u(`error`,`cli_websocket_permanent_close`,{closeCode:e}),this.state=`closed`,this.onCloseCallback?.(e);return}if(!this.autoReconnect){this.state=`closed`,this.onCloseCallback?.(e);return}let n=Date.now();this.reconnectStartTime||(this.reconnectStartTime=n),this.lastReconnectAttemptTime!==null&&n-this.lastReconnectAttemptTime>I&&(l(`WebSocketTransport: Detected system sleep (${Math.round((n-this.lastReconnectAttemptTime)/1e3)}s gap), resetting reconnection budget`),u(`info`,`cli_websocket_sleep_detected`,{gapMs:n-this.lastReconnectAttemptTime}),this.reconnectStartTime=n,this.reconnectAttempts=0),this.lastReconnectAttemptTime=n;let r=n-this.reconnectStartTime;if(r<N){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!t&&this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`WebSocketTransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(j*2**(this.reconnectAttempts-1),M),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`WebSocketTransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(r/1e3)}s elapsed)`),u(`error`,`cli_websocket_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.isBridge&&p(`tengu_ws_transport_reconnecting`,{attempt:this.reconnectAttempts,elapsedMs:r,delayMs:Math.round(n)}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`WebSocketTransport: Reconnection time budget exhausted after ${Math.round(r/1e3)}s for ${this.url.href}`,{level:`error`}),u(`error`,`cli_websocket_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:r}),this.state=`closed`,this.onCloseCallback&&this.onCloseCallback(e)}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopPingInterval(),this.stopKeepaliveInterval(),S(),this.state=`closing`,this.doDisconnect()}replayBufferedMessages(e){let t=this.messageBuffer.toArray();if(t.length===0)return;let n=0;if(e){let r=t.findIndex(t=>`uuid`in t&&t.uuid===e);if(r>=0){n=r+1;let e=t.slice(n);this.messageBuffer.clear(),this.messageBuffer.addAll(e),e.length===0&&(this.lastSentId=null),l(`WebSocketTransport: Evicted ${n} confirmed messages, ${e.length} remaining`),u(`info`,`cli_websocket_evicted_confirmed_messages`,{evicted:n,remaining:e.length})}}let r=t.slice(n);if(r.length===0){l(`WebSocketTransport: No new messages to replay`),u(`info`,`cli_websocket_no_messages_to_replay`);return}l(`WebSocketTransport: Replaying ${r.length} buffered messages`),u(`info`,`cli_websocket_messages_to_replay`,{count:r.length});for(let e of r){let t=s(e)+`
|
|
3
|
+
`;if(!this.sendLine(t)){this.handleConnectionError();break}}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnConnect(e){this.onConnectCallback=e}setOnClose(e){this.onCloseCallback=e}getStateLabel(){return this.state}async write(e){`uuid`in e&&typeof e.uuid==`string`&&(this.messageBuffer.add(e),this.lastSentId=e.uuid);let t=s(e)+`
|
|
4
|
+
`;if(this.state!==`connected`)return;let n=this.sessionId?` session=${this.sessionId}`:``,r=this.getControlMessageDetailLabel(e);l(`WebSocketTransport: Sending message type=${e.type}${n}${r}`),this.sendLine(t)}getControlMessageDetailLabel(e){if(e.type===`control_request`){let{request_id:t,request:n}=e,r=n.subtype===`can_use_tool`?n.tool_name:``;return` subtype=${n.subtype} request_id=${t}${r?` tool=${r}`:``}`}if(e.type===`control_response`){let{subtype:t,request_id:n}=e.response;return` subtype=${t} request_id=${n}`}return``}startPingInterval(){this.stopPingInterval(),this.pongReceived=!0;let e=Date.now();this.pingInterval=setInterval(()=>{if(this.state===`connected`&&this.ws){let t=Date.now(),n=t-e;if(e=t,n>I){l(`WebSocketTransport: ${Math.round(n/1e3)}s tick gap detected — process was suspended, forcing reconnect`),u(`info`,`cli_websocket_sleep_detected_on_ping`,{gapMs:n}),this.handleConnectionError();return}if(!this.pongReceived){l(`WebSocketTransport: No pong received, connection appears dead`,{level:`error`}),u(`error`,`cli_websocket_pong_timeout`),this.handleConnectionError();return}this.pongReceived=!1;try{this.ws.ping?.()}catch(e){l(`WebSocketTransport: Ping failed: ${e}`,{level:`error`}),u(`error`,`cli_websocket_ping_failed`)}}},P)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}startKeepaliveInterval(){this.stopKeepaliveInterval(),!t(process.env.CLAUDE_CODE_REMOTE)&&(this.keepAliveInterval=setInterval(()=>{if(this.state===`connected`&&this.ws)try{this.ws.send(k),this.lastActivityTime=Date.now(),l(`WebSocketTransport: Sent periodic keep_alive data frame`)}catch(e){l(`WebSocketTransport: Periodic keep_alive failed: ${e}`,{level:`error`}),u(`error`,`cli_websocket_keepalive_failed`)}},F))}stopKeepaliveInterval(){this.keepAliveInterval&&(clearInterval(this.keepAliveInterval),this.keepAliveInterval=null)}};c(),w(),d(),n();var z=100,B=15e3,V=3e3,H=class extends R{constructor(e,t={},n,i,a){super(e,t,n,i,a),r(this,`postUrl`,void 0),r(this,`uploader`,void 0),r(this,`streamEventBuffer`,[]),r(this,`streamEventTimer`,null);let{maxConsecutiveFailures:o,onBatchDropped:s}=a??{};this.postUrl=U(e),this.uploader=new O({maxBatchSize:500,maxQueueSize:1e4,baseDelayMs:500,maxDelayMs:8e3,jitterMs:1e3,maxConsecutiveFailures:o,onBatchDropped:(e,t)=>{u(`error`,`cli_hybrid_batch_dropped_max_failures`,{batchSize:e,failures:t}),s?.(e,t)},send:e=>this.postOnce(e)}),l(`HybridTransport: POST URL = ${this.postUrl}`),u(`info`,`cli_hybrid_transport_initialized`)}async write(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>this.flushStreamEvents(),z));return}return await this.uploader.enqueue([...this.takeStreamEvents(),e]),this.uploader.flush()}async writeBatch(e){return await this.uploader.enqueue([...this.takeStreamEvents(),...e]),this.uploader.flush()}get droppedBatchCount(){return this.uploader.droppedBatchCount}flush(){return this.uploader.enqueue(this.takeStreamEvents()),this.uploader.flush()}takeStreamEvents(){this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null);let e=this.streamEventBuffer;return this.streamEventBuffer=[],e}flushStreamEvents(){this.streamEventTimer=null,this.uploader.enqueue(this.takeStreamEvents())}close(){this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[];let e=this.uploader,t;Promise.race([e.flush(),new Promise(e=>{t=setTimeout(e,V)})]).finally(()=>{clearTimeout(t),e.close()}),super.close()}async postOnce(e){let t=E();if(!t){l(`HybridTransport: No session token available for POST`),u(`warn`,`cli_hybrid_post_no_token`);return}let n={Authorization:`Bearer ${t}`,"Content-Type":`application/json`},r;try{r=await i.post(this.postUrl,{events:e},{headers:n,validateStatus:()=>!0,timeout:B})}catch(e){throw l(`HybridTransport: POST error: ${e.message}`),u(`warn`,`cli_hybrid_post_network_error`),e}if(r.status>=200&&r.status<300){l(`HybridTransport: POST success count=${e.length}`);return}if(r.status>=400&&r.status<500&&r.status!==429){C(`Hybrid POST ${r.status}: url=${this.postUrl.replace(/token=[^&]+/,`token=***`)} events=${e.length} body=${JSON.stringify(r.data).slice(0,200)}`),l(`HybridTransport: POST returned ${r.status} (permanent), dropping`),u(`warn`,`cli_hybrid_post_client_error`,{status:r.status});return}throw l(`HybridTransport: POST returned ${r.status} (retryable)`),u(`warn`,`cli_hybrid_post_retryable_error`,{status:r.status}),Error(`POST failed with ${r.status}`)}};function U(e){let t=e.protocol===`wss:`?`https:`:`http:`,n=e.pathname;return n=n.replace(`/ws/`,`/session/`),n.endsWith(`/events`)||(n=n.endsWith(`/`)?n+`events`:n+`/events`),`${t}//${e.host}${n}${e.search}`}export{R as n,H as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-CaCI0a5T.js";import{l as r,p as i}from"./debug-CjIaNjpK.js";import{r as a,t as o}from"./execFileNoThrow-DdmR1mBS.js";import{Pp as s,jp as c}from"./loadAgentsDir-Bz0FfcVt.js";import{c as l,i as u,r as d}from"./detection-DW6grIlc.js";function f(){let e,t=new Promise(t=>{e=t}),n=v;return v=t,n.then(()=>e)}function p(e){return o(`it2`,e)}function m(e){let t=e.match(/Created new pane:\s*(.+)/);return t&&t[1]?t[1].trim():``}function h(){let e=process.env.ITERM_SESSION_ID;if(!e)return null;let t=e.indexOf(`:`);return t===-1?null:e.slice(t+1)}var g,_,v,y;e((()=>{r(),a(),d(),c(),t(),g=[],_=!1,v=Promise.resolve(),y=class{constructor(){n(this,`type`,`iterm2`),n(this,`displayName`,`iTerm2`),n(this,`supportsHideShow`,!1)}async isAvailable(){let e=u();if(i(`[ITermBackend] isAvailable check: inITerm2=${e}`),!e)return i(`[ITermBackend] isAvailable: false (not in iTerm2)`),!1;let t=await l();return i(`[ITermBackend] isAvailable: ${t} (it2 CLI ${t?`found`:`not found`})`),t}async isRunningInside(){let e=u();return i(`[ITermBackend] isRunningInside: ${e}`),e}async createTeammatePaneInSwarmView(e,t){i(`[ITermBackend] createTeammatePaneInSwarmView called for ${e} with color ${t}`);let n=await f();try{for(;;){let t=!_;i(`[ITermBackend] Creating pane: isFirstTeammate=${t}, existingPanes=${g.length}`);let n,r;if(t){let e=h();e?(n=[`session`,`split`,`-v`,`-s`,e],i(`[ITermBackend] First split from leader session: ${e}`)):(n=[`session`,`split`,`-v`],i(`[ITermBackend] First split from active session (no leader ID)`))}else r=g[g.length-1],r?(n=[`session`,`split`,`-s`,r],i(`[ITermBackend] Subsequent split from teammate session: ${r}`)):(n=[`session`,`split`],i(`[ITermBackend] Subsequent split from active session (no teammate ID)`));let a=await p(n);if(a.code!==0){if(r){let e=await p([`session`,`list`]);if(e.code===0&&!e.stdout.includes(r)){i(`[ITermBackend] Split failed targeting dead session ${r}, pruning and retrying: ${a.stderr}`);let e=g.indexOf(r);e!==-1&&g.splice(e,1),g.length===0&&(_=!1);continue}}throw Error(`Failed to create iTerm2 split pane: ${a.stderr}`)}t&&(_=!0);let o=m(a.stdout);if(!o)throw Error(`Failed to parse session ID from split output: ${a.stdout}`);return i(`[ITermBackend] Created teammate pane for ${e}: ${o}`),g.push(o),{paneId:o,isFirstTeammate:t}}}finally{n()}}async sendCommandToPane(e,t,n){let r=await p(e?[`session`,`run`,`-s`,e,t]:[`session`,`run`,t]);if(r.code!==0)throw Error(`Failed to send command to iTerm2 pane ${e}: ${r.stderr}`)}async setPaneBorderColor(e,t,n){}async setPaneTitle(e,t,n,r){}async enablePaneBorderStatus(e,t){}async rebalancePanes(e,t){i(`[ITermBackend] Pane rebalancing not implemented for iTerm2`)}async killPane(e,t){let n=await p([`session`,`close`,`-f`,`-s`,e]),r=g.indexOf(e);return r!==-1&&g.splice(r,1),g.length===0&&(_=!1),n.code===0}async hidePane(e,t){return i(`[ITermBackend] hidePane not supported in iTerm2`),!1}async showPane(e,t,n){return i(`[ITermBackend] showPane not supported in iTerm2`),!1}},s(y)}))();export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./defineProperty-CaCI0a5T.js";function r(){let e=new i,t=new i;return e._setPeer(t),t._setPeer(e),[e,t]}var i;e((()=>{t(),i=class{constructor(){n(this,`peer`,void 0),n(this,`closed`,!1),n(this,`onclose`,void 0),n(this,`onerror`,void 0),n(this,`onmessage`,void 0)}_setPeer(e){this.peer=e}async start(){}async send(e){if(this.closed)throw Error(`Transport is closed`);queueMicrotask(()=>{this.peer?.onmessage?.(e)})}async close(){this.closed||(this.closed=!0,this.onclose?.(),this.peer&&!this.peer.closed&&(this.peer.closed=!0,this.peer.onclose?.()))}}}))();export{r as createLinkedTransportPair};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Mt as e,Rn as t,b as n,f as r,t as i,x as a}from"./src-DNHWYkls.js";import{t as o}from"./jsx-runtime-BTgGEFjL.js";import{A as s,E as c,O as l}from"./debug-CjIaNjpK.js";import{LE as u,RT as d,hw as f,mw as p,vw as m,zE as h}from"./loadAgentsDir-Bz0FfcVt.js";import{t as g}from"./renderOptions-QZLxGnh_.js";t(),i(),f(),h(),c(),m();var _=o();function v({filePath:e,errorDescription:t,onExit:i,onReset:o}){return(0,_.jsxs)(r,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,_.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(n,{children:[`The configuration file at `,(0,_.jsx)(n,{bold:!0,children:e}),` contains invalid JSON.`]}),(0,_.jsx)(n,{children:t})]}),(0,_.jsxs)(a,{flexDirection:`column`,children:[(0,_.jsx)(n,{bold:!0,children:`Choose an option:`}),(0,_.jsx)(d,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():o()},onCancel:i})]})]})}var y=`dark`;async function b({error:t}){let n={...g(!1),theme:y};await new Promise(async r=>{let{unmount:i}=await e((0,_.jsx)(u,{children:(0,_.jsx)(p,{children:(0,_.jsx)(v,{filePath:t.filePath,errorDescription:t.message,onExit:()=>{i(),r(),process.exit(1)},onReset:()=>{s(t.filePath,l(t.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),i(),r(),process.exit(0)}})})}),n)})}export{b as showInvalidConfigDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-DR8-3Aex.js";import{Rn as e,b as t,f as n,t as r}from"./src-DNHWYkls.js";import{t as i}from"./jsx-runtime-BTgGEFjL.js";import{RT as a,vw as o}from"./loadAgentsDir-Bz0FfcVt.js";import{n as s,t as c}from"./ValidationErrorsList-DprGtB2w.js";e(),r(),o(),s();var l=i();function u({settingsErrors:e,onContinue:r,onExit:i}){function o(e){e===`exit`?i():r()}return(0,l.jsxs)(n,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,l.jsx)(c,{errors:e}),(0,l.jsx)(t,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,l.jsx)(a,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:o})]})}export{u as InvalidSettingsDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./src-DNHWYkls.js";var n=e((()=>{t()}));export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-DNHWYkls.js";import{t as r}from"./jsx-runtime-BTgGEFjL.js";import{n as i,t as a}from"./useManageMCPConnections-bf-VfJGD.js";function o(){let e=(0,l.useContext)(d);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function s(){let e=(0,l.useContext)(d);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function c({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:a}=i(t,n),o=(0,l.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:a}),[r,a]);return(0,u.jsx)(d.Provider,{value:o,children:e})}var l,u,d,f=e((()=>{l=t(n(),1),a(),u=r(),d=(0,l.createContext)(null)}));export{s as i,f as n,o as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,t as i,x as a}from"./src-DNHWYkls.js";import{t as o}from"./jsx-runtime-BTgGEFjL.js";import{o as s,s as c}from"./log-DVv8YiNo.js";import{$g as l,BP as u,C_ as d,Cg as f,FF as p,IF as m,Qg as h,S_ as g,Sg as _,VP as v,XI as y,YI as b,b_ as x,bg as S,cg as C,db as w,dg as T,e_ as E,fg as D,hg as ee,iE as te,lg as O,mg as k,nE as A,n_ as j,og as M,pg as N,r_ as P,sg as F,t_ as I,ub as L,ug as R,v_ as z,vg as B,x_ as V,xg as H,y_ as U,yg as W}from"./loadAgentsDir-Bz0FfcVt.js";import{t as G}from"./useTerminalSize-DzV4aaTi.js";function K({message:e,lookups:t,containerWidth:n,addMargin:r,tools:i,commands:o,verbose:s,inProgressToolUseIDs:c,progressMessagesForMessage:l,shouldAnimate:d,shouldShowDot:f,style:p,width:m,isTranscriptMode:h,onOpenRateLimitOptions:v,isActiveCollapsedGroup:y,isUserContinuation:b=!1,lastThinkingBlockId:x,latestBashOutputUUID:S,shouldCollapseDiffs:w}){switch(e.type){case`attachment`:return(0,Q.jsx)(B,{addMargin:r,attachment:e.attachment,verbose:s,isTranscriptMode:h});case`assistant`:return(0,Q.jsx)(a,{flexDirection:`column`,width:n??`100%`,children:e.message.content.map((n,a)=>(0,Q.jsx)(J,{param:n,addMargin:r,tools:i,commands:o,verbose:s,inProgressToolUseIDs:c,progressMessagesForMessage:l,shouldAnimate:d,shouldShowDot:f,width:m,inProgressToolCallCount:c.size,isTranscriptMode:h,lookups:t,onOpenRateLimitOptions:v,thinkingBlockId:`${e.uuid}:${a}`,lastThinkingBlockId:x,advisorModel:e.advisorModel},a))});case`user`:{if(e.isCompactSummary)return(0,Q.jsx)(g,{message:e,screen:h?`transcript`:`prompt`});let o=[],c=0;for(let t of e.message.content)if(t.type===`image`){let t=e.imagePasteIds?.[c];c++,o.push(t??c)}else o.push(c);let d=S===e.uuid,f=(0,Q.jsx)(a,{flexDirection:`column`,width:n??`100%`,children:e.message.content.map((n,a)=>(0,Q.jsx)(q,{message:e,addMargin:r,tools:i,progressMessagesForMessage:l,param:n,style:p,verbose:s,imageIndex:o[a],isUserContinuation:b,lookups:t,isTranscriptMode:h,shouldCollapseDiffs:w},a))});return d?(0,Q.jsx)(u,{children:f}):f}case`system`:return e.subtype===`compact_boundary`?te()?null:(0,Q.jsx)(D,{}):e.subtype===`microcompact_boundary`?null:e.subtype===`local_command`?(0,Q.jsx)(_,{addMargin:r,param:{type:`text`,text:String(e.content??``)},verbose:s,isTranscriptMode:h}):(0,Q.jsx)(C,{message:e,addMargin:r,verbose:s,isTranscriptMode:h});case`grouped_tool_use`:return(0,Q.jsx)(R,{message:e,tools:i,lookups:t,inProgressToolUseIDs:c,shouldAnimate:d});case`collapsed_read_search`:return(0,Q.jsx)(L,{children:(0,Q.jsx)(k,{message:e,inProgressToolUseIDs:c,shouldAnimate:d,verbose:s||h,tools:i,lookups:t,isActiveGroup:y})})}}function q({message:e,addMargin:t,tools:r,progressMessagesForMessage:i,param:a,style:o,verbose:s,imageIndex:c,isUserContinuation:l,lookups:u,isTranscriptMode:d,shouldCollapseDiffs:f}){let{columns:p}=n();switch(a.type){case`text`:return(0,Q.jsx)(_,{addMargin:t,param:a,verbose:s,planContent:e.planContent,isTranscriptMode:d,timestamp:e.timestamp});case`image`:return(0,Q.jsx)(S,{imageId:c,addMargin:t&&!l});case`tool_result`:return(0,Q.jsx)(M,{param:a,message:e,lookups:u,progressMessagesForMessage:i,style:o,tools:r,verbose:s,width:p-5,isTranscriptMode:d,shouldCollapseDiffs:f});default:return}}function J({param:e,addMargin:t,tools:n,commands:r,verbose:i,inProgressToolUseIDs:a,progressMessagesForMessage:o,shouldAnimate:s,shouldShowDot:l,width:u,inProgressToolCallCount:d,isTranscriptMode:f,lookups:p,onOpenRateLimitOptions:g,thinkingBlockId:_,lastThinkingBlockId:v,advisorModel:b}){if(y(e))return(0,Q.jsx)(j,{param:{type:`text`,text:e.connector_text},addMargin:t,shouldShowDot:l,verbose:i,width:u,onOpenRateLimitOptions:g});switch(e.type){case`tool_use`:return(0,Q.jsx)(h,{param:e,addMargin:t,tools:n,commands:r,verbose:i,inProgressToolUseIDs:a,progressMessagesForMessage:o,shouldAnimate:s,shouldShowDot:l,inProgressToolCallCount:d,lookups:p,isTranscriptMode:f});case`text`:return(0,Q.jsx)(j,{param:e,addMargin:t,shouldShowDot:l,verbose:i,width:u,onOpenRateLimitOptions:g});case`redacted_thinking`:return!f&&!i?null:(0,Q.jsx)(z,{addMargin:t});case`thinking`:return!f&&!i?null:(0,Q.jsx)(E,{addMargin:t,param:e,isTranscriptMode:f,verbose:i,hideInTranscript:f&&!(!v||_===v)});case`server_tool_use`:case`advisor_tool_result`:return m(e)?(0,Q.jsx)(x,{block:e,addMargin:t,resolvedToolUseIDs:p.resolvedToolUseIDs,erroredToolUseIDs:p.erroredToolUseIDs,shouldAnimate:s,verbose:i||f,advisorModel:b}):(c(Error(`Unable to render server tool block: ${e.type}`)),null);default:return c(Error(`Unable to render message type: ${e.type}`)),null}}function Y(e){return e.type!==`assistant`||!e.message?!1:e.message.content.some(e=>e.type===`thinking`||e.type===`redacted_thinking`)}function X(e,t){return e.message.uuid!==t.message.uuid||e.lastThinkingBlockId!==t.lastThinkingBlockId&&Y(t.message)||e.verbose!==t.verbose||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.isTranscriptMode!==t.isTranscriptMode||e.containerWidth!==t.containerWidth?!1:!!(e.isStatic&&t.isStatic)}var Z,Q,$,ne=e((()=>{Z=t(r(),1),G(),i(),b(),p(),A(),s(),d(),V(),U(),P(),I(),l(),W(),ee(),N(),T(),O(),H(),f(),F(),w(),v(),Q=o(),$=Z.memo(K,X)}));export{Y as n,ne as r,$ as t};
|