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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,f as r,t as i}from"./src-DNHWYkls.js";import{t as a}from"./jsx-runtime-BTgGEFjL.js";import{Y as o,Z as s,l as c,m as l,nt as u,q as d,xo as f,yo as p}from"./growthbook-p4aJ_UMv.js";import{n as m,r as h}from"./analytics-i6X1et4O.js";import{Cs as g,RT as _,Ss as v,ws as y,xs as b,zT as x}from"./loadAgentsDir-Bz0FfcVt.js";import{n as S,t as C}from"./extra-usage-7EPJNjNW.js";import{n as w,t as T}from"./claudeAiLimitsHook-ATshVrOH.js";import{n as E,t as D}from"./upgrade-DaaHOvft.js";function O({onDone:e,context:t}){let[n,i]=(0,A.useState)(null),a=w(),l=s(),u=o(),f=d()?.hasExtraUsageEnabled===!0,m=l===`max`&&u===`default_claude_max_20x`,g=l===`team`||l===`enterprise`,v=c(`tengu_jade_anvil_4`,!1),x=(0,A.useMemo)(()=>{let e=[];if(b.isEnabled()){let t=p(),n=g&&!t,r=a.overageDisabledReason===`out_of_credits`||a.overageDisabledReason===`org_level_disabled_until`||a.overageDisabledReason===`org_service_zero_credit_limit`;if(!(n&&r)){let t=a.overageStatus===`rejected`||a.overageStatus===`allowed_warning`,r;r=n?t?`Request more`:`Request extra usage`:f?`Add funds to continue with extra usage`:`Switch to extra usage`,e.push({label:r,value:`extra-usage`})}}!m&&!g&&y.isEnabled()&&e.push({label:`Upgrade your plan`,value:`upgrade`});let t={label:`Stop and wait for limit to reset`,value:`cancel`};return v?[...e,t]:[t,...e]},[v,m,g,f,a.overageStatus,a.overageDisabledReason]);function S(){h(`tengu_rate_limit_options_menu_cancel`,{}),e(void 0,{display:`skip`})}function T(n){n===`upgrade`?(h(`tengu_rate_limit_options_menu_select_upgrade`,{}),D(e,t).then(e=>{e&&i(e)})):n===`extra-usage`?(h(`tengu_rate_limit_options_menu_select_extra_usage`,{}),C(e,t).then(e=>{e&&i(e)})):n===`cancel`&&S()}return n||(0,j.jsx)(r,{title:`What do you want to do?`,onCancel:S,color:`suggestion`,children:(0,j.jsx)(_,{options:x,onChange:T,visibleOptionCount:x.length})})}async function k(e,t){return(0,j.jsx)(O,{onDone:e,context:t})}var A,j;e((()=>{A=t(n(),1),x(),i(),l(),m(),T(),u(),f(),S(),v(),g(),E(),j=a()}))();export{k as call};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-CFG7IQID.js";import{Ht as i,N as a,at as o,ot as s,zn as c}from"./state-CUZTq6r0.js";import{co as l,do as u,lo as d,uo as f}from"./growthbook-p4aJ_UMv.js";import{$ as p,Q as m,U as h,_ as g,h as _,l as v,p as y,z as ee}from"./debug-CjIaNjpK.js";import{M as b,j as te}from"./git-Bj8Ow4pJ.js";import{join as ne}from"node:path";import{appendFileSync as re,existsSync as ie,mkdirSync as ae}from"node:fs";import{homedir as oe}from"node:os";import{randomUUID as x}from"crypto";var se=e((()=>{})),ce,le=e((()=>{ce={input_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,output_tokens:0,server_tool_use:{web_search_requests:0,web_fetch_requests:0},service_tier:`standard`,cache_creation:{ephemeral_1h_input_tokens:0,ephemeral_5m_input_tokens:0},inference_geo:``,iterations:[],speed:`standard`}})),ue=e((()=>{}));function de(e){return e}var fe=e((()=>{})),pe=e((()=>{se(),le(),ue(),fe()}));function me(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function he(e){if(process.env.OPENAI_MODEL)return process.env.OPENAI_MODEL;let t=e.replace(/\[1m\]$/,``),n=me(t);if(n){let e=`OPENAI_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return ge[t]??t}var ge,_e=e((()=>{ge={"claude-sonnet-4-20250514":`gpt-4o`,"claude-sonnet-4-5-20250929":`gpt-4o`,"claude-sonnet-4-6":`gpt-4o`,"claude-opus-4-20250514":`o3`,"claude-opus-4-1-20250805":`o3`,"claude-opus-4-5-20251101":`o3`,"claude-opus-4-6":`o3`,"claude-haiku-4-5-20251001":`gpt-4o-mini`,"claude-3-5-haiku-20241022":`gpt-4o-mini`,"claude-3-7-sonnet-20250219":`gpt-4o`,"claude-3-5-sonnet-20241022":`gpt-4o`}}));function ve(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function ye(){let e=process.env.GROK_MODEL_MAP;if(!e)return null;try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return null}function be(e){if(process.env.GROK_MODEL)return process.env.GROK_MODEL;let t=e.replace(/\[1m\]$/,``),n=ve(t),r=ye();if(r&&n&&r[n])return r[n];if(n){let e=`GROK_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return S[t]?S[t]:n&&C[n]?C[n]:t}var S,C,xe=e((()=>{S={"claude-sonnet-4-20250514":`grok-3-mini-fast`,"claude-sonnet-4-5-20250929":`grok-3-mini-fast`,"claude-sonnet-4-6":`grok-3-mini-fast`,"claude-opus-4-20250514":`grok-4.20-reasoning`,"claude-opus-4-1-20250805":`grok-4.20-reasoning`,"claude-opus-4-5-20251101":`grok-4.20-reasoning`,"claude-opus-4-6":`grok-4.20-reasoning`,"claude-haiku-4-5-20251001":`grok-3-mini-fast`,"claude-3-5-haiku-20241022":`grok-3-mini-fast`,"claude-3-7-sonnet-20250219":`grok-3-mini-fast`,"claude-3-5-sonnet-20241022":`grok-3-mini-fast`},C={opus:`grok-4.20-reasoning`,sonnet:`grok-3-mini-fast`,haiku:`grok-3-mini-fast`}}));function Se(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Ce(e){if(process.env.GEMINI_MODEL)return process.env.GEMINI_MODEL;let t=e.replace(/\[1m\]$/i,``),n=Se(t);if(!n)return t;let r=`GEMINI_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i;let a=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,o=process.env[a];if(o)return o;throw Error(`Gemini provider requires GEMINI_MODEL or ${r} (or ${a} for backward compatibility) to be configured.`)}var we=e((()=>{})),w,Te=e((()=>{w=`_geminiThoughtSignature`}));function T(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Ee(e,t){let n=[],r=new Map;for(let t of e){if(t.type===`assistant`){let e=Ae(t);e.parts.length>0&&n.push(e);let i=t.message.content;if(Array.isArray(i))for(let e of i)typeof e!=`string`&&e.type===`tool_use`&&r.set(e.id,e.name);continue}if(t.type===`user`){let e=Oe(t,r);e.parts.length>0&&n.push(e)}}let i=De(t);return{contents:n,...i?{systemInstruction:{parts:[{text:i}]}}:{}}}function De(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
2
|
+
|
|
3
|
+
`)}function Oe(e,t){let n=e.message.content;return typeof n==`string`?{role:`user`,parts:E(n)}:Array.isArray(n)?{role:`user`,parts:n.flatMap(e=>ke(e,t))}:{role:`user`,parts:[]}}function ke(e,t){if(typeof e==`string`)return E(e);if(e.type===`text`)return E(e.text);if(e.type===`tool_result`){let n=e;return[{functionResponse:{name:t.get(n.tool_use_id)??n.tool_use_id,response:Ne(n)}}]}if(e.type===`image`){let t=e.source;if(t?.type===`base64`&&typeof t.data==`string`)return[{inlineData:{mimeType:t.media_type||`image/png`,data:t.data}}];if(t?.type===`url`&&typeof t.url==`string`)return E(`[image: ${t.url}]`)}return[]}function Ae(e){let t=e.message.content;if(typeof t==`string`)return{role:`model`,parts:E(t)};if(!Array.isArray(t))return{role:`model`,parts:[]};let n=[];for(let e of t){if(typeof e==`string`){n.push(...E(e));continue}if(e.type===`text`){n.push(...E(e.text,D(e)));continue}if(e.type===`thinking`){let t=je(e.thinking,e.signature);t&&n.push(t);continue}if(e.type===`tool_use`){let t=e;n.push({functionCall:{name:t.name,args:Me(t.input)},...D(e)&&{thoughtSignature:D(e)}})}}return{role:`model`,parts:n}}function E(e,t){return typeof e!=`string`||e.length===0?[]:[{text:e,...t&&{thoughtSignature:t}}]}function je(e,t){if(!(typeof e!=`string`||e.length===0))return{text:e,thought:!0,...t&&{thoughtSignature:t}}}function Me(e){if(typeof e==`string`){let t=T(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:t===null?{}:{value:t}}return e&&typeof e==`object`&&!Array.isArray(e)?e:e===void 0?{}:{value:e}}function Ne(e){let t=Pe(e.content);return t&&typeof t==`object`&&!Array.isArray(t)?e.is_error?{...t,is_error:!0}:t:{result:t,...e.is_error?{is_error:!0}:{}}}function Pe(e){if(typeof e==`string`)return T(e)??e;if(Array.isArray(e)){let t=e.map(e=>typeof e==`string`?e:e&&typeof e==`object`&&`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
4
|
+
`);return T(t)??t}return e??``}function D(e){let t=e[w];return typeof t==`string`&&t.length>0?t:void 0}var Fe=e((()=>{Te()}));function Ie(e){if(typeof e==`string`)return k.has(e)?e:void 0;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`&&k.has(e)),n=Array.from(new Set(t));return n.length===0?void 0:n.length===1?n[0]:n}}function Le(e){if(e===null)return`null`;if(Array.isArray(e))return`array`;if(typeof e==`string`)return`string`;if(typeof e==`boolean`)return`boolean`;if(typeof e==`number`)return Number.isInteger(e)?`integer`:`number`;if(typeof e==`object`)return`object`}function Re(e){let t=e.map(Le).filter(e=>e!==void 0),n=Array.from(new Set(t));if(n.length!==0)return n.length===1?n[0]:n}function ze(e){return e===void 0?[`null`]:Array.isArray(e)?e.includes(`null`)?e:[...e,`null`]:e===`null`?e:[e,`null`]}function Be(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=Object.entries(e).map(([e,t])=>[e,O(t)]).filter(([,e])=>Object.keys(e).length>0);if(t.length!==0)return Object.fromEntries(t)}function Ve(e){if(!Array.isArray(e))return;let t=e.map(e=>O(e)).filter(e=>Object.keys(e).length>0);return t.length>0?t:void 0}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n={},r=Ie(t.type);t.const===void 0?Array.isArray(t.enum)&&t.enum.length>0&&(n.enum=t.enum,r=r??Re(t.enum)):(n.enum=[t.const],r=r??Le(t.const)),r||(t.properties&&typeof t.properties==`object`?r=`object`:(t.items!==void 0||t.prefixItems!==void 0)&&(r=`array`)),t.nullable===!0&&(r=ze(r)),r&&(n.type=r),typeof t.title==`string`&&(n.title=t.title),typeof t.description==`string`&&(n.description=t.description),typeof t.format==`string`&&(n.format=t.format),typeof t.pattern==`string`&&(n.pattern=t.pattern),typeof t.minimum==`number`?n.minimum=t.minimum:typeof t.exclusiveMinimum==`number`&&(n.minimum=t.exclusiveMinimum),typeof t.maximum==`number`?n.maximum=t.maximum:typeof t.exclusiveMaximum==`number`&&(n.maximum=t.exclusiveMaximum),typeof t.minItems==`number`&&(n.minItems=t.minItems),typeof t.maxItems==`number`&&(n.maxItems=t.maxItems),typeof t.minLength==`number`&&(n.minLength=t.minLength),typeof t.maxLength==`number`&&(n.maxLength=t.maxLength),typeof t.minProperties==`number`&&(n.minProperties=t.minProperties),typeof t.maxProperties==`number`&&(n.maxProperties=t.maxProperties);let i=Be(t.properties);if(i&&(n.properties=i,n.propertyOrdering=Object.keys(i)),Array.isArray(t.required)){let e=t.required.filter(e=>typeof e==`string`);e.length>0&&(n.required=e)}if(typeof t.additionalProperties==`boolean`)n.additionalProperties=t.additionalProperties;else{let e=O(t.additionalProperties);Object.keys(e).length>0&&(n.additionalProperties=e)}let a=O(t.items);Object.keys(a).length>0&&(n.items=a);let o=Ve(t.prefixItems);o&&(n.prefixItems=o);let s=Ve(t.anyOf??t.oneOf);return s&&(n.anyOf=s),n}function He(e){let t=O(e);return Object.keys(t).length>0?t:{type:`object`,properties:{}}}function Ue(e){let t=e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e;return{name:t.name||``,description:t.description||``,parametersJsonSchema:He(t.input_schema??{type:`object`,properties:{}})}});return t.length>0?[{functionDeclarations:t}]:[]}function We(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return{mode:`AUTO`};case`any`:return{mode:`ANY`};case`tool`:return{mode:`ANY`,allowedFunctionNames:typeof t.name==`string`?[t.name]:void 0};default:return}}var k,Ge=e((()=>{k=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`])}));async function*Ke(e,t){let n=`msg_${x().replace(/-/g,``).slice(0,24)}`,r=!1,i=!1,a=0,o=null,s=!1,c,l=0,u=0,d=0;for await(let i of e){let e=i.usageMetadata;e&&(l=e.promptTokenCount??l,u=(e.candidatesTokenCount??0)+(e.thoughtsTokenCount??0),d=e.cachedContentTokenCount??d),r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:l,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:d}}});let f=i.candidates?.[0],p=f?.content?.parts??[];for(let e of p){if(e.functionCall){o&&(yield{type:`content_block_stop`,index:o.index},o=null),s=!0;let t=a++;yield{type:`content_block_start`,index:t,content_block:{type:`tool_use`,id:`toolu_${x().replace(/-/g,``).slice(0,24)}`,name:e.functionCall.name||``,input:{}}},e.thoughtSignature&&(yield{type:`content_block_delta`,index:t,delta:{type:`signature_delta`,signature:e.thoughtSignature}}),e.functionCall.args&&Object.keys(e.functionCall.args).length>0&&(yield{type:`content_block_delta`,index:t,delta:{type:`input_json_delta`,partial_json:JSON.stringify(e.functionCall.args)}}),yield{type:`content_block_stop`,index:t};continue}let t=qe(e);if(t){(!o||o.type!==t)&&(o&&(yield{type:`content_block_stop`,index:o.index}),o={index:a++,type:t},yield{type:`content_block_start`,index:o.index,content_block:t===`thinking`?{type:`thinking`,thinking:``,signature:``}:{type:`text`,text:``}}),e.text&&(yield{type:`content_block_delta`,index:o.index,delta:t===`thinking`?{type:`thinking_delta`,thinking:e.text}:{type:`text_delta`,text:e.text}}),e.thoughtSignature&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}});continue}e.thoughtSignature&&o&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}})}f?.finishReason&&(c=f.finishReason)}r&&(o&&(yield{type:`content_block_stop`,index:o.index}),i||(yield{type:`message_delta`,delta:{stop_reason:Je(c,s),stop_sequence:null},usage:{input_tokens:l,output_tokens:u,cache_creation_input_tokens:0,cache_read_input_tokens:d}},yield{type:`message_stop`},i=!0))}function qe(e){return typeof e.text==`string`?e.thought?`thinking`:`text`:null}function Je(e,t){switch(e){case`MAX_TOKENS`:return`max_tokens`;default:return t?`tool_use`:`end_turn`}}var Ye=e((()=>{}));function A(e){if(!e||typeof e!=`object`)return null;let t=e,n=0;for(;t&&n<5;){if(t instanceof Error&&`code`in t&&typeof t.code==`string`){let e=t.code,n=tt.has(e);return{code:e,message:t.message,isSSLError:n}}if(t instanceof Error&&`cause`in t&&t.cause!==t)t=t.cause,n++;else break}return null}function Xe(e){let t=A(e);return t?.isSSLError?`SSL certificate error (${t.code}). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run /doctor for details.`:null}function j(e){if(e.includes(`<!DOCTYPE html`)||e.includes(`<html`)){let t=e.match(/<title>([^<]+)<\/title>/);return t&&t[1]?t[1].trim():``}return e}function Ze(e){let t=e.message;return t?j(t):``}function Qe(e){return typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null}function $e(e){if(!Qe(e))return null;let t=e.error,n=t?.error?.message;if(typeof n==`string`&&n.length>0){let e=j(n);if(e.length>0)return e}let r=t?.message;if(typeof r==`string`&&r.length>0){let e=j(r);if(e.length>0)return e}return null}function et(e){let t=A(e);if(t){let{code:e,isSSLError:n}=t;if(e===`ETIMEDOUT`)return`Request timed out. Check your internet connection and proxy settings`;if(n)switch(e){case`UNABLE_TO_VERIFY_LEAF_SIGNATURE`:case`UNABLE_TO_GET_ISSUER_CERT`:case`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`:return`Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates`;case`CERT_HAS_EXPIRED`:return`Unable to connect to API: SSL certificate has expired`;case`CERT_REVOKED`:return`Unable to connect to API: SSL certificate has been revoked`;case`DEPTH_ZERO_SELF_SIGNED_CERT`:case`SELF_SIGNED_CERT_IN_CHAIN`:return`Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates`;case`ERR_TLS_CERT_ALTNAME_INVALID`:case`HOSTNAME_MISMATCH`:return`Unable to connect to API: SSL certificate hostname mismatch`;case`CERT_NOT_YET_VALID`:return`Unable to connect to API: SSL certificate is not yet valid`;default:return`Unable to connect to API: SSL error (${e})`}}if(e.message===`Connection error.`)return t?.code?`Unable to connect to API (${t.code})`:`Unable to connect to API. Check your internet connection`;if(!e.message)return $e(e)??`API error (status ${e.status??`unknown`})`;let n=Ze(e);return n!==e.message&&n.length>0?n:e.message}var tt,nt=e((()=>{tt=new Set([`UNABLE_TO_VERIFY_LEAF_SIGNATURE`,`UNABLE_TO_GET_ISSUER_CERT`,`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`,`CERT_SIGNATURE_FAILURE`,`CERT_NOT_YET_VALID`,`CERT_HAS_EXPIRED`,`CERT_REVOKED`,`CERT_REJECTED`,`CERT_UNTRUSTED`,`DEPTH_ZERO_SELF_SIGNED_CERT`,`SELF_SIGNED_CERT_IN_CHAIN`,`CERT_CHAIN_TOO_LONG`,`PATH_LENGTH_EXCEEDED`,`ERR_TLS_CERT_ALTNAME_INVALID`,`HOSTNAME_MISMATCH`,`ERR_TLS_HANDSHAKE_TIMEOUT`,`ERR_SSL_WRONG_VERSION_NUMBER`,`ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC`])}));function rt(e,t,n){let r=[],i=it(t);i&&r.push({role:`system`,content:i});for(let t of e)switch(t.type){case`user`:r.push(...at(t));break;case`assistant`:r.push(...st(t));break;default:break}return r}function it(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
5
|
+
|
|
6
|
+
`)}function at(e){let t=[],n=e.message.content;if(typeof n==`string`)t.push({role:`user`,content:n});else if(Array.isArray(n)){let e=[],r=[],i=[];for(let t of n)if(typeof t==`string`)e.push(t);else if(t.type===`text`)e.push(t.text);else if(t.type===`tool_result`)r.push(t);else if(t.type===`image`){let e=ct(t);e&&i.push(e)}for(let e of r)t.push(ot(e));if(i.length>0){let n=[];e.length>0&&n.push({type:`text`,text:e.join(`
|
|
7
|
+
`)}),n.push(...i),t.push({role:`user`,content:n})}else e.length>0&&t.push({role:`user`,content:e.join(`
|
|
8
|
+
`)})}return t}function ot(e){let t;return t=typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.map(e=>typeof e==`string`?e:`text`in e?e.text:``).filter(Boolean).join(`
|
|
9
|
+
`):``,{role:`tool`,tool_call_id:e.tool_use_id,content:t}}function st(e){let t=e.message.content;if(typeof t==`string`)return[{role:`assistant`,content:t}];if(!Array.isArray(t))return[{role:`assistant`,content:``}];let n=[],r=[],i=[];for(let e of t)if(typeof e==`string`)n.push(e);else if(e.type===`text`)n.push(e.text);else if(e.type===`tool_use`){let t=e;r.push({id:t.id,type:`function`,function:{name:t.name,arguments:typeof t.input==`string`?t.input:JSON.stringify(t.input)}})}else if(e.type===`thinking`){let t=e.thinking;typeof t==`string`&&i.push(t)}return[{role:`assistant`,content:n.length>0?n.join(`
|
|
10
|
+
`):null,...r.length>0&&{tool_calls:r},...i.length>0&&{reasoning_content:i.join(`
|
|
11
|
+
`)}}]}function ct(e){let t=e.source;return t?t.type===`base64`&&typeof t.data==`string`?{type:`image_url`,image_url:{url:`data:${t.media_type||`image/png`};base64,${t.data}`}}:t.type===`url`&&typeof t.url==`string`?{type:`image_url`,image_url:{url:t.url}}:null:null}var lt=e((()=>{}));function ut(e){return e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e,n=t.name||``,r=t.description||``,i=t.input_schema;return{type:`function`,function:{name:n,description:r,parameters:M(i||{type:`object`,properties:{}})}}})}function M(e){if(!e||typeof e!=`object`)return e;let t={...e};`const`in t&&(t.enum=[t.const],delete t.const);for(let e of[`properties`,`definitions`,`$defs`,`patternProperties`]){let n=t[e];if(n&&typeof n==`object`){let r={};for(let[e,t]of Object.entries(n))r[e]=t&&typeof t==`object`?M(t):t;t[e]=r}}for(let e of[`items`,`additionalProperties`,`not`,`if`,`then`,`else`,`contains`,`propertyNames`]){let n=t[e];n&&typeof n==`object`&&!Array.isArray(n)&&(t[e]=M(n))}for(let e of[`anyOf`,`oneOf`,`allOf`]){let n=t[e];Array.isArray(n)&&(t[e]=n.map(e=>e&&typeof e==`object`?M(e):e))}return t}function dt(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return`auto`;case`any`:return`required`;case`tool`:return{type:`function`,function:{name:t.name}};default:return}}var ft=e((()=>{}));function N(e){let t=Math.max(0,e.totalInputTokens),n=Math.min(Math.max(0,e.cacheReadTokens??0),t),r=Math.max(0,t-n),i=Math.min(Math.max(0,e.cacheWriteTokens??0),r);return{input_tokens:Math.max(0,r-i),output_tokens:Math.max(0,e.outputTokens),cache_creation_input_tokens:i,cache_read_input_tokens:n}}var pt=e((()=>{}));async function*mt(e,t,n){let r=`msg_${x().replace(/-/g,``).slice(0,24)}`,i=!1,a=-1,o=new Map,s=!1,c=!1,l=0,u=0,d=0,f=0,p=N({totalInputTokens:0,outputTokens:0}),m=new Set,h=null,g=!1;for await(let _ of e){let e=_.choices?.[0],v=e?.delta;if(_.usage){l=_.usage.prompt_tokens??l,u=_.usage.completion_tokens??u;let e=_.usage.prompt_tokens_details,t=e&&typeof e==`object`?e:void 0;typeof t?.cached_tokens==`number`&&(d=t.cached_tokens),n?.includeCacheWriteTokens&&typeof t?.cache_write_tokens==`number`?f=t.cache_write_tokens:n?.includeCacheWriteTokens||(f=0),p=N({totalInputTokens:l,outputTokens:u,cacheReadTokens:d,cacheWriteTokens:f})}if(i||(i=!0,yield{type:`message_start`,message:{id:r,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{...p,output_tokens:0}}}),!v)continue;let y=v.reasoning_content;if(y!=null&&(s||(a++,s=!0,m.add(a),yield{type:`content_block_start`,index:a,content_block:{type:`thinking`,thinking:``,signature:``}}),y!==``&&(yield{type:`content_block_delta`,index:a,delta:{type:`thinking_delta`,thinking:y}})),v.content!=null&&v.content!==``&&(c||(s&&(yield{type:`content_block_stop`,index:a},m.delete(a),s=!1),a++,c=!0,m.add(a),yield{type:`content_block_start`,index:a,content_block:{type:`text`,text:``}}),yield{type:`content_block_delta`,index:a,delta:{type:`text_delta`,text:v.content}}),v.tool_calls)for(let e of v.tool_calls){let t=e.index;if(!o.has(t)){s&&(yield{type:`content_block_stop`,index:a},m.delete(a),s=!1),c&&(yield{type:`content_block_stop`,index:a},m.delete(a),c=!1),a++;let n=e.id||`toolu_${x().replace(/-/g,``).slice(0,24)}`,r=e.function?.name||``;o.set(t,{contentIndex:a,id:n,name:r,arguments:``}),m.add(a),yield{type:`content_block_start`,index:a,content_block:{type:`tool_use`,id:n,name:r,input:{}}}}let n=e.function?.arguments;n&&(o.get(t).arguments+=n,yield{type:`content_block_delta`,index:o.get(t).contentIndex,delta:{type:`input_json_delta`,partial_json:n}})}if(e?.finish_reason){s&&(yield{type:`content_block_stop`,index:a},m.delete(a),s=!1),c&&(yield{type:`content_block_stop`,index:a},m.delete(a),c=!1);for(let[,e]of o)m.has(e.contentIndex)&&(yield{type:`content_block_stop`,index:e.contentIndex},m.delete(e.contentIndex));h=e.finish_reason,g=o.size>0}}for(let e of m)yield{type:`content_block_stop`,index:e};h!==null&&(yield{type:`message_delta`,delta:{stop_reason:h===`length`?`max_tokens`:g?`tool_use`:ht(h),stop_sequence:null},usage:p},yield{type:`message_stop`})}function ht(e){switch(e){case`stop`:return`end_turn`;case`tool_calls`:return`tool_use`;case`length`:return`max_tokens`;case`content_filter`:return`end_turn`;default:return`end_turn`}}var gt=e((()=>{pt()})),_t=e((()=>{pe(),_e(),xe(),we(),Fe(),Ge(),Ye(),Te(),nt(),lt(),ft(),gt(),pt()}));function vt(e){a()&&(P.length>=xt&&P.shift(),P.push(e))}function yt(){return P.length===0?[]:P.splice(0).map(e=>({...e,uuid:x(),session_id:o()}))}function bt(e,t,n){vt({type:`system`,subtype:`task_notification`,task_id:e,tool_use_id:n?.toolUseId,status:t,output_file:n?.outputFile??``,summary:n?.summary??``,usage:n?.usage})}var xt,P,St=e((()=>{i(),xt=1e3,P=[]}));function Ct(){let e=s();if(e!==void 0)return e;let t=process.env.CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR;if(!t){let e=u(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return c(e),e}let n=parseInt(t,10);if(Number.isNaN(n))return y(`CLAUDE_CODE_WEBSOCKET_AUTH_FILE_DESCRIPTOR must be a valid file descriptor number, got: ${t}`,{level:`error`}),c(null),null;try{let e=_(),t=process.platform===`darwin`||process.platform===`freebsd`?`/dev/fd/${n}`:`/proc/self/fd/${n}`,r=e.readFileSync(t,{encoding:`utf8`}).trim();return r?(y(`Successfully read token from file descriptor ${n}`),c(r),f(l,r,`session ingress token`),r):(y(`File descriptor contained empty token`,{level:`error`}),c(null),null)}catch(e){y(`Failed to read token from file descriptor ${n}: ${ee(e)}`,{level:`error`});let t=u(process.env.CLAUDE_SESSION_INGRESS_TOKEN_FILE??l,`session ingress token`);return c(t),t}}function wt(){return process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN||Ct()}function Tt(){let e=wt();if(!e)return{};if(e.startsWith(`sk-ant-sid`)){let t={Cookie:`sessionKey=${e}`},n=process.env.CLAUDE_CODE_ORGANIZATION_UUID;return n&&(t[`X-Organization-Uuid`]=n),t}return{Authorization:`Bearer ${e}`}}function Et(e){process.env.CLAUDE_CODE_SESSION_ACCESS_TOKEN=e}var Dt=e((()=>{i(),d(),v(),h(),g()}));function Ot(){F(),V=setInterval(()=>{b(`debug`,`session_keepalive_heartbeat`,{refcount:R}),r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&L?.()},I)}function kt(){F(),L!==null&&(H=setTimeout(()=>{b(`info`,`session_idle_30s`),H=null},I))}function F(){H!==null&&(clearTimeout(H),H=null)}function At(e){L=e,R>0&&V===null&&Ot()}function jt(){L=null,V!==null&&(clearInterval(V),V=null),F()}function Mt(){r(process.env.CLAUDE_CODE_REMOTE_SEND_KEEPALIVES)&&L?.()}function Nt(){return L!==null}function Pt(e){R++,z.set(e,(z.get(e)??0)+1),R===1&&(B=Date.now(),L!==null&&V===null&&Ot()),U||(U=!0,p(async()=>{b(`info`,`session_activity_at_shutdown`,{refcount:R,active:Object.fromEntries(z),oldest_activity_ms:R>0&&B!==null?Date.now()-B:null})}))}function Ft(e){R>0&&R--;let t=(z.get(e)??0)-1;t>0?z.set(e,t):z.delete(e),R===0&&V!==null&&(clearInterval(V),V=null,kt())}var I,L,R,z,B,V,H,U,It=e((()=>{m(),te(),n(),I=3e4,L=null,R=0,z=new Map,B=null,V=null,H=null,U=!1})),Lt=t({activateProactive:()=>zt,deactivateProactive:()=>Bt,getActivationSource:()=>qt,getNextTickAt:()=>Kt,isContextBlocked:()=>Wt,isProactiveActive:()=>Rt,isProactivePaused:()=>G,pauseProactive:()=>Vt,resumeProactive:()=>Ht,setContextBlocked:()=>Ut,setNextTickAt:()=>Gt,shouldTick:()=>Yt,subscribeToProactiveChanges:()=>Jt});function W(){for(let e of Z)try{e()}catch{}}function Rt(){return K}function zt(e){K||(K=!0,q=!1,J=!1,X=e,W())}function Bt(){K&&(K=!1,q=!1,J=!1,Y=null,X=void 0,W())}function G(){return q}function Vt(){!K||q||(q=!0,Y=null,W())}function Ht(){!K||!q||(q=!1,W())}function Ut(e){J!==e&&(J=e,e&&(Y=null),W())}function Wt(){return J}function Gt(e){Y=e,W()}function Kt(){return!K||q||J?null:Y}function qt(){return X}function Jt(e){return Z.add(e),()=>{Z.delete(e)}}function Yt(){return K&&!q&&!J}var K,q,J,Y,X,Z,Xt=e((()=>{K=!1,q=!1,J=!1,Y=null,Z=new Set}));function Zt(){let e=ne(oe(),`.zaniicode`);ie(e)||ae(e,{recursive:!0})}function Qt(e){try{$||(Zt(),re(Q,`\n===== RC-DEBUG session ${new Date().toISOString()} =====\n`),$=!0),re(Q,`[${new Date().toISOString().slice(11,23)}] ${e}\n`)}catch{}}var Q,$,$t=e((()=>{Q=ne(oe(),`.zaniicode`,`rc-debug.log`),$=!1}));export{rt as A,be as B,vt as C,N as D,mt as E,We as F,de as H,Ue as I,Ee as L,et as M,Xe as N,dt as O,Ke as P,w as R,bt as S,_t as T,ce as U,he as V,Tt as _,Rt as a,Et as b,Gt as c,Nt as d,At as f,jt as g,Ft as h,Wt as i,A as j,ut as k,Yt as l,Pt as m,Qt as n,G as o,Mt as p,Xt as r,Lt as s,$t as t,It as u,wt as v,St as w,yt as x,Dt as y,Ce as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-Zh7qGPze.js";import{Z as r,_s as i,ls as a,nt as o,q as s,st as c,xs as l}from"./growthbook-p4aJ_UMv.js";import{l as u,p as d}from"./debug-CjIaNjpK.js";import{n as f,r as p}from"./privacyLevel-CRCHhztk.js";import{o as m,s as h}from"./log-DVv8YiNo.js";import{l as g,u as _}from"./oauth-DMPGYAoZ.js";import{a as v,l as y,o as b}from"./api-YHYC4Zdk.js";async function x(e=`claude_code_guest_pass`){let{accessToken:n,orgUUID:r}=await y(),i={...v(n),"x-organization-uuid":r},a=`${g().BASE_API_URL}/api/oauth/organizations/${r}/referral/eligibility`;return(await t.get(a,{headers:i,params:{campaign:e},timeout:5e3})).data}async function S(e=`claude_code_guest_pass`){let{accessToken:n,orgUUID:r}=await y(),i={...v(n),"x-organization-uuid":r},a=`${g().BASE_API_URL}/api/oauth/organizations/${r}/referral/redemptions`;return(await t.get(a,{headers:i,params:{campaign:e},timeout:1e4})).data}function C(){return!!(s()?.organizationUuid&&c()&&r()===`max`)}function w(){if(!C())return{eligible:!1,needsRefresh:!1,hasCache:!1};let e=s()?.organizationUuid;if(!e)return{eligible:!1,needsRefresh:!1,hasCache:!1};let t=a().passesEligibilityCache?.[e];if(!t)return{eligible:!1,needsRefresh:!0,hasCache:!1};let{eligible:n,timestamp:r}=t;return{eligible:n,needsRefresh:Date.now()-r>j,hasCache:!0}}function T(e){let t=N[e.currency]??`${e.currency} `,n=e.amount_minor_units/100;return`${t}${n%1==0?n.toString():n.toFixed(2)}`}function E(){let e=s()?.organizationUuid;return e?a().passesEligibilityCache?.[e]?.referrer_reward??null:null}function D(){let e=s()?.organizationUuid;return e?a().passesEligibilityCache?.[e]?.remaining_passes??null:null}async function O(){if(M)return d(`Passes: Reusing in-flight eligibility fetch`),M;let e=s()?.organizationUuid;return e?(M=(async()=>{try{let t=await x(),n={...t,timestamp:Date.now()};return l(t=>({...t,passesEligibilityCache:{...t.passesEligibilityCache,[e]:n}})),d(`Passes eligibility cached for org ${e}: ${t.eligible}`),t}catch(e){return d(`Failed to fetch and cache passes eligibility`),h(e),null}finally{M=null}})(),M):null}async function k(){if(!C())return null;let e=s()?.organizationUuid;if(!e)return null;let t=a().passesEligibilityCache?.[e],n=Date.now();if(!t)return d(`Passes: No cache, fetching eligibility in background (command unavailable this session)`),O(),null;if(n-t.timestamp>j){d(`Passes: Cache stale, returning cached data and refreshing in background`),O();let{timestamp:e,...n}=t;return n}d(`Passes: Using fresh cached eligibility data`);let{timestamp:r,...i}=t;return i}async function A(){p()||k()}var j,M,N,P=e((()=>{n(),_(),o(),i(),u(),m(),f(),b(),j=1440*60*1e3,M=null,N={USD:`$`,EUR:`€`,GBP:`£`,BRL:`R$`,CAD:`CA$`,AUD:`A$`,NZD:`NZ$`,SGD:`S$`}}));export{E as a,A as c,k as i,S as n,D as o,T as r,P as s,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ht as t,K as n}from"./state-CUZTq6r0.js";import{U as r,l as i,p as a,z as o}from"./debug-CjIaNjpK.js";import{o as s,s as c}from"./log-DVv8YiNo.js";import{Ds as l,Os as u,Sb as d,So as f,XC as p,ZC as m,_v as h,_y as g,hv as _,hy as v,i as y,mO as b,o as x,pO as S,va as C,xb as w,xo as T,ya as E}from"./loadAgentsDir-Bz0FfcVt.js";async function D(e){a(`refreshActivePlugins: clearing all plugin caches`),T(),v();let t=await E(),[r,i]=await Promise.all([l(),y(n())]),{enabled:s,disabled:u,errors:f}=t,[p,g]=await Promise.all([Promise.all(s.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await b(e,f);return t&&(e.mcpServers=t),t?Object.keys(t).length:0})),Promise.all(s.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await d(e,f);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),_=p.reduce((e,t)=>e+t,0),x=g.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:s,disabled:u,commands:r,errors:O(e.plugins.errors,f),needsRefresh:!1},agentDefinitions:i,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),h();let S=!1;try{await m()}catch(e){S=!0,c(e),a(`refreshActivePlugins: loadPluginHooks failed: ${o(e)}`)}let C=s.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return a(`refreshActivePlugins: ${s.length} enabled, ${r.length} commands, ${i.allAgents.length} agents, ${C} hooks, ${_} MCP, ${x} LSP`),{enabled_count:s.length,disabled_count:u.length,command_count:r.length,agent_count:i.allAgents.length,hook_count:C,mcp_count:_,lsp_count:x,error_count:f.length+ +!!S,agentDefinitions:i,pluginCommands:r}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{t(),_(),x(),i(),r(),s(),f(),u(),p(),w(),S(),g(),C()}));export{D as n,A as t};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-CFG7IQID.js";import{Gs as i,Ms as a,ar as o,sr as s}from"./growthbook-p4aJ_UMv.js";import{B as c,U as l,l as u,p as d}from"./debug-CjIaNjpK.js";import{r as f,t as p}from"./execFileNoThrow-DdmR1mBS.js";import{n as m,t as h}from"./which-C0ex-06E.js";import{d as g,f as _}from"./stringUtils-U7kMYMJq.js";import{a as v,r as y,t as b}from"./xdg-BaVL-FHd.js";import{n as x,t as S}from"./sanitization-CIBpY9KT.js";import*as C from"os";import*as w from"path";import{promises as T}from"fs";function E(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}function D(e){let t=e.startsWith(`claude-cli://`)?e:e.startsWith(`claude-cli:`)?e.replace(`${O}:`,`${O}://`):null;if(!t)throw Error(`Invalid deep link: expected ${O}:// scheme, got "${e}"`);let n;try{n=new URL(t)}catch{throw Error(`Invalid deep link URL: "${e}"`)}if(n.hostname!==`open`)throw Error(`Unknown deep link action: "${n.hostname}"`);let r=n.searchParams.get(`cwd`)??void 0,i=n.searchParams.get(`repo`)??void 0,a=n.searchParams.get(`q`);if(r&&!r.startsWith(`/`)&&!/^[a-zA-Z]:[/\\]/.test(r))throw Error(`Invalid cwd in deep link: must be an absolute path, got "${r}"`);if(r&&E(r))throw Error(`Deep link cwd contains disallowed control characters`);if(r&&r.length>j)throw Error(`Deep link cwd exceeds ${j} characters (got ${r.length})`);if(i&&!k.test(i))throw Error(`Invalid repo in deep link: expected "owner/repo", got "${i}"`);let o;if(a&&a.trim().length>0){if(o=x(a.trim()),E(o))throw Error(`Deep link query contains disallowed control characters`);if(o.length>A)throw Error(`Deep link query exceeds ${A} characters (got ${o.length})`)}return{query:o,cwd:r,repo:i}}var O,k,A,j,M=e((()=>{S(),O=`claude-cli`,k=/^[\w.-]+\/[\w.-]+$/,A=5e3,j=4096})),N=t({MACOS_BUNDLE_ID:()=>W,ensureDeepLinkProtocolRegistered:()=>U,isProtocolHandlerCurrent:()=>H,registerProtocolHandler:()=>B});function P(){return w.join(y(),`applications`,K)}function F(e){return`Exec="${e}" --handle-uri %u`}function I(e){return`"${e}" --handle-uri "%1"`}async function L(e){let t=w.join(q,`Contents`);try{await T.rm(q,{recursive:!0})}catch(e){if(c(e)!==`ENOENT`)throw e}await T.mkdir(w.dirname(J),{recursive:!0});let n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleIdentifier</key>
|
|
6
|
+
<string>${W}</string>
|
|
7
|
+
<key>CFBundleName</key>
|
|
8
|
+
<string>${G}</string>
|
|
9
|
+
<key>CFBundleExecutable</key>
|
|
10
|
+
<string>claude</string>
|
|
11
|
+
<key>CFBundleVersion</key>
|
|
12
|
+
<string>1.0</string>
|
|
13
|
+
<key>CFBundlePackageType</key>
|
|
14
|
+
<string>APPL</string>
|
|
15
|
+
<key>LSBackgroundOnly</key>
|
|
16
|
+
<true/>
|
|
17
|
+
<key>CFBundleURLTypes</key>
|
|
18
|
+
<array>
|
|
19
|
+
<dict>
|
|
20
|
+
<key>CFBundleURLName</key>
|
|
21
|
+
<string>Claude Code Deep Link</string>
|
|
22
|
+
<key>CFBundleURLSchemes</key>
|
|
23
|
+
<array>
|
|
24
|
+
<string>${O}</string>
|
|
25
|
+
</array>
|
|
26
|
+
</dict>
|
|
27
|
+
</array>
|
|
28
|
+
</dict>
|
|
29
|
+
</plist>`;await T.writeFile(w.join(t,`Info.plist`),n),await T.symlink(e,J),await p(`/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister`,[`-R`,q],{useCwd:!1}),d(`Registered ${O}:// protocol handler at ${q}`)}async function R(e){await T.mkdir(w.dirname(P()),{recursive:!0});let t=`[Desktop Entry]
|
|
30
|
+
Name=${G}
|
|
31
|
+
Comment=Handle ${O}:// deep links for Claude Code
|
|
32
|
+
${F(e)}
|
|
33
|
+
Type=Application
|
|
34
|
+
NoDisplay=true
|
|
35
|
+
MimeType=x-scheme-handler/${O};
|
|
36
|
+
`;await T.writeFile(P(),t);let n=await m(`xdg-mime`);if(n){let{code:e}=await p(n,[`default`,K,`x-scheme-handler/${O}`],{useCwd:!1});if(e!==0)throw Object.assign(Error(`xdg-mime exited with code ${e}`),{code:`XDG_MIME_FAILED`})}d(`Registered ${O}:// protocol handler at ${P()}`)}async function z(e){for(let t of[[`add`,Y,`/ve`,`/d`,`URL:${G}`,`/f`],[`add`,Y,`/v`,`URL Protocol`,`/d`,``,`/f`],[`add`,X,`/ve`,`/d`,I(e),`/f`]]){let{code:e}=await p(`reg`,t,{useCwd:!1});if(e!==0)throw Object.assign(Error(`reg add exited with code ${e}`),{code:`REG_FAILED`})}d(`Registered ${O}:// protocol handler in Windows registry`)}async function B(e){let t=e??await V();switch(process.platform){case`darwin`:await L(t);break;case`linux`:await R(t);break;case`win32`:await z(t);break;default:throw Error(`Unsupported platform: ${process.platform}`)}}async function V(){let e=process.platform===`win32`?`claude.exe`:`claude`,t=w.join(b(),e);try{return await T.realpath(t),t}catch{return process.execPath}}async function H(e){try{switch(process.platform){case`darwin`:return await T.readlink(J)===e;case`linux`:return(await T.readFile(P(),`utf8`)).includes(F(e));case`win32`:{let{stdout:t,code:n}=await p(`reg`,[`query`,X,`/ve`],{useCwd:!1});return n===0&&t.includes(I(e))}default:return!1}}catch{return!1}}async function U(){if(a().disableDeepLinkRegistration===`disable`||!o(`tengu_lodestone_enabled`,!1))return;let e=await V();if(await H(e))return;let t=w.join(n(),`.deep-link-register-failed`);try{let e=await T.stat(t);if(Date.now()-e.mtimeMs<Z)return}catch{}try{await B(e),_(`tengu_deep_link_registered`,{success:!0}),d(`Auto-registered claude-cli:// deep link protocol handler`),await T.rm(t,{force:!0}).catch(()=>{})}catch(e){let n=c(e);_(`tengu_deep_link_registered`,{success:!1,error_code:n}),d(`Failed to auto-register deep link protocol handler: ${e instanceof Error?e.message:String(e)}`,{level:`warn`}),(n===`EACCES`||n===`ENOSPC`)&&await T.writeFile(t,``).catch(()=>{})}}var W,G,K,q,J,Y,X,Z,Q=e((()=>{M(),s(),g(),u(),r(),l(),f(),i(),h(),v(),W=`com.anthropic.claude-code-url-handler`,G=`Claude Code URL Handler`,K=`claude-code-url-handler.desktop`,q=w.join(C.homedir(),`Applications`,`Claude Code URL Handler.app`),J=w.join(q,`Contents`,`MacOS`,`claude`),Y=`HKEY_CURRENT_USER\\Software\\Classes\\${O}`,X=`${Y}\\shell\\open\\command`,Z=1440*60*1e3}));export{D as a,M as i,Q as n,N as r,W as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{ll as t,ul as n}from"./growthbook-p4aJ_UMv.js";import{l as r,p as i}from"./debug-CjIaNjpK.js";import{Hb as a,Ub as o,Wb as s}from"./loadAgentsDir-Bz0FfcVt.js";var c,l=e((()=>{c=`(no content)`}));function u(e,n,r,o,c){let l=0;for(let u of t){let t=r[u];if(t)for(let r of t)for(let t of r.hooks){let d=t.once?()=>{i(`Removing one-shot hook for event ${u} in skill '${o}'`),s(e,n,u,t)}:void 0;a(e,n,u,r.matcher||``,t,d,c),l++}}l>0&&i(`Registered ${l} hooks from skill '${o}'`)}var d=e((()=>{n(),r(),o()}));export{l as i,u as n,c as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ap as e,Cp as t,Dp as n,Ep as r,Fp as i,Ip as a,Lp as o,Mp as s,Np as c,Op as l,Pp as u,Tp as d,jp as f,kp as p,wp as m}from"./loadAgentsDir-Bz0FfcVt.js";f();export{t as detectAndGetBackend,m as ensureBackendsRegistered,d as getBackendByType,r as getCachedBackend,n as getCachedDetectionResult,l as getInProcessBackend,p as getResolvedTeammateMode,e as getTeammateExecutor,s as isInProcessEnabled,c as markInProcessFallback,u as registerITermBackend,i as registerTmuxBackend,a as registerWindowsTerminalBackend,o as resetBackendDetection};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{a as t,i as n,r,s as i,t as a}from"./releaseNotes-DveQShyB.js";function o(e){return e.map(([e,t])=>`${`Version ${e}:`}\n${t.map(e=>`· ${e}`).join(`
|
|
2
|
+
`)}`).join(`
|
|
3
|
+
|
|
4
|
+
`)}async function s(){let e=[];try{let i=new Promise((e,t)=>{setTimeout(e=>e(Error(`Timeout`)),500,t)});await Promise.race([r(),i]),e=n(await t())}catch{}if(e.length>0)return{type:`text`,value:o(e)};let i=n(await t());return i.length>0?{type:`text`,value:o(i)}:{type:`text`,value:`See the full changelog at: ${a}`}}e((()=>{i()}))();export{s as call};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-CFG7IQID.js";import{t as r}from"./semver-BsItM2Z4.js";import{n as i,t as a}from"./axios-Zh7qGPze.js";import{Ht as o,N as s}from"./state-CUZTq6r0.js";import{_s as c,ls as l,xs as u}from"./growthbook-p4aJ_UMv.js";import{J as d,U as f}from"./debug-CjIaNjpK.js";import{n as p,r as m}from"./privacyLevel-CRCHhztk.js";import{o as h,s as g}from"./log-DVv8YiNo.js";import{r as _,t as v}from"./semver-D3lOjiBN.js";import{dirname as y,join as b}from"path";import{mkdir as x,readFile as S,writeFile as C}from"fs/promises";function w(){return b(t(),`cache`,`changelog.md`)}async function T(){let e=l();if(!e.cachedChangelog)return;let t=w();try{await x(y(t),{recursive:!0}),await C(t,e.cachedChangelog,{encoding:`utf-8`,flag:`wx`})}catch{}u(({cachedChangelog:e,...t})=>t)}async function E(){if(s()||m())return;let e=await i.get(I);if(e.status===200){let t=e.data;if(t===L)return;let n=w();await x(y(n),{recursive:!0}),await C(n,t,{encoding:`utf-8`}),L=t;let r=Date.now();u(e=>({...e,changelogLastFetched:r}))}}async function D(){if(L!==null)return L;let e=w();try{let t=await S(e,`utf-8`);return L=t,t}catch{return L=``,``}}function O(){return L??``}function k(e){try{if(!e)return{};let t={},n=e.split(/^## /gm).slice(1);for(let e of n){let n=e.trim().split(`
|
|
2
|
+
`);if(n.length===0)continue;let r=n[0];if(!r)continue;let i=r.split(` - `)[0]?.trim()||``;if(!i)continue;let a=n.slice(1).filter(e=>e.trim().startsWith(`- `)).map(e=>e.trim().substring(2).trim()).filter(Boolean);a.length>0&&(t[i]=a)}return t}catch(e){return g(d(e)),{}}}function A(e,t,n=O()){try{let r=k(n),i=(0,N.coerce)(e),a=t?(0,N.coerce)(t):null;if(!a||i&&v(i.version,a.version))return Object.entries(r).filter(([e])=>!a||v(e,a.version)).sort(([e],[t])=>v(e,t)?-1:1).flatMap(([e,t])=>t).filter(Boolean).slice(0,P)}catch(e){return g(d(e)),[]}return[]}function j(e=O()){try{let t=k(e);return Object.keys(t).sort((e,t)=>v(e,t)?1:-1).map(e=>{let n=t[e];if(!n||n.length===0)return null;let r=n.filter(Boolean);return r.length===0?null:[e,r]}).filter(e=>e!==null)}catch(e){return g(d(e)),[]}}function M(e,t=`2.8.4`){if(process.env.USER_TYPE===`ant`)return{hasReleaseNotes:!1,releaseNotes:[]};let n=A(t,e);return{hasReleaseNotes:n.length>0,releaseNotes:n}}var N,P,F,I,L,R=e((()=>{a(),N=r(),o(),c(),n(),f(),h(),p(),_(),P=5,F=`https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md`,I=`https://raw.githubusercontent.com/anthropics/claude-code/refs/heads/main/CHANGELOG.md`,L=null}));export{D as a,T as c,j as i,k as l,M as n,O as o,E as r,R as s,F as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t}from"./envUtils-CFG7IQID.js";import{Ht as n}from"./state-CUZTq6r0.js";import{Ao as r,Gs as i,_s as a,m as o,nt as s}from"./growthbook-p4aJ_UMv.js";import{U as c}from"./debug-CjIaNjpK.js";import{j as l,v as u}from"./git-Bj8Ow4pJ.js";import{a as d,c as f}from"./stringUtils-U7kMYMJq.js";import{u as p}from"./oauth-DMPGYAoZ.js";import{Qi as m,bI as h,eP as g}from"./loadAgentsDir-Bz0FfcVt.js";import{t as _}from"./types-Bqp3meR4.js";import{n as v,t as y}from"./refresh-Bl3Miver.js";import"path";import"fs/promises";var b=e((()=>{n(),p(),s(),g(),a(),l(),c(),u(),r(),i(),o(),m(),_()}));function x(e,t){return`${e} ${f(e,t)}`}var S;e((()=>{n(),b(),t(),y(),h(),d(),S=async(e,t)=>{let n=await v(t.setAppState),r=`Reloaded: ${[x(n.enabled_count,`plugin`),x(n.command_count,`skill`),x(n.agent_count,`agent`),x(n.hook_count,`hook`),x(n.mcp_count,`plugin MCP server`),x(n.lsp_count,`plugin LSP server`)].join(` · `)}`;return n.error_count>0&&(r+=`\n${x(n.error_count,`error`)} during load. Run /doctor for details.`),{type:`text`,value:r}}}))();export{S as call};
|
|
@@ -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{In as i,Ln as a,Rn as o,b as s,f as c,g as l,h as u,l as d,t as f,tt as p}from"./src-DNHWYkls.js";import{t as m}from"./jsx-runtime-BTgGEFjL.js";import{Bl as h,Fl as g,Gs as _,Hl as v,Js as y,Rs as b,Vs as x}from"./growthbook-p4aJ_UMv.js";import{J as S,U as C}from"./debug-CjIaNjpK.js";import{o as w,s as T}from"./log-DVv8YiNo.js";import{RT as E,Xk as D,Zk as O,lD as k,uD as A,zT as j}from"./loadAgentsDir-Bz0FfcVt.js";import{t as M}from"./useKeybinding-DAQL_dB_.js";async function N(){let e=await D();if(e.length===0)return{availableEnvironments:[],selectedEnvironment:null,selectedEnvironmentSource:null};let t=x()?.remote?.defaultEnvironmentId,n=e.find(e=>e.kind!==`bridge`)??e[0],r=null;if(t){let i=e.find(e=>e.environment_id===t);if(i){n=i;for(let e=g.length-1;e>=0;e--){let n=g[e];if(!(!n||n===`flagSettings`)&&b(n)?.remote?.defaultEnvironmentId===t){r=n;break}}}}return{availableEnvironments:e,selectedEnvironment:n,selectedEnvironmentSource:r}}var P=e((()=>{v(),_(),O()}));function F({onDone:e}){let[t,n]=(0,z.useState)(`loading`),[r,a]=(0,z.useState)([]),[o,l]=(0,z.useState)(null),[u,f]=(0,z.useState)(null),[p,m]=(0,z.useState)(null);(0,z.useEffect)(()=>{let e=!1;async function t(){try{let t=await N();if(e)return;a(t.availableEnvironments),l(t.selectedEnvironment),f(t.selectedEnvironmentSource),n(null)}catch(t){if(e)return;let r=S(t);T(r),m(r.message),n(null)}}return t(),()=>{e=!0}},[]);function h(t){if(t===`cancel`){e();return}n(`updating`);let a=r.find(e=>e.environment_id===t);if(!a){e(`Error: Selected environment not found`);return}y(`localSettings`,{remote:{defaultEnvironmentId:a.environment_id}}),e(`Set default remote environment to ${i.bold(a.name)} (${a.environment_id})`)}return t===`loading`?(0,B.jsx)(c,{title:V,onCancel:e,hideInputGuide:!0,children:(0,B.jsx)(d,{message:`Loading environments…`})}):p?(0,B.jsx)(c,{title:V,onCancel:e,children:(0,B.jsxs)(s,{color:`error`,children:[`Error: `,p]})}):o?r.length===1?(0,B.jsx)(L,{environment:o,onDone:e}):(0,B.jsx)(R,{environments:r,selectedEnvironment:o,selectedEnvironmentSource:u,loadingState:t,onSelect:h,onCancel:e}):(0,B.jsx)(c,{title:V,subtitle:H,onCancel:e,children:(0,B.jsx)(s,{children:`No remote environments available.`})})}function I({environment:e}){return(0,B.jsxs)(s,{children:[r.tick,` Using `,(0,B.jsx)(s,{bold:!0,children:e.name}),` `,(0,B.jsxs)(s,{dimColor:!0,children:[`(`,e.environment_id,`)`]})]})}function L({environment:e,onDone:t}){return p(`confirm:yes`,t,{context:`Confirmation`}),(0,B.jsx)(c,{title:V,subtitle:H,onCancel:t,children:(0,B.jsx)(I,{environment:e})})}function R({environments:e,selectedEnvironment:t,selectedEnvironmentSource:n,loadingState:r,onSelect:i,onCancel:a}){let o=n&&n!==`localSettings`?` (from ${h(n)} settings)`:``;return(0,B.jsxs)(c,{title:V,subtitle:(0,B.jsxs)(s,{children:[`Currently using: `,(0,B.jsx)(s,{bold:!0,children:t.name}),o]}),onCancel:a,hideInputGuide:!0,children:[(0,B.jsx)(s,{dimColor:!0,children:H}),r===`updating`?(0,B.jsx)(d,{message:`Updating…`}):(0,B.jsx)(E,{options:e.map(e=>({label:(0,B.jsxs)(s,{children:[e.name,` `,(0,B.jsxs)(s,{dimColor:!0,children:[`(`,e.environment_id,`)`]})]}),value:e.environment_id})),defaultValue:t.environment_id,onChange:i,onCancel:()=>i(`cancel`),layout:`compact-vertical`}),(0,B.jsx)(s,{dimColor:!0,children:(0,B.jsxs)(u,{children:[(0,B.jsx)(l,{shortcut:`Enter`,action:`select`}),(0,B.jsx)(k,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]})}var z,B,V,H,U=e((()=>{a(),n(),o(),z=t(o(),1),f(),M(),C(),w(),v(),_(),P(),A(),j(),B=m(),V=`Select Remote Environment`,H=`Configure environments at: https://claude.ai/code`}));async function W(e){return(0,G.jsx)(F,{onDone:e})}var G;e((()=>{o(),U(),G=m()}))();export{W as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,s as t}from"./envUtils-CFG7IQID.js";import{n,t as r}from"./axios-Zh7qGPze.js";import{$ as i,E as a,O as o,Q as s,U as c,l,p as u,z as d}from"./debug-CjIaNjpK.js";import{M as f,j as p}from"./git-Bj8Ow4pJ.js";import{n as m,r as h}from"./analytics-i6X1et4O.js";import{n as g,t as _}from"./sleep-CC8jykQd.js";import{c as v,d as y,i as b,o as x,s as S}from"./debugUtils-Dsg-UHeg.js";import{a as C,i as w}from"./trustedDevice-DADcxAAs.js";import{a as T,r as E}from"./bridgeConfig-GYR-LUiu.js";import{t as ee}from"./jwtUtils-D-tJzoJY.js";import{t as D}from"./workSecret-Dh5Ayceu.js";import{i as O,r as te}from"./envLessBridgeConfig-DJ1Sts3F.js";import{a as k,c as A,i as ne,n as re,o as j,r as ie,s as ae,t as M}from"./bridgeMessaging-BUOZU_ba.js";import{r as N,t as oe}from"./flushGate-2zqab-Pp.js";import{a as se}from"./sessionState-Dgky34M4.js";t(),s(),p(),m(),_(),v(),C(),O(),r(),l(),c(),a(),x();var P=`2023-06-01`;function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":P}}async function ce(e,t,r,i,a){let s=`${e}/v1/code/sessions`,c;try{c=await n.post(s,{title:r,bridge:{},...a?.length?{tags:a}:{}},{headers:F(t),timeout:i,validateStatus:e=>e<500})}catch(e){return u(`[code-session] Session create request failed: ${d(e)}`),null}if(c.status!==200&&c.status!==201){let e=b(c.data);return u(`[code-session] Session create failed ${c.status}${e?`: ${e}`:``}`),null}let l=c.data;return!l||typeof l!=`object`||!(`session`in l)||!l.session||typeof l.session!=`object`||!(`id`in l.session)||typeof l.session.id!=`string`||!l.session.id.startsWith(`cse_`)?(u(`[code-session] No session.id (cse_*) in response: ${o(l).slice(0,200)}`),null):l.session.id}async function I(e,t,r,i,a){let s=`${t}/v1/code/sessions/${e}/bridge`,c=F(r);a&&(c[`X-Trusted-Device-Token`]=a);let l;try{l=await n.post(s,{},{headers:c,timeout:i,validateStatus:e=>e<500})}catch(e){return u(`[code-session] /bridge request failed: ${d(e)}`),null}if(l.status!==200){let e=b(l.data);return u(`[code-session] /bridge failed ${l.status}${e?`: ${e}`:``}`),null}let f=l.data;if(typeof f!=`object`||!f||!(`worker_jwt`in f)||typeof f.worker_jwt!=`string`||!(`expires_in`in f)||typeof f.expires_in!=`number`||!(`api_base_url`in f)||typeof f.api_base_url!=`string`||!(`worker_epoch`in f))return u(`[code-session] /bridge response malformed (need worker_jwt, expires_in, api_base_url, worker_epoch): ${o(f).slice(0,200)}`),null;let p=f.worker_epoch,m=typeof p==`string`?Number(p):p;return typeof m!=`number`||!Number.isFinite(m)||!Number.isSafeInteger(m)?(u(`[code-session] /bridge worker_epoch invalid: ${o(p)}`),null):{worker_jwt:f.worker_jwt,api_base_url:f.api_base_url,expires_in:f.expires_in,worker_epoch:m}}r(),x(),l(),c(),T();var L=`2023-06-01`;function R(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":L}}async function z(t){let{baseUrl:n,orgUUID:r,title:a,getAccessToken:o,onAuth401:s,toSDKMessages:c,initialHistoryCap:l,initialMessages:p,onInboundMessage:m,onUserMessage:g,onPermissionResponse:_,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,onStateChange:C,outboundOnly:w,tags:T}=t,E=await te(),O=o();if(!O)return u(`[remote-bridge] No OAuth token`),null;let P=await B(()=>ce(n,O,a,E.http_timeout_ms,T),`createCodeSession`,E);if(!P)return C?.(`failed`,`Session creation failed — see debug log`),S(`v2_session_create_failed`,void 0,!0),null;let F=P;u(`[remote-bridge] Created session ${F}`),f(`info`,`bridge_repl_v2_session_created`);let I=await B(()=>V(F,n,O,E.http_timeout_ms),`fetchRemoteCredentials`,E);if(!I)return C?.(`failed`,`Remote credentials fetch failed — see debug log`),S(`v2_remote_creds_failed`,void 0,!0),H(F,n,O,r,E.http_timeout_ms),null;u(`[remote-bridge] Fetched bridge credentials (expires_in=${I.expires_in}s)`);let L=D(I.api_base_url,F);u(`[remote-bridge] v2 session URL: ${L}`);let R;try{R=await N({sessionUrl:L,ingressToken:I.worker_jwt,sessionId:F,epoch:I.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,getAuthToken:()=>I.worker_jwt,outboundOnly:w})}catch(e){return u(`[remote-bridge] v2 transport setup failed: ${d(e)}`,{level:`error`}),C?.(`failed`,`Transport setup failed: ${d(e)}`),S(`v2_transport_setup_failed`,void 0,!0),H(F,n,O,r,E.http_timeout_ms),null}u(`[remote-bridge] v2 transport created (epoch=${I.worker_epoch})`),C?.(`ready`);let z=new M(E.uuid_dedup_buffer_size),U=new Set;if(p)for(let e of p)U.add(e.uuid),z.add(e.uuid);let le=new M(E.uuid_dedup_buffer_size),W=new oe,G=!1,K=!1,q=!1,J=!g,Y=`initial`,X;function Z(e){K||h(`tengu_bridge_repl_connect_timeout`,{v2:!0,elapsed_ms:E.connect_timeout_ms,cause:e})}se(e=>{K||R.reportMetadata(e)},{replayCurrent:!0});let Q=ee({refreshBufferMs:E.token_refresh_buffer_ms,getAccessToken:async()=>{let e=o();return s&&await s(e??``),o()??e},onRefresh:(e,t)=>{(async()=>{if(q||K){u(`[remote-bridge] Recovery already in flight, skipping proactive refresh`);return}q=!0;try{let r=await B(()=>V(e,n,t,E.http_timeout_ms),`fetchRemoteCredentials (proactive)`,E);if(!r||K)return;await ue(r,`proactive_refresh`),u(`[remote-bridge] Transport rebuilt (proactive refresh)`)}catch(e){u(`[remote-bridge] Proactive refresh rebuild failed: ${d(e)}`,{level:`error`}),f(`error`,`bridge_repl_v2_proactive_refresh_failed`),K||C?.(`failed`,`Refresh failed: ${d(e)}`)}finally{q=!1}})()},label:`remote`});Q.scheduleFromExpiresIn(F,I.expires_in);function $(){R.setOnConnect(()=>{if(clearTimeout(X),u(`[remote-bridge] v2 transport connected`),f(`info`,`bridge_repl_v2_transport_connected`),h(`tengu_bridge_repl_ws_connected`,{v2:!0,cause:Y}),!G&&p&&p.length>0){G=!0;let e=R;pe(p).catch(e=>u(`[remote-bridge] flushHistory failed: ${e}`)).finally(()=>{R!==e||K||q||(fe(),C?.(`connected`))})}else W.active||C?.(`connected`)}),R.setOnData(e=>{ie(e,z,le,m,_?e=>{R.reportState(`running`),_(e)}:void 0,e=>ne(e,{transport:R,sessionId:F,onInterrupt:v,onSetModel:y,onSetMaxThinkingTokens:b,onSetPermissionMode:x,outboundOnly:w}))}),R.setOnClose(e=>{if(clearTimeout(X),!K){if(u(`[remote-bridge] v2 transport closed (code=${e})`),h(`tengu_bridge_repl_ws_closed`,{code:e,v2:!0}),e===401&&!q){de();return}C?.(`failed`,`Transport closed (code ${e})`)}})}async function ue(e,t){Y=t,W.start();try{let t=R.getLastSequenceNum();if(R.close(),R=await N({sessionUrl:D(e.api_base_url,F),ingressToken:e.worker_jwt,sessionId:F,epoch:e.worker_epoch,heartbeatIntervalMs:E.heartbeat_interval_ms,heartbeatJitterFraction:E.heartbeat_jitter_fraction,initialSequenceNum:t,getAuthToken:()=>e.worker_jwt,outboundOnly:w}),K){R.close();return}$(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y),Q.scheduleFromExpiresIn(F,e.expires_in),fe()}finally{W.drop()}}async function de(){if(!q){q=!0,C?.(`reconnecting`,`JWT expired — refreshing`),u(`[remote-bridge] 401 on SSE — attempting JWT refresh`);try{let e=o();s&&await s(e??``);let t=o()??e;if(!t||K){K||C?.(`failed`,`JWT refresh failed: no OAuth token`);return}let r=await B(()=>V(F,n,t,E.http_timeout_ms),`fetchRemoteCredentials (recovery)`,E);if(!r||K){K||C?.(`failed`,`JWT refresh failed after 401`);return}G=!1,await ue(r,`auth_401_recovery`),u(`[remote-bridge] Transport rebuilt after 401`)}catch(e){u(`[remote-bridge] 401 recovery failed: ${d(e)}`,{level:`error`}),f(`error`,`bridge_repl_v2_jwt_refresh_failed`),K||C?.(`failed`,`JWT refresh failed: ${d(e)}`)}finally{q=!1}}}$(),p&&p.length>0&&W.start(),R.connect(),X=setTimeout(Z,E.connect_timeout_ms,Y);function fe(){let e=W.end();if(e.length===0)return;for(let t of e)z.add(t.uuid);let t=c(e).map(e=>({...e,session_id:F}));A(e)&&R.reportState(`running`),u(`[remote-bridge] Drained ${e.length} queued message(s) after flush`),R.writeBatch(t)}async function pe(e){let t=e.filter(k),n=l>0&&t.length>l?t.slice(-l):t;n.length<t.length&&u(`[remote-bridge] Capped initial flush: ${t.length} -> ${n.length} (cap=${l})`);let r=c(n).map(e=>({...e,session_id:F}));if(r.length===0)return;let i=t.at(-1);i&&ae(i)&&R.reportState(`running`),u(`[remote-bridge] Flushing ${r.length} history events`),await R.writeBatch(r)}async function me(){if(K)return;K=!0,Q.cancelAll(),clearTimeout(X),W.drop(),R.reportState(`idle`);let e={...j(F),session_id:F};R.write(e);let t=o(),i=await H(F,n,t,r,E.teardown_archive_timeout_ms);if(i===401&&s)try{await s(t??``),t=o(),i=await H(F,n,t,r,E.teardown_archive_timeout_ms)}catch(e){u(`[remote-bridge] Teardown 401 retry threw: ${d(e)}`,{level:`error`})}R.close();let a=i===`no_token`?`skipped_no_token`:i===`timeout`||i===`error`?`network_error`:i>=500?`server_5xx`:i>=400?`server_4xx`:`ok`;u(`[remote-bridge] Torn down (archive=${i})`),f(`info`,`bridge_repl_v2_teardown`),h(`tengu_bridge_repl_teardown`,{v2:!0,archive_status:a,archive_ok:typeof i==`number`&&i<400,archive_http_status:typeof i==`number`?i:void 0,archive_timeout:i===`timeout`,archive_no_token:i===`no_token`})}let he=i(me);return h(`tengu_bridge_repl_started`,{has_initial_messages:!!(p&&p.length>0),v2:!0,expires_in_s:I.expires_in,inProtectedNamespace:e()}),{bridgeSessionId:F,environmentId:``,sessionIngressUrl:I.api_base_url,writeMessages(e){let t=e.filter(e=>k(e)&&!U.has(e.uuid)&&!z.has(e.uuid));if(t.length===0)return;if(!J)for(let e of t){let t=re(e);if(t!==void 0&&g?.(t,F)){J=!0;break}}if(W.enqueue(...t)){u(`[remote-bridge] Queued ${t.length} message(s) during flush`);return}for(let e of t)z.add(e.uuid);let n=c(t).map(e=>({...e,session_id:F}));A(t)&&R.reportState(`running`),u(`[remote-bridge] Sending ${t.length} message(s)`),R.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!z.has(e.uuid));if(t.length===0)return;for(let e of t)e.uuid&&z.add(e.uuid);let n=t.map(e=>({...e,session_id:F}));R.writeBatch(n)},sendControlRequest(e){if(q){u(`[remote-bridge] Dropping control_request during 401 recovery: ${e.request_id}`);return}let t={...e,session_id:F};e.request?.subtype===`can_use_tool`&&R.reportState(`requires_action`),R.write(t),u(`[remote-bridge] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(q){u(`[remote-bridge] Dropping control_response during 401 recovery`);return}let t={...e,session_id:F};R.reportState(`running`),R.write(t),u(`[remote-bridge] Sent control_response`)},sendControlCancelRequest(e){if(q){u(`[remote-bridge] Dropping control_cancel_request during 401 recovery: ${e}`);return}let t={type:`control_cancel_request`,request_id:e,session_id:F};R.reportState(`running`),R.write(t),u(`[remote-bridge] Sent control_cancel_request request_id=${e}`)},sendResult(){if(q){u(`[remote-bridge] Dropping result during 401 recovery`);return}R.reportState(`idle`);let e={...j(F),session_id:F};R.write(e),u(`[remote-bridge] Sent result`)},async teardown(){he(),await me()}}}async function B(e,t,n){let r=n.init_retry_max_attempts;for(let i=1;i<=r;i++){let a=await e();if(a!==null)return a;if(i<r){let e=n.init_retry_base_delay_ms*2**(i-1),a=e*n.init_retry_jitter_fraction*(2*Math.random()-1),o=Math.min(e+a,n.init_retry_max_delay_ms);u(`[remote-bridge] ${t} failed (attempt ${i}/${r}), retrying in ${Math.round(o)}ms`),await g(o)}}return null}async function V(e,t,n,r){let i=await I(e,t,n,r,w());return i?E()?{...i,api_base_url:t}:i:null}async function H(e,t,r,i,a){if(!r)return`no_token`;let o=y(e);try{let e=await n.post(`${t}/v1/sessions/${o}/archive`,{},{headers:{...R(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i},timeout:a,validateStatus:()=>!0});return u(`[remote-bridge] Archive ${o} status=${e.status}`),e.status}catch(e){return u(`[remote-bridge] Archive failed: ${d(e)}`),n.isAxiosError(e)&&e.code===`ECONNABORTED`?`timeout`:`error`}}export{z as initEnvLessBridgeCore};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,d as i,f as a,nt as o,t as s,x as c}from"./src-DNHWYkls.js";import{t as l}from"./jsx-runtime-BTgGEFjL.js";import{U as u,z as d}from"./debug-CjIaNjpK.js";import{BT as f,UT as p}from"./loadAgentsDir-Bz0FfcVt.js";import{t as m}from"./useKeybinding-DAQL_dB_.js";import{a as h,t as g}from"./bridgeConfig-GYR-LUiu.js";import{a as _,n as v}from"./types-DgzOOCDl.js";import{n as y,r as b}from"./bridgeEnabled-DKqmLnKO.js";import{t as x}from"./Dialog-Dgg8bqcG.js";import{t as S}from"./ListItem-B6MyhHvM.js";import{i as C,o as w,t as T}from"./cliLaunch-CMXoY_LO.js";import{resolve as E}from"path";function D({onDone:e}){let[t,n]=(0,N.useState)(I),[r,i]=(0,N.useState)(null);return(0,N.useEffect)(()=>{if(F&&!F.killed){n(`running`);return}let t=!1;return(async()=>{let r=await k();if(!t){if(r){e(r,{display:`system`});return}n(`starting`);try{A(),t||(n(`running`),I=`running`,e(`Remote Control Server started. Use /remote-control-server to manage.`,{display:`system`}))}catch(r){if(!t){let t=d(r);n(`error`),i(t),I=`error`,e(`Remote Control Server failed to start: ${t}`,{display:`system`})}}}})(),()=>{t=!0}},[]),t===`running`&&F&&!F.killed?(0,P.jsx)(O,{onDone:e}):null}function O({onDone:e}){p(`remote-control-server-dialog`);let[t,n]=(0,N.useState)(2),s=L.slice(-5);function l(){j(),e(`Remote Control Server stopped.`,{display:`system`})}function u(){j();try{A(),e(`Remote Control Server restarted.`,{display:`system`})}catch(t){e(`Failed to restart: ${d(t)}`,{display:`system`})}}function f(){e(void 0,{display:`skip`})}return o({"select:next":()=>n(e=>(e+1)%3),"select:previous":()=>n(e=>(e-1+3)%3),"select:accept":()=>{t===0?l():t===1?u():f()}},{context:`Select`}),(0,P.jsx)(a,{title:`Remote Control Server`,onCancel:f,hideInputGuide:!0,children:(0,P.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,P.jsxs)(r,{children:[`Remote Control Server is`,` `,(0,P.jsx)(r,{bold:!0,color:`success`,children:`running`}),F?` (PID: ${F.pid})`:``]}),s.length>0&&(0,P.jsxs)(c,{flexDirection:`column`,children:[(0,P.jsx)(r,{dimColor:!0,children:`Recent logs:`}),s.map((e,t)=>(0,P.jsx)(r,{dimColor:!0,children:e},t))]}),(0,P.jsxs)(c,{flexDirection:`column`,children:[(0,P.jsx)(i,{isFocused:t===0,children:(0,P.jsx)(r,{children:`Stop server`})}),(0,P.jsx)(i,{isFocused:t===1,children:(0,P.jsx)(r,{children:`Restart server`})}),(0,P.jsx)(i,{isFocused:t===2,children:(0,P.jsx)(r,{children:`Continue`})})]}),(0,P.jsx)(r,{dimColor:!0,children:`Enter to select · Esc to continue`})]})})}async function k(){return await y()||(g()?null:v)}function A(){let e=E(`.`),t=w(T([`daemon`,`start`,`--dir=${e}`]),{cwd:e,stdio:[`ignore`,`pipe`,`pipe`],detached:!1});F=t,L=[],t.stdout?.on(`data`,e=>{let t=e.toString().trimEnd().split(`
|
|
2
|
+
`);for(let e of t)L.push(e),L.length>R&&L.shift()}),t.stderr?.on(`data`,e=>{let t=e.toString().trimEnd().split(`
|
|
3
|
+
`);for(let e of t)L.push(`[err] ${e}`),L.length>R&&L.shift()}),t.on(`exit`,(e,t)=>{F=null,I=`stopped`,L.push(`[daemon] exited (code=${e??`unknown`}, signal=${t})`)}),t.on(`error`,e=>{F=null,I=`error`,L.push(`[daemon] error: ${e.message}`)})}function j(){if(F&&!F.killed){F.kill(`SIGTERM`);let e=F.pid;setTimeout(()=>{try{e&&process.kill(e,0),F&&!F.killed&&F.kill(`SIGKILL`)}catch{}},1e4)}F=null,I=`stopped`}async function M(e,t,n){return(0,P.jsx)(D,{onDone:e})}var N,P,F,I,L,R;e((()=>{n(),N=t(n(),1),b(),h(),_(),x(),S(),f(),s(),m(),C(),u(),P=l(),F=null,I=`stopped`,L=[],R=50}))();export{M as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ht as t,at as n}from"./state-CUZTq6r0.js";import{f as r,l as i}from"./teammate-C-FiRloZ.js";import{Hc as a,Zc as o,br as s,hr as c,ii as l,si as u}from"./loadAgentsDir-Bz0FfcVt.js";import{a as d,i as f,r as p}from"./bridgeConfig-GYR-LUiu.js";import{n as m,t as h}from"./generateSessionName-Dpjg-u_x.js";async function g(e,t,i){if(r())return e(`Cannot rename: This session is a swarm teammate. Teammate names are set by the team leader.`,{display:`system`}),null;let o;if(!i||i.trim()===``){let n=await h(a(t.messages),t.abortController.signal);if(!n)return e(`Could not generate a name: no conversation context yet. Usage: /rename <name>`,{display:`system`}),null;o=n}else o=i.trim();let s=n(),d=c();await u(s,o,d);let m=t.getAppState().replBridgeSessionId;if(m){let e=f();import(`./createSession-BJSnFBGt.js`).then(({updateBridgeSessionTitle:t})=>t(m,o,{baseUrl:p(),getAccessToken:e?()=>e:void 0}).catch(()=>{}))}return await l(s,o,d),t.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:o}})),e(`Session renamed to: ${o}`,{display:`system`}),null}e((()=>{t(),d(),o(),s(),i(),m()}))();export{g as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,u as t}from"./envUtils-CFG7IQID.js";import{o as n,s as r}from"./log-DVv8YiNo.js";import{ReadStream as i}from"tty";import{openSync as a}from"fs";e(),n();var o=null;function s(){if(o!==null)return o;if(process.stdin.isTTY){o=void 0;return}if(t(process.env.CI)){o=void 0;return}if(process.argv.includes(`mcp`)){o=void 0;return}if(process.platform===`win32`){o=void 0;return}try{let e=new i(a(`/dev/tty`,`r`));return e.isTTY=!0,o=e,o}catch(e){r(e),o=void 0;return}}function c(e=!1){let t=s(),n={exitOnCtrlC:e};return t&&(n.stdin=t),n}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,s as t,u as n}from"./envUtils-CFG7IQID.js";import{$ as r,Q as i,U as a,l as o,p as s,z as c}from"./debug-CjIaNjpK.js";import{M as l,j as u}from"./git-Bj8Ow4pJ.js";import{n as d,r as f}from"./analytics-i6X1et4O.js";import{n as p,t as m}from"./sleep-CC8jykQd.js";import{Bs as h,Gs as g,Hs as _,Js as v,Ks as ee,MS as y,Rs as b,Us as x,Vs as S,Ws as C,kS as w,qs as T,zs as E}from"./loadAgentsDir-Bz0FfcVt.js";import{a as te,c as ne,d as D,f as re,o as O,r as k,s as ie}from"./debugUtils-Dsg-UHeg.js";import{b as ae,n as A,t as oe,y as se}from"./rcDebugLog-BbHlIxCm.js";import{a as ce,i as le}from"./trustedDevice-DADcxAAs.js";import{t as ue}from"./capacityWake-BWCSatN6.js";import{n as de}from"./pollConfig-C8nODJY1.js";import{a as fe,n as pe,r as me,t as he}from"./workSecret-Dh5Ayceu.js";import{a as ge,i as _e,n as ve,o as ye,r as be,t as xe}from"./bridgeMessaging-BUOZU_ba.js";import{t as Se}from"./HybridTransport-B-G4QJcy.js";import{n as Ce,r as we,t as Te}from"./flushGate-2zqab-Pp.js";import{a as Ee}from"./sessionState-Dgky34M4.js";import{randomUUID as De}from"crypto";g(),o(),oe(),u(),d(),i(),ne(),w(),ce(),se(),t(),O(),a(),m(),E();var Oe=2e3,ke=6e4,j=900*1e3,Ae=0;async function M(t){let{dir:i,machineName:a,branch:o,gitRepoUrl:u,title:d,baseUrl:p,sessionIngressUrl:m,workerType:g,getAccessToken:v,createSession:ee,archiveSession:x,getCurrentTitle:w=()=>d,toSDKMessages:T=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:E,getPollIntervalConfig:te=()=>de,initialHistoryCap:ne=200,initialMessages:O,previouslyFlushedUUIDs:k,onInboundMessage:oe,onPermissionResponse:se,onInterrupt:ce,onSetModel:me,onSetMaxThinkingTokens:Oe,onSetPermissionMode:ke,onStateChange:j,onUserMessage:M,perpetual:Me,initialSSESequenceNum:Ne=0}=t,Pe=++Ae,{writeBridgePointer:N,clearBridgePointer:Fe,readBridgePointer:Ie}=await import(`./bridgePointer-BpzIEsD_.js`),Le=Me?await Ie(i):null,P=Le?.source===`repl`?Le:null;s(`[bridge:repl] initBridgeCore #${Pe} starting (initialMessages=${O?.length??0}${P?` perpetual prior=env:${P.environmentId}`:``})`);let Re=C({baseUrl:p,getAccessToken:v,runnerVersion:`2.8.4`,onDebug:s,onAuth401:E,getTrustedDeviceToken:le}),F=process.env.USER_TYPE===`ant`?_(Re):Re,I={dir:i,machineName:a,branch:o,gitRepoUrl:u,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:De(),workerType:g,environmentId:De(),reuseEnvironmentId:P?.environmentId,apiBaseUrl:p,sessionIngressUrl:m},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return ie(`registration_failed`,`[bridge:repl] Environment registration failed: ${c(e)}`),P&&await Fe(i),j?.(`failed`,c(e)),null}s(`[bridge:repl] Environment registered: ${L}`),l(`info`,`bridge_repl_env_registered`),f(`tengu_bridge_repl_env_registered`,{});async function ze(e,t){if(L!==e)return s(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=re(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),s(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){s(`[bridge:repl] reconnectSession(${e}) failed: ${c(t)}`)}return s(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let Be=P?await ze(P.environmentId,P.sessionId):!1;P&&!Be&&await Fe(i);let z;if(Be&&P){if(z=P.sessionId,s(`[bridge:repl] Perpetual session reused: ${z}`),O&&k)for(let e of O)k.add(e.uuid)}else{let e=await ee({environmentId:L,title:d,gitRepoUrl:u,branch:o,signal:AbortSignal.timeout(15e3)});if(!e)return s(`[bridge:repl] Session creation failed, deregistering environment`),f(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),j?.(`failed`,`Session creation failed`),null;z=e,s(`[bridge:repl] Session created: ${z}`)}await N(i,{sessionId:z,environmentId:L,source:`repl`}),l(`info`,`bridge_repl_session_created`),f(`tengu_bridge_repl_started`,{has_initial_messages:!!(O&&O.length>0),inProtectedNamespace:e()});let Ve=new Set;if(O)for(let e of O)Ve.add(e.uuid);let B=new xe(2e3);for(let e of Ve)B.add(e);let He=new xe(2e3),V=new AbortController,H=null;Ee(e=>{V.signal.aborted||H?.reportMetadata(e)},{replayCurrent:!0});let U=0,W=Be?Ne:0,G=null,K=null,Ue=ue(V.signal),q=Ue.wake,We=Ue.signal,J=new Te,Ge=!M,Y=0,X=null;async function Z(){if(X)return X;X=Ke();try{return await X}finally{X=null}}async function Ke(){if(Y++,A(`doReconnect: attempt=${Y}/3 envId=${L} sessionId=${z} workId=${G}`),U++,s(`[bridge:repl] Reconnecting after env lost (attempt ${Y}/3)`),Y>3)return s(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}if(q(),J.drop(),G){let e=G;if(await F.stopWork(L,e,!1).catch(()=>{}),G!==e)return s(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Y=0,!0;G=null,K=null}if(V.signal.aborted)return s(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,s(`[bridge:repl] Environment re-registration failed: ${c(e)}`),!1}if(I.reuseEnvironmentId=void 0,s(`[bridge:repl] Re-registered: requested=${e} got=${L}`),V.signal.aborted)return s(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(H!==null)return s(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Y=0,!0;if(await ze(e,z))return f(`tengu_bridge_repl_reconnected_in_place`,{}),Y=0,!0;if(L!==e&&f(`tengu_bridge_repl_env_expired_fresh_session`,{}),await x(z),V.signal.aborted)return s(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=w(),n=await ee({environmentId:L,title:t,gitRepoUrl:u,branch:o,signal:AbortSignal.timeout(15e3)});return n?V.signal.aborted?(s(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await x(n),!1):(z=n,y(D(n)).catch(()=>{}),W=0,He.clear(),Ge=!M,s(`[bridge:repl] Re-created session: ${z}`),await N(i,{sessionId:z,environmentId:L,source:`repl`}),k?.clear(),Y=0,!0):(s(`[bridge:repl] Session creation failed during reconnection`),!1)}function qe(){return v()}function Je(){let e=J.end();if(e.length===0)return;if(!H){s(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)B.add(t.uuid);let t=T(e).map(e=>({...e,session_id:z}));s(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),H.writeBatch(t)}let Q=null;function Ye(){Q?.()}function Xe(e){if(A(`handleTransportPermanentClose: code=${e} transport=${H?`exists`:`null`} pollAborted=${V.signal.aborted}`),s(`[bridge:repl] Transport permanently closed: code=${e}`),f(`tengu_bridge_repl_ws_closed`,{code:e}),H){let e=H.getLastSequenceNum();e>W&&(W=e),H=null}q();let t=J.drop();if(t>0&&s(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){j?.(`failed`,`session ended`),V.abort(),Ye();return}j?.(`reconnecting`,`Remote Control connection lost (code ${e})`),s(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),Z().then(t=>{t||V.signal.aborted||(s(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),f(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),j?.(`failed`,`reconnection failed`),Ye())})}let $;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&($=()=>{s(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),Z()},process.on(`SIGUSR2`,$));let Ze=null;process.env.USER_TYPE===`ant`&&S({fireClose:e=>{if(!Ze){s(`[bridge:debug] fireClose: no transport wired yet`);return}s(`[bridge:debug] fireClose(${e}) — injecting`),Ze(e)},forceReconnect:()=>{s(`[bridge:debug] forceReconnect — injecting`),Z()},injectFault:h,wakePollLoop:q,describe:()=>`env=${L} session=${z} transport=${H?.getStateLabel()??`null`} workId=${G??`null`}`}),je({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:V.signal,getPollIntervalConfig:te,onStateChange:j,getWsState:()=>H?.getStateLabel()??`null`,isAtCapacity:()=>H!==null,capacitySignal:We,onFatalError:Ye,getHeartbeatInfo:()=>!G||!K?null:{environmentId:L,workId:G,sessionToken:K},onHeartbeatFatal:e=>{if(s(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}J.drop(),G&&F.stopWork(L,G,!1).catch(e=>{s(`[bridge:repl] stopWork after heartbeat fatal: ${c(e)}`)}),G=null,K=null,q(),j?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await Z()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(e,t,r,a)=>{if(H?.isConnectedStatus()&&s(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${r})`),s(`[bridge:repl] Work received: workId=${r} workSessionId=${e} currentSessionId=${z} match=${fe(e,z)}`),N(i,{sessionId:z,environmentId:L,source:`repl`}),!fe(e,z)){s(`[bridge:repl] Rejecting foreign session: expected=${z} got=${e}`);return}G=r,K=t;let o=a||n(process.env.CLAUDE_BRIDGE_USE_CCR_V2),l;if(!o){if(l=qe(),!l){s(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ae(l)}if(f(`tengu_bridge_repl_work_received`,{}),H){let e=H;H=null;let t=e.getLastSequenceNum();t>W&&(W=t),e.close()}J.deactivate();let u=e=>_e(e,{transport:H,sessionId:z,onInterrupt:ce,onSetModel:me,onSetMaxThinkingTokens:Oe,onSetPermissionMode:ke}),d=!1,h=e=>{H=e,e.setOnConnect(()=>{if(H===e){if(s(`[bridge:repl] Ingress transport connected`),f(`tengu_bridge_repl_ws_connected`,{}),!o){let e=qe();e&&ae(e)}if(tt=!1,!d&&O&&O.length>0){d=!0;let t=ne,n=O.filter(e=>ge(e)&&!k?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(s(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),f(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=T(r);if(i.length>0){s(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:z})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){s(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(k)for(let e of i)e.uuid&&k.add(e.uuid)}).catch(e=>s(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{H===e&&(Je(),j?.(`connected`))})}else Je(),j?.(`connected`)}else J.active||j?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);A(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{A(`ingress (non-JSON): ${String(e).slice(0,200)}`)}be(e,B,He,oe,se,u)}),Ze=Xe,e.setOnClose(t=>{H===e&&(A(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Xe(t))}),!d&&O&&O.length>0&&J.start(),e.connect()};if(U++,o){let n=he(p,e),r=U;s(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),we({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:W}).then(e=>{if(V.signal.aborted){e.close();return}if(r!==U){s(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${U}`),e.close();return}h(e)},e=>{s(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${c(e)}`,{level:`error`}),f(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===U&&(G&&(F.stopWork(L,G,!1).catch(e=>{s(`[bridge:repl] stopWork after v2 init failure: ${c(e)}`)}),G=null,K=null),q())})}else{let t=pe(m,e);s(`[bridge:repl] Ingress URL: ${t}`),s(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=l??``;h(Ce(new Se(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${qe()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{j?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),q()}})))}}});let Qe=Me?setInterval(()=>{X||N(i,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;Qe?.unref?.();let $e=te().session_keepalive_interval_v2_ms,et=$e>0?setInterval(()=>{H&&(s(`[bridge:repl] keep_alive sent`),H.write({type:`keep_alive`}).catch(e=>{s(`[bridge:repl] keep_alive write failed: ${c(e)}`)}))},$e):null;et?.unref?.();let tt=!1;Q=async()=>{if(tt){s(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}tt=!0;let e=Date.now();if(s(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${G??`none`} transportState=${H?.getStateLabel()??`null`}`),Qe!==null&&clearInterval(Qe),et!==null&&clearInterval(et),$&&process.off(`SIGUSR2`,$),process.env.USER_TYPE===`ant`&&(b(),Ze=null),V.abort(),s(`[bridge:repl] Teardown: poll loop aborted`),H){let e=H.getLastSequenceNum();e>W&&(W=e)}if(Me){H=null,J.drop(),await N(i,{sessionId:z,environmentId:L,source:`repl`}),s(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=H;if(H=null,J.drop(),t){let e={...ye(z),session_id:z};t.write(e)}let n=G?F.stopWork(L,G,!0).then(()=>{s(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{s(`[bridge:repl] Teardown stopWork failed: ${c(e)}`)}):Promise.resolve();await Promise.all([n,x(z)]),t?.close(),s(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{s(`[bridge:repl] Teardown deregister failed: ${c(e)}`)}),await Fe(i),s(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let nt=r(()=>Q?.());return s(`[bridge:repl] Ready: env=${L} session=${z}`),j?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=H?.getLastSequenceNum()??0;return Math.max(W,e)},sessionIngressUrl:m,writeMessages(e){let t=e.filter(e=>ge(e)&&!Ve.has(e.uuid)&&!B.has(e.uuid));if(t.length===0)return;if(!Ge)for(let e of t){let t=ve(e);if(t!==void 0&&M?.(t,z)){Ge=!0;break}}if(J.enqueue(...t)){s(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!H){let e=t.map(e=>e.type).join(`,`);s(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)B.add(e.uuid);s(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=T(t).map(e=>({...e,session_id:z}));H.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!B.has(e.uuid));if(t.length===0)return;if(!H){s(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&B.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));H.writeBatch(n)},sendControlRequest(e){if(!H){s(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};H.write(t),s(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!H){s(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};H.write(t),s(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!H){s(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};H.write(t),s(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!H){s(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}H.reportState(`idle`);let e={...ye(z),session_id:z};H.write(e),s(`[bridge:repl] Sent result for session=${z}`)},async teardown(){nt(),await Q?.(),s(`[bridge:repl] Torn down`),f(`tengu_bridge_repl_teardown`,{})}}}async function je({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:u,capacitySignal:d,onFatalError:m,getPollIntervalConfig:h=()=>de,getHeartbeatInfo:g,onHeartbeatFatal:_}){s(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let y=0,b=null,S=null,C=0,w=!1;for(;!n.aborted;){let{environmentId:E,environmentSecret:ne}=t(),D=h();try{let t=await e.pollForWork(E,ne,n,D.reclaim_older_than_ms);if(C=0,y>0&&(s(`[bridge:repl] Poll recovered after ${y} consecutive error(s)`),y=0,b=null,S=null,r?.(`ready`)),!t){let t=w;if(w=!1,u?.()&&d&&!t){let t=D.poll_interval_ms_at_capacity;if(D.non_exclusive_heartbeat_interval_ms>0&&g){f(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:D.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&u()&&(r===null||Date.now()<r);){let t=h();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=g();if(!n)break;let r=d();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(s(`[bridge:repl:heartbeat] Failed: ${c(e)}`),e instanceof x){r.cleanup(),f(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),_?(_(e),s(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await p(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:u()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(f(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&s(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:D.non_exclusive_heartbeat_interval_ms;if(r>0){let e=d(),t=Date.now();await p(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(s(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),f(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),w=!0)}}else await p(D.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=me(t.secret)}catch(n){s(`[bridge:repl] Failed to decode work secret: ${c(n)}`),f(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(E,t.id,!1).catch(()=>{});continue}s(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(E,t.id,a.session_ingress_token)}catch(e){s(`[bridge:repl] Acknowledge failed workId=${t.id}: ${c(e)}`)}if(t.data.type===`healthcheck`){s(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{v(e,`session_id`)}catch{s(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),s(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof x&&i.status===404&&a){let e=t().environmentId;if(E!==e){s(`[bridge:repl] Stale poll error for old env=${E}, current env=${e} — skipping onEnvironmentLost`),y=0,b=null;continue}if(C++,s(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${C}/3)`),f(`tengu_bridge_repl_env_lost`,{attempt:C}),C>3){s(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),m?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){y=0,b=null,r?.(`ready`),s(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),m?.();break}if(i instanceof x){let e=ee(i.errorType),t=T(i);s(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),f(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),l(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),m?.();break}let c=Date.now();S!==null&&c-S>6e4*2&&(s(`[bridge:repl] Detected system sleep (${Math.round((c-S)/1e3)}s gap), resetting poll error budget`),l(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:c-S}),y=0,b=null),S=c,y++,b===null&&(b=c);let u=c-b,d=te(i),_=k(i),v=o?.()??`unknown`;if(s(`[bridge:repl] Poll error (attempt ${y}, elapsed ${Math.round(u/1e3)}s, ws=${v}): ${_}`),f(`tengu_bridge_repl_poll_error`,{status:d,consecutiveErrors:y,elapsedMs:u}),y===1&&r?.(`reconnecting`,_),u>=9e5){s(`[bridge:repl] Poll failures exceeded ${j/1e3}s (${y} errors), giving up`),l(`info`,`bridge_repl_poll_give_up`),f(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:y,elapsedMs:u,lastStatus:d}),r?.(`failed`,`connection to server lost`);break}let w=Math.min(Oe*2**(y-1),ke);if(h().non_exclusive_heartbeat_interval_ms>0){let t=g?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await p(w,n)}}s(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}export{M 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"./figures-fES5sASd.js";import{F as i,In as a,Ln as o,Rn as s,b as c,t as l,tn as u,x as d}from"./src-DNHWYkls.js";import{t as f}from"./jsx-runtime-BTgGEFjL.js";import{Ht as p,K as m,at as h}from"./state-CUZTq6r0.js";import{o as g,s as _}from"./log-DVv8YiNo.js";import{Ar as v,Dh as y,Ew as b,Fr as x,HP as S,Nr as C,Oh as w,Sr as T,UP as E,ar as D,bC as O,br as k,fr as A,pi as j,wr as M,ww as N,xC as P}from"./loadAgentsDir-Bz0FfcVt.js";import{t as F}from"./useTerminalSize-DzV4aaTi.js";import{n as I,r as L}from"./modalContext-B1b0Gsro.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./crossProjectResume-DxO6TX30.js";function W(e){switch(e.resultType){case`sessionNotFound`:return`Session ${a.bold(e.arg)} was not found. Run ${a.bold(`/resume`)} without arguments to browse all sessions.`;case`multipleMatches`:return`Found ${e.count} sessions matching ${a.bold(e.arg)}. Run ${a.bold(`/resume`)} to pick one from the list.`}}function G({message:e,args:t,onDone:n}){return J.useEffect(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsxs)(c,{dimColor:!0,children:[r.pointer,` /resume `,t]}),(0,Y.jsx)(S,{children:(0,Y.jsx)(c,{children:e})})]})}function K({onDone:e,onResume:t}){let[n,r]=J.useState([]),[a,o]=J.useState([]),[s,l]=J.useState(!0),[f,p]=J.useState(!1),[g,_]=J.useState(!1),{rows:b}=i(),S=L(),w=J.useCallback(async(t,n)=>{l(!0);try{let i=q(t?await v():await x(n),h());if(i.length===0){e(`No conversations found to resume`);return}r(i)}catch{e(`Failed to load conversations`)}finally{l(!1)}},[e]);J.useEffect(()=>{async function e(){let e=await y(m());o(e),w(!1,e)}e()},[w]);let T=J.useCallback(()=>{let e=!g;_(e),w(e,a)},[g,w,a]);async function E(n){let r=P(A(n));if(!r){e(`Failed to resume conversation`);return}let i=M(n)?await C(n):n,o=U(i,g,a);if(o.isCrossProject){if(o.isSameRepoWorktree){p(!0),t(r,i,`slash_command_picker`);return}let n=await u(o.command);n&&process.stdout.write(n),e([``,`This conversation is from a different directory.`,``,`To resume, run:`,` ${o.command}`,``,`(Command copied to clipboard)`,``].join(`
|
|
2
|
+
`),{display:`user`});return}p(!0),t(r,i,`slash_command_picker`)}function D(){e(`Resume cancelled`,{display:`system`})}return s?(0,Y.jsxs)(d,{children:[(0,Y.jsx)(N,{}),(0,Y.jsx)(c,{children:` Loading conversations…`})]}):f?(0,Y.jsxs)(d,{children:[(0,Y.jsx)(N,{}),(0,Y.jsx)(c,{children:` Resuming conversation…`})]}):(0,Y.jsx)(R,{logs:n,maxHeight:S?Math.floor(b/2):b-2,onCancel:D,onSelect:E,onLogsChanged:()=>w(g,a),showAllProjects:g,onToggleAllProjects:T,onAgenticSearch:H})}function q(e,t){return e.filter(e=>!e.isSidechain&&A(e)!==t)}var J,Y,X;e((()=>{o(),n(),J=t(s(),1),p(),V(),E(),b(),I(),F(),l(),z(),B(),w(),g(),k(),O(),Y=f(),X=async(e,t,n)=>{let r=async(n,r,i)=>{try{await t.resume?.(n,r,i),e(void 0,{display:`skip`})}catch(t){_(t),e(`Failed to resume: ${t.message}`)}},i=n?.trim();if(!i)return(0,Y.jsx)(K,{onDone:e,onResume:r},Date.now());let a=await x(await y(m()));if(a.length===0){let t=`No conversations found to resume.`;return(0,Y.jsx)(G,{message:t,args:i,onDone:()=>e(t)})}let o=P(i);if(o){let e=a.filter(e=>A(e)===o).sort((e,t)=>t.modified.getTime()-e.modified.getTime());if(e.length>0){let t=e[0];return r(o,M(t)?await C(t):t,`slash_command_session_id`),null}let t=await D(o);if(t)return r(o,t,`slash_command_session_id`),null}if(T()){let t=await j(i,{exact:!0});if(t.length===1){let e=t[0],n=A(e);if(n)return r(n,M(e)?await C(e):e,`slash_command_title`),null}if(t.length>1){let n=W({resultType:`multipleMatches`,arg:i,count:t.length});return(0,Y.jsx)(G,{message:n,args:i,onDone:()=>e(n)})}}let s=W({resultType:`sessionNotFound`,arg:i});return(0,Y.jsx)(G,{message:s,args:i,onDone:()=>e(s)})}}))();export{X as call,q as filterResumableSessions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t){return t.openMessageSelector&&t.openMessageSelector(),{type:`skip`}}e((()=>{}))();export{t as call};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{l as r,s as i}from"./envUtils-CFG7IQID.js";import{l as a,p as o}from"./debug-CjIaNjpK.js";import{o as s,s as c}from"./log-DVv8YiNo.js";import{r as l,t as u}from"./execFileNoThrow-DdmR1mBS.js";import{i as d,o as f}from"./platform-BXz_rgpy.js";import{a as p,d as m,f as h,n as g}from"./stringUtils-U7kMYMJq.js";import{n as _,t as v}from"./bundledMode-DQNSSQbt.js";import{n as y,t as b}from"./findExecutable-D8vJrFnO.js";import{n as x,t as S}from"./distRoot-CJaacAHy.js";import{homedir as C}from"os";import*as w from"path";import{existsSync as T}from"fs";import{execFile as E,spawn as D}from"child_process";function O(e,t,n){let r=n??process.platform;return T(e)?{mode:`builtin`,command:e,args:[]}:(t===void 0?b(`rg`,[]).cmd:t??`rg`)===`rg`?{mode:`builtin`,command:e,args:[],note:`no ripgrep available on ${r}; install ripgrep via apt/pkg/brew`}:{mode:`system`,command:`rg`,args:[],note:`fallback: builtin rg unavailable on ${r}, using system rg`}}function k(){let e=L();return{rgPath:e.command,rgArgs:e.args,argv0:e.argv0}}function A(e){return e.includes(`os error 11`)||e.includes(`Resource temporarily unavailable`)}function j(e,t,n,r,i=!1){let{rgPath:a,rgArgs:o,argv0:s}=k(),c=i?[`-j`,`1`]:[],l=[...o,...c,...e,t],u=d()===`wsl`?6e4:2e4,f=parseInt(process.env.CLAUDE_CODE_GLOB_TIMEOUT_SECONDS||``,10)||0,p=f>0?f*1e3:u;if(s){let e=D(a,l,{argv0:s,signal:n,windowsHide:!0}),t=``,i=``,o=!1,c=!1;e.stdout?.on(`data`,e=>{o||(t+=e.toString(),t.length>R&&(t=t.slice(0,R),o=!0))}),e.stderr?.on(`data`,e=>{c||(i+=e.toString(),i.length>R&&(i=i.slice(0,R),c=!0))});let u,d=setTimeout(()=>{process.platform===`win32`?e.kill():(e.kill(`SIGTERM`),u=setTimeout(e=>e.kill(`SIGKILL`),5e3,e))},p),f=!1;return e.on(`close`,(e,n)=>{if(!f)if(f=!0,clearTimeout(d),clearTimeout(u),e===0||e===1)r(null,t,i);else{let a=Error(`ripgrep exited with code ${e}`);a.code=e??void 0,a.signal=n??void 0,r(a,t,i)}}),e.on(`error`,e=>{f||(f=!0,clearTimeout(d),clearTimeout(u),r(e,t,i))}),e}return E(a,l,{maxBuffer:R,signal:n,timeout:p,killSignal:process.platform===`win32`?void 0:`SIGKILL`},r)}async function M(e,t,n){await F();let{rgPath:r,rgArgs:i,argv0:a}=k();return new Promise((o,s)=>{let c=D(r,[...i,...e,t],{argv0:a,signal:n,windowsHide:!0,stdio:[`ignore`,`pipe`,`ignore`]}),l=0;c.stdout?.on(`data`,e=>{l+=g(e,`
|
|
2
|
+
`)});let u=!1;c.on(`close`,e=>{u||(u=!0,e===0||e===1?o(l):s(Error(`rg --files exited ${e}`)))}),c.on(`error`,e=>{u||(u=!0,s(e))})})}async function N(e,t,n){return await F(),H().catch(e=>{c(e)}),new Promise((r,i)=>{let a=(s,l,u,f)=>{if(!s){r(l.trim().split(`
|
|
3
|
+
`).map(e=>e.replace(/\r$/,``)).filter(Boolean));return}if(s.code===1){r([]);return}if([`ENOENT`,`EACCES`,`EPERM`].includes(s.code)){i(s);return}if(!f&&A(u)){o(`rg EAGAIN error detected, retrying with single-threaded mode (-j 1)`),h(`tengu_ripgrep_eagain_retry`,{}),j(e,t,n,(e,t,n)=>{a(e,t,n,!0)},!0);return}let p=l&&l.trim().length>0,m=s.signal===`SIGTERM`||s.signal===`SIGKILL`||s.code===`ABORT_ERR`,g=s.code===`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`,_=[];if(p&&(_=l.trim().split(`
|
|
4
|
+
`).map(e=>e.replace(/\r$/,``)).filter(Boolean),_.length>0&&(m||g)&&(_=_.slice(0,-1))),o(`rg error (signal=${s.signal}, code=${s.code}, stderr: ${u}), ${_.length} results`),s.code!==2&&s.code!==`ABORT_ERR`&&c(s),m&&_.length===0){i(new z(`Ripgrep search timed out after ${d()===`wsl`?60:20} seconds. The search may have matched files but did not complete in time. Try searching a more specific path or pattern.`,_));return}r(_)};j(e,t,n,(e,t,n)=>{a(e,t,n,!1)})})}function P(){let e=L();return{mode:e.mode,path:e.command,working:V?.working??null,note:V?.note??e.note}}async function F(){if(process.platform!==`darwin`||U)return;U=!0;let e=L();if(e.mode!==`builtin`)return;let t=e.command;if((await u(`codesign`,[`-vv`,`-d`,t],{preserveOutputOnError:!1})).stdout.split(`
|
|
5
|
+
`).find(e=>e.includes(`linker-signed`)))try{let e=await u(`codesign`,[`--sign`,`-`,`--force`,`--preserve-metadata=entitlements,requirements,flags,runtime`,t]);e.code!==0&&c(Error(`Failed to sign ripgrep: ${e.stdout} ${e.stderr}`));let n=await u(`xattr`,[`-d`,`com.apple.quarantine`,t]);n.code!==0&&c(Error(`Failed to remove quarantine: ${n.stdout} ${n.stderr}`))}catch(e){c(e)}}var I,L,R,z,B,V,H,U,W=e((()=>{n(),m(),v(),a(),x(),i(),l(),y(),s(),f(),p(),I=S,L=t(()=>{if(r(process.env.USE_BUILTIN_RIPGREP)){let{cmd:e}=b(`rg`,[]);if(e!==`rg`)return{mode:`system`,command:`rg`,args:[]}}if(_())return{mode:`embedded`,command:process.execPath,args:[`--no-config`],argv0:`rg`};let e=w.resolve(I,`vendor`,`ripgrep`);return O(process.platform===`win32`?w.resolve(e,`${process.arch}-win32`,`rg.exe`):w.resolve(e,`${process.arch}-${process.platform}`,`rg`))}),R=2e7,z=class extends Error{constructor(e,t){super(e),this.partialResults=t,this.name=`RipgrepTimeoutError`}},B=t(async(e,t,n=[])=>{if(w.resolve(e)!==w.resolve(C()))try{let r=[`--files`,`--hidden`];n.forEach(e=>{r.push(`--glob`,`!${e}`)});let i=await M(r,e,t);if(i===0)return 0;let a=10**Math.floor(Math.log10(i));return Math.round(i/a)*a}catch(e){e?.name!==`AbortError`&&c(e)}},(e,t,n=[])=>`${e}|${n.join(`,`)}`),V=null,H=t(async()=>{if(V!==null)return;let e=L();try{let t;if(e.argv0){let n=Bun.spawn([e.command,`--version`],{argv0:e.argv0,stderr:`ignore`,stdout:`pipe`}),[r,i]=await Promise.all([n.stdout.text(),n.exited]);t={code:i,stdout:r}}else t=await u(e.command,[...e.args,`--version`],{timeout:5e3});let n=t.code===0&&!!t.stdout&&t.stdout.startsWith(`ripgrep `);V={working:n,lastTested:Date.now(),config:e,note:e.note},o(`Ripgrep first use test: ${n?`PASSED`:`FAILED`} (mode=${e.mode}, path=${e.command})`),h(`tengu_ripgrep_availability`,{working:+!!n,using_system:+(e.mode===`system`)})}catch(t){V={working:!1,lastTested:Date.now(),config:e,note:e.note},c(t)}}),U=!1}));export{W as a,k as c,P as i,B as n,O as o,L as r,N as s,z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t}from"./ripgrep-BEWqxrpl.js";e();export{t as getRipgrepStatus};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
async function e(e,t){if(t?.list){console.log(`Recent versions:`),console.log(` (version listing requires access to the release registry)`),console.log(" Use `claude update --list` for available versions.");return}if(t?.safe){if(console.log(`Safe rollback: would install the server-pinned safe version.`),t.dryRun){console.log(` (dry run — no changes made)`);return}console.log(` Safe version pinning requires access to the release API.`),console.log(` Contact oncall for the current safe version.`);return}if(!e){console.error(`Usage: claude rollback [target]
|
|
2
|
+
|
|
3
|
+
Options:
|
|
4
|
+
-l, --list List recent published versions
|
|
5
|
+
--dry-run Show what would be installed
|
|
6
|
+
--safe Roll back to server-pinned safe version
|
|
7
|
+
|
|
8
|
+
Examples:
|
|
9
|
+
claude rollback 2.1.880
|
|
10
|
+
claude rollback --list
|
|
11
|
+
claude rollback --safe`),process.exitCode=1;return}if(console.log(`Rolling back to version ${e}...`),t?.dryRun){console.log(` (dry run — would install ${e})`);return}let{spawnSync:n}=await import(`child_process`),r=n(`npm`,[`install`,`-g`,`@anthropic-ai/claude-code@${e}`],{stdio:`inherit`});r.status===0?console.log(`Rolled back to ${e} successfully.`):(console.error(`Rollback failed with exit code ${r.status}`),process.exitCode=r.status??1)}export{e as rollback};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./runtimeObserver-CX6vepq9.js";t();export{o as RUNTIME_SESSION_ID,n as getRuntimeTurn,i as initSkillLearning,e as resetRuntimeLLMBookkeeping,r as resetRuntimeObserverForTest,a as runSkillLearningPostSampling};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-CFG7IQID.js";import{Oi as r,cM as i,sM as a,zi as o}from"./loadAgentsDir-Bz0FfcVt.js";import{r as s,t as c}from"./featureCheck-DKigAPal.js";import{a as l,c as u,i as d,l as f,n as p,o as m,r as ee,s as te,u as ne}from"./instinctParser-DxKdI3JC.js";import{C as h,S as g,b as _,c as re,f as ie,i as ae,m as oe,o as v,r as se,u as y}from"./skillGenerator-mEMjcmmm.js";import{a as ce,i as b,l as le,n as x,o as ue,t as de}from"./observationStore-DVBxrSdI.js";import{a as fe,s as pe}from"./projectContext-B21hXj9q.js";import{d as me,i as he,l as ge,p as _e}from"./sessionObserver-SpE_eglb.js";import{dirname as ve,join as S}from"node:path";import{existsSync as C}from"node:fs";import{randomBytes as ye}from"node:crypto";import{mkdir as w,readFile as be,readdir as T,rename as xe,unlink as Se,writeFile as E}from"node:fs/promises";function D(e,t){if(e.length===0)throw Error(`Cannot generate a command draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=g(t?.name??Ce(e)),i=Ee(e),a=t?.description??we(e),o=k(r,n,t),s=Te({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function O(e){await w(e.outputPath,{recursive:!0});let t=S(e.outputPath,`${e.name}.md`);return C(t)?t:(await E(t,e.content,`utf8`),r(),t)}function k(e,n,r){return r?.outputRoot?r.outputRoot:n===`project`?S(r?.cwd??process.cwd(),`.claude`,`commands`):r?.globalCommandsDir??S(t(),`commands`)}function Ce(e){return g([`learned`,...De(e,4)].join(`-`))||`learned-command`}function we(e){return(e[0]?.trigger??`Reuse the learned workflow`).replace(/\s+/g,` `).slice(0,120)}function Te(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# /${t}`,``,`## When to use`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
2
|
+
`),``,`## Steps`,``,i.map(e=>`- ${e.action}`).join(`
|
|
3
|
+
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).join(`
|
|
4
|
+
`),``].join(`
|
|
5
|
+
`)}function Ee(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function De(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`run`,`use`,`prefer`,`avoid`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var A=e((()=>{n(),o(),_()}));function j(e,t){if(e.length===0)throw Error(`Cannot generate an agent draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=g(t?.name??Oe(e)),i=je(e),a=t?.description??ke(e),o=N(r,n,t),s=Ae({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function M(e){await w(e.outputPath,{recursive:!0});let t=S(e.outputPath,`${e.name}.md`);return C(t)?t:(await E(t,e.content,`utf8`),r(),t)}function N(e,n,r){return r?.outputRoot?r.outputRoot:n===`project`?S(r?.cwd??process.cwd(),`.claude`,`agents`):r?.globalAgentsDir??S(t(),`agents`)}function Oe(e){return g([`learned`,`agent`,...Me(e,4)].join(`-`))||`learned-agent`}function ke(e){return(e[0]?.trigger??`Run the learned multi-step workflow`).replace(/\s+/g,` `).slice(0,120)}function Ae(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`You are the ${t} learned agent.`,``,`## Triggers`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
6
|
+
`),``,`## Playbook`,``,i.map(e=>`- ${e.action}`).join(`
|
|
7
|
+
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,20).join(`
|
|
8
|
+
`),``].join(`
|
|
9
|
+
`)}function je(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function Me(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`debug`,`investigate`,`research`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var P=e((()=>{n(),o(),_()}));function F(e){let t=new Map;for(let n of e){if(n.status!==`active`&&n.status!==`pending`)continue;let e=`${n.domain}:${Pe(n.trigger)}`,r=t.get(e)??[];r.push(n),t.set(e,r)}return Array.from(t.values()).filter(e=>e.length>=f().minClusterSize).map(e=>{let t=e.reduce((e,t)=>e+t.confidence,0)/e.length;return{target:I(e),trigger:e[0]?.trigger??`learned pattern`,domain:e[0]?.domain??`project`,instincts:e,averageConfidence:Number(t.toFixed(2))}}).sort((e,t)=>t.averageConfidence-e.averageConfidence)}function I(e){let t=Array.isArray(e)?e:e.instincts,n=t.map(e=>`${e.trigger} ${e.action}`).join(` `).toLowerCase();return/user asks|explicitly request|command|run /.test(n)?`command`:t.length>=4&&/(debug|investigate|research|multi-step)/.test(n)?`agent`:`skill`}function Ne(e,t){return F(e).filter(e=>e.target===`skill`&&h(e.instincts)).map(e=>ae(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function L(e,t){return F(e).filter(e=>e.target===`command`&&h(e.instincts)).map(e=>D(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function R(e,t){return F(e).filter(e=>e.target===`agent`&&h(e.instincts)).map(e=>j(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function Pe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,` `).split(/\s+/).filter(Boolean).slice(0,6).join(` `)}var z=e((()=>{_(),v(),A(),P(),ne()}));function B(e){let t=x(e),n=e?.project;return(e?.scope??n?.scope??`project`)===`global`||!n||n.projectId===`global`?S(t,`global`,`instincts`,`personal`):S(t,`projects`,n.projectId,`instincts`,`personal`)}async function V(e,t){let n=m(e);await w(B(t),{recursive:!0});let r=He(n.id,t),i=`${r}.${ye(6).toString(`hex`)}.tmp`;return await E(i,u(n)),await xe(i,r),n}async function H(e){let t=B(e),n=[];try{n=await T(t)}catch(e){if(e.code===`ENOENT`)return[];throw e}let r=[];for(let e of n.filter(e=>e.endsWith(`.json`))){let n=await be(S(t,e),`utf8`);r.push(te(n))}return r.sort((e,t)=>e.id.localeCompare(t.id))}function Fe(e,t){let n=U.then(()=>Ie(e,t));return U=n.catch(()=>{}),n}async function Ie(e,t){let n=await H(t),r=n.find(t=>t.id===e.id)??n.find(t=>t.trigger.toLowerCase()===e.trigger.toLowerCase()&&l(t,e)),i=new Date().toISOString();if(!r)return V(e,t);let a=l(r,e),o=a?-.1:ze(e.evidenceOutcome),s=p(r.confidence+o),c=Le(r.status,s,a);return V(m({...r,confidence:s,evidence:[...r.evidence,...e.evidence],evidenceOutcome:e.evidenceOutcome??r.evidenceOutcome,observationIds:[...r.observationIds??[],...e.observationIds??[]],updatedAt:i,status:c}),t)}function Le(e,t,n){return n&&t<.3?`conflict-hold`:e===`conflict-hold`&&t>=.5||e===`pending`&&t>=.8?`active`:e}async function Re(e){let t=await H(e),n=Date.now(),r=0;for(let i of t){if(i.status!==`pending`&&i.status!==`active`)continue;let t=Date.parse(i.updatedAt);if(Number.isNaN(t))continue;let a=Math.floor((n-t)/We);if(a<1)continue;let o=-Ue*a,s=p(i.confidence+o);s!==i.confidence&&(await V(m({...i,confidence:s,updatedAt:new Date(n).toISOString()}),e),r+=1)}return r}function ze(e){return e===`failure`?-.05:.05}async function Be(e,t){let n=await H(t);return await w(ve(e),{recursive:!0}),await E(e,`${JSON.stringify(n,null,2)}\n`),n}async function Ve(e,t){let n=await H(t),r=Date.now()-e*24*60*60*1e3,i=[];for(let e of n)e.status===`pending`&&Date.parse(e.updatedAt)<r&&(await Se(He(e.id,t)),i.push(e));return i}function He(e,t){return S(B(t),`${e}.json`)}var U,Ue,We,W=e((()=>{b(),d(),U=Promise.resolve(),Ue=.02,We=10080*60*1e3}));function Ge(e){if(G.add(e),G.size>Xe){let e=G.size-Ze,t=G.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;G.delete(e.value)}}}function Ke(e,t=2,n=.8){let r=new Map;for(let t of e){if(t.scope!==`project`)continue;let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}return Array.from(r.entries()).flatMap(([e,r])=>{let i=Array.from(new Set(r.map(e=>e.projectId).filter(Boolean))),a=r.reduce((e,t)=>e+t.confidence,0)/r.length;return i.length>=t&&a>=n?[{instinctId:e,projectIds:i,averageConfidence:Number(a.toFixed(2))}]:[]})}async function qe(e={}){let t=e.minProjects??2,n=e.minConfidence??.8,r=await Je(e.rootDir),i=Ke(r,t,n),a=[];for(let t of i){if(G.has(t.instinctId))continue;let n=r.find(e=>e.id===t.instinctId);n&&(await V({...n,scope:`global`,projectId:void 0,projectName:void 0,confidence:t.averageConfidence,updatedAt:new Date().toISOString()},{rootDir:e.rootDir,scope:`global`,project:Ye(e.rootDir)}),Ge(t.instinctId),a.push(t))}return a}async function Je(e){let t=S(x(e?{rootDir:e}:void 0),`projects`);if(!C(t))return[];let n=await T(t,{withFileTypes:!0}),r=[];for(let i of n){if(!i.isDirectory())continue;let n=await H({rootDir:e,project:{projectId:i.name,projectName:i.name,scope:`project`,source:`git_root`,cwd:t,storageDir:S(t,i.name)},scope:`project`});r.push(...n)}return r}function Ye(e){let t=x(e?{rootDir:e}:void 0);return{projectId:`global`,projectName:`Global`,scope:`global`,source:`global`,cwd:t,storageDir:S(t,`global`)}}var Xe,Ze,G,Qe=e((()=>{W(),b(),Xe=256,Ze=192,G=new Set}));function $e(){X=0,Z=0,Q.clear()}function et(){return J}function tt(){if(!q){q=!0;try{_e()}catch{}i(it),nt().catch(()=>{})}}async function nt(){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE)return;let e={project:pe(process.cwd())};await Promise.allSettled([Re(e),ce(e),Ve(30,e)])}function rt(e){try{let t=x();return e.startsWith(t)}catch{return!1}}async function it(e){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE||!e.querySource?.startsWith(`repl_main_thread`)||e.toolUseContext.agentId)return;let t=process.cwd();if(rt(t))return;let n=pe(t),r={project:n};++J;let i=[];for(let t of st(e.messages,n))i.push(await de(t,r));let a=(await ue(r)).filter(e=>e.source===`tool-hook`&&e.sessionId===`runtime-session`&&typeof e.timestamp==`string`&&e.timestamp>Y);i.push(...a);for(let e of a)e.timestamp>Y&&(Y=e.timestamp);if(i.length===0)return;let o=Date.now(),{llm:c}=f(),l=i.length>=5&&X<c.maxCallsPerSession&&o-Z>=c.cooldownMs,u;if(l)X++,Z=o,u=await ge(i,{project:n});else{let{heuristicObserverBackend:e}=await import(`./sessionObserver-CESI-uVZ.js`),t=e.analyze(i,{project:n});u=Array.isArray(t)?t:await t}for(let e of u)await Fe(ee(e),r);await ot(r)}function at(){J=0,Y=``,$e()}async function ot(e){let n=await H(e),r=process.cwd(),i=[S(r,`.claude`,`skills`),S(t(),`skills`)],a=F(n).filter(e=>e.target===`skill`&&h(e.instincts));for(let e of a){let t=await se(e.instincts,{cwd:r,scope:e.instincts[0]?.scope??`project`},i);if(t.action===`append-evidence`)continue;let n=t.draft;C(S(n.outputPath,`SKILL.md`))||await re(ie(n,await y(`skill`,n,i)))}let o=L(n,{cwd:r});for(let e of o)(await y(`command`,e,[S(r,`.claude`,`commands`),S(t(),`commands`)])).length>0||await O(e);let s=R(n,{cwd:r});for(let e of s)(await y(`agent`,e,[S(r,`.claude`,`agents`),S(t(),`agents`)])).length>0||await M(e);await qe()}function st(e,t){let n=K,r={sessionId:n,projectId:t.projectId,projectName:t.projectName,cwd:t.cwd,timestamp:new Date().toISOString(),source:`hook`};return e.flatMap(e=>{let t=`${n}:${String(e.uuid)}`;if(Q.has(t))return[];if(Q.add(t),Q.size>dt){let e=Q.size-$,t=Q.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;Q.delete(e.value)}}if(e.type===`user`){let t=ut(e.message?.content);if(t.length>0)return t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_complete`,toolName:e.toolName,toolOutput:e.output,outcome:e.isError?`failure`:`success`}));let n=ct(e.message?.content);return n.trim()?[{...r,id:crypto.randomUUID(),event:`user_message`,messageText:n}]:[]}if(e.type===`assistant`){let t=lt(e.message?.content),n=ct(e.message?.content);return[...t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_start`,toolName:e.toolName,toolInput:e.input})),...n.trim()?[{...r,id:crypto.randomUUID(),event:`assistant_message`,messageText:n}]:[]]}return[]})}function ct(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
|
|
10
|
+
`):``}function lt(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_use`?[{toolName:String(t.name??`unknown_tool`),input:le(t.input)}]:[]}):[]}function ut(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_result`?[{toolName:String(t.name??t.tool_name??`unknown_tool`),output:le(t.content),isError:t.is_error===!0}]:[]}):[]}var K,q,J,Y,X,Z,Q,dt,$,ft=e((()=>{a(),ne(),c(),b(),fe(),he(),d(),me(),W(),oe(),z(),v(),_(),A(),P(),Qe(),n(),K=`runtime-session`,q=!1,J=0,Y=``,X=0,Z=0,Q=new Set,dt=1e3,$=500}));export{O as A,j as C,D,M as E,k as O,z as S,P as T,I as _,$e as a,L as b,qe as c,Be as d,W as f,Fe as g,V as h,ft as i,A as k,Ke as l,Ve as m,et as n,at as o,H as p,tt as r,it as s,K as t,Qe as u,F as v,N as w,Ne as x,R as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{gI as e,pI as t}from"./loadAgentsDir-Bz0FfcVt.js";e();export{t as SandboxManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Q as t,Rn as n,T as r,b as i,i as a,n as o,nt as s,p as c,r as l,t as u,v as d,x as f}from"./src-DNHWYkls.js";import{t as p}from"./jsx-runtime-BTgGEFjL.js";import{Ht as m,w as h}from"./state-CUZTq6r0.js";import{Gs as g,Ls as _,Vs as v}from"./growthbook-p4aJ_UMv.js";import{i as y,o as b}from"./platform-BXz_rgpy.js";import{RT as x,gI as S,mI as C,pI as w,yI as T,zT as E}from"./loadAgentsDir-Bz0FfcVt.js";import{t as D}from"./useKeybinding-DAQL_dB_.js";import{relative as O}from"path";function k(){let e=w.isSandboxingEnabled(),t=w.checkDependencies(),n=t.warnings.length>0?(0,A.jsx)(f,{marginTop:1,flexDirection:`column`,children:t.warnings.map((e,t)=>(0,A.jsx)(i,{dimColor:!0,children:e},t))}):null;if(!e)return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled`}),n]});let r=w.getFsReadConfig(),a=w.getFsWriteConfig(),o=w.getNetworkRestrictionConfig(),s=w.getAllowUnixSockets(),c=w.getExcludedCommands(),l=w.getLinuxGlobPatternWarnings();return(0,A.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,A.jsxs)(f,{flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Excluded Commands:`}),(0,A.jsx)(i,{dimColor:!0,children:c.length>0?c.join(`, `):`None`})]}),r.denyOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Read Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,r.denyOnly.join(`, `)]}),r.allowWithinDeny&&r.allowWithinDeny.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed within denied: `,r.allowWithinDeny.join(`, `)]})]}),a.allowOnly.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Filesystem Write Restrictions:`}),(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,a.allowOnly.join(`, `)]}),a.denyWithinAllow.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied within allowed: `,a.denyWithinAllow.join(`, `)]})]}),(o.allowedHosts&&o.allowedHosts.length>0||o.deniedHosts&&o.deniedHosts.length>0)&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsxs)(i,{bold:!0,color:`permission`,children:[`Network Restrictions`,T()?` (Managed)`:``,`:`]}),o.allowedHosts&&o.allowedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Allowed: `,o.allowedHosts.join(`, `)]}),o.deniedHosts&&o.deniedHosts.length>0&&(0,A.jsxs)(i,{dimColor:!0,children:[`Denied: `,o.deniedHosts.join(`, `)]})]}),s&&s.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`permission`,children:`Allowed Unix Sockets:`}),(0,A.jsx)(i,{dimColor:!0,children:s.join(`, `)})]}),l.length>0&&(0,A.jsxs)(f,{marginTop:1,flexDirection:`column`,children:[(0,A.jsx)(i,{bold:!0,color:`warning`,children:`⚠ Warning: Glob patterns not fully supported on Linux`}),(0,A.jsxs)(i,{dimColor:!0,children:[`The following patterns will be ignored: `,l.slice(0,3).join(`, `),l.length>3&&` (${l.length-3} more)`]})]}),n]})}var A,j=e((()=>{n(),u(),S(),A=p()}));function M({depCheck:e}){let t=y()===`macos`,n=e.errors.some(e=>e.includes(`ripgrep`)),r=e.errors.some(e=>e.includes(`bwrap`)),a=e.errors.some(e=>e.includes(`socat`)),o=e.warnings.length>0,s=e.errors.filter(e=>!e.includes(`ripgrep`)&&!e.includes(`bwrap`)&&!e.includes(`socat`));return(0,N.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[t&&(0,N.jsx)(f,{flexDirection:`column`,children:(0,N.jsxs)(i,{children:[`seatbelt: `,(0,N.jsx)(i,{color:`success`,children:`built-in (macOS)`})]})}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`ripgrep (rg): `,n?(0,N.jsx)(i,{color:`error`,children:`not found`}):(0,N.jsx)(i,{color:`success`,children:`found`})]}),n&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· `,t?`brew install ripgrep`:`apt install ripgrep`]})]}),!t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`bubblewrap (bwrap):`,` `,r?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),r&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install bubblewrap`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`socat: `,a?(0,N.jsx)(i,{color:`error`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`})]}),a&&(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· apt install socat`]})]}),(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{children:[`seccomp filter:`,` `,o?(0,N.jsx)(i,{color:`warning`,children:`not installed`}):(0,N.jsx)(i,{color:`success`,children:`installed`}),o&&(0,N.jsx)(i,{dimColor:!0,children:` (required to block unix domain sockets)`})]}),o&&(0,N.jsxs)(f,{flexDirection:`column`,children:[(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· npm install -g @anthropic-ai/sandbox-runtime`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`· or copy vendor/seccomp/* from sandbox-runtime and set`]}),(0,N.jsxs)(i,{dimColor:!0,children:[` `,`sandbox.seccomp.bpfPath and applyPath in settings.json`]})]})]})]}),s.map(e=>(0,N.jsx)(i,{color:`error`,children:e},e))]})}var N,P=e((()=>{n(),u(),b(),N=p()}));function F({onComplete:e}){let t=w.isSandboxingEnabled(),n=w.areSandboxSettingsLockedByPolicy(),r=w.areUnsandboxedCommandsAllowed();return t?n?(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(i,{color:`subtle`,children:`Override settings are managed by a higher-priority configuration and cannot be changed locally.`}),(0,L.jsx)(f,{marginTop:1,children:(0,L.jsxs)(i,{dimColor:!0,children:[`Current setting: `,r?`Allow unsandboxed fallback`:`Strict sandbox mode`]})})]}):(0,L.jsx)(I,{onComplete:e,currentMode:r?`open`:`closed`}):(0,L.jsx)(f,{flexDirection:`column`,paddingY:1,children:(0,L.jsx)(i,{color:`subtle`,children:`Sandbox is not enabled. Enable sandbox to configure override settings.`})})}function I({onComplete:e,currentMode:n}){let[o]=r(),{headerFocused:s,focusHeader:c}=a(),l=d(`success`,o)(`(current)`),u=[{label:n===`open`?`Allow unsandboxed fallback ${l}`:`Allow unsandboxed fallback`,value:`open`},{label:n===`closed`?`Strict sandbox mode ${l}`:`Strict sandbox mode`,value:`closed`}];async function p(t){let n=t;await w.setSandboxSettings({allowUnsandboxedCommands:n===`open`}),e(n===`open`?`✓ Unsandboxed fallback allowed - commands can run outside sandbox when necessary`:"✓ Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[(0,L.jsx)(f,{marginBottom:1,children:(0,L.jsx)(i,{bold:!0,children:`Configure Overrides:`})}),(0,L.jsx)(x,{options:u,onChange:p,onCancel:()=>e(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,L.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Allow unsandboxed fallback:`}),` `,`When a command fails due to sandbox restrictions, Claude can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions).`]}),(0,L.jsxs)(i,{dimColor:!0,children:[(0,L.jsx)(i,{bold:!0,dimColor:!0,children:`Strict sandbox mode:`}),` `,`All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands.`]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Learn more:`,` `,(0,L.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing#configure-sandboxing`,children:`code.claude.com/docs/en/sandboxing#configure-sandboxing`})]})]})]})}var L,R=e((()=>{n(),u(),S(),E(),L=p()}));function z({onComplete:e,depCheck:t}){let[n]=r(),i=w.isSandboxingEnabled(),a=w.isAutoAllowBashIfSandboxedEnabled(),u=t.warnings.length>0,f=v().sandbox?.network?.allowAllUnixSockets,p=u&&!f,m=i?a?`auto-allow`:`regular`:`disabled`,h=d(`success`,n)(`(current)`),g=[{label:m===`auto-allow`?`Sandbox BashTool, with auto-allow ${h}`:`Sandbox BashTool, with auto-allow`,value:`auto-allow`},{label:m===`regular`?`Sandbox BashTool, with regular permissions ${h}`:`Sandbox BashTool, with regular permissions`,value:`regular`},{label:m===`disabled`?`No Sandbox ${h}`:`No Sandbox`,value:`disabled`}];async function _(t){switch(t){case`auto-allow`:await w.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),e(`✓ Sandbox enabled with auto-allow for bash commands`);break;case`regular`:await w.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),e(`✓ Sandbox enabled with regular bash permissions`);break;case`disabled`:await w.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),e(`○ Sandbox disabled`);break}}s({"confirm:no":()=>e(void 0,{display:`skip`})},{context:`Settings`});let y=(0,V.jsx)(o,{title:`Mode`,children:(0,V.jsx)(B,{showSocketWarning:p,options:g,onSelect:_,onComplete:e})},`mode`),b=(0,V.jsx)(o,{title:`Overrides`,children:(0,V.jsx)(F,{onComplete:e})},`overrides`),x=(0,V.jsx)(o,{title:`Config`,children:(0,V.jsx)(k,{})},`config`);return(0,V.jsx)(c,{color:`permission`,children:(0,V.jsx)(l,{title:`Sandbox:`,color:`permission`,defaultTab:`Mode`,children:t.errors.length>0?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[y,...u?[(0,V.jsx)(o,{title:`Dependencies`,children:(0,V.jsx)(M,{depCheck:t})},`dependencies`)]:[],b,x]})})}function B({showSocketWarning:e,options:n,onSelect:r,onComplete:o}){let{headerFocused:s,focusHeader:c}=a();return(0,V.jsxs)(f,{flexDirection:`column`,paddingY:1,children:[e&&(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{color:`warning`,children:`Cannot block unix domain sockets (see Dependencies tab)`})}),(0,V.jsx)(f,{marginBottom:1,children:(0,V.jsx)(i,{bold:!0,children:`Configure Mode:`})}),(0,V.jsx)(x,{options:n,onChange:r,onCancel:()=>o(void 0,{display:`skip`}),onUpFromFirstItem:c,isDisabled:s}),(0,V.jsxs)(f,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,V.jsxs)(i,{dimColor:!0,children:[(0,V.jsx)(i,{bold:!0,dimColor:!0,children:`Auto-allow mode:`}),` `,`Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected.`]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Learn more: `,(0,V.jsx)(t,{url:`https://code.claude.com/docs/en/sandboxing`,children:`code.claude.com/docs/en/sandboxing`})]})]})]})}var V,H=e((()=>{n(),u(),D(),S(),g(),E(),j(),P(),R(),V=p()}));async function U(e,t,n){let r=v().theme||`light`,i=y();if(!w.isSupportedPlatform()){let t=i===`wsl`?`Error: Sandboxing requires WSL2. WSL1 is not supported.`:`Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.`;return e(d(`error`,r)(t)),null}let a=w.checkDependencies();if(!w.isPlatformInEnabledList())return e(d(`error`,r)(`Error: Sandboxing is disabled for this platform (${i}) via the enabledPlatforms setting.`)),null;if(w.areSandboxSettingsLockedByPolicy())return e(d(`error`,r)(`Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.`)),null;let o=n?.trim()||``;if(!o)return(0,W.jsx)(z,{onComplete:e,depCheck:a});if(o){let t=o.split(` `)[0];if(t===`exclude`){let t=o.slice(8).trim();if(!t)return e(d(`error`,r)(`Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")`)),null;let n=t.replace(/^["']|["']$/g,``);C(n);let i=_(`localSettings`),a=i?O(h(),i):`.claude/settings.local.json`;return e(d(`success`,r)(`Added "${n}" to excluded commands in ${a}`)),null}else return e(d(`error`,r)(`Error: Unknown subcommand "${t}". Available subcommand: exclude`)),null}return null}var W;e((()=>{n(),m(),H(),u(),b(),S(),g(),W=p()}))();export{U as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";function t(e){let t=e,n=``,r=0;for(;t!==n&&r<10;)n=t,t=t.normalize(`NFKC`),t=t.replace(/[\p{Cf}\p{Co}\p{Cn}]/gu,``),t=t.replace(/[\u200B-\u200F]/g,``).replace(/[\u202A-\u202E]/g,``).replace(/[\u2066-\u2069]/g,``).replace(/[\uFEFF]/g,``).replace(/[\uE000-\uF8FF]/g,``),r++;if(r>=10)throw Error(`Unicode sanitization reached maximum iterations (10) for input: ${e.slice(0,100)}`);return t}function n(e){if(typeof e==`string`)return t(e);if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={};for(let[r,i]of Object.entries(e))t[n(r)]=n(i);return t}return e}var r=e((()=>{}));export{t as n,n as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./chunk-DR8-3Aex.js";var t=e(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),n=e(((e,t)=>{t.exports=typeof process==`object`&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),r=e(((e,r)=>{var{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:o}=t(),s=n();e=r.exports={};var c=e.re=[],l=e.safeRe=[],u=e.src=[],d=e.safeSrc=[],f=e.t={},p=0,m=`[a-zA-Z0-9-]`,h=[[`\\s`,1],[`\\d`,o],[m,a]],g=e=>{for(let[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},_=(e,t,n)=>{let r=g(t),i=p++;s(e,i,t),f[e]=i,u[i]=t,d[i]=r,c[i]=new RegExp(t,n?`g`:void 0),l[i]=new RegExp(r,n?`g`:void 0)};_(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),_(`NUMERICIDENTIFIERLOOSE`,`\\d+`),_(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${m}*`),_(`MAINVERSION`,`(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})\\.(${u[f.NUMERICIDENTIFIER]})`),_(`MAINVERSIONLOOSE`,`(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})\\.(${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASEIDENTIFIER`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIER]})`),_(`PRERELEASEIDENTIFIERLOOSE`,`(?:${u[f.NONNUMERICIDENTIFIER]}|${u[f.NUMERICIDENTIFIERLOOSE]})`),_(`PRERELEASE`,`(?:-(${u[f.PRERELEASEIDENTIFIER]}(?:\\.${u[f.PRERELEASEIDENTIFIER]})*))`),_(`PRERELEASELOOSE`,`(?:-?(${u[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[f.PRERELEASEIDENTIFIERLOOSE]})*))`),_(`BUILDIDENTIFIER`,`${m}+`),_(`BUILD`,`(?:\\+(${u[f.BUILDIDENTIFIER]}(?:\\.${u[f.BUILDIDENTIFIER]})*))`),_(`FULLPLAIN`,`v?${u[f.MAINVERSION]}${u[f.PRERELEASE]}?${u[f.BUILD]}?`),_(`FULL`,`^${u[f.FULLPLAIN]}$`),_(`LOOSEPLAIN`,`[v=\\s]*${u[f.MAINVERSIONLOOSE]}${u[f.PRERELEASELOOSE]}?${u[f.BUILD]}?`),_(`LOOSE`,`^${u[f.LOOSEPLAIN]}$`),_(`GTLT`,`((?:<|>)?=?)`),_(`XRANGEIDENTIFIERLOOSE`,`${u[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_(`XRANGEIDENTIFIER`,`${u[f.NUMERICIDENTIFIER]}|x|X|\\*`),_(`XRANGEPLAIN`,`[v=\\s]*(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:\\.(${u[f.XRANGEIDENTIFIER]})(?:${u[f.PRERELEASE]})?${u[f.BUILD]}?)?)?`),_(`XRANGEPLAINLOOSE`,`[v=\\s]*(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[f.XRANGEIDENTIFIERLOOSE]})(?:${u[f.PRERELEASELOOSE]})?${u[f.BUILD]}?)?)?`),_(`XRANGE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAIN]}$`),_(`XRANGELOOSE`,`^${u[f.GTLT]}\\s*${u[f.XRANGEPLAINLOOSE]}$`),_(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),_(`COERCE`,`${u[f.COERCEPLAIN]}(?:$|[^\\d])`),_(`COERCEFULL`,u[f.COERCEPLAIN]+`(?:${u[f.PRERELEASE]})?(?:${u[f.BUILD]})?(?:$|[^\\d])`),_(`COERCERTL`,u[f.COERCE],!0),_(`COERCERTLFULL`,u[f.COERCEFULL],!0),_(`LONETILDE`,`(?:~>?)`),_(`TILDETRIM`,`(\\s*)${u[f.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,_(`TILDE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAIN]}$`),_(`TILDELOOSE`,`^${u[f.LONETILDE]}${u[f.XRANGEPLAINLOOSE]}$`),_(`LONECARET`,`(?:\\^)`),_(`CARETTRIM`,`(\\s*)${u[f.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,_(`CARET`,`^${u[f.LONECARET]}${u[f.XRANGEPLAIN]}$`),_(`CARETLOOSE`,`^${u[f.LONECARET]}${u[f.XRANGEPLAINLOOSE]}$`),_(`COMPARATORLOOSE`,`^${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]})$|^$`),_(`COMPARATOR`,`^${u[f.GTLT]}\\s*(${u[f.FULLPLAIN]})$|^$`),_(`COMPARATORTRIM`,`(\\s*)${u[f.GTLT]}\\s*(${u[f.LOOSEPLAIN]}|${u[f.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,_(`HYPHENRANGE`,`^\\s*(${u[f.XRANGEPLAIN]})\\s+-\\s+(${u[f.XRANGEPLAIN]})\\s*$`),_(`HYPHENRANGELOOSE`,`^\\s*(${u[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[f.XRANGEPLAINLOOSE]})\\s*$`),_(`STAR`,`(<|>)?=?\\s*\\*`),_(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),_(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),i=e(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),a=e(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),o=e(((e,o)=>{var s=n(),{MAX_LENGTH:c,MAX_SAFE_INTEGER:l}=t(),{safeRe:u,t:d}=r(),f=i(),{compareIdentifiers:p}=a();o.exports=class e{constructor(t,n){if(n=f(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>c)throw TypeError(`version is longer than ${c} characters`);s(`SemVer`,t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=t.trim().match(n.loose?u[d.LOOSE]:u[d.FULL]);if(!r)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>l||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>l||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>l||this.patch<0)throw TypeError(`Invalid patch version`);r[4]?this.prerelease=r[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<l)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(s(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let e=this.prerelease[n],r=t.prerelease[n];if(s(`prerelease compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let e=this.build[n],r=t.build[n];if(s(`build compare`,n,e,r),e===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(e===void 0)return-1;if(e===r)continue;return p(e,r)}while(++n)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?u[d.PRERELEASELOOSE]:u[d.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];n===!1&&(r=[t]),p(this.prerelease[0],t)===0?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),s=e(((e,t)=>{var n=o();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}})),c=e(((e,t)=>{var n=o();t.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))})),l=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>0})),u=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<0})),d=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)===0})),f=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)!==0})),p=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)>=0})),m=e(((e,t)=>{var n=c();t.exports=(e,t,r)=>n(e,t,r)<=0})),h=e(((e,t)=>{var n=d(),r=f(),i=l(),a=p(),o=u(),s=m();t.exports=(e,t,c,l)=>{switch(t){case`===`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e===c;case`!==`:return typeof e==`object`&&(e=e.version),typeof c==`object`&&(c=c.version),e!==c;case``:case`=`:case`==`:return n(e,c,l);case`!=`:return r(e,c,l);case`>`:return i(e,c,l);case`>=`:return a(e,c,l);case`<`:return o(e,c,l);case`<=`:return s(e,c,l);default:throw TypeError(`Invalid operator: ${t}`)}}})),g=e(((e,t)=>{var n=o(),i=s(),{safeRe:a,t:c}=r();t.exports=(e,t)=>{if(e instanceof n)return e;if(typeof e==`number`&&(e=String(e)),typeof e!=`string`)return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?a[c.COERCEFULL]:a[c.COERCE]);else{let n=t.includePrerelease?a[c.COERCERTLFULL]:a[c.COERCERTL],i;for(;(i=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||i.index+i[0].length!==r.index+r[0].length)&&(r=i),n.lastIndex=i.index+i[1].length+i[2].length;n.lastIndex=-1}if(r===null)return null;let o=r[2];return i(`${o}.${r[3]||`0`}.${r[4]||`0`}${t.includePrerelease&&r[5]?`-${r[5]}`:``}${t.includePrerelease&&r[6]?`+${r[6]}`:``}`,t)}})),_=e(((e,t)=>{t.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}})),v=e(((e,a)=>{var s=/\s+/g;a.exports=class e{constructor(t,n){if(n=l(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof u)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(s,` `),this.set=this.raw.split(`||`).map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!S(e[0])),this.set.length===0)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&C(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted=``;for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+=`||`);let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=` `),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&b)|(this.options.loose&&x))+`:`+e,n=c.get(t);if(n)return n;let r=this.options.loose,i=r?p[m.HYPHENRANGELOOSE]:p[m.HYPHENRANGE];e=e.replace(i,F(this.options.includePrerelease)),d(`hyphen replace`,e),e=e.replace(p[m.COMPARATORTRIM],h),d(`comparator trim`,e),e=e.replace(p[m.TILDETRIM],g),d(`tilde trim`,e),e=e.replace(p[m.CARETTRIM],v),d(`caret trim`,e);let a=e.split(` `).map(e=>T(e,this.options)).join(` `).split(/\s+/).map(e=>P(e,this.options));r&&(a=a.filter(e=>(d(`loose invalid filter`,e,this.options),!!e.match(p[m.COMPARATORLOOSE])))),d(`range list`,a);let o=new Map,s=a.map(e=>new u(e,this.options));for(let e of s){if(S(e))return[e];o.set(e.value,e)}o.size>1&&o.has(``)&&o.delete(``);let l=[...o.values()];return c.set(t,l),l}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Range is required`);return this.set.some(e=>w(e,n)&&t.set.some(t=>w(t,n)&&e.every(e=>t.every(t=>e.intersects(t,n)))))}test(e){if(!e)return!1;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(I(this.set[t],e,this.options))return!0;return!1}};var c=new(_()),l=i(),u=y(),d=n(),f=o(),{safeRe:p,t:m,comparatorTrimReplace:h,tildeTrimReplace:g,caretTrimReplace:v}=r(),{FLAG_INCLUDE_PRERELEASE:b,FLAG_LOOSE:x}=t(),S=e=>e.value===`<0.0.0-0`,C=e=>e.value===``,w=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},T=(e,t)=>(e=e.replace(p[m.BUILD],``),d(`comp`,e,t),e=k(e,t),d(`caret`,e),e=D(e,t),d(`tildes`,e),e=j(e,t),d(`xrange`,e),e=N(e,t),d(`stars`,e),e),E=e=>!e||e.toLowerCase()===`x`||e===`*`,D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(` `),O=(e,t)=>{let n=t.loose?p[m.TILDELOOSE]:p[m.TILDE];return e.replace(n,(t,n,r,i,a)=>{d(`tilde`,e,t,n,r,i,a);let o;return E(n)?o=``:E(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:E(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(d(`replaceTilde pr`,a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,d(`tilde return`,o),o})},k=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(` `),A=(e,t)=>{d(`caret`,e,t);let n=t.loose?p[m.CARETLOOSE]:p[m.CARET],r=t.includePrerelease?`-0`:``;return e.replace(n,(t,n,i,a,o)=>{d(`caret`,e,t,n,i,a,o);let s;return E(n)?s=``:E(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:E(a)?s=n===`0`?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(d(`replaceCaret pr`,o),s=n===`0`?i===`0`?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(d(`no pr`),s=n===`0`?i===`0`?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),d(`caret return`,s),s})},j=(e,t)=>(d(`replaceXRanges`,e,t),e.split(/\s+/).map(e=>M(e,t)).join(` `)),M=(e,t)=>{e=e.trim();let n=t.loose?p[m.XRANGELOOSE]:p[m.XRANGE];return e.replace(n,(n,r,i,a,o,s)=>{d(`xRange`,e,n,r,i,a,o,s);let c=E(i),l=c||E(a),u=l||E(o),f=u;return r===`=`&&f&&(r=``),s=t.includePrerelease?`-0`:``,c?n=r===`>`||r===`<`?`<0.0.0-0`:`*`:r&&f?(l&&(a=0),o=0,r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),r===`<`&&(s=`-0`),n=`${r+i}.${a}.${o}${s}`):l?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:u&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),d(`xRange return`,n),n})},N=(e,t)=>(d(`replaceStars`,e,t),e.trim().replace(p[m.STAR],``)),P=(e,t)=>(d(`replaceGTE0`,e,t),e.trim().replace(p[t.includePrerelease?m.GTE0PRE:m.GTE0],``)),F=e=>(t,n,r,i,a,o,s,c,l,u,d,f)=>(n=E(r)?``:E(i)?`>=${r}.0.0${e?`-0`:``}`:E(a)?`>=${r}.${i}.0${e?`-0`:``}`:o?`>=${n}`:`>=${n}${e?`-0`:``}`,c=E(l)?``:E(u)?`<${+l+1}.0.0-0`:E(d)?`<${l}.${+u+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`,`${n} ${c}`.trim()),I=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(d(e[n].semver),e[n].semver!==u.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}})),y=e(((e,t)=>{var a=Symbol(`SemVer ANY`);t.exports=class e{static get ANY(){return a}constructor(t,n){if(n=s(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(` `),d(`comparator`,t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===a?this.value=``:this.value=this.operator+this.semver.version,d(`comp`,this)}parse(e){let t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: ${e}`);this.operator=n[1]===void 0?``:n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new f(n[2],this.options.loose):this.semver=a}toString(){return this.value}test(e){if(d(`Comparator.test`,e,this.options.loose),this.semver===a||e===a)return!0;if(typeof e==`string`)try{e=new f(e,this.options)}catch{return!1}return u(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw TypeError(`a Comparator is required`);return this.operator===``?this.value===``?!0:new p(t.value,n).test(this.value):t.operator===``?t.value===``?!0:new p(this.value,n).test(t.semver):(n=s(n),n.includePrerelease&&(this.value===`<0.0.0-0`||t.value===`<0.0.0-0`)||!n.includePrerelease&&(this.value.startsWith(`<0.0.0`)||t.value.startsWith(`<0.0.0`))?!1:!!(this.operator.startsWith(`>`)&&t.operator.startsWith(`>`)||this.operator.startsWith(`<`)&&t.operator.startsWith(`<`)||this.semver.version===t.semver.version&&this.operator.includes(`=`)&&t.operator.includes(`=`)||u(this.semver,`<`,t.semver,n)&&this.operator.startsWith(`>`)&&t.operator.startsWith(`<`)||u(this.semver,`>`,t.semver,n)&&this.operator.startsWith(`<`)&&t.operator.startsWith(`>`)))}};var s=i(),{safeRe:c,t:l}=r(),u=h(),d=n(),f=o(),p=v()})),b=e(((e,t)=>{var n=v();t.exports=(e,t,r)=>{try{t=new n(t,r)}catch{return!1}return t.test(e)}}));export{t as _,h as a,f as c,l as d,c as f,r as g,a as h,g as i,d as l,o as m,y as n,m as o,s as p,v as r,p as s,b as t,u};
|