@readmagic/workmate 0.0.24 → 0.0.26
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-mS8iUoWY.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-BHBkysy0.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
- package/dist/chunks/App-D--vtCyq.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DyqI98d2.js +1 -0
- package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
- package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
- package/dist/chunks/Doctor-BU69VQzw.js +1 -0
- package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
- package/dist/chunks/ExitFlow-xBOnvhiW.js +2 -0
- package/dist/chunks/InvalidConfigDialog-NiuhcaG5.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-iwh8H52b.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
- package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
- package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
- package/dist/chunks/McpParsingWarnings-BYG2yqjO.js +1 -0
- package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
- package/dist/chunks/Messages-CxMsfjOa.js +10 -0
- package/dist/chunks/Onboarding-CkATe87e.js +1 -0
- package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
- package/dist/chunks/PromptInputFooterSuggestions-CwqAsTI2.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
- package/dist/chunks/{ProviderSetup-BCSPsvfv.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
- package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
- package/dist/chunks/REPL-BgzQtSFF.js +1 -0
- package/dist/chunks/REPL-rirm6s_7.js +124 -0
- package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
- package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
- package/dist/chunks/{SelectMulti-BQRHed-d.js → SelectMulti-BpAjjhsn.js} +1 -1
- package/dist/chunks/Settings-B6DImvca.js +2 -0
- package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
- package/dist/chunks/{SpinnerGlyph-CmkRUvHe.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
- package/dist/chunks/TextInput-BboKIug2.js +22 -0
- package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
- package/dist/chunks/TrustDialog-CZ8JpySm.js +1 -0
- package/dist/chunks/{ValidationErrorsList-DgNzJQUP.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
- package/dist/chunks/_baseEach-DGbaIpJA.js +1 -0
- package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
- package/dist/chunks/add-dir-B576wzi9.js +1 -0
- package/dist/chunks/{agentDisplay-M4pfwbMC.js → agentDisplay-ZuFoBZYu.js} +1 -1
- package/dist/chunks/{agents-DddX7lLX.js → agents-Dy4_hDic.js} +1 -1
- package/dist/chunks/agents-HIOBiw4w.js +101 -0
- package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
- package/dist/chunks/analytics-COpjZpvd.js +1 -0
- package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
- package/dist/chunks/backgroundHousekeeping-PyLNnGdw.js +1 -0
- package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
- package/dist/chunks/banner-DqFectPg.js +2 -0
- package/dist/chunks/branch-B_BL5N9N.js +2 -0
- package/dist/chunks/{break-cache-BMXqFTeS.js → break-cache-DL95nKZl.js} +2 -2
- package/dist/chunks/btw-Y44ctueB.js +1 -0
- package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
- package/dist/chunks/caches-5xZ4dSXt.js +1 -0
- package/dist/chunks/caches-Be9saXxV.js +1 -0
- package/dist/chunks/{claudeDesktop-D8ml2767.js → claudeDesktop-g8eUUY2E.js} +1 -1
- package/dist/chunks/{clear-B8ZtFPOK.js → clear-DtTkA707.js} +1 -1
- package/dist/chunks/{client-CpTCeWba.js → client-Bw_L3lSc.js} +1 -1
- package/dist/chunks/{client-4iqhC8xq.js → client-aJ2Nr_sh.js} +1 -1
- package/dist/chunks/client-mnUISv_N.js +1 -0
- package/dist/chunks/client-wPqIdEVm.js +1 -0
- package/dist/chunks/commands-wfE12a4L.js +1 -0
- package/dist/chunks/compact-CvNOtu7J.js +2 -0
- package/dist/chunks/config-D3K87Mm1.js +3 -0
- package/dist/chunks/config-DTga6Ku8.js +1 -0
- package/dist/chunks/config-DtmqWusU.js +1 -0
- package/dist/chunks/context-Opu4E8dL.js +1 -0
- package/dist/chunks/{context-noninteractive-C7wrRZnM.js → context-noninteractive-B1V2Mp26.js} +5 -5
- package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
- package/dist/chunks/conversation-CG_z7TLE.js +1 -0
- package/dist/chunks/conversation-CHesBfFZ.js +1 -0
- package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
- package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
- package/dist/chunks/cwd-BH2f3u0o.js +1 -0
- package/dist/chunks/cwd-DrEEb4f5.js +1 -0
- package/dist/chunks/debug-kBjDaVkQ.js +39 -0
- package/dist/chunks/{detectRepository-CfX8Lc0A.js → detectRepository-M6K2wc7h.js} +1 -1
- package/dist/chunks/{diff-DdpHThJ7.js → diff-Cv7tX2-P.js} +1 -1
- package/dist/chunks/{directoryCompletion-D_Rtg-4j.js → directoryCompletion-BHyjyKAM.js} +1 -1
- package/dist/chunks/doctor-DeBG5SL5.js +1 -0
- package/dist/chunks/entry-CbhyIWgj.js +13 -0
- package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
- package/dist/chunks/{esm-CGx9qY3q.js → esm-DUH16IqH.js} +1 -1
- package/dist/chunks/execAsync-D6SA-YsV.js +1 -0
- package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
- package/dist/chunks/execa-CBhG1doD.js +34 -0
- package/dist/chunks/exit-OKEV_ddw.js +1 -0
- package/dist/chunks/extraUsage-BlRL3yeb.js +1 -0
- package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
- package/dist/chunks/fast-4I_qPJCd.js +1 -0
- package/dist/chunks/fast-DiolM1M7.js +1 -0
- package/dist/chunks/fetchModelList-BRFTQim4.js +1 -0
- package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
- package/dist/chunks/fileSuggestions-iWVXvvLB.js +3 -0
- package/dist/chunks/firstPartyEventLogger-CN9UOmEC.js +1 -0
- package/dist/chunks/firstPartyEventLogger-RR5rvDtk.js +1 -0
- package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
- package/dist/chunks/{gemini-C_ApXgwc.js → gemini-BfVyavwQ.js} +2 -2
- package/dist/chunks/generateSessionName-CGaTTXCA.js +1 -0
- package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
- package/dist/chunks/getMachineId-bsd-DTYGimUN.js +1 -0
- package/dist/chunks/getMachineId-darwin-DqIFUVvd.js +2 -0
- package/dist/chunks/getMachineId-linux-CnCTmdzd.js +1 -0
- package/dist/chunks/getMachineId-unsupported-Cx21ssu1.js +1 -0
- package/dist/chunks/getMachineId-win-vZhex7KX.js +1 -0
- package/dist/chunks/goal-BidR-GFa.js +3 -0
- package/dist/chunks/grok-DLcuI-U7.js +1 -0
- package/dist/chunks/help-CZuvYhXj.js +1 -0
- package/dist/chunks/history-BxPGftQw.js +1 -0
- package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
- package/dist/chunks/{hooks-DR3IYPJ3.js → hooks-ehqfAM5F.js} +2 -2
- package/dist/chunks/install-ACGY0vhM.js +1 -0
- package/dist/chunks/instrumentation-B9bfF2mA.js +21 -0
- package/dist/chunks/{job-YhJQWgE0.js → job-Coztdn6A.js} +1 -1
- package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
- package/dist/chunks/launchLocalMemory-DRzfpIOB.js +3 -0
- package/dist/chunks/launchOnboarding-D2zFCJf-.js +8 -0
- package/dist/chunks/{loadAgentsDir-B0Anodo0.js → loadAgentsDir-DR5PVAc3.js} +590 -594
- package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
- package/dist/chunks/{loadPluginHooks-BSwCtQ6T.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
- package/dist/chunks/{loader-CICGtLp2.js → loader-6MqzNGmV.js} +1 -1
- package/dist/chunks/{localSearch-BxLYi6w_.js → localSearch-CzkxDuOR.js} +1 -1
- package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
- package/dist/chunks/lockfile-D_9vif6E.js +1 -0
- package/dist/chunks/{log-D2TIwHBV.js → log-DWZny1vM.js} +1 -1
- package/dist/chunks/logoUtils-DR5T0pr3.js +1 -0
- package/dist/chunks/{magicDocs-Bkz7ZcmL.js → magicDocs-BwBxjfLo.js} +2 -2
- package/dist/chunks/main-Ryi27wYq.js +345 -0
- package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
- package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
- package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
- package/dist/chunks/mcp-BCpnF6wD.js +1 -0
- package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
- package/dist/chunks/mcp-CZBTxbhu.js +2 -0
- package/dist/chunks/memory-BQO6Y0ak.js +1 -0
- package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
- package/dist/chunks/mode-wq70cR44.js +2 -0
- package/dist/chunks/model-D42epddJ.js +1 -0
- package/dist/chunks/model-DVk9-2dk.js +1 -0
- package/dist/chunks/modelOptions-beLgXORr.js +1 -0
- package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
- package/dist/chunks/{notifications-Bc6k-Ozy.js → notifications-dGBuNvFj.js} +1 -1
- package/dist/chunks/onChangeAppState-B4K-rSaF.js +1 -0
- package/dist/chunks/open-Cyrr4E5x.js +1 -0
- package/dist/chunks/openai-DAwnAV9K.js +2 -0
- package/dist/chunks/overlayContext-B6i_6y_0.js +1 -0
- package/dist/chunks/{panel-CVS4SK_E.js → panel-C0CF3noE.js} +1 -1
- package/dist/chunks/parser-BZt0VFd_.js +1 -0
- package/dist/chunks/{parser-Cg6hSCmn.js → parser-DThLwgdM.js} +1 -1
- package/dist/chunks/partition-BRQHofxD.js +1 -0
- package/dist/chunks/{pasteStore-P0zP-ch0.js → pasteStore-BmehVo5j.js} +1 -1
- package/dist/chunks/permissions-DkfWKN-B.js +3 -0
- package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
- package/dist/chunks/plan-B6U3ioer.js +1 -0
- package/dist/chunks/platform-Vl9IynC3.js +2 -0
- package/dist/chunks/plugin-CTA2_-F7.js +17 -0
- package/dist/chunks/{pluginAutoupdate-ennb9k8_.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
- package/dist/chunks/{pluginBlocklist-9OrNEh--.js → pluginBlocklist-DAoUENwc.js} +1 -1
- package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
- package/dist/chunks/{pluginFlagging-js_-WmYj.js → pluginFlagging-BCj9LJP3.js} +1 -1
- package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
- package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
- package/dist/chunks/{pluginStartupCheck-SRXOyqr7.js → pluginStartupCheck-U8_xk25t.js} +1 -1
- package/dist/chunks/plugins-D7zyI9c4.js +4 -0
- package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
- package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
- package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
- package/dist/chunks/print-BzljdXem.js +13 -0
- package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
- package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
- package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
- package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
- package/dist/chunks/{projectOnboardingState-B5YATuc6.js → projectOnboardingState-KqcpRXls.js} +1 -1
- package/dist/chunks/{prompt-CJ1l3XXk.js → prompt-CTByhpUI.js} +21 -21
- package/dist/chunks/prompt-DTpfW6yP.js +1 -0
- package/dist/chunks/prompt-D__eHY_5.js +1 -0
- package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
- package/dist/chunks/protocolHandler-BQSLVGnG.js +13 -0
- package/dist/chunks/{proxy-CDBfZjO7.js → proxy-BtWuysHM.js} +2 -2
- package/dist/chunks/reconciler-D6BUq8WB.js +1 -0
- package/dist/chunks/refresh-B4pqFp12.js +1 -0
- package/dist/chunks/reject-C6IvUvBt.js +1 -0
- package/dist/chunks/{reload-plugins-CQZFQLWP.js → reload-plugins-DXQqk7q6.js} +1 -1
- package/dist/chunks/rename-D4XBmTBI.js +1 -0
- package/dist/chunks/{renderOptions-DV0dn0IW.js → renderOptions-DkP98P_d.js} +1 -1
- package/dist/chunks/resume-DzIev0JI.js +2 -0
- package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
- package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
- package/dist/chunks/{runtimeObserver-PJ1o8GRA.js → runtimeObserver-BPqlbu0B.js} +4 -4
- package/dist/chunks/{runtimeObserver-DEuR8z0f.js → runtimeObserver-BUHs3qjs.js} +1 -1
- package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
- package/dist/chunks/sandbox-toggle-CTtET6Xq.js +1 -0
- package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
- package/dist/chunks/select-FrwoTzuc.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
- package/dist/chunks/{sessionObserver-BtKjvteq.js → sessionObserver-B6xzxckA.js} +2 -2
- package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
- package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
- package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
- package/dist/chunks/settings-BK6gCko-.js +1 -0
- package/dist/chunks/settings-YIDksG5Z.js +24 -0
- package/dist/chunks/setup-BBvZyrfz.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-Bg_aIc5Z.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
- package/dist/chunks/{sideQuestion-D49GsfH7.js → sideQuestion-5jcbOMsR.js} +3 -3
- package/dist/chunks/sinks-B-kFqjjd.js +1 -0
- package/dist/chunks/sinks-DB_D4lmu.js +1 -0
- package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
- package/dist/chunks/{skillGapStore-CcFoHNLl.js → skillGapStore-DOz1KCqo.js} +2 -2
- package/dist/chunks/{skillLifecycle-Bnz_4wE5.js → skillLifecycle-D9NkIwFQ.js} +2 -2
- package/dist/chunks/{skillSearchPanel-C_5yUhqn.js → skillSearchPanel-DFiSZaJ4.js} +4 -4
- package/dist/chunks/skills-DgeLr52a.js +1 -0
- package/dist/chunks/sleep-BbWr_FL1.js +1 -0
- package/dist/chunks/{src-CiJCsqUl.js → src-C8gyNm5a.js} +1 -1
- package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
- package/dist/chunks/src-Db7K3F_i.js +3 -0
- package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
- package/dist/chunks/startupProfiler-DIM_Ihyp.js +3 -0
- package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
- package/dist/chunks/{state-B4jiUise.js → state-CXY-q5gr.js} +1 -1
- package/dist/chunks/state-DXt6rahM.js +1 -0
- package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
- package/dist/chunks/status-CKLecQZV.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DI45AH-c.js +1 -0
- package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
- package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
- package/dist/chunks/switcher-DhZCaAun.js +1 -0
- package/dist/chunks/{tasks-DdcUQEeD.js → tasks-6suPhqsK.js} +1 -1
- package/dist/chunks/{templateJobs-C8qsPrLj.js → templateJobs-BKVEWCsb.js} +1 -1
- package/dist/chunks/{terminalSetup-qc2PlvOm.js → terminalSetup-7PUR4hfo.js} +1 -1
- package/dist/chunks/{terminalSetup-B_10N_gE.js → terminalSetup-Cqy5_PhJ.js} +4 -4
- package/dist/chunks/{theme-f1h2QI8J.js → theme-B-HG2PUs.js} +1 -1
- package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
- package/dist/chunks/{toolEventObserver-7QP38x4t.js → toolEventObserver-BY3QVnr6.js} +1 -1
- package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
- package/dist/chunks/{types-Dx7P7JLQ.js → types-CD25a50S.js} +16 -16
- package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
- package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
- package/dist/chunks/{use-select-navigation-hWL5VHnL.js → use-select-navigation-CW5alA9r.js} +1 -1
- package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BgJrnuDl.js +1 -0
- package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
- package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
- package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
- package/dist/chunks/useSearchInput-BITV_Txn.js +1 -0
- package/dist/chunks/useSettingsErrors-CO0fTNzn.js +1 -0
- package/dist/chunks/util-_zo3I1y8.js +1 -0
- package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
- package/dist/chunks/vim-qgMS88ss.js +1 -0
- package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -12
- package/scripts/postinstall.cjs +16 -16
- package/dist/chunks/AddWorkspaceDirectory-Ch8IcWXO.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Cyia0s4g.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-LjI_H_Au.js +0 -1
- package/dist/chunks/App-BOqh_1tN.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CSEuuoq9.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-CwfCwUr9.js +0 -1
- package/dist/chunks/CustomSelect-wmZ9jz0W.js +0 -1
- package/dist/chunks/DiffDialog-BpXIEWiE.js +0 -6
- package/dist/chunks/Doctor-CMpr7tdf.js +0 -1
- package/dist/chunks/Doctor-DqW6j3_B.js +0 -3
- package/dist/chunks/ExitFlow-DacaBTlk.js +0 -2
- package/dist/chunks/Grove-CNqYPWI6.js +0 -11
- package/dist/chunks/InvalidConfigDialog-0TMJItCC.js +0 -1
- package/dist/chunks/KeybindingProviderSetup-D49HHTXD.js +0 -1
- package/dist/chunks/MCPConnectionManager-Cie77ZAK.js +0 -1
- package/dist/chunks/MCPToolListView-B4ehtkXd.js +0 -1
- package/dist/chunks/McpParsingWarnings-Bff66RtJ.js +0 -1
- package/dist/chunks/MessageSelector-Dpd6Iywp.js +0 -3
- package/dist/chunks/Messages-DN7M3oS_.js +0 -10
- package/dist/chunks/Onboarding-CQmE3rUf.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-HI6HH3TP.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-3QNUC2Cg.js +0 -1
- package/dist/chunks/QueryEngine-DdLWvJv6.js +0 -1
- package/dist/chunks/REPL-BqO9KcK_.js +0 -124
- package/dist/chunks/REPL-CmZmypfF.js +0 -1
- package/dist/chunks/ResumeConversation-DBqX7gva.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BsSoILFj.js +0 -1
- package/dist/chunks/Settings-B-7yBewS.js +0 -3
- package/dist/chunks/Spinner-ByQXTvAA.js +0 -1
- package/dist/chunks/TextInput-B8ruWRf2.js +0 -22
- package/dist/chunks/ThemePicker-BQErFFW1.js +0 -1
- package/dist/chunks/TrustDialog-BIhz6AZE.js +0 -1
- package/dist/chunks/_baseEach-CsIRoaTH.js +0 -1
- package/dist/chunks/add-dir-CrUDs19x.js +0 -1
- package/dist/chunks/agents-CGaCQeLw.js +0 -101
- package/dist/chunks/allErrors-BF73lon8.js +0 -1
- package/dist/chunks/analytics-DJobLaWP.js +0 -1
- package/dist/chunks/appleTerminalBackup-BArZWB21.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Bq3LMsVR.js +0 -17
- package/dist/chunks/backgroundHousekeeping-Cl3Ox7Qh.js +0 -1
- package/dist/chunks/banner-Cu2-XUek.js +0 -2
- package/dist/chunks/branch-Yg_taNlT.js +0 -2
- package/dist/chunks/btw-udbprVvu.js +0 -1
- package/dist/chunks/caches-ChjIEcdd.js +0 -1
- package/dist/chunks/caches-DLJ6urv-.js +0 -1
- package/dist/chunks/client-BiqbIkwr.js +0 -1
- package/dist/chunks/client-CZ8nyVh5.js +0 -1
- package/dist/chunks/commands-CVCpJo7M.js +0 -1
- package/dist/chunks/compact-izk6RKHQ.js +0 -2
- package/dist/chunks/config-C-Y2qtB2.js +0 -3
- package/dist/chunks/config-CFqpXMFX.js +0 -1
- package/dist/chunks/config-DD8fCYXn.js +0 -1
- package/dist/chunks/context-BbVm4SWK.js +0 -1
- package/dist/chunks/context-noninteractive-x0HAzWhc.js +0 -1
- package/dist/chunks/conversation-DouVzO0K.js +0 -1
- package/dist/chunks/conversation-DrVkifKy.js +0 -1
- package/dist/chunks/conversationRecovery-DliPBo_z.js +0 -1
- package/dist/chunks/crossProjectResume-DxMy05_P.js +0 -40
- package/dist/chunks/cwd-Dc3NV7s8.js +0 -1
- package/dist/chunks/cwd-Pa83R95t.js +0 -1
- package/dist/chunks/datadog-Cu3s7P48.js +0 -1
- package/dist/chunks/debug-Bglx1aTu.js +0 -39
- package/dist/chunks/doctor-D_kV_D_l.js +0 -1
- package/dist/chunks/entry-Bxseqbi_.js +0 -13
- package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
- package/dist/chunks/esm-BXTZz3av.js +0 -1
- package/dist/chunks/execAsync-Bv2yxuGe.js +0 -1
- package/dist/chunks/execFileNoThrow-BTachNBI.js +0 -34
- package/dist/chunks/exit-C_R_FgzR.js +0 -1
- package/dist/chunks/extraUsage-xMuDiNKh.js +0 -1
- package/dist/chunks/extractMemories-D4Dl1itt.js +0 -1
- package/dist/chunks/fast-DH-C5IZs.js +0 -1
- package/dist/chunks/fast-bopOPrtf.js +0 -1
- package/dist/chunks/fetchModelList-DC4VQpqa.js +0 -1
- package/dist/chunks/fetchModelList-FE8tzTDc.js +0 -1
- package/dist/chunks/fileSuggestions-C-9unnoJ.js +0 -3
- package/dist/chunks/firstPartyEventLogger-QmjjQmgt.js +0 -3
- package/dist/chunks/firstPartyEventLogger-lFeqhtfh.js +0 -1
- package/dist/chunks/generateSessionName-CQ03xlYI.js +0 -1
- package/dist/chunks/genericProcessUtils-DwQFuna9.js +0 -23
- package/dist/chunks/getMachineId-bsd-Cut1kHoA.js +0 -1
- package/dist/chunks/getMachineId-darwin-CsRhaP3y.js +0 -2
- package/dist/chunks/getMachineId-linux-Bd7UBNRQ.js +0 -1
- package/dist/chunks/getMachineId-unsupported-vFGP8E_8.js +0 -1
- package/dist/chunks/getMachineId-win-DamF2CH_.js +0 -1
- package/dist/chunks/goal-CdL29Y8C.js +0 -3
- package/dist/chunks/grok-C6WAslUT.js +0 -1
- package/dist/chunks/grove-O6qp7ITR.js +0 -1
- package/dist/chunks/help-DxanITNN.js +0 -1
- package/dist/chunks/history-BMycjPTT.js +0 -1
- package/dist/chunks/hooks-D9ApLkBp.js +0 -1
- package/dist/chunks/install-0D9u2dZw.js +0 -1
- package/dist/chunks/instrumentation-BFiGwntt.js +0 -21
- package/dist/chunks/keybindings-DZrF9iNd.js +0 -1
- package/dist/chunks/launchLocalMemory-DhJ56KDc.js +0 -3
- package/dist/chunks/launchOnboarding-DmMoZwv5.js +0 -8
- package/dist/chunks/loadAgentsDir-BbUR6pqH.js +0 -1
- package/dist/chunks/localSearch-zfn7jgrh.js +0 -1
- package/dist/chunks/logoUtils-CRxTutvr.js +0 -1
- package/dist/chunks/main-9ksgUUY_.js +0 -345
- package/dist/chunks/managedEnv-BEqrGqn1.js +0 -1
- package/dist/chunks/managedEnv-OPlzUPbJ.js +0 -1
- package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
- package/dist/chunks/mcp-ChF12reQ.js +0 -1
- package/dist/chunks/mcp-DoEl5uah.js +0 -2
- package/dist/chunks/mcp-hp9qqjAy.js +0 -6
- package/dist/chunks/memory-Qv-wGNQ5.js +0 -1
- package/dist/chunks/mode-bFXPCR2P.js +0 -2
- package/dist/chunks/model-6lkW4o2c.js +0 -1
- package/dist/chunks/model-BvQFFOf8.js +0 -1
- package/dist/chunks/modelOptions-BBvF3wHK.js +0 -1
- package/dist/chunks/nativeInstaller-CdjmE9Zy.js +0 -1
- package/dist/chunks/onChangeAppState-DLjZ1x95.js +0 -1
- package/dist/chunks/open-BtQHzzL9.js +0 -1
- package/dist/chunks/openai-D46QvESE.js +0 -2
- package/dist/chunks/overlayContext-8--_fbvY.js +0 -1
- package/dist/chunks/parser-CG5RuOCK.js +0 -1
- package/dist/chunks/partition-DznN4XZH.js +0 -1
- package/dist/chunks/permissions-DmGFViHI.js +0 -3
- package/dist/chunks/pidLock-Cm4sW35f.js +0 -3
- package/dist/chunks/plan-CzGBz_87.js +0 -1
- package/dist/chunks/platform-BacQ6ACS.js +0 -2
- package/dist/chunks/plugin-CluR79xX.js +0 -17
- package/dist/chunks/pluginCliCommands-CJv5uhOG.js +0 -1
- package/dist/chunks/pluginOperations-CcUSHAIa.js +0 -2
- package/dist/chunks/pluginStartupCheck-CRBUO9gP.js +0 -1
- package/dist/chunks/plugins-IwwaCDba.js +0 -4
- package/dist/chunks/poorMode-B0QGV6Ci.js +0 -1
- package/dist/chunks/poorMode-G-pnu6NM.js +0 -1
- package/dist/chunks/print-CgszM1ea.js +0 -13
- package/dist/chunks/processBashCommand-D098WsqY.js +0 -1
- package/dist/chunks/processSlashCommand-DOQFjJ88.js +0 -5
- package/dist/chunks/prompt-BKPmDAuL.js +0 -1
- package/dist/chunks/prompt-CgOklk7z.js +0 -1
- package/dist/chunks/promptEditor-DoGHJN_W.js +0 -4
- package/dist/chunks/protocolHandler-DjQALaU2.js +0 -13
- package/dist/chunks/reconciler-ykkSPR-i.js +0 -1
- package/dist/chunks/refresh-Dn_I1R4v.js +0 -1
- package/dist/chunks/registerProtocol-CAsDme_E.js +0 -1
- package/dist/chunks/reject-DtcCfuZV.js +0 -1
- package/dist/chunks/rename-DyEfsZiq.js +0 -1
- package/dist/chunks/resume-BcXEDUqZ.js +0 -2
- package/dist/chunks/ripgrep-DLs8MraF.js +0 -1
- package/dist/chunks/ripgrep-Dl3y5r4m.js +0 -5
- package/dist/chunks/sandbox-adapter-DfB9kgQD.js +0 -1
- package/dist/chunks/sandbox-toggle-D9GDUsTl.js +0 -1
- package/dist/chunks/searchExtraTools-D4gMMQv0.js +0 -1
- package/dist/chunks/select-DIxfl_VN.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-lbgHnVvi.js +0 -1
- package/dist/chunks/sessionObserver-D6qzEdGJ.js +0 -1
- package/dist/chunks/sessionStorage-C_7gow_z.js +0 -1
- package/dist/chunks/sessionTracing-CtbeAD0s.js +0 -11
- package/dist/chunks/settings-B2jvL8Dp.js +0 -24
- package/dist/chunks/settings-CisDe8DB.js +0 -1
- package/dist/chunks/setup-qecdf-ES.js +0 -3
- package/dist/chunks/sinks-C-lP7uyO.js +0 -1
- package/dist/chunks/sinks-De-B1lPQ.js +0 -1
- package/dist/chunks/skillChangeDetector-DkOJoNhT.js +0 -1
- package/dist/chunks/skills-BE5scC-g.js +0 -1
- package/dist/chunks/src-CHw1lvBc.js +0 -3
- package/dist/chunks/startupProfiler-BH0FoI66.js +0 -1
- package/dist/chunks/startupProfiler-CJdr3SxP.js +0 -3
- package/dist/chunks/state-BhOKSFi5.js +0 -1
- package/dist/chunks/status-Dw09WZLd.js +0 -1
- package/dist/chunks/statusNoticeHelpers-BRQpUIlH.js +0 -1
- package/dist/chunks/stringUtils-C718f5ey.js +0 -4
- package/dist/chunks/switcher-CgZVah7U.js +0 -1
- package/dist/chunks/switcher-DZwUo5Ed.js +0 -1
- package/dist/chunks/tipRegistry-B71o4qWr.js +0 -2
- package/dist/chunks/toolPool-V-7Yv0GA.js +0 -1
- package/dist/chunks/udsClient-cQz6nJ_T.js +0 -1
- package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BKwzUpgb.js +0 -1
- package/dist/chunks/useMainLoopModel-DxvV70Ru.js +0 -1
- package/dist/chunks/useManagePlugins-BXLXazrR.js +0 -1
- package/dist/chunks/useMergedTools-CCgnBJzO.js +0 -1
- package/dist/chunks/useSearchInput-CzopttqC.js +0 -1
- package/dist/chunks/useSettingsErrors-SFPWfxsA.js +0 -1
- package/dist/chunks/util-Cbb3S6SX.js +0 -1
- package/dist/chunks/validatePlugin-BMSoeb_b.js +0 -1
- package/dist/chunks/vim-CoRp9lY1.js +0 -1
- package/dist/chunks/worktree-Vm-SNY5x.js +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ct as t,ot as n}from"./esm-BXTZz3av.js";import{$l as r,Ag as i,B as a,Di as o,E as s,Fd as c,Id as l,Jb as u,Jm as d,Kb as f,Km as p,Lh as m,Lx as h,Mi as g,Ni as _,Op as v,Pi as y,Qo as b,Rx as x,Si as S,Tg as C,Ti as w,Us as T,V as E,Vs as D,Ws as O,Yi as ee,Zo as te,_S as ne,_d as k,b as A,cf as re,cg as ie,cu as ae,dg as oe,es as se,eu as ce,fS as le,gS as j,gd as M,hc as ue,hd as de,iu as fe,kp as pe,lS as N,lf as me,mS as he,mc as ge,ny as P,oS as F,pS as I,qb as L,sf as _e,su as ve,tS as ye,tu as R,ty as be,uS as xe,ua as Se,vS as Ce,vd as we,wa as Te,wg as Ee,yd as De,zh as Oe,zx as z}from"./loadAgentsDir-B0Anodo0.js";import{It as ke,Mn as Ae,st as je,t as Me}from"./state-B4jiUise.js";import{E as Ne,I as Pe,c as B,f as Fe,i as V,k as H,u as Ie}from"./debug-Bglx1aTu.js";import{Dt as Le,Et as Re}from"./settings-B2jvL8Dp.js";import{D as U,O as W,o as ze,q as Be,s as G}from"./log-D2TIwHBV.js";import{n as Ve,r as K}from"./analytics-DJobLaWP.js";import{Kt as He,qt as Ue}from"./model-BvQFFOf8.js";import{h as We,m as Ge}from"./firstPartyEventLogger-QmjjQmgt.js";import{E as Ke,T as qe,w as Je}from"./sessionTracing-CtbeAD0s.js";import{randomUUID as q}from"crypto";function Ye(e,t,n,r,i){let a=0;for(let o of Le){let s=n[o];if(s)for(let n of s)for(let s of n.hooks){let c=s.once?()=>{B(`Removing one-shot hook for event ${o} in skill '${r}'`),De(e,t,o,s)}:void 0;k(e,t,o,n.matcher||``,s,c,i),a++}}a>0&&B(`Registered ${a} hooks from skill '${r}'`)}var Xe=e((()=>{Re(),V(),we()}));function Ze(e){let t=e.trim();if(!t.startsWith(`/`))return null;let n=t.slice(1).split(` `);if(!n[0])return null;let r=n[0],i=!1,a=1;n.length>1&&n[1]===`(MCP)`&&(r=`${r} (MCP)`,i=!0,a=2);let o=n.slice(a).join(` `);return{commandName:r,args:o,isMcp:i}}var Qe=e((()=>{}));function $e(){return!1}function J(){if(!$e())throw Error(`ToolUseContext.options.allowBackgroundForkedSlashCommands is test-only and cannot be enabled outside NODE_ENV=test.`)}async function et(e,t,n,r,i,a,o){let s=c(),l=e.pluginInfo?z(e.pluginInfo.repository).marketplace:void 0;K(`tengu_slash_command_forked`,{command_name:e.name,invocation_trigger:`user-slash`,...e.pluginInfo&&{_PROTO_plugin_name:e.pluginInfo.pluginManifest.name,...l&&{_PROTO_marketplace_name:l},...R(e.pluginInfo)}});let{skillContent:u,modifiedGetAppState:d,baseAgent:f,promptMessages:p}=await O(e,t,n);B(`Executing forked slash command /${e.name} with agent ${f.agentType}`);let m=n.options.allowBackgroundForkedSlashCommands===!0;if(m&&J(),m){let t=be(),r=y(e),i=He(),c=e=>C({value:e,mode:`prompt`,priority:`later`,isMeta:!0,skipSlashCommands:!0,workload:i}),l=async()=>{if(!o?.runId)return;let e=await _e({runId:o.runId,rootDir:o.rootDir,priority:`later`,workload:i});for(let t of e)Ee(t)},u=async e=>{o?.runId&&await re({runId:o.runId,rootDir:o.rootDir,error:e instanceof Error?e.message:String(e)})};return(async()=>{let i=Date.now()+$;for(;Date.now()<i&&n.getAppState().mcp.clients.some(e=>e.type===`pending`);)await We(Q);let o=n.options.refreshTools?.()??n.options.tools,u=[];for await(let r of M({agentDefinition:f,promptMessages:p,toolUseContext:{...n,getAppState:d,abortController:t},canUseTool:a,isAsync:!0,querySource:`agent:custom`,model:e.model,availableTools:o,override:{agentId:s}}))u.push(r);let m=D(u,`Command completed`);B(`Background forked command /${r} completed (agent ${s})`),c(`<scheduled-task-result command="/${r}">\n${m}\n</scheduled-task-result>`);try{await l()}catch(e){G(e)}})().catch(async e=>{G(e),c(`<scheduled-task-result command="/${r}" status="failed">\n${e instanceof Error?e.message:String(e)}\n</scheduled-task-result>`),await u(e)}),{messages:[],shouldQuery:!1,command:e,deferAutonomyCompletion:!!o?.runId}}let h=[],g=[],_=`forked-command-${e.name}`,v=0,b=e=>(v++,{type:`progress`,data:{message:e,type:`agent_progress`,prompt:u,agentId:s},parentToolUseID:_,toolUseID:`${_}-${v}`,timestamp:new Date().toISOString(),uuid:q()}),x=()=>{i({jsx:ae(g,{tools:n.options.tools,verbose:!1}),shouldHidePromptInput:!1,shouldContinueAnimation:!0,showSpinner:!0})};x();try{for await(let t of M({agentDefinition:f,promptMessages:p,toolUseContext:{...n,getAppState:d},canUseTool:a,isAsync:!1,querySource:`agent:custom`,model:e.model,availableTools:n.options.tools})){h.push(t);let e=Se([t]);if(t.type===`assistant`){let r=ie(t);r>0&&n.setResponseLength(e=>e+r);let i=e[0];i&&i.type===`assistant`&&(g.push(b(t)),x())}if(t.type===`user`){let t=e[0];t&&t.type===`user`&&(g.push(b(t)),x())}}}finally{i(null)}let S=D(h,`Command completed`);return B(`Forked slash command /${e.name} completed with agent ${s}`),{messages:[I({content:j({inputString:`/${y(e)} ${t}`.trim(),precedingInputBlocks:r})}),I({content:`<local-command-stdout>\n${S}\n</local-command-stdout>`})],shouldQuery:!1,command:e,resultText:S}}function tt(e){return!/[^a-zA-Z0-9:\-_]/.test(e)}async function nt(e,t,n,r,i,a,o,s,c,l){let u=Ze(e);if(!u){K(`tengu_input_slash_missing`,{});let e="Commands are in the form `/command [args]`";return{messages:[N(),...r,I({content:j({inputString:e,precedingInputBlocks:t})})],shouldQuery:!1,resultText:e}}let{commandName:d,args:f,isMcp:p}=u,m=p?`mcp`:S().has(d)?d:`custom`;if(!g(d,i.options.commands)){let n=!1;try{await Ie().stat(`/${d}`),n=!0}catch{}if(tt(d)&&!n){K(`tengu_input_slash_invalid`,{input:d});let e=`Unknown skill: ${d}`;return{messages:[N(),...r,I({content:j({inputString:e,precedingInputBlocks:t})}),...f?[xe(`Args from unknown skill: ${f}`,`warning`)]:[]],shouldQuery:!1,resultText:e}}let i=q();return Ae(i),K(`tengu_input_prompt`,{}),qe(`user_prompt`,{prompt_length:String(e.length),prompt:Ke(e),"prompt.id":i}),{messages:[I({content:j({inputString:e,precedingInputBlocks:t}),uuid:o}),...r],shouldQuery:!0}}let{messages:h,shouldQuery:_,allowedTools:v,model:y,command:b,resultText:C,nextInput:w,submitNextInput:T,deferAutonomyCompletion:E}=await rt(d,f,a,i,t,n,s,c,o,l);if(h.length===0){let e={input:m};if(b.type===`prompt`&&b.pluginInfo){let{pluginManifest:t,repository:n}=b.pluginInfo,{marketplace:r}=z(n),i=x(r);e._PROTO_plugin_name=t.name,r&&(e._PROTO_marketplace_name=r),e.plugin_repository=i?n:`third-party`,e.plugin_name=i?t.name:`third-party`,i&&t.version&&(e.plugin_version=t.version),Object.assign(e,R(b.pluginInfo))}return K(`tengu_input_command`,{...e,invocation_trigger:`user-slash`}),{messages:[],shouldQuery:!1,model:y,nextInput:w,submitNextInput:T,deferAutonomyCompletion:E}}if(h.length===2&&h[1].type===`user`&&typeof h[1].message.content==`string`&&h[1].message.content.startsWith(`Unknown command:`))return e.startsWith(`/var`)||e.startsWith(`/tmp`)||e.startsWith(`/private`)||K(`tengu_input_slash_invalid`,{input:d}),{messages:[N(),...h],shouldQuery:_,allowedTools:v,model:y};let D={input:m};if(b.type===`prompt`&&b.pluginInfo){let{pluginManifest:e,repository:t}=b.pluginInfo,{marketplace:n}=z(t),r=x(n);D._PROTO_plugin_name=e.name,n&&(D._PROTO_marketplace_name=n),D.plugin_repository=r?t:`third-party`,D.plugin_name=r?e.name:`third-party`,r&&e.version&&(D.plugin_version=e.version),Object.assign(D,R(b.pluginInfo))}K(`tengu_input_command`,{...D,invocation_trigger:`user-slash`});let O=h.length>0&&h[0]&&ye(h[0]);return{messages:_||h.every(Te)||O?h:[N(),...h],shouldQuery:_,allowedTools:v,model:y,resultText:C,nextInput:w,submitNextInput:T,deferAutonomyCompletion:E}}async function rt(e,t,n,r,i,s,c,l,u,d){let f=o(e,r.options.commands);if(f.type===`prompt`&&f.userInvocable!==!1&&ce(e),f.userInvocable===!1)return{messages:[I({content:j({inputString:`/${e}`,precedingInputBlocks:i})}),I({content:`This skill can only be invoked by Work Mate, not directly by users. Ask Work Mate to use the "${e}" skill for you.`})],shouldQuery:!1,command:f};try{switch(f.type){case`local-jsx`:return new Promise(e=>{let a=!1,o=(n,r)=>{if(a=!0,r?.display===`skip`){e({messages:[],shouldQuery:!1,command:f,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput});return}let o=(r?.metaMessages??[]).map(e=>I({content:e,isMeta:!0})),s=pe()&&typeof n==`string`&&n.endsWith(` dismissed`),c=r?.displayArgs??t;e({messages:r?.display===`system`?s?o:[F(Y(f,c)),F(`<local-command-stdout>${n}</local-command-stdout>`),...o]:[I({content:j({inputString:Y(f,c),precedingInputBlocks:i})}),I(n?{content:`<local-command-stdout>${n}</local-command-stdout>`}:{content:`<local-command-stdout>${ne}</local-command-stdout>`}),...o],shouldQuery:r?.shouldQuery??!1,command:f,nextInput:r?.nextInput,submitNextInput:r?.submitNextInput})};f.load().then(e=>e.call(o,{...r,canUseTool:l},t)).then(t=>{if(t!=null){if(r.options.isNonInteractiveSession){e({messages:[],shouldQuery:!1,command:f});return}a||n({jsx:t,shouldHidePromptInput:!0,showSpinner:!1,isLocalJSXCommand:!0,isImmediate:f.immediate===!0})}}).catch(t=>{G(t),!a&&(a=!0,n({jsx:null,shouldHidePromptInput:!1,clearLocalJSX:!0}),e({messages:[],shouldQuery:!1,command:f}))})});case`local`:{let e=I({content:j({inputString:Y(f,f.isSensitive&&t.trim()?`***`:t),precedingInputBlocks:i})});try{let n=N(),i=await(await f.load()).call(t,r);if(i.type===`skip`)return{messages:[],shouldQuery:!1,command:f};if(i.type===`compact`){let t=[n,e,...i.displayText?[I({content:`<local-command-stdout>${i.displayText}</local-command-stdout>`,timestamp:new Date(Date.now()+100).toISOString()})]:[]],r={...i.compactionResult,messagesToKeep:[...i.compactionResult.messagesToKeep??[],...t]};return Oe(),{messages:p(r),shouldQuery:!1,command:f}}return{messages:[e,F(`<local-command-stdout>${i.value}</local-command-stdout>`)],shouldQuery:!1,command:f,resultText:i.value}}catch(t){return G(t),{messages:[e,F(`<local-command-stderr>${String(t)}</local-command-stderr>`)],shouldQuery:!1,command:f}}}case`prompt`:try{return f.context===`fork`?await et(f,t,r,i,n,l??a,d):await Z(f,t,r,i,s,u)}catch(e){return e instanceof Ne?{messages:[I({content:j({inputString:Y(f,t),precedingInputBlocks:i})}),le({toolUse:!1})],shouldQuery:!1,command:f}:{messages:[I({content:j({inputString:Y(f,t),precedingInputBlocks:i})}),I({content:`<local-command-stderr>${String(e)}</local-command-stderr>`})],shouldQuery:!1,command:f}}}}catch(e){if(e instanceof H)return{messages:[I({content:j({inputString:e.message,precedingInputBlocks:i})})],shouldQuery:!1,command:f};throw e}}function Y(e,t){return he(y(e),t)}function X(e,t=`loading`){return[`<${U}>${e}</${U}>`,`<${W}>${e}</${W}>`,`<skill-format>true</skill-format>`].join(`
|
|
2
|
-
`)}function it(e,t){return[`<${U}>${e}</${U}>`,`<${W}>/${e}</${W}>`,t?`<command-args>${t}</command-args>`:null].filter(Boolean).join(`
|
|
3
|
-
`)}function at(e,t){return e.userInvocable===!1&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)?X(e.name,e.progressMessage):it(e.name,t)}async function ot(e,t,n,r,i=[]){let a=w(e,n);if(!a)throw new H(`Unknown command: ${e}`);if(a.type!==`prompt`)throw Error(`Unexpected ${a.type} command. Expected 'prompt' command. Use /${e} directly in the main conversation.`);return Z(a,t,r,[],i)}async function Z(e,t,r,i=[],a=[],o){let c=await e.getPromptForCommand(t,r),l=!L(`hooks`)||u(e.source);if(e.hooks&&l){let t=je();Ye(r.setAppState,t,e.hooks,e.name,e.type===`prompt`?e.skillRoot:void 0)}let d=e.source?`${e.source}:${e.name}`:e.name,f=c.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
4
|
-
|
|
5
|
-
`);Me(e.name,d,f,n()?.agentId??null);let p=at(e,t),m=s(e.allowedTools??[]),h=a.length>0||i.length>0?[...a,...i,...c]:c,g=await ue(b(c.filter(e=>e.type===`text`).map(e=>e.text).join(` `),r,null,[],r.messages,`repl_main_thread`,{skipSkillDiscovery:!0}));return{messages:[I({content:p,uuid:o}),I({content:h,isMeta:!0}),...g,te({type:`command_permissions`,allowedTools:m,model:e.model})],shouldQuery:!0,allowedTools:m,model:e.model,command:e}}var Q,$;e((()=>{ke(),_(),Ce(),Be(),Ve(),d(),m(),de(),ve(),P(),t(),se(),V(),Pe(),T(),Fe(),v(),ge(),Xe(),ze(),i(),ee(),A(),E(),h(),f(),Qe(),Ge(),r(),Je(),fe(),oe(),l(),me(),Ue(),Q=200,$=1e4}))();export{X as formatSkillLoadingMetadata,ot as processPromptSlashCommand,nt as processSlashCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t}from"./prompt-CJ1l3XXk.js";t();export{e as isDeferredTool};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fx as e,vx as t}from"./loadAgentsDir-B0Anodo0.js";t();export{e as clearPromptCache};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{P_ as r,z_ as i}from"./loadAgentsDir-B0Anodo0.js";import{Rn as a,t as o}from"./src-DL3w8VPk.js";import{T as s,c,f as l,i as u,u as d,x as f}from"./debug-Bglx1aTu.js";import{_ as p,b as m,x as h,y as g}from"./stringUtils-C718f5ey.js";import{i as _,n as v,o as y,s as b}from"./history-BMycjPTT.js";import{n as x,t as S}from"./tempfile-CHO5wXsV.js";import{basename as C}from"path";import{spawn as w,spawnSync as T}from"child_process";function E(e){return!!g(e)}function D(e){let t=C(e.split(` `)[0]??``);return A.find(e=>t.includes(e))}function O(e,t,n){return n?M.has(e)?[`-g`,`${t}:${n}`]:e===`subl`?[`${t}:${n}`]:[t]:[t]}function k(e,t){let n=N();if(!n)return!1;let r=n.split(` `),i=r[0]??n,o=r.slice(1),s=D(n);if(s){let r=O(s,e,t),a={detached:!0,stdio:`ignore`},l;return l=process.platform===`win32`?w(`${n} ${r.map(e=>`"${e}"`).join(` `)}`,{...a,shell:!0}):w(i,[...o,...r],a),l.on(`error`,e=>c(`editor spawn failed: ${e}`,{level:`error`})),l.unref(),!0}let l=a.get(process.stdout);if(!l)return!1;let u=t&&j.test(C(i));l.enterAlternateScreen();try{let r={stdio:`inherit`},a;return a=process.platform===`win32`?T(`${n} ${u?`+${t} `:``}"${e}"`,{...r,shell:!0}):T(i,[...o,...u?[`+${t}`,e]:[e]],r),a.error?(c(`editor spawn failed: ${a.error}`,{level:`error`}),!1):!0}finally{l.exitAlternateScreen()}}var A,j,M,N,P=e((()=>{n(),o(),u(),p(),A=[`code`,`cursor`,`windsurf`,`codium`,`subl`,`atom`,`gedit`,`notepad++`,`notepad`],j=/\b(vi|vim|nvim|nano|emacs|pico|micro|helix|hx)\b/,M=new Set([`code`,`cursor`,`windsurf`,`codium`]),N=t(()=>process.env.VISUAL?.trim()?process.env.VISUAL.trim():process.env.EDITOR?.trim()?process.env.EDITOR.trim():process.platform===`win32`?`start /wait notepad`:[`code`,`vi`,`nano`].find(e=>E(e)))}));function F(e){return D(e)!==void 0}function I(e){let t=d(),n=a.get(process.stdout);if(!n)throw Error(`Ink instance not found - cannot pause rendering`);let r=N();if(!r)return{content:null};try{t.statSync(e)}catch{return{content:null}}let o=!F(r);o?n.enterAlternateScreen():(n.pause(),n.suspendStdin());try{return m(`${z[r]??r} "${e}"`,{stdio:`inherit`}),{content:t.readFileSync(e,{encoding:`utf-8`})}}catch(e){if(typeof e==`object`&&e&&`status`in e&&typeof e.status==`number`){let t=e.status;if(t!==0)return{content:null,error:`${i(r)} exited with code ${t}`}}return{content:null}}finally{o?n.exitAlternateScreen():(n.resumeStdin(),n.resume())}}function L(e,t,n){let r=e;for(let[e,t]of Object.entries(n))if(t.type===`text`){let n=parseInt(e,10),i=t.content,a=r.indexOf(i);if(a!==-1){let e=_(n,y(i));r=r.slice(0,a)+e+r.slice(a+i.length)}}return r}function R(e,t){let n=d(),r=S();try{s(r,t?v(e,t):e,{encoding:`utf-8`,flush:!0});let n=I(r);if(n.content===null)return n;let i=n.content;return i.endsWith(`
|
|
2
|
-
`)&&!i.endsWith(`
|
|
3
|
-
|
|
4
|
-
`)&&(i=i.slice(0,-1)),t&&(i=L(i,e,t)),{content:i}}finally{try{n.unlinkSync(r)}catch{}}}var z,B=e((()=>{b(),o(),P(),h(),l(),r(),f(),x(),z={code:`code -w`,subl:`subl --wait`}}));export{P as a,N as i,R as n,k as o,B as r,I as t};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{C as e,c as t,i as n,x as r}from"./debug-Bglx1aTu.js";import{p as i,s as a}from"./config-C-Y2qtB2.js";import{i as o,t as s}from"./execFileNoThrow-BTachNBI.js";import{_ as c,v as l}from"./stringUtils-C718f5ey.js";import{i as u,n as d,r as f}from"./banner-Cu2-XUek.js";import{r as p}from"./registerProtocol-CAsDme_E.js";import{homedir as m}from"os";import{basename as h}from"path";import{spawn as g}from"child_process";r(),i(),n(),o(),c();var _=[{name:`iTerm2`,bundleId:`com.googlecode.iterm2`,app:`iTerm`},{name:`Ghostty`,bundleId:`com.mitchellh.ghostty`,app:`Ghostty`},{name:`Kitty`,bundleId:`net.kovidgoyal.kitty`,app:`kitty`},{name:`Alacritty`,bundleId:`org.alacritty`,app:`Alacritty`},{name:`WezTerm`,bundleId:`com.github.wez.wezterm`,app:`WezTerm`},{name:`Terminal.app`,bundleId:`com.apple.Terminal`,app:`Terminal`}],v=[`ghostty`,`kitty`,`alacritty`,`wezterm`,`gnome-terminal`,`konsole`,`xfce4-terminal`,`mate-terminal`,`tilix`,`xterm`];async function y(){let e=a().deepLinkTerminal;if(e){let t=_.find(t=>t.app===e);if(t)return{name:t.name,command:t.app}}let t=process.env.TERM_PROGRAM;if(t){let e=t.replace(/\.app$/i,``).toLowerCase(),n=_.find(t=>t.app.toLowerCase()===e||t.name.toLowerCase()===e);if(n)return{name:n.name,command:n.app}}for(let e of _){let{code:t,stdout:n}=await s(`mdfind`,[`kMDItemCFBundleIdentifier == "${e.bundleId}"`],{timeout:5e3,useCwd:!1});if(t===0&&n.trim().length>0)return{name:e.name,command:e.app}}for(let e of _){let{code:t}=await s(`ls`,[`/Applications/${e.app}.app`],{timeout:1e3,useCwd:!1});if(t===0)return{name:e.name,command:e.app}}return{name:`Terminal.app`,command:`Terminal`}}async function b(){let e=process.env.TERMINAL;if(e){let t=await l(e);if(t)return{name:h(e),command:t}}let t=await l(`x-terminal-emulator`);if(t)return{name:`x-terminal-emulator`,command:t};for(let e of v){let t=await l(e);if(t)return{name:e,command:t}}return null}async function x(){let e=await l(`wt.exe`);if(e)return{name:`Windows Terminal`,command:e};let t=await l(`pwsh.exe`);if(t)return{name:`PowerShell`,command:t};let n=await l(`powershell.exe`);return n?{name:`PowerShell`,command:n}:{name:`Command Prompt`,command:`cmd.exe`}}async function S(){switch(process.platform){case`darwin`:return y();case`linux`:return b();case`win32`:return x();default:return null}}async function C(e,n){let r=await S();if(!r)return t(`No terminal emulator detected`,{level:`error`}),!1;t(`Launching in terminal: ${r.name} (${r.command})`);let i=[`--deep-link-origin`];switch(n.repo&&(i.push(`--deep-link-repo`,n.repo),n.lastFetchMs!==void 0&&i.push(`--deep-link-last-fetch`,String(n.lastFetchMs))),n.query&&i.push(`--prefill`,n.query),process.platform){case`darwin`:return w(r,e,i,n.cwd);case`linux`:return T(r,e,i,n.cwd);case`win32`:return E(r,e,i,n.cwd);default:return!1}}async function w(e,n,r,i){switch(e.command){case`iTerm`:{let{code:e}=await s(`osascript`,[`-e`,`tell application "iTerm"
|
|
2
|
-
if running then
|
|
3
|
-
create window with default profile
|
|
4
|
-
else
|
|
5
|
-
activate
|
|
6
|
-
end if
|
|
7
|
-
tell current session of current window
|
|
8
|
-
write text ${A(O(n,r,i))}
|
|
9
|
-
end tell
|
|
10
|
-
end tell`],{useCwd:!1});if(e===0)return!0;break}case`Terminal`:{let{code:e}=await s(`osascript`,[`-e`,`tell application "Terminal"
|
|
11
|
-
do script ${A(O(n,r,i))}
|
|
12
|
-
activate
|
|
13
|
-
end tell`],{useCwd:!1});return e===0}case`Ghostty`:{let t=[`-na`,e.command,`--args`,`--window-save-state=never`];i&&t.push(`--working-directory=${i}`),t.push(`-e`,n,...r);let{code:a}=await s(`open`,t,{useCwd:!1});if(a===0)return!0;break}case`Alacritty`:{let t=[`-na`,e.command,`--args`];i&&t.push(`--working-directory`,i),t.push(`-e`,n,...r);let{code:a}=await s(`open`,t,{useCwd:!1});if(a===0)return!0;break}case`kitty`:{let t=[`-na`,e.command,`--args`];i&&t.push(`--directory`,i),t.push(n,...r);let{code:a}=await s(`open`,t,{useCwd:!1});if(a===0)return!0;break}case`WezTerm`:{let t=[`-na`,e.command,`--args`,`start`];i&&t.push(`--cwd`,i),t.push(`--`,n,...r);let{code:a}=await s(`open`,t,{useCwd:!1});if(a===0)return!0;break}}return t(`Failed to launch ${e.name}, falling back to Terminal.app`),w({name:`Terminal.app`,command:`Terminal`},n,r,i)}async function T(e,t,n,r){let i,a;switch(e.name){case`gnome-terminal`:i=r?[`--working-directory=${r}`,`--`]:[`--`],i.push(t,...n);break;case`konsole`:i=r?[`--workdir`,r,`-e`]:[`-e`],i.push(t,...n);break;case`kitty`:i=r?[`--directory`,r]:[],i.push(t,...n);break;case`wezterm`:i=r?[`start`,`--cwd`,r,`--`]:[`start`,`--`],i.push(t,...n);break;case`alacritty`:i=r?[`--working-directory`,r,`-e`]:[`-e`],i.push(t,...n);break;case`ghostty`:i=r?[`--working-directory=${r}`,`-e`]:[`-e`],i.push(t,...n);break;case`xfce4-terminal`:case`mate-terminal`:i=r?[`--working-directory=${r}`,`-x`]:[`-x`],i.push(t,...n);break;case`tilix`:i=r?[`--working-directory=${r}`,`-e`]:[`-e`],i.push(t,...n);break;default:i=[`-e`,t,...n],a=r;break}return D(e.command,i,{cwd:a})}async function E(e,t,n,r){let i=[];switch(e.name){case`Windows Terminal`:r&&i.push(`-d`,r),i.push(`--`,t,...n);break;case`PowerShell`:{let e=r?`Set-Location ${j(r)}; `:``;i.push(`-NoExit`,`-Command`,`${e}& ${j(t)} ${n.map(j).join(` `)}`);break}default:{let e=r?`cd /d ${M(r)} && `:``;i.push(`/k`,`${e}${M(t)} ${n.map(e=>M(e)).join(` `)}`);break}}return D(e.command,i,{windowsVerbatimArguments:e.name===`Command Prompt`})}function D(e,n,r={}){return new Promise(i=>{let a=g(e,n,{detached:!0,stdio:`ignore`,cwd:r.cwd,windowsVerbatimArguments:r.windowsVerbatimArguments});a.once(`error`,n=>{t(`Failed to spawn ${e}: ${n.message}`,{level:`error`}),i(!1)}),a.once(`spawn`,()=>{a.unref(),i(!0)})})}function O(e,t,n){return`${n?`cd ${k(n)} && `:``}${[e,...t].map(k).join(` `)}`}function k(e){return`'${e.replace(/'/g,`'\\''`)}'`}function A(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function j(e){return`'${e.replace(/'/g,`''`)}'`}function M(e){return`"${e.replace(/"/g,``).replace(/%/g,`%%`).replace(/(\\+)$/,`$1$1`)}"`}n();async function N(n){t(`Handling deep link URI: ${n}`);let r;try{r=p(n)}catch(e){let t=e instanceof Error?e.message:String(e);return console.error(`Deep link error: ${t}`),1}t(`Parsed deep link action: ${e(r)}`);let{cwd:i,resolvedRepo:a}=await F(r),o=a?await d(i):void 0;return await C(process.execPath,{query:r.query,cwd:i,repo:a,lastFetchMs:o?.getTime()})?0:(console.error(`Failed to open a terminal. Make sure a supported terminal emulator is installed.`),1)}async function P(){if(process.env.__CFBundleIdentifier!==`com.anthropic.claude-code-url-handler`)return null;try{let{waitForUrlEvent:e}=await import(`./urlHandler-DLz3FZm1.js`),t=await e(5e3);return t?await N(t):null}catch{return null}}async function F(e){if(e.cwd)return{cwd:e.cwd};if(e.repo){let n=await f(u(e.repo));if(n[0])return t(`Resolved repo ${e.repo} → ${n[0]}`),{cwd:n[0],resolvedRepo:e.repo};t(`No local clone found for repo ${e.repo}, falling back to home`)}return{cwd:m()}}export{N as handleDeepLinkUri,P as handleUrlSchemeLaunch};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ao as e,lo as t,ro as n,uo as r}from"./loadAgentsDir-B0Anodo0.js";import{It as i,J as a}from"./state-B4jiUise.js";import{I as o,M as s,c,i as l}from"./debug-Bglx1aTu.js";import{Dr as u,Lr as d,_t as f,kn as p,vt as m,wn as h}from"./settings-B2jvL8Dp.js";import{o as g,s as _}from"./log-D2TIwHBV.js";import{Mt as v,jt as y}from"./model-BvQFFOf8.js";import{isAbsolute as b,resolve as x}from"path";y(),i(),l(),o(),h(),d(),g(),t(),f();function S(e,t,n){let r=[],i=[],a=[];for(let[o,s]of Object.entries(e)){let e=t[o],c=w(s.source,n?.projectRoot);e?s.sourceIsFallback||v(c,e.source)?a.push(o):i.push({name:o,declaredSource:c,materializedSource:e.source}):r.push(o)}return{missing:r,sourceChanged:i,upToDate:a}}async function C(t){let i=e();if(Object.keys(i).length===0)return{installed:[],updated:[],failed:[],upToDate:[],skipped:[]};let o;try{o=await r()}catch(e){_(e),o={}}let l=S(i,o,{projectRoot:a()}),u=[...l.missing.map(e=>({name:e,source:w(i[e].source),action:`install`})),...l.sourceChanged.map(({name:e,declaredSource:t})=>({name:e,source:t,action:`update`}))],d=[],f=[];for(let e of u){if(t?.skip?.(e.name,e.source)){d.push(e.name);continue}if(e.action===`update`&&m(e.source)&&!await p(e.source.path)){c(`[reconcile] '${e.name}' declared path does not exist; keeping materialized entry`),d.push(e.name);continue}f.push(e)}if(f.length===0)return{installed:[],updated:[],failed:[],upToDate:l.upToDate,skipped:d};c(`[reconcile] ${f.length} marketplace(s): ${f.map(e=>`${e.name}(${e.action})`).join(`, `)}`);let h=[],g=[],v=[];for(let e=0;e<f.length;e++){let{name:r,source:i,action:a}=f[e];t?.onProgress?.({type:`installing`,name:r,action:a,index:e+1,total:f.length});try{let e=await n(i);a===`install`?h.push(r):g.push(r),t?.onProgress?.({type:`installed`,name:r,alreadyMaterialized:e.alreadyMaterialized})}catch(e){let n=s(e);v.push({name:r,error:n}),t?.onProgress?.({type:`failed`,name:r,error:n}),_(e)}}return{installed:h,updated:g,failed:v,upToDate:l.upToDate,skipped:d}}function w(e,t){if((e.source===`directory`||e.source===`file`)&&!b(e.path)){let n=t??a(),r=u(n);return{...e,path:x(r??n,e.path)}}return e}export{C as n,S as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Fa as t,Fv as n,Go as r,Ia as i,Mo as a,Pv as o,Wo as s,Yf as c,ah as l,ap as u,ep as d,i as f,ih as p,ip as m,jo as h,np as g,o as _,qf as v}from"./loadAgentsDir-B0Anodo0.js";import{It as y,J as b}from"./state-B4jiUise.js";import{I as x,M as S,c as C,i as w}from"./debug-Bglx1aTu.js";import{o as T,s as E}from"./log-D2TIwHBV.js";async function D(e){C(`refreshActivePlugins: clearing all plugin caches`),h(),v();let t=await i(),[r,a]=await Promise.all([s(),f(b())]),{enabled:o,disabled:c,errors:d}=t,[p,m]=await Promise.all([Promise.all(o.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await n(e,d);return t&&(e.mcpServers=t),t?Object.keys(t).length:0})),Promise.all(o.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await u(e,d);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))]),_=p.reduce((e,t)=>e+t,0),y=m.reduce((e,t)=>e+t,0);e(e=>({...e,plugins:{...e.plugins,enabled:o,disabled:c,commands:r,errors:O(e.plugins.errors,d),needsRefresh:!1},agentDefinitions:a,mcp:{...e.mcp,pluginReconnectKey:e.mcp.pluginReconnectKey+1}})),g();let x=!1;try{await l()}catch(e){x=!0,E(e),C(`refreshActivePlugins: loadPluginHooks failed: ${S(e)}`)}let w=o.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 C(`refreshActivePlugins: ${o.length} enabled, ${r.length} commands, ${a.allAgents.length} agents, ${w} hooks, ${_} MCP, ${y} LSP`),{enabled_count:o.length,disabled_count:c.length,command_count:r.length,agent_count:a.allAgents.length,hook_count:w,mcp_count:_,lsp_count:y,error_count:d.length+ +!!x,agentDefinitions:a,pluginCommands:r}}function O(e,t){let n=e.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r=new Set(t.map(k));return[...n.filter(e=>!r.has(k(e))),...t]}function k(e){return e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`}var A=e((()=>{y(),d(),_(),w(),x(),T(),a(),r(),p(),m(),o(),c(),t()}));export{D as n,A as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./envUtils-DfkgIdYf.js";import{I as t,i as n}from"./debug-Bglx1aTu.js";import{h as r,t as i}from"./settings-B2jvL8Dp.js";import{i as a}from"./execFileNoThrow-BTachNBI.js";import{_ as o}from"./stringUtils-C718f5ey.js";import{n as s,t as c}from"./sanitization-DV-94a9Z.js";import*as l from"os";import*as u from"path";import"fs";c();var d=`claude-cli`;function f(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<=31||n===127)return!0}return!1}var p=/^[\w.-]+\/[\w.-]+$/,m=5e3,h=4096;function g(e){let t=e.startsWith(`claude-cli://`)?e:e.startsWith(`claude-cli:`)?e.replace(`${d}:`,`${d}://`):null;if(!t)throw Error(`Invalid deep link: expected ${d}:// scheme, got "${e}"`);let n;try{n=new URL(t)}catch{throw Error(`Invalid deep link URL: "${e}"`)}if(n.hostname!==`open`)throw Error(`Unknown deep link action: "${n.hostname}"`);let r=n.searchParams.get(`cwd`)??void 0,i=n.searchParams.get(`repo`)??void 0,a=n.searchParams.get(`q`);if(r&&!r.startsWith(`/`)&&!/^[a-zA-Z]:[/\\]/.test(r))throw Error(`Invalid cwd in deep link: must be an absolute path, got "${r}"`);if(r&&f(r))throw Error(`Deep link cwd contains disallowed control characters`);if(r&&r.length>h)throw Error(`Deep link cwd exceeds ${h} characters (got ${r.length})`);if(i&&!p.test(i))throw Error(`Invalid repo in deep link: expected "owner/repo", got "${i}"`);let o;if(a&&a.trim().length>0){if(o=s(a.trim()),f(o))throw Error(`Deep link query contains disallowed control characters`);if(o.length>m)throw Error(`Deep link query exceeds ${m} characters (got ${o.length})`)}return{query:o,cwd:r,repo:i}}n(),e(),t(),a(),r(),o();var _=`com.anthropic.claude-code-url-handler`,v=u.join(l.homedir(),`Applications`,`Claude Code URL Handler.app`);u.join(v,`Contents`,`MacOS`,`claude`),`${d}`;async function y(){i().disableDeepLinkRegistration}export{y as n,g as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,o as n}from"./isObject-C6qM3WEW.js";import{BC as r,FC as i,Gw as a,PC as o,VC as s,Ww as c}from"./loadAgentsDir-B0Anodo0.js";import{Jr as ee,Yr as l,ai as u,dr as te,ei as ne,fr as d,hr as f,ii as p,mr as m,oi as re,or as ie,pr as h,si as ae,sr as g,ti as _,ur as v,vr as y,yr as b}from"./state-B4jiUise.js";import{Gn as x,Jn as S,Kn as C,Xn as w,Yn as T,fi as E,pi as D,qn as O}from"./settings-B2jvL8Dp.js";import{M as k,N as A}from"./config-C-Y2qtB2.js";import{n as j,t as M}from"./_baseEach-CsIRoaTH.js";function N(e){return u(e)||l(e)||!!(P&&e&&e[P])}var P,F=e((()=>{n(),ee(),p(),P=t?t.isConcatSpreadable:void 0}));function I(e,t,n,r,i){var a=-1,o=e.length;for(n||(n=N),i||(i=[]);++a<o;){var s=e[a];t>0&&n(s)?t>1?I(s,t-1,n,r,i):re(i,s):r||(i[i.length]=s)}return i}var L=e((()=>{ae(),F()}));function R(e){return e!=null&&e.length?I(e,1):[]}var z=e((()=>{L()}));function B(e){return C(S(e,void 0,R),e+``)}var V=e((()=>{z(),O(),x()}));function H(e,t){var n=[];return M(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}var U=e((()=>{j()}));function W(e,t){return t.length<2?e:v(e,r(t,0,-1))}var G=e((()=>{te(),s()}));function K(e){if(typeof e!=`function`)throw TypeError(q);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}var q,J=e((()=>{q=`Expected a function`}));function oe(e,t){t=m(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var a=h(t[n]);if(a===`__proto__`&&!Y.call(e,`__proto__`)||(a===`constructor`||a===`prototype`)&&n<r-1)return!1}var o=W(e,t);return o==null||delete o[h(i(t))]}var Y,se=e((()=>{f(),o(),G(),d(),Y=Object.prototype.hasOwnProperty}));function ce(e){return w(e)?void 0:e}var le=e((()=>{T()})),X,Z,Q,$,ue=e((()=>{b(),a(),se(),f(),D(),le(),V(),A(),X=1,Z=2,Q=4,$=B(function(e,t){var n={};if(e==null)return n;var r=!1;t=y(t,function(t){return t=m(t,e),r||(r=t.length>1),t}),E(e,k(e),n),r&&(n=c(n,X|Z|Q,ce));for(var i=t.length;i--;)oe(n,t[i]);return n})}));function de(e,t){return(u(e)?ne:H)(e,K(ie(t,3)))}var fe=e((()=>{_(),U(),g(),p(),J()}));export{$ as i,de as n,ue as r,fe as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Qr as t,Qx as n,Yi as r,_r as i,pr as a,ti as o}from"./loadAgentsDir-B0Anodo0.js";import{It as s,st as c}from"./state-B4jiUise.js";import{n as l,t as u}from"./generateSessionName-CQ03xlYI.js";async function d(e,r,i){let s;if(!i||i.trim()===``){let t=await u(n(r.messages),r.abortController.signal);if(!t)return e(`Could not generate a name: no conversation context yet. Usage: /rename <name>`,{display:`system`}),null;s=t}else s=i.trim();let l=c(),d=a();return await o(l,s,d),await t(l,s,d),r.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:s}})),e(`Session renamed to: ${s}`,{display:`system`}),null}e((()=>{s(),r(),i(),l()}))();export{d as call};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{Er as i,Id as a,Ld as o,_r as s,bb as c,bi as l,jr as u,kr as d,nb as f,rb as p,rr as m,si as h,ur as g,xi as _,xr as v,yr as y}from"./loadAgentsDir-B0Anodo0.js";import{I as b,P as x,ai as S,di as C,dr as w,fi as T,ot as E,t as D}from"./src-DL3w8VPk.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{It as k,J as A,st as j}from"./state-B4jiUise.js";import{o as M,s as N}from"./log-D2TIwHBV.js";import{r as P,t as F}from"./Spinner-ByQXTvAA.js";import{n as I,r as L}from"./modalContext-DDZdU1J8.js";import{a as R,i as z,n as B,o as V,r as H,t as U}from"./crossProjectResume-DxMy05_P.js";function W(e){switch(e.resultType){case`sessionNotFound`:return`Session ${C.bold(e.arg)} was not found. Run ${C.bold(`/resume`)} without arguments to browse all sessions.`;case`multipleMatches`:return`Found ${e.count} sessions matching ${C.bold(e.arg)}. Run ${C.bold(`/resume`)} to pick one from the list.`}}function G({message:e,args:t,onDone:n}){return J.useEffect(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,Y.jsxs)(b,{flexDirection:`column`,children:[(0,Y.jsxs)(x,{dimColor:!0,children:[r.pointer,` /resume `,t]}),(0,Y.jsx)(f,{children:(0,Y.jsx)(x,{children:e})})]})}function K({onDone:e,onResume:t}){let[n,r]=J.useState([]),[a,s]=J.useState([]),[c,f]=J.useState(!0),[p,m]=J.useState(!1),[h,_]=J.useState(!1),{rows:y}=E(),S=L(),C=J.useCallback(async(t,n)=>{f(!0);try{let a=q(t?await i():await u(n),j());if(a.length===0){e(`No conversations found to resume`);return}r(a)}catch{e(`Failed to load conversations`)}finally{f(!1)}},[e]);J.useEffect(()=>{async function e(){let e=await l(A());s(e),C(!1,e)}e()},[C]);let T=J.useCallback(()=>{let e=!h;_(e),C(e,a)},[h,C,a]);async function D(n){let r=o(g(n));if(!r){e(`Failed to resume conversation`);return}let i=v(n)?await d(n):n,a=U(i,h);if(a.isCrossProject){if(a.isSameRepoWorktree){m(!0),t(r,i,`slash_command_picker`);return}let n=await w(a.command);n&&process.stdout.write(n),e([``,`This conversation is from a different directory.`,``,`To resume, run:`,` ${a.command}`,``,`(Command copied to clipboard)`,``].join(`
|
|
2
|
-
`),{display:`user`});return}m(!0),t(r,i,`slash_command_picker`)}function O(){e(`Resume cancelled`,{display:`system`})}return c?(0,Y.jsxs)(b,{children:[(0,Y.jsx)(F,{}),(0,Y.jsx)(x,{children:` Loading conversations…`})]}):p?(0,Y.jsxs)(b,{children:[(0,Y.jsx)(F,{}),(0,Y.jsx)(x,{children:` Resuming conversation…`})]}):(0,Y.jsx)(R,{logs:n,maxHeight:S?Math.floor(y/2):y-2,onCancel:O,onSelect:D,onLogsChanged:()=>C(h,a),showAllProjects:h,onToggleAllProjects:T,onAgenticSearch:H})}function q(e,t){return e.filter(e=>!e.isSidechain&&g(e)!==t)}var J,Y,X;e((()=>{T(),n(),J=t(S(),1),k(),V(),p(),P(),I(),c(),D(),z(),B(),_(),M(),s(),a(),Y=O(),X=async(e,t,n)=>{let r=async(n,r,i)=>{try{await t.resume?.(n,r,i),e(void 0,{display:`skip`})}catch(t){N(t),e(`Failed to resume: ${t.message}`)}},i=n?.trim();if(!i)return(0,Y.jsx)(K,{onDone:e,onResume:r},Date.now());let a=await u(await l(A()));if(a.length===0){let t=`No conversations found to resume.`;return(0,Y.jsx)(G,{message:t,args:i,onDone:()=>e(t)})}let s=o(i);if(s){let e=a.filter(e=>g(e)===s).sort((e,t)=>t.modified.getTime()-e.modified.getTime());if(e.length>0){let t=e[0];return r(s,v(t)?await d(t):t,`slash_command_session_id`),null}let t=await m(s);if(t)return r(s,t,`slash_command_session_id`),null}if(y()){let t=await h(i,{exact:!0});if(t.length===1){let e=t[0],n=g(e);if(n)return r(n,v(e)?await d(e):e,`slash_command_title`),null}if(t.length>1){let n=W({resultType:`multipleMatches`,arg:i,count:t.length});return(0,Y.jsx)(G,{message:n,args:i,onDone:()=>e(n)})}}let c=W({resultType:`sessionNotFound`,arg:i});return(0,Y.jsx)(G,{message:c,args:i,onDone:()=>e(c)})}}))();export{X as call,q as filterResumableSessions};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t}from"./ripgrep-Dl3y5r4m.js";e();export{t as getRipgrepStatus};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{c as r,o as i}from"./envUtils-DfkgIdYf.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{c as s,i as c}from"./debug-Bglx1aTu.js";import{i as l,t as u}from"./execFileNoThrow-BTachNBI.js";import{o as d,s as f}from"./log-D2TIwHBV.js";import{f as p,h as m,m as h,o as g,p as _,r as v}from"./stringUtils-C718f5ey.js";import{i as y,o as b}from"./platform-BacQ6ACS.js";import{n as x,r as S}from"./analytics-DJobLaWP.js";import{homedir as C}from"os";import*as w from"path";import{existsSync as T}from"fs";import{execFile as E,spawn as D}from"child_process";import{fileURLToPath as O}from"url";var k,A,j,M=e((()=>{k=O(import.meta.url),A=w.dirname(k),j=(()=>{let e=A.split(w.sep),t=e.lastIndexOf(`dist`);if(t!==-1)return e.slice(0,t+1).join(w.sep);let n=e.lastIndexOf(`src`);return n===-1?A:e.slice(0,n).join(w.sep)})()}));function N(e,t,n){let r=n??process.platform;return T(e)?{mode:`builtin`,command:e,args:[]}:(t===void 0?p(`rg`,[]).cmd:t??`rg`)===`rg`?{mode:`builtin`,command:e,args:[],note:`no ripgrep available on ${r}; install ripgrep via apt/pkg/brew`}:{mode:`system`,command:`rg`,args:[]}}function P(){let e=H();return{rgPath:e.command,rgArgs:e.args,argv0:e.argv0}}function F(e){return e.includes(`os error 11`)||e.includes(`Resource temporarily unavailable`)}function I(e,t,n,r,i=!1){let{rgPath:a,rgArgs:o,argv0:s}=P(),c=i?[`-j`,`1`]:[],l=[...o,...c,...e,t],u=y()===`wsl`?6e4:2e4,d=parseInt(process.env.CLAUDE_CODE_GLOB_TIMEOUT_SECONDS||``,10)||0,f=d>0?d*1e3:u;if(s){let e=D(a,l,{argv0:s,signal:n,windowsHide:!0}),t=``,i=``,o=!1,c=!1;e.stdout?.on(`data`,e=>{o||(t+=e.toString(),t.length>U&&(t=t.slice(0,U),o=!0))}),e.stderr?.on(`data`,e=>{c||(i+=e.toString(),i.length>U&&(i=i.slice(0,U),c=!0))});let u,d=setTimeout(()=>{process.platform===`win32`?e.kill():(e.kill(`SIGTERM`),u=setTimeout(e=>e.kill(`SIGKILL`),5e3,e))},f),p=!1;return e.on(`close`,(e,n)=>{if(!p)if(p=!0,clearTimeout(d),clearTimeout(u),e===0||e===1)r(null,t,i);else{let a=Error(`ripgrep exited with code ${e}`);a.code=e??void 0,a.signal=n??void 0,r(a,t,i)}}),e.on(`error`,e=>{p||(p=!0,clearTimeout(d),clearTimeout(u),r(e,t,i))}),e}return E(a,l,{maxBuffer:U,signal:n,timeout:f,killSignal:process.platform===`win32`?void 0:`SIGKILL`},r)}async function L(e,t,n){await B();let{rgPath:r,rgArgs:i,argv0:a}=P();return new Promise((o,s)=>{let c=D(r,[...i,...e,t],{argv0:a,signal:n,windowsHide:!0,stdio:[`ignore`,`pipe`,`ignore`]}),l=0;c.stdout?.on(`data`,e=>{l+=v(e,`
|
|
2
|
-
`)});let u=!1;c.on(`close`,e=>{u||(u=!0,e===0||e===1?o(l):s(Error(`rg --files exited ${e}`)))}),c.on(`error`,e=>{u||(u=!0,s(e))})})}async function R(e,t,n){return await B(),q().catch(e=>{f(e)}),new Promise((r,i)=>{let a=(o,c,l,u)=>{if(!o){r(c.trim().split(`
|
|
3
|
-
`).map(e=>e.replace(/\r$/,``)).filter(Boolean));return}if(o.code===1){r([]);return}if([`ENOENT`,`EACCES`,`EPERM`].includes(o.code)){i(o);return}if(!u&&F(l)){s(`rg EAGAIN error detected, retrying with single-threaded mode (-j 1)`),S(`tengu_ripgrep_eagain_retry`,{}),I(e,t,n,(e,t,n)=>{a(e,t,n,!0)},!0);return}let d=c&&c.trim().length>0,p=o.signal===`SIGTERM`||o.signal===`SIGKILL`||o.code===`ABORT_ERR`,m=o.code===`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`,h=[];if(d&&(h=c.trim().split(`
|
|
4
|
-
`).map(e=>e.replace(/\r$/,``)).filter(Boolean),h.length>0&&(p||m)&&(h=h.slice(0,-1))),s(`rg error (signal=${o.signal}, code=${o.code}, stderr: ${l}), ${h.length} results`),o.code!==2&&o.code!==`ABORT_ERR`&&f(o),p&&h.length===0){i(new W(`Ripgrep search timed out after ${y()===`wsl`?60:20} seconds. The search may have matched files but did not complete in time. Try searching a more specific path or pattern.`,h));return}r(h)};I(e,t,n,(e,t,n)=>{a(e,t,n,!1)})})}function z(){let e=H();return{mode:e.mode,path:e.command,working:K?.working??null,note:K?.note??e.note}}async function B(){if(process.platform!==`darwin`||J)return;J=!0;let e=H();if(e.mode!==`builtin`)return;let t=e.command;if((await u(`codesign`,[`-vv`,`-d`,t],{preserveOutputOnError:!1})).stdout.split(`
|
|
5
|
-
`).find(e=>e.includes(`linker-signed`)))try{let e=await u(`codesign`,[`--sign`,`-`,`--force`,`--preserve-metadata=entitlements,requirements,flags,runtime`,t]);e.code!==0&&f(Error(`Failed to sign ripgrep: ${e.stdout} ${e.stderr}`));let n=await u(`xattr`,[`-d`,`com.apple.quarantine`,t]);n.code!==0&&f(Error(`Failed to remove quarantine: ${n.stdout} ${n.stderr}`))}catch(e){f(e)}}var V,H,U,W,G,K,q,J,Y=e((()=>{n(),x(),h(),c(),M(),i(),l(),_(),d(),b(),g(),a(),V=j,H=t(()=>{if(r(process.env.USE_BUILTIN_RIPGREP)){let{cmd:e}=p(`rg`,[]);if(e!==`rg`)return{mode:`system`,command:`rg`,args:[]}}if(m())return{mode:`embedded`,command:process.execPath,args:[`--no-config`],argv0:`rg`};let e=w.resolve(V,`vendor`,`ripgrep`);return N(process.platform===`win32`?w.resolve(e,`${process.arch}-win32`,`rg.exe`):w.resolve(e,`${process.arch}-${process.platform}`,`rg`))}),U=2e7,W=class extends Error{constructor(e,t){super(e),o(this,`partialResults`,void 0),this.partialResults=t,this.name=`RipgrepTimeoutError`}},G=t(async(e,t,n=[])=>{if(w.resolve(e)!==w.resolve(C()))try{let r=[`--files`,`--hidden`];n.forEach(e=>{r.push(`--glob`,`!${e}`)});let i=await L(r,e,t);if(i===0)return 0;let a=10**Math.floor(Math.log10(i));return Math.round(i/a)*a}catch(e){e?.name!==`AbortError`&&f(e)}},(e,t,n=[])=>`${e}|${n.join(`,`)}`),K=null,q=t(async()=>{if(K!==null)return;let e=H();try{let t;if(e.argv0){let n=Bun.spawn([e.command,`--version`],{argv0:e.argv0,stderr:`ignore`,stdout:`pipe`}),[r,i]=await Promise.all([n.stdout.text(),n.exited]);t={code:i,stdout:r}}else t=await u(e.command,[...e.args,`--version`],{timeout:5e3});let n=t.code===0&&!!t.stdout&&t.stdout.startsWith(`ripgrep `);K={working:n,lastTested:Date.now(),config:e,note:e.note},s(`Ripgrep first use test: ${n?`PASSED`:`FAILED`} (mode=${e.mode}, path=${e.command})`),S(`tengu_ripgrep_availability`,{working:+!!n,using_system:+(e.mode===`system`)})}catch(t){K={working:!1,lastTested:Date.now(),config:e,note:e.note},f(t)}}),J=!1}));export{Y as a,P as c,z as i,G as n,N as o,H as r,R as s,W as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{gC as e,yC as t}from"./loadAgentsDir-B0Anodo0.js";t();export{e as SandboxManager};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{SC as t,_C as n,gC as r,mb as i,yC as a}from"./loadAgentsDir-B0Anodo0.js";import{Gt as o,H as s,I as c,Lt as l,P as u,a as d,j as f,n as p,r as m,t as h,x as g}from"./src-DL3w8VPk.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{E as v,It as y}from"./state-B4jiUise.js";import{d as b,h as x,o as S}from"./settings-B2jvL8Dp.js";import{i as C,o as w}from"./platform-BacQ6ACS.js";import{n as T,t as E}from"./select-DIxfl_VN.js";import{relative as D}from"path";function O(){let e=r.isSandboxingEnabled(),n=r.checkDependencies(),i=n.warnings.length>0?(0,k.jsx)(c,{marginTop:1,flexDirection:`column`,children:n.warnings.map((e,t)=>(0,k.jsx)(u,{dimColor:!0,children:e},t))}):null;if(!e)return(0,k.jsxs)(c,{flexDirection:`column`,paddingY:1,children:[(0,k.jsx)(u,{color:`subtle`,children:`Sandbox is not enabled`}),i]});let a=r.getFsReadConfig(),o=r.getFsWriteConfig(),s=r.getNetworkRestrictionConfig(),l=r.getAllowUnixSockets(),d=r.getExcludedCommands(),f=r.getLinuxGlobPatternWarnings();return(0,k.jsxs)(c,{flexDirection:`column`,paddingY:1,children:[(0,k.jsxs)(c,{flexDirection:`column`,children:[(0,k.jsx)(u,{bold:!0,color:`permission`,children:`Excluded Commands:`}),(0,k.jsx)(u,{dimColor:!0,children:d.length>0?d.join(`, `):`None`})]}),a.denyOnly.length>0&&(0,k.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(u,{bold:!0,color:`permission`,children:`Filesystem Read Restrictions:`}),(0,k.jsxs)(u,{dimColor:!0,children:[`Denied: `,a.denyOnly.join(`, `)]}),a.allowWithinDeny&&a.allowWithinDeny.length>0&&(0,k.jsxs)(u,{dimColor:!0,children:[`Allowed within denied: `,a.allowWithinDeny.join(`, `)]})]}),o.allowOnly.length>0&&(0,k.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(u,{bold:!0,color:`permission`,children:`Filesystem Write Restrictions:`}),(0,k.jsxs)(u,{dimColor:!0,children:[`Allowed: `,o.allowOnly.join(`, `)]}),o.denyWithinAllow.length>0&&(0,k.jsxs)(u,{dimColor:!0,children:[`Denied within allowed: `,o.denyWithinAllow.join(`, `)]})]}),(s.allowedHosts&&s.allowedHosts.length>0||s.deniedHosts&&s.deniedHosts.length>0)&&(0,k.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,k.jsxs)(u,{bold:!0,color:`permission`,children:[`Network Restrictions`,t()?` (Managed)`:``,`:`]}),s.allowedHosts&&s.allowedHosts.length>0&&(0,k.jsxs)(u,{dimColor:!0,children:[`Allowed: `,s.allowedHosts.join(`, `)]}),s.deniedHosts&&s.deniedHosts.length>0&&(0,k.jsxs)(u,{dimColor:!0,children:[`Denied: `,s.deniedHosts.join(`, `)]})]}),l&&l.length>0&&(0,k.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(u,{bold:!0,color:`permission`,children:`Allowed Unix Sockets:`}),(0,k.jsx)(u,{dimColor:!0,children:l.join(`, `)})]}),f.length>0&&(0,k.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(u,{bold:!0,color:`warning`,children:`⚠ Warning: Glob patterns not fully supported on Linux`}),(0,k.jsxs)(u,{dimColor:!0,children:[`The following patterns will be ignored: `,f.slice(0,3).join(`, `),f.length>3&&` (${f.length-3} more)`]})]}),i]})}var k,A=e((()=>{h(),a(),k=_()}));function j({depCheck:e}){let t=C()===`macos`,n=e.errors.some(e=>e.includes(`ripgrep`)),r=e.errors.some(e=>e.includes(`bwrap`)),i=e.errors.some(e=>e.includes(`socat`)),a=e.warnings.length>0,o=e.errors.filter(e=>!e.includes(`ripgrep`)&&!e.includes(`bwrap`)&&!e.includes(`socat`));return(0,M.jsxs)(c,{flexDirection:`column`,paddingY:1,gap:1,children:[t&&(0,M.jsx)(c,{flexDirection:`column`,children:(0,M.jsxs)(u,{children:[`seatbelt: `,(0,M.jsx)(u,{color:`success`,children:`built-in (macOS)`})]})}),(0,M.jsxs)(c,{flexDirection:`column`,children:[(0,M.jsxs)(u,{children:[`ripgrep (rg): `,n?(0,M.jsx)(u,{color:`error`,children:`not found`}):(0,M.jsx)(u,{color:`success`,children:`found`})]}),n&&(0,M.jsxs)(u,{dimColor:!0,children:[` `,`· `,t?`brew install ripgrep`:`apt install ripgrep`]})]}),!t&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(c,{flexDirection:`column`,children:[(0,M.jsxs)(u,{children:[`bubblewrap (bwrap):`,` `,r?(0,M.jsx)(u,{color:`error`,children:`not installed`}):(0,M.jsx)(u,{color:`success`,children:`installed`})]}),r&&(0,M.jsxs)(u,{dimColor:!0,children:[` `,`· apt install bubblewrap`]})]}),(0,M.jsxs)(c,{flexDirection:`column`,children:[(0,M.jsxs)(u,{children:[`socat: `,i?(0,M.jsx)(u,{color:`error`,children:`not installed`}):(0,M.jsx)(u,{color:`success`,children:`installed`})]}),i&&(0,M.jsxs)(u,{dimColor:!0,children:[` `,`· apt install socat`]})]}),(0,M.jsxs)(c,{flexDirection:`column`,children:[(0,M.jsxs)(u,{children:[`seccomp filter:`,` `,a?(0,M.jsx)(u,{color:`warning`,children:`not installed`}):(0,M.jsx)(u,{color:`success`,children:`installed`}),a&&(0,M.jsx)(u,{dimColor:!0,children:` (required to block unix domain sockets)`})]}),a&&(0,M.jsxs)(c,{flexDirection:`column`,children:[(0,M.jsxs)(u,{dimColor:!0,children:[` `,`· npm install -g @anthropic-ai/sandbox-runtime`]}),(0,M.jsxs)(u,{dimColor:!0,children:[` `,`· or copy vendor/seccomp/* from sandbox-runtime and set`]}),(0,M.jsxs)(u,{dimColor:!0,children:[` `,`sandbox.seccomp.bpfPath and applyPath in settings.json`]})]})]})]}),o.map(e=>(0,M.jsx)(u,{color:`error`,children:e},e))]})}var M,N=e((()=>{h(),w(),M=_()}));function P({onComplete:e}){let t=r.isSandboxingEnabled(),n=r.areSandboxSettingsLockedByPolicy(),i=r.areUnsandboxedCommandsAllowed();return t?n?(0,I.jsxs)(c,{flexDirection:`column`,paddingY:1,children:[(0,I.jsx)(u,{color:`subtle`,children:`Override settings are managed by a higher-priority configuration and cannot be changed locally.`}),(0,I.jsx)(c,{marginTop:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Current setting: `,i?`Allow unsandboxed fallback`:`Strict sandbox mode`]})})]}):(0,I.jsx)(F,{onComplete:e,currentMode:i?`open`:`closed`}):(0,I.jsx)(c,{flexDirection:`column`,paddingY:1,children:(0,I.jsx)(u,{color:`subtle`,children:`Sandbox is not enabled. Enable sandbox to configure override settings.`})})}function F({onComplete:e,currentMode:t}){let[n]=s(),{headerFocused:i,focusHeader:a}=d(),o=f(`success`,n)(`(current)`),p=[{label:t===`open`?`Allow unsandboxed fallback ${o}`:`Allow unsandboxed fallback`,value:`open`},{label:t===`closed`?`Strict sandbox mode ${o}`:`Strict sandbox mode`,value:`closed`}];async function m(t){let n=t;await r.setSandboxSettings({allowUnsandboxedCommands:n===`open`}),e(n===`open`?`✓ Unsandboxed fallback allowed - commands can run outside sandbox when necessary`:"✓ Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}return(0,I.jsxs)(c,{flexDirection:`column`,paddingY:1,children:[(0,I.jsx)(c,{marginBottom:1,children:(0,I.jsx)(u,{bold:!0,children:`Configure Overrides:`})}),(0,I.jsx)(E,{options:p,onChange:m,onCancel:()=>e(void 0,{display:`skip`}),onUpFromFirstItem:a,isDisabled:i}),(0,I.jsxs)(c,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,I.jsxs)(u,{dimColor:!0,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:`Allow unsandboxed fallback:`}),` `,`When a command fails due to sandbox restrictions, Work Mate can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions).`]}),(0,I.jsxs)(u,{dimColor:!0,children:[(0,I.jsx)(u,{bold:!0,dimColor:!0,children:`Strict sandbox mode:`}),` `,`All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands.`]}),(0,I.jsxs)(u,{dimColor:!0,children:[`Learn more:`,` `,(0,I.jsx)(l,{url:`https://code.workmate.com/docs/en/sandboxing#configure-sandboxing`,children:`code.workmate.com/docs/en/sandboxing#configure-sandboxing`})]})]})]})}var I,L=e((()=>{h(),a(),T(),I=_()}));function R({onComplete:e,depCheck:t}){let[n]=s(),i=r.isSandboxingEnabled(),a=r.isAutoAllowBashIfSandboxedEnabled(),c=t.warnings.length>0,l=b().sandbox?.network?.allowAllUnixSockets,u=c&&!l,d=i?a?`auto-allow`:`regular`:`disabled`,h=f(`success`,n)(`(current)`),_=[{label:d===`auto-allow`?`Sandbox BashTool, with auto-allow ${h}`:`Sandbox BashTool, with auto-allow`,value:`auto-allow`},{label:d===`regular`?`Sandbox BashTool, with regular permissions ${h}`:`Sandbox BashTool, with regular permissions`,value:`regular`},{label:d===`disabled`?`No Sandbox ${h}`:`No Sandbox`,value:`disabled`}];async function v(t){switch(t){case`auto-allow`:await r.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),e(`✓ Sandbox enabled with auto-allow for bash commands`);break;case`regular`:await r.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),e(`✓ Sandbox enabled with regular bash permissions`);break;case`disabled`:await r.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),e(`○ Sandbox disabled`);break}}o({"confirm:no":()=>e(void 0,{display:`skip`})},{context:`Settings`});let y=(0,B.jsx)(p,{title:`Mode`,children:(0,B.jsx)(z,{showSocketWarning:u,options:_,onSelect:v,onComplete:e})},`mode`),x=(0,B.jsx)(p,{title:`Overrides`,children:(0,B.jsx)(P,{onComplete:e})},`overrides`),S=(0,B.jsx)(p,{title:`Config`,children:(0,B.jsx)(O,{})},`config`);return(0,B.jsx)(g,{color:`permission`,children:(0,B.jsx)(m,{title:`Sandbox:`,color:`permission`,defaultTab:`Mode`,children:t.errors.length>0?[(0,B.jsx)(p,{title:`Dependencies`,children:(0,B.jsx)(j,{depCheck:t})},`dependencies`)]:[y,...c?[(0,B.jsx)(p,{title:`Dependencies`,children:(0,B.jsx)(j,{depCheck:t})},`dependencies`)]:[],x,S]})})}function z({showSocketWarning:e,options:t,onSelect:n,onComplete:r}){let{headerFocused:i,focusHeader:a}=d();return(0,B.jsxs)(c,{flexDirection:`column`,paddingY:1,children:[e&&(0,B.jsx)(c,{marginBottom:1,children:(0,B.jsx)(u,{color:`warning`,children:`Cannot block unix domain sockets (see Dependencies tab)`})}),(0,B.jsx)(c,{marginBottom:1,children:(0,B.jsx)(u,{bold:!0,children:`Configure Mode:`})}),(0,B.jsx)(E,{options:t,onChange:n,onCancel:()=>r(void 0,{display:`skip`}),onUpFromFirstItem:a,isDisabled:i}),(0,B.jsxs)(c,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,B.jsxs)(u,{dimColor:!0,children:[(0,B.jsx)(u,{bold:!0,dimColor:!0,children:`Auto-allow mode:`}),` `,`Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected.`]}),(0,B.jsxs)(u,{dimColor:!0,children:[`Learn more:`,` `,(0,B.jsx)(l,{url:`https://code.workmate.com/docs/en/sandboxing`,children:`code.workmate.com/docs/en/sandboxing`})]})]})]})}var B,V=e((()=>{h(),i(),a(),x(),T(),A(),N(),L(),B=_()}));async function H(e,t,i){let a=b().theme||`light`,o=C();if(!r.isSupportedPlatform()){let t=o===`wsl`?`Error: Sandboxing requires WSL2. WSL1 is not supported.`:`Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.`;return e(f(`error`,a)(t)),null}let s=r.checkDependencies();if(!r.isPlatformInEnabledList())return e(f(`error`,a)(`Error: Sandboxing is disabled for this platform (${o}) via the enabledPlatforms setting.`)),null;if(r.areSandboxSettingsLockedByPolicy())return e(f(`error`,a)(`Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.`)),null;let c=i?.trim()||``;if(!c)return(0,U.jsx)(R,{onComplete:e,depCheck:s});if(c){let t=c.split(` `)[0];if(t===`exclude`){let t=c.slice(8).trim();if(!t)return e(f(`error`,a)(`Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")`)),null;let r=t.replace(/^["']|["']$/g,``);n(r);let i=S(`localSettings`),o=i?D(v(),i):`.workmate/settings.local.json`;return e(f(`success`,a)(`Added "${r}" to excluded commands in ${o}`)),null}else return e(f(`error`,a)(`Error: Unknown subcommand "${t}". Available subcommand: exclude`)),null}return null}var U;e((()=>{y(),V(),h(),w(),a(),x(),U=_()}))();export{H as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_h as e,yh as t}from"./loadAgentsDir-B0Anodo0.js";e();export{t as isSearchExtraToolsEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{mb as i}from"./loadAgentsDir-B0Anodo0.js";import{Ft as a,G as o,Gr as s,Gt as c,I as l,P as u,ai as d,hn as f,t as p}from"./src-DL3w8VPk.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{Hn as h,Vn as g}from"./settings-B2jvL8Dp.js";import{c as _,o as v,s as y}from"./stringUtils-C718f5ey.js";import{a as b,i as x,n as S,o as C,r as w,t as T}from"./use-select-navigation-hWL5VHnL.js";import{i as E,t as D}from"./overlayContext-8--_fbvY.js";var O,k,A=e((()=>{O=t(d(),1),D(),p(),i(),v(),k=({isDisabled:e=!1,disableSelection:t=!1,state:n,options:r,isMultiSelect:i=!1,onUpFromFirstItem:a,onDownFromLastItem:o,onInputModeToggle:s,inputValues:l,imagesSelected:u=!1,onEnterImageSelection:d})=>{E(`select`,!!n.onCancel);let p=(0,O.useMemo)(()=>r.find(e=>e.value===n.focusedValue)?.type===`input`,[r,n.focusedValue]);c((0,O.useMemo)(()=>{let e={};return p||(e[`select:next`]=()=>{if(o){let e=r[r.length-1];if(e&&n.focusedValue===e.value){o();return}}n.focusNextOption()},e[`select:previous`]=()=>{if(a&&n.visibleFromIndex===0){let e=r[0];if(e&&n.focusedValue===e.value){a();return}}n.focusPreviousOption()},e[`select:accept`]=()=>{t!==!0&&n.focusedValue!==void 0&&r.find(e=>e.value===n.focusedValue)?.disabled!==!0&&(n.selectFocusedOption?.(),n.onChange?.(n.focusedValue))}),n.onCancel&&(e[`select:cancel`]=()=>{n.onCancel()}),e},[r,n,o,a,p,t]),{context:`Select`,isActive:!e}),f((e,c,f)=>{let p=y(e),m=r.find(e=>e.value===n.focusedValue),h=m?.type===`input`;if(c.tab&&s&&n.focusedValue!==void 0){s(n.focusedValue);return}if(h){if(u)return;if(c.downArrow&&d?.()){f.stopImmediatePropagation();return}if(c.downArrow||c.ctrl&&e===`n`){if(o){let e=r[r.length-1];if(e&&n.focusedValue===e.value){o(),f.stopImmediatePropagation();return}}n.focusNextOption(),f.stopImmediatePropagation();return}if(c.upArrow||c.ctrl&&e===`p`){if(a&&n.visibleFromIndex===0){let e=r[0];if(e&&n.focusedValue===e.value){a(),f.stopImmediatePropagation();return}}n.focusPreviousOption(),f.stopImmediatePropagation();return}return}if(c.pageDown&&n.focusNextPage(),c.pageUp&&n.focusPreviousPage(),t!==!0&&(i&&_(e)===` `&&n.focusedValue!==void 0&&m?.disabled!==!0&&(n.selectFocusedOption?.(),n.onChange?.(n.focusedValue)),t!==`numeric`&&/^[0-9]+$/.test(p))){let e=parseInt(p,10)-1;if(e>=0&&e<n.options.length){let t=n.options[e];if(t.disabled===!0)return;if(t.type===`input`){if((l?.get(t.value)??``).trim()){n.onChange?.(t.value);return}if(t.allowEmptySubmitToCancel){n.onChange?.(t.value);return}n.focusOption(t.value);return}n.onChange?.(t.value);return}}},{isActive:!e})}}));function j({visibleOptionCount:e=5,options:t,defaultValue:n,onChange:r,onCancel:i,onFocus:a,focusValue:o}){let[s,c]=(0,M.useState)(n),l=S({visibleOptionCount:e,options:t,initialFocusValue:void 0,onFocus:a,focusValue:o}),u=(0,M.useCallback)(()=>{c(l.focusedValue)},[l.focusedValue]);return{...l,value:s,selectFocusedOption:u,onChange:r,onCancel:i}}var M,N=e((()=>{M=t(d(),1),T()}));function P(e){return typeof e==`string`?e:typeof e==`number`?String(e):e?Array.isArray(e)?e.map(P).join(``):L.isValidElement(e)?P(e.props.children):``:``}function F({isDisabled:e=!1,hideIndexes:t=!1,visibleOptionCount:n=5,highlightText:i,options:o,defaultValue:c,onCancel:d,onChange:f,onFocus:p,defaultFocusValue:m,layout:h=`compact`,disableSelection:_=!1,inlineDescriptions:v=!1,onUpFromFirstItem:y,onDownFromLastItem:x,onInputModeToggle:S,onOpenEditor:C,onImagePaste:T,pastedContents:E,onRemoveImage:D}){let[O,A]=(0,L.useState)(!1),[M,N]=(0,L.useState)(0),[F,z]=(0,L.useState)(()=>{let e=new Map;return o.forEach(t=>{t.type===`input`&&t.initialValue&&e.set(t.value,t.initialValue)}),e}),B=(0,L.useRef)(new Map);(0,L.useEffect)(()=>{for(let e of o)if(e.type===`input`&&e.initialValue!==void 0){let t=B.current.get(e.value)??``,n=F.get(e.value)??``,r=e.initialValue;r!==t&&n===t&&z(t=>{let n=new Map(t);return n.set(e.value,r),n}),B.current.set(e.value,r)}},[o,F]);let V=j({visibleOptionCount:n,options:o,defaultValue:c,onChange:f,onCancel:d,onFocus:p,focusValue:m});k({isDisabled:e,disableSelection:_||(t?`numeric`:!1),state:V,options:o,isMultiSelect:!1,onUpFromFirstItem:y,onDownFromLastItem:x,onInputModeToggle:S,inputValues:F,imagesSelected:O,onEnterImageSelection:()=>{if(E&&Object.values(E).some(e=>e.type===`image`)){let e=g(Object.values(E),e=>e.type===`image`);return A(!0),N(e-1),!0}return!1}});let H={container:()=>({flexDirection:`column`}),highlightedText:()=>({bold:!0})};if(h===`expanded`){let t=V.options.length.toString().length;return(0,R.jsx)(l,{...H.container(),children:V.visibleOptions.map((n,r)=>{let s=n.index===V.visibleFromIndex,c=n.index===V.visibleToIndex-1,p=V.visibleToIndex<o.length,m=V.visibleFromIndex>0,h=V.visibleFromIndex+r+1,g=!e&&V.focusedValue===n.value,_=V.value===n.value;if(n.type===`input`){let e=F.has(n.value)?F.get(n.value):n.initialValue||``;return(0,R.jsx)(w,{option:n,isFocused:g,isSelected:_,shouldShowDownArrow:p&&c,shouldShowUpArrow:m&&s,maxIndexWidth:t,index:h,inputValue:e,onInputChange:e=>{z(t=>{let r=new Map(t);return r.set(n.value,e),r})},onSubmit:e=>{let t=E&&Object.values(E).some(e=>e.type===`image`);e.trim()||t||n.allowEmptySubmitToCancel?f?.(n.value):d?.()},onExit:d,layout:`expanded`,showLabel:v,onOpenEditor:C,resetCursorOnUpdate:n.resetCursorOnUpdate,onImagePaste:T,pastedContents:E,onRemoveImage:D,imagesSelected:O,selectedImageIndex:M,onImagesSelectedChange:A,onSelectedImageIndexChange:N},String(n.value))}let y=n.label;if(typeof n.label==`string`&&i&&n.label.includes(i)){let e=n.label,t=e.indexOf(i);y=(0,R.jsxs)(R.Fragment,{children:[e.slice(0,t),(0,R.jsx)(u,{...H.highlightedText(),children:i}),e.slice(t+i.length)]})}let x=n.disabled===!0,S=x?void 0:_?`success`:g?`suggestion`:void 0;return(0,R.jsxs)(l,{flexDirection:`column`,flexShrink:0,children:[(0,R.jsx)(b,{isFocused:g,isSelected:_,shouldShowDownArrow:p&&c,shouldShowUpArrow:m&&s,children:(0,R.jsx)(u,{dimColor:x,color:S,children:y})}),n.description&&(0,R.jsx)(l,{paddingLeft:2,children:(0,R.jsx)(u,{dimColor:x||n.dimDescription!==!1,color:S,children:(0,R.jsx)(a,{children:n.description})})}),(0,R.jsx)(u,{children:` `})]},String(n.value))})})}if(h===`compact-vertical`){let n=t?0:V.options.length.toString().length;return(0,R.jsx)(l,{...H.container(),children:V.visibleOptions.map((r,s)=>{let c=r.index===V.visibleFromIndex,p=r.index===V.visibleToIndex-1,m=V.visibleToIndex<o.length,h=V.visibleFromIndex>0,g=V.visibleFromIndex+s+1,_=!e&&V.focusedValue===r.value,y=V.value===r.value;if(r.type===`input`){let e=F.has(r.value)?F.get(r.value):r.initialValue||``;return(0,R.jsx)(w,{option:r,isFocused:_,isSelected:y,shouldShowDownArrow:m&&p,shouldShowUpArrow:h&&c,maxIndexWidth:n,index:g,inputValue:e,onInputChange:e=>{z(t=>{let n=new Map(t);return n.set(r.value,e),n})},onSubmit:e=>{let t=E&&Object.values(E).some(e=>e.type===`image`);e.trim()||t||r.allowEmptySubmitToCancel?f?.(r.value):d?.()},onExit:d,layout:`compact`,showLabel:v,onOpenEditor:C,resetCursorOnUpdate:r.resetCursorOnUpdate,onImagePaste:T,pastedContents:E,onRemoveImage:D,imagesSelected:O,selectedImageIndex:M,onImagesSelectedChange:A,onSelectedImageIndexChange:N},String(r.value))}let x=r.label;if(typeof r.label==`string`&&i&&r.label.includes(i)){let e=r.label,t=e.indexOf(i);x=(0,R.jsxs)(R.Fragment,{children:[e.slice(0,t),(0,R.jsx)(u,{...H.highlightedText(),children:i}),e.slice(t+i.length)]})}let S=r.disabled===!0;return(0,R.jsxs)(l,{flexDirection:`column`,flexShrink:0,children:[(0,R.jsxs)(b,{isFocused:_,isSelected:y,shouldShowDownArrow:m&&p,shouldShowUpArrow:h&&c,children:[!t&&(0,R.jsx)(u,{dimColor:!0,children:`${g}.`.padEnd(n+1)}),(0,R.jsx)(u,{dimColor:S,color:S?void 0:y?`success`:_?`suggestion`:void 0,children:x})]}),r.description&&(0,R.jsx)(l,{paddingLeft:t?4:n+4,children:(0,R.jsx)(u,{dimColor:S||r.dimDescription!==!1,color:S?void 0:y?`success`:_?`suggestion`:void 0,children:(0,R.jsx)(a,{children:r.description})})})]},String(r.value))})})}let U=t?0:V.options.length.toString().length,W=V.visibleOptions.some(e=>e.type===`input`),G=!v&&!W&&V.visibleOptions.some(e=>e.description),K=V.visibleOptions.map((t,n)=>{let r=t.index===V.visibleFromIndex,a=t.index===V.visibleToIndex-1,s=V.visibleToIndex<o.length,c=V.visibleFromIndex>0,l=V.visibleFromIndex+n+1,d=!e&&V.focusedValue===t.value,f=V.value===t.value,p=t.disabled===!0,m=t.label;if(typeof t.label==`string`&&i&&t.label.includes(i)){let e=t.label,n=e.indexOf(i);m=(0,R.jsxs)(R.Fragment,{children:[e.slice(0,n),(0,R.jsx)(u,{...H.highlightedText(),children:i}),e.slice(n+i.length)]})}return{option:t,index:l,label:m,isFocused:d,isSelected:f,isOptionDisabled:p,shouldShowDownArrow:s&&a,shouldShowUpArrow:c&&r}});if(G){let e=Math.max(...K.map(e=>{if(e.option.type===`input`)return 0;let n=P(e.option.label),r=t?0:U+2,i=e.isSelected?2:0;return 2+r+s(n)+i}));return(0,R.jsx)(l,{...H.container(),children:K.map(n=>{if(n.option.type===`input`)return null;let i=P(n.option.label),o=t?0:U+2,c=n.isSelected?2:0,d=2+o+s(i)+c,f=e-d;return(0,R.jsxs)(I,{isFocused:n.isFocused,children:[(0,R.jsxs)(l,{flexDirection:`row`,flexShrink:0,children:[n.isFocused?(0,R.jsx)(u,{color:`suggestion`,children:r.pointer}):n.shouldShowDownArrow?(0,R.jsx)(u,{dimColor:!0,children:r.arrowDown}):n.shouldShowUpArrow?(0,R.jsx)(u,{dimColor:!0,children:r.arrowUp}):(0,R.jsx)(u,{children:` `}),(0,R.jsx)(u,{children:` `}),(0,R.jsxs)(u,{dimColor:n.isOptionDisabled,color:n.isOptionDisabled?void 0:n.isSelected?`success`:n.isFocused?`suggestion`:void 0,children:[!t&&(0,R.jsx)(u,{dimColor:!0,children:`${n.index}.`.padEnd(U+2)}),n.label]}),n.isSelected&&(0,R.jsxs)(u,{color:`success`,children:[` `,r.tick]}),f>0&&(0,R.jsx)(u,{children:` `.repeat(f)})]}),(0,R.jsx)(l,{flexGrow:1,marginLeft:2,children:(0,R.jsx)(u,{wrap:`wrap`,dimColor:n.isOptionDisabled||n.option.dimDescription!==!1,color:n.isOptionDisabled?void 0:n.isSelected?`success`:n.isFocused?`suggestion`:void 0,children:(0,R.jsx)(a,{children:n.option.description||` `})})})]},String(n.option.value))})})}return(0,R.jsx)(l,{...H.container(),children:V.visibleOptions.map((n,r)=>{if(n.type===`input`){let t=F.has(n.value)?F.get(n.value):n.initialValue||``,i=n.index===V.visibleFromIndex,a=n.index===V.visibleToIndex-1,s=V.visibleToIndex<o.length,c=V.visibleFromIndex>0,l=V.visibleFromIndex+r+1;return(0,R.jsx)(w,{option:n,isFocused:!e&&V.focusedValue===n.value,isSelected:V.value===n.value,shouldShowDownArrow:s&&a,shouldShowUpArrow:c&&i,maxIndexWidth:U,index:l,inputValue:t,onInputChange:e=>{z(t=>{let r=new Map(t);return r.set(n.value,e),r})},onSubmit:e=>{let t=E&&Object.values(E).some(e=>e.type===`image`);e.trim()||t||n.allowEmptySubmitToCancel?f?.(n.value):d?.()},onExit:d,layout:`compact`,showLabel:v,onOpenEditor:C,resetCursorOnUpdate:n.resetCursorOnUpdate,onImagePaste:T,pastedContents:E,onRemoveImage:D,imagesSelected:O,selectedImageIndex:M,onImagesSelectedChange:A,onSelectedImageIndexChange:N},String(n.value))}let s=n.label;if(typeof n.label==`string`&&i&&n.label.includes(i)){let e=n.label,t=e.indexOf(i);s=(0,R.jsxs)(R.Fragment,{children:[e.slice(0,t),(0,R.jsx)(u,{...H.highlightedText(),children:i}),e.slice(t+i.length)]})}let c=n.index===V.visibleFromIndex,p=n.index===V.visibleToIndex-1,m=V.visibleToIndex<o.length,h=V.visibleFromIndex>0,g=V.visibleFromIndex+r+1,_=!e&&V.focusedValue===n.value,y=V.value===n.value,x=n.disabled===!0;return(0,R.jsxs)(b,{isFocused:_,isSelected:y,shouldShowDownArrow:m&&p,shouldShowUpArrow:h&&c,children:[(0,R.jsxs)(l,{flexDirection:`row`,flexShrink:0,children:[!t&&(0,R.jsx)(u,{dimColor:!0,children:`${g}.`.padEnd(U+2)}),(0,R.jsxs)(u,{dimColor:x,color:x?void 0:y?`success`:_?`suggestion`:void 0,children:[s,v&&n.description&&(0,R.jsxs)(u,{dimColor:x||n.dimDescription!==!1,children:[` `,n.description]})]})]}),!v&&n.description&&(0,R.jsx)(l,{flexShrink:99,marginLeft:2,children:(0,R.jsx)(u,{wrap:`wrap-trim`,dimColor:x||n.dimDescription!==!1,color:x?void 0:y?`success`:_?`suggestion`:void 0,children:(0,R.jsx)(a,{children:n.description})})})]},String(n.value))})})}function I({isFocused:e,children:t}){return(0,R.jsx)(l,{ref:o({line:0,column:0,active:e}),flexDirection:`row`,children:t})}var L,R,z=e((()=>{n(),L=t(d(),1),p(),h(),x(),C(),A(),N(),R=m()}));export{z as n,F as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Hf as e,Vf as t}from"./loadAgentsDir-B0Anodo0.js";t();export{e as registerSessionFileAccessHooks};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./sessionObserver-BtKjvteq.js";t();export{e as heuristicObserverBackend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Gr as e,_r as t,wr as n}from"./loadAgentsDir-B0Anodo0.js";t();export{n as linkSessionToPR,e as recordTranscript};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DfkgIdYf.js";import{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{et as o,ft as s,rt as c,ut as l}from"./esm-BXTZz3av.js";import{D as u,I as d,It as f,st as p,tt as m}from"./state-B4jiUise.js";import{C as h,I as ee,S as g,c as te,i as ne,x as _}from"./debug-Bglx1aTu.js";import{p as re,u as ie}from"./config-C-Y2qtB2.js";import{S as ae,y as oe}from"./log-D2TIwHBV.js";import"path";import"fs";import{createHash as se}from"crypto";import"fs/promises";import{AsyncLocalStorage as ce}from"async_hooks";function le(e){let n=ue[e],r=process.env[e];return r===void 0?n:t(r)}function v(){let e=ie(),t=p(),n={"user.id":e};return le(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),le(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.24`),l.terminal&&(n[`terminal.type`]=l.terminal),n}var ue,y=e((()=>{f(),re(),s(),n(),ue={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function de(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function fe(e){return de()?e:`<REDACTED>`}async function b(e,t={}){let n=u();if(!n){x||(x=!0,te(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...v(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":pe++},i=m();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var pe,x,me=e((()=>{f(),ne(),n(),y(),pe=0,x=!1}));function he(){E.clear(),D.clear()}function S(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&d()||!1}function C(e,t=O){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
|
|
2
|
-
|
|
3
|
-
[TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function w(e){return se(`sha256`).update(e).digest(`hex`).slice(0,12)}function ge(e){return`sp_${w(e)}`}function _e(e){return`msg_${w(h(e.message.content))}`}function T(e){let t=e.trim().match(k);return t?.[1]?t[1].trim():null}function ve(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=T(e);r?n.push(r):t.push(`[USER]\n${e}`)}else if(Array.isArray(e)){for(let r of e)if(r.type===`text`){let e=T(r.text);e?n.push(e):t.push(`[USER]\n${r.text}`)}else if(r.type===`tool_result`){let e=typeof r.content==`string`?r.content:h(r.content),i=T(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function ye(e,t){if(!S())return;let{content:n,truncated:r}=C(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function be(e,t,n){if(S()){if(t?.systemPrompt){let n=ge(t.systemPrompt),r=t.systemPrompt.slice(0,500);if(e.setAttribute(`system_prompt_hash`,n),e.setAttribute(`system_prompt_preview`,r),e.setAttribute(`system_prompt_length`,t.systemPrompt.length),!E.has(n)){E.add(n);let{content:e,truncated:r}=C(t.systemPrompt);b(`system_prompt`,{system_prompt_hash:n,system_prompt:e,system_prompt_length:String(t.systemPrompt.length),...r&&{system_prompt_truncated:`true`}})}}if(t?.tools)try{let n=g(t.tools).map(e=>{let t=h(e),n=w(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,h(n.map(({name:e,hash:t})=>({name:e,hash:t})))),e.setAttribute(`tools_count`,n.length);for(let{name:e,hash:t,json:r}of n)if(!E.has(`tool_${t}`)){E.add(`tool_${t}`);let{content:n,truncated:i}=C(r);b(`tool`,{tool_name:c(e),tool_hash:t,tool:n,...i&&{tool_truncated:`true`}})}}catch{e.setAttribute(`tools_parse_error`,!0)}if(n&&n.length>0&&t?.querySource){let r=t.querySource,i=D.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&_e(t)===i){a=e+1;break}}let o=n.slice(a).filter(e=>e.type===`user`);if(o.length>0){let{contextParts:t,systemReminders:i}=ve(o);if(t.length>0){let n=t.join(`
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
`),{content:r,truncated:i}=C(n);e.setAttributes({new_context:r,new_context_message_count:o.length,...i&&{new_context_truncated:!0,new_context_original_length:n.length}})}if(i.length>0){let t=i.join(`
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
`),{content:n,truncated:r}=C(t);e.setAttributes({system_reminders:n,system_reminders_count:i.length,...r&&{system_reminders_truncated:!0,system_reminders_original_length:t.length}})}let a=n[n.length-1];a&&D.set(r,_e(a))}}}}function xe(e,t){if(!(!S()||!t)&&t.modelOutput!==void 0){let{content:n,truncated:r}=C(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}}function Se(e,t,n){if(!S())return;let{content:r,truncated:i}=C(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function Ce(e,t,n){if(!S())return;let{content:r,truncated:i}=C(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var E,D,O,k,we=e((()=>{f(),o(),n(),_(),me(),E=new Set,D=new Map,O=60*1024,k=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function A(e){return Math.abs(oe(e))||1}function Te(e){let t=U.get(e);return t===void 0?(H++,U.set(e,H),H):t}function j(){let e=p(),t=`main`,n=z.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:A(t)};return z.set(e,r),B++,r}function M(){return(Date.now()-Re)*1e3}function N(){return`span_${++V}`}function Ee(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;te(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function De(e){F&&(I.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),I.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&I.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function P(){return F}function Oe(e,t,n){if(!F)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Te(e),threadId:A(t)};z.set(e,r),B++,De(r)}function ke(e){F&&(z.delete(e),U.delete(e))}function Ae(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`API Call`,category:`api`,startTime:M(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),L.push({name:`API Call`,cat:`api`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function je(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,ee={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(L.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;L.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),L.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}L.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+g,t=e+o*1e3;L.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),L.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-g/1e3;r!==void 0&&r>0&&(L.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),L.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),R.delete(e)}function Me(e,t){if(!F)return``;let n=N(),r=j();return R.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:M(),agentInfo:r,args:{tool_name:e,...t}}),L.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:R.get(n).startTime,pid:r.processId,tid:r.threadId,args:R.get(n).args}),n}function Ne(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Pe(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:M(),agentInfo:n,args:{context:e}}),L.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Fe(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Ie(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Interaction`,category:`interaction`,startTime:M(),agentInfo:n,args:{user_prompt_length:e?.length}}),L.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Le(e){if(!F||!e)return;let t=R.get(e);if(!t)return;let n=M(),r=n-t.startTime;L.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),R.delete(e)}var F,I,L,R,z,B,Re,V,H,U,ze=e((()=>{f(),ne(),n(),ee(),ae(),_(),F=!1,I=[],L=[],R=new Map,z=new Map,B=0,Re=0,V=0,H=1,U=new Map}));function W(e){return e.spanContext().spanId||``}function Be(){if($)return;$=!0;let e=setInterval(()=>{let e=Date.now()-nt;for(let[t,n]of X){let r=n.deref();r===void 0?(X.delete(t),Z.delete(t)):r.startTime<e&&(r.ended||r.span.end(),X.delete(t),Z.delete(t))}},6e4);typeof e.unref==`function`&&e.unref()}function Ve(){return!1}function G(){return Ve()||S()}function K(){return r.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function q(e,t={}){return{...v(),"span.type":e,...t}}function He(e){Be();let n=P()?Ie(e):void 0;if(!G()){if(n){let e=r.getActiveSpan()||K().startSpan(`dummy`),t=W(e),i={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:n};return X.set(t,new WeakRef(i)),J.enterWith(i),e}return r.getActiveSpan()||K().startSpan(`dummy`)}let i=K(),a=t(process.env.OTEL_LOG_USER_PROMPTS)?e:`<REDACTED>`;Q++;let o=q(`interaction`,{user_prompt:a,user_prompt_length:e.length,"interaction.sequence":Q}),s=i.startSpan(`claude_code.interaction`,{attributes:o});ye(s,e);let c=W(s),l={span:s,startTime:Date.now(),attributes:o,perfettoSpanId:n};return X.set(c,new WeakRef(l)),J.enterWith(l),s}function Ue(){let e=J.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&Le(e.perfettoSpanId),!G()){e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0);return}let t=Date.now()-e.startTime;e.span.setAttributes({"interaction.duration_ms":t}),e.span.end(),e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0)}function We(e,t,n,a){let o=P()?Ae({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!G()){if(o){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:o};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let s=K(),c=J.getStore(),l=q(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:a?`fast`:`normal`}),u=c?r.setSpan(i.active(),c.span):i.active(),d=s.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),be(d,t,n);let f=W(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:o};return X.set(f,new WeakRef(p)),Z.set(f,p),d}function Ge(e,t){let n;if(e){let t=W(e);n=X.get(t)?.deref()}else n=Array.from(X.values()).findLast(e=>{let t=e.deref();return t?.attributes[`span.type`]===`llm_request`||t?.attributes.model})?.deref();if(!n)return;let r=Date.now()-n.startTime;if(n.perfettoSpanId&&je(n.perfettoSpanId,{ttftMs:t?.ttftMs,ttltMs:r,promptTokens:t?.inputTokens,outputTokens:t?.outputTokens,cacheReadTokens:t?.cacheReadTokens,cacheCreationTokens:t?.cacheCreationTokens,success:t?.success,error:t?.error,requestSetupMs:t?.requestSetupMs,attemptStartTimes:t?.attemptStartTimes}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let i={duration_ms:r};t&&(t.inputTokens!==void 0&&(i.input_tokens=t.inputTokens),t.outputTokens!==void 0&&(i.output_tokens=t.outputTokens),t.cacheReadTokens!==void 0&&(i.cache_read_tokens=t.cacheReadTokens),t.cacheCreationTokens!==void 0&&(i.cache_creation_tokens=t.cacheCreationTokens),t.success!==void 0&&(i.success=t.success),t.statusCode!==void 0&&(i.status_code=t.statusCode),t.error!==void 0&&(i.error=t.error),t.attempt!==void 0&&(i.attempt=t.attempt),t.hasToolCall!==void 0&&(i[`response.has_tool_call`]=t.hasToolCall),t.ttftMs!==void 0&&(i.ttft_ms=t.ttftMs),xe(i,t)),n.span.setAttributes(i),n.span.end();let a=W(n.span);X.delete(a),Z.delete(a)}function Ke(e,t,n){let a=P()?Me(e,t):void 0;if(!G()){if(a){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:a};return X.set(n,new WeakRef(i)),Y.enterWith(i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let o=K(),s=J.getStore(),c=q(`tool`,{tool_name:e,...t}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.tool`,{attributes:c},l);n&&Se(u,e,n);let d=W(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:a};return X.set(d,new WeakRef(f)),Y.enterWith(f),u}function qe(){let e=P()?Pe(`tool_permission`):void 0;if(!G()){if(e){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=W(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let t=K(),n=Y.getStore(),a=q(`tool.blocked_on_user`),o=n?r.setSpan(i.active(),n.span):i.active(),s=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:a},o),c=W(s),l={span:s,startTime:Date.now(),attributes:a,perfettoSpanId:e};return X.set(c,new WeakRef(l)),Z.set(c,l),s}function Je(e,t){let n=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.blocked_on_user`)?.deref();if(!n)return;if(n.perfettoSpanId&&Fe(n.perfettoSpanId,{decision:e,source:t}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let r={duration_ms:Date.now()-n.startTime};e&&(r.decision=e),t&&(r.source=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Z.delete(i)}function Ye(){if(!G())return r.getActiveSpan()||K().startSpan(`dummy`);let e=K(),t=Y.getStore(),n=q(`tool.execution`),a=t?r.setSpan(i.active(),t.span):i.active(),o=e.startSpan(`claude_code.tool.execution`,{attributes:n},a),s=W(o),c={span:o,startTime:Date.now(),attributes:n};return X.set(s,new WeakRef(c)),Z.set(s,c),o}function Xe(e){if(!G())return;let t=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.execution`)?.deref();if(!t)return;let n={duration_ms:Date.now()-t.startTime};e&&(e.success!==void 0&&(n.success=e.success),e.error!==void 0&&(n.error=e.error)),t.span.setAttributes(n),t.span.end();let r=W(t.span);X.delete(r),Z.delete(r)}function Ze(e,t){let n=Y.getStore();if(!n)return;if(n.perfettoSpanId&&Ne(n.perfettoSpanId,{success:!0,resultTokens:t}),!G()){let e=W(n.span);X.delete(e),Y.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&Ce(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Y.enterWith(void 0)}function Qe(){return t(process.env.OTEL_LOG_TOOL_CONTENT)}function $e(e,t){if(!G()||!Qe())return;let n=Y.getStore();if(!n)return;let r={};for(let[e,n]of Object.entries(t))if(typeof n==`string`){let{content:t,truncated:i}=C(n);r[e]=t,i&&(r[`${e}_truncated`]=!0,r[`${e}_original_length`]=n.length)}else r[e]=n;n.span.addEvent(e,r)}function et(e,t,n,a){if(!S())return r.getActiveSpan()||K().startSpan(`dummy`);let o=K(),s=Y.getStore()??J.getStore(),c=q(`hook`,{hook_event:e,hook_name:t,num_hooks:n,hook_definitions:a}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.hook`,{attributes:c},l),d=W(u),f={span:u,startTime:Date.now(),attributes:c};return X.set(d,new WeakRef(f)),Z.set(d,f),u}function tt(e,t){if(!S())return;let n=W(e),r=X.get(n)?.deref();if(!r)return;let i={duration_ms:Date.now()-r.startTime};t&&(t.numSuccess!==void 0&&(i.num_success=t.numSuccess),t.numBlocking!==void 0&&(i.num_blocking=t.numBlocking),t.numNonBlockingError!==void 0&&(i.num_non_blocking_error=t.numNonBlockingError),t.numCancelled!==void 0&&(i.num_cancelled=t.numCancelled)),r.span.setAttributes(i),r.span.end(),X.delete(n),Z.delete(n)}var J,Y,X,Z,Q,$,nt,rt=e((()=>{a(),n(),y(),we(),ze(),J=new ce,Y=new ce,X=new Map,Z=new Map,Q=0,$=!1,nt=1800*1e3}));export{S as C,v as D,fe as E,y as O,we as S,b as T,Ee as _,Je as a,ke as b,rt as c,He as d,We as f,ze as g,Ke as h,Ge as i,Ve as l,Ye as m,tt as n,Xe as o,qe as p,Ue as r,Ze as s,$e as t,et as u,P as v,me as w,he as x,Oe as y};
|