@readmagic/workmate 0.0.20 → 0.0.22
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/dist/chunks/AddWorkspaceDirectory-DWgTWJ7R.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DCvgQ6n3.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-s0Orgord.js +1 -0
- package/dist/chunks/App-BcEI6U5j.js +1 -0
- package/dist/chunks/ApproveApiKey-DegdTXZl.js +1 -0
- package/dist/chunks/ApproveApiKey-_VXIMSwY.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CjBt1L0p.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-D2Gesf-u.js +1 -0
- package/dist/chunks/CustomSelect-B46Eh0gU.js +1 -0
- package/dist/chunks/DiffDialog-v2IiYyi3.js +6 -0
- package/dist/chunks/Doctor-BP0Rqraa.js +1 -0
- package/dist/chunks/Doctor-By_y3C2V.js +3 -0
- package/dist/chunks/ExitFlow-BasHk1mk.js +2 -0
- package/dist/chunks/Grove-C3mhgshv.js +11 -0
- package/dist/chunks/InvalidConfigDialog-DYVQK5js.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-Dg6OiStR.js +1 -0
- package/dist/chunks/KeybindingProviderSetup-Bn1jzN5F.js +1 -0
- package/dist/chunks/MCPConnectionManager-ChN4Ayjk.js +1 -0
- package/dist/chunks/MCPToolListView-DLSrQHDc.js +1 -0
- package/dist/chunks/McpParsingWarnings-DZejAh8b.js +1 -0
- package/dist/chunks/MessageSelector-CdDlJE48.js +3 -0
- package/dist/chunks/Messages-DuL_r1Or.js +10 -0
- package/dist/chunks/Onboarding-CE2GNA-h.js +1 -0
- package/dist/chunks/PermissionDialog-BaibiQae.js +1 -0
- package/dist/chunks/PressEnterToContinue-DZc_s_pE.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-lkr_A5jQ.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-DaQKKyM5.js +1 -0
- package/dist/chunks/QueryEngine-DNNy1UCD.js +1 -0
- package/dist/chunks/REPL-CEhW-C41.js +1 -0
- package/dist/chunks/REPL-CkSL4C_8.js +124 -0
- package/dist/chunks/ResumeConversation-BMCO_3X7.js +1 -0
- package/dist/chunks/{SearchBox-CwwV0W-w.js → SearchBox-C9xxQzh1.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-DSy_jDhf.js +1 -0
- package/dist/chunks/SelectMulti-CNE06VAN.js +1 -0
- package/dist/chunks/Settings-mDykHLok.js +2 -0
- package/dist/chunks/Spinner-DwsJJUtn.js +1 -0
- package/dist/chunks/SpinnerGlyph-A6G-gloN.js +1 -0
- package/dist/chunks/TextInput-7uqPhq9T.js +22 -0
- package/dist/chunks/ThemePicker-DT9zVy-0.js +1 -0
- package/dist/chunks/TrustDialog-G4jM9IfM.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BfZ5gcIv.js → ValidationErrorsList-BLtP647v.js} +1 -1
- package/dist/chunks/add-dir-7RfQAC3h.js +1 -0
- package/dist/chunks/{agentDisplay-BM4QG_RX.js → agentDisplay-vLQHFrmq.js} +1 -1
- package/dist/chunks/agents-BNg_skSm.js +101 -0
- package/dist/chunks/{agents-BbDBN5l9.js → agents-DLz0kfsr.js} +1 -1
- package/dist/chunks/allErrors-DaztSMrw.js +1 -0
- package/dist/chunks/appleTerminalBackup-BYKdf3of.js +1 -0
- package/dist/chunks/auth-BTB00dq5.js +10 -0
- package/dist/chunks/auth-Bbc0Ny8i.js +1 -0
- package/dist/chunks/backgroundHousekeeping-DYz83_8C.js +1 -0
- package/dist/chunks/backgroundHousekeeping-bEZtlJSf.js +17 -0
- package/dist/chunks/banner-mqZEluky.js +2 -0
- package/dist/chunks/branch-exFKkymg.js +2 -0
- package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BL2gnDLX.js} +2 -2
- package/dist/chunks/btw-3l78DYET.js +1 -0
- package/dist/chunks/caches-6Nx6tsk9.js +1 -0
- package/dist/chunks/caches-ouaWB9bY.js +1 -0
- package/dist/chunks/claudeDesktop-D3PEgx3U.js +1 -0
- package/dist/chunks/{clear-DmqQBNKg.js → clear-CXfhVRp8.js} +1 -1
- package/dist/chunks/client-C01Bnxxv.js +1 -0
- package/dist/chunks/client-DYRgRQsr.js +1 -0
- package/dist/chunks/{client-C_jBL1yC.js → client-DdenNfkQ.js} +1 -1
- package/dist/chunks/client-DvhWKIOx.js +1 -0
- package/dist/chunks/commands-BoxOw75F.js +1 -0
- package/dist/chunks/compact-BOYr105K.js +2 -0
- package/dist/chunks/config-BddEvZZl.js +3 -0
- package/dist/chunks/config-GEv9hUzz.js +1 -0
- package/dist/chunks/config-kw4xg7Nk.js +1 -0
- package/dist/chunks/context-3s9wtn4L.js +1 -0
- package/dist/chunks/{context-noninteractive-BzDVMnWC.js → context-noninteractive-CJhUu_4y.js} +9 -9
- package/dist/chunks/context-noninteractive-DFvoZ2L9.js +1 -0
- package/dist/chunks/conversation-CoGharlH.js +1 -0
- package/dist/chunks/conversation-MxEVm54C.js +1 -0
- package/dist/chunks/conversationRecovery-Da_8uldZ.js +1 -0
- package/dist/chunks/convert-legacy-node-http-options-BZnGSjx2.js +1 -0
- package/dist/chunks/crossProjectResume-CzPCHq_K.js +40 -0
- package/dist/chunks/cwd-BcO6WHKo.js +1 -0
- package/dist/chunks/cwd-CDUelriw.js +1 -0
- package/dist/chunks/{datadog-Bc6wkPne.js → datadog-v_mXWncN.js} +1 -1
- package/dist/chunks/{debug-D58GQBDG.js → debug-8DCufdSp.js} +4 -4
- package/dist/chunks/detectRepository-DfX8xXw2.js +1 -0
- package/dist/chunks/{diff-DIg66U_d.js → diff-DJSt7QO6.js} +1 -1
- package/dist/chunks/directoryCompletion-CT6YVeg7.js +1 -0
- package/dist/chunks/doctor-DWvioSU9.js +1 -0
- package/dist/chunks/entry-ex0-RyYV.js +13 -0
- package/dist/chunks/esm-0CwQE5CJ.js +10 -0
- package/dist/chunks/esm-BCmY8V0C.js +1 -0
- package/dist/chunks/esm-BQY8jJNR.js +1 -0
- package/dist/chunks/esm-BUJtY-Rb.js +1 -0
- package/dist/chunks/esm-BadZVa27.js +1 -0
- package/dist/chunks/esm-BbMeEYcz.js +1 -0
- package/dist/chunks/esm-sVMjGuep.js +1 -0
- package/dist/chunks/execFileNoThrow-BsfuytkN.js +34 -0
- package/dist/chunks/exit-BxC_ZEtO.js +1 -0
- package/dist/chunks/extraUsage-DYm33Occ.js +1 -0
- package/dist/chunks/extractMemories-CzN3Ax2B.js +1 -0
- package/dist/chunks/fast-DqUpl_Lr.js +1 -0
- package/dist/chunks/fast-NUdUyAaM.js +1 -0
- package/dist/chunks/fetchModelList-CqsTAWEN.js +1 -0
- package/dist/chunks/fetchModelList-DBMHE6Ng.js +1 -0
- package/dist/chunks/fileSuggestions-B-SLfb-o.js +3 -0
- package/dist/chunks/firstPartyEventLogger-C0q45h_4.js +3 -0
- package/dist/chunks/firstPartyEventLogger-CP8hCBDj.js +1 -0
- package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
- package/dist/chunks/gemini-BC9kHhwe.js +2 -0
- package/dist/chunks/generateSessionName-ChvKBVxB.js +1 -0
- package/dist/chunks/{genericProcessUtils-6E7fB1dI.js → genericProcessUtils-BYi0OefF.js} +3 -3
- package/dist/chunks/goal-ByyimpVU.js +3 -0
- package/dist/chunks/grok-DenjixMl.js +1 -0
- package/dist/chunks/grove-Dq8QbQ9o.js +7 -0
- package/dist/chunks/help-CK90i4hE.js +1 -0
- package/dist/chunks/history-CNQNd6hT.js +1 -0
- package/dist/chunks/{hooks-7iyENdDG.js → hooks-BRFDg9DV.js} +2 -2
- package/dist/chunks/hooks-BaYwmkxD.js +1 -0
- package/dist/chunks/install-ZMll-dAa.js +1 -0
- package/dist/chunks/instrumentation-BwVyvRfY.js +21 -0
- package/dist/chunks/{job-CXz7SLZp.js → job-G_ukhLc4.js} +1 -1
- package/dist/chunks/keybindings-wNxBzDVQ.js +1 -0
- package/dist/chunks/launchLocalMemory-BcRlXLm6.js +3 -0
- package/dist/chunks/launchOnboarding-CDjQ64RO.js +8 -0
- package/dist/chunks/{loadAgentsDir-DaNpxaO-.js → loadAgentsDir-C1LkW7gl.js} +571 -641
- package/dist/chunks/loadAgentsDir-DKXap_Om.js +1 -0
- package/dist/chunks/loadPluginHooks-DtmHtEiS.js +1 -0
- package/dist/chunks/{loader-C33o_5kS.js → loader-C61fB6vU.js} +1 -1
- package/dist/chunks/localSearch-BB9x5C2N.js +1 -0
- package/dist/chunks/{localSearch-C2SZ9bGW.js → localSearch-DFo_WTMm.js} +1 -1
- package/dist/chunks/log-DaILwWJa.js +1 -0
- package/dist/chunks/logoUtils-Dj_2SWmO.js +1 -0
- package/dist/chunks/{magicDocs-CrTwULyJ.js → magicDocs-DYc9TFmI.js} +2 -2
- package/dist/chunks/main-BRg8L_aw.js +346 -0
- package/dist/chunks/managedEnv-DsqAYOJ4.js +1 -0
- package/dist/chunks/managedEnv-lybrMred.js +1 -0
- package/dist/chunks/mcp-Bsw3cMiJ.js +6 -0
- package/dist/chunks/mcp-DDdud6Y7.js +1 -0
- package/dist/chunks/mcp-DbgTDUt7.js +2 -0
- package/dist/chunks/memory-CzwTzihf.js +1 -0
- package/dist/chunks/modalContext-DDZdU1J8.js +1 -0
- package/dist/chunks/mode-Pan-Q2c4.js +2 -0
- package/dist/chunks/model-BYfmXKHf.js +1 -0
- package/dist/chunks/model-BwBE0Pt5.js +1 -0
- package/dist/chunks/modelOptions-DvNBapgG.js +1 -0
- package/dist/chunks/nativeInstaller-DnSNJWIi.js +1 -0
- package/dist/chunks/notifications-B0DTaYoy.js +1 -0
- package/dist/chunks/omit-Dl1Us_PY.js +1 -0
- package/dist/chunks/onChangeAppState-4KOJMN82.js +1 -0
- package/dist/chunks/openai-C_6C1_0N.js +10 -0
- package/dist/chunks/overlayContext-CMV7nYR9.js +1 -0
- package/dist/chunks/panel-D9fGQgln.js +1 -0
- package/dist/chunks/parser-BKAVMTyD.js +1 -0
- package/dist/chunks/{parser-eVu-cTRs.js → parser-D8slvrJP.js} +1 -1
- package/dist/chunks/partition-B504IgAa.js +1 -0
- package/dist/chunks/pasteStore-DNV1M5Xd.js +1 -0
- package/dist/chunks/permissions-CLFMhdRk.js +3 -0
- package/dist/chunks/pidLock-D9do1Afy.js +3 -0
- package/dist/chunks/plan-CQLnPLuE.js +1 -0
- package/dist/chunks/{platform-DMQxcm4K.js → platform-Dzff1WWw.js} +1 -1
- package/dist/chunks/plugin-BYdF7uob.js +17 -0
- package/dist/chunks/pluginAutoupdate-BJaAqwTH.js +1 -0
- package/dist/chunks/pluginBlocklist-DKKmOnWM.js +1 -0
- package/dist/chunks/pluginCliCommands-z8TtJMKH.js +1 -0
- package/dist/chunks/{pluginFlagging-DRA0m76J.js → pluginFlagging-DQP8tBi2.js} +1 -1
- package/dist/chunks/pluginOperations-BcfJCDco.js +2 -0
- package/dist/chunks/{pluginStartupCheck-BF1N4Lih.js → pluginStartupCheck-CfRvCrFg.js} +1 -1
- package/dist/chunks/pluginStartupCheck-Cq4PvULa.js +1 -0
- package/dist/chunks/plugins-CTM8jpOw.js +4 -0
- package/dist/chunks/policyLimits-a7ix6GnU.js +1 -0
- package/dist/chunks/poorMode-C11JEH3d.js +1 -0
- package/dist/chunks/{poorMode-CKQfWf3S.js → poorMode-J5SYJvoY.js} +1 -1
- package/dist/chunks/print-u6MzL5Cr.js +13 -0
- package/dist/chunks/processBashCommand-DIwrI2QC.js +1 -0
- package/dist/chunks/processSlashCommand-B-Gujpxm.js +5 -0
- package/dist/chunks/projectOnboardingState-CJycxw5P.js +1 -0
- package/dist/chunks/{prompt-8u06WVES.js → prompt-BGqgPgCU.js} +3 -3
- package/dist/chunks/prompt-BPJDGlx5.js +1 -0
- package/dist/chunks/prompt-DEdZzkEz.js +1 -0
- package/dist/chunks/promptEditor-CmQ9p4oe.js +4 -0
- package/dist/chunks/{protocolHandler-DzHVaPl3.js → protocolHandler-CJo9-PfZ.js} +2 -2
- package/dist/chunks/{proxy-BhIc7-mj.js → proxy-CB17QimU.js} +2 -2
- package/dist/chunks/reconciler-DSKLuOS7.js +1 -0
- package/dist/chunks/refresh-BbZFCNpn.js +1 -0
- package/dist/chunks/registerProtocol-CLIpzVwF.js +1 -0
- package/dist/chunks/reload-plugins-DjugL8jH.js +1 -0
- package/dist/chunks/rename-DOtCOtEr.js +1 -0
- package/dist/chunks/{renderOptions-D-aQZbzS.js → renderOptions-Zqfm2U1y.js} +1 -1
- package/dist/chunks/resume-BB4T4WIV.js +2 -0
- package/dist/chunks/ripgrep-BuzOTf1S.js +5 -0
- package/dist/chunks/ripgrep-CZ2CqaHb.js +1 -0
- package/dist/chunks/{runtimeObserver-DzesbvgI.js → runtimeObserver-CK_iZ6OB.js} +1 -1
- package/dist/chunks/{runtimeObserver-L6041elO.js → runtimeObserver-CpP0L9T9.js} +4 -4
- package/dist/chunks/sandbox-adapter-DhJJ6WOV.js +1 -0
- package/dist/chunks/sandbox-toggle-KOHYvbQT.js +1 -0
- package/dist/chunks/searchExtraTools-CdJghGkj.js +1 -0
- package/dist/chunks/select-C_KXmqbI.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-D7KbWFp7.js +1 -0
- package/dist/chunks/sessionObserver-DB-sLv-X.js +1 -0
- package/dist/chunks/{sessionObserver-0D8xFoRK.js → sessionObserver-WOYv2n7C.js} +2 -2
- package/dist/chunks/sessionStorage-sgOAbDn7.js +1 -0
- package/dist/chunks/sessionTracing-yBre24PH.js +11 -0
- package/dist/chunks/settings-C-KNkvsM.js +1 -0
- package/dist/chunks/settings-DKN4xSpQ.js +24 -0
- package/dist/chunks/setup-CN_Pk7AR.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Cy9tsuKc.js → shadowedRuleDetection-Df-kZ_pK.js} +1 -1
- package/dist/chunks/{sideQuestion-Ds7Elgs4.js → sideQuestion-CMB8hfgX.js} +3 -3
- package/dist/chunks/sinks-BS17vtN0.js +1 -0
- package/dist/chunks/sinks-D1EjkHb4.js +1 -0
- package/dist/chunks/skillChangeDetector-CBKuGuEi.js +1 -0
- package/dist/chunks/{skillGapStore-BxCxKPev.js → skillGapStore-CfmlO6pb.js} +2 -2
- package/dist/chunks/{skillLifecycle-CfyNC3sW.js → skillLifecycle-BQ2LMfMx.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CMNJFIEC.js → skillSearchPanel-BwYuwLFs.js} +4 -4
- package/dist/chunks/skills-BVHPQma0.js +1 -0
- package/dist/chunks/src-9vmGsuSI.js +1 -0
- package/dist/chunks/{src-CgZmCiiH.js → src-BacxF9BD.js} +2 -2
- package/dist/chunks/startupProfiler-B_U4QDtf.js +1 -0
- package/dist/chunks/startupProfiler-DTs9w9EN.js +3 -0
- package/dist/chunks/{state-D5D6QpTX.js → state-BowF111d.js} +1 -1
- package/dist/chunks/state-CGuyDES7.js +1 -0
- package/dist/chunks/staticRender-BVWx0IM1.js +1 -0
- package/dist/chunks/status-BurdTfyz.js +2 -0
- package/dist/chunks/status-DMq1An5h.js +1 -0
- package/dist/chunks/statusNoticeHelpers-X75JNlx5.js +1 -0
- package/dist/chunks/stringUtils-BQm3OfeJ.js +4 -0
- package/dist/chunks/{switcher-DQF5ZNal.js → switcher-Bq1Ct_Sn.js} +1 -1
- package/dist/chunks/switcher-DGD4ORVf.js +1 -0
- package/dist/chunks/{tasks-C8pb6ftc.js → tasks-0c8Uy04D.js} +1 -1
- package/dist/chunks/tempfile-CHO5wXsV.js +1 -0
- package/dist/chunks/{templateJobs-DJ4dcfcL.js → templateJobs-BdFzE9XG.js} +1 -1
- package/dist/chunks/terminalSetup-Cf_r6pwK.js +32 -0
- package/dist/chunks/{terminalSetup-7PdC4fV5.js → terminalSetup-D7J6bxcn.js} +1 -1
- package/dist/chunks/theme-Bby4fssR.js +1 -0
- package/dist/chunks/tipRegistry-CyRXWWTz.js +2 -0
- package/dist/chunks/{toolEventObserver-D2nk8ZbW.js → toolEventObserver-CzFZUIsM.js} +1 -1
- package/dist/chunks/toolPool-CnrZcprA.js +1 -0
- package/dist/chunks/types-zk5Ltv5q.js +81 -0
- package/dist/chunks/udsClient-ftP0yIpe.js +1 -0
- package/dist/chunks/use-select-navigation-DMaC_3iw.js +1 -0
- package/dist/chunks/useDoublePress-C9xxQzh1.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CjW3gUOt.js +1 -0
- package/dist/chunks/useMainLoopModel-DWscpA9I.js +1 -0
- package/dist/chunks/useManagePlugins-CYXVcql2.js +1 -0
- package/dist/chunks/useMergedTools-DarmnCEw.js +1 -0
- package/dist/chunks/useSearchInput-C2JuUW3g.js +1 -0
- package/dist/chunks/useSettingsErrors-DutJBiKZ.js +1 -0
- package/dist/chunks/util-Bq5l7FF5.js +1 -0
- package/dist/chunks/validatePlugin-DIdEydz_.js +1 -0
- package/dist/chunks/{vim-BagKUX4j.js → vim-D8prM2IH.js} +1 -1
- package/dist/chunks/worktree-Caqt2WRZ.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +3 -21
- package/dist/chunks/AddWorkspaceDirectory-BYNvxNrD.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BSSz86ER.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CMEGV4Md.js +0 -1
- package/dist/chunks/App-W_9d1DjK.js +0 -1
- package/dist/chunks/ApproveApiKey-Bf1Rb8Ql.js +0 -1
- package/dist/chunks/ApproveApiKey-wpdvXpFr.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-lGn1Wj1k.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-CjVjyNf8.js +0 -1
- package/dist/chunks/DiffDialog-DCpchgp5.js +0 -6
- package/dist/chunks/Doctor-6SjW91rd.js +0 -1
- package/dist/chunks/Doctor-FPYTivHw.js +0 -3
- package/dist/chunks/ExitFlow-Dy8_1D8J.js +0 -2
- package/dist/chunks/Grove-Dd6rjs5P.js +0 -11
- package/dist/chunks/HybridTransport-CJVkWa2u.js +0 -2
- package/dist/chunks/InvalidConfigDialog-Bisj9ic_.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-DyTPNRQR.js +0 -1
- package/dist/chunks/MCPConnectionManager-DfyoZaiu.js +0 -1
- package/dist/chunks/MCPToolListView-Dioupv8F.js +0 -1
- package/dist/chunks/McpParsingWarnings-BUlgpZAF.js +0 -1
- package/dist/chunks/MessageSelector-D8fylxPg.js +0 -3
- package/dist/chunks/Messages-BZDFMYBT.js +0 -10
- package/dist/chunks/Onboarding-BKLomZYo.js +0 -1
- package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
- package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-DCum89fF.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DG2lRqis.js +0 -1
- package/dist/chunks/QueryEngine-CyGHpX7M.js +0 -1
- package/dist/chunks/REPL-BDsz8KIx.js +0 -1
- package/dist/chunks/REPL-CCBNfZfs.js +0 -128
- package/dist/chunks/RemoteSessionManager-BfsOv4K6.js +0 -2
- package/dist/chunks/ResumeConversation-pC8NLq0F.js +0 -1
- package/dist/chunks/SSETransport-B3K6eH9I.js +0 -2
- package/dist/chunks/SearchExtraToolsTool-DYoxHo9T.js +0 -1
- package/dist/chunks/Settings-CKaGmKg2.js +0 -2
- package/dist/chunks/TeleportProgress-CkgSp1cs.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-DdO_rECq.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-BeG4N-2z.js +0 -1
- package/dist/chunks/ThemePicker-iD9ufy99.js +0 -1
- package/dist/chunks/TrustDialog-qO5OdQt8.js +0 -1
- package/dist/chunks/add-dir-C4eSVlZ6.js +0 -1
- package/dist/chunks/agents-D3APE_8d.js +0 -101
- package/dist/chunks/allErrors-BkgB7JNK.js +0 -1
- package/dist/chunks/api-BHBK9axp.js +0 -1
- package/dist/chunks/api-DyUWfg3a.js +0 -1
- package/dist/chunks/auth-0rn1U4Eq.js +0 -10
- package/dist/chunks/auth-BEoTPSgC.js +0 -1
- package/dist/chunks/auth-BPug7U_u.js +0 -1
- package/dist/chunks/backgroundHousekeeping-D7xAhUaE.js +0 -1
- package/dist/chunks/backgroundHousekeeping-km82qEh0.js +0 -17
- package/dist/chunks/banner-BkUdig-T.js +0 -2
- package/dist/chunks/bg-tGgpwpYx.js +0 -9
- package/dist/chunks/branch-CQ38cx5n.js +0 -2
- package/dist/chunks/bridgeConfig-C5L-7KaP.js +0 -1
- package/dist/chunks/bridgeConfig-CJMjDoaP.js +0 -1
- package/dist/chunks/bridgeMessaging-DVC3qj-C.js +0 -1
- package/dist/chunks/bridgePointer-DfTOjgtX.js +0 -1
- package/dist/chunks/bridgeStatusUtil-Cex6VowM.js +0 -1
- package/dist/chunks/btw-_P96ffHR.js +0 -1
- package/dist/chunks/bundledMode--fG1S62b.js +0 -1
- package/dist/chunks/caches-DH-q8Fjf.js +0 -1
- package/dist/chunks/caches-Dq0pJFDP.js +0 -1
- package/dist/chunks/capacityWake-BpP6c7x3.js +0 -3
- package/dist/chunks/ccrClient-DO563xlf.js +0 -1
- package/dist/chunks/claudeDesktop-DPc_SaVn.js +0 -1
- package/dist/chunks/cliLaunch-DDtwAolw.js +0 -1
- package/dist/chunks/client-9uHzAmFH.js +0 -1
- package/dist/chunks/client-BVal_QII.js +0 -1
- package/dist/chunks/client-C19cqYQS.js +0 -1
- package/dist/chunks/client-Dd7CKMRX.js +0 -1
- package/dist/chunks/commands-BkpqHY9F.js +0 -1
- package/dist/chunks/compact-DuVIvqMu.js +0 -2
- package/dist/chunks/config-DMP6-Ccr.js +0 -1
- package/dist/chunks/config-DRy1I12M.js +0 -3
- package/dist/chunks/config-e0Goy478.js +0 -1
- package/dist/chunks/context-DjgMzIfe.js +0 -1
- package/dist/chunks/context-noninteractive-DV7bIJCm.js +0 -1
- package/dist/chunks/controlMessageCompat-IFu4Gc1y.js +0 -1
- package/dist/chunks/conversation-BBOE_EoE.js +0 -1
- package/dist/chunks/conversation-WxH5pb2z.js +0 -1
- package/dist/chunks/createSSHSession-LVGVXHXL.js +0 -5
- package/dist/chunks/createSession-BUzna9-E.js +0 -1
- package/dist/chunks/createSession-Dgwxk1WA.js +0 -1
- package/dist/chunks/crossProjectResume-6B2NYy8a.js +0 -40
- package/dist/chunks/cwd-DLK3znO7.js +0 -1
- package/dist/chunks/cwd-Nh5IZNKO.js +0 -1
- package/dist/chunks/debugUtils-DXBRbwCE.js +0 -1
- package/dist/chunks/detached-Biz-xhu0.js +0 -4
- package/dist/chunks/detectRepository-CDOJ-M7h.js +0 -1
- package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
- package/dist/chunks/directoryCompletion-BDGcGDuv.js +0 -1
- package/dist/chunks/doctor-BhUmhHQU.js +0 -1
- package/dist/chunks/entry-B-Y-AYeK.js +0 -13
- package/dist/chunks/esm-BYnFh4pG.js +0 -1
- package/dist/chunks/esm-Bx6rTxIs.js +0 -1
- package/dist/chunks/esm-C367Cyo-.js +0 -1
- package/dist/chunks/esm-CXM9jqO_.js +0 -1
- package/dist/chunks/esm-CXczu_-W.js +0 -1
- package/dist/chunks/esm-CXt5K8Xt.js +0 -1
- package/dist/chunks/esm-Cb-L4oAk.js +0 -1
- package/dist/chunks/esm-CvHtYRrr.js +0 -1
- package/dist/chunks/esm-DhRjocaU.js +0 -1
- package/dist/chunks/esm-DklLYEuz.js +0 -1
- package/dist/chunks/esm-IYgGg4wR.js +0 -1
- package/dist/chunks/esm-lyfry1WB.js +0 -10
- package/dist/chunks/execFileNoThrow-Bmb5HEFz.js +0 -34
- package/dist/chunks/execSyncWrapper-C3ZFV9od.js +0 -1
- package/dist/chunks/exit-CW2eqUrR.js +0 -1
- package/dist/chunks/extraUsage-CkTon7ib.js +0 -1
- package/dist/chunks/extractMemories-CfmbvayQ.js +0 -1
- package/dist/chunks/fast-ByahC7Gw.js +0 -1
- package/dist/chunks/fast-xtIP4u4y.js +0 -1
- package/dist/chunks/fetchModelList-D9aePIPW.js +0 -1
- package/dist/chunks/fetchModelList-Dy-x4h3G.js +0 -1
- package/dist/chunks/fileSuggestions-CFkJktgc.js +0 -3
- package/dist/chunks/firstPartyEventLogger-Bt9iG9xk.js +0 -1
- package/dist/chunks/firstPartyEventLogger-DqGSujCz.js +0 -3
- package/dist/chunks/flushGate-BjKW7PFC.js +0 -1
- package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
- package/dist/chunks/gemini-NnmxBoEp.js +0 -1
- package/dist/chunks/generateSessionName-EpqGW-T2.js +0 -1
- package/dist/chunks/git-By_J4XJL.js +0 -5
- package/dist/chunks/git-zJCasBa6.js +0 -1
- package/dist/chunks/githubRepoPathMapping-CzgPGOHQ.js +0 -1
- package/dist/chunks/goal-DbS8yJfB.js +0 -3
- package/dist/chunks/grok-BxZ4vTDw.js +0 -1
- package/dist/chunks/grove-CYE1Cfcz.js +0 -7
- package/dist/chunks/hash-Tu-My5Vp.js +0 -1
- package/dist/chunks/help-DatnwM25.js +0 -1
- package/dist/chunks/hooks-DjbqtbUV.js +0 -1
- package/dist/chunks/initReplBridge-BEZW5PEY.js +0 -1
- package/dist/chunks/install-DJukI-kL.js +0 -1
- package/dist/chunks/instrumentation-2HH15DPu.js +0 -21
- package/dist/chunks/jwtUtils-C_LG1txt.js +0 -1
- package/dist/chunks/keybindings-C9l5il16.js +0 -1
- package/dist/chunks/launchLocalMemory-BfGenqj1.js +0 -3
- package/dist/chunks/launchOnboarding-DjMmXeQE.js +0 -8
- package/dist/chunks/lazySchema-DULtBUCI.js +0 -65
- package/dist/chunks/lib-BlVGipXx.js +0 -14
- package/dist/chunks/loadAgentsDir-DcI-8FQF.js +0 -1
- package/dist/chunks/loadPluginHooks-CGgpcyEC.js +0 -1
- package/dist/chunks/localSearch-CTTwYTU1.js +0 -1
- package/dist/chunks/log-CZ7ploQm.js +0 -1
- package/dist/chunks/logoUtils-CbIqOFrX.js +0 -1
- package/dist/chunks/main-Blm02_Js.js +0 -31
- package/dist/chunks/main-bJXadFi0.js +0 -356
- package/dist/chunks/managedEnv-CUsdYhAI.js +0 -1
- package/dist/chunks/managedEnv-DXeaUDSK.js +0 -1
- package/dist/chunks/mappers-_B-s9fNz.js +0 -1
- package/dist/chunks/mcp-BbbYzWpy.js +0 -6
- package/dist/chunks/mcp-D91sH9a8.js +0 -1
- package/dist/chunks/mcp-Dx-zgUgu.js +0 -2
- package/dist/chunks/memoize-CumjjK2Q.js +0 -1
- package/dist/chunks/memory-BeL7ui9m.js +0 -1
- package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
- package/dist/chunks/mode-D695kgLI.js +0 -2
- package/dist/chunks/model-DX0TtzqX.js +0 -1
- package/dist/chunks/model-Do0f476p.js +0 -1
- package/dist/chunks/model-DpcM8dz5.js +0 -1
- package/dist/chunks/modelOptions-B3nis9cC.js +0 -1
- package/dist/chunks/nativeInstaller-CymO8TNe.js +0 -1
- package/dist/chunks/oauth-D38aRTUb.js +0 -1
- package/dist/chunks/oauth-U649LV5H.js +0 -1
- package/dist/chunks/omit-DO61BHZu.js +0 -1
- package/dist/chunks/onChangeAppState-vKml_lit.js +0 -1
- package/dist/chunks/openai-DdupGVdC.js +0 -10
- package/dist/chunks/panel-CVd1dzYl.js +0 -1
- package/dist/chunks/parser-Cq9X7HMP.js +0 -1
- package/dist/chunks/partition-BivH9MBJ.js +0 -1
- package/dist/chunks/permissions-C9iqR4_N.js +0 -3
- package/dist/chunks/pidLock-DiKz5Tza.js +0 -3
- package/dist/chunks/plan-KDN5IGWY.js +0 -1
- package/dist/chunks/plugin-D0rzUb8E.js +0 -17
- package/dist/chunks/pluginAutoupdate-C2xTKLR_.js +0 -1
- package/dist/chunks/pluginBlocklist-xdiUmUpt.js +0 -1
- package/dist/chunks/pluginCliCommands-CIDDvVN7.js +0 -1
- package/dist/chunks/pluginOperations-BEYsarAn.js +0 -2
- package/dist/chunks/pluginStartupCheck-DVkI4pqo.js +0 -1
- package/dist/chunks/plugins-CWWU4BKs.js +0 -4
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
- package/dist/chunks/print-B5H2xbBS.js +0 -14
- package/dist/chunks/processBashCommand-EQ9EWaRV.js +0 -1
- package/dist/chunks/processSlashCommand-C4PKNyFT.js +0 -5
- package/dist/chunks/prompt-B9sDzLPK.js +0 -1
- package/dist/chunks/prompt-WsoTRhoh.js +0 -1
- package/dist/chunks/promptEditor-Cr4w-4Bz.js +0 -4
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +0 -1
- package/dist/chunks/reconciler-RIKmaPg7.js +0 -1
- package/dist/chunks/refresh-CCSCAjgz.js +0 -1
- package/dist/chunks/registerProtocol-C0IlPEoa.js +0 -1
- package/dist/chunks/reload-plugins-DC-tbXVv.js +0 -1
- package/dist/chunks/remoteBridgeCore-NGTnhQgw.js +0 -1
- package/dist/chunks/remoteManagedSettings-BoOYHzYP.js +0 -1
- package/dist/chunks/rename-DS1AmW-F.js +0 -1
- package/dist/chunks/resume-Cf5PSoPw.js +0 -2
- package/dist/chunks/ripgrep-C3jtZL7k.js +0 -5
- package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
- package/dist/chunks/sandbox-adapter-Z4Phj31K.js +0 -1
- package/dist/chunks/sandbox-toggle-COZE8Lo4.js +0 -1
- package/dist/chunks/searchExtraTools-CvkRbL2m.js +0 -1
- package/dist/chunks/session-BvA99K4j.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-6XfAf6ke.js +0 -1
- package/dist/chunks/sessionIdCompat-Dgp6PW_1.js +0 -1
- package/dist/chunks/sessionObserver-CRWUBJEY.js +0 -1
- package/dist/chunks/sessionState-CQhbGfmh.js +0 -11
- package/dist/chunks/sessionStorage-DqEuxDlb.js +0 -1
- package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +0 -3
- package/dist/chunks/sessionTracing-BoOZsXU2.js +0 -11
- package/dist/chunks/settings-3xZ0fsvE.js +0 -19
- package/dist/chunks/settings-Crx1cI1u.js +0 -1
- package/dist/chunks/settingsSync-rkWmClKS.js +0 -1
- package/dist/chunks/setup-D8L275fT.js +0 -3
- package/dist/chunks/shellQuote-Ddgr1vif.js +0 -4
- package/dist/chunks/sinks-BXX72cbf.js +0 -1
- package/dist/chunks/sinks-DMp6uEzM.js +0 -1
- package/dist/chunks/skillChangeDetector-CtithJ4a.js +0 -1
- package/dist/chunks/skills-DXMk-498.js +0 -1
- package/dist/chunks/src-D3yIF9I42.js +0 -1
- package/dist/chunks/src-DQOX_xI1.js +0 -1
- package/dist/chunks/src-Dt5IJd3C.js +0 -1
- package/dist/chunks/src-Dvp6-vB7.js +0 -19
- package/dist/chunks/src-PM8NIIu_.js +0 -1
- package/dist/chunks/startupProfiler-CbzxVmbv.js +0 -3
- package/dist/chunks/startupProfiler-uHetQush.js +0 -1
- package/dist/chunks/state-BStOuCh4.js +0 -1
- package/dist/chunks/staticRender-D9AbnQFr.js +0 -1
- package/dist/chunks/stats-Ce15gc3E.js +0 -1
- package/dist/chunks/status-CFrLuGbf.js +0 -2
- package/dist/chunks/status-D5OCkMZG.js +0 -1
- package/dist/chunks/statusNoticeHelpers-CZoOse-_.js +0 -1
- package/dist/chunks/stringUtils-CKD8qDqx.js +0 -4
- package/dist/chunks/subprocessEnv-CNBOhlDV.js +0 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +0 -1
- package/dist/chunks/switcher-AiMcRzoi.js +0 -1
- package/dist/chunks/syncCache-qWJ_VfBo.js +0 -1
- package/dist/chunks/teleport-Bi_1VFIZ.js +0 -1
- package/dist/chunks/terminalSetup-kWdZRKWq.js +0 -32
- package/dist/chunks/theme-CEKOCSLw.js +0 -1
- package/dist/chunks/tmux-CpGd0Aca.js +0 -1
- package/dist/chunks/toolPool-Df5iUqJ-.js +0 -1
- package/dist/chunks/trustedDevice-CB6rNzl-.js +0 -1
- package/dist/chunks/trustedDevice-DXGePUAC.js +0 -1
- package/dist/chunks/types-APu4OCXJ.js +0 -17
- package/dist/chunks/udsClient-U7MEfYj7.js +0 -1
- package/dist/chunks/upstreamproxy-CTOuotLO.js +0 -10
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js +0 -1
- package/dist/chunks/useMainLoopModel-CIG2cjS2.js +0 -1
- package/dist/chunks/useManagePlugins-MSHw-qHx.js +0 -1
- package/dist/chunks/useMergedTools-Bb-INJa2.js +0 -1
- package/dist/chunks/useSearchInput-QL_VtdJD.js +0 -1
- package/dist/chunks/useSettingsErrors-Dvi6zLCr.js +0 -1
- package/dist/chunks/userAgent-i-oGzf40.js +0 -1
- package/dist/chunks/util-CLQvtXuD.js +0 -1
- package/dist/chunks/validatePlugin-1mTZ3TJR.js +0 -1
- package/dist/chunks/which-BxQ1hpjp.js +0 -1
- package/dist/chunks/windowsPaths-BdhjMYTm.js +0 -1
- package/dist/chunks/windowsPaths-DtGZ83kH.js +0 -1
- package/dist/chunks/workSecret-CaM2yIJD.js +0 -1
- package/dist/chunks/workerRegistry-BjxoZ12l.js +0 -2
- package/dist/chunks/worktree-DpksgxdF.js +0 -1
- /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./esm-CXt5K8Xt.js";import{t as i}from"./src-Dvp6-vB7.js";import{n as a,t as o}from"./esm-C367Cyo-.js";var s=t((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OTLPMetricExporter=void 0;var s=(a(),e(o)),c=i(),l=(n(),e(r));t.OTLPMetricExporter=class extends s.OTLPMetricExporterBase{constructor(e){super((0,c.createOtlpGrpcExportDelegate)((0,c.convertLegacyOtlpGrpcOptions)(e??{},`METRICS`),l.ProtobufMetricsSerializer,`MetricsExportService`,`/opentelemetry.proto.collector.metrics.v1.MetricsService/Export`),e)}}})),c=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OTLPMetricExporter=void 0;var t=s();Object.defineProperty(e,"OTLPMetricExporter",{enumerable:!0,get:function(){return t.OTLPMetricExporter}})}));export default c();export{};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-DL3w8VPk2.js";import{Ut as ee,ft as te}from"./state-D5D6QpTX.js";import{T as c,c as l,f as u,i as d,u as ne,x as f}from"./debug-D58GQBDG.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{i as h,n as g,o as _,r as v}from"./intl-D2kgJmX7.js";import{dirname as re,join as ie}from"path";function y(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return b(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return x(e,t);let s=t-1-a;return s<=0?x(r,t):`${S(i,s)}…${r}`}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return`${r}…`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...g().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function S(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function C(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
|
|
2
|
-
`);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?b(r,t):`${r}…`}return o(r)<=t?r:b(r,t)}var w=e((()=>{s(),_()}));function T(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function E(e){return`${(e/1e3).toFixed(1)}s`}function D(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function O(e){return F(e>=1e3).format(e).toLowerCase()}function k(e){return O(e).replace(`.0`,``)}function A(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:v(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:v(n,r).format(0,`second`)}function j(e,t={}){let{now:n=new Date,...r}=t;return e>n?A(e,{...r,now:n}):A(e,{...r,numeric:`always`,now:n})}function M(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:T(e.fileSize),n=[j(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function ae(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}var N,P,F,I=e((()=>{_(),w(),N=null,P=null,F=e=>e?(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),N):(P||(P=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),P)}));function L(){return V}function R(e){return e.toFixed(3)}function z(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${T(r.rss)}, Heap: ${T(r.heapUsed)}`:``;return`[+${R(e).padStart(i)}ms] (+${R(t).padStart(a)}ms) ${n}${o}${s}`}var B,V,H=e((()=>{I(),i(),B=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},V=new B}));function U(e){X&&(L().mark(e),J&&Z.push(process.memoryUsage()))}function W(){if(!J)return`Startup profiling not enabled`;let e=L().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(z(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${R(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
|
|
3
|
-
`)}function G(){if(!$){if($=!0,q(),J){let e=K(),t=re(e);ne().mkdirSync(t),c(e,W(),{encoding:`utf8`,flush:!0}),l(`Startup profiling report:`),l(W())}L().clearMarks(),Z.length=0}}function K(){return ie(t(),`startup-perf`,`${te()}.txt`)}function q(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,m(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,oe=e((()=>{ee(),p(),d(),r(),u(),H(),f(),J=n(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{b as C,x as S,k as _,R as a,C as b,H as c,M as d,O as f,E as g,ae as h,G as i,D as l,j as m,oe as n,z as o,A as p,U as r,L as s,K as t,T as u,I as v,S as w,y as x,w as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./startupProfiler-CbzxVmbv.js";e();export{t as profileCheckpoint};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ut as e,ft as t,t as n,un as r,zn as i}from"./state-D5D6QpTX.js";e();export{n as addInvokedSkill,t as getSessionId,r as setCwdState,i as setOriginalCwd};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Kr as n,ai as r,kn as i,qr as a,t as o,vt as s}from"./src-DL3w8VPk2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{PassThrough as l}from"stream";function u({children:e}){let{exit:t}=s();return(0,m.useLayoutEffect)(()=>{let e=setTimeout(t,0);return()=>clearTimeout(e)},[t]),(0,h.jsx)(h.Fragment,{children:e})}function d(e){let t=e.indexOf(g);if(t===-1)return e;let n=t+8,r=e.indexOf(_,n);return r===-1?e:e.slice(n,r)}async function f(e,t){let n=``,r=new l;return t!==void 0&&(r.columns=t),r.on(`data`,e=>{n+=e.toString()}),await(await i((0,h.jsx)(u,{children:e}),{stdout:r,patchConsole:!1})).waitUntilExit(),d(n)}async function p(e,t){return a(await f(e,t))}var m,h,g,_,v=e((()=>{m=t(r(),1),n(),o(),h=c(),g=`\x1B[?2026h`,_=`\x1B[?2026l`}));export{f as n,p as r,v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-DL3w8VPk2.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{h as r,v as i}from"./config-DRy1I12M.js";var a=e(t(),1);r();var o=n();function s(e,t){let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)}var c=1024;function l(){let e=new Map,t=new Map,n=new Map;return{increment(t,n=1){e.set(t,(e.get(t)??0)+n)},set(t,n){e.set(t,n)},observe(e,n){let r=t.get(e);if(r||(r={reservoir:[],count:0,sum:0,min:n,max:n},t.set(e,r)),r.count++,r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.reservoir.length<c)r.reservoir.push(n);else{let e=Math.floor(Math.random()*r.count);e<c&&(r.reservoir[e]=n)}},add(e,t){let r=n.get(e);r||(r=new Set,n.set(e,r)),r.add(t)},getAll(){let r=Object.fromEntries(e);for(let[e,n]of t){if(n.count===0)continue;r[`${e}_count`]=n.count,r[`${e}_min`]=n.min,r[`${e}_max`]=n.max,r[`${e}_avg`]=n.sum/n.count;let t=[...n.reservoir].sort((e,t)=>e-t);r[`${e}_p50`]=s(t,50),r[`${e}_p95`]=s(t,95),r[`${e}_p99`]=s(t,99)}for(let[e,t]of n)r[e]=t.size;return r}}}var u=(0,a.createContext)(null);function d({store:e,children:t}){let n=(0,a.useMemo)(()=>l(),[]),r=e??n;return(0,a.useEffect)(()=>{let e=()=>{let e=r.getAll();Object.keys(e).length>0&&i(t=>({...t,lastSessionMetrics:e}))};return process.on(`exit`,e),()=>{process.off(`exit`,e)}},[r]),(0,o.jsx)(u.Provider,{value:r,children:t})}export{l as n,d as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r,t as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{By as s,Ky as c,Uy as l,Wy as ee,ab as u,fb as d,lb as f,sb as p}from"./loadAgentsDir-DaNpxaO-.js";import{P as m,di as h,fi as g,j as _,t as v}from"./src-DL3w8VPk2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{Cn as b,bn as x,cn as S,h as C,i as w,in as T,n as E,rn as D,s as O}from"./settings-3xZ0fsvE.js";import{f as k,v as A}from"./startupProfiler-CbzxVmbv.js";import{$r as j,Pt as M,_ as N,i as te,mt as P,ti as F,x as I,zt as L}from"./model-Do0f476p.js";import{h as R,l as z,o as B,p as V}from"./proxy-BhIc7-mj.js";import{g as H,h as U}from"./pidLock-DiKz5Tza.js";import{n as W,t as G}from"./nativeInstaller-CymO8TNe.js";import{n as K,t as q}from"./allErrors-BkgB7JNK.js";function J(){return[]}function Y(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=d(t.ideType),i=f(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(m,{children:[_(`error`,n)(o.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
|
|
2
|
-
`,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=u(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${_(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function X(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(_(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(_(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(_(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(_(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${_(`inactive`,t)(`· /mcp`)}`}]}async function Z(){let e=l(await ee()),t=[];return e.forEach(e=>{let n=x(e.path);t.push(`Large ${n} will impact performance (${k(e.content.length)} chars > ${k(s)})`)}),t}function Q(){return[{label:`Setting sources`,value:D().filter(e=>{let t=O(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=w();if(e===null)return null;switch(e){case`remote`:return`Enterprise managed settings (remote)`;case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=E();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return T(e)}).filter(e=>e!==null)}]}async function ne(){return(await W()).map(e=>e.message)}async function re(){let e=await U(),t=[],{errors:n}=q();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function ie(){let e=P();if(!e)return[];let t=[];return e.subscription&&t.push({label:`Login method`,value:`${e.subscription} Account`}),e.tokenSource&&t.push({label:`Auth token`,value:e.tokenSource}),e.apiKeySource&&t.push({label:`API key`,value:e.apiKeySource}),e.organization&&!process.env.IS_DEMO&&t.push({label:`Organization`,value:e.organization}),e.email&&!process.env.IS_DEMO&&t.push({label:`Email`,value:e.email}),t}function ae(){let e=j(),r=[];if(e!==`firstParty`){let t={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];r.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&r.push({label:`API base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&r.push({label:`Bedrock base URL`,value:e}),r.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&r.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&r.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&r.push({label:`GCP project`,value:i}),r.push({label:`Default region`,value:n()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&r.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&r.push({label:`Microsoft Foundry base URL`,value:e});let n=process.env.ANTHROPIC_FOUNDRY_RESOURCE;n&&r.push({label:`Microsoft Foundry resource`,value:n}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&r.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;r.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;r.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;r.push({label:`OpenAI base URL`,value:e})}let a=B();a&&r.push({label:`Proxy`,value:a});let o=V();return process.env.NODE_EXTRA_CA_CERTS&&r.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&r.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&r.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),r}function oe(e){let t=I(e);if(e===null&&L()){let e=te();t=`${h.bold(`Default`)} ${e}`}return t}var $,se=e((()=>{g(),a(),v(),M(),c(),H(),r(),b(),A(),p(),N(),F(),R(),G(),z(),K(),S(),C(),$=y()}));export{re as a,J as c,se as d,ne as i,Q as l,ie as n,X as o,Y as r,Z as s,ae as t,oe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-CKaGmKg2.js";async function i(e,t){return(0,a.jsx)(r,{onClose:e,context:t,defaultTab:`Status`})}var a;e((()=>{n(),a=t()}))();export{i as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Qi as n}from"./loadAgentsDir-DaNpxaO-.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,n)=>e+t(`${n.agentType}: ${n.whenToUse}`),0):0}var i,a=e((()=>{n(),i=15e3}));export{r as n,a as r,i as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-BxQ1hpjp.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=`${t}s`){return e===1?t:n}function u(e){let t=e.indexOf(`
|
|
2
|
-
`);return t===-1?e:e.slice(0,t)}function d(e,t,n=0){let r=0,i=e.indexOf(t,n);for(;i!==-1;)r++,i=e.indexOf(t,i+1);return r}function f(e){return e.replace(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function p(e){return e.replace(/\u3000/g,` `)}function m(e,t=`,`,n=g){let r=`...[truncated]`,i=``;for(let a of e){let e=i?t:``,o=e+a;if(i.length+o.length<=n)i+=o;else{let t=n-i.length-e.length-14;return t>0?i+=e+a.slice(0,t)+r:i+=r,i}}return i}function h(e,t){let n=e.split(`
|
|
3
|
-
`);return n.length<=t?e:`${n.slice(0,t).join(`
|
|
4
|
-
`)}…`}var g,_,v=e((()=>{t(),g=2**21,_=class{constructor(e=g){n(this,`maxSize`,void 0),n(this,`content`,``),n(this,`isTruncated`,!1),n(this,`totalBytesReceived`,0),this.maxSize=e}append(e){let t=typeof e==`string`?e:e.toString();if(this.totalBytesReceived+=t.length,!(this.isTruncated&&this.content.length>=this.maxSize))if(this.content.length+t.length>this.maxSize){let e=this.maxSize-this.content.length;e>0&&(this.content+=t.slice(0,e)),this.isTruncated=!0}else this.content+=t}toString(){if(!this.isTruncated)return this.content;let e=this.totalBytesReceived-this.maxSize,t=Math.round(e/1024);return`${this.content}\n... [output truncated - ${t}KB removed]`}clear(){this.content=``,this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}}));export{u as a,p as c,h as d,a as f,s as i,l,c as n,v as o,o as p,d as r,f as s,_ as t,m as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.js";function r(e){o=e}function i(){let e=o?.()??{};if(!t(process.env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB))return Object.keys(e).length>0?{...process.env,...e}:process.env;let n={...process.env,...e};for(let e of a)delete n[e],delete n[`INPUT_${e}`];return n}var a,o,s=e((()=>{n(),a=[`ANTHROPIC_API_KEY`,`CLAUDE_CODE_OAUTH_TOKEN`,`ANTHROPIC_AUTH_TOKEN`,`ANTHROPIC_FOUNDRY_API_KEY`,`ANTHROPIC_CUSTOM_HEADERS`,`OTEL_EXPORTER_OTLP_HEADERS`,`OTEL_EXPORTER_OTLP_LOGS_HEADERS`,`OTEL_EXPORTER_OTLP_METRICS_HEADERS`,`OTEL_EXPORTER_OTLP_TRACES_HEADERS`,`AWS_SECRET_ACCESS_KEY`,`AWS_SESSION_TOKEN`,`AWS_BEARER_TOKEN_BEDROCK`,`GOOGLE_APPLICATION_CREDENTIALS`,`AZURE_CLIENT_SECRET`,`AZURE_CLIENT_CERTIFICATE_PATH`,`ACTIONS_ID_TOKEN_REQUEST_TOKEN`,`ACTIONS_ID_TOKEN_REQUEST_URL`,`ACTIONS_RUNTIME_TOKEN`,`ACTIONS_RUNTIME_URL`,`ALL_INPUTS`,`OVERRIDE_GITHUB_TOKEN`,`DEFAULT_WORKFLOW_TOKEN`,`SSH_SIGNING_KEY`]}));export{r as n,i as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./subprocessEnv-CNBOhlDV.js";t();export{e as registerUpstreamProxyEnvFn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./switcher-DQF5ZNal.js";t();export{e as restoreActiveProvider};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hn as t,Un as n,Wn as r}from"./settings-3xZ0fsvE.js";import{u as i}from"./oauth-D38aRTUb.js";import{$r as a,Pt as o,St as s,gt as c,ni as l,ti as u}from"./model-Do0f476p.js";function d(){p=void 0,n()}function f(){if(p!==void 0)return p;if(a()!==`firstParty`||!l()||process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return p=r(!1);let e=s();if(e?.accessToken&&e.subscriptionType===null||e?.accessToken&&e.scopes?.includes(`user:inference`)&&(e.subscriptionType===`enterprise`||e.subscriptionType===`team`))return p=r(!0);try{let{key:e}=c({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return p=r(!0)}catch{}return p=r(!1)}var p,m=e((()=>{i(),o(),u(),t()}));export{f as n,d as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cu as e,du as t,gu as n,lu as r,pu as i}from"./loadAgentsDir-DaNpxaO-.js";r();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,n as validateGitState};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,fi as a,j as o,t as s}from"./src-DL3w8VPk2.js";import{n as c,t as l}from"./cwd-Nh5IZNKO.js";import{C as u,R as d,S as f,V as p,f as ee,u as te,x as ne}from"./debug-D58GQBDG.js";import{Cn as m,Gt as h,Jt as g,Tn as re}from"./settings-3xZ0fsvE.js";import{c as _,h as v,o as y,v as b,y as x}from"./config-DRy1I12M.js";import{r as S,t as C}from"./execFileNoThrow-Bmb5HEFz.js";import{o as w,s as T}from"./log-CZ7ploQm.js";import{i as ie,o as ae}from"./platform-DMQxcm4K.js";import{d as oe,o as se,s as E}from"./types-APu4OCXJ.js";import{homedir as D,platform as O}from"os";import{dirname as ce,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as le}from"url";function I(){let e=te().existsSync(k(l(),`AGENTS.md`)),t=re(l());return[{key:`workspace`,text:`Ask Work Mate to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`agentsmd`,text:`Run /init to create a AGENTS.md file with instructions for Work Mate`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){y().hasCompletedProjectOnboarding||L()&&b(e=>({...e,hasCompletedProjectOnboarding:!0}))}function ue(){b(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),v(),c(),m(),ee(),z=t(()=>{let e=y();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function V(e){x(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){x(e=>({...e,appleTerminalSetupInProgress:!1}))}function de(){let e=_();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(D(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function fe(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),V(t),t}catch(e){return T(e),null}}async function W(){let{inProgress:e,backupPath:t}=de();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return T(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{v(),S(),w()}));function pe(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function me(){return!h.terminal||!(h.terminal in $)?null:$[h.terminal]??null}function K(e){return r()?`\x1b]8;;${le(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return O()===`darwin`&&h.terminal===`Apple_Terminal`||h.terminal===`vscode`||h.terminal===`cursor`||h.terminal===`windsurf`||h.terminal===`alacritty`||h.terminal===`zed`}async function J(e){let t=``;switch(h.terminal){case`Apple_Terminal`:t=await ye(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await be(e);break;case`zed`:t=await xe(e);break;case null:break}return x(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(h.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:h.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),t}function he(){return _().shiftEnterKeyBindingInstalled===!0}function ge(){return _().hasUsedBackslashReturn===!0}function _e(){_().hasUsedBackslashReturn||x(e=>({...e,hasUsedBackslashReturn:!0}))}async function ve(e,t,n){if(h.terminal&&h.terminal in $)return e(`Shift+Enter is natively supported in ${$[h.terminal]}.
|
|
2
|
-
|
|
3
|
-
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!q()){let t=h.terminal||`your current terminal`,n=ie(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
|
|
4
|
-
`:n===`windows`&&(r=` • Windows: Windows Terminal
|
|
5
|
-
`),e(`Terminal setup cannot be run from ${t}.
|
|
6
|
-
|
|
7
|
-
This command configures a convenient Shift+Enter shortcut for multi-line prompts.
|
|
8
|
-
${i.dim(`Note: You can already use backslash (\\\\) + return to add newlines.`)}
|
|
9
|
-
|
|
10
|
-
To set up the shortcut (optional):
|
|
11
|
-
1. Exit tmux/screen temporarily
|
|
12
|
-
2. Run /terminal-setup directly in one of these terminals:
|
|
13
|
-
${r} • IDE: VSCode, Cursor, Windsurf, Zed
|
|
14
|
-
• Other: Alacritty
|
|
15
|
-
3. Return to tmux/screen - settings will persist
|
|
16
|
-
|
|
17
|
-
${i.dim(`Note: iTerm2, WezTerm, Ghostty, Kitty, and Warp support Shift+Enter natively.`)}`),null}return e(await J(t.options.theme)),null}async function Y(e=`VSCode`,t){if(pe())return`${o(`warning`,t)(`Cannot install keybindings from a remote ${e} session.`)}${Q}${Q}${e} keybindings must be installed on your local machine, not the remote server.${Q}${Q}To install the Shift+Enter keybinding:${Q}1. Open ${e} on your local machine (not connected to remote)${Q}2. Open the Command Palette (Cmd/Ctrl+Shift+P) → "Preferences: Open Keyboard Shortcuts (JSON)"${Q}3. Add this keybinding (the file must be a JSON array):${Q}${Q}${i.dim(`[
|
|
18
|
-
{
|
|
19
|
-
"key": "shift+enter",
|
|
20
|
-
"command": "workbench.action.terminal.sendSequence",
|
|
21
|
-
"args": { "text": "\\u001b\\r" },
|
|
22
|
-
"when": "terminalFocus"
|
|
23
|
-
}
|
|
24
|
-
]`)}${Q}`;let n=e===`VSCode`?`Code`:e,r=k(D(),O()===`win32`?k(`AppData`,`Roaming`,n,`User`):O()===`darwin`?k(`Library`,`Application Support`,n,`User`):k(`.config`,n,`User`)),a=k(r,`keybindings.json`);try{await M(r,{recursive:!0});let n=`[]`,s=[],c=!1;try{n=await N(a,{encoding:`utf-8`}),c=!0,s=oe(n)??[]}catch(e){if(!p(e))throw e}if(c){let n=`${a}.${A(4).toString(`hex`)}.bak`;try{await j(a,n)}catch{return`${o(`warning`,t)(`Error backing up existing ${e} terminal keybindings. Bailing out.`)}${Q}${i.dim(`See ${K(a)}`)}${Q}${i.dim(`Backup path: ${K(n)}`)}${Q}`}}return s.find(e=>e.key===`shift+enter`&&e.command===`workbench.action.terminal.sendSequence`&&e.when===`terminalFocus`)?`${o(`warning`,t)(`Found existing ${e} terminal Shift+Enter key binding. Remove it to continue.`)}${Q}${i.dim(`See ${K(a)}`)}${Q}`:(await F(a,se(n,{key:`shift+enter`,command:`workbench.action.terminal.sendSequence`,args:{text:`\x1B\r`},when:`terminalFocus`}),{encoding:`utf-8`}),`${o(`success`,t)(`Installed ${e} terminal Shift+Enter key binding`)}${Q}${i.dim(`See ${K(a)}`)}${Q}`)}catch(t){throw T(t),Error(`Failed to install ${e} terminal Shift+Enter key binding`)}}async function X(e){let{code:t}=await C(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':useOptionAsMetaKey bool true`,U()]);if(t!==0){let{code:t}=await C(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':useOptionAsMetaKey true`,U()]);if(t!==0)return T(Error(`Failed to enable Option as Meta key for Terminal.app profile: ${e}`)),!1}return!0}async function Z(e){let{code:t}=await C(`/usr/libexec/PlistBuddy`,[`-c`,`Add :'Window Settings':'${e}':Bell bool false`,U()]);if(t!==0){let{code:t}=await C(`/usr/libexec/PlistBuddy`,[`-c`,`Set :'Window Settings':'${e}':Bell false`,U()]);if(t!==0)return T(Error(`Failed to disable audio bell for Terminal.app profile: ${e}`)),!1}return!0}async function ye(e){try{if(!await fe())throw Error(`Failed to create backup of Terminal.app preferences, bailing out`);let{stdout:t,code:n}=await C(`defaults`,[`read`,`com.apple.Terminal`,`Default Window Settings`]);if(n!==0||!t.trim())throw Error(`Failed to read default Terminal.app profile`);let{stdout:r,code:a}=await C(`defaults`,[`read`,`com.apple.Terminal`,`Startup Window Settings`]);if(a!==0||!r.trim())throw Error(`Failed to read startup Terminal.app profile`);let s=!1,c=t.trim(),l=await X(c),u=await Z(c);(l||u)&&(s=!0);let d=r.trim();if(d!==c){let e=await X(d),t=await Z(d);(e||t)&&(s=!0)}if(!s)throw Error(`Failed to enable Option as Meta key or disable audio bell for any Terminal.app profile`);return await C(`killall`,[`cfprefsd`]),H(),`${o(`success`,e)(`Configured Terminal.app settings:`)}${Q}${o(`success`,e)(`- Enabled "Use Option as Meta key"`)}${Q}${o(`success`,e)(`- Switched to visual bell`)}${Q}${i.dim(`Option+Enter will now enter a newline.`)}${Q}${i.dim(`You must restart Terminal.app for changes to take effect.`,e)}${Q}`}catch(e){T(e);let t=await W(),n=`Failed to enable Option as Meta key for Terminal.app.`;throw t.status===`restored`?Error(`${n} Your settings have been restored from backup.`):t.status===`failed`?Error(`${n} Restoring from backup failed, try manually with: defaults import com.apple.Terminal ${t.backupPath}`):Error(`${n} No backup was available to restore from.`)}}async function be(e){let t=[],n=process.env.XDG_CONFIG_HOME;if(n?t.push(k(n,`alacritty`,`alacritty.toml`)):t.push(k(D(),`.config`,`alacritty`,`alacritty.toml`)),O()===`win32`){let e=process.env.APPDATA;e&&t.push(k(e,`alacritty`,`alacritty.toml`))}let r=null,a=``,s=!1;for(let e of t)try{a=await N(e,{encoding:`utf-8`}),r=e,s=!0;break}catch(e){if(!p(e))throw e}if(r||(r=t[0]??null),!r)throw Error(`No valid config path found for Alacritty`);try{if(s){if(a.includes(`mods = "Shift"`)&&a.includes(`key = "Return"`))return`${o(`warning`,e)(`Found existing Alacritty Shift+Enter key binding. Remove it to continue.`)}${Q}${i.dim(`See ${K(r)}`)}${Q}`;let t=A(4).toString(`hex`),n=`${r}.${t}.bak`;try{await j(r,n)}catch{return`${o(`warning`,e)(`Error backing up existing Alacritty config. Bailing out.`)}${Q}${i.dim(`See ${K(r)}`)}${Q}${i.dim(`Backup path: ${K(n)}`)}${Q}`}}else await M(ce(r),{recursive:!0});let t=a;return a&&!a.endsWith(`
|
|
25
|
-
`)&&(t+=`
|
|
26
|
-
`),t+=`
|
|
27
|
-
[[keyboard.bindings]]
|
|
28
|
-
key = "Return"
|
|
29
|
-
mods = "Shift"
|
|
30
|
-
chars = "\\u001B\\r"
|
|
31
|
-
`,await F(r,t,{encoding:`utf-8`}),`${o(`success`,e)(`Installed Alacritty Shift+Enter key binding`)}${Q}${o(`success`,e)(`You may need to restart Alacritty for changes to take effect`)}${Q}${i.dim(`See ${K(r)}`)}${Q}`}catch(e){throw T(e),Error(`Failed to install Alacritty Shift+Enter key binding`)}}async function xe(e){let t=k(D(),`.config`,`zed`),n=k(t,`keymap.json`);try{await M(t,{recursive:!0});let r=`[]`,a=!1;try{r=await N(n,{encoding:`utf-8`}),a=!0}catch(e){if(!p(e))throw e}if(a){if(r.includes(`shift-enter`))return`${o(`warning`,e)(`Found existing Zed Shift+Enter key binding. Remove it to continue.`)}${Q}${i.dim(`See ${K(n)}`)}${Q}`;let t=`${n}.${A(4).toString(`hex`)}.bak`;try{await j(n,t)}catch{return`${o(`warning`,e)(`Error backing up existing Zed keymap. Bailing out.`)}${Q}${i.dim(`See ${K(n)}`)}${Q}${i.dim(`Backup path: ${K(t)}`)}${Q}`}}let s;try{s=f(r),Array.isArray(s)||(s=[])}catch{s=[]}return s.push({context:`Terminal`,bindings:{"shift-enter":[`terminal::SendText`,`\x1B\r`]}}),await F(n,`${u(s,null,2)}\n`,{encoding:`utf-8`}),`${o(`success`,e)(`Installed Zed Shift+Enter key binding`)}${Q}${i.dim(`See ${K(n)}`)}${Q}`}catch(e){throw T(e),Error(`Failed to install Zed Shift+Enter key binding`)}}var Q,$,Se=e((()=>{a(),s(),B(),G(),v(),g(),d(),S(),E(),w(),ae(),ne(),Q=`
|
|
32
|
-
`,$={ghostty:`Ghostty`,kitty:`Kitty`,"iTerm.app":`iTerm2`,WezTerm:`WezTerm`,WarpTerminal:`Warp`}}));export{he as a,q as c,I as d,ue as f,z as h,Se as i,W as l,R as m,me as n,_e as o,B as p,ge as r,J as s,ve as t,G as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-DL3w8VPk2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-iD9ufy99.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{r as n,t as r}from"./execFileNoThrow-Bmb5HEFz.js";import{i,t as a}from"./cliLaunch-DDtwAolw.js";import{spawnSync as o}from"child_process";n(),e();var s=class{constructor(){t(this,`name`,`tmux`),t(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await r(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=a(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=i(t);if(o(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(o(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}};export{s as TmuxEngine};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{dT as t,uT as n,vx as r,yx as i}from"./loadAgentsDir-DaNpxaO-.js";import{n as a,t as o}from"./partition-BivH9MBJ.js";function s(e,n,r){let[o,s]=a(t([...e,...n],`name`),i),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),n(),r()}));export{s as n,c as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,c,i as l,x as u}from"./debug-D58GQBDG.js";import{d,f}from"./log-CZ7ploQm.js";import{l as p,u as m}from"./oauth-D38aRTUb.js";import{Pt as h,_n as g,gn as _,ot as v}from"./model-Do0f476p.js";import{hostname as y}from"os";i(),n(),m(),l(),s(),d(),g(),u();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let s=p().BASE_API_URL,l;try{l=await r.post(`${s}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${o(e)}`);return}if(l.status!==200&&l.status!==201){c(`[trusted-device] Enrollment failed ${l.status}: ${a(l.data).slice(0,200)}`);return}let u=l.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${l.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${o(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${o(e)}`)}}export{C as i,w as n,E as r,T as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./trustedDevice-CB6rNzl-.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C as t,D as n,E as r,N as i,P as a,_ as o,f as s,g as c,j as l,n as u,r as d,t as f}from"./lazySchema-DULtBUCI.js";import{C as p,v as m,x as h,y as g}from"./debug-D58GQBDG.js";import{o as _,s as v}from"./log-CZ7ploQm.js";import{n as y,t as b}from"./memoize-CumjjK2Q.js";import{open as x,readFile as S,stat as C}from"fs/promises";function w(e){return e.startsWith(T)?e.slice(1):e}var T,E=e((()=>{T=``}));function D(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}function p(e){r=e,i=``,a=0,o=16,d=0}function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&A(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&A(e.charCodeAt(r)))for(r++;r<e.length&&A(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&A(e.charCodeAt(r))){for(r++;r<e.length&&A(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
2
|
-
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(k(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(O(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(O(t));return o=15}if(k(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
3
|
-
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!k(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,k(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!A(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}function _(e){if(O(e)||k(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let e;do e=g();while(e>=12&&e<=15);return e}return{setPosition:p,getPosition:()=>r,scan:t?v:g,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>c,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function O(e){return e===32||e===9}function k(e){return e===10||e===13}function A(e){return e>=48&&e<=57}var ee,j=e((()=>{(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(ee||(ee={}))})),M,N,P,F,te=e((()=>{M=Array(20).fill(0).map((e,t)=>` `.repeat(t)),N=200,P={" ":{"\n":Array(N).fill(0).map((e,t)=>`
|
|
4
|
-
`+` `.repeat(t)),"\r":Array(N).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(N).fill(0).map((e,t)=>`\r
|
|
5
|
-
`+` `.repeat(t))}," ":{"\n":Array(N).fill(0).map((e,t)=>`
|
|
6
|
-
`+` `.repeat(t)),"\r":Array(N).fill(0).map((e,t)=>`\r`+` `.repeat(t)),"\r\n":Array(N).fill(0).map((e,t)=>`\r
|
|
7
|
-
`+` `.repeat(t))}},F=[`
|
|
8
|
-
`,`\r`,`\r
|
|
9
|
-
`]}));function ne(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!L(e,a-1);)a--;let c=s;for(;c<e.length&&!L(e,c);)c++;i=e.substring(a,c),r=re(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=ie(n,e),l=F.includes(c),u=0,d=0,f;f=n.insertSpaces?M[n.tabSize||4]??I(M[1],n.tabSize||4):` `;let p=f===` `?` `:` `,m=D(i,!1),h=!1;function g(){if(u>1)return I(c,u)+I(f,r+d);let e=f.length*(r+d);return!l||e>P[p][c].length?c+I(f,r+d):e<=0?c:P[p][c][e]}function _(){let e=m.scan();for(u=0;e===15||e===14;)e===14&&n.keepLines?u+=1:e===14&&(u=1),e=m.scan();return h=e===16||m.getTokenError()!==0,e}let v=[];function y(n,r,i){!h&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&v.push({offset:r,length:i-r,content:n})}let b=_();if(n.keepLines&&u>0&&y(I(c,u),0,0),b!==17){let e=m.getTokenOffset()+a;y(f.length*r<20&&n.insertSpaces?M[f.length*r]:I(f,r),a,e)}for(;b!==17;){let e=m.getTokenOffset()+m.getTokenLength()+a,t=_(),r=``,i=!1;for(;u===0&&(t===12||t===13);){let n=m.getTokenOffset()+a;y(M[1],e,n),e=m.getTokenOffset()+m.getTokenLength()+a,i=t===12,r=i?g():``,t=_()}if(t===2)b!==1&&d--,n.keepLines&&u>0||!n.keepLines&&b!==1?r=g():n.keepLines&&(r=M[1]);else if(t===4)b!==3&&d--,n.keepLines&&u>0||!n.keepLines&&b!==3?r=g():n.keepLines&&(r=M[1]);else{switch(b){case 3:case 1:d++,r=n.keepLines&&u>0||!n.keepLines?g():M[1];break;case 5:r=n.keepLines&&u>0||!n.keepLines?g():M[1];break;case 12:r=g();break;case 13:u>0?r=g():i||(r=M[1]);break;case 6:n.keepLines&&u>0?r=g():i||(r=M[1]);break;case 10:n.keepLines&&u>0?r=g():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&u>0?r=g():(t===12||t===13)&&!i?r=M[1]:t!==5&&t!==17&&(h=!0);break;case 16:h=!0;break}u>0&&(t===12||t===13)&&(r=g())}t===17&&(r=n.keepLines&&u>0?g():n.insertFinalNewline?c:``);let o=m.getTokenOffset()+a;y(r,e,o),b=t}return v}function I(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}function re(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===M[1])r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}function ie(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
|
|
10
|
-
`?`\r
|
|
11
|
-
`:`\r`;if(n===`
|
|
12
|
-
`)return`
|
|
13
|
-
`}return e&&e.eol||`
|
|
14
|
-
`}function L(e,t){return`\r
|
|
15
|
-
`.indexOf(e.charAt(t))!==-1}var ae=e((()=>{j(),te()}));function oe(e,t=[],n=R.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return le(e,{onObjectBegin:()=>{let e={};o(e),a.push(i),i=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{i=a.pop()},onArrayBegin:()=>{let e=[];o(e),a.push(i),i=e,r=null},onArrayEnd:()=>{i=a.pop()},onLiteralValue:o,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n),i[0]}function se(e,t=[],n=R.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}function a(e){return r.children.push(e),e}le(e,{onObjectBegin:e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},onObjectProperty:(e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},onObjectEnd:(e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:(e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},onArrayEnd:(e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:(e,t,n)=>{a({type:ue(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:(e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}},n);let o=r.children[0];return o&&delete o.parent,o}function ce(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}function le(e,t,n=R.DEFAULT){let r=D(e,!1),i=[],a=0;function o(e){return e?()=>a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function s(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function c(e){return e?t=>a===0&&e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}function l(e){return e?()=>{a>0?a++:e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice())===!1&&(a=1)}:()=>!0}function u(e){return e?()=>{a>0&&a--,a===0&&e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter())}:()=>!0}let d=l(t.onObjectBegin),f=c(t.onObjectProperty),p=u(t.onObjectEnd),m=l(t.onArrayBegin),h=u(t.onArrayEnd),g=c(t.onLiteralValue),_=s(t.onSeparator),v=o(t.onComment),y=s(t.onError),b=n&&n.disallowComments,x=n&&n.allowTrailingComma;function S(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:C(14);break;case 5:C(15);break;case 3:C(13);break;case 1:b||C(11);break;case 2:C(12);break;case 6:C(16);break}switch(e){case 12:case 13:b?C(10):v();break;case 16:C(1);break;case 15:case 14:break;default:return e}}}function C(e,t=[],n=[]){if(y(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){S();break}else if(n.indexOf(e)!==-1)break;e=S()}}}function w(e){let t=r.getTokenValue();return e?g(t):(f(t),i.push(t)),S(),!0}function T(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(C(2),t=0),g(t);break;case 7:g(null);break;case 8:g(!0);break;case 9:g(!1);break;default:return!1}return S(),!0}function E(){return r.getToken()===10?(w(!1),r.getToken()===6?(_(`:`),S(),A()||C(4,[],[2,5])):C(5,[],[2,5]),i.pop(),!0):(C(3,[],[2,5]),!1)}function O(){d(),S();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||C(4,[],[]),_(`,`),S(),r.getToken()===2&&x)break}else e&&C(6,[],[]);E()||C(4,[],[2,5]),e=!0}return p(),r.getToken()===2?S():C(7,[2],[]),!0}function k(){m(),S();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||C(4,[],[]),_(`,`),S(),r.getToken()===4&&x)break}else t&&C(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,A()||C(4,[],[4,5]),t=!0}return h(),e||i.pop(),r.getToken()===4?S():C(8,[4],[]),!0}function A(){switch(r.getToken()){case 3:return k();case 1:return O();case 10:return w(!0);default:return T()}}return S(),r.getToken()===17?n.allowEmptyContent?!0:(C(4,[],[]),!1):A()?(r.getToken()!==17&&C(9,[],[]),!0):(C(4,[],[]),!1)}function ue(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}var R,z=e((()=>{j(),(function(e){e.DEFAULT={allowTrailingComma:!1}})(R||(R={}))}));function de(e,t,n,r){let i=t.slice(),a=se(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=ce(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return B(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=ce(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return B(e,{offset:i,length:a-i,content:``},r)}else return B(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return B(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return B(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return B(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return B(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}function B(e,t,n){if(!n.formattingOptions)return[t];let r=V(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!L(r,i-1);)i--;for(;a<r.length&&!L(r,a);)a++}let o=ne(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=V(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}function V(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}var fe=e((()=>{ae(),z()}));function pe(e,t,n,r){return de(e,t,n,r)}function me(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=V(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}var H,U,W,G,he=e((()=>{ae(),fe(),j(),z(),(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(H||(H={})),(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(U||(U={})),W=oe,(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(G||(G={}))}));function ge(e,t){try{return{ok:!0,value:JSON.parse(w(e))}}catch(e){return t&&v(e),{ok:!1}}}function _e(e){if(!e)return null;try{return W(w(e))}catch(e){return v(e),null}}function ve(e){let t=J,n=e.length,r=t(e);if(!r.error||r.done||r.read>=n)return r.values;let i=r.values,a=r.read;for(;a<n;){let r=typeof e==`string`?e.indexOf(`
|
|
16
|
-
`,a):e.indexOf(10,a);if(r===-1)break;a=r+1;let o=t(e,a);if(o.values.length>0&&(i=i.concat(o.values)),!o.error||o.done||o.read>=n)break;a=o.read}return i}function ye(e){let t=e.length,n=0;e[0]===239&&e[1]===187&&e[2]===191&&(n=3);let r=[];for(;n<t;){let i=e.indexOf(10,n);i===-1&&(i=t);let a=e.toString(`utf8`,n,i).trim();if(n=i+1,a)try{r.push(JSON.parse(a))}catch{}}return r}function be(e){let t=w(e),n=t.length,r=0,i=[];for(;r<n;){let e=t.indexOf(`
|
|
17
|
-
`,r);e===-1&&(e=n);let a=t.substring(r,e).trim();if(r=e+1,a)try{i.push(JSON.parse(a))}catch{}}return i}function K(e){return J?ve(e):typeof e==`string`?be(e):ye(e)}async function xe(e){try{var t=m();let{size:n}=await C(e);if(n<=Y)return K(await S(e));let r=t.a(await x(e,`r`)),i=Buffer.allocUnsafe(Y),a=0,o=n-Y;for(;a<Y;){let{bytesRead:e}=await r.read(i,a,Y-a,o+a);if(e===0)break;a+=e}let s=i.indexOf(10);return s!==-1&&s<a-1?K(i.subarray(s+1,a)):K(i.subarray(0,a))}catch(e){t.e=e}finally{await t.d()}}function Se(e,t){try{if(!e||e.trim()===``)return p([t],null,4);let n=w(e),r=W(n);if(Array.isArray(r)){let e=r.length,i=pe(n,e===0?[0]:[e],t,{formattingOptions:{insertSpaces:!0,tabSize:4},isArrayInsertion:!0});return!i||i.length===0?p([...r,t],null,4):me(n,i)}else return p([t],null,4)}catch(e){return v(e),p([t],null,4)}}var Ce,q,we,J,Y,Te=e((()=>{he(),E(),_(),b(),h(),g(),Ce=8*1024,q=y(ge,e=>e,50),we=Object.assign(function(e,t=!0){if(!e)return null;let n=e.length>Ce?ge(e,t):q(e,t);return n.ok?n.value:null},{cache:q.cache}),J=(()=>{if(typeof Bun>`u`)return!1;let e=Bun.JSONL;return e?.parseChunk?e.parseChunk:!1})(),Y=100*1024*1024})),Ee,X,De,Z,Oe,ke,Ae,je,Q,Me,Ne,$,Pe,Fe=e((()=>{d(),f(),Ee=u(()=>s([`local`,`user`,`project`,`dynamic`,`enterprise`,`claudeai`,`managed`])),u(()=>s([`stdio`,`sse`,`sse-ide`,`http`,`ws`,`sdk`,`claudeai-proxy`])),X=u(()=>n({type:t(`stdio`).optional(),command:i().min(1,`Command cannot be empty`),args:c(i()).default([]),env:l(i(),i()).optional()})),De=u(()=>o()),Z=u(()=>n({clientId:i().optional(),callbackPort:r().int().positive().optional(),authServerMetadataUrl:i().url().startsWith(`https://`,{message:`authServerMetadataUrl must use https://`}).optional(),xaa:De().optional()})),Oe=u(()=>n({type:t(`sse`),url:i(),headers:l(i(),i()).optional(),headersHelper:i().optional(),oauth:Z().optional()})),ke=u(()=>n({type:t(`sse-ide`),url:i(),ideName:i(),ideRunningInWindows:o().optional()})),Ae=u(()=>n({type:t(`ws-ide`),url:i(),ideName:i(),authToken:i().optional(),ideRunningInWindows:o().optional()})),je=u(()=>n({type:t(`http`),url:i(),headers:l(i(),i()).optional(),headersHelper:i().optional(),oauth:Z().optional()})),Q=u(()=>n({type:t(`ws`),url:i(),headers:l(i(),i()).optional(),headersHelper:i().optional()})),Me=u(()=>n({type:t(`sdk`),name:i()})),Ne=u(()=>n({type:t(`claudeai-proxy`),url:i(),id:i()})),$=u(()=>a([X(),Oe(),ke(),Ae(),je(),Q(),Me(),Ne()])),Pe=u(()=>n({mcpServers:l(i(),$())}))}));export{Fe as a,K as c,_e as d,E as f,X as i,xe as l,Pe as n,Se as o,w as p,$ as r,Te as s,Ee as t,we as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{P as r,R as i,S as a,V as o,c as s,i as c,x as l}from"./debug-D58GQBDG.js";import{o as u}from"./log-CZ7ploQm.js";import{a as d,i as f}from"./genericProcessUtils-6E7fB1dI.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{i(),l()})),_=e((()=>{c(),i(),n(),g(),u(),l()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return o(e)||s(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(d(t))try{let i=a(await m(p(e,r),`utf8`));n.push({pid:t,sessionId:i.sessionId,cwd:i.cwd,startedAt:i.startedAt,kind:i.kind,name:i.name,messagingSocketPath:i.messagingSocketPath,entrypoint:i.entrypoint,bridgeSessionId:i.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),c(),i(),f(),l(),_(),g()}))();export{y as listAllLiveSessions};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.js";import{B as r,R as i,c as a,i as o,nt as s,tt as c}from"./debug-D58GQBDG.js";import{c as l,h as u,l as d,m as f,s as p}from"./proxy-BhIc7-mj.js";import{homedir as m}from"os";import{join as h}from"path";import{mkdir as g,readFile as _,unlink as v,writeFile as y}from"fs/promises";import{createServer as b}from"node:net";n(),c(),i(),o(),u(),d();var x,S=512*1024,C=3e4;function w(e){let t=e.length,n=[],r=t;for(;r>127;)n.push(r&127|128),r>>>=7;n.push(r);let i=new Uint8Array(1+n.length+t);return i[0]=10,i.set(n,1),i.set(e,1+n.length),i}function T(e){if(e.length===0)return new Uint8Array;if(e[0]!==10)return null;let t=0,n=0,r=1;for(;r<e.length;){let i=e[r];if(t|=(i&127)<<n,r++,!(i&128))break;if(n+=7,n>28)return null}return r+t>e.length?null:e.subarray(r,r+t)}function E(){return{connectBuf:Buffer.alloc(0),pending:[],wsOpen:!1,established:!1,closed:!1}}async function D(e){let t=`Basic ${Buffer.from(`${e.sessionId}:${e.token}`).toString(`base64`)}`,n=`Bearer ${e.token}`,r=typeof Bun<`u`?O(e.wsUrl,t,n):await k(e.wsUrl,t,n);return a(`[upstreamproxy] relay listening on 127.0.0.1:${r.port}`),r}function O(e,t,n){let r=Bun.listen({hostname:`127.0.0.1`,port:0,socket:{open(e){e.data={...E(),writeBuf:[]}},data(r,i){let a=r.data;A({write:e=>{let t=typeof e==`string`?Buffer.from(e,`utf8`):e;if(a.writeBuf.length>0){a.writeBuf.push(t);return}let n=r.write(t);n<t.length&&a.writeBuf.push(t.subarray(n))},end:()=>r.end()},a,i,e,t,n)},drain(e){let t=e.data;for(;t.writeBuf.length>0;){let n=t.writeBuf[0],r=e.write(n);if(r<n.length){t.writeBuf[0]=n.subarray(r);return}t.writeBuf.shift()}},close(e){P(e.data)},error(e,t){a(`[upstreamproxy] client socket error: ${t.message}`),P(e.data)}}});return{port:r.port,stop:()=>r.stop(!0)}}async function k(e,t,n){x=(await import(`./wrapper-K8ZapJVu.js`)).default;let r=new WeakMap,i=b(i=>{let o=E();r.set(i,o);let s={write:e=>{i.write(typeof e==`string`?e:Buffer.from(e))},end:()=>i.end()};i.on(`data`,r=>A(s,o,r,e,t,n)),i.on(`close`,()=>P(r.get(i))),i.on(`error`,e=>{a(`[upstreamproxy] client socket error: ${e.message}`),P(r.get(i))})});return new Promise((e,t)=>{i.once(`error`,t),i.listen(0,`127.0.0.1`,()=>{let n=i.address();if(n===null||typeof n==`string`){t(Error(`upstreamproxy: server has no TCP address`));return}e({port:n.port,stop:()=>i.close()})})})}function A(e,t,n,r,i,a){if(!t.ws){t.connectBuf=Buffer.concat([t.connectBuf,n]);let o=t.connectBuf.indexOf(`\r
|
|
2
|
-
\r
|
|
3
|
-
`);if(o===-1){t.connectBuf.length>8192&&(e.write(`HTTP/1.1 400 Bad Request\r
|
|
4
|
-
\r
|
|
5
|
-
`),e.end());return}let s=t.connectBuf.subarray(0,o).toString(`utf8`).split(`\r
|
|
6
|
-
`)[0]??``;if(!s.match(/^CONNECT\s+(\S+)\s+HTTP\/1\.[01]$/i)){e.write(`HTTP/1.1 405 Method Not Allowed\r
|
|
7
|
-
\r
|
|
8
|
-
`),e.end();return}let c=t.connectBuf.subarray(o+4);c.length>0&&t.pending.push(Buffer.from(c)),t.connectBuf=Buffer.alloc(0),j(e,t,s,r,i,a);return}if(!t.wsOpen){t.pending.push(Buffer.from(n));return}N(t.ws,n)}function j(e,t,n,r,i,o){let s={"Content-Type":`application/proto`,Authorization:o},c;c=x?new x(r,{headers:s,agent:p(r),...f()}):new globalThis.WebSocket(r,{headers:s,proxy:l(r),tls:f()||void 0}),c.binaryType=`arraybuffer`,t.ws=c,c.onopen=()=>{let e=`${n}\r\nProxy-Authorization: ${i}\r\n\r\n`;c.send(w(new Uint8Array(Buffer.from(e,`utf8`)))),t.wsOpen=!0;for(let e of t.pending)N(c,e);t.pending=[],t.pinger=setInterval(M,C,c)},c.onmessage=n=>{let r=T(n.data instanceof ArrayBuffer?new Uint8Array(n.data):new Uint8Array(Buffer.from(n.data)));r&&r.length>0&&(t.established=!0,e.write(r))},c.onerror=n=>{a(`[upstreamproxy] ws error: ${`message`in n?String(n.message):`websocket error`}`),!t.closed&&(t.closed=!0,t.established||e.write(`HTTP/1.1 502 Bad Gateway\r
|
|
9
|
-
\r
|
|
10
|
-
`),e.end(),P(t))},c.onclose=()=>{t.closed||(t.closed=!0,e.end(),P(t))}}function M(e){e.readyState===WebSocket.OPEN&&e.send(w(new Uint8Array))}function N(e,t){if(e.readyState===WebSocket.OPEN)for(let n=0;n<t.length;n+=S){let r=new Uint8Array(t.subarray(n,n+S));e.send(w(r))}}function P(e){if(e){if(e.pinger&&clearInterval(e.pinger),e.ws&&e.ws.readyState<=WebSocket.OPEN)try{e.ws.close()}catch{}e.ws=void 0}}o();var F=`/etc/ssl/certs/ca-certificates.crt`,I=[`localhost`,`127.0.0.1`,`::1`,`169.254.0.0/16`,`10.0.0.0/8`,`172.16.0.0/12`,`192.168.0.0/16`,`anthropic.com`,`.anthropic.com`,`*.anthropic.com`,`github.com`,`api.github.com`,`*.github.com`,`*.githubusercontent.com`,`registry.npmjs.org`,`pypi.org`,`files.pythonhosted.org`,`index.crates.io`,`proxy.golang.org`].join(`,`),L={enabled:!1};async function R(e){if(!t(process.env.CLAUDE_CODE_REMOTE)||!t(process.env.CCR_UPSTREAM_PROXY_ENABLED))return L;let n=process.env.CLAUDE_CODE_REMOTE_SESSION_ID;if(!n)return a(`[upstreamproxy] CLAUDE_CODE_REMOTE_SESSION_ID unset; proxy disabled`,{level:`warn`}),L;let r=e?.tokenPath??`/run/ccr/session_token`,i=await B(r);if(!i)return a(`[upstreamproxy] no session token file; proxy disabled`),L;V();let o=e?.ccrBaseUrl??process.env.ANTHROPIC_BASE_URL??`https://api.anthropic.com`,c=e?.caBundlePath??h(m(),`.ccr`,`ca-bundle.crt`);if(!await H(o,e?.systemCaPath??F,c))return L;try{let e=await D({wsUrl:`${o.replace(/^http/,`ws`)}/v1/code/upstreamproxy/ws`,sessionId:n,token:i});s(async()=>e.stop()),L={enabled:!0,port:e.port,caBundlePath:c},a(`[upstreamproxy] enabled on 127.0.0.1:${e.port}`),await v(r).catch(()=>{a(`[upstreamproxy] token file unlink failed`,{level:`warn`})})}catch(e){a(`[upstreamproxy] relay start failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`})}return L}function z(){if(!L.enabled||!L.port||!L.caBundlePath){if(process.env.HTTPS_PROXY&&process.env.SSL_CERT_FILE){let e={};for(let t of[`HTTPS_PROXY`,`https_proxy`,`NO_PROXY`,`no_proxy`,`SSL_CERT_FILE`,`NODE_EXTRA_CA_CERTS`,`REQUESTS_CA_BUNDLE`,`CURL_CA_BUNDLE`])process.env[t]&&(e[t]=process.env[t]);return e}return{}}let e=`http://127.0.0.1:${L.port}`;return{HTTPS_PROXY:e,https_proxy:e,NO_PROXY:I,no_proxy:I,SSL_CERT_FILE:L.caBundlePath,NODE_EXTRA_CA_CERTS:L.caBundlePath,REQUESTS_CA_BUNDLE:L.caBundlePath,CURL_CA_BUNDLE:L.caBundlePath}}async function B(e){try{return(await _(e,`utf8`)).trim()||null}catch(e){return r(e)||a(`[upstreamproxy] token read failed: ${e instanceof Error?e.message:String(e)}`,{level:`warn`}),null}}function V(){if(!(process.platform!==`linux`||typeof Bun>`u`))try{e(`bun:ffi`).dlopen(`libc.so.6`,{prctl:{args:[`int`,`u64`,`u64`,`u64`,`u64`],returns:`int`}}).symbols.prctl(4,0n,0n,0n,0n)!==0&&a(`[upstreamproxy] prctl(PR_SET_DUMPABLE,0) returned nonzero`,{level:`warn`})}catch(e){a(`[upstreamproxy] prctl unavailable: ${e instanceof Error?e.message:String(e)}`,{level:`warn`})}}async function H(e,t,n){try{let r=await fetch(`${e}/v1/code/upstreamproxy/ca-cert`,{signal:AbortSignal.timeout(5e3)});if(!r.ok)return a(`[upstreamproxy] ca-cert fetch ${r.status}; proxy disabled`,{level:`warn`}),!1;let i=await r.text(),o=await _(t,`utf8`).catch(()=>``);return await g(h(n,`..`),{recursive:!0}),await y(n,`${o}\n${i}`,`utf8`),!0}catch(e){return a(`[upstreamproxy] ca-cert download failed: ${e instanceof Error?e.message:String(e)}; proxy disabled`,{level:`warn`}),!1}}export{z as getUpstreamProxyEnv,R as initUpstreamProxy};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{gd as n,uC as r}from"./loadAgentsDir-DaNpxaO-.js";import{Gt as i,ai as a,et as o,t as s,vt as c}from"./src-DL3w8VPk2.js";function l(e,t,n,r=!0){let{exit:i}=c(),[a,s]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??i,[n,i]),d=o(e=>s({pending:e,keyName:`Ctrl-C`}),l),f=o(e=>s({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),a}var u,d=e((()=>{u=t(a(),1),s(),n()}));function f(e,t,n){return l(i,t,e,n)}var p=e((()=>{r(),d()}));export{f as n,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Xh as t,Zh as n}from"./loadAgentsDir-DaNpxaO-.js";import{C as r,_ as i,s as a}from"./model-Do0f476p.js";function o(){let e=n(e=>e.mainLoopModel);return r(n(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{t(),i()}));export{o as n,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as t,Cs as n,Hx as r,Ss as i,Ux as a,Xd as o,Xh as s,Yd as c,Zh as l,_h as u,_s as d,b_ as f,bh as p,co as m,hh as h,lo as g,vs as _,x_ as v,yh as y}from"./loadAgentsDir-DaNpxaO-.js";import{ai as b}from"./src-DL3w8VPk2.js";import{R as x,U as S,c as C,i as w}from"./debug-D58GQBDG.js";import{In as T,Ln as E}from"./settings-3xZ0fsvE.js";import{O as D,k as O}from"./git-By_J4XJL.js";import{o as k,s as A}from"./log-CZ7ploQm.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-DRA0m76J.js";import{t as F}from"./pluginBlocklist-xdiUmUpt.js";var I=e(b(),1);c(),j(),h(),s(),E(),w(),D(),x(),k(),i(),_(),f(),y(),r(),P(),m();function L({enabled:e=!0}={}){let r=t(),i=l(e=>e.plugins.needsRefresh),{addNotification:s}=o(),c=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:t,errors:i}=await g();await F();let o=N();Object.keys(o).length>0&&s({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let c=[],l=[];try{c=await d()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{l=await n()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await v()}catch(e){let t=e instanceof Error?e.message:String(e);i.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let f=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await a(e,i);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),m=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await p(e,i);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);u(),r(n=>{let r=n.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(i.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...i];return{...n,plugins:{...n.plugins,enabled:e,disabled:t,commands:c,errors:o}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${t.length}, Commands: ${c.length}, Agents: ${l.length}, Errors: ${i.length}`);let h=e.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{enabled_count:e.length,disabled_count:t.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:i.length,skill_count:c.length,agent_count:l.length,hook_count:h,mcp_count:f,lsp_count:m}}catch(e){let t=S(e);return A(t),C(`Error loading plugins: ${e}`),r(e=>{let n=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:t.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...n,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[r,s]);(0,I.useEffect)(()=>{e&&c().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),O(`info`,`tengu_plugins_loaded`,r)})},[c,e]),(0,I.useEffect)(()=>{!e||!i||s({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,i,s])}export{L as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Uc as n,qc as r}from"./loadAgentsDir-DaNpxaO-.js";import{ai as i}from"./src-DL3w8VPk2.js";import{n as a,t as o}from"./toolPool-Df5iUqJ-.js";function s(e,t,r){return(0,c.useMemo)(()=>a(e,n(r,t),r.mode),[e,t,r,!1,!1])}var c,l=e((()=>{c=t(i(),1),r(),o()}));export{s as n,l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Cd as n,Dd as r,Ed as i,Od as a,Td as o,_d as s,gC as c,vd as l,wd as u,yd as d}from"./loadAgentsDir-DaNpxaO-.js";import{Vn as f,ai as p,hn as m,ot as h,t as g}from"./src-DL3w8VPk2.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:c,onExitUp:d,columns:p,passthroughCtrlKeys:g=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=h(),w=p??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=f=>{if(!e)return;let p=s.fromText(T,w,D);if(!(f.ctrl&&g.includes(f.key.toLowerCase()))){if(_(f)||o(),v(f)||i(),f.key===`return`||f.key===`down`){f.preventDefault(),t();return}if(f.key===`up`){f.preventDefault(),d&&d();return}if(f.key===`escape`){f.preventDefault(),c?c():T.length>0?(E(``),O(0)):t();return}if(f.key===`backspace`){if(f.preventDefault(),f.meta){let{cursor:e,killed:t}=p.deleteWordBefore();n(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(c??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}if(f.key===`delete`){f.preventDefault();let e=p.del();E(e.text),O(e.offset);return}if(f.key===`left`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.prevWord();O(e.offset);return}if(f.key===`right`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.nextWord();O(e.offset);return}if(f.key===`left`){f.preventDefault();let e=p.left();O(e.offset);return}if(f.key===`right`){f.preventDefault();let e=p.right();O(e.offset);return}if(f.key===`home`){f.preventDefault(),O(0);return}if(f.key===`end`){f.preventDefault(),O(T.length);return}if(f.ctrl){switch(f.preventDefault(),f.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(p.left().offset);return;case`f`:O(p.right().offset);return;case`d`:{if(T.length===0){(c??t)();return}let e=p.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(c??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=p.deleteToLineEnd();n(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=p.deleteToLineStart();n(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=p.deleteWordBefore();n(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=l();if(e.length>0){let t=p.offset,n=p.insert(e);u(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(c){c();return}}return}if(f.meta){switch(f.preventDefault(),f.key.toLowerCase()){case`b`:O(p.prevWord().offset);return;case`f`:O(p.nextWord().offset);return;case`d`:{let e=p.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=a();if(e){let{text:t,start:n,length:i}=e,a=T.slice(0,n),o=T.slice(n+i),s=a+t+o,c=n+t.length;r(t.length),E(s),O(c)}return}}return}if(f.key!==`tab`&&f.key.length>=1&&!x.has(f.key)){f.preventDefault();let e=p.insert(f.key);E(e.text),O(e.offset)}}};return m((e,t,n)=>{A(new f(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(p(),1),g(),d(),c(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Xd as n,Yd as r,ng as i,rg as a}from"./loadAgentsDir-DaNpxaO-.js";import{ai as o}from"./src-DL3w8VPk2.js";import{Ut as s,z as c}from"./state-D5D6QpTX.js";import{n as l,t as u}from"./allErrors-BkgB7JNK.js";function d(){let{addNotification:e,removeNotification:t}=n(),[r,i]=(0,f.useState)(()=>{let{errors:e}=u();return e});return a((0,f.useCallback)(()=>{let{errors:e}=u();i(e)},[])),(0,f.useEffect)(()=>{if(!c())if(r.length>0){let t=`Found ${r.length} settings ${r.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[r,e,t]),r}var f,p,m=e((()=>{f=t(o(),1),r(),s(),l(),i(),p=`settings-errors`}));export{d as n,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return`workmate/0.0.20`}var n=e((()=>{}));export{n,t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ou as t,Xh as n,Yh as r,ku as i}from"./loadAgentsDir-DaNpxaO-.js";import{ai as a}from"./src-DL3w8VPk2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{n as s,r as c}from"./analytics-DJobLaWP.js";import{t as l}from"./useManagePlugins-MSHw-qHx.js";import{n as u,t as d}from"./MCPConnectionManager-DfyoZaiu.js";import{cwd as f}from"process";var p=e(a(),1);i(),s(),u(),n();var m=o(),h=p.lazy(()=>import(`./Doctor-6SjW91rd.js`).then(e=>({default:e.Doctor})));function g({onDone:e}){return l(),(0,m.jsx)(p.Suspense,{fallback:null,children:(0,m.jsx)(h,{onDone:e})})}async function _(e){c(`tengu_doctor_command`,{}),await new Promise(n=>{e.render((0,m.jsx)(r,{children:(0,m.jsx)(t,{children:(0,m.jsx)(d,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,m.jsx)(g,{onDone:()=>{n()}})})})}))}),e.unmount(),process.exit(0)}async function v(e,t){let{setup:n}=await import(`./setup-D8L275fT.js`);await n(f(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-DJukI-kL.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{_ as doctorHandler,v as installHandler};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{bw as r,lE as i,mw as a,oE as o,pw as s,sE as c,uE as l,xw as u,yw as d}from"./loadAgentsDir-DaNpxaO-.js";import{g as f,r as p}from"./lazySchema-DULtBUCI.js";import{B as m,C as ee,F as h,P as g,R as _,S as v,c as y,f as b,i as te,u as x,x as S}from"./debug-D58GQBDG.js";import{_t as C,ft as w,gt as T,ht as ne,mt as re}from"./settings-3xZ0fsvE.js";import{o as ie,s as E}from"./log-CZ7ploQm.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(s(),H)}async function I(){let e=F();try{let t=v(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return y(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return y(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return y(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(y(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(y(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(y(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&y(`Failed to load install counts cache: ${g(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=s();await x().mkdir(r),await P(n,ee(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),y(`Install counts cache saved successfully`)}catch(e){E(e);try{await N(n)}catch{}}}async function R(){y(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return u(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw u(`install_counts`,U,`failure`,performance.now()-e,d(t)),t}}async function z(){let e=await I();if(e){y(`Using cached install counts`),u(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return E(e),y(`Failed to fetch install counts: ${g(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),te(),_(),b(),ie(),S(),r(),a(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=x(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{_(),b()}));function le(e){let t=D.basename(e),n=D.basename(D.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=re().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${g(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=v(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(a&&typeof a==`object`){let e=a;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let o=T().extend({plugins:f(ne().strict())}).strict().safeParse(a);if(o.success||t.push(...q(o.error)),o.success){let e=o.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=D.dirname(r),a=D.basename(i)===`.claude-plugin`?D.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=v(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(o);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let s=a[1]||``,c;try{c=l(s)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${g(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof c!=`object`||!c||Array.isArray(c))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(c)?`an array`:c===null?`null`:typeof c}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let u=c;if(u.description!==void 0){let e=u.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});u.name!==void 0&&u.name!==null&&typeof u.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof u.name}.`});let d=u[`allowed-tools`];d!=null&&(typeof d!=`string`&&!Array.isArray(d)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof d}.`}):Array.isArray(d)&&d.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let f=u.shell;if(f!=null)if(typeof f!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof f}.`});else{let e=f.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${f}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${g(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=v(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${g(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=w().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(m(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${g(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!m(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=v(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{p(),_(),c(),S(),i(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,o as n}from"./execFileNoThrow-Bmb5HEFz.js";import{n as r,t as i}from"./execSyncWrapper-C3ZFV9od.js";async function a(e){if(process.platform===`win32`){let t=await n(`where.exe ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim().split(/\r?\n/)[0]||null}let t=await n(`which ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return t.exitCode!==0||!t.stdout?null:t.stdout.trim()}function o(e){if(process.platform===`win32`)try{return i(`where.exe ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return i(`which ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()||null}catch{return null}}var s,c,l,u=e((()=>{t(),r(),s=typeof Bun<`u`&&typeof Bun.which==`function`?Bun.which:null,c=s?async e=>s(e):a,l=s??o}));export{c as n,l as r,u as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./cwd-Nh5IZNKO.js";import{c as a,i as o}from"./debug-D58GQBDG.js";import{n as s,t as c}from"./memoize-CumjjK2Q.js";import{n as l,t as u}from"./execSyncWrapper-C3ZFV9od.js";import{i as d,o as f}from"./platform-DMQxcm4K.js";import{existsSync as p}from"fs";import*as m from"path/win32";function h(){if(d()===`windows`){let e=y();process.env.SHELL=e,process.env.CLAUDE_CODE_GIT_BASH_PATH=e,a(`Using bash path: "${e}"`)}}function g(e,t){let n=[`C:\\Program Files\\Git\\bin\\bash.exe`,`C:\\Program Files\\Git\\usr\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\bin\\bash.exe`,`C:\\Program Files (x86)\\Git\\usr\\bin\\bash.exe`];t&&n.push(`${t}\\scoop\\apps\\git\\current\\usr\\bin\\bash.exe`);for(let t of n)if(e(t))return t;return null}function _(e,t){if(e===`git`){for(let e of[`C:\\Program Files\\Git\\cmd\\git.exe`,`C:\\Program Files (x86)\\Git\\cmd\\git.exe`])if(t.checkExists(e))return e}try{let n=t.execCommand(`where.exe ${e}`).split(/\r?\n/).map(e=>e.trim()).filter(Boolean),r=m.resolve(t.cwdFn()).toLowerCase();for(let e of n){let t=m.resolve(e).toLowerCase(),n=m.dirname(t).toLowerCase(),i=m.relative(r,n);if(i===``||!i.startsWith(`..`)&&!m.isAbsolute(i)){a(`Skipping potentially malicious executable in current directory: ${e}`);continue}return e}return null}catch{return null}}function v(e=b){let t=e.envOverride??process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t)return e.checkExists(t)?t:null;let n=_(`bash`,e);if(n&&e.checkExists(n))return n;let r=_(`git`,e);if(r){let t=[m.join(r,`..`,`..`,`bin`,`bash.exe`),m.join(r,`..`,`..`,`usr`,`bin`,`bash.exe`),m.join(r,`..`,`bash.exe`)];for(let n of t)if(e.checkExists(n))return n}return g(e.checkExists,e.userProfile)}function y(){let e=x();if(e!==null)return e;let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;console.error(t?`Work Mate was unable to find CLAUDE_CODE_GIT_BASH_PATH path "${t}"`:`Work Mate on Windows requires git-bash (https://git-scm.com/downloads/win). If installed but not in PATH, set environment variable pointing to your bash.exe, similar to: CLAUDE_CODE_GIT_BASH_PATH=C:\\Program Files\\Git\\bin\\bash.exe`),process.exit(1)}var b,x,S,C,w=e((()=>{n(),r(),o(),l(),c(),f(),b={checkExists:p,execCommand:e=>u(e,{stdio:`pipe`,encoding:`utf8`}).trim(),cwdFn:i,userProfile:process.env.USERPROFILE,envOverride:void 0},x=t(()=>v()),S=s(e=>{if(e.startsWith(`\\\\`))return e.replace(/\\/g,`/`);let t=e.match(/^([A-Za-z]):[/\\]/);return t?`/${t[1].toLowerCase()}${e.slice(2).replace(/\\/g,`/`)}`:e.replace(/\\/g,`/`)},e=>e,500),C=s(e=>{if(e.startsWith(`//`))return e.replace(/\//g,`\\`);let t=e.match(/^\/cygdrive\/([A-Za-z])(\/|$)/);if(t)return`${t[1].toUpperCase()}:${(e.slice(`/cygdrive/${t[1]}`.length)||`\\`).replace(/\//g,`\\`)}`;let n=e.match(/^\/([A-Za-z])(\/|$)/);return n?`${n[1].toUpperCase()}:${(e.slice(2)||`\\`).replace(/\//g,`\\`)}`:e.replace(/\//g,`\\`)},e=>e,500)}));export{C as a,w as i,x as n,h as o,v as r,S as s,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,o as t}from"./windowsPaths-BdhjMYTm.js";e();export{t as setShellIfWindows};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./axios-DaWTGg7G.js";import{C as n,S as r,x as i}from"./debug-D58GQBDG.js";t(),i();function a(e){let t=r(Buffer.from(e,`base64url`).toString(`utf-8`));if(!t||typeof t!=`object`||!(`version`in t)||t.version!==1)throw Error(`Unsupported work secret version: ${t&&typeof t==`object`&&`version`in t?t.version:`unknown`}`);let n=t;if(typeof n.session_ingress_token!=`string`||n.session_ingress_token.length===0)throw Error(`Invalid work secret: missing or empty session_ingress_token`);if(typeof n.api_base_url!=`string`)throw Error(`Invalid work secret: missing api_base_url`);return t}function o(e,t){let n=e.includes(`localhost`)||e.includes(`127.0.0.1`),r=e.startsWith(`https`)?`wss`:`ws`,i=n?`v2`:`v1`;return`${r}://${e.replace(/^https?:\/\//,``).replace(/\/+$/,``)}/${i}/session_ingress/ws/${t}`}function s(e,t){if(e===t)return!0;let n=e.slice(e.lastIndexOf(`_`)+1),r=t.slice(t.lastIndexOf(`_`)+1);return n.length>=4&&n===r}function c(e,t){return`${e.replace(/\/+$/,``)}/v1/code/sessions/${t}`}async function l(t,r){let i=await e.post(`${t}/worker/register`,{},{headers:{Authorization:`Bearer ${r}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`},timeout:1e4}),a=i.data?.worker_epoch,o=typeof a==`string`?Number(a):a;if(typeof o!=`number`||!Number.isFinite(o)||!Number.isSafeInteger(o))throw Error(`registerWorker: invalid worker_epoch in response: ${n(i.data)}`);return o}export{s as a,l as i,o as n,a as r,c as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{l as e,o as t,u as n}from"./envUtils-DcaKZlRU.js";import{Dt as r,St as i,mt as a,oS as o,sS as s}from"./loadAgentsDir-DaNpxaO-.js";import{t as c}from"./src-DL3w8VPk2.js";import{C as l,P as u,R as d,S as f,c as p,i as m,x as h}from"./debug-D58GQBDG.js";import{Ut as g}from"./settings-3xZ0fsvE.js";import{O as _,k as v}from"./git-By_J4XJL.js";import{o as y,s as b}from"./log-CZ7ploQm.js";import{n as x,r as S}from"./analytics-DJobLaWP.js";import{C,l as w,v as T}from"./startupProfiler-CbzxVmbv.js";import{Pt as E,St as D,dn as O,fn as k}from"./model-Do0f476p.js";import{i as ee,t as A}from"./sessionIdCompat-Dgp6PW_1.js";import{n as j}from"./firstPartyEventLogger-DqGSujCz.js";import{t as te}from"./datadog-Bc6wkPne.js";import{n as M,o as N,r as P}from"./debugUtils-DXBRbwCE.js";import{t as F}from"./pollConfig-2nFzv6Hy.js";import{n as I,t as L}from"./rcDebugLog-DSchf3Hs.js";import{a as R,i as z,n as B,o as ne,r as re,s as V,t as H}from"./capacityWake-BpP6c7x3.js";import{a as ie,i as ae,n as oe,r as se,t as ce}from"./workSecret-CaM2yIJD.js";import{i as U}from"./trustedDevice-CB6rNzl-.js";import{t as le}from"./jwtUtils-C_LG1txt.js";import{n as W,r as G}from"./cliLaunch-DDtwAolw.js";import"./bridgeStatusUtil-Cex6VowM.js";import{t as K}from"./lib-BlVGipXx.js";import{hostname as q,tmpdir as ue}from"os";import{dirname as J,join as de,resolve as Y}from"path";import{createWriteStream as X}from"fs";import{randomUUID as Z}from"crypto";import{spawn as fe}from"child_process";import{createInterface as Q}from"readline";t(),d(),h(),_(),y(),x(),T(),O(),s(),te(),j(),i(),L(),K(),g(),c(),m(),A(),N();var pe=10,me=10;function he(e){return e.replace(/[^a-zA-Z0-9_-]/g,`_`)}var ge={Read:`Reading`,Write:`Writing`,Edit:`Editing`,MultiEdit:`Editing`,Bash:`Running`,Glob:`Searching`,Grep:`Searching`,WebFetch:`Fetching`,WebSearch:`Searching`,Task:`Running task`,FileReadTool:`Reading`,FileWriteTool:`Writing`,FileEditTool:`Editing`,GlobTool:`Searching`,GrepTool:`Searching`,BashTool:`Running`,NotebookEditTool:`Editing notebook`,LSP:`LSP`};function $(e,t){let n=ge[e]??e,r=t.file_path??t.filePath??t.pattern??t.command?.slice(0,60)??t.url??t.query??``;return r?`${n} ${r}`:n}function _e(e,t,n){let r;try{r=f(e)}catch{return[]}if(!r||typeof r!=`object`)return[];let i=r,a=[],o=Date.now();switch(i.type){case`assistant`:{let e=i.message;if(!e)break;let r=e.content;if(!Array.isArray(r))break;for(let e of r){if(!e||typeof e!=`object`)continue;let r=e;if(r.type===`tool_use`){let e=r.name??`Tool`,i=r.input??{},s=$(e,i);a.push({type:`tool_start`,summary:s,timestamp:o}),n(`[bridge:activity] sessionId=${t} tool_use name=${e} ${ye(i)}`)}else if(r.type===`text`){let e=r.text??``;e.length>0&&(a.push({type:`text`,summary:e.slice(0,80),timestamp:o}),n(`[bridge:activity] sessionId=${t} text "${e.slice(0,100)}"`))}}break}case`result`:{let e=i.subtype;if(e===`success`)a.push({type:`result`,summary:`Session completed`,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=success`);else if(e){let r=i.errors?.[0]??`Error: ${e}`;a.push({type:`error`,summary:r,timestamp:o}),n(`[bridge:activity] sessionId=${t} result subtype=${e} error="${r}"`)}else n(`[bridge:activity] sessionId=${t} result subtype=undefined`);break}default:break}return a}function ve(e){if(e.parent_tool_use_id!=null||e.isSynthetic||e.isReplay)return;let t=e.message?.content,n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let e of t)if(e&&typeof e==`object`&&e.type===`text`){n=e.text;break}}return n=n?.trim(),n||void 0}function ye(e){let t=[];for(let[n,r]of Object.entries(e))if(typeof r==`string`&&t.push(`${n}="${r.slice(0,100)}"`),t.length>=3)break;return t.join(` `)}function be(e){return{spawn(t,n){let r=he(t.sessionId),i;if(e.debugFile){let t=e.debugFile.lastIndexOf(`.`);i=t>0?`${e.debugFile.slice(0,t)}-${r}${e.debugFile.slice(t)}`:`${e.debugFile}-${r}`}else e.verbose&&(i=de(ue(),`claude`,`bridge-session-${r}.log`));let a=null,o;e.debugFile&&(o=de(J(e.debugFile),`bridge-transcript-${r}.jsonl`),a=X(o,{flags:`a`}),a.on(`error`,t=>{e.onDebug(`[bridge:session] Transcript write error: ${t.message}`),a=null}),e.onDebug(`[bridge:session] Transcript log: ${o}`));let s=[...e.scriptArgs,`--print`,`--sdk-url`,t.sdkUrl,`--session-id`,t.sessionId,`--input-format`,`stream-json`,`--output-format`,`stream-json`,`--replay-user-messages`,...e.verbose?[`--verbose`]:[],...i?[`--debug-file`,i]:[],...e.permissionMode?[`--permission-mode`,e.permissionMode]:[]],c={...e.env,CLAUDE_CODE_OAUTH_TOKEN:void 0,CLAUDE_CODE_ENVIRONMENT_KIND:`bridge`,...e.sandbox&&{CLAUDE_CODE_FORCE_SANDBOX:`1`},CLAUDE_CODE_SESSION_ACCESS_TOKEN:t.accessToken,CLAUDE_CODE_POST_FOR_SESSION_INGRESS_V2:`1`,...t.useCcrV2&&{CLAUDE_CODE_USE_CCR_V2:`1`,CLAUDE_CODE_WORKER_EPOCH:String(t.workerEpoch)}};e.onDebug(`[bridge:session] Spawning sessionId=${t.sessionId} sdkUrl=${t.sdkUrl} accessToken=${t.accessToken?`present`:`MISSING`}`),e.onDebug(`[bridge:session] Child args: ${s.join(` `)}`),i&&e.onDebug(`[bridge:session] Debug log: ${i}`);let u=fe(e.execPath,s,{cwd:n,stdio:[`pipe`,`pipe`,`pipe`],env:c,windowsHide:!0});e.onDebug(`[bridge:session] sessionId=${t.sessionId} pid=${u.pid}`);let d=[],p=null,m=[],h=!1,g=!1;u.stderr&&Q({input:u.stderr}).on(`line`,t=>{e.verbose&&process.stderr.write(`${t}\n`),m.length>=me&&m.shift(),m.push(t)}),u.stdout&&Q({input:u.stdout}).on(`line`,n=>{a&&a.write(`${n}\n`),e.onDebug(`[bridge:ws] sessionId=${t.sessionId} <<< ${M(n)}`),e.verbose&&process.stderr.write(`${n}\n`);let r=_e(n,t.sessionId,e.onDebug);for(let n of r)d.length>=pe&&d.shift(),d.push(n),p=n,e.onActivity?.(t.sessionId,n);{let r;try{r=f(n)}catch{}if(r&&typeof r==`object`){let n=r;if(n.type===`control_request`)n.request?.subtype===`can_use_tool`&&e.onPermissionRequest&&e.onPermissionRequest(t.sessionId,r,t.accessToken);else if(n.type===`user`&&!g&&t.onFirstUserMessage){let e=ve(n);e&&(g=!0,t.onFirstUserMessage(e))}}}});let _=new Promise(n=>{u.on(`close`,(r,i)=>{a&&(a.end(),a=null),i===`SIGTERM`||i===`SIGINT`?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} interrupted signal=${i} pid=${u.pid}`),n(`interrupted`)):r===0?(e.onDebug(`[bridge:session] sessionId=${t.sessionId} completed exit_code=0 pid=${u.pid}`),n(`completed`)):(e.onDebug(`[bridge:session] sessionId=${t.sessionId} failed exit_code=${r} pid=${u.pid}`),n(`failed`))}),u.on(`error`,r=>{e.onDebug(`[bridge:session] sessionId=${t.sessionId} spawn error: ${r.message}`),n(`failed`)})}),v={sessionId:t.sessionId,done:_,activities:d,accessToken:t.accessToken,lastStderr:m,get currentActivity(){return p},kill(){u.killed||(e.onDebug(`[bridge:session] Sending SIGTERM to sessionId=${t.sessionId} pid=${u.pid}`),process.platform===`win32`?u.kill():u.kill(`SIGTERM`))},forceKill(){!h&&u.pid&&(h=!0,e.onDebug(`[bridge:session] Sending SIGKILL to sessionId=${t.sessionId} pid=${u.pid}`),process.platform===`win32`?u.kill():u.kill(`SIGKILL`))},writeStdin(n){u.stdin&&!u.stdin.destroyed&&(e.onDebug(`[bridge:ws] sessionId=${t.sessionId} >>> ${M(n)}`),u.stdin.write(n))},updateAccessToken(n){v.accessToken=n,v.writeStdin(`${l({type:`update_environment_variables`,variables:{CLAUDE_CODE_SESSION_ACCESS_TOKEN:n}})}\n`),e.onDebug(`[bridge:session] Sent token refresh via stdin for sessionId=${t.sessionId}`)}};return v}}}m(),N();var xe={connInitialMs:2e3,connCapMs:12e4,connGiveUpMs:6e5,generalInitialMs:500,generalCapMs:3e4,generalGiveUpMs:6e5},Se=1e3;function Ce(e){return e.connCapMs*2}function we(){let e=[...W()],t=G();return t&&e.push(t),e}function Te(e,t,n){try{return e.spawn(t,n)}catch(e){let t=u(e);return b(Error(`Session spawn failed: ${t}`)),t}}async function Ee(t,i,s,c,l,d,f,m=xe,h,g){let _=new AbortController;f.aborted?_.abort():f.addEventListener(`abort`,()=>_.abort(),{once:!0});let y=_.signal,x=new Map,C=new Map,T=new Map,E=new Map,D=new Map,O=new Map,A=new Set,j=new Map,te=new Set,M=new Set,N=H(y);async function L(){I(`heartbeat: checking ${x.size} active session(s)`);let e=!1,t=!1,n=[];for(let[r]of x){let a=T.get(r),o=D.get(r);if(!(!a||!o))try{await c.heartbeatWork(i,a,o),e=!0}catch(e){p(`[bridge:heartbeat] Failed for sessionId=${r} workId=${a}: ${u(e)}`),e instanceof B&&(S(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),e.status===401||e.status===403?n.push(r):t=!0)}}for(let e of n){d.logVerbose(`Session ${e} token expired — re-queuing via bridge/reconnect`);try{await c.reconnectSession(i,e),p(`[bridge:heartbeat] Re-queued sessionId=${e} via bridge/reconnect`)}catch(t){d.logError(`Failed to refresh session ${e} token: ${u(t)}`),p(`[bridge:heartbeat] reconnectSession(${e}) failed: ${u(t)}`,{level:`error`})}}return t?`fatal`:n.length>0?`auth_failed`:e?`ok`:`failed`}let re=new Set,V=g?le({getAccessToken:g,onRefresh:(e,t)=>{let n=x.get(e);n&&(re.has(e)?(d.logVerbose(`Refreshing session ${e} token via bridge/reconnect`),c.reconnectSession(i,e).catch(t=>{d.logError(`Failed to refresh session ${e} token: ${u(t)}`),p(`[bridge:token] reconnectSession(${e}) failed: ${u(t)}`,{level:`error`})})):n.updateAccessToken(t))},label:`bridge`}):null,U=Date.now(),W=new Set;function G(e){W.add(e),e.finally(()=>W.delete(e))}let K=0,q=0,J=null,Y=null,X=null,Z=null;p(`[bridge:work] Starting poll loop spawnMode=${t.spawnMode} maxSessions=${t.maxSessions} environmentId=${i}`),v(`info`,`bridge_loop_started`,{max_sessions:t.maxSessions,spawn_mode:t.spawnMode}),d.printBanner(t,i),d.updateSessionCount(0,t.maxSessions,t.spawnMode),h&&d.setAttached(h);function fe(){d.updateSessionCount(x.size,t.maxSessions,t.spawnMode);for(let[e,t]of x){let n=t.currentActivity;n&&d.updateSessionActivity(E.get(e)??e,n)}if(x.size===0){d.updateIdleStatus();return}let[e,n]=[...x.entries()].pop(),r=C.get(e);if(!r)return;let i=n.currentActivity;if(!i||i.type===`result`||i.type===`error`){t.maxSessions>1&&d.refreshDisplay();return}let a=w(Date.now()-r),o=n.activities.filter(e=>e.type===`tool_start`).slice(-5).map(e=>e.summary);d.updateSessionStatus(e,a,i,o)}function Q(){pe(),fe(),Z=setInterval(fe,Se)}function pe(){Z&&(clearInterval(Z),Z=null)}function me(e,n,a){return o=>{let s=T.get(e);I(`session done: sessionId=${e} workId=${s??`none`} status=${o} wasTimedOut=${te.has(e)} duration=${Math.round((Date.now()-n)/1e3)}s stderr=${a.lastStderr.length>0?a.lastStderr.join(`\\n`).slice(0,500):`(none)`}`),x.delete(e),C.delete(e),T.delete(e),D.delete(e);let l=E.get(e)??e;E.delete(e),d.removeSession(l),M.delete(l),re.delete(e);let f=O.get(e);f&&(clearTimeout(f),O.delete(e)),V?.cancel(e),N.wake();let h=te.delete(e),g=h&&o===`interrupted`?`failed`:o,k=Date.now()-n;p(`[bridge:session] sessionId=${e} workId=${s??`unknown`} exited status=${g} duration=${w(k)}`),S(`tengu_bridge_session_done`,{status:g,duration_ms:k}),v(`info`,`bridge_session_done`,{status:g,duration_ms:k}),d.clearStatus(),pe();let ee=a.lastStderr.length>0?a.lastStderr.join(`
|
|
2
|
-
`):void 0,P;switch(g){case`completed`:d.logSessionComplete(e,k);break;case`failed`:!h&&!y.aborted&&(P=ee??`Process exited with error`,d.logSessionFailed(e,P),b(Error(`Bridge session failed: ${P}`)));break;case`interrupted`:d.logVerbose(`Session ${e} interrupted`);break}g!==`interrupted`&&s&&(G(Me(c,i,s,d,m.stopWorkBaseDelayMs)),A.add(s));let F=j.get(e);if(F&&(j.delete(e),G(r(F.worktreePath,F.worktreeBranch,F.gitRoot,F.hookBased).catch(e=>d.logVerbose(`Failed to remove worktree ${F.worktreePath}: ${u(e)}`)))),g!==`interrupted`&&!y.aborted)if(t.spawnMode!==`single-session`)G(c.archiveSession(l).catch(t=>d.logVerbose(`Failed to archive session ${e}: ${u(t)}`))),p(`[bridge:session] Session ${g}, returning to idle (multi-session mode)`);else{p(`[bridge:session] Session ${g}, aborting poll loop to tear down environment`),_.abort();return}y.aborted||Q()}}for(h||Q();!y.aborted;){let f=F();try{I(`poll: envId=${i} activeSessions=${x.size}`);let g=await c.pollForWork(i,s,y,f.reclaim_older_than_ms);if(J!==null||Y!==null){let e=Date.now()-(J??Y??Date.now());d.logReconnected(e),p(`[bridge:poll] Reconnected after ${w(e)}`),S(`tengu_bridge_reconnected`,{disconnected_ms:e})}if(K=0,q=0,J=null,Y=null,X=null,!g){if(x.size>=t.maxSessions){let e=f.multisession_poll_interval_ms_at_capacity;if(f.non_exclusive_heartbeat_interval_ms>0){S(`tengu_bridge_heartbeat_mode_entered`,{active_sessions:x.size,heartbeat_interval_ms:f.non_exclusive_heartbeat_interval_ms});let n=e>0?Date.now()+e:null,r=`ok`,i=0;for(;!y.aborted&&x.size>=t.maxSessions&&(n===null||Date.now()<n);){let e=F();if(e.non_exclusive_heartbeat_interval_ms<=0)break;let t=N.signal();if(r=await L(),r===`auth_failed`||r===`fatal`){t.cleanup();break}i++,await k(e.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}let a=r===`auth_failed`||r===`fatal`?r:y.aborted?`shutdown`:x.size<t.maxSessions?`capacity_changed`:n!==null&&Date.now()>=n?`poll_due`:`config_disabled`;if(S(`tengu_bridge_heartbeat_mode_exited`,{reason:a,heartbeat_cycles:i,active_sessions:x.size}),a===`poll_due`&&p(`[bridge:poll] Heartbeat poll_due after ${i} cycles — falling through to pollForWork`),r===`auth_failed`||r===`fatal`){let t=N.signal();await k(e>0?e:f.non_exclusive_heartbeat_interval_ms,t.signal),t.cleanup()}}else if(e>0){let t=N.signal();await k(e,t.signal),t.cleanup()}}else await k(x.size>0?f.multisession_poll_interval_ms_partial_capacity:f.multisession_poll_interval_ms_not_at_capacity,y);continue}let _=x.size>=t.maxSessions;if(A.has(g.id)){if(p(`[bridge:work] Skipping already-completed workId=${g.id}`),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}else await k(1e3,y);continue}let P;try{P=se(g.secret)}catch(e){let t=u(e);if(d.logError(`Failed to decode work secret for workId=${g.id}: ${t}`),S(`tengu_bridge_work_secret_failed`,{}),A.add(g.id),G(Me(c,i,g.id,d,m.stopWorkBaseDelayMs)),_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}continue}let R=async()=>{p(`[bridge:work] Acknowledging workId=${g.id}`);try{await c.acknowledgeWork(i,g.id,P.session_ingress_token)}catch(e){p(`[bridge:work] Acknowledge failed workId=${g.id}: ${u(e)}`)}},z=g.data.type;switch(g.data.type){case`healthcheck`:await R(),p(`[bridge:work] Healthcheck received`),d.logVerbose(`Healthcheck received`);break;case`session`:{let s=g.data.id;I(`work received: type=session sessionId=${s} workId=${g.id}`);try{ne(s,`session_id`)}catch{await R(),d.logError(`Invalid session_id received: ${s}`);break}let f=x.get(s);if(f){f.updateAccessToken(P.session_ingress_token),D.set(s,P.session_ingress_token),T.set(s,g.id),V?.schedule(s,P.session_ingress_token),p(`[bridge:work] Updated access token for existing sessionId=${s} workId=${g.id}`),await R();break}if(x.size>=t.maxSessions){p(`[bridge:work] At capacity (${x.size}/${t.maxSessions}), cannot spawn new session for workId=${g.id}`);break}await R();let _=Date.now(),w,N=!1,F;if(P.use_code_sessions===!0||e(process.env.CLAUDE_BRIDGE_USE_CCR_V2)){w=ce(t.apiBaseUrl,s);for(let e=1;e<=2;e++)try{F=await ae(w,P.session_ingress_token),N=!0,p(`[bridge:session] CCR v2: registered worker sessionId=${s} epoch=${F} attempt=${e}`);break}catch(t){let n=u(t);if(e<2){if(p(`[bridge:session] CCR v2: registerWorker attempt ${e} failed, retrying: ${n}`),await k(2e3,y),y.aborted)break;continue}d.logError(`CCR v2 worker registration failed for session ${s}: ${n}`),b(Error(`registerWorker failed: ${n}`)),A.add(g.id),G(Me(c,i,g.id,d,m.stopWorkBaseDelayMs))}if(!N)break}else w=oe(t.sessionIngressUrl,s);let L=t.spawnMode,z=t.dir,B=0;if(L===`worktree`&&(h===void 0||!ie(s,h))){let e=Date.now();try{let t=await a(`bridge-${he(s)}`);B=Date.now()-e,j.set(s,{worktreePath:t.worktreePath,worktreeBranch:t.worktreeBranch,gitRoot:t.gitRoot,hookBased:t.hookBased}),z=t.worktreePath,p(`[bridge:session] Created worktree for sessionId=${s} at ${t.worktreePath}`)}catch(e){let t=u(e);d.logError(`Failed to create worktree for session ${s}: ${t}`),b(Error(`Worktree creation failed: ${t}`)),A.add(g.id),G(Me(c,i,g.id,d,m.stopWorkBaseDelayMs));break}}p(`[bridge:session] Spawning sessionId=${s} sdkUrl=${w}`);let H=ee(s);I(`spawning session: sessionId=${s} sdkUrl=${w} useCcrV2=${N} workerEpoch=${F} dir=${z} accessToken=${P.session_ingress_token?`${P.session_ingress_token.slice(0,8)}...`:`NONE`}`);let se=Te(l,{sessionId:s,sdkUrl:w,accessToken:P.session_ingress_token,useCcrV2:N,workerEpoch:F,onFirstUserMessage:e=>{if(M.has(H))return;M.add(H);let n=Fe(e);d.setSessionTitle(H,n),p(`[bridge:title] derived title for ${H}: ${n}`),import(`./createSession-BUzna9-E.js`).then(({updateBridgeSessionTitle:e})=>e(H,n,{baseUrl:t.apiBaseUrl})).catch(e=>p(`[bridge:title] failed to update title for ${H}: ${e}`,{level:`error`}))}},z);if(typeof se==`string`){d.logError(`Failed to spawn session ${s}: ${se}`);let e=j.get(s);e&&(j.delete(s),G(r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased).catch(t=>d.logVerbose(`Failed to remove worktree ${e.worktreePath}: ${u(t)}`)))),A.add(g.id),G(Me(c,i,g.id,d,m.stopWorkBaseDelayMs));break}let U=se,le=Date.now()-_;S(`tengu_bridge_session_started`,{active_sessions:x.size,spawn_mode:L,in_worktree:j.has(s),spawn_duration_ms:le,worktree_create_ms:B,inProtectedNamespace:n()}),v(`info`,`bridge_session_started`,{spawn_mode:L,in_worktree:j.has(s),spawn_duration_ms:le,worktree_create_ms:B}),x.set(s,U),T.set(s,g.id),D.set(s,P.session_ingress_token),E.set(s,H);let W=Date.now();C.set(s,W),d.logSessionStart(s,`Session ${s}`);let K=he(s),q;if(t.debugFile){let e=t.debugFile.lastIndexOf(`.`);q=e>0?`${t.debugFile.slice(0,e)}-${K}${t.debugFile.slice(e)}`:`${t.debugFile}-${K}`}else t.verbose&&(q=de(ue(),`claude`,`bridge-session-${K}.log`));q&&d.logVerbose(`Debug log: ${q}`),d.addSession(H,o(H,t.sessionIngressUrl)),Q(),d.setAttached(H),Ie(H,t.apiBaseUrl).then(e=>{e&&x.has(s)&&(M.add(H),d.setSessionTitle(H,e),p(`[bridge:title] server title for ${H}: ${e}`))}).catch(e=>p(`[bridge:title] failed to fetch title for ${H}: ${e}`,{level:`error`}));let J=t.sessionTimeoutMs??864e5;if(J>0){let e=setTimeout(Ne,J,s,J,d,te,U);O.set(s,e)}N&&re.add(s),V?.schedule(s,P.session_ingress_token),U.done.then(me(s,W,U));break}default:await R(),p(`[bridge:work] Unknown work type: ${z}, skipping`);break}if(_){let e=N.signal();f.non_exclusive_heartbeat_interval_ms>0?(await L(),await k(f.non_exclusive_heartbeat_interval_ms,e.signal)):f.multisession_poll_interval_ms_at_capacity>0&&await k(f.multisession_poll_interval_ms_at_capacity,e.signal),e.cleanup()}}catch(e){if(y.aborted)break;if(e instanceof B){z(e.errorType)?d.logStatus(e.message):R(e)?p(`[bridge:work] Suppressed 403 error: ${e.message}`):(d.logError(e.message),b(e)),S(`tengu_bridge_fatal_error`,{status:e.status,error_type:e.errorType}),v(z(e.errorType)?`info`:`error`,`bridge_fatal_error`,{status:e.status,error_type:e.errorType});break}let t=P(e);if(I(`poll error: ${t} isConn=${Oe(e)} isServer=${ke(e)} activeSessions=${x.size}`),Oe(e)||ke(e)){let e=Date.now();X!==null&&e-X>Ce(m)&&(p(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),v(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,J||(J=e);let n=e-J;if(n>=m.connGiveUpMs){d.logError(`Server unreachable for ${Math.round(n/6e4)} minutes, giving up.`),S(`tengu_bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n}),v(`error`,`bridge_poll_give_up`,{error_type:`connection`,elapsed_ms:n});break}Y=null,q=0,K=K?Math.min(K*2,m.connCapMs):m.connInitialMs;let r=Ae(K);d.logVerbose(`Connection error, retrying in ${je(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),d.updateReconnectingStatus(je(r),w(n)),F().non_exclusive_heartbeat_interval_ms>0&&await L(),await k(r,y)}else{let e=Date.now();X!==null&&e-X>Ce(m)&&(p(`[bridge:work] Detected system sleep (${Math.round((e-X)/1e3)}s gap), resetting error budget`),v(`info`,`bridge_poll_sleep_detected`,{gapMs:e-X}),J=null,K=0,Y=null,q=0),X=e,Y||(Y=e);let n=e-Y;if(n>=m.generalGiveUpMs){d.logError(`Persistent errors for ${Math.round(n/6e4)} minutes, giving up.`),S(`tengu_bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n}),v(`error`,`bridge_poll_give_up`,{error_type:`general`,elapsed_ms:n});break}J=null,K=0,q=q?Math.min(q*2,m.generalCapMs):m.generalInitialMs;let r=Ae(q);d.logVerbose(`Poll failed, retrying in ${je(r)} (${Math.round(n/1e3)}s elapsed): ${t}`),d.updateReconnectingStatus(je(r),w(n)),F().non_exclusive_heartbeat_interval_ms>0&&await L(),await k(r,y)}}}pe(),d.clearStatus();let ge=Date.now()-U;S(`tengu_bridge_shutdown`,{active_sessions:x.size,loop_duration_ms:ge}),v(`info`,`bridge_shutdown`,{active_sessions:x.size,loop_duration_ms:ge});let $=new Set(x.keys());h&&$.add(h);let _e=new Map(E);if(x.size>0){p(`[bridge:shutdown] Shutting down ${x.size} active session(s)`),d.logStatus(`Shutting down ${x.size} active session(s)\u2026`);let e=new Map(T);for(let[e,t]of x.entries())p(`[bridge:shutdown] Sending SIGTERM to sessionId=${e}`),t.kill();let t=new AbortController;await Promise.race([Promise.allSettled([...x.values()].map(e=>e.done)),k(m.shutdownGraceMs??3e4,t.signal)]),t.abort();for(let[e,t]of x.entries())p(`[bridge:shutdown] Force-killing stuck sessionId=${e}`),t.forceKill();for(let e of O.values())clearTimeout(e);if(O.clear(),V?.cancelAll(),j.size>0){let e=[...j.values()];j.clear(),p(`[bridge:shutdown] Cleaning up ${e.length} worktree(s)`),await Promise.allSettled(e.map(e=>r(e.worktreePath,e.worktreeBranch,e.gitRoot,e.hookBased)))}await Promise.allSettled([...e.entries()].map(([e,t])=>c.stopWork(i,t,!0).catch(n=>d.logVerbose(`Failed to stop work ${t} for session ${e}: ${u(n)}`))))}W.size>0&&await Promise.allSettled([...W]),$.size>0&&(p(`[bridge:shutdown] Archiving ${$.size} session(s)`),await Promise.allSettled([...$].map(e=>c.archiveSession(_e.get(e)??ee(e)).catch(t=>d.logVerbose(`Failed to archive session ${e}: ${u(t)}`)))));try{await c.deregisterEnvironment(i),p(`[bridge:shutdown] Environment deregistered, bridge offline`),d.logVerbose(`Environment deregistered.`)}catch(e){d.logVerbose(`Failed to deregister environment: ${u(e)}`)}let{clearBridgePointer:ve}=await import(`./bridgePointer-DfTOjgtX.js`);await ve(t.dir),d.logVerbose(`Environment offline.`)}var De=new Set([`ECONNREFUSED`,`ECONNRESET`,`ETIMEDOUT`,`ENETUNREACH`,`EHOSTUNREACH`]);function Oe(e){return!!(e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&De.has(e.code))}function ke(e){return!!e&&typeof e==`object`&&`code`in e&&typeof e.code==`string`&&e.code===`ERR_BAD_RESPONSE`}function Ae(e){return Math.max(0,e+e*.25*(2*Math.random()-1))}function je(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`}async function Me(e,t,n,r,i=1e3){for(let a=1;a<=3;a++)try{await e.stopWork(t,n,!1),p(`[bridge:work] stopWork succeeded for workId=${n} on attempt ${a}/3`);return}catch(e){if(e instanceof B){R(e)?p(`[bridge:work] Suppressed stopWork 403 for ${n}: ${e.message}`):r.logError(`Failed to stop work ${n}: ${e.message}`),v(`error`,`bridge_stop_work_failed`,{attempts:a,fatal:!0});return}let t=u(e);if(a<3){let e=Ae(i*2**(a-1));r.logVerbose(`Failed to stop work ${n} (attempt ${a}/3), retrying in ${je(e)}: ${t}`),await k(e)}else r.logError(`Failed to stop work ${n} after 3 attempts: ${t}`),v(`error`,`bridge_stop_work_failed`,{attempts:3})}}function Ne(e,t,n,r,i){p(`[bridge:session] sessionId=${e} timed out after ${w(t)}`),S(`tengu_bridge_session_timeout`,{timeout_ms:t}),n.logSessionFailed(e,`Session timed out after ${w(t)}`),r.add(e),i.kill()}var Pe=80;function Fe(e){return C(e.replace(/\s+/g,` `).trim(),Pe)}async function Ie(e,t){let{getBridgeSession:n}=await import(`./createSession-BUzna9-E.js`);return(await n(e,{baseUrl:t}))?.title||void 0}var Le=class extends Error{constructor(e){super(e),this.name=`BridgeHeadlessPermanentError`}};async function Re(e,t){let{dir:n,log:r}=e;process.chdir(n);let{setOriginalCwd:i,setCwdState:a}=await import(`./state-BStOuCh4.js`);i(n),a(n);let{enableConfigs:o,checkHasTrustDialogAccepted:s}=await import(`./config-e0Goy478.js`);o();let{initSinks:c}=await import(`./sinks-DMp6uEzM.js`);if(c(),!s())throw new Le(`Workspace not trusted: ${n}. Run \`claude\` in that directory first to accept the trust dialog.`);if(!e.getAccessToken())throw Error(V);let{getBridgeBaseUrl:l}=await import(`./bridgeConfig-CJMjDoaP.js`),d=l();if(d.startsWith(`http://`)&&!d.includes(`localhost`)&&!d.includes(`127.0.0.1`))throw new Le(`Remote Control base URL uses HTTP. Only HTTPS or localhost HTTP is allowed.`);let f=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||d,{getBranch:p,getRemoteUrl:m,findGitRoot:h}=await import(`./git-zJCasBa6.js`),{hasWorktreeCreateHook:g}=await import(`./hooks-DjbqtbUV.js`);if(e.spawnMode===`worktree`&&!(g()||h(n)!==null))throw new Le(`Worktree mode requires a git repository or WorktreeCreate hooks. Directory ${n} has neither.`);let _=await p(),v=await m(),y=q(),b=Z(),x={dir:n,machineName:y,branch:_,gitRepoUrl:v,maxSessions:e.capacity,spawnMode:e.spawnMode,verbose:!1,sandbox:e.sandbox,bridgeId:b,workerType:`claude_code`,environmentId:Z(),apiBaseUrl:d,sessionIngressUrl:f,sessionTimeoutMs:e.sessionTimeoutMs},S=re({baseUrl:d,getAccessToken:e.getAccessToken,runnerVersion:`0.0.20`,onDebug:r,onAuth401:e.onAuth401,getTrustedDeviceToken:U}),C,w;try{let e=await S.registerBridgeEnvironment(x);C=e.environment_id,w=e.environment_secret}catch(e){throw Error(`Bridge registration failed: ${u(e)}`)}let T=be({execPath:process.execPath,scriptArgs:we(),env:process.env,verbose:!1,sandbox:e.sandbox,permissionMode:e.permissionMode,onDebug:r}),E=ze(r);E.printBanner(x,C);let D;if(e.createSessionOnStart){let{createBridgeSession:n}=await import(`./createSession-BUzna9-E.js`);try{let i=await n({environmentId:C,title:e.name,events:[],gitRepoUrl:v,branch:_,signal:t,baseUrl:d,getAccessToken:e.getAccessToken,permissionMode:e.permissionMode});i&&(D=i,r(`created initial session ${i}`))}catch(e){r(`session pre-creation failed (non-fatal): ${u(e)}`)}}await Ee(x,C,w,S,T,E,t,void 0,D,async()=>e.getAccessToken())}function ze(e){let t=()=>{};return{printBanner:(t,n)=>e(`registered environmentId=${n} dir=${t.dir} spawnMode=${t.spawnMode} capacity=${t.maxSessions}`),logSessionStart:(t,n)=>e(`session start ${t}`),logSessionComplete:(t,n)=>e(`session complete ${t} (${n}ms)`),logSessionFailed:(t,n)=>e(`session failed ${t}: ${n}`),logStatus:e,logVerbose:e,logError:t=>e(`error: ${t}`),logReconnected:t=>e(`reconnected after ${t}ms`),addSession:(t,n)=>e(`session attached ${t}`),removeSession:t=>e(`session detached ${t}`),updateIdleStatus:t,updateReconnectingStatus:t,updateSessionStatus:t,updateSessionActivity:t,updateSessionCount:t,updateFailedStatus:t,setSpawnModeDisplay:t,setRepoInfo:t,setDebugLogPath:t,setAttached:t,setSessionTitle:t,clearStatus:t,toggleQr:t,refreshDisplay:t}}E(),d();var Be=78,Ve=1;async function He(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=Be;return}switch(e){case`remoteControl`:await Ue();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=Be}}async function Ue(){let e=process.env.DAEMON_WORKER_DIR||Y(`.`),t=process.env.DAEMON_WORKER_NAME||void 0,n=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,r=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),i=process.env.DAEMON_WORKER_PERMISSION||void 0,a=process.env.DAEMON_WORKER_SANDBOX===`1`,o=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,s=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,c=new AbortController,l=()=>c.abort();process.on(`SIGTERM`,l),process.on(`SIGINT`,l);let d={dir:e,name:t,spawnMode:n,capacity:r,permissionMode:i,sandbox:a,sessionTimeoutMs:o,createSessionOnStart:s,getAccessToken:()=>D()?.accessToken,onAuth401:async e=>!!D()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await Re(d,c.signal)}catch(e){e instanceof Le?(console.error(`[remoteControl] permanent error: ${e.message}`),process.exitCode=Be):(console.error(`[remoteControl] transient error: ${u(e)}`),process.exitCode=Ve)}finally{process.off(`SIGTERM`,l),process.off(`SIGINT`,l)}}export{He as runDaemonWorker};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{St as e,_t as t}from"./loadAgentsDir-DaNpxaO-.js";e();export{t as execIntoTmuxWorktree};
|
|
File without changes
|