@readmagic/workmate 0.0.23 → 0.0.25
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-Y5S_lMjD.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DVbU-BaD.js +1 -0
- package/dist/chunks/App-B8q8PV77.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-DjqGAL4C.js +1 -0
- package/dist/chunks/CustomSelect-BvTftqEH.js +1 -0
- package/dist/chunks/DiffDialog-v5r8cBKW.js +6 -0
- package/dist/chunks/Doctor-DKpBnbuI.js +1 -0
- package/dist/chunks/Doctor-uvO6NM5m.js +3 -0
- package/dist/chunks/ExitFlow-Dh9QdaYK.js +2 -0
- package/dist/chunks/InvalidConfigDialog-C9boykQn.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-Dtmpzeps.js → InvalidSettingsDialog-UN5mleCK.js} +1 -1
- package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +1 -0
- package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +1 -0
- package/dist/chunks/MCPToolListView-De1W4jpj.js +1 -0
- package/dist/chunks/McpParsingWarnings-zkM_lGd0.js +1 -0
- package/dist/chunks/MessageSelector-DW_itlX-.js +3 -0
- package/dist/chunks/Messages-BFsCpACq.js +10 -0
- package/dist/chunks/Onboarding-BT90cFkn.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-CCTZYbWI.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +1 -0
- package/dist/chunks/{ProviderSetup-XcBHjUnd.js → ProviderSetup-yIj8YOKF.js} +1 -1
- package/dist/chunks/QueryEngine-egz5mbaW.js +1 -0
- package/dist/chunks/REPL-D27CE4WN.js +124 -0
- package/dist/chunks/REPL-e8wAT1wN.js +1 -0
- package/dist/chunks/ResumeConversation-CWA27Lke.js +1 -0
- package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +1 -0
- package/dist/chunks/{SelectMulti-Bc6l11_K.js → SelectMulti-BW7Ffk1G.js} +1 -1
- package/dist/chunks/Settings-axHLvYIy.js +3 -0
- package/dist/chunks/Spinner-VjwI7m_g.js +1 -0
- package/dist/chunks/{SpinnerGlyph-CmkRUvHe.js → SpinnerGlyph-CqrOK3Mx.js} +1 -1
- package/dist/chunks/TextInput-Cev5Awdd.js +22 -0
- package/dist/chunks/ThemePicker-CtQYHmOr.js +1 -0
- package/dist/chunks/TrustDialog-8Sjmuu0e.js +1 -0
- package/dist/chunks/{ValidationErrorsList-DgNzJQUP.js → ValidationErrorsList-INwwoerV.js} +1 -1
- package/dist/chunks/_baseEach-DrPH_FGo.js +1 -0
- package/dist/chunks/add-dir-D3RMaYxy.js +1 -0
- package/dist/chunks/{agentDisplay-BReJUBWg.js → agentDisplay-B3npXoCS.js} +1 -1
- package/dist/chunks/{agents-B3x8yJ_r.js → agents-2mPGmeq6.js} +1 -1
- package/dist/chunks/agents-DEnmg8Xo.js +101 -0
- package/dist/chunks/allErrors-C9kx6lnk.js +1 -0
- package/dist/chunks/analytics-COpjZpvd.js +1 -0
- package/dist/chunks/{appleTerminalBackup-BArZWB21.js → appleTerminalBackup-CT7g8yOs.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-BkFxfjOf.js +1 -0
- package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +1 -0
- package/dist/chunks/banner-DHpTmEO7.js +2 -0
- package/dist/chunks/branch-Be_yDFU8.js +2 -0
- package/dist/chunks/{break-cache-BMXqFTeS.js → break-cache-UUt6Dkf2.js} +2 -2
- package/dist/chunks/btw-DUml5L1w.js +1 -0
- package/dist/chunks/caches-DWjwe-DN.js +1 -0
- package/dist/chunks/caches-VLs1tQkZ.js +1 -0
- package/dist/chunks/{claudeDesktop-D8ml2767.js → claudeDesktop-mBGFDbI6.js} +1 -1
- package/dist/chunks/{clear-Bdhb6b39.js → clear-CrGjNe6E.js} +1 -1
- package/dist/chunks/{client-CpTCeWba.js → client-BDuhbzLD.js} +1 -1
- package/dist/chunks/{client-4iqhC8xq.js → client-BYFVVMcf.js} +1 -1
- package/dist/chunks/client-CO_6v4yl.js +1 -0
- package/dist/chunks/client-DO-O441l.js +1 -0
- package/dist/chunks/commands-Cn1P7Tms.js +1 -0
- package/dist/chunks/compact-DGUhdXcc.js +2 -0
- package/dist/chunks/config-C7GTF4iI.js +1 -0
- package/dist/chunks/config-CWPHVTic.js +3 -0
- package/dist/chunks/config-Cox0TM2Z.js +1 -0
- package/dist/chunks/context-mV5zjqmc.js +1 -0
- package/dist/chunks/context-noninteractive--OuiZUzL.js +1 -0
- package/dist/chunks/{context-noninteractive-Dd4xIoP1.js → context-noninteractive-DvfVvmSE.js} +2 -2
- package/dist/chunks/conversation--y8PD2Lk.js +1 -0
- package/dist/chunks/conversation-BIPJEOwO.js +1 -0
- package/dist/chunks/conversationRecovery-BBJzrA0g.js +1 -0
- package/dist/chunks/crossProjectResume-CwZb3cEU.js +40 -0
- package/dist/chunks/cwd-BZMp3CZ8.js +1 -0
- package/dist/chunks/cwd-BvNt_018.js +1 -0
- package/dist/chunks/debug-CRnGsZOV.js +39 -0
- package/dist/chunks/{detectRepository-CfX8Lc0A.js → detectRepository-CsJLbVEe.js} +1 -1
- package/dist/chunks/{diff-BOAElpfQ.js → diff-DUEoNCnJ.js} +1 -1
- package/dist/chunks/{directoryCompletion-D_Rtg-4j.js → directoryCompletion-Bgi8DBT5.js} +1 -1
- package/dist/chunks/doctor-4NiE46ZG.js +1 -0
- package/dist/chunks/entry-D1iD76SW.js +13 -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-BTachNBI.js → execFileNoThrow-BgRsj_SW.js} +3 -3
- package/dist/chunks/exit-CrsQsjbx.js +1 -0
- package/dist/chunks/extraUsage-BtHE-SBX.js +1 -0
- package/dist/chunks/extractMemories-kogJzpit.js +1 -0
- package/dist/chunks/fast-CuNVwVTr.js +1 -0
- package/dist/chunks/fast-RlFnwGRV.js +1 -0
- package/dist/chunks/fetchModelList-Cjow_QGy.js +1 -0
- package/dist/chunks/fetchModelList-uiCPVqbJ.js +1 -0
- package/dist/chunks/fileSuggestions-C96V9-Ne.js +3 -0
- package/dist/chunks/firstPartyEventLogger-CN9UOmEC.js +1 -0
- package/dist/chunks/firstPartyEventLogger-RR5rvDtk.js +1 -0
- package/dist/chunks/{gemini-D_ORb_L6.js → gemini-4YGElN3H.js} +2 -2
- package/dist/chunks/generateSessionName-BHIKyXpz.js +1 -0
- package/dist/chunks/{genericProcessUtils-DwQFuna9.js → genericProcessUtils-BNlr-QxM.js} +1 -1
- 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-ePK_jLo3.js +3 -0
- package/dist/chunks/grok-DnmklTrm.js +1 -0
- package/dist/chunks/help-B7xRle-V.js +1 -0
- package/dist/chunks/history-kOw3CcLT.js +1 -0
- package/dist/chunks/hooks-BDY1jMbS.js +1 -0
- package/dist/chunks/{hooks-DIvN6gdv.js → hooks-BN5f58HY.js} +2 -2
- package/dist/chunks/install-DrMiHa2Q.js +1 -0
- package/dist/chunks/instrumentation-Oj5xagJG.js +21 -0
- package/dist/chunks/{job-R6c4-3c8.js → job-D9ypO0cd.js} +1 -1
- package/dist/chunks/keybindings-BRRN_eap.js +1 -0
- package/dist/chunks/launchLocalMemory-DliLezJw.js +3 -0
- package/dist/chunks/launchOnboarding-A-kk-7ID.js +8 -0
- package/dist/chunks/loadAgentsDir-CJAK4kif.js +1 -0
- package/dist/chunks/{loadAgentsDir-DlPbtIsS.js → loadAgentsDir-DGozQu_6.js} +550 -550
- package/dist/chunks/{loadPluginHooks-C_msxVIc.js → loadPluginHooks-BiHPKDaY.js} +1 -1
- package/dist/chunks/{loader-CICGtLp2.js → loader-CtoR-vO-.js} +1 -1
- package/dist/chunks/{localSearch-CK-sFzPm.js → localSearch-BU02Qsv9.js} +1 -1
- package/dist/chunks/localSearch-DyaB2Rm-.js +1 -0
- package/dist/chunks/{log-D2TIwHBV.js → log-DoSpAwRP.js} +1 -1
- package/dist/chunks/logoUtils-DLd6JKqW.js +1 -0
- package/dist/chunks/{magicDocs-BEF8D3if.js → magicDocs-Bj8LYrN2.js} +2 -2
- package/dist/chunks/main-B_09WbaG.js +345 -0
- package/dist/chunks/managedEnv-BJGfe3m7.js +1 -0
- package/dist/chunks/{managedEnv-OPlzUPbJ.js → managedEnv-CIWJsuty.js} +1 -1
- package/dist/chunks/mcp-1nBvcNxw.js +1 -0
- package/dist/chunks/mcp-7DXpXMdT.js +2 -0
- package/dist/chunks/mcp-kw99WVi2.js +6 -0
- package/dist/chunks/memory-CjWvzR_9.js +1 -0
- package/dist/chunks/mode-CBKawxnD.js +2 -0
- package/dist/chunks/model-DpZaKZMb.js +1 -0
- package/dist/chunks/model-DwbqvCY2.js +1 -0
- package/dist/chunks/modelOptions-CXBfKFXA.js +1 -0
- package/dist/chunks/nativeInstaller-SmPeEisk.js +1 -0
- package/dist/chunks/{notifications-4wP1Tx9Y.js → notifications-ql0eSo0Y.js} +1 -1
- package/dist/chunks/onChangeAppState-D85b33R5.js +1 -0
- package/dist/chunks/open-Cyrr4E5x.js +1 -0
- package/dist/chunks/openai-D_j7-KW6.js +2 -0
- package/dist/chunks/overlayContext-CLjlCFBl.js +1 -0
- package/dist/chunks/{panel-CVS4SK_E.js → panel-DMZkOEiU.js} +1 -1
- package/dist/chunks/parser-2usBI4G-.js +1 -0
- package/dist/chunks/{parser-Cg6hSCmn.js → parser-UqADrvxF.js} +1 -1
- package/dist/chunks/partition-CwxTlmMd.js +1 -0
- package/dist/chunks/{pasteStore-P0zP-ch0.js → pasteStore-ovtxMVR5.js} +1 -1
- package/dist/chunks/permissions-CgsvWOk_.js +3 -0
- package/dist/chunks/pidLock-B-SW3Nhx.js +3 -0
- package/dist/chunks/plan-BJrWtXEh.js +1 -0
- package/dist/chunks/platform-DsMIk3eq.js +2 -0
- package/dist/chunks/plugin-D97VJAxW.js +17 -0
- package/dist/chunks/{pluginAutoupdate-8qugAFhb.js → pluginAutoupdate-DQqYDPVg.js} +1 -1
- package/dist/chunks/{pluginBlocklist-q01ackCf.js → pluginBlocklist-BAr9WTup.js} +1 -1
- package/dist/chunks/pluginCliCommands-CUGPc853.js +1 -0
- package/dist/chunks/{pluginFlagging-BG2MHCQJ.js → pluginFlagging-BO_3qjfs.js} +1 -1
- package/dist/chunks/pluginOperations-rTrzu6Vg.js +2 -0
- package/dist/chunks/pluginStartupCheck-BRHnXlym.js +1 -0
- package/dist/chunks/{pluginStartupCheck-DTMa6TgL.js → pluginStartupCheck-BX6cv-vs.js} +1 -1
- package/dist/chunks/plugins-9crasx2V.js +4 -0
- package/dist/chunks/poorMode-BaS0DBUO.js +1 -0
- package/dist/chunks/{poorMode-B0QGV6Ci.js → poorMode-DmvzFAz_.js} +1 -1
- package/dist/chunks/print-Bi3xVdB3.js +13 -0
- package/dist/chunks/processBashCommand-BBtnCx-7.js +1 -0
- package/dist/chunks/processSlashCommand-jzF0GmLO.js +5 -0
- package/dist/chunks/{projectOnboardingState-B5YATuc6.js → projectOnboardingState--L3BKjOE.js} +1 -1
- package/dist/chunks/prompt-CmijKW7G.js +1 -0
- package/dist/chunks/prompt-DYBx_D0H.js +1 -0
- package/dist/chunks/{prompt-mM79EGnT.js → prompt-DzO1um1h.js} +4 -4
- package/dist/chunks/{promptEditor-DLGN_eLu.js → promptEditor-B6S_Rzcu.js} +2 -2
- package/dist/chunks/protocolHandler-BWgH1jaF.js +13 -0
- package/dist/chunks/{proxy-CDBfZjO7.js → proxy-BjkGlmBu.js} +1 -1
- package/dist/chunks/reconciler-CVMmAaCy.js +1 -0
- package/dist/chunks/refresh-CAGv8BJY.js +1 -0
- package/dist/chunks/reject-CEUkoI2G.js +1 -0
- package/dist/chunks/{reload-plugins-C42xSB5l.js → reload-plugins-DeyJTx4s.js} +1 -1
- package/dist/chunks/rename-DPFis9g_.js +1 -0
- package/dist/chunks/{renderOptions-DV0dn0IW.js → renderOptions-DRS2EslG.js} +1 -1
- package/dist/chunks/resume-N4O5YI-S.js +2 -0
- package/dist/chunks/ripgrep-3omwGI-l.js +1 -0
- package/dist/chunks/ripgrep-CgQrN3XX.js +5 -0
- package/dist/chunks/{runtimeObserver-1wQO8HSZ.js → runtimeObserver-C0CJvA3q.js} +1 -1
- package/dist/chunks/{runtimeObserver-XQrOux41.js → runtimeObserver-DMSzdFWt.js} +4 -4
- package/dist/chunks/sandbox-adapter-D15jjHJR.js +1 -0
- package/dist/chunks/sandbox-toggle-Tbbaw18C.js +1 -0
- package/dist/chunks/searchExtraTools-BoFc__Eg.js +1 -0
- package/dist/chunks/select-Fq6g2Ejk.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +1 -0
- package/dist/chunks/{sessionObserver-DS4G6mb9.js → sessionObserver-CRie77tp.js} +2 -2
- package/dist/chunks/sessionObserver-PcaVCVkX.js +1 -0
- package/dist/chunks/sessionStorage-Dkf7FRgA.js +1 -0
- package/dist/chunks/sessionTracing-D7rekMdW.js +11 -0
- package/dist/chunks/settings-8fwIkMDV.js +1 -0
- package/dist/chunks/settings-CodSADx8.js +24 -0
- package/dist/chunks/setup-DBiIrXrh.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BRxZjobz.js → shadowedRuleDetection-CTnYVrmP.js} +1 -1
- package/dist/chunks/{sideQuestion-DLJxyrlp.js → sideQuestion-Cl8m2qYx.js} +3 -3
- package/dist/chunks/sinks-CiupmfTg.js +1 -0
- package/dist/chunks/sinks-DH83d_kd.js +1 -0
- package/dist/chunks/skillChangeDetector-BrrZaFkT.js +1 -0
- package/dist/chunks/{skillGapStore-CKN_d3pO.js → skillGapStore-es3K-aYe.js} +2 -2
- package/dist/chunks/{skillLifecycle-BMY2JGGG.js → skillLifecycle-BcgoOQBk.js} +2 -2
- package/dist/chunks/{skillSearchPanel-D9trHULQ.js → skillSearchPanel-CuDDb1L-.js} +4 -4
- package/dist/chunks/skills-BRtgqnLz.js +1 -0
- package/dist/chunks/{src-CiJCsqUl.js → src-C8gyNm5a.js} +1 -1
- package/dist/chunks/src-Db7K3F_i.js +3 -0
- package/dist/chunks/startupProfiler-D1NRu2nj.js +1 -0
- package/dist/chunks/startupProfiler-DF0AjiDf.js +3 -0
- package/dist/chunks/{state-B4jiUise.js → state-BQ4BEGin.js} +1 -1
- package/dist/chunks/state-D3gvDiu8.js +1 -0
- package/dist/chunks/status-WXA16wIM.js +1 -0
- package/dist/chunks/statusNoticeHelpers-BfmIub5L.js +1 -0
- package/dist/chunks/{stringUtils-C718f5ey.js → stringUtils-Bu_lJH5c.js} +1 -1
- package/dist/chunks/switcher-5gilU5_R.js +1 -0
- package/dist/chunks/{switcher-CAajZeNL.js → switcher-DMfuKuw_.js} +1 -1
- package/dist/chunks/{tasks-BWNQr2d3.js → tasks-B6gYXxOx.js} +1 -1
- package/dist/chunks/{templateJobs-gUET39Ho.js → templateJobs-BW6TaqEC.js} +1 -1
- package/dist/chunks/{terminalSetup-B_10N_gE.js → terminalSetup-BgIXFBpd.js} +4 -4
- package/dist/chunks/{terminalSetup-qc2PlvOm.js → terminalSetup-C-g9Xvj3.js} +1 -1
- package/dist/chunks/{theme-B7fKI6E5.js → theme-9AZceq_m.js} +1 -1
- package/dist/chunks/tipRegistry-DtO1H_Wo.js +2 -0
- package/dist/chunks/{toolEventObserver-BL06sDI4.js → toolEventObserver-DTuJcREC.js} +1 -1
- package/dist/chunks/toolPool-DHS8jWaL.js +1 -0
- package/dist/chunks/{types-Dx7P7JLQ.js → types-97nL3naE.js} +16 -16
- package/dist/chunks/{udsClient-cQz6nJ_T.js → udsClient-CmYHFiBD.js} +1 -1
- package/dist/chunks/{use-select-navigation-BiUJdWai.js → use-select-navigation-BStVRvcX.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-DWRFdFoU.js +1 -0
- package/dist/chunks/useMainLoopModel-DSN5HjV1.js +1 -0
- package/dist/chunks/useManagePlugins-ntnOf5OU.js +1 -0
- package/dist/chunks/useMergedTools-C5Yns9Ij.js +1 -0
- package/dist/chunks/useSearchInput-B_mY9wBq.js +1 -0
- package/dist/chunks/useSettingsErrors-CM7tThcp.js +1 -0
- package/dist/chunks/util-Bb2S6g9N.js +1 -0
- package/dist/chunks/{validatePlugin-D6tFo87L.js → validatePlugin-D8WQ5z4W.js} +1 -1
- package/dist/chunks/vim-Dpnhgoz_.js +1 -0
- package/dist/chunks/worktree-a5oOPSYl.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -12
- package/dist/chunks/AddWorkspaceDirectory-OgcBcK5A.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDNd5-7E.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CNEifEyV.js +0 -1
- package/dist/chunks/App-B-3tPQ3k.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-COuhHcey.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-bJek4siJ.js +0 -1
- package/dist/chunks/CustomSelect-DoeEXOIP.js +0 -1
- package/dist/chunks/DiffDialog-B3X9FMpO.js +0 -6
- package/dist/chunks/Doctor-6PXyjIi6.js +0 -3
- package/dist/chunks/Doctor-DNgkgYhB.js +0 -1
- package/dist/chunks/ExitFlow-DgAZp_8U.js +0 -2
- package/dist/chunks/Grove-CHatOzcE.js +0 -11
- package/dist/chunks/InvalidConfigDialog-DXL92MN9.js +0 -1
- package/dist/chunks/KeybindingProviderSetup-DA37QUFs.js +0 -1
- package/dist/chunks/MCPConnectionManager-thZd-xA_.js +0 -1
- package/dist/chunks/MCPToolListView-CpY-YJg4.js +0 -1
- package/dist/chunks/McpParsingWarnings-JvChf3xr.js +0 -1
- package/dist/chunks/MessageSelector-C0_iw7SI.js +0 -3
- package/dist/chunks/Messages-K4DDsDP9.js +0 -10
- package/dist/chunks/Onboarding-C1UdzM-1.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-AyLog8p7.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-oyic20ip.js +0 -1
- package/dist/chunks/QueryEngine-DYxBjJ4i.js +0 -1
- package/dist/chunks/REPL-CQBJRrT0.js +0 -124
- package/dist/chunks/REPL-CrVuMQY2.js +0 -1
- package/dist/chunks/ResumeConversation-Dl8H9Gfy.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-lv7VE50N.js +0 -1
- package/dist/chunks/Settings-TGp3fPrS.js +0 -3
- package/dist/chunks/Spinner-zYPFVFHN.js +0 -1
- package/dist/chunks/TextInput-CD9iau2k.js +0 -22
- package/dist/chunks/ThemePicker-0F0hZYPX.js +0 -1
- package/dist/chunks/TrustDialog-C76YiMKz.js +0 -1
- package/dist/chunks/_baseEach-4ff-vRlp.js +0 -1
- package/dist/chunks/add-dir-JMsRLGfx.js +0 -1
- package/dist/chunks/agents-9qQ8I6zW.js +0 -101
- package/dist/chunks/allErrors-DfWylHSw.js +0 -1
- package/dist/chunks/analytics-DJobLaWP.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BGxHB_OX.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CVNIhQg8.js +0 -17
- package/dist/chunks/banner-Cu2-XUek.js +0 -2
- package/dist/chunks/branch-C4TsMEkx.js +0 -2
- package/dist/chunks/btw-Dn1eYFAz.js +0 -1
- package/dist/chunks/caches-BGzKwpnc.js +0 -1
- package/dist/chunks/caches-DArHxBgL.js +0 -1
- package/dist/chunks/client-BiqbIkwr.js +0 -1
- package/dist/chunks/client-CZ8nyVh5.js +0 -1
- package/dist/chunks/commands-QepeBbFn.js +0 -1
- package/dist/chunks/compact-Bu9BUpxV.js +0 -2
- package/dist/chunks/config-C-Y2qtB2.js +0 -3
- package/dist/chunks/config-D58C3_Lu.js +0 -1
- package/dist/chunks/config-DD8fCYXn.js +0 -1
- package/dist/chunks/context-CY_yfdYa.js +0 -1
- package/dist/chunks/context-noninteractive-BDDi3NLF.js +0 -1
- package/dist/chunks/conversation-B0wxBwzv.js +0 -1
- package/dist/chunks/conversation-DUu9qBnq.js +0 -1
- package/dist/chunks/conversationRecovery-2ft8sCPE.js +0 -1
- package/dist/chunks/crossProjectResume-6boHMUBx.js +0 -40
- package/dist/chunks/cwd-Dc3NV7s8.js +0 -1
- package/dist/chunks/cwd-Pa83R95t.js +0 -1
- package/dist/chunks/datadog-BPuGcxxC.js +0 -1
- package/dist/chunks/debug-Bglx1aTu.js +0 -39
- package/dist/chunks/doctor-CkLzqAMd.js +0 -1
- package/dist/chunks/entry-TNOoyy7_.js +0 -13
- package/dist/chunks/esm-eTAUP-La.js +0 -1
- package/dist/chunks/execAsync-Bv2yxuGe.js +0 -1
- package/dist/chunks/exit-DXApFJIP.js +0 -1
- package/dist/chunks/extraUsage-CmQaLPV1.js +0 -1
- package/dist/chunks/extractMemories-xP63mv6R.js +0 -1
- package/dist/chunks/fast-C5nQH8rm.js +0 -1
- package/dist/chunks/fast-eGx2IxD7.js +0 -1
- package/dist/chunks/fetchModelList-CxLsVNsu.js +0 -1
- package/dist/chunks/fetchModelList-D24lRIgR.js +0 -1
- package/dist/chunks/fileSuggestions-DHxdwq28.js +0 -3
- package/dist/chunks/firstPartyEventLogger-BVAogAX8.js +0 -1
- package/dist/chunks/firstPartyEventLogger-M6UMli2c.js +0 -3
- package/dist/chunks/generateSessionName-BQoDduyA.js +0 -1
- 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-D7c2mSds.js +0 -3
- package/dist/chunks/grok-B2-ZbUiR.js +0 -1
- package/dist/chunks/grove-O6qp7ITR.js +0 -1
- package/dist/chunks/help-CZJdRviD.js +0 -1
- package/dist/chunks/history-CQiUERTL.js +0 -1
- package/dist/chunks/hooks-BNuUlMzL.js +0 -1
- package/dist/chunks/install-T_CV1Slu.js +0 -1
- package/dist/chunks/instrumentation-BjqUZ383.js +0 -21
- package/dist/chunks/keybindings-CLRaiL_Z.js +0 -1
- package/dist/chunks/launchLocalMemory-DrbKrwXc.js +0 -3
- package/dist/chunks/launchOnboarding-tqsMD8ni.js +0 -8
- package/dist/chunks/loadAgentsDir-CcmY8zCj.js +0 -1
- package/dist/chunks/localSearch-DrUj0B-d.js +0 -1
- package/dist/chunks/logoUtils-x2pHV-Nl.js +0 -1
- package/dist/chunks/main-kOVUGxOS.js +0 -345
- package/dist/chunks/managedEnv-BEqrGqn1.js +0 -1
- package/dist/chunks/mcp-BNd29r6p.js +0 -6
- package/dist/chunks/mcp-D0wAJrRT.js +0 -1
- package/dist/chunks/mcp-mgOlm1cY.js +0 -2
- package/dist/chunks/memory-DDLk9_LJ.js +0 -1
- package/dist/chunks/mode-CcNsWgK3.js +0 -2
- package/dist/chunks/model-BwBG0V1u.js +0 -1
- package/dist/chunks/model-DzCP4K-9.js +0 -1
- package/dist/chunks/modelOptions-DRaG3bo0.js +0 -1
- package/dist/chunks/nativeInstaller-C3pVPqrZ.js +0 -1
- package/dist/chunks/onChangeAppState-BlaoFbYF.js +0 -1
- package/dist/chunks/open-BtQHzzL9.js +0 -1
- package/dist/chunks/openai-CDN71NdX.js +0 -2
- package/dist/chunks/overlayContext-BT2Lq8ei.js +0 -1
- package/dist/chunks/parser-CG5RuOCK.js +0 -1
- package/dist/chunks/partition-CIl_ORUT.js +0 -1
- package/dist/chunks/permissions-zSNOZSwr.js +0 -3
- package/dist/chunks/pidLock-BTqO-h7Y.js +0 -3
- package/dist/chunks/plan-Bs6em6lk.js +0 -1
- package/dist/chunks/platform-BacQ6ACS.js +0 -2
- package/dist/chunks/plugin-DDDxjBa0.js +0 -17
- package/dist/chunks/pluginCliCommands-DXZfCZsv.js +0 -1
- package/dist/chunks/pluginOperations-hXYLrzM2.js +0 -2
- package/dist/chunks/pluginStartupCheck-HS1ZceZa.js +0 -1
- package/dist/chunks/plugins-COoGBYk6.js +0 -4
- package/dist/chunks/poorMode-G-pnu6NM.js +0 -1
- package/dist/chunks/print-BASybEtO.js +0 -13
- package/dist/chunks/processBashCommand-DDi_Pymt.js +0 -1
- package/dist/chunks/processSlashCommand-Cq9kaoSF.js +0 -5
- package/dist/chunks/prompt-CHobfCB1.js +0 -1
- package/dist/chunks/prompt-CMm6RHHc.js +0 -1
- package/dist/chunks/protocolHandler-DjQALaU2.js +0 -13
- package/dist/chunks/reconciler-CeXqh95g.js +0 -1
- package/dist/chunks/refresh-Ce2yk28a.js +0 -1
- package/dist/chunks/registerProtocol-CAsDme_E.js +0 -1
- package/dist/chunks/reject-Bld5E-bn.js +0 -1
- package/dist/chunks/rename-CtBghpxZ.js +0 -1
- package/dist/chunks/resume-BWkaTDqd.js +0 -2
- package/dist/chunks/ripgrep-DLs8MraF.js +0 -1
- package/dist/chunks/ripgrep-Dl3y5r4m.js +0 -5
- package/dist/chunks/sandbox-adapter-8GO6eJxw.js +0 -1
- package/dist/chunks/sandbox-toggle-Dir9Polo.js +0 -1
- package/dist/chunks/searchExtraTools-BhDq8DTJ.js +0 -1
- package/dist/chunks/select-Bxf5-5sI.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CozocHQE.js +0 -1
- package/dist/chunks/sessionObserver-DGEQM4cO.js +0 -1
- package/dist/chunks/sessionStorage-BcAscOGE.js +0 -1
- package/dist/chunks/sessionTracing-BoDDYLxW.js +0 -11
- package/dist/chunks/settings-B2jvL8Dp.js +0 -24
- package/dist/chunks/settings-CisDe8DB.js +0 -1
- package/dist/chunks/setup-BRypY6iT.js +0 -3
- package/dist/chunks/sinks-CGdKmq_8.js +0 -1
- package/dist/chunks/sinks-Cz2HfgMU.js +0 -1
- package/dist/chunks/skillChangeDetector-xviGstqm.js +0 -1
- package/dist/chunks/skills-CX_AvwLG.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-Daaak6Bo.js +0 -1
- package/dist/chunks/statusNoticeHelpers-vFVgIYuw.js +0 -1
- package/dist/chunks/switcher-BpgmH4AI.js +0 -1
- package/dist/chunks/tipRegistry-DamZr34w.js +0 -2
- package/dist/chunks/toolPool-CX5wDBi1.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js +0 -1
- package/dist/chunks/useMainLoopModel-DwjSVzzO.js +0 -1
- package/dist/chunks/useManagePlugins-BqfIVa6E.js +0 -1
- package/dist/chunks/useMergedTools-Bw8FchX8.js +0 -1
- package/dist/chunks/useSearchInput-B25K1RnK.js +0 -1
- package/dist/chunks/useSettingsErrors-DYQ44kX4.js +0 -1
- package/dist/chunks/util-CtlC2dsN.js +0 -1
- package/dist/chunks/vim-CoRp9lY1.js +0 -1
- package/dist/chunks/worktree-B8apCnVe.js +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{B as n,Ds as r,E_ as i,Ec as a,Es as o,Jl as s,Ni as c,Oi as l,S_ as u,Tc as d,V as f,Yl as p,_r as m,i as h,o as g,rr as _}from"./loadAgentsDir-DlPbtIsS.js";import{$ as v,A as y,F as b,G as x,P as S,Q as C,V as w,W as T,Y as E,Z as D,tt as ee,x as te,z as O}from"./types-Dx7P7JLQ.js";import{Dn as k,It as A,J as ne,Wn as j,ct as re,er as ie,tr as ae}from"./state-B4jiUise.js";import{_r as oe,d as se,h as ce,pr as le,sr as ue}from"./settings-B2jvL8Dp.js";import{p as de,r as fe}from"./config-C-Y2qtB2.js";import{d as pe,o as me}from"./model-BwBG0V1u.js";import{_n as he,vn as ge}from"./prompt-mM79EGnT.js";import{t as _e}from"./conversationRecovery-2ft8sCPE.js";import{t as ve}from"./QueryEngine-DYxBjJ4i.js";import{n as ye,r as be}from"./modelOptions-DRaG3bo0.js";import{n as xe,r as Se}from"./managedEnv-OPlzUPbJ.js";import{dirname as Ce}from"node:path";import{randomUUID as M}from"node:crypto";import{Readable as we,Writable as Te}from"node:stream";import{unlink as Ee}from"node:fs/promises";import*as N from"node:path/posix";import{isAbsolute as De,resolve as Oe}from"node:path/posix";te();var P={authenticate:`authenticate`,document_did_change:`document/didChange`,document_did_close:`document/didClose`,document_did_focus:`document/didFocus`,document_did_open:`document/didOpen`,document_did_save:`document/didSave`,initialize:`initialize`,logout:`logout`,nes_accept:`nes/accept`,nes_close:`nes/close`,nes_reject:`nes/reject`,nes_start:`nes/start`,nes_suggest:`nes/suggest`,session_cancel:`session/cancel`,session_close:`session/close`,session_fork:`session/fork`,session_list:`session/list`,session_load:`session/load`,session_new:`session/new`,session_prompt:`session/prompt`,session_resume:`session/resume`,session_set_config_option:`session/set_config_option`,session_set_mode:`session/set_mode`,session_set_model:`session/set_model`},F={elicitation_complete:`elicitation/complete`,elicitation_create:`elicitation/create`,fs_read_text_file:`fs/read_text_file`,fs_write_text_file:`fs/write_text_file`,session_request_permission:`session/request_permission`,session_update:`session/update`,terminal_create:`terminal/create`,terminal_kill:`terminal/kill`,terminal_output:`terminal/output`,terminal_release:`terminal/release`,terminal_wait_for_exit:`terminal/wait_for_exit`},ke=x({_meta:E(D(),v()).nullish(),terminal:b().optional().default(!1)}),Ae=x({_meta:E(D(),v()).nullish(),label:D().nullish(),name:D(),optional:b().optional().default(!1),secret:b().optional().default(!0)}),je=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:D(),name:D()}),Me=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:D(),link:D().nullish(),name:D(),vars:S(Ae)}),Ne=x({_meta:E(D(),v()).nullish(),args:S(D()).optional(),description:D().nullish(),env:E(D(),D()).optional(),id:D(),name:D()}),Pe=C([Me.and(x({type:w(`env_var`)})),Ne.and(x({type:w(`terminal`)})),je]),Fe=x({_meta:E(D(),v()).nullish(),methodId:D()}),Ie=x({_meta:E(D(),v()).nullish()}),Le=x({_meta:E(D(),v()).nullish(),blob:D(),mimeType:D().nullish(),uri:D()}),Re=x({default:b().nullish(),description:D().nullish(),title:D().nullish()}),ze=x({_meta:E(D(),v()).nullish()}),Be=x({_meta:E(D(),v()).nullish()}),Ve=x({amount:T(),currency:D()}),He=x({_meta:E(D(),v()).nullish(),terminalId:D()}),Ue=x({_meta:E(D(),v()).nullish(),newText:D(),oldText:D().nullish(),path:D()}),We=C([D(),T(),T(),b(),S(D())]),Ge=O(C([x({content:E(D(),We).nullish()}).and(x({action:w(`accept`)})),x({action:w(`decline`)}),x({action:w(`cancel`)})]),x({_meta:E(D(),v()).nullish()})),Ke=x({_meta:E(D(),v()).nullish()}),qe=D(),Je=x({_meta:E(D(),v()).nullish(),elicitationId:qe}),Ye=w(`object`),Xe=w(`string`),Ze=x({_meta:E(D(),v()).nullish()}),Qe=x({_meta:E(D(),v()).nullish(),form:Ke.nullish(),url:Ze.nullish()}),$e=x({const:D(),title:D()}),et=x({_meta:E(D(),v()).nullish(),name:D(),value:D()}),tt=x({code:C([w(-32700),w(-32600),w(-32601),w(-32602),w(-32603),w(-32800),w(-32e3),w(-32002),w(-32042),T().int().min(-2147483648,{message:`Invalid value: Expected int32 to be >= -2147483648`}).max(2147483647,{message:`Invalid value: Expected int32 to be <= 2147483647`})]),data:v().optional(),message:D()}),nt=v(),rt=v(),it=v(),at=x({_meta:E(D(),v()).nullish(),readTextFile:b().optional().default(!1),writeTextFile:b().optional().default(!1)}),ot=x({_meta:E(D(),v()).nullish(),name:D(),value:D()}),st=x({_meta:E(D(),v()).nullish(),name:D(),title:D().nullish(),version:D()}),ct=x({default:T().nullish(),description:D().nullish(),maximum:T().nullish(),minimum:T().nullish(),title:D().nullish()}),lt=x({_meta:E(D(),v()).nullish()}),ut=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cursor:D().nullish(),cwd:D().nullish()}),dt=x({_meta:E(D(),v()).nullish()}),ft=x({_meta:E(D(),v()).nullish(),logout:dt.nullish()}),pt=x({_meta:E(D(),v()).nullish()}),mt=x({_meta:E(D(),v()).nullish()}),ht=x({_meta:E(D(),v()).nullish(),http:b().optional().default(!1),sse:b().optional().default(!1)}),gt=x({_meta:E(D(),v()).nullish(),headers:S(ot),name:D(),url:D()}),_t=x({_meta:E(D(),v()).nullish(),headers:S(ot),name:D(),url:D()}),vt=x({_meta:E(D(),v()).nullish(),args:S(D()),command:D(),env:S(et),name:D()}),I=C([gt.and(x({type:w(`http`)})),_t.and(x({type:w(`sse`)})),vt]),yt=D(),bt=x({_meta:E(D(),v()).nullish(),description:D().nullish(),modelId:yt,name:D()}),xt=C([w(`error`),w(`warning`),w(`information`),w(`hint`)]),St=x({_meta:E(D(),v()).nullish()}),Ct=x({_meta:E(D(),v()).nullish()}),wt=x({_meta:E(D(),v()).nullish()}),Tt=x({_meta:E(D(),v()).nullish()}),Et=x({_meta:E(D(),v()).nullish()}),Dt=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Ot=x({diff:D(),uri:D()}),kt=x({endLine:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),startLine:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),text:D()}),At=x({_meta:E(D(),v()).nullish()}),jt=x({_meta:E(D(),v()).nullish()}),Mt=x({languageId:D(),text:D(),uri:D()}),Nt=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Pt=C([w(`rejected`),w(`ignored`),w(`replaced`),w(`cancelled`)]),Ft=x({excerpts:S(kt),uri:D()}),It=x({_meta:E(D(),v()).nullish()}),Lt=x({_meta:E(D(),v()).nullish()}),Rt=x({name:D(),owner:D(),remoteUrl:D()}),zt=x({_meta:E(D(),v()).nullish()}),Bt=x({_meta:E(D(),v()).nullish(),jump:At.nullish(),rename:Lt.nullish(),searchAndReplace:zt.nullish()}),Vt=x({id:D(),isRegex:b().nullish(),replace:D(),search:D(),uri:D()}),Ht=C([w(`automatic`),w(`diagnostic`),w(`manual`)]),Ut=x({_meta:E(D(),v()).nullish(),maxCount:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish()}),Wt=x({_meta:E(D(),v()).nullish(),diagnostics:St.nullish(),editHistory:Dt.nullish(),openFiles:jt.nullish(),recentFiles:Nt.nullish(),relatedSnippets:It.nullish(),userActions:Ut.nullish()}),Gt=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I)}),Kt=x({default:T().nullish(),description:D().nullish(),maximum:T().nullish(),minimum:T().nullish(),title:D().nullish()}),qt=D(),Jt=C([w(`allow_once`),w(`allow_always`),w(`reject_once`),w(`reject_always`)]),Yt=x({_meta:E(D(),v()).nullish(),kind:Jt,name:D(),optionId:qt}),Xt=C([w(`high`),w(`medium`),w(`low`)]),Zt=C([w(`pending`),w(`in_progress`),w(`completed`)]),Qt=x({_meta:E(D(),v()).nullish(),content:D(),priority:Xt,status:Zt}),$t=x({_meta:E(D(),v()).nullish(),entries:S(Qt)}),L=x({character:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`})}),en=x({id:D(),position:L,uri:D()}),tn=x({id:D(),newName:D(),position:L,uri:D()}),nn=x({action:D(),position:L,timestampMs:T(),uri:D()}),rn=C([w(`utf-16`),w(`utf-32`),w(`utf-8`)]),an=x({_meta:E(D(),v()).nullish(),auth:ke.optional().default({terminal:!1}),elicitation:Qe.nullish(),fs:at.optional().default({readTextFile:!1,writeTextFile:!1}),nes:Bt.nullish(),positionEncodings:S(rn).optional(),terminal:b().optional().default(!1)}),on=x({_meta:E(D(),v()).nullish(),audio:b().optional().default(!1),embeddedContext:b().optional().default(!1),image:b().optional().default(!1)}),sn=T().int().gte(0).lte(65535),cn=x({_meta:E(D(),v()).nullish(),clientCapabilities:an.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:st.nullish(),protocolVersion:sn}),R=x({end:L,start:L}),ln=x({message:D(),range:R,severity:xt,uri:D()}),un=x({languageId:D(),lastFocusedMs:T().nullish(),uri:D(),visibleRange:R.nullish()}),dn=x({_meta:E(D(),v()).nullish(),diagnostics:S(ln).nullish(),editHistory:S(Ot).nullish(),openFiles:S(un).nullish(),recentFiles:S(Mt).nullish(),relatedSnippets:S(Ft).nullish(),userActions:S(nn).nullish()}),fn=x({newText:D(),range:R}),pn=C([x({cursorPosition:L.nullish(),edits:S(fn),id:D(),uri:D()}).and(x({kind:w(`edit`)})),en.and(x({kind:w(`jump`)})),tn.and(x({kind:w(`rename`)})),Vt.and(x({kind:w(`searchAndReplace`)}))]),mn=x({_meta:E(D(),v()).nullish(),content:D()}),hn=x({_meta:E(D(),v()).nullish()}),z=C([T(),D()]).nullable();x({_meta:E(D(),v()).nullish(),requestId:z});var gn=x({requestId:z}),_n=y([`assistant`,`user`]),B=x({_meta:E(D(),v()).nullish(),audience:S(_n).nullish(),lastModified:D().nullish(),priority:T().nullish()}),vn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),data:D(),mimeType:D()}),yn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),data:D(),mimeType:D(),uri:D().nullish()}),bn=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),description:D().nullish(),mimeType:D().nullish(),name:D(),size:T().nullish(),title:D().nullish(),uri:D()}),xn=x({_meta:E(D(),v()).nullish(),optionId:qt}),Sn=C([x({outcome:w(`cancelled`)}),xn.and(x({outcome:w(`selected`)}))]),Cn=x({_meta:E(D(),v()).nullish(),outcome:Sn}),wn=x({_meta:E(D(),v()).nullish()}),Tn=x({_meta:E(D(),v()).nullish()}),En=x({currentValue:b()}),Dn=D(),On=D(),kn=C([w(`mode`),w(`model`),w(`thought_level`),D()]),V=D(),An=x({_meta:E(D(),v()).nullish(),description:D().nullish(),name:D(),value:V}),jn=x({_meta:E(D(),v()).nullish(),group:Dn,name:D(),options:S(An)}),H=O(C([x({currentValue:V,options:C([S(An),S(jn)])}).and(x({type:w(`select`)})),En.and(x({type:w(`boolean`)}))]),x({_meta:E(D(),v()).nullish(),category:kn.nullish(),description:D().nullish(),id:On,name:D()})),Mn=x({_meta:E(D(),v()).nullish(),configOptions:S(H)}),Nn=x({_meta:E(D(),v()).nullish()}),U=D(),Pn=x({_meta:E(D(),v()).nullish(),id:D(),sessionId:U}),Fn=x({_meta:E(D(),v()).nullish(),sessionId:U}),In=x({_meta:E(D(),v()).nullish(),sessionId:U}),Ln=x({_meta:E(D(),v()).nullish(),sessionId:U}),Rn=x({_meta:E(D(),v()).nullish(),args:S(D()).optional(),command:D(),cwd:D().nullish(),env:S(et).optional(),outputByteLimit:T().nullish(),sessionId:U}),zn=x({_meta:E(D(),v()).nullish(),sessionId:U,uri:D()}),Bn=x({_meta:E(D(),v()).nullish(),position:L,sessionId:U,uri:D(),version:T(),visibleRange:R}),Vn=x({_meta:E(D(),v()).nullish(),languageId:D(),sessionId:U,text:D(),uri:D(),version:T()}),Hn=x({_meta:E(D(),v()).nullish(),sessionId:U,uri:D()}),Un=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I).optional(),sessionId:U}),Wn=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Gn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I),sessionId:U}),Kn=x({_meta:E(D(),v()).nullish(),limit:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:D(),sessionId:U}),qn=x({_meta:E(D(),v()).nullish(),id:D(),reason:Pt.nullish(),sessionId:U}),Jn=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Yn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),mcpServers:S(I).optional(),sessionId:U}),Xn=x({_meta:E(D(),v()).nullish(),additionalDirectories:S(D()).optional(),cwd:D(),sessionId:U,title:D().nullish(),updatedAt:D().nullish()}),Zn=x({_meta:E(D(),v()).nullish(),nextCursor:D().nullish(),sessions:S(Xn)}),Qn=x({_meta:E(D(),v()).nullish(),title:D().nullish(),updatedAt:D().nullish()}),$n=x({_meta:E(D(),v()).nullish()}),W=D(),er=x({_meta:E(D(),v()).nullish(),currentModeId:W}),tr=x({_meta:E(D(),v()).nullish(),description:D().nullish(),id:W,name:D()}),G=x({_meta:E(D(),v()).nullish(),availableModes:S(tr),currentModeId:W}),K=x({_meta:E(D(),v()).nullish(),availableModels:S(bt),currentModelId:yt}),nr=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),rr=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish()}),ir=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish(),sessionId:U}),ar=x({_meta:E(D(),v()).nullish(),configOptions:S(H).nullish(),models:K.nullish(),modes:G.nullish()}),or=x({_meta:E(D(),v()).nullish()}),sr=x({_meta:E(D(),v()).nullish(),additionalDirectories:wn.nullish(),close:Tn.nullish(),fork:Nn.nullish(),list:$n.nullish(),resume:or.nullish()}),cr=O(C([x({type:w(`boolean`),value:b()}),x({value:V})]),x({_meta:E(D(),v()).nullish(),configId:On,sessionId:U})),lr=x({_meta:E(D(),v()).nullish(),configOptions:S(H)}),ur=x({_meta:E(D(),v()).nullish(),modeId:W,sessionId:U}),dr=x({_meta:E(D(),v()).nullish()}),fr=x({_meta:E(D(),v()).nullish(),modelId:yt,sessionId:U}),pr=x({_meta:E(D(),v()).nullish()}),mr=x({_meta:E(D(),v()).nullish(),sessionId:U}),hr=C([w(`end_turn`),w(`max_tokens`),w(`max_turn_requests`),w(`refusal`),w(`cancelled`)]),gr=C([w(`email`),w(`uri`),w(`date`),w(`date-time`)]),_r=x({default:D().nullish(),description:D().nullish(),enum:S(D()).nullish(),format:gr.nullish(),maxLength:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),minLength:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),oneOf:S($e).nullish(),pattern:D().nullish(),title:D().nullish()}),vr=x({_meta:E(D(),v()).nullish(),context:dn.nullish(),position:L,selection:R.nullish(),sessionId:U,triggerKind:Ht,uri:D(),version:T()}),yr=x({_meta:E(D(),v()).nullish(),suggestions:S(pn)}),br=x({_meta:E(D(),v()).nullish(),terminalId:D()}),xr=x({_meta:E(D(),v()).nullish(),exitCode:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:D().nullish()}),Sr=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),Cr=x({_meta:E(D(),v()).nullish(),exitStatus:xr.nullish(),output:D(),truncated:b()}),wr=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),text:D()}),Tr=x({range:R.nullish(),text:D()}),Er=x({_meta:E(D(),v()).nullish(),contentChanges:S(Tr),sessionId:U,uri:D(),version:T()});x({method:D(),params:C([Fn,Vn,Er,zn,Hn,Bn,Pn,qn,nt]).nullish()});var Dr=C([w(`full`),w(`incremental`)]),Or=x({_meta:E(D(),v()).nullish(),syncKind:Dr}),kr=x({_meta:E(D(),v()).nullish(),didChange:Or.nullish(),didClose:Ct.nullish(),didFocus:wt.nullish(),didOpen:Tt.nullish(),didSave:Et.nullish()}),Ar=x({_meta:E(D(),v()).nullish(),document:kr.nullish()}),jr=x({_meta:E(D(),v()).nullish(),context:Wt.nullish(),events:Ar.nullish()}),Mr=x({_meta:E(D(),v()).nullish(),auth:ft.optional().default({}),loadSession:b().optional().default(!1),mcpCapabilities:ht.optional().default({http:!1,sse:!1}),nes:jr.nullish(),positionEncoding:rn.nullish(),promptCapabilities:on.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:sr.optional().default({})}),Nr=x({_meta:E(D(),v()).nullish(),agentCapabilities:Mr.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:st.nullish(),authMethods:S(Pe).optional().default([]),protocolVersion:sn}),Pr=C([x({_meta:E(D(),v()).nullish(),mimeType:D().nullish(),text:D(),uri:D()}),Le]),Fr=x({_meta:E(D(),v()).nullish(),annotations:B.nullish(),resource:Pr}),Ir=C([wr.and(x({type:w(`text`)})),yn.and(x({type:w(`image`)})),vn.and(x({type:w(`audio`)})),bn.and(x({type:w(`resource_link`)})),Fr.and(x({type:w(`resource`)}))]),Lr=x({_meta:E(D(),v()).nullish(),content:Ir}),Rr=x({_meta:E(D(),v()).nullish(),content:Ir,messageId:D().nullish()}),zr=x({_meta:E(D(),v()).nullish(),messageId:D().nullish(),prompt:S(Ir),sessionId:U}),Br=x({anyOf:S($e)}),Vr=C([Lr.and(x({type:w(`content`)})),Ue.and(x({type:w(`diff`)})),br.and(x({type:w(`terminal`)}))]),Hr=D(),Ur=x({sessionId:U,toolCallId:Hr.nullish()}),Wr=O(C([Ur,gn]),x({elicitationId:qe,url:D().url()})),Gr=x({_meta:E(D(),v()).nullish(),line:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),path:D()}),Kr=C([w(`pending`),w(`in_progress`),w(`completed`),w(`failed`)]),qr=C([w(`read`),w(`edit`),w(`delete`),w(`move`),w(`search`),w(`execute`),w(`think`),w(`fetch`),w(`switch_mode`),w(`other`)]),Jr=x({_meta:E(D(),v()).nullish(),content:S(Vr).optional(),kind:qr.optional(),locations:S(Gr).optional(),rawInput:v().optional(),rawOutput:v().optional(),status:Kr.optional(),title:D(),toolCallId:Hr}),Yr=x({_meta:E(D(),v()).nullish(),content:S(Vr).nullish(),kind:qr.nullish(),locations:S(Gr).nullish(),rawInput:v().optional(),rawOutput:v().optional(),status:Kr.nullish(),title:D().nullish(),toolCallId:Hr}),Xr=x({_meta:E(D(),v()).nullish(),options:S(Yt),sessionId:U,toolCall:Yr}),Zr=x({_meta:E(D(),v()).nullish(),hint:D()}),Qr=x({_meta:E(D(),v()).nullish(),description:D(),input:Zr.nullish(),name:D()}),$r=x({_meta:E(D(),v()).nullish(),availableCommands:S(Qr)}),ei=C([x({enum:S(D()),type:Xe}),Br]),ti=x({default:S(D()).nullish(),description:D().nullish(),items:ei,maxItems:T().nullish(),minItems:T().nullish(),title:D().nullish()}),ni=C([_r.and(x({type:w(`string`)})),Kt.and(x({type:w(`number`)})),ct.and(x({type:w(`integer`)})),Re.and(x({type:w(`boolean`)})),ti.and(x({type:w(`array`)}))]),ri=x({description:D().nullish(),properties:E(D(),ni).optional().default({}),required:S(D()).nullish(),title:D().nullish(),type:Ye.optional().default(`object`)}),ii=O(C([O(C([Ur,gn]),x({requestedSchema:ri})).and(x({mode:w(`form`)})),Wr.and(x({mode:w(`url`)}))]),x({_meta:E(D(),v()).nullish(),message:D()})),ai=x({cachedReadTokens:T().nullish(),cachedWriteTokens:T().nullish(),inputTokens:T(),outputTokens:T(),thoughtTokens:T().nullish(),totalTokens:T()});C([x({id:z,result:C([Nr,Ie,mt,ir,rr,Zn,nr,ar,Be,dr,lr,x({_meta:E(D(),v()).nullish(),stopReason:hr,usage:ai.nullish(),userMessageId:D().nullish()}),pr,mr,yr,ze,it])}),x({error:tt,id:z})]);var oi=x({_meta:E(D(),v()).nullish(),cost:Ve.nullish(),size:T(),used:T()}),si=C([Rr.and(x({sessionUpdate:w(`user_message_chunk`)})),Rr.and(x({sessionUpdate:w(`agent_message_chunk`)})),Rr.and(x({sessionUpdate:w(`agent_thought_chunk`)})),Jr.and(x({sessionUpdate:w(`tool_call`)})),Yr.and(x({sessionUpdate:w(`tool_call_update`)})),$t.and(x({sessionUpdate:w(`plan`)})),$r.and(x({sessionUpdate:w(`available_commands_update`)})),er.and(x({sessionUpdate:w(`current_mode_update`)})),Mn.and(x({sessionUpdate:w(`config_option_update`)})),Qn.and(x({sessionUpdate:w(`session_info_update`)})),oi.and(x({sessionUpdate:w(`usage_update`)}))]),ci=x({_meta:E(D(),v()).nullish(),sessionId:U,update:si});x({method:D(),params:C([ci,Je,nt]).nullish()});var li=x({_meta:E(D(),v()).nullish(),sessionId:U,terminalId:D()}),ui=x({_meta:E(D(),v()).nullish(),exitCode:T().int().gte(0).max(4294967295,{message:`Invalid value: Expected uint32 to be <= 4294967295`}).nullish(),signal:D().nullish()}),di=x({name:D(),uri:D()}),fi=x({_meta:E(D(),v()).nullish(),repository:Rt.nullish(),workspaceFolders:S(di).nullish(),workspaceUri:D().nullish()});x({id:z,method:D(),params:C([cn,Fe,pt,Gt,Gn,ut,Un,Yn,Ln,ur,cr,zr,fr,fi,vr,In,rt]).nullish()});var pi=x({_meta:E(D(),v()).nullish(),content:D(),path:D(),sessionId:U});x({id:z,method:D(),params:C([pi,Kn,Xr,Rn,Sr,Jn,li,Wn,ii,rt]).nullish()}),C([x({id:z,result:C([x({_meta:E(D(),v()).nullish()}),mn,Cn,He,Cr,hn,ui,lt,Ge,it])}),x({error:tt,id:z})]),e();function mi(e,t){let n=new TextEncoder,r=new TextDecoder;return{readable:new ReadableStream({async start(e){let n=``,i=t.getReader();try{for(;;){let{value:t,done:a}=await i.read();if(a){n+=r.decode();break}if(!t)continue;n+=r.decode(t,{stream:!0});let o=n.split(`
|
|
2
|
-
`);n=o.pop()||``;for(let t of o){let n=t.trim();if(n)try{let t=JSON.parse(n);e.enqueue(t)}catch(e){console.error(`Failed to parse JSON message:`,n,e)}}}let t=n.trim();if(t)try{let n=JSON.parse(t);e.enqueue(n)}catch(e){console.error(`Failed to parse JSON message:`,t,e)}}catch(t){e.error(t);return}finally{i.releaseLock()}e.close()}}),writable:new WritableStream({async write(t){let r=JSON.stringify(t)+`
|
|
3
|
-
`,i=e.getWriter();try{await i.write(n.encode(r))}finally{i.releaseLock()}}})}}te();var hi,gi=class{constructor(e,n){t(this,`connection`,void 0);let r=e(this),i=async(e,t)=>{switch(e){case P.initialize:{let e=cn.parse(t);return r.initialize(e)}case P.session_new:{let e=Gt.parse(t);return r.newSession(e)}case P.session_load:{if(!r.loadSession)throw q.methodNotFound(e);let n=Gn.parse(t);return r.loadSession(n)}case P.session_list:{if(!r.listSessions)throw q.methodNotFound(e);let n=ut.parse(t);return r.listSessions(n)}case P.session_fork:{if(!r.unstable_forkSession)throw q.methodNotFound(e);let n=Un.parse(t);return r.unstable_forkSession(n)}case P.session_resume:{if(!r.unstable_resumeSession)throw q.methodNotFound(e);let n=Yn.parse(t);return r.unstable_resumeSession(n)}case P.session_close:{if(!r.unstable_closeSession)throw q.methodNotFound(e);let n=Ln.parse(t);return r.unstable_closeSession(n)}case P.session_set_mode:{if(!r.setSessionMode)throw q.methodNotFound(e);let n=ur.parse(t);return await r.setSessionMode(n)??{}}case P.authenticate:{let e=Fe.parse(t);return await r.authenticate(e)??{}}case P.logout:{if(!r.unstable_logout)throw q.methodNotFound(e);let n=pt.parse(t);return await r.unstable_logout(n)??{}}case P.session_prompt:{let e=zr.parse(t);return r.prompt(e)}case P.session_set_model:{if(!r.unstable_setSessionModel)throw q.methodNotFound(e);let n=fr.parse(t);return await r.unstable_setSessionModel(n)??{}}case P.session_set_config_option:{if(!r.setSessionConfigOption)throw q.methodNotFound(e);let n=cr.parse(t);return r.setSessionConfigOption(n)}case P.nes_start:{if(!r.unstable_startNes)throw q.methodNotFound(e);let n=fi.parse(t);return r.unstable_startNes(n)}case P.nes_suggest:{if(!r.unstable_suggestNes)throw q.methodNotFound(e);let n=vr.parse(t);return r.unstable_suggestNes(n)}case P.nes_close:{if(!r.unstable_closeNes)throw q.methodNotFound(e);let n=In.parse(t);return await r.unstable_closeNes(n)??{}}default:if(r.extMethod)return r.extMethod(e,t);throw q.methodNotFound(e)}},a=async(e,t)=>{switch(e){case P.session_cancel:{let e=Fn.parse(t);return r.cancel(e)}case P.document_did_open:{if(!r.unstable_didOpenDocument)return;let e=Vn.parse(t);return r.unstable_didOpenDocument(e)}case P.document_did_change:{if(!r.unstable_didChangeDocument)return;let e=Er.parse(t);return r.unstable_didChangeDocument(e)}case P.document_did_close:{if(!r.unstable_didCloseDocument)return;let e=zn.parse(t);return r.unstable_didCloseDocument(e)}case P.document_did_save:{if(!r.unstable_didSaveDocument)return;let e=Hn.parse(t);return r.unstable_didSaveDocument(e)}case P.document_did_focus:{if(!r.unstable_didFocusDocument)return;let e=Bn.parse(t);return r.unstable_didFocusDocument(e)}case P.nes_accept:{if(!r.unstable_acceptNes)return;let e=Pn.parse(t);return r.unstable_acceptNes(e)}case P.nes_reject:{if(!r.unstable_rejectNes)return;let e=qn.parse(t);return r.unstable_rejectNes(e)}default:if(r.extNotification)return r.extNotification(e,t);throw q.methodNotFound(e)}};this.connection=new vi(i,a,n)}async sessionUpdate(e){return await this.connection.sendNotification(F.session_update,e)}async requestPermission(e){return await this.connection.sendRequest(F.session_request_permission,e)}async readTextFile(e){return await this.connection.sendRequest(F.fs_read_text_file,e)}async writeTextFile(e){return await this.connection.sendRequest(F.fs_write_text_file,e)??{}}async createTerminal(e){return new _i((await this.connection.sendRequest(F.terminal_create,e)).terminalId,e.sessionId,this.connection)}async unstable_createElicitation(e){return await this.connection.sendRequest(F.elicitation_create,e)}async unstable_completeElicitation(e){return await this.connection.sendNotification(F.elicitation_complete,e)}async extMethod(e,t){return await this.connection.sendRequest(e,t)}async extNotification(e,t){return await this.connection.sendNotification(e,t)}get signal(){return this.connection.signal}get closed(){return this.connection.closed}};hi=Symbol.asyncDispose;var _i=class{constructor(e,n,r){t(this,`id`,void 0),t(this,`sessionId`,void 0),t(this,`connection`,void 0),this.id=e,this.sessionId=n,this.connection=r}async currentOutput(){return await this.connection.sendRequest(F.terminal_output,{sessionId:this.sessionId,terminalId:this.id})}async waitForExit(){return await this.connection.sendRequest(F.terminal_wait_for_exit,{sessionId:this.sessionId,terminalId:this.id})}async kill(){return await this.connection.sendRequest(F.terminal_kill,{sessionId:this.sessionId,terminalId:this.id})??{}}async release(){return await this.connection.sendRequest(F.terminal_release,{sessionId:this.sessionId,terminalId:this.id})??{}}async[hi](){await this.release()}},vi=class{constructor(e,n,r){t(this,`pendingResponses`,new Map),t(this,`nextRequestId`,0),t(this,`requestHandler`,void 0),t(this,`notificationHandler`,void 0),t(this,`stream`,void 0),t(this,`writeQueue`,Promise.resolve()),t(this,`abortController`,new AbortController),t(this,`closedPromise`,void 0),this.requestHandler=e,this.notificationHandler=n,this.stream=r,this.closedPromise=new Promise(e=>{this.abortController.signal.addEventListener(`abort`,()=>e())}),this.receive()}get signal(){return this.abortController.signal}get closed(){return this.closedPromise}async receive(){let e;try{let e=this.stream.readable.getReader();try{for(;!this.abortController.signal.aborted;){let{value:t,done:n}=await e.read();if(n)break;if(t)try{this.processMessage(t)}catch(e){console.error(`Unexpected error during message processing:`,t,e),`id`in t&&t.id!==void 0&&this.sendMessage({jsonrpc:`2.0`,id:t.id,error:{code:-32700,message:`Parse error`}})}}}finally{e.releaseLock()}}catch(t){e=t}finally{this.close(e)}}close(e){if(this.abortController.signal.aborted)return;let t=e??Error(`ACP connection closed`);for(let e of this.pendingResponses.values())e.reject(t);this.pendingResponses.clear(),this.abortController.abort(t)}async processMessage(e){if(`method`in e&&`id`in e){let t=await this.tryCallRequestHandler(e.method,e.params);`error`in t&&console.error(`Error handling request`,e,t.error),await this.sendMessage({jsonrpc:`2.0`,id:e.id,...t})}else if(`method`in e){let t=await this.tryCallNotificationHandler(e.method,e.params);`error`in t&&console.error(`Error handling notification`,e,t.error)}else`id`in e?this.handleResponse(e):console.error(`Invalid message`,{message:e})}async tryCallRequestHandler(e,t){try{return{result:await this.requestHandler(e,t)??null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}async tryCallNotificationHandler(e,t){try{return await this.notificationHandler(e,t),{result:null}}catch(e){if(e instanceof q)return e.toResult();if(e instanceof ee)return q.invalidParams(e.format()).toResult();let t;(e instanceof Error||typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`)&&(t=e.message);try{return q.internalError(t?JSON.parse(t):{}).toResult()}catch{return q.internalError({details:t}).toResult()}}}handleResponse(e){let t=this.pendingResponses.get(e.id);if(t){if(`result`in e)t.resolve(e.result);else if(`error`in e){let{code:n,message:r,data:i}=e.error;t.reject(new q(n,r,i))}this.pendingResponses.delete(e.id)}else console.error(`Got response to unknown request`,e.id)}sendRequest(e,t){this.throwIfClosed();let n=this.nextRequestId++,r=new Promise((e,t)=>{this.pendingResponses.set(n,{resolve:e,reject:t})});return r.catch(()=>{}),this.sendMessage({jsonrpc:`2.0`,id:n,method:e,params:t}),r}async sendNotification(e,t){this.throwIfClosed(),await this.sendMessage({jsonrpc:`2.0`,method:e,params:t})}throwIfClosed(){if(this.abortController.signal.aborted)throw this.abortController.signal.reason??Error(`ACP connection closed`)}async sendMessage(e){return this.writeQueue=this.writeQueue.then(async()=>{let t=this.stream.writable.getWriter();try{await t.write(e)}finally{t.releaseLock()}}).catch(e=>{this.close(e)}),this.writeQueue}},q=class e extends Error{constructor(e,n,r){super(n),t(this,`code`,void 0),t(this,`data`,void 0),this.code=e,this.name=`RequestError`,this.data=r}static parseError(t,n){return new e(-32700,`Parse error${n?`: ${n}`:``}`,t)}static invalidRequest(t,n){return new e(-32600,`Invalid request${n?`: ${n}`:``}`,t)}static methodNotFound(t){return new e(-32601,`"Method not found": ${t}`,{method:t})}static invalidParams(t,n){return new e(-32602,`Invalid params${n?`: ${n}`:``}`,t)}static internalError(t,n){return new e(-32603,`Internal error${n?`: ${n}`:``}`,t)}static authRequired(t,n){return new e(-32e3,`Authentication required${n?`: ${n}`:``}`,t)}static resourceNotFound(t){return new e(-32002,`Resource not found${t?`: ${t}`:``}`,t&&{uri:t})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}};ie(),A(),ce(),ge(),de(),i(),a(),r(),c(),f(),g(),Se();function J(e,t){if(e)return t?De(e)?e:Oe(t,e):e}var yi=!(typeof process.geteuid==`function`?process.geteuid()===0:typeof process.getuid==`function`&&process.getuid()===0)||!!process.env.IS_SANDBOX,bi={auto:`auto`,default:`default`,acceptedits:`acceptEdits`,dontask:`dontAsk`,plan:`plan`,bypasspermissions:`bypassPermissions`,bypass:`bypassPermissions`};function xi(e,t=`permissions.defaultMode`){if(e===void 0)return`default`;if(typeof e!=`string`)throw Error(`Invalid ${t}: expected a string.`);let n=e.trim().toLowerCase();if(n===``)throw Error(`Invalid ${t}: expected a non-empty string.`);let r=bi[n];if(!r)throw Error(`Invalid ${t}: ${e}.`);if(r===`bypassPermissions`&&!yi)throw Error(`Invalid ${t}: bypassPermissions is not available when running as root.`);return r}function Si(e){let t=[...e.mcpServers??[]].sort((e,t)=>e.name.localeCompare(t.name));return JSON.stringify({cwd:e.cwd,mcpServers:t})}var Ci=256;function wi(e){let t=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return t.length<=Ci?t:`${t.slice(0,Ci-1)}…`}function Ti(e,t){if(!t)return e;let n=N.resolve(t),r=N.resolve(e);return r.startsWith(n+N.sep)||r===n?N.relative(n,r):e}function Ei(e){let t="```";for(let n of e.matchAll(/^```+/gm)??[])for(;n[0].length>=t.length;)t+="`";return`${t}\n${e}${e.endsWith(`
|
|
4
|
-
`)?``:`
|
|
5
|
-
`}${t}`}function Y(e,t=!1,n){let r=e.name,i=e.input;switch(r){case`Agent`:case`Task`:{let e=i?.description??`Task`,t=i?.prompt;return{title:e,kind:`think`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Bash`:{let e=i?.command??`Terminal`,t=i?.description;return{title:e,kind:`execute`,content:t?[{type:`content`,content:{type:`text`,text:t}}]:[]}}case`Read`:{let e=i?.file_path,t=e??`File`,r=i?.offset,a=i?.limit,o=``;a&&a>0?o=` (${r??1} - ${(r??1)+a-1})`:r&&(o=` (from line ${r})`);let s=t?Ti(t,n):`File`,c=J(e,n);return{title:`Read ${s}${o}`,kind:`read`,locations:c?[{path:c,line:r??1}]:[],content:[]}}case`Write`:{let e=i?.file_path??``,t=i?.content??``,r=e?Ti(e,n):void 0,a=J(e,n);return{title:r?`Write ${r}`:`Write`,kind:`edit`,content:a?[{type:`diff`,path:a,oldText:null,newText:t}]:[{type:`content`,content:{type:`text`,text:t}}],locations:a?[{path:a}]:[]}}case`Edit`:{let e=i?.file_path??``,t=i?.old_string??``,r=i?.new_string??``,a=e?Ti(e,n):void 0,o=J(e,n);return{title:a?`Edit ${a}`:`Edit`,kind:`edit`,content:o?[{type:`diff`,path:o,oldText:t||null,newText:r}]:[],locations:o?[{path:o}]:[]}}case`Glob`:{let e=i?.path??``,t=i?.pattern??``,r=J(e,n),a=`Find`;return e&&(a+=` \`${e}\``),t&&(a+=` \`${t}\``),{title:a,kind:`search`,content:[],locations:r?[{path:r}]:[]}}case`Grep`:{let e=i?.pattern??``,t=i?.path??``,n=`grep`;return i?.[`-i`]&&(n+=` -i`),i?.[`-n`]&&(n+=` -n`),i?.[`-A`]!==void 0&&(n+=` -A ${i[`-A`]}`),i?.[`-B`]!==void 0&&(n+=` -B ${i[`-B`]}`),i?.[`-C`]!==void 0&&(n+=` -C ${i[`-C`]}`),i?.output_mode===`files_with_matches`?n+=` -l`:i?.output_mode===`count`&&(n+=` -c`),i?.head_limit!==void 0&&(n+=` | head -${i.head_limit}`),i?.glob&&(n+=` --include="${i.glob}"`),i?.type&&(n+=` --type=${i.type}`),i?.multiline&&(n+=` -P`),e&&(n+=` "${e}"`),t&&(n+=` ${t}`),{title:n,kind:`search`,content:[]}}case`TodoWrite`:{let e=i?.todos;return{title:Array.isArray(e)?`Update TODOs: ${e.map(e=>e.content).join(`, `)}`:`Update TODOs`,kind:`think`,content:[]}}case`ExitPlanMode`:{let e=i?.plan;return{title:`Ready to code?`,kind:`switch_mode`,content:e?[{type:`content`,content:{type:`text`,text:e}}]:[]}}default:return{title:r||`Unknown Tool`,kind:`other`,content:[]}}}function Di(e,t){return Array.isArray(e)&&e.length>0?{content:e.map(e=>({type:`content`,content:Oi(e,t)}))}:typeof e==`string`&&e.length>0?{content:[{type:`content`,content:{type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e}}]}:{}}function Oi(e,t){let n=e=>({type:`text`,text:t?`\`\`\`\n${e}\n\`\`\``:e});switch(e.type){case`text`:{let n=e.text;return{type:`text`,text:t?`\`\`\`\n${n}\n\`\`\``:n}}case`image`:{let t=e.source;return t?.type===`base64`?{type:`image`,data:t.data,mimeType:t.media_type}:n(t?.type===`url`?`[image: ${t.url}]`:`[image: file reference]`)}case`resource_link`:{let t=e.uri;return{type:`resource_link`,uri:t,name:e.name??t,mimeType:e.mimeType}}case`resource`:{let t=e.resource;return{type:`resource`,resource:{uri:t?.uri??``,mimeType:t?.mimeType,...typeof t?.text==`string`?{text:t.text}:{},...typeof t?.blob==`string`?{blob:t.blob}:{}}}}case`tool_reference`:return n(`Tool: ${e.tool_name}`);case`tool_search_tool_search_result`:{let t=e.tool_references;return n(`Tools found: ${t?.map(e=>e.tool_name).join(`, `)||`none`}`)}case`tool_search_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);case`web_fetch_result`:return n(`Fetched: ${e.url}`);case`web_fetch_tool_result_error`:return n(`Error: ${e.error_code}`);case`code_execution_result`:case`bash_code_execution_result`:return n(`Output: ${e.stdout||e.stderr||``}`);case`code_execution_tool_result_error`:case`bash_code_execution_tool_result_error`:return n(`Error: ${e.error_code}`);case`text_editor_code_execution_view_result`:return n(e.content);case`text_editor_code_execution_create_result`:return n(e.is_file_update?`File updated`:`File created`);case`text_editor_code_execution_str_replace_result`:{let t=e.lines;return n(t?.join(`
|
|
6
|
-
`)||``)}case`text_editor_code_execution_tool_result_error`:return n(`Error: ${e.error_code}${e.error_message?` - ${e.error_message}`:``}`);default:try{return{type:`text`,text:JSON.stringify(e)}}catch{return{type:`text`,text:`[content]`}}}}function ki(e,t,n=!1){if(!t)return{};let r=e.is_error===!0,i=e.content;if(r&&i)return Di(i,!0);switch(t.name){case`Read`:return typeof i==`string`&&i.length>0?{content:[{type:`content`,content:{type:`text`,text:Ei(i)}}]}:Array.isArray(i)&&i.length>0?{content:i.map(e=>({type:`content`,content:e.type===`text`?{type:`text`,text:Ei(e.text)}:Oi(e,!1)}))}:{};case`Bash`:{let e=``;if(i&&typeof i==`object`&&!Array.isArray(i)&&i.type===`bash_code_execution_result`){let t=i;e=[t.stdout,t.stderr].filter(Boolean).join(`
|
|
7
|
-
`)}else typeof i==`string`?e=i:Array.isArray(i)&&i.length>0&&(e=i.map(e=>e.type===`text`?e.text:``).join(`
|
|
8
|
-
`));return e.trim()?{content:[{type:`content`,content:{type:`text`,text:`\`\`\`console\n${e.trimEnd()}\n\`\`\``}}]}:{}}case`Edit`:case`Write`:return{};case`ExitPlanMode`:return{title:`Exited Plan Mode`};default:return Di(i??``,r)}}function Ai(e){return e===`in_progress`?`in_progress`:e===`completed`?`completed`:`pending`}function X(e,t,n,r,i,a,o){let s=[];for(let i of e){let e=i.type,a=null;switch(e){case`text`:case`text_delta`:{let e=i.text??``;a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`thinking`:case`thinking_delta`:{let e=i.thinking??``;a={sessionUpdate:`agent_thought_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`text`,text:e}};break}case`image`:{let e=i.source;e?.type===`base64`&&(a={sessionUpdate:t===`assistant`?`agent_message_chunk`:`user_message_chunk`,...o?.messageId?{messageId:o.messageId}:{},content:{type:`image`,data:e.data,mimeType:e.media_type}});break}case`tool_use`:case`server_tool_use`:case`mcp_tool_use`:{let t=i.id??``,n=i.name??`unknown`,s=i.input,c=t in r;if(r[t]={type:e,id:t,name:n,input:s},n===`TodoWrite`){let e=s?.todos;Array.isArray(e)&&(a={sessionUpdate:`plan`,entries:e.map(e=>({content:e.content,status:Ai(e.status),priority:`medium`}))})}else{let e=s?{...s}:{};a=c?{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call_update`,status:`in_progress`,rawInput:e,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}:{_meta:{claudeCode:{toolName:n}},toolCallId:t,sessionUpdate:`tool_call`,rawInput:e,status:`pending`,...Y({name:n,id:t,input:s??{}},!1,o?.cwd)}}break}case`tool_result`:case`mcp_tool_result`:{let e=i.tool_use_id??``,t=r[e];if(!t)break;if(t.name!==`TodoWrite`){let n=ki(i,{name:t.name,id:t.id},!1);a={_meta:{claudeCode:{toolName:t.name}},toolCallId:e,sessionUpdate:`tool_call_update`,status:i.is_error===!0?`failed`:`completed`,rawOutput:i.content,...n}}break}case`redacted_thinking`:case`input_json_delta`:case`citations_delta`:case`signature_delta`:case`container_upload`:case`compaction`:case`compaction_delta`:break}if(a){if(o?.parentToolUseId){let e=a._meta;a._meta={...e,claudeCode:{...e?.claudeCode??{},parentToolUseId:o.parentToolUseId}}}s.push({sessionId:n,update:a})}}return s}function ji(e,t,n,r,i){let a=e.message;if(!a)return[];let o=a.content;if(!o)return[];if(typeof o==`string`)return[{sessionId:t,update:{sessionUpdate:`agent_message_chunk`,...i?.messageId?{messageId:i.messageId}:{},content:{type:`text`,text:o}}}];let s=i?.streamingActive?o.filter(e=>e.type!==`text`&&e.type!==`thinking`):o;return s.length===0?[]:X(s,`assistant`,t,n,r,void 0,i)}function Mi(e,t,n,r,i){let a=e.event;if(!a)return[];switch(a.type){case`content_block_start`:{let o=a.content_block;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`content_block_delta`:{let o=a.delta;return o?X([o],`assistant`,t,n,r,void 0,{clientCapabilities:i?.clientCapabilities,parentToolUseId:e.parent_tool_use_id,cwd:i?.cwd,messageId:i?.messageId}):[]}case`message_start`:case`message_delta`:case`message_stop`:case`content_block_stop`:return[];default:return[]}}function Ni(e,t){let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n}function Pi(e,t){let n=null,r=0;for(let i of Object.keys(e)){let e=Ni(i,t);e>r&&(r=e,n=i)}return n?e[n]??null:null}var Fi=console;function Ii(e,t){if(t.aborted)return Promise.resolve({done:!0,value:void 0});let n,r=new Promise(e=>{n=()=>e({done:!0,value:void 0}),t.addEventListener(`abort`,n,{once:!0})});return Promise.race([e.next(),r]).finally(()=>{n&&t.removeEventListener(`abort`,n)})}async function Li(e,t,n,r,i,a,o,s){let c=`end_turn`,l={inputTokens:0,outputTokens:0,cachedReadTokens:0,cachedWriteTokens:0},u=null,d=null,f=2e5,p=!1,m=null;try{for(;!r.aborted;){let s=await Ii(t,r);if(s.done||r.aborted)break;let h=s.value;if(h==null)continue;let g=h;switch(g.type){case`system`:g.subtype===`compact_boundary`&&(u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
9
|
-
|
|
10
|
-
Compacting completed.`}}}));break;case`result`:{let t=g.usage;t&&(l.inputTokens+=t.input_tokens??0,l.outputTokens+=t.output_tokens??0,l.cachedReadTokens+=t.cache_read_input_tokens??0,l.cachedWriteTokens+=t.cache_creation_input_tokens??0);let i=g.modelUsage;if(i&&d){let e=Pi(i,d);e?.contextWindow&&(f=e.contextWindow)}u!==null&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`usage_update`,used:u,size:f}});let a=g.subtype,o=g.is_error;if(r.aborted){c=`cancelled`;break}switch(a){case`success`:{let e=g.stop_reason;c=e===`max_tokens`?`max_tokens`:e===`refusal`?`refusal`:`end_turn`,o&&(c=`end_turn`);break}case`error_during_execution`:c=g.stop_reason===`max_tokens`?`max_tokens`:`end_turn`;break;case`error_max_budget_usd`:case`error_max_turns`:case`error_max_structured_output_retries`:c=`max_turn_requests`;break}break}case`stream_event`:{let t=g.parent_tool_use_id;t===null&&m===null&&(m=M());let r=Mi(g,e,i,n,{clientCapabilities:a,cwd:o,messageId:t===null?m??void 0:void 0});for(let e of r)await n.sessionUpdate(e);p=!0;break}case`assistant`:{let t=g.message,r=g.parent_tool_use_id;if(t?.usage&&r===null){let e=t.usage;u=(typeof e.input_tokens==`number`?e.input_tokens:0)+(typeof e.output_tokens==`number`?e.output_tokens:0)+(typeof e.cache_read_input_tokens==`number`?e.cache_read_input_tokens:0)+(typeof e.cache_creation_input_tokens==`number`?e.cache_creation_input_tokens:0)}r===null&&t?.model&&t.model!==`<synthetic>`&&(d=t.model);let s;r===null&&(m===null&&(m=M()),s=m);let c=ji(g,e,i,n,{clientCapabilities:a,cwd:o,parentToolUseId:r,streamingActive:p,messageId:s});for(let e of c)await n.sessionUpdate(e);r===null&&(m=null);break}case`user`:break;case`progress`:{let t=g.data;if(!t)break;let r=t.type;if(r===`agent_progress`||r===`skill_progress`){let r=t.message;if(r){let t=r.content;if(t)for(let r of t)r.type===`text`&&await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:r.text}}})}}break}case`tool_use_summary`:break;case`attachment`:break;case`compact_boundary`:u=0,await n.sessionUpdate({sessionId:e,update:{sessionUpdate:`agent_message_chunk`,content:{type:`text`,text:`
|
|
11
|
-
|
|
12
|
-
Compacting completed.`}}});break;default:Fi.debug(`Ignoring unknown SDK message type`);break}}if(r.aborted||s?.())return{stopReason:`cancelled`,usage:l}}catch(e){if(r.aborted)return{stopReason:`cancelled`,usage:l};throw e}return{stopReason:c,usage:l}}async function Ri(e,t,n,r,i,a){for(let o of t){let t=o;if(t.type!==`user`&&t.type!==`assistant`){Fi.debug(`Ignoring unknown SDK message type`);continue}if(t.isMeta===!0)continue;let s=t.message?.content;if(!s)continue;let c=t.type===`assistant`?`assistant`:`user`;if(typeof s==`string`){if(!s.trim())continue;let t=M();await n.sessionUpdate({sessionId:e,update:{sessionUpdate:c===`assistant`?`agent_message_chunk`:`user_message_chunk`,...t?{messageId:t}:{},content:{type:`text`,text:s}}});continue}if(Array.isArray(s)){let t=X(s,c,e,r,n,void 0,{clientCapabilities:i,cwd:a,messageId:M()});for(let e of t)await n.sessionUpdate(e)}}}function zi(e,t,r,i,a,o,s,c){return async(r,l,u,d,f,p)=>{let m=Vi(i);if(r.name===`ExitPlanMode`)return Bi(e,t,f,l,m,a,o,s,c);if(p!==void 0)return p;try{let e=await n(r,l,u,d,f);if(e.behavior===`allow`||e.behavior===`deny`)return e}catch(e){return console.error(`[ACP Permissions] Pipeline error:`,e),{behavior:`deny`,message:`Permission pipeline failed`,decisionReason:{type:`other`,reason:`Permission pipeline failed`},toolUseID:f}}let h=Y({name:r.name,id:f,input:l},m,a),g={toolCallId:f,title:h.title,kind:h.kind,status:`pending`,rawInput:l},_=[{kind:`allow_always`,name:`Always Allow`,optionId:`allow_always`},{kind:`allow_once`,name:`Allow`,optionId:`allow`},{kind:`reject_once`,name:`Reject`,optionId:`reject`},{kind:`reject_always`,name:`Always Reject`,optionId:`reject_always`}];try{let n=await e.requestPermission({sessionId:t,toolCall:g,options:_});if(n.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Permission request cancelled by client`,decisionReason:{type:`mode`,mode:`default`},toolUseID:f};if(n.outcome.outcome===`selected`&&`optionId`in n.outcome&&n.outcome.optionId!==void 0){let e=n.outcome.optionId;if(e===`allow`||e===`allow_always`)return{behavior:`allow`,updatedInput:l}}return{behavior:`deny`,message:`Permission denied by client`,decisionReason:{type:`mode`,mode:`default`}}}catch(e){return console.error(`[ACP Permissions] Client request error:`,e),{behavior:`deny`,message:`Permission request failed`,decisionReason:{type:`mode`,mode:`default`}}}}}async function Bi(e,t,n,r,i,a,o,s,c){let l=[{kind:`allow_always`,name:`Yes, and use "auto" mode`,optionId:`auto`},{kind:`allow_always`,name:`Yes, and auto-accept edits`,optionId:`acceptEdits`},{kind:`allow_once`,name:`Yes, and manually approve edits`,optionId:`default`},{kind:`reject_once`,name:`No, keep planning`,optionId:`plan`}];s?.()===!0&&l.unshift({kind:`allow_always`,name:`Yes, and bypass permissions`,optionId:`bypassPermissions`});let u=Y({name:`ExitPlanMode`,id:n,input:r},i,a),d={toolCallId:n,title:u.title,kind:u.kind,status:`pending`,rawInput:r},f=await e.requestPermission({sessionId:t,toolCall:d,options:l});if(f.outcome.outcome===`cancelled`)return c?.(),{behavior:`deny`,message:`Tool use aborted`,decisionReason:{type:`mode`,mode:`default`}};if(f.outcome.outcome===`selected`&&`optionId`in f.outcome&&f.outcome.optionId!==void 0){let n=f.outcome.optionId;if(l.some(e=>e.optionId===n)&&(n==="default"||n===`acceptEdits`||n===`auto`||n===`bypassPermissions`))return o?.(n),await e.sessionUpdate({sessionId:t,update:{sessionUpdate:`current_mode_update`,currentModeId:n}}),{behavior:`allow`,updatedInput:r}}return{behavior:`deny`,message:`User rejected request to exit plan mode.`,decisionReason:{type:`mode`,mode:`plan`}}}function Vi(e){if(!e)return!1;if(e.terminal===!0)return!0;let t=e._meta;return!t||typeof t!=`object`?!1:t.terminal_output===!0}pe(),be(),s(),le(),e(),m();var Z=class{constructor(e){t(this,`conn`,void 0),t(this,`sessions`,new Map),t(this,`clientCapabilities`,void 0),this.conn=e}async initialize(e){return this.clientCapabilities=e.clientCapabilities,{protocolVersion:1,authMethods:[],agentInfo:{name:`workmate`,title:`Work Mate`,version:typeof globalThis.MACRO==`object`&&globalThis.MACRO!==null?String(globalThis.MACRO.VERSION??`0.0.0`):`0.0.0`},agentCapabilities:{_meta:{claudeCode:{promptQueueing:!0,forkSession:!0}},promptCapabilities:{image:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0},loadSession:!0,sessionCapabilities:{list:{},resume:{},close:{},delete:{}}}}}async authenticate(e){return{}}async newSession(e){let t=await this.createSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async unstable_resumeSession(e){let t=await this.getOrCreateSession({...e,replay:!1});return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async loadSession(e){let t=await this.getOrCreateSession(e);return this.scheduleAvailableCommandsUpdate(t.sessionId),t}async listSessions(e){if(e.cursor!==void 0&&e.cursor!==null)throw Error(`Pagination cursor not supported: listSessions returns all results in a single page.`);let t=e.cwd||ne(),n=await ue(t),r=await p({dir:t}),i=[];for(let e of r){if(!e.cwd||await ue(e.cwd)!==n)continue;let t=wi(e.summary??``);i.push({sessionId:e.sessionId,cwd:e.cwd,...t?{title:t}:{},updatedAt:new Date(e.lastModified).toISOString()})}return{sessions:i}}async unstable_forkSession(e){let{initialMessages:t}=await Hi(e.sessionId),n=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{initialMessages:t});return this.scheduleAvailableCommandsUpdate(n.sessionId),n}async unstable_closeSession(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return await this.teardownSession(e.sessionId),{}}async unstable_deleteSession(e){let t=await oe(e.sessionId);if(t)try{await Ee(t.filePath)}catch(e){if(e.code!==`ENOENT`)throw e}return this.sessions.has(e.sessionId)&&await this.teardownSession(e.sessionId),{}}async extMethod(e,t){if(e===`session/delete`){let e=t.sessionId;if(typeof e!=`string`||e.length===0)throw Error(`session/delete requires a non-empty sessionId`);return this.unstable_deleteSession({sessionId:e})}throw q.methodNotFound(e)}async cancel(e){let t=this.sessions.get(e.sessionId);if(t){t.cancelled=!0,t.cancelGeneration+=1;for(let[,e]of t.pendingMessages)e.resolve(!0);t.pendingMessages.clear(),t.pendingQueue=[],t.pendingQueueHead=0,t.queryEngine.interrupt()}}async setSessionMode(e){if(!this.sessions.get(e.sessionId))throw Error(`Session not found`);return this.applySessionMode(e.sessionId,e.modeId),await this.conn.sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:e.modeId}}),await this.updateConfigOption(e.sessionId,`mode`,e.modeId),{}}async unstable_setSessionModel(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);return t.queryEngine.setModel(e.modelId),await this.updateConfigOption(e.sessionId,`model`,e.modelId),{}}async sendAvailableCommandsUpdate(e){let t=this.sessions.get(e);if(!t)return;let n=t.commands.filter(e=>e.type===`prompt`&&!e.isHidden&&e.userInvocable!==!1).map(e=>({name:e.name,description:e.description,input:e.argumentHint?{hint:e.argumentHint}:void 0}));await this.conn.sessionUpdate({sessionId:e,update:{sessionUpdate:`available_commands_update`,availableCommands:n}})}scheduleAvailableCommandsUpdate(e){setTimeout(()=>{this.sendAvailableCommandsUpdate(e).catch(e=>{console.error(`[ACP] Failed to send available commands update:`,e)})},0)}};async function Hi(e){let t;try{let n=await _(e);n&&n.messages.length>0&&(t=_e(n.messages))}catch(e){console.error(`[ACP] fork source load failed:`,e)}return{initialMessages:t}}var Ui=[`auto`,`default`,`acceptEdits`,`bypassPermissions`,`dontAsk`,`plan`];function Wi(e){return Ui.includes(e)}function Gi(e,t,n){if(t){let t=Ki(e,`_meta.permissionMode`);if(t===`bypassPermissions`&&!Yi())throw Error(`Mode not available: bypassPermissions cannot run as root (start the agent as a non-root user, or set IS_SANDBOX=1).`);return t}return qi(n)??`default`}function Ki(e,t){if(e==null)throw Error(`Invalid ${t}: expected a string.`);return xi(e,t)}function qi(e){if(e!=null)try{return xi(e,`permissions.defaultMode`)}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[ACP] Invalid permissions.defaultMode, using default:`,t);return}}function Ji(e,t){return!!e&&Object.hasOwn(e,t)}function Yi(){return Xi()}function Xi(){return process.env.IS_SANDBOX?!0:typeof process.geteuid==`function`?process.geteuid()!==0:typeof process.getuid!=`function`||process.getuid()!==0}function Zi(e,t){return[{id:`mode`,name:`Mode`,description:`Session permission mode`,category:`mode`,type:`select`,currentValue:e.currentModeId,options:e.availableModes.map(e=>({value:e.id,name:e.name,description:e.description}))},{id:`model`,name:`Model`,description:`AI model to use`,category:`model`,type:`select`,currentValue:t.currentModelId,options:t.availableModels.map(e=>({value:e.modelId,name:e.name,description:e.description??void 0}))}]}function Qi(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(Array.isArray(e.options))for(let n of e.options)n&&typeof n==`object`&&typeof n.value==`string`&&t.push(n.value);else typeof n.value==`string`&&t.push(n.value)}return t}function Q(e){return e.conn}function $(e){return e.clientCapabilities}function $i(e,t,n,r){n===`mode`?t.modes={...t.modes,currentModeId:r}:n===`model`&&(t.models={...t.models,currentModelId:r})}A();function ea(){return se().permissions?.defaultMode}async function ta(e,t={}){fe();let n=t.sessionId??M(),r=e.cwd;j(n,re()),k(r);let i=process.cwd(),a=!1;try{process.chdir(r),a=!0}catch{}ae(),xe();try{let i=he(),a=d(i),s=e._meta,c=Ji(s,`permissionMode`),f=Gi(c?s?.permissionMode:void 0,c,ea()),p=$(this),m=this.conn,g=zi(m,n,()=>this.sessions.get(n)?.modes.currentModeId??`default`,p,r,e=>{this.applySessionMode(n,e)},()=>this.sessions.get(n)?.appState.toolPermissionContext.isBypassPermissionsModeAvailable??!1),_=Yi(),v={...o(),toolPermissionContext:{...i,mode:f,isBypassPermissionsModeAvailable:_}},[y,b]=await Promise.all([l(r),h(r)]);v.agentDefinitions=b;let x=new ve({cwd:r,tools:a,commands:y,mcpClients:[],agents:b.activeAgents,canUseTool:g,getAppState:()=>v,setAppState:e=>{let t=e(v);Object.assign(v,t)},readFileCache:new u(500,50*1024*1024),includePartialMessages:!0,replayUserMessages:!0,initialMessages:t.initialMessages}),S={currentModeId:f,availableModes:[{id:`default`,name:`Default`,description:`Standard behavior, prompts for dangerous operations`},{id:`acceptEdits`,name:`Accept Edits`,description:`Auto-accept file edit operations`},{id:`plan`,name:`Plan Mode`,description:`Planning mode, no actual tool execution`},{id:`auto`,name:`Auto`,description:`Use a model classifier to approve/deny permission prompts.`},..._?[{id:`bypassPermissions`,name:`Bypass Permissions`,description:`Skip all permission checks`}]:[],{id:`dontAsk`,name:`Don't Ask`,description:`Don't prompt for permissions, deny if not pre-approved`}]},C=ye(),w=me(),T={availableModels:C.map(e=>({modelId:String(e.value??``),name:e.label??String(e.value??``),description:e.description??void 0})),currentModelId:w};x.setModel(w);let E=Zi(S,T),D={queryEngine:x,cancelled:!1,cancelGeneration:0,cwd:r,modes:S,models:T,configOptions:E,promptRunning:!1,pendingMessages:new Map,pendingQueue:[],pendingQueueHead:0,toolUseCache:{},clientCapabilities:p,appState:v,commands:y,sessionFingerprint:Si({cwd:r,mcpServers:e.mcpServers})};return this.sessions.set(n,D),{sessionId:n,modes:S,models:T,configOptions:E}}finally{a&&process.chdir(i)}}Object.assign(Z.prototype,{createSession:ta}),m(),A(),le();async function na(e){let t=e.replay!==!1,n=this.sessions.get(e.sessionId);if(n){if(Si({cwd:e.cwd,mcpServers:e.mcpServers})===n.sessionFingerprint){let r=await oe(e.sessionId,e.cwd);return j(e.sessionId,r?Ce(r.filePath):null),k(e.cwd),t&&await this.replaySessionHistory(e),{sessionId:e.sessionId,modes:n.modes,models:n.models,configOptions:n.configOptions}}await this.teardownSession(e.sessionId)}let r=await oe(e.sessionId,e.cwd),i=r?Ce(r.filePath):null;j(e.sessionId,i),k(e.cwd);let a;if(r)try{let t=await _(e.sessionId);t&&t.messages.length>0&&(a=_e(t.messages))}catch(e){console.error(`[ACP] Failed to load session history:`,e)}let o=await this.createSession({cwd:e.cwd,mcpServers:e.mcpServers??[],_meta:e._meta},{sessionId:e.sessionId,initialMessages:a});if(t&&a&&a.length>0){let t=this.sessions.get(e.sessionId);t&&await Ri(e.sessionId,a,Q(this),t.toolUseCache,$(this),t.cwd)}return{sessionId:o.sessionId,modes:o.modes,models:o.models,configOptions:o.configOptions}}async function ra(e){this.sessions.get(e)&&(await this.cancel({sessionId:e}),this.sessions.delete(e))}async function ia(e){try{let t=await _(e.sessionId);if(!t||t.messages.length===0)return;let n=_e(t.messages);if(n.length===0)return;let r=this.sessions.get(e.sessionId);if(!r)return;await Ri(e.sessionId,n,Q(this),r.toolUseCache,$(this),r.cwd)}catch(e){console.error(`[ACP] Failed to replay session history:`,e)}}function aa(e,t){if(!Wi(t))throw Error(`Invalid mode: ${t}`);let n=this.sessions.get(e);if(n){if(t===`bypassPermissions`&&!n.appState.toolPermissionContext.isBypassPermissionsModeAvailable||!n.modes.availableModes.some(e=>e.id===t))throw Error(`Mode not available: ${t}`);n.modes={...n.modes,currentModeId:t},n.appState.toolPermissionContext={...n.appState.toolPermissionContext,mode:t}}}async function oa(e,t,n){let r=this.sessions.get(e);r&&($i(this,r,t,n),r.configOptions=r.configOptions.map(e=>e.id===t&&typeof e.currentValue==`string`?{...e,currentValue:n}:e),await Q(this).sessionUpdate({sessionId:e,update:{sessionUpdate:`config_option_update`,configOptions:r.configOptions}}))}Object.assign(Z.prototype,{getOrCreateSession:na,teardownSession:ra,replaySessionHistory:ia,applySessionMode:aa,updateConfigOption:oa});function sa(e){if(!e||e.length===0)return``;let t=[];for(let n of e){let e=n;if(e.type===`text`)t.push(String(e.text??``));else if(e.type===`resource_link`){let n=typeof e.name==`string`?e.name:void 0,r=typeof e.uri==`string`?e.uri:void 0;t.push(ca(n,r))}else if(e.type===`resource`){let n=e.resource;if(n&&typeof n.text==`string`)t.push(n.text);else if(n&&typeof n.blob==`string`){let e=typeof n.mimeType==`string`?n.mimeType:`application/octet-stream`,r=typeof n.uri==`string`?n.uri:`(unknown uri)`;t.push(`Embedded resource: ${r} (${e}, base64 blob, ${n.blob.length} chars)`)}}}return t.filter(e=>e.length>0).join(`
|
|
13
|
-
`)}function ca(e,t){let n=[];return e&&e.length>0&&n.push(`name=${e}`),t&&t.length>0&&n.push(`uri=${t}`),n.length>0?`Resource link: ${n.join(`, `)}`:`Resource link`}function la(e){for(;e.pendingQueueHead<e.pendingQueue.length;){let t=e.pendingQueue[e.pendingQueueHead++];if(!t)continue;let n=e.pendingMessages.get(t);if(n)return e.pendingMessages.delete(t),ua(e),n}ua(e)}function ua(e){if(e.pendingQueueHead!==0){if(e.pendingQueueHead>=e.pendingQueue.length){e.pendingQueue=[],e.pendingQueueHead=0;return}e.pendingQueueHead>1024&&e.pendingQueueHead*2>e.pendingQueue.length&&(e.pendingQueue=e.pendingQueue.slice(e.pendingQueueHead),e.pendingQueueHead=0)}}A();async function da(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session ${e.sessionId} not found`);let n=e.messageId??void 0,r=sa(e.prompt);if(!r.trim())throw Error(`Prompt content is empty`);let i=t.cancelGeneration;if(t.promptRunning){let e=M();if(await new Promise(n=>{t.pendingQueue.push(e),t.pendingMessages.set(e,{resolve:n})}))return{stopReason:`cancelled`}}if(t.cancelGeneration!==i)return{stopReason:`cancelled`};t.cancelled=!1,t.promptRunning=!0;try{t.queryEngine.resetAbortController(),j(e.sessionId,re());let i=t.queryEngine.submitMessage(r),{stopReason:a,usage:o}=await Li(e.sessionId,i,Q(this),t.queryEngine.getAbortSignal(),t.toolUseCache,$(this),t.cwd,()=>t.cancelled);if(t.cancelled)return{stopReason:`cancelled`};if(await pa(this,e.sessionId,r),o){let e={inputTokens:o.inputTokens,outputTokens:o.outputTokens,cachedReadTokens:o.cachedReadTokens,cachedWriteTokens:o.cachedWriteTokens,thoughtTokens:0,totalTokens:o.inputTokens+o.outputTokens+o.cachedReadTokens+o.cachedWriteTokens+0};return{stopReason:a,usage:e,...n?{userMessageId:n}:{},_meta:{claudeCode:{usage:e}}}}return{stopReason:a,...n?{userMessageId:n}:{}}}catch(n){let r=n instanceof Error&&(n.name===`AbortError`||/abort|cancelled|interrupt/i.test(n.message));if(t.cancelled||r)return{stopReason:`cancelled`};throw n instanceof Error&&(n.message.includes(`terminated`)||n.message.includes(`process exited`))?(await this.teardownSession(e.sessionId),Error(`The Work Mate Agent process exited unexpectedly. Please start a new session.`)):n}finally{let e=la(t);e?(t.promptRunning=!0,e.resolve(!1)):t.promptRunning=!1}}async function fa(e){let t=this.sessions.get(e.sessionId);if(!t)throw Error(`Session not found`);if(typeof e.value!=`string`)throw Error(`Invalid value for config option ${e.configId}: ${String(e.value)}`);let n=t.configOptions.find(t=>t.id===e.configId);if(!n)throw Error(`Unknown config option: ${e.configId}`);if(n.type===`select`){let t=Qi(n.options);if(!t.includes(e.value))throw Error(`Invalid value '${e.value}' for config option ${e.configId}; must be one of: ${t.join(`, `)}`)}let r=e.value;return e.configId===`mode`?(this.applySessionMode(e.sessionId,r),await Q(this).sessionUpdate({sessionId:e.sessionId,update:{sessionUpdate:`current_mode_update`,currentModeId:r}})):e.configId===`model`&&t.queryEngine.setModel(r),$i(this,t,e.configId,r),t.configOptions=t.configOptions.map(t=>t.id===e.configId&&typeof t.currentValue==`string`?{...t,currentValue:r}:t),{configOptions:t.configOptions}}async function pa(e,t,n){let r=e.sessions.get(t);if(!r)return;let i=r.toolUseCache;if(i.__sessionInfoTitleSent)return;i.__sessionInfoTitleSent=!0;let a=wi(n).slice(0,100);try{await Q(e).sessionUpdate({sessionId:t,update:{sessionUpdate:`session_info_update`,...a?{title:a}:{},updatedAt:new Date().toISOString()}})}catch(e){console.error(`[ACP] Failed to send session_info_update:`,e)}}Object.assign(Z.prototype,{prompt:da,setSessionConfigOption:fa}),de(),Se();function ma(e,t){let n=we.toWeb(e);return mi(Te.toWeb(t),n)}async function ha(){fe(),xe();let e=ma(process.stdin,process.stdout),t,n=new gi(e=>(t=new Z(e),t),e);console.log=console.error,console.info=console.error,console.warn=console.error,console.debug=console.error;async function r(){for(let[e]of t.sessions)try{await t.unstable_closeSession({sessionId:e})}catch{}process.exit(0)}n.closed.then(r).catch(r),process.on(`SIGTERM`,r),process.on(`SIGINT`,r),process.on(`unhandledRejection`,(e,t)=>{console.error(`Unhandled Rejection at:`,t,`reason:`,e)}),process.stdin.resume()}export{ha as runAcpAgent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,o as i}from"./envUtils-DfkgIdYf.js";import{n as a,t as o}from"./defineProperty-C-QyHrDq.js";import{E as s,O as c,S as l,i as u,l as d,n as f,s as p,v as ee}from"./esm-lWlUmoUA.js";import{B as m,C as te,D as h,E as ne,F as re,O as ie,S as ae,T as oe,b as se,c as ce,i as le,m as ue,n as g,o as de,u as fe,v as _,x as pe}from"./esm-BbMeEYcz.js";import{n as me,t as he}from"./esm-sVMjGuep.js";import{F as ge,I as _e,It as ve,Y as ye,at as be,st as xe,x as Se}from"./state-B4jiUise.js";import{C as Ce,I as we,i as Te,x as Ee}from"./debug-Bglx1aTu.js";import{Gt as De,Lr as Oe,Pr as ke,Ut as Ae,Wt as v,h as je,qt as Me,t as Ne}from"./settings-B2jvL8Dp.js";import{i as Pe,t as Fe}from"./execFileNoThrow-BTachNBI.js";import{a as Ie,n as Le,o as Re,r as ze}from"./platform-BacQ6ACS.js";import{Bt as Be,Ft as Ve,Gt as He,It as Ue,Lt as We,Pt as Ge,Qt as Ke,Vt as qe,Yt as y,Zt as Je,bt as Ye,d as Xe,o as Ze,t as b,yt as Qe,zt as $e}from"./model-BwBG0V1u.js";import{i as et,t as tt}from"./genericProcessUtils-DwQFuna9.js";import{arch as nt,hostname as rt,platform as it,release as at}from"os";import{extname as ot}from"path";import{stat as st}from"fs/promises";import{inspect as ct}from"util";import*as lt from"process";import{AsyncLocalStorage as ut}from"async_hooks";var x,dt=e((()=>{(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(x||(x={}))})),ft,pt,mt=e((()=>{ft=class{emit(e){}enabled(){return!1}},pt=new ft}));function ht(e,t,n){return r=>r===e?t:n}var S,C,gt=e((()=>{S=Symbol.for(`io.opentelemetry.js.api.logs`),C=globalThis})),_t,vt,yt=e((()=>{mt(),_t=class{getLogger(e,t,n){return new ft}},vt=new _t})),bt,xt=e((()=>{mt(),bt=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):pt}}})),w,St=e((()=>{yt(),xt(),w=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new bt(this,e,t,n)}_getDelegate(){return this._delegate??vt}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}}})),Ct,wt=e((()=>{gt(),yt(),St(),Ct=class e{constructor(){this._proxyLoggerProvider=new w}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return C[S]?this.getLoggerProvider():(C[S]=ht(1,e,vt),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return C[S]?.call(C,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete C[S],this._proxyLoggerProvider=new w}}})),Tt,T=e((()=>{dt(),mt(),wt(),Tt=Ct.getInstance()}));function Et(){return`workmate/0.0.23`}var Dt=e((()=>{})),Ot,kt,E,At=e((()=>{n(),Je(),Ot=[{modelEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`ANTHROPIC_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],kt=[{modelEnvVar:`OPENAI_DEFAULT_OPUS_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_OPUS_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_SONNET_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_SONNET_MODEL_SUPPORTED_CAPABILITIES`},{modelEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL`,capabilitiesEnvVar:`OPENAI_DEFAULT_HAIKU_MODEL_SUPPORTED_CAPABILITIES`}],E=t((e,t)=>{if(y()===`firstParty`)return;let n=e.toLowerCase(),r=y()===`openai`?kt:Ot;for(let e of r){let r=process.env[e.modelEnvVar],i=process.env[e.capabilitiesEnvVar];if(!(!r||i===void 0)&&n===r.toLowerCase())return i.toLowerCase().split(`,`).map(e=>e.trim()).includes(t)}},(e,t)=>`${e.toLowerCase()}:${t}`)}));function jt(e){let t=[],n=[];for(let r of e)O.includes(r)?t.push(r):n.push(r);return{allowed:t,disallowed:n}}function Mt(e){if(!e||e.length===0)return;let{allowed:t,disallowed:n}=jt(e);for(let e of n)console.warn(`Warning: Beta header '${e}' is not allowed. Only the following betas are supported: ${O.join(`, `)}`);return t.length>0?t:void 0}function Nt(e){let t=E(e,`interleaved_thinking`);if(t!==void 0)return t;let n=b(e),r=y();return r===`foundry`?!0:r===`firstParty`?!n.includes(`claude-3-`):n.includes(`claude-opus-4`)||n.includes(`claude-sonnet-4`)}function Pt(e){let t=b(e),n=y();return n===`foundry`?!0:n===`firstParty`?!t.includes(`claude-3-`):t.includes(`claude-opus-4`)||t.includes(`claude-sonnet-4`)||t.includes(`claude-haiku-4`)}function Ft(e){let t=b(e),n=y();return n!==`firstParty`&&n!==`foundry`?!1:t.includes(`claude-sonnet-4-6`)||t.includes(`claude-sonnet-4-5`)||t.includes(`claude-opus-4-1`)||t.includes(`claude-opus-4-5`)||t.includes(`claude-opus-4-6`)||t.includes(`claude-opus-4-7`)||t.includes(`claude-haiku-4-5`)}function It(e){return!0}function D(){return(y()===`firstParty`||y()===`foundry`)&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)&&Ke()}function Lt(){return y()===`firstParty`&&!r(process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS)}function Rt(e,t){let n=[...k(e)];t?.isAgenticQuery&&(n.includes(`claude-code-20250219`)||n.push(Ve));let r=be();return!r||r.length===0?n:[...n,...r.filter(e=>!n.includes(e))]}var O,zt,k,Bt,Vt=e((()=>{n(),ve(),He(),Ye(),i(),Xe(),At(),Je(),je(),O=[Ue],zt=t(e=>{let t=[],n=b(e).includes(`haiku`);y();let i=D();n||t.push(Ve),Qe(e)&&t.push(Ue),!r(process.env.DISABLE_INTERLEAVED_THINKING)&&Nt(e)&&t.push($e),i&&Nt(e)&&!_e()&&Ne().showThinkingSummaries!==!0&&t.push(qe);let a=r(process.env.USE_API_CONTEXT_MANAGEMENT)||Pt(e),o=Pt(e);return D()&&(a||o)&&t.push(We),i&&Ft(e),i&&t.push(Be),process.env.ANTHROPIC_BETAS&&t.push(...process.env.ANTHROPIC_BETAS.split(`,`).map(e=>e.trim()).filter(Boolean)),t}),k=t(e=>{let t=zt(e);return y()===`bedrock`?t.filter(e=>!Ge.has(e)):t}),Bt=t(e=>zt(e).filter(e=>Ge.has(e)))}));function Ht(){return process.platform===`linux`&&r(process.env.CLAUDE_CODE_BUBBLEWRAP)}function Ut(){return process.platform===`linux`?A??!1:!1}async function Wt(){if(j!==void 0)return j;if(process.platform===`darwin`)return j=null,null;try{let e=await tt(process.pid,10);for(let t of e){let e=t.toLowerCase();for(let t of Ae)if(e.includes(t))return j=t,t}}catch{}return j=null,null}async function Gt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?await Wt()||`pycharm`:v.terminal}function Kt(){return process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&v.platform!==`darwin`?j===void 0?`pycharm`:j||`pycharm`:v.terminal}async function qt(){process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`&&await Wt()}var Jt,A,j,Yt,Xt=e((()=>{n(),Me(),i(),Pe(),et(),Jt=t(async()=>{if(process.platform!==`linux`)return!1;let{code:e}=await Fe(`test`,[`-f`,`/.dockerenv`]);return e===0}),A=null,process.platform===`linux`&&st(`/lib/libc.musl-${process.arch===`x64`?`x86_64`:`aarch64`}.so.1`).then(()=>{A=!0},()=>{A=!1}),Yt={...v,terminal:Kt(),getIsDocker:Jt,getIsBubblewrapSandbox:Ht,isMuslEnvironment:Ut,getTerminalWithJetBrainsDetectionAsync:Gt,initJetBrainsDetection:qt}}));function Zt(e){return Qt?.has(e)??!1}var Qt,$t=e((()=>{Te(),we()}));function M(){return an.getStore()}function en(e,t){return an.run(e,t)}function tn(e){return e?.agentType===`subagent`}function nn(){let e=M();if(!(!tn(e)||!e.subagentName))return e.isBuiltIn?e.subagentName:`user-defined`}function rn(){let e=M();if(!(!e?.invokingRequestId||e.invocationEmitted))return e.invocationEmitted=!0,{invokingRequestId:e.invokingRequestId,invocationKind:e.invocationKind}}var an,on=e((()=>{an=new ut}));function sn(e){return e.startsWith(`mcp__`)?`mcp_tool`:e}function cn(){return r(process.env.OTEL_LOG_TOOL_DETAILS)}function ln(e,t){return!!(process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`||e===`claudeai-proxy`||t&&Zt(t))}function un(e,t,n){let r=dn(e);return!r||!yn.has(r.serverName)&&!ln(t,n)?{}:{mcpServerName:r.serverName,mcpToolName:r.mcpToolName}}function dn(e){if(!e.startsWith(`mcp__`))return;let t=e.split(`__`);if(t.length<3)return;let n=t[1],r=t.slice(2).join(`__`);if(!(!n||!r))return{serverName:n,mcpToolName:r}}function fn(e,t){if(e===`Skill`&&typeof t==`object`&&t&&`skill`in t&&typeof t.skill==`string`)return t.skill}function N(e,t=0){if(typeof e==`string`)return e.length>bn?`${e.slice(0,xn)}…[${e.length} chars]`:e;if(typeof e==`number`||typeof e==`boolean`||e==null)return e;if(t>=Sn)return`<nested>`;if(Array.isArray(e)){let n=e.slice(0,I).map(e=>N(e,t+1));return e.length>I&&n.push(`…[${e.length} items]`),n}if(typeof e==`object`){let n=Object.entries(e).filter(([e])=>!e.startsWith(`_`)),r=n.slice(0,I).map(([e,n])=>[e,N(n,t+1)]);return n.length>I&&r.push([`…`,`${n.length} keys`]),Object.fromEntries(r)}return String(e)}function pn(e){if(!cn())return;let t=Ce(N(e));return t.length>F&&(t=`${t.slice(0,F)}…[truncated]`),t}function P(e){let t=ot(e).toLowerCase();if(!t||t===`.`)return;let n=t.slice(1);return n.length>Cn?`other`:n}function mn(e,t){if(!e.includes(`.`)&&!t)return;let n,r=new Set;if(t){let e=P(t);e&&(r.add(e),n=e)}for(let t of e.split(Tn)){if(!t)continue;let e=t.split(En);if(e.length<2)continue;let i=e[0],a=i.lastIndexOf(`/`),o=a>=0?i.slice(a+1):i;if(wn.has(o))for(let t=1;t<e.length;t++){let i=e[t];if(i.charCodeAt(0)===45)continue;let a=P(i);a&&!r.has(a)&&(r.add(a),n=n?`${n},${a}`:a)}}if(n)return n}function hn(){let e=M();if(e)return{agentId:e.agentId,parentSessionId:e.parentSessionId,agentType:e.agentType};let t=process.env.CLAUDE_CODE_AGENT_ID,n=process.env.CLAUDE_CODE_PARENT_SESSION_ID,r=t?`standalone`:void 0;if(t||r||n)return{...t?{agentId:t}:{},...r?{agentType:r}:{},...n?{parentSessionId:n}:{}};let i=ye();return i?{parentSessionId:i}:{}}function gn(){try{let e=process.memoryUsage(),t=process.cpuUsage(),n=Date.now(),r;if(L&&R){let e=n-R;e>0&&(r=(t.user-L.user+(t.system-L.system))/(e*1e3)*100)}return L=t,R=n,{uptime:process.uptime(),rss:e.rss,heapTotal:e.heapTotal,heapUsed:e.heapUsed,external:e.external,arrayBuffers:e.arrayBuffers,constrainedMemory:process.constrainedMemory(),cpuUsage:t,cpuPercent:r}}catch{return}}async function _n(e={}){let t=e.model?String(e.model):Ze(),n=typeof e.betas==`string`?e.betas:k(t).join(`,`),[r,i]=await Promise.all([On(),ke()]),a=gn();return{model:t,sessionId:xe(),userType:process.env.USER_TYPE||``,...n.length>0?{betas:n}:{},envContext:r,...process.env.CLAUDE_CODE_ENTRYPOINT&&{entrypoint:process.env.CLAUDE_CODE_ENTRYPOINT},...process.env.CLAUDE_AGENT_SDK_VERSION&&{agentSdkVersion:process.env.CLAUDE_AGENT_SDK_VERSION},isInteractive:String(ge()),clientType:Se(),...a&&{processMetrics:a},sweBenchRunId:process.env.SWE_BENCH_RUN_ID||``,sweBenchInstanceId:process.env.SWE_BENCH_INSTANCE_ID||``,sweBenchTaskId:process.env.SWE_BENCH_TASK_ID||``,...hn(),...i&&{rh:i}}}function vn(e,t,n={}){let{envContext:r,processMetrics:i,rh:a,skillMode:o,observerMode:s,...c}=e,l={platform:r.platform,platform_raw:r.platformRaw,arch:r.arch,node_version:r.nodeVersion,terminal:r.terminal||`unknown`,package_managers:r.packageManagers,runtimes:r.runtimes,is_running_with_bun:r.isRunningWithBun,is_ci:r.isCi,is_claubbit:r.isClaubbit,is_claude_code_remote:r.isClaudeCodeRemote,is_local_agent_mode:r.isLocalAgentMode,is_conductor:r.isConductor,is_github_action:r.isGithubAction,is_claude_code_action:r.isClaudeCodeAction,version:r.version,build_time:r.buildTime,deployment_environment:r.deploymentEnvironment};r.remoteEnvironmentType&&(l.remote_environment_type=r.remoteEnvironmentType),r.claudeCodeContainerId&&(l.claude_code_container_id=r.claudeCodeContainerId),r.claudeCodeRemoteSessionId&&(l.claude_code_remote_session_id=r.claudeCodeRemoteSessionId),r.tags&&(l.tags=r.tags.split(`,`).map(e=>e.trim()).filter(Boolean)),r.githubEventName&&(l.github_event_name=r.githubEventName),r.githubActionsRunnerEnvironment&&(l.github_actions_runner_environment=r.githubActionsRunnerEnvironment),r.githubActionsRunnerOs&&(l.github_actions_runner_os=r.githubActionsRunnerOs),r.githubActionRef&&(l.github_action_ref=r.githubActionRef),r.wslVersion&&(l.wsl_version=r.wslVersion),r.linuxDistroId&&(l.linux_distro_id=r.linuxDistroId),r.linuxDistroVersion&&(l.linux_distro_version=r.linuxDistroVersion),r.linuxKernel&&(l.linux_kernel=r.linuxKernel),r.vcs&&(l.vcs=r.vcs),r.versionBase&&(l.version_base=r.versionBase);let u={session_id:c.sessionId,model:c.model,user_type:c.userType,is_interactive:c.isInteractive===`true`,client_type:c.clientType};if(c.betas&&(u.betas=c.betas),c.entrypoint&&(u.entrypoint=c.entrypoint),c.agentSdkVersion&&(u.agent_sdk_version=c.agentSdkVersion),c.sweBenchRunId&&(u.swe_bench_run_id=c.sweBenchRunId),c.sweBenchInstanceId&&(u.swe_bench_instance_id=c.sweBenchInstanceId),c.sweBenchTaskId&&(u.swe_bench_task_id=c.sweBenchTaskId),c.agentId&&(u.agent_id=c.agentId),c.parentSessionId&&(u.parent_session_id=c.parentSessionId),c.agentType&&(u.agent_type=c.agentType),t.githubActionsMetadata){let e=t.githubActionsMetadata;l.github_actions_metadata={actor_id:e.actorId,repository_id:e.repositoryId,repository_owner_id:e.repositoryOwnerId}}let d;return(t.accountUuid||t.organizationUuid)&&(d={account_uuid:t.accountUuid,organization_uuid:t.organizationUuid}),{env:l,...i&&{process:Buffer.from(Ce(i)).toString(`base64`)},...d&&{auth:d},core:u,additional:{...a&&{rh:a},...o&&{skill_mode:o},...s&&{observer_mode:s},...n}}}var yn,bn,xn,F,I,Sn,Cn,wn,Tn,En,Dn,On,L,R,kn=e((()=>{n(),Me(),Xt(),Vt(),Xe(),ve(),i(),$t(),Oe(),Re(),on(),Ee(),yn=new Set,bn=512,xn=128,F=4*1024,I=20,Sn=2,Cn=10,wn=new Set([`rm`,`mv`,`cp`,`touch`,`mkdir`,`chmod`,`chown`,`cat`,`head`,`tail`,`sort`,`stat`,`diff`,`wc`,`grep`,`rg`,`sed`]),Tn=/\s*(?:&&|\|\||[;|])\s*/,En=/\s+/,Dn=t(()=>{let e=`0.0.23`.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/);return e?e[0]:void 0}),On=t(async()=>{let[e,t,n,i]=await Promise.all([v.getPackageManagers(),v.getRuntimes(),ze(),Le()]);return{platform:De(),platformRaw:process.env.CLAUDE_CODE_HOST_PLATFORM||process.platform,arch:v.arch,nodeVersion:v.nodeVersion,terminal:Yt.terminal,packageManagers:e.join(`,`),runtimes:t.join(`,`),isRunningWithBun:v.isRunningWithBun(),isCi:r(process.env.CI),isClaubbit:r(process.env.CLAUBBIT),isClaudeCodeRemote:r(process.env.CLAUDE_CODE_REMOTE),isLocalAgentMode:process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`,isConductor:v.isConductor(),...process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE&&{remoteEnvironmentType:process.env.CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE},...process.env.CLAUDE_CODE_CONTAINER_ID&&{claudeCodeContainerId:process.env.CLAUDE_CODE_CONTAINER_ID},...process.env.CLAUDE_CODE_REMOTE_SESSION_ID&&{claudeCodeRemoteSessionId:process.env.CLAUDE_CODE_REMOTE_SESSION_ID},...process.env.CLAUDE_CODE_TAGS&&{tags:process.env.CLAUDE_CODE_TAGS},isGithubAction:r(process.env.GITHUB_ACTIONS),isClaudeCodeAction:r(process.env.CLAUDE_CODE_ACTION),version:`0.0.23`,versionBase:Dn(),buildTime:`2026-08-26T10:35:19.203Z`,deploymentEnvironment:v.detectDeploymentEnvironment(),...r(process.env.GITHUB_ACTIONS)&&{githubEventName:process.env.GITHUB_EVENT_NAME,githubActionsRunnerEnvironment:process.env.RUNNER_ENVIRONMENT,githubActionsRunnerOs:process.env.RUNNER_OS,githubActionRef:process.env.GITHUB_ACTION_PATH?.includes(`claude-code-action/`)?process.env.GITHUB_ACTION_PATH.split(`claude-code-action/`)[1]:void 0},...Ie()&&{wslVersion:Ie()},...n??{},...i.length>0?{vcs:i.join(`,`)}:{}}}),L=null,R=null}));function An(e){return e.setValue(z,!0)}function jn(e){return e.getValue(z)===!0}var z,B=e((()=>{f(),z=c(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`)}));function Mn(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Nn(n)){p.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Pn(r)){p.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Nn(e){return typeof e==`string`&&e!==``}function Pn(e){return e==null?!0:Array.isArray(e)?Fn(e):In(typeof e)}function Fn(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(In(e)){t=e;continue}return!1}return!1}}return!0}function In(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}var Ln=e((()=>{f()}));function Rn(){return e=>{p.error(zn(e))}}function zn(e){return typeof e==`string`?e:JSON.stringify(Bn(e))}function Bn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Vn=e((()=>{f()}));function Hn(e){try{Un(e)}catch{}}var Un,Wn=e((()=>{Vn(),Un=Rn()}));function Gn(e){let t=process.env[e];if(t==null||t.trim()===``)return;let n=Number(t);if(isNaN(n)){p.warn(`Unknown value ${ct(t)} for ${e}, expected a number, using defaults`);return}return n}function V(e){let t=process.env[e];if(!(t==null||t.trim()===``))return t}var Kn=e((()=>{f()})),qn,Jn=e((()=>{qn=`2.9.0`})),Yn,Xn=e((()=>{Yn=`process.runtime.name`})),H,Zn=e((()=>{Jn(),_(),Xn(),H={[ne]:`opentelemetry`,[Yn]:`node`,[oe]:ie,[h]:qn}})),U,Qn=e((()=>{Kn(),Zn(),U=performance})),$n=e((()=>{Qn()}));function W(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*cr)]}function er(e){return or(W(U.timeOrigin),W(typeof e==`number`?e:U.now()))}function tr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=G),[n,r]}function nr(e){return e[0]*1e6+e[1]/1e3}function rr(e){return e[0]+e[1]/G}function ir(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ar(e){return ir(e)||typeof e==`number`||e instanceof Date}function or(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=G&&(n[1]-=G,n[0]+=1),n}var sr,cr,G,lr=e((()=>{$n(),sr=9,cr=10**6,G=10**sr})),K,ur=e((()=>{(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(K||(K={}))}));function dr(e){if(!fr(e)||pr(e)!==gr)return!1;let t=xr(e);if(t===null)return!0;let n=Cr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&yr.call(n)===br}function fr(e){return typeof e==`object`&&!!e}function pr(e){return e==null?e===void 0?vr:_r:q&&q in Object(e)?mr(e):hr(e)}function mr(e){let t=Cr.call(e,q),n=e[q],r=!1;try{e[q]=void 0,r=!0}catch{}let i=wr.call(e);return r&&(t?e[q]=n:delete e[q]),i}function hr(e){return wr.call(e)}var gr,_r,vr,yr,br,xr,Sr,Cr,q,wr,Tr=e((()=>{gr=`[object Object]`,_r=`[object Null]`,vr=`[object Undefined]`,yr=Function.prototype.toString,br=yr.call(Object),xr=Object.getPrototypeOf,Sr=Object.prototype,Cr=Sr.hasOwnProperty,q=Symbol?Symbol.toStringTag:void 0,wr=Sr.toString}));function Er(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Or(t,e.shift(),0,n);return t}function Dr(e){return J(e)?e.slice():e}function Or(e,t,n=0,r){let i;if(!(n>Mr)){if(n++,X(e)||X(t)||Ar(t))i=Dr(t);else if(J(e)){if(i=e.slice(),J(t))for(let e=0,n=t.length;e<n;e++)i.push(Dr(t[e]));else if(Y(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Dr(t[r]))}}}else if(Y(e))if(Y(t)){if(!jr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(X(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(kr(e,s,r)||kr(t,s,r))delete i[s];else{if(Y(a)&&Y(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Or(i[s],c,n,r)}}}}else i=t;return i}}function kr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J(e){return Array.isArray(e)}function Ar(e){return typeof e==`function`}function Y(e){return!X(e)&&!J(e)&&!Ar(e)&&typeof e==`object`}function X(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function jr(e,t){return!(!dr(e)||!dr(t))}var Mr,Nr=e((()=>{Tr(),Mr=20})),Pr,Fr=e((()=>{a(),Pr=class{constructor(){o(this,`_promise`,void 0),o(this,`_resolve`,void 0),o(this,`_reject`,void 0),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}})),Ir,Lr=e((()=>{Fr(),a(),Ir=class{constructor(e,t){o(this,`_isCalled`,!1),o(this,`_deferred`,new Pr),o(this,`_callback`,void 0),o(this,`_that`,void 0),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}}));function Rr(e,t){return new Promise(n=>{d.with(An(d.active()),()=>{e.export(t,n)})})}var zr=e((()=>{f(),B()})),Br,Vr=e((()=>{B(),Ln(),Wn(),Vn(),lr(),ur(),$n(),Nr(),Lr(),zr(),Br={_export:Rr}}));function Hr(){if(Z===void 0)try{let e=globalThis.process.argv0;Z=e?`unknown_service:${e}`:`unknown_service`}catch{Z=`unknown_service`}return Z}var Z,Ur=e((()=>{})),Q,Wr=e((()=>{Q=e=>typeof e==`object`&&!!e&&typeof e.then==`function`}));function Gr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Kr(){return Gr({[te]:Hr(),[oe]:H[oe],[ne]:H[ne],[h]:H[h]})}function qr(e){return e.map(([e,t])=>Q(t)?[e,t.catch(t=>{p.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function Jr(e){if(typeof e==`string`||e===void 0)return e;p.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function Yr(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;p.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var Xr,Zr=e((()=>{f(),Vr(),_(),Ur(),Wr(),a(),Xr=class e{static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=qr(t),r._asyncAttributesPending=t.filter(([e,t])=>Q(t)).length>0,r}constructor(e,t){o(this,`_rawAttributes`,void 0),o(this,`_asyncAttributesPending`,!1),o(this,`_schemaUrl`,void 0),o(this,`_memoizedAttributes`,void 0);let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(Q(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=qr(this._rawAttributes),this._schemaUrl=Jr(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,Q(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&p.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(Q(n)){p.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??(e[t]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=Yr(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}}})),Qr,$r,ei=e((()=>{f(),_(),Vr(),a(),Qr=class{constructor(){o(this,`_MAX_LENGTH`,255),o(this,`_COMMA_SEPARATOR`,`,`),o(this,`_LABEL_KEY_VALUE_SPLITTER`,`=`)}detect(e){let t={},n=V(`OTEL_RESOURCE_ATTRIBUTES`),r=V(`OTEL_SERVICE_NAME`);if(n)try{let e=this._parseResourceAttributes(n);Object.assign(t,e)}catch(e){p.debug(`EnvDetector failed: ${e instanceof Error?e.message:e}`)}return r&&(t[te]=r),{attributes:t}}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR).filter(e=>e.trim()!==``);for(let e of n){let n=e.split(this._LABEL_KEY_VALUE_SPLITTER);if(n.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${e}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[r,i]=n,a=r.trim(),o=i.trim();if(a.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${e}".`);let s,c;try{s=decodeURIComponent(a),c=decodeURIComponent(o)}catch(t){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${e}": ${t instanceof Error?t.message:t}`,{cause:t})}if(s.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${s}".`);if(c.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${s}".`);t[s]=c}return t}},$r=new Qr})),ti,ni,ri,ii,ai,oi=e((()=>{ti=`host.arch`,ni=`host.id`,ri=`host.name`,ii=`os.type`,ai=`os.version`}));async function si(){if(!$)switch(lt.platform){case`darwin`:$=(await import(`./getMachineId-darwin-CsRhaP3y.js`)).getMachineId;break;case`linux`:$=(await import(`./getMachineId-linux-Bd7UBNRQ.js`)).getMachineId;break;case`freebsd`:$=(await import(`./getMachineId-bsd-Cut1kHoA.js`)).getMachineId;break;case`win32`:$=(await import(`./getMachineId-win-DamF2CH_.js`)).getMachineId;break;default:$=(await import(`./getMachineId-unsupported-vFGP8E_8.js`)).getMachineId;break}return $()}var $,ci=e((()=>{})),li,ui,di=e((()=>{li=e=>{switch(e){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return e}},ui=e=>{switch(e){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return e}}})),fi,pi,mi=e((()=>{oi(),ci(),di(),fi=class{detect(e){return{attributes:{[ri]:rt(),[ti]:li(nt()),[ni]:si()}}}},pi=new fi})),hi,gi,_i=e((()=>{oi(),di(),hi=class{detect(e){return{attributes:{[ii]:ui(it()),[ai]:at()}}}},gi=new hi})),vi=e((()=>{mi(),_i(),oi()})),yi=e((()=>{vi()})),bi=e((()=>{ei(),yi()})),xi=e((()=>{Zr(),bi(),Ur()}));function Si(e){return Ci(e,new WeakSet)}function Ci(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>Ci(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>Ci(e,t))}return!1}var wi=e((()=>{})),Ti,Ei=e((()=>{f(),g(),_(),wi(),a(),Ti=class{set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){o(this,`hrTime`,void 0),o(this,`hrTimeObserved`,void 0),o(this,`spanContext`,void 0),o(this,`resource`,void 0),o(this,`instrumentationScope`,void 0),o(this,`attributes`,{}),o(this,`_severityText`,void 0),o(this,`_severityNumber`,void 0),o(this,`_body`,void 0),o(this,`_eventName`,void 0),o(this,`_attributesCount`,0),o(this,`_droppedAttributesCount`,0),o(this,`_isReadonly`,!1),o(this,`_logRecordLimits`,void 0);let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:s,severityText:c,body:l,attributes:d={},exception:f,context:p}=n,m=Date.now();if(this.hrTime=ue(r??m),this.hrTimeObserved=ue(i??m),p){let e=u.getSpanContext(p);e&&ee(e)&&(this.spanContext=e)}this.severityNumber=s,this.severityText=c,this.body=l,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(d),f!=null&&this._setException(f)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return p.warn(`Invalid attribute key: ${e}`),this;if(!Si(t))return p.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&p.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return p.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(ae,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(se,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(pe,n.stack),t=!0)}t||p.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&p.warn(`Can not execute the operation on emitted log record`),this._isReadonly}}})),Di,Oi=e((()=>{T(),f(),Ei(),a(),Di=class{constructor(e,t){o(this,`instrumentationScope`,void 0),o(this,`_sharedState`,void 0),o(this,`_loggerConfig`,void 0),this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=this._loggerConfig,n=e.context||d.active(),r=e.severityNumber??x.UNSPECIFIED;if(r!==x.UNSPECIFIED&&r<t.minimumSeverity)return;if(t.traceBased){let e=u.getSpanContext(n);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return}let i=new Ti(this._sharedState,this.instrumentationScope,{context:n,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(i,n),i._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==x.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||d.active();if(t.traceBased){let e=u.getSpanContext(r);if(e&&ee(e)&&(e.traceFlags&l.SAMPLED)!==l.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}}})),ki,Ai=e((()=>{ki=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}}})),ji,Mi=e((()=>{g(),a(),ji=class{constructor(e,t){o(this,`processors`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>de(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}}}));function Ni(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var Pi=e((()=>{})),Fi,Ii=e((()=>{Fi=`otel.sdk.log.created`})),Li,Ri=e((()=>{Ii(),a(),Li=class{constructor(e){o(this,`createdLogs`,void 0),this.createdLogs=e.createCounter(Fi,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}}})),zi,Bi=e((()=>{zi=`0.215.0`})),Vi,Hi,Ui,Wi=e((()=>{f(),T(),Ai(),Mi(),Pi(),Ri(),Bi(),a(),Vi={disabled:!1,minimumSeverity:x.UNSPECIFIED,traceBased:!1},Hi=()=>({...Vi}),Ui=class{constructor(e,t,n,r,i,a){o(this,`loggers`,new Map),o(this,`activeProcessor`,void 0),o(this,`registeredLogRecordProcessors`,[]),o(this,`resource`,void 0),o(this,`forceFlushTimeoutMillis`,void 0),o(this,`logRecordLimits`,void 0),o(this,`processors`,void 0),o(this,`loggerMetrics`,void 0),o(this,`_loggerConfigurator`,void 0),o(this,`_loggerConfigs`,new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new ji(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new ki,this._loggerConfigurator=i??Hi;let c=a?a.getMeter(`@opentelemetry/sdk-logs`,zi):s();this.loggerMetrics=new Li(c)}getLoggerConfig(e){let t=Ni(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}}})),Gi,Ki=e((()=>{f(),T(),he(),g(),Oi(),Wi(),a(),Gi=class{constructor(e={}){o(this,`_shutdownOnce`,void 0),o(this,`_sharedState`,void 0);let t={resource:e.resource??me(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??Hi,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Ui(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new le(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return p.warn(`A shutdown LoggerProvider cannot provide a Logger`),pt;e||p.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new Di({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(p.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(p.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}}})),qi,Ji=e((()=>{g(),qi=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:fe(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let t of e)console.dir(this._exportInfo(t),{depth:3});t?.({code:ce.SUCCESS})}}}));async function Yi(e){let t=[];for(let n=0,r=e.length;n<r;n++){let r=e[n];r.resource.asyncAttributesPending&&r.resource.waitForAsyncAttributes&&t.push(r.resource.waitForAsyncAttributes())}t!=null&&t.length>0&&await Promise.all(t)}var Xi,Zi,Qi=e((()=>{f(),g(),a(),Xi=class{constructor(e,t,n){o(this,`_exportCompleted`,void 0),o(this,`_exportScheduledPromise`,void 0),o(this,`_exportScheduledResolve`,void 0),this._exportScheduledPromise=new Promise(e=>{this._exportScheduledResolve=e}),this._exportCompleted=this._executeExport(e,t,n)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,n){try{await Yi(t),await d.with(m(d.active()),async()=>this._exportWithTimeout(e,t,n))}catch(e){re(e),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>{i(Error(`Timeout`))},n);e.export(t,e=>{clearTimeout(a),e.code===ce.SUCCESS?r():i(e.error??Error(`BatchLogRecordProcessor: log record export failed`))}),this._exportScheduledResolve()})}},Zi=class{constructor(e,t){o(this,`_maxExportBatchSize`,void 0),o(this,`_maxQueueSize`,void 0),o(this,`_scheduledDelayMillis`,void 0),o(this,`_exportTimeoutMillis`,void 0),o(this,`_exporter`,void 0),o(this,`_currentExport`,null),o(this,`_finishedLogRecords`,[]),o(this,`_timer`,void 0),o(this,`_shutdownOnce`,void 0),o(this,`_flushing`,!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new le(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(p.warn(`BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;for(this._finishedLogRecords=[],this._clearTimer(),this._currentExport!==null&&(await this._exporter.forceFlush(),await this._currentExport.exportCompleted,this._currentExport=null);e.length>0;){let t;e.length<=this._maxExportBatchSize?(t=e,e=[]):t=e.splice(0,this._maxExportBatchSize);let n=new Xi(this._exporter,t,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(e){re(e)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){let e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();let e=this._extractBatch();if(e===null)return;let t=new Xi(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(e=>{this._currentExport=null,re(e),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),$i,ea=e((()=>{Qi(),$i=class extends Zi{onShutdown(){}}})),ta=e((()=>{ea()})),na=e((()=>{ta()})),ra=e((()=>{Ki(),Ji(),na(),T()}));export{mn as $,rr as A,Hn as B,Er as C,At as Ct,er as D,Tt as Dt,or as E,T as Et,Qn as F,B as G,Ln as H,U as I,dn as J,jn as K,Gn as L,ar as M,ir as N,tr as O,W as P,P as Q,V as R,Nr as S,E as St,ur as T,Dt as Tt,Pn as U,Wn as V,Mn as W,pn as X,fn as Y,_n as Z,Gr as _,Vt as _t,Ji as a,rn as at,Ir as b,D as bt,xi as c,on as ct,pi as d,qt as dt,kn as et,mi as f,Xt as ft,Zr as g,k as gt,Kr as h,Rt as ht,qi as i,vn as it,lr as j,nr as k,_i as l,en as lt,ei as m,Bt as mt,$i as n,un as nt,Gi as o,M as ot,$r as p,Mt as pt,An as q,ea as r,sn as rt,Ki as s,nn as st,ra as t,cn as tt,gi as u,Yt as ut,Vr as v,It as vt,K as w,Et as wt,Lr as x,Lt as xt,Br as y,Ft as yt,Kn as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import*as t from"util";import*as n from"child_process";var r,i=e((()=>{r=t.promisify(n.exec)}));export{i as n,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,Xs as n,Ys as r,_i as i,hi as a,jC as o,vt as s,xt as c}from"./loadAgentsDir-DlPbtIsS.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,t as d}from"./ExitFlow-DgAZp_8U.js";import{spawnSync as f}from"child_process";function p(){return o(g)??`Goodbye!`}async function m(e){if(n())return e(),f(`tmux`,[`detach-client`],{stdio:`ignore`}),null;let t=s()!==null;return t?(0,h.jsx)(d,{showWorktree:t,onDone:e,onCancel:()=>e()}):(e(p()),await a(0,`prompt_input_exit`),null)}var h,g;e((()=>{t(),u(),r(),i(),c(),h=l(),g=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}))();export{m as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,md as a,pd as o}from"./loadAgentsDir-DlPbtIsS.js";import{D as s,Gt as c,I as l,P as u,T as d,ai as f,t as p,x as m}from"./src-DL3w8VPk.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{G as g,H as _,N as v,U as y,W as b,bt as x,d as S,h as C,yt as w}from"./model-BwBG0V1u.js";import{n as T,t as E}from"./useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js";import{t as D}from"./select-Bxf5-5sI.js";import{n as O,r as k,t as A}from"./modelOptions-DRaG3bo0.js";import{t as j}from"./CustomSelect-DoeEXOIP.js";import{n as M,t as N}from"./fetchModelList-CxLsVNsu.js";function P({initial:e,sessionModel:t,onSelect:n,onCancel:i,isStandaloneCommand:a,showFastModeNotice:f,headerText:p}){let h=T(),_=e===null?L:e,[x,S]=(0,F.useState)(_),E=r(e=>g()?e.fastMode:!1),[k,j]=(0,F.useState)(()=>new Set(w(_)?[_.replace(/\[1m\]/i,``)]:[])),M=(0,F.useCallback)(()=>{if(!x||x===L)return;let e=x.replace(/\[1m\]/i,``);j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x]),P=(0,F.useMemo)(()=>O(E??!1),[E]),[R,z]=(0,F.useState)(null),[B,V]=(0,F.useState)(!1);(0,F.useEffect)(()=>{let e=!1;return V(!1),N().then(t=>{if(!e){if(!t||t.length===0){z(null),V(!0);return}z(t)}}).catch(()=>{e||V(!0)}),()=>{e=!0}},[]);let H=(0,F.useMemo)(()=>R?A(R,E??!1):null,[R,E]),U=R===null&&!B,W=(0,F.useMemo)(()=>{let t=H??P;return e!==null&&!t.some(t=>t.value===e)?[...t,{value:e,label:C(e),description:`Current model`}]:t},[H,P,e]),G=(0,F.useMemo)(()=>W.map(e=>({...e,value:e.value===null?L:e.value})),[W]),K=(0,F.useMemo)(()=>G.some(e=>e.value===_)?_:G[0]?.value??void 0,[G,_]),q=Math.min(10,G.length),J=Math.max(0,G.length-q),Y=G.find(e=>e.value===x)?.label,X=x!==void 0&&x!==L&&k.has(x.replace(/\[1m\]/i,``)),Z=(0,F.useCallback)(e=>{S(e)},[]);c({"modelPicker:toggle1M":()=>M()},{context:`ModelPicker`});function Q(e){if(e===L){n(null);return}let t=e.replace(/\[1m\]/i,``);n(k.has(t)?`${t}[1m]`:t)}let $=(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(l,{marginBottom:1,flexDirection:`column`,children:[(0,I.jsx)(u,{color:`remember`,bold:!0,children:`Select model`}),(0,I.jsx)(u,{dimColor:!0,children:p??`Choose a model for this and future sessions. Use Space to toggle 1M context.`}),t&&(0,I.jsxs)(u,{dimColor:!0,children:[`Currently using `,C(t),` for this session (set by plan mode). Selecting a model will undo this.`]})]}),(0,I.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,I.jsx)(l,{flexDirection:`column`,children:(0,I.jsx)(D,{defaultValue:_,defaultFocusValue:K,options:G,onChange:Q,onFocus:Z,onCancel:i??(()=>{}),visibleOptionCount:q})}),J>0&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsxs)(u,{dimColor:!0,children:[`and `,J,` more…`]})}),U&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`正在从 API 拉取可用模型列表…`})}),B&&R===null&&(0,I.jsx)(l,{paddingLeft:3,children:(0,I.jsx)(u,{dimColor:!0,children:`API 拉取失败,使用内置列表`})})]}),(0,I.jsx)(l,{marginBottom:1,flexDirection:`column`,children:X?(0,I.jsxs)(u,{dimColor:!0,children:[`1M context on`,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]}):(0,I.jsxs)(u,{color:`subtle`,children:[`1M context off`,Y?` for ${Y}`:``,(0,I.jsx)(u,{color:`subtle`,children:` · Space to toggle`})]})}),g()?f?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Fast mode is `,(0,I.jsx)(u,{bold:!0,children:`ON`}),` and available with `,v,` only (/fast). Switching to other models turn off fast mode.`]})}):y()&&!b()?(0,I.jsx)(l,{marginBottom:1,children:(0,I.jsxs)(u,{dimColor:!0,children:[`Use `,(0,I.jsx)(u,{bold:!0,children:`/fast`}),` to turn on Fast mode (`,v,` only).`]})}):null:null]}),a&&(0,I.jsx)(u,{dimColor:!0,italic:!0,children:h.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,I.jsxs)(d,{children:[(0,I.jsx)(s,{shortcut:`Enter`,action:`confirm`}),(0,I.jsx)(o,{action:`select:cancel`,context:`Select`,fallback:`Esc`,description:`exit`})]})})]});return a?(0,I.jsx)(m,{color:`permission`,children:$}):$}var F,I,L,R=e((()=>{F=t(f(),1),x(),E(),_(),p(),i(),n(),S(),k(),M(),a(),j(),I=h(),L=`__NO_PREFERENCE__`}));function z(e,t,n){return!1}var B=e((()=>{}));export{R as i,z as n,P as r,B as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cc as e,lc as t,sc as n,uc as r}from"./loadAgentsDir-DlPbtIsS.js";r();export{n as drainPendingExtraction,e as executeExtractMemories,t as initExtractMemories};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./fast-eGx2IxD7.js";t();export{n as FastModePicker,e as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ip as n,Lp as r,mb as i,zp as a}from"./loadAgentsDir-DlPbtIsS.js";import{Gt as o,I as s,Lt as c,P as l,ai as u,di as d,fi as f,j as p,t as m,y as h}from"./src-DL3w8VPk.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{Ht as _,b as v,h as y}from"./settings-B2jvL8Dp.js";import{p as b,s as x}from"./config-C-Y2qtB2.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{_ as w,l as T}from"./startupProfiler-CJdr3SxP.js";import{A as E,F as D,G as O,H as k,I as A,K as j,M,N,P,R as F,Z as I,j as L}from"./model-BwBG0V1u.js";import{n as R,t as z}from"./systemTheme-Ceakddth.js";function B({cooldown:e}){return e?(0,H.jsx)(l,{color:`promptBorder`,dimColor:!0,children:`↯`}):(0,H.jsx)(l,{color:`fastMode`,children:`↯`})}function V(e=!0,t=!1){if(!e)return`↯`;let n=R(x().theme);return t?d.dim(p(`promptBorder`,n)(`↯`)):p(`fastMode`,n)(`↯`)}var H,U=e((()=>{f(),_(),m(),b(),z(),H=g()}));function W(e,t){P(),v(`userSettings`,{fastMode:e?!0:void 0}),t(e?e=>{let t=!j(e.mainLoopModel);return{...e,...t?{mainLoopModel:D(),mainLoopModelForSession:null}:{},fastMode:!0}}:e=>({...e,fastMode:!1}))}function G({onDone:e,unavailableReason:t}){let n=r(e=>e.mainLoopModel),i=r(e=>e.fastMode),u=a(),[d,f]=(0,J.useState)(i??!1),p=A(),m=p.status===`cooldown`,g=t!==null,_=E(L(!0));function v(){g||(W(d,u),C(`tengu_fast_mode_toggled`,{enabled:d,source:`picker`}),d?e(`${V(d)} Fast mode ON${j(n)?``:` · model set to ${N}`} · ${_}`):(u(e=>({...e,fastMode:!1})),e(`Fast mode OFF`)))}function y(){if(g){i&&W(!1,u),e(`Fast mode OFF`,{display:`system`});return}e(i?`${V()} Kept Fast mode ON`:`Kept Fast mode OFF`,{display:`system`})}function b(){g||f(e=>!e)}return o({"confirm:yes":v,"confirm:nextField":b,"confirm:next":b,"confirm:previous":b,"confirm:cycleMode":b,"confirm:toggle":b},{context:`Confirmation`}),(0,Y.jsxs)(h,{title:(0,Y.jsxs)(l,{children:[(0,Y.jsx)(B,{cooldown:m}),` Fast mode (research preview)`]}),subtitle:`High-speed mode for ${N}. Billed as extra usage at a premium rate. Separate rate limits apply.`,onCancel:y,color:`fastMode`,inputGuide:e=>e.pending?(0,Y.jsxs)(l,{children:[`Press `,e.keyName,` again to exit`]}):g?(0,Y.jsx)(l,{children:`Esc to cancel`}):(0,Y.jsx)(l,{children:`Tab to toggle · Enter to confirm · Esc to cancel`}),children:[t?(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsx)(l,{color:`error`,children:t})}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(s,{flexDirection:`column`,gap:0,marginLeft:2,children:(0,Y.jsxs)(s,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{bold:!0,children:`Fast mode`}),(0,Y.jsx)(l,{color:d?`fastMode`:void 0,bold:d,children:d?`ON `:`OFF`}),(0,Y.jsx)(l,{dimColor:!0,children:_})]})}),m&&p.status===`cooldown`&&(0,Y.jsx)(s,{marginLeft:2,children:(0,Y.jsxs)(l,{color:`warning`,children:[p.reason===`overloaded`?`Fast mode overloaded and is temporarily unavailable`:`You've hit your fast limit`,` · resets in `,T(p.resetAt-Date.now(),{hideTrailingZeros:!0})]})})]}),(0,Y.jsxs)(l,{dimColor:!0,children:[`Learn more:`,` `,(0,Y.jsx)(c,{url:`https://code.workmate.com/docs/en/fast-mode`,children:`https://code.workmate.com/docs/en/fast-mode`})]})]})}async function K(e,t,n){let r=F();if(r)return`Fast mode unavailable: ${r}`;let{mainLoopModel:i}=t();return W(e,n),C(`tengu_fast_mode_toggled`,{enabled:e,source:`shortcut`}),e?`${V(!0)} Fast mode ON${j(i)?``:` · model set to ${N}`} · ${E(L(!0))}`:`Fast mode OFF`}async function q(e,t,n){if(!O())return null;await I();let r=n?.trim().toLowerCase();if(r===`on`||r===`off`)return e(await K(r===`on`,t.getAppState,t.setAppState)),null;let i=F();return C(`tengu_fast_mode_picker_shown`,{unavailable_reason:i??``}),(0,Y.jsx)(G,{onDone:e,unavailableReason:i})}var J,Y,X=e((()=>{J=t(u(),1),m(),U(),i(),S(),n(),k(),w(),M(),y(),Y=g()}));export{U as a,V as i,q as n,X as r,G as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{g as t,v as n}from"./types-Dx7P7JLQ.js";import{c as r,i}from"./debug-Bglx1aTu.js";import{Et as a,Tt as o,Yt as s,Zt as c,at as l,ct as u}from"./model-BwBG0V1u.js";import{n as d,r as f}from"./client-4iqhC8xq.js";async function p(){let e=s();try{switch(e){case`firstParty`:{let e=await o({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.display_name??n.id,description:n.id});return t.length>0?t:null}case`openai`:{let e=d({maxRetries:1}),t=[];for await(let n of e.models.list())t.push({value:n.id,label:n.id,description:`via openai-compat`});return t.length>0?t:null}case`grok`:{let{getGrokClient:e}=await import(`./client-BiqbIkwr.js`),t=e({maxRetries:1}),n=[];for await(let e of t.models.list())n.push({value:e.id,label:e.id,description:`via grok`});return n.length>0?n:null}case`bedrock`:{let e=(await l()).map(e=>({value:e,label:e,description:`Bedrock inference profile`}));return e.length>0?e:null}case`gemini`:case`vertex`:case`foundry`:return null}}catch(t){return r(`[fetchModelList] ${e} failed: ${t instanceof Error?t.message:`unknown`}`),null}return null}var m,h,g=e((()=>{a(),f(),i(),t(),u(),c(),m=300*1e3,h=n(p,m)}));export{g as n,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./fetchModelList-CxLsVNsu.js";e();export{t as fetchAvailableModels};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{m as i}from"./zod-CuNujUwx.js";import{Lt as a,_ as o,g as s,jt as c,mn as l,p as u}from"./loadAgentsDir-DlPbtIsS.js";import{Jn as d,qn as f}from"./state-B4jiUise.js";import{n as p,t as m}from"./cwd-Pa83R95t.js";import{I as h,M as g,c as _,f as v,i as ee,u as y}from"./debug-Bglx1aTu.js";import{Ir as b,Lr as x,Or as te,er as ne,h as re,nr as ie,t as ae}from"./settings-B2jvL8Dp.js";import{p as oe,s as se}from"./config-C-Y2qtB2.js";import{i as ce,n as S}from"./execFileNoThrow-BTachNBI.js";import{o as le,s as C}from"./log-D2TIwHBV.js";import{n as ue,r as w}from"./analytics-DJobLaWP.js";import{a as de,s as fe}from"./ripgrep-Dl3y5r4m.js";import*as T from"path";import{statSync as pe}from"fs";function me(e,t,n){if(t===0)return n?k:0;let r=e.charCodeAt(t-1);return he(r)?be:ge(r)&&_e(e.charCodeAt(t))?D:0}function he(e){return e===47||e===92||e===45||e===95||e===46||e===32}function ge(e){return e>=97&&e<=122}function _e(e){return e>=65&&e<=90}function E(){return new Promise(e=>setImmediate(e))}function ve(e,t){let n=new Set;for(let r of e){let e=r.length;for(let t=0;t<r.length;t++){let n=r.charCodeAt(t);if(n===47||n===92){e=t;break}}let i=r.slice(0,e);if(i.length>0&&(n.add(i),n.size>=t))break}let r=Array.from(n);return r.sort((e,t)=>{let n=e.length-t.length;return n===0?e<t?-1:+(e>t):n}),r.slice(0,t).map(e=>({path:e,score:0}))}var ye,be,D,O,k,xe,Se,Ce,A,j,we,Te=e((()=>{n(),ye=16,be=8,D=6,O=4,k=8,xe=3,Se=1,Ce=100,A=64,j=new Int32Array(A),we=class{constructor(){r(this,`paths`,[]),r(this,`lowerPaths`,[]),r(this,`charBits`,new Int32Array),r(this,`pathLens`,new Uint16Array),r(this,`topLevelCache`,null),r(this,`readyCount`,0)}loadFromFileList(e){let t=new Set,n=[];for(let r of e)r.length>0&&!t.has(r)&&(t.add(r),n.push(r));this.buildIndex(n)}loadFromFileListAsync(e){let t=()=>{};return{queryable:new Promise(e=>{t=e}),done:this.buildAsync(e,t)}}async buildAsync(e,t){let n=new Set,r=[],i=performance.now();for(let t=0;t<e.length;t++){let a=e[t];a.length>0&&!n.has(a)&&(n.add(a),r.push(a)),(t&255)==255&&performance.now()-i>4&&(await E(),i=performance.now())}this.resetArrays(r),i=performance.now();let a=!0;for(let e=0;e<r.length;e++)this.indexPath(e),(e&255)==255&&performance.now()-i>4&&(this.readyCount=e+1,a&&(t(),a=!1),await E(),i=performance.now());this.readyCount=r.length,t()}buildIndex(e){this.resetArrays(e);for(let t=0;t<e.length;t++)this.indexPath(t);this.readyCount=e.length}resetArrays(e){let t=e.length;this.paths=e,this.lowerPaths=Array(t),this.charBits=new Int32Array(t),this.pathLens=new Uint16Array(t),this.readyCount=0,this.topLevelCache=ve(e,Ce)}indexPath(e){let t=this.paths[e].toLowerCase();this.lowerPaths[e]=t;let n=t.length;this.pathLens[e]=n;let r=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n>=97&&n<=122&&(r|=1<<n-97)}this.charBits[e]=r}search(e,t){if(t<=0)return[];if(e.length===0)return this.topLevelCache?this.topLevelCache.slice(0,t):[];let n=e!==e.toLowerCase(),r=n?e:e.toLowerCase(),i=Math.min(r.length,A),a=Array(i),o=0;for(let e=0;e<i;e++){let t=r.charAt(e);a[e]=t;let n=t.charCodeAt(0);n>=97&&n<=122&&(o|=1<<n-97)}let s=i*24+k+32,c=[],l=-1/0,{paths:u,lowerPaths:d,charBits:f,pathLens:p,readyCount:m}=this;for(let e=0;e<m;e++){if((f[e]&o)!==o)continue;let r=n?u[e]:d[e],m=a[0],h=0,g=[],_=r.indexOf(m);if(_===-1)continue;g[h++]=_;for(let e=_+1;e<r.length;e++){if(r.charCodeAt(e)!==m.charCodeAt(0))continue;let t=r.charCodeAt(e-1);(t===47||t===92||t===45||t===95||t===46||t===32)&&(g[h++]=e)}let v=u[e],ee=p[e],y=Math.max(0,32-(ee>>2)),b=-1/0;for(let e=0;e<h;e++){j[0]=g[e];let n=0,o=0,u=j[0],d=!0;for(let e=1;e<i;e++){let t=r.indexOf(a[e],u+1);if(t===-1){d=!1;break}j[e]=t;let i=t-u-1;i===0?o+=O:n+=xe+i*Se,u=t}if(!d||c.length===t&&s+o-n+y<=l)continue;let f=i*ye+o-n;f+=me(v,j[0],!0);for(let e=1;e<i;e++)f+=me(v,j[e],!1);f+=y,f>b&&(b=f)}if(b===-1/0)continue;let x=b;if(c.length<t)c.push({path:v,fuzzScore:x}),c.length===t&&(c.sort((e,t)=>e.fuzzScore-t.fuzzScore),l=c[0].fuzzScore);else if(x>l){let e=0,t=c.length;for(;e<t;){let n=e+t>>1;c[n].fuzzScore<x?e=n+1:t=n}c.splice(e,0,{path:v,fuzzScore:x}),c.shift(),l=c[0].fuzzScore}}c.sort((e,t)=>t.fuzzScore-e.fuzzScore);let h=c.length,g=Math.max(h,1),_=Array(h);for(let e=0;e<h;e++){let t=c[e].path,n=e/g;_[e]={path:t,score:t.includes(`test`)?Math.min(n*1.05,1):n}}return _}}}));function M(){return z||(z=new we),z}function Ee(){z=null,B=null,H++,U=null,W=[],G=[],K=[],V.clear(),q=null,J=null,Y=0,X=null,Z=null,Q=null}function N(e){let t=e.length,n=Math.max(1,Math.floor(t/500)),r=-2128831035;for(let i=0;i<t;i+=n){let t=e[i];for(let e=0;e<t.length;e++)r=(r^t.charCodeAt(e))*16777619|0;r=r*16777619|0}if(t>0){let n=e[t-1];for(let e=0;e<n.length;e++)r=(r^n.charCodeAt(e))*16777619|0}return`${t}:${(r>>>0).toString(16)}`}function De(){let e=te(m());if(!e)return null;try{return pe(T.join(e,`.git`,`index`)).mtimeMs}catch{return null}}function P(e,t,n){return n===t?e:e.map(e=>{let r=T.join(t,e);return T.relative(n,r)})}async function Oe(e){if(e.length===0||!z||W.length===0)return;let t=await I(e),n=[...W,...G,...K,...e,...t],r=N(n);if(r===Q){_(`[FileIndex] skipped index rebuild — merged paths unchanged`);return}await z.loadFromFileListAsync(n).done,Q=r,_(`[FileIndex] rebuilt index with ${W.length} tracked + ${e.length} untracked files`)}async function F(e,t){let n=`${e}:${t}`;if(J===n)return q;let r=y(),i=[`.ignore`,`.rgignore`],a=[...new Set([e,t])],o=(0,Be.default)(),s=!1,c=a.flatMap(e=>i.map(t=>T.join(e,t))),l=await Promise.all(c.map(e=>r.readFile(e,{encoding:`utf8`}).catch(()=>null)));for(let[e,t]of l.entries())t!==null&&(o.add(t),s=!0,_(`[FileIndex] loaded ignore patterns from ${c[e]}`));let u=s?o:null;return q=u,J=n,u}async function ke(e,t){let n=Date.now();_(`[FileIndex] getFilesUsingGit called`);let r=m(),i=te(r);if(!i)return _(`[FileIndex] not a git repo, returning null`),null;try{let a=Date.now(),o=await S(b(),[`-c`,`core.quotepath=false`,`ls-files`,`--recurse-submodules`],{timeout:5e3,abortSignal:e,cwd:i});if(_(`[FileIndex] git ls-files (tracked) took ${Date.now()-a}ms`),o.code!==0)return _(`[FileIndex] git ls-files failed (code=${o.code}, stderr=${o.stderr}), falling back to ripgrep`),null;let s=P(o.stdout.trim().split(`
|
|
2
|
-
`).filter(Boolean),i,r),c=await F(i,r);if(c){let e=s.length;s=c.filter(s),_(`[FileIndex] applied ignore patterns: ${e} -> ${s.length} files`)}W=s;let l=Date.now()-n;if(_(`[FileIndex] git ls-files: ${s.length} tracked files in ${l}ms`),w(`tengu_file_suggestions_git_ls_files`,{file_count:s.length,tracked_count:s.length,untracked_count:0,duration_ms:l}),!U){let e=t?[`-c`,`core.quotepath=false`,`ls-files`,`--others`,`--exclude-standard`]:[`-c`,`core.quotepath=false`,`ls-files`,`--others`],n=H;U=S(b(),e,{timeout:1e4,cwd:i}).then(async e=>{if(n===H&&e.code===0){let t=P(e.stdout.trim().split(`
|
|
3
|
-
`).filter(Boolean),i,r),n=await F(i,r);if(n&&t.length>0){let e=t.length;t=n.filter(t),_(`[FileIndex] applied ignore patterns to untracked: ${e} -> ${t.length} files`)}_(`[FileIndex] background untracked fetch: ${t.length} files`),Oe(t)}}).catch(e=>{_(`[FileIndex] background untracked fetch failed: ${e}`)}).finally(()=>{U=null})}return s}catch(e){return _(`[FileIndex] git ls-files error: ${g(e)}`),null}}async function I(e){let t=new Set,n=performance.now();for(let r=0;r<e.length;r++)Ae(e,r,r+1,t),(r&255)==255&&performance.now()-n>4&&(await E(),n=performance.now());return[...t].map(e=>e+T.sep)}function Ae(e,t,n,r){for(let i=t;i<n;i++){let t=T.dirname(e[i]);for(;t!==`.`&&!r.has(t);){let e=T.dirname(t);if(e===t)break;r.add(t),t=e}}}async function je(e){return(await Promise.all(u.map(t=>o(t,e)))).flatMap(e=>e.map(e=>e.filePath))}async function Me(e,t){_(`[FileIndex] getProjectFiles called, respectGitignore=${t}`);let n=await ke(e,t);if(n!==null)return _(`[FileIndex] using git ls-files result (${n.length} files)`),n;_(`[FileIndex] git ls-files returned null, falling back to ripgrep`);let r=Date.now(),i=[`--files`,`--follow`,`--hidden`,`--glob`,`!.git/`,`--glob`,`!.svn/`,`--glob`,`!.hg/`,`--glob`,`!.bzr/`,`--glob`,`!.jj/`,`--glob`,`!.sl/`];t||i.push(`--no-ignore-vcs`);let a=(await fe(i,`.`,e)).map(e=>T.relative(m(),e)),o=Date.now()-r;return _(`[FileIndex] ripgrep: ${a.length} files in ${o}ms`),w(`tengu_file_suggestions_ripgrep`,{file_count:a.length,duration_ms:o}),a}async function Ne(){let e=AbortSignal.timeout(1e4),t=M();try{let n=ae(),r=se(),i=n.respectGitignore??r.respectGitignore??!0,a=m(),[o,s]=await Promise.all([Me(e,i),je(a)]);G=s;let c=[...o,...s],l=await I(c);K=l;let u=[...l,...c],d=N(u);d===Z?_(`[FileIndex] skipped index rebuild — tracked paths unchanged`):(await t.loadFromFileListAsync(u).done,Z=d,Q=null)}catch(e){C(e)}return t}function Pe(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;return e.substring(0,r)}function Fe(e){if(e.length===0)return``;let t=e.map(e=>e.displayText),n=t[0];for(let e=1;e<t.length;e++){let r=t[e];if(n=Pe(n,r),n===``)return``}return n}function L(e,t){return{id:`file-${e}`,displayText:e,metadata:t===void 0?void 0:{score:t}}}function Ie(e,t){return e.search(t,$).map(e=>L(e.path,e.score))}function R(){if(B)return;let e=De();if(z&&!(e!==null&&e!==X)&&Date.now()-Y<He)return;let t=H,n=Date.now();M(),B=Ne().then(r=>t===H?(B=null,V.emit(),X=e,Y=Date.now(),_(`[FileIndex] cache refresh completed in ${Date.now()-n}ms`),r):r).catch(e=>(_(`[FileIndex] Cache refresh failed: ${g(e)}`),C(e),t===H&&(B=null),M()))}async function Le(){let e=y(),t=m();try{return(await e.readdir(t)).map(e=>{let n=T.join(t,e.name),r=T.relative(t,n);return e.isDirectory()?r+T.sep:r})}catch(e){return C(e),[]}}async function Re(e,t=!1){if(!e&&!t)return[];if(ae().fileSuggestion?.type===`command`)return(await a({...c(),query:e})).slice(0,$).map(L);if(e===``||e===`.`||e===`./`){let e=await Le();return R(),e.slice(0,$).map(L)}let n=Date.now();try{let t=B!==null;R();let r=e,i=`.${T.sep}`;e.startsWith(i)&&(r=e.substring(2)),r.startsWith(`~`)&&(r=ne(r));let a=z?Ie(z,r):[],o=Date.now()-n;return _(`[FileIndex] generateFileSuggestions: ${a.length} results in ${o}ms (${t?`partial`:`full`} index)`),w(`tengu_file_suggestions_query`,{duration_ms:o,cache_hit:!t,result_count:a.length,query_length:e.length}),a}catch(e){return C(e),[]}}function ze(e,t,n,r,i,a){let o=typeof e==`string`?e:e.displayText;i(t.substring(0,r)+o+t.substring(r+n.length)),a(r+o.length)}var Be,z,B,V,Ve,H,U,W,G,K,q,J,Y,X,Z,Q,$,He,Ue=e((()=>{Be=t(i(),1),s(),Te(),ue(),oe(),p(),ee(),h(),ce(),v(),x(),l(),le(),ie(),de(),re(),d(),z=null,B=null,V=f(),Ve=V.subscribe,H=0,U=null,W=[],G=[],K=[],q=null,J=null,Y=0,X=null,Z=null,Q=null,$=15,He=5e3}));export{Ue as a,Re as i,Ee as n,Ve as o,Fe as r,R as s,ze as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./firstPartyEventLogger-M6UMli2c.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{i as r,l as i,o as a}from"./envUtils-DfkgIdYf.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{C as c,v as l,w as u}from"./esm-BbMeEYcz.js";import{Tt as d,Z as f,_ as ee,c as te,et as p,it as ne,n as re,o as ie,t as ae,v as oe,w as m,wt as se}from"./esm-eTAUP-La.js";import{n as h,t as ce}from"./axios-DaWTGg7G.js";import{d as le,l as ue}from"./types-Dx7P7JLQ.js";import{It as g,st as _}from"./state-B4jiUise.js";import{n as de,t as fe}from"./cwd-Pa83R95t.js";import{C as v,I as pe,M as me,V as he,x as ge,z as _e}from"./debug-Bglx1aTu.js";import{Gt as ve,qt as ye}from"./settings-B2jvL8Dp.js";import{p as y,u as b}from"./config-C-Y2qtB2.js";import{a as be,s as xe}from"./execFileNoThrow-BTachNBI.js";import{d as Se,o as Ce,p as x,s as S}from"./log-D2TIwHBV.js";import{a as we,i as Te,o as Ee}from"./platform-BacQ6ACS.js";import{i as De,n as Oe}from"./analytics-DJobLaWP.js";import{n as ke,r as C}from"./startupProfiler-CJdr3SxP.js";import*as w from"path";import{randomUUID as T}from"crypto";import{appendFile as Ae,mkdir as E,readdir as je,unlink as D,writeFile as Me}from"fs/promises";function O(e,t,n){return new Promise((r,i)=>{if(t?.aborted){n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r();return}let a=setTimeout((e,t,n)=>{e?.removeEventListener(`abort`,t),n()},e,t,o,r);function o(){clearTimeout(a),n?.throwOnAbort||n?.abortError?i(n.abortError?.()??Error(`aborted`)):r()}t?.addEventListener(`abort`,o,{once:!0}),n?.unref&&a.unref()})}var k=e((()=>{}));function A(){return i(process.env.CLAUDE_CODE_USE_BEDROCK)||i(process.env.CLAUDE_CODE_USE_VERTEX)||i(process.env.CLAUDE_CODE_USE_FOUNDRY)||x()}function Ne(){return x()}var Pe=e((()=>{a(),Se()}));async function Fe(){}var Ie,j,M=e((()=>{xe(),n(),g(),y(),de(),ye(),a(),Ie=t(e=>({deviceId:b(),sessionId:_(),email:void 0,appVersion:`0.0.23`,platform:ve(),userType:process.env.USER_TYPE,...i(process.env.GITHUB_ACTIONS)&&{githubActionsMetadata:{actor:process.env.GITHUB_ACTOR,actorId:process.env.GITHUB_ACTOR_ID,repository:process.env.GITHUB_REPOSITORY,repositoryId:process.env.GITHUB_REPOSITORY_ID,repositoryOwner:process.env.GITHUB_REPOSITORY_OWNER,repositoryOwnerId:process.env.GITHUB_REPOSITORY_OWNER_ID}}})),j=t(async()=>{let e=await be(`git config --get user.email`,{shell:!0,reject:!1,cwd:fe()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function Le(){return{seconds:0,nanos:0}}function N(e){return e!=null}var P,Re=e((()=>{P={fromJSON(e){return{seconds:N(e.seconds)?globalThis.Number(e.seconds):0,nanos:N(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==void 0&&(t.seconds=Math.round(e.seconds)),e.nanos!==void 0&&(t.nanos=Math.round(e.nanos)),t},create(e){return P.fromPartial(e??{})},fromPartial(e){let t=Le();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function ze(){return{account_id:0,organization_uuid:``,account_uuid:``}}function F(e){return e!=null}var I,Be=e((()=>{I={fromJSON(e){return{account_id:F(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:F(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:F(e.account_uuid)?globalThis.String(e.account_uuid):``}},toJSON(e){let t={};return e.account_id!==void 0&&(t.account_id=Math.round(e.account_id)),e.organization_uuid!==void 0&&(t.organization_uuid=e.organization_uuid),e.account_uuid!==void 0&&(t.account_uuid=e.account_uuid),t},create(e){return I.fromPartial(e??{})},fromPartial(e){let t=ze();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function Ve(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function He(){return{platform:``,node_version:``,terminal:``,package_managers:``,runtimes:``,is_running_with_bun:!1,is_ci:!1,is_claubbit:!1,is_github_action:!1,is_claude_code_action:!1,is_claude_ai_auth:!1,version:``,github_event_name:``,github_actions_runner_environment:``,github_actions_runner_os:``,github_action_ref:``,wsl_version:``,github_actions_metadata:void 0,arch:``,is_claude_code_remote:!1,remote_environment_type:``,claude_code_container_id:``,claude_code_remote_session_id:``,tags:[],deployment_environment:``,is_conductor:!1,version_base:``,coworker_type:``,build_time:``,is_local_agent_mode:!1,linux_distro_id:``,linux_distro_version:``,linux_kernel:``,vcs:``,platform_raw:``}}function Ue(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function We(){return{event_name:``,client_timestamp:void 0,model:``,session_id:``,user_type:``,betas:``,env:void 0,entrypoint:``,agent_sdk_version:``,is_interactive:!1,client_type:``,process:``,additional_metadata:``,auth:void 0,server_timestamp:void 0,event_id:``,device_id:``,swe_bench_run_id:``,swe_bench_instance_id:``,swe_bench_task_id:``,email:``,agent_id:``,parent_session_id:``,agent_type:``,slack:void 0,team_name:``,skill_name:``,plugin_name:``,marketplace_name:``}}function Ge(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function L(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):Ge(P.fromJSON(e))}function R(e){return e!=null}var z,B,V,H,Ke=e((()=>{Re(),Be(),z={fromJSON(e){return{actor_id:R(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:R(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:R(e.repository_owner_id)?globalThis.String(e.repository_owner_id):``}},toJSON(e){let t={};return e.actor_id!==void 0&&(t.actor_id=e.actor_id),e.repository_id!==void 0&&(t.repository_id=e.repository_id),e.repository_owner_id!==void 0&&(t.repository_owner_id=e.repository_owner_id),t},create(e){return z.fromPartial(e??{})},fromPartial(e){let t=Ve();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},B={fromJSON(e){return{platform:R(e.platform)?globalThis.String(e.platform):``,node_version:R(e.node_version)?globalThis.String(e.node_version):``,terminal:R(e.terminal)?globalThis.String(e.terminal):``,package_managers:R(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:R(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:R(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:R(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:R(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:R(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:R(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:R(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:R(e.version)?globalThis.String(e.version):``,github_event_name:R(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:R(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:R(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:R(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:R(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:R(e.github_actions_metadata)?z.fromJSON(e.github_actions_metadata):void 0,arch:R(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:R(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:R(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:R(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:R(e.claude_code_remote_session_id)?globalThis.String(e.claude_code_remote_session_id):``,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(e=>globalThis.String(e)):[],deployment_environment:R(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:R(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:R(e.version_base)?globalThis.String(e.version_base):``,coworker_type:R(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:R(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:R(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:R(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:R(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:R(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:R(e.vcs)?globalThis.String(e.vcs):``,platform_raw:R(e.platform_raw)?globalThis.String(e.platform_raw):``}},toJSON(e){let t={};return e.platform!==void 0&&(t.platform=e.platform),e.node_version!==void 0&&(t.node_version=e.node_version),e.terminal!==void 0&&(t.terminal=e.terminal),e.package_managers!==void 0&&(t.package_managers=e.package_managers),e.runtimes!==void 0&&(t.runtimes=e.runtimes),e.is_running_with_bun!==void 0&&(t.is_running_with_bun=e.is_running_with_bun),e.is_ci!==void 0&&(t.is_ci=e.is_ci),e.is_claubbit!==void 0&&(t.is_claubbit=e.is_claubbit),e.is_github_action!==void 0&&(t.is_github_action=e.is_github_action),e.is_claude_code_action!==void 0&&(t.is_claude_code_action=e.is_claude_code_action),e.is_claude_ai_auth!==void 0&&(t.is_claude_ai_auth=e.is_claude_ai_auth),e.version!==void 0&&(t.version=e.version),e.github_event_name!==void 0&&(t.github_event_name=e.github_event_name),e.github_actions_runner_environment!==void 0&&(t.github_actions_runner_environment=e.github_actions_runner_environment),e.github_actions_runner_os!==void 0&&(t.github_actions_runner_os=e.github_actions_runner_os),e.github_action_ref!==void 0&&(t.github_action_ref=e.github_action_ref),e.wsl_version!==void 0&&(t.wsl_version=e.wsl_version),e.github_actions_metadata!==void 0&&(t.github_actions_metadata=z.toJSON(e.github_actions_metadata)),e.arch!==void 0&&(t.arch=e.arch),e.is_claude_code_remote!==void 0&&(t.is_claude_code_remote=e.is_claude_code_remote),e.remote_environment_type!==void 0&&(t.remote_environment_type=e.remote_environment_type),e.claude_code_container_id!==void 0&&(t.claude_code_container_id=e.claude_code_container_id),e.claude_code_remote_session_id!==void 0&&(t.claude_code_remote_session_id=e.claude_code_remote_session_id),e.tags?.length&&(t.tags=e.tags),e.deployment_environment!==void 0&&(t.deployment_environment=e.deployment_environment),e.is_conductor!==void 0&&(t.is_conductor=e.is_conductor),e.version_base!==void 0&&(t.version_base=e.version_base),e.coworker_type!==void 0&&(t.coworker_type=e.coworker_type),e.build_time!==void 0&&(t.build_time=e.build_time),e.is_local_agent_mode!==void 0&&(t.is_local_agent_mode=e.is_local_agent_mode),e.linux_distro_id!==void 0&&(t.linux_distro_id=e.linux_distro_id),e.linux_distro_version!==void 0&&(t.linux_distro_version=e.linux_distro_version),e.linux_kernel!==void 0&&(t.linux_kernel=e.linux_kernel),e.vcs!==void 0&&(t.vcs=e.vcs),e.platform_raw!==void 0&&(t.platform_raw=e.platform_raw),t},create(e){return B.fromPartial(e??{})},fromPartial(e){let t=He();return t.platform=e.platform??``,t.node_version=e.node_version??``,t.terminal=e.terminal??``,t.package_managers=e.package_managers??``,t.runtimes=e.runtimes??``,t.is_running_with_bun=e.is_running_with_bun??!1,t.is_ci=e.is_ci??!1,t.is_claubbit=e.is_claubbit??!1,t.is_github_action=e.is_github_action??!1,t.is_claude_code_action=e.is_claude_code_action??!1,t.is_claude_ai_auth=e.is_claude_ai_auth??!1,t.version=e.version??``,t.github_event_name=e.github_event_name??``,t.github_actions_runner_environment=e.github_actions_runner_environment??``,t.github_actions_runner_os=e.github_actions_runner_os??``,t.github_action_ref=e.github_action_ref??``,t.wsl_version=e.wsl_version??``,t.github_actions_metadata=e.github_actions_metadata!==void 0&&e.github_actions_metadata!==null?z.fromPartial(e.github_actions_metadata):void 0,t.arch=e.arch??``,t.is_claude_code_remote=e.is_claude_code_remote??!1,t.remote_environment_type=e.remote_environment_type??``,t.claude_code_container_id=e.claude_code_container_id??``,t.claude_code_remote_session_id=e.claude_code_remote_session_id??``,t.tags=e.tags?.map(e=>e)||[],t.deployment_environment=e.deployment_environment??``,t.is_conductor=e.is_conductor??!1,t.version_base=e.version_base??``,t.coworker_type=e.coworker_type??``,t.build_time=e.build_time??``,t.is_local_agent_mode=e.is_local_agent_mode??!1,t.linux_distro_id=e.linux_distro_id??``,t.linux_distro_version=e.linux_distro_version??``,t.linux_kernel=e.linux_kernel??``,t.vcs=e.vcs??``,t.platform_raw=e.platform_raw??``,t}},V={fromJSON(e){return{slack_team_id:R(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:R(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:R(e.trigger)?globalThis.String(e.trigger):``,creation_method:R(e.creation_method)?globalThis.String(e.creation_method):``}},toJSON(e){let t={};return e.slack_team_id!==void 0&&(t.slack_team_id=e.slack_team_id),e.is_enterprise_install!==void 0&&(t.is_enterprise_install=e.is_enterprise_install),e.trigger!==void 0&&(t.trigger=e.trigger),e.creation_method!==void 0&&(t.creation_method=e.creation_method),t},create(e){return V.fromPartial(e??{})},fromPartial(e){let t=Ue();return t.slack_team_id=e.slack_team_id??``,t.is_enterprise_install=e.is_enterprise_install??!1,t.trigger=e.trigger??``,t.creation_method=e.creation_method??``,t}},H={fromJSON(e){return{event_name:R(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:R(e.client_timestamp)?L(e.client_timestamp):void 0,model:R(e.model)?globalThis.String(e.model):``,session_id:R(e.session_id)?globalThis.String(e.session_id):``,user_type:R(e.user_type)?globalThis.String(e.user_type):``,betas:R(e.betas)?globalThis.String(e.betas):``,env:R(e.env)?B.fromJSON(e.env):void 0,entrypoint:R(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:R(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:R(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:R(e.client_type)?globalThis.String(e.client_type):``,process:R(e.process)?globalThis.String(e.process):``,additional_metadata:R(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:R(e.auth)?I.fromJSON(e.auth):void 0,server_timestamp:R(e.server_timestamp)?L(e.server_timestamp):void 0,event_id:R(e.event_id)?globalThis.String(e.event_id):``,device_id:R(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:R(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:R(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:R(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:R(e.email)?globalThis.String(e.email):``,agent_id:R(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:R(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:R(e.agent_type)?globalThis.String(e.agent_type):``,slack:R(e.slack)?V.fromJSON(e.slack):void 0,team_name:R(e.team_name)?globalThis.String(e.team_name):``,skill_name:R(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:R(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:R(e.marketplace_name)?globalThis.String(e.marketplace_name):``}},toJSON(e){let t={};return e.event_name!==void 0&&(t.event_name=e.event_name),e.client_timestamp!==void 0&&(t.client_timestamp=e.client_timestamp.toISOString()),e.model!==void 0&&(t.model=e.model),e.session_id!==void 0&&(t.session_id=e.session_id),e.user_type!==void 0&&(t.user_type=e.user_type),e.betas!==void 0&&(t.betas=e.betas),e.env!==void 0&&(t.env=B.toJSON(e.env)),e.entrypoint!==void 0&&(t.entrypoint=e.entrypoint),e.agent_sdk_version!==void 0&&(t.agent_sdk_version=e.agent_sdk_version),e.is_interactive!==void 0&&(t.is_interactive=e.is_interactive),e.client_type!==void 0&&(t.client_type=e.client_type),e.process!==void 0&&(t.process=e.process),e.additional_metadata!==void 0&&(t.additional_metadata=e.additional_metadata),e.auth!==void 0&&(t.auth=I.toJSON(e.auth)),e.server_timestamp!==void 0&&(t.server_timestamp=e.server_timestamp.toISOString()),e.event_id!==void 0&&(t.event_id=e.event_id),e.device_id!==void 0&&(t.device_id=e.device_id),e.swe_bench_run_id!==void 0&&(t.swe_bench_run_id=e.swe_bench_run_id),e.swe_bench_instance_id!==void 0&&(t.swe_bench_instance_id=e.swe_bench_instance_id),e.swe_bench_task_id!==void 0&&(t.swe_bench_task_id=e.swe_bench_task_id),e.email!==void 0&&(t.email=e.email),e.agent_id!==void 0&&(t.agent_id=e.agent_id),e.parent_session_id!==void 0&&(t.parent_session_id=e.parent_session_id),e.agent_type!==void 0&&(t.agent_type=e.agent_type),e.slack!==void 0&&(t.slack=V.toJSON(e.slack)),e.team_name!==void 0&&(t.team_name=e.team_name),e.skill_name!==void 0&&(t.skill_name=e.skill_name),e.plugin_name!==void 0&&(t.plugin_name=e.plugin_name),e.marketplace_name!==void 0&&(t.marketplace_name=e.marketplace_name),t},create(e){return H.fromPartial(e??{})},fromPartial(e){let t=We();return t.event_name=e.event_name??``,t.client_timestamp=e.client_timestamp??void 0,t.model=e.model??``,t.session_id=e.session_id??``,t.user_type=e.user_type??``,t.betas=e.betas??``,t.env=e.env!==void 0&&e.env!==null?B.fromPartial(e.env):void 0,t.entrypoint=e.entrypoint??``,t.agent_sdk_version=e.agent_sdk_version??``,t.is_interactive=e.is_interactive??!1,t.client_type=e.client_type??``,t.process=e.process??``,t.additional_metadata=e.additional_metadata??``,t.auth=e.auth!==void 0&&e.auth!==null?I.fromPartial(e.auth):void 0,t.server_timestamp=e.server_timestamp??void 0,t.event_id=e.event_id??``,t.device_id=e.device_id??``,t.swe_bench_run_id=e.swe_bench_run_id??``,t.swe_bench_instance_id=e.swe_bench_instance_id??``,t.swe_bench_task_id=e.swe_bench_task_id??``,t.email=e.email??``,t.agent_id=e.agent_id??``,t.parent_session_id=e.parent_session_id??``,t.agent_type=e.agent_type??``,t.slack=e.slack!==void 0&&e.slack!==null?V.fromPartial(e.slack):void 0,t.team_name=e.team_name??``,t.skill_name=e.skill_name??``,t.plugin_name=e.plugin_name??``,t.marketplace_name=e.marketplace_name??``,t}}}));function U(){return w.join(r(),`telemetry`)}function qe(e){if(!h.isAxiosError(e))return me(e);let t=[],n=e.response?.headers?.[`request-id`];return n&&t.push(`request-id=${n}`),e.response?.status&&t.push(`status=${e.response.status}`),e.code&&t.push(`code=${e.code}`),e.message&&t.push(e.message),t.join(`, `)}var W,G,K,Je=e((()=>{oe(),ce(),g(),Ke(),a(),pe(),ue(),Ce(),k(),ge(),d(),Oe(),p(),o(),W=T(),G=`1p_failed_events.`,K=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`batchDelayMs`,void 0),s(this,`baseBackoffDelayMs`,void 0),s(this,`maxBackoffDelayMs`,void 0),s(this,`maxAttempts`,void 0),s(this,`isKilled`,void 0),s(this,`pendingExports`,[]),s(this,`isShutdown`,!1),s(this,`schedule`,void 0),s(this,`cancelBackoff`,null),s(this,`attempts`,0),s(this,`isRetrying`,!1),s(this,`lastExportErrorContext`,void 0);let t=e.baseUrl||(process.env.ANTHROPIC_BASE_URL===`https://api-staging.anthropic.com`?`https://api-staging.anthropic.com`:`https://api.anthropic.com`);this.endpoint=`${t}${e.path||`/api/event_logging/batch`}`,this.timeout=e.timeout||1e4,this.maxBatchSize=e.maxBatchSize||200,this.batchDelayMs=e.batchDelayMs||100,this.baseBackoffDelayMs=e.baseBackoffDelayMs||500,this.maxBackoffDelayMs=e.maxBackoffDelayMs||3e4,this.maxAttempts=e.maxAttempts??8,this.isKilled=e.isKilled??(()=>!1),this.schedule=e.schedule??((e,t)=>{let n=setTimeout(e,t);return()=>clearTimeout(n)}),this.retryPreviousBatches()}async getQueuedEventCount(){return(await this.loadEventsFromCurrentBatch()).length}getCurrentBatchFilePath(){return w.join(U(),`${G}${_()}.${W}.json`)}async loadEventsFromFile(e){try{return await le(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await D(e)}catch{}else await E(U(),{recursive:!0}),await Me(e,`${t.map(e=>v(e)).join(`
|
|
2
|
-
`)}\n`,`utf8`)}catch(e){S(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await E(U(),{recursive:!0}),await Ae(e,`${t.map(e=>v(e)).join(`
|
|
3
|
-
`)}\n`,`utf8`)}catch(e){S(e)}}async deleteFile(e){try{await D(e)}catch{}}async retryPreviousBatches(){try{let e=`${G}${_()}.`,t;try{t=(await je(U())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(W))}catch(e){if(_e(e))return;throw e}for(let e of t){let t=w.join(U(),e);this.retryFileInBackground(t)}}catch(e){S(e)}}async retryFileInBackground(e){if(this.attempts>=this.maxAttempts){await this.deleteFile(e);return}let t=await this.loadEventsFromFile(e);if(t.length===0){await this.deleteFile(e);return}let n=await this.sendEventsInBatches(t);n.length===0?await this.deleteFile(e):await this.saveEventsToFile(e,n)}async export(e,t){if(this.isShutdown){t({code:m.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{let n=e.filter(e=>e.instrumentationScope?.name===`com.anthropic.claude_code.events`);if(n.length===0){t({code:m.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:m.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:m.FAILED,error:Error(`Dropped ${r.length} events: max attempts (${this.maxAttempts}) reached`)});return}let i=await this.sendEventsInBatches(r);if(this.attempts++,i.length>0){await this.queueFailedEvents(i),this.scheduleBackoffRetry();let e=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``;t({code:m.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:m.SUCCESS})}catch(e){S(e),t({code:m.FAILED,error:he(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=qe(i);for(let r=e;r<t.length;r++)n.push(...t[r]);break}e<t.length-1&&this.batchDelayMs>0&&await O(this.batchDelayMs)}return n.length>0&&r&&(this.lastExportErrorContext=r),n}async queueFailedEvents(e){let t=this.getCurrentBatchFilePath();await this.appendEventsToFile(t,e);let n=this.lastExportErrorContext?` (${this.lastExportErrorContext})`:``,r=`1P event logging: ${e.length} events failed to export${n}`;S(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);this.cancelBackoff=this.schedule(async()=>{this.cancelBackoff=null,await this.retryFailedEvents()},e)}async retryFailedEvents(){let e=this.getCurrentBatchFilePath();for(;!this.isShutdown;){let t=await this.loadEventsFromFile(e);if(t.length===0)break;if(this.attempts>=this.maxAttempts){await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e);let n=await this.sendEventsInBatches(t);if(this.attempts++,this.isRetrying=!1,n.length>0){await this.saveEventsToFile(e,n),this.scheduleBackoffRetry();return}this.resetBackoff()}}resetBackoff(){this.attempts=0,this.cancelBackoff&&(this.cancelBackoff(),this.cancelBackoff=null)}async sendBatchWithRetry(e){if(this.isKilled())throw Error(`firstParty sink killswitch active`);let t={"Content-Type":`application/json`,"User-Agent":se(),"x-service-name":`workmate`};try{let n=await h.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}catch(e){throw e}}logSuccess(e,t,n){}hrTimeToDate(e){let[t,n]=e;return new Date(t*1e3+n/1e6)}transformLogsToEvents(e){let t=[];for(let n of e){let e=n.attributes||{},r=e.event_name||n.body||`unknown`,i=e.core_metadata,a=e.user_metadata,o=e.event_metadata||{};if(!i){t.push({event_type:`ClaudeCodeInternalEvent`,event_data:H.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:_(),additional_metadata:Buffer.from(v({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=ne(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=De(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:H.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),device_id:e.user_id,email:a?.email,auth:s.auth,...s.core,env:s.env,process:s.process,skill_name:typeof c==`string`?c:void 0,plugin_name:typeof l==`string`?l:void 0,marketplace_name:typeof u==`string`?u:void 0,additional_metadata:Object.keys(f).length>0?Buffer.from(v(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush()}async forceFlush(){await Promise.all(this.pendingExports)}}}));function q(e){return!1}var Ye=e((()=>{}));function J(){return{}}function Xe(e){let t=J()[e];if(!t)return null;let n=t.sample_rate;return typeof n!=`number`||n<0||n>1||n>=1?null:n<=0?0:Math.random()<n?n:0}async function Ze(){if($)try{await $.shutdown()}catch{}}function Y(){return!A()}async function Qe(e,t,n={}){try{let r=await f({model:n.model,betas:n.betas}),i={event_name:t,event_id:T(),core_metadata:r,user_metadata:Ie(!0),event_metadata:n},a=b();a&&(i.user_id=a),e.emit({body:t,attributes:i})}catch{}}function $e(e,t={}){Y()&&(!Q||q(`firstParty`)||Qe(Q,e,t))}function et(){if(C(`1p_event_logging_start`),!Y())return;C(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||X.toString(),10),t=Z,n=tt,r=Te(),i={[c]:`workmate`,[u]:`0.0.23`};if(r===`wsl`){let e=we();e&&(i[`wsl.version`]=e)}$=new ie({resource:ee(i),processors:[new re(new K({maxBatchSize:t,isKilled:()=>q(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.23`)}var X,Z,tt,Q,$,nt=e((()=>{te(),ae(),l(),y(),Ee(),ke(),M(),Pe(),Je(),p(),Ye(),X=1e4,Z=200,tt=8192,Q=null,$=null}));export{$e as a,j as c,Pe as d,A as f,O as h,Y as i,Fe as l,k as m,nt as n,Xe as o,Ne as p,et as r,Ze as s,J as t,M as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{X as t,Yi as n,Yx as r,Z as i,aC as a,qg as o}from"./loadAgentsDir-DlPbtIsS.js";import{f as s,l as c}from"./types-Dx7P7JLQ.js";import{I as l,M as u,c as d,i as f}from"./debug-Bglx1aTu.js";import{r as p,t as m}from"./sessionTitle-k4wpUS5l.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await i({systemPrompt:a([`Generate a short kebab-case name (2-4 words) that captures the main topic of this conversation. Use lowercase words separated by hyphens. Examples: "fix-login-bug", "add-auth-feature", "refactor-api-client", "debug-test-failures". Return JSON with a "name" field.`]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{name:{type:`string`}},required:[`name`],additionalProperties:!1}},signal:t,options:{querySource:`rename_generate_name`,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,mcpTools:[]}}),o=s(Array.isArray(e.message.content)?r(e.message.content):e.message.content);return o&&typeof o==`object`&&`name`in o&&typeof o.name==`string`?o.name:null}catch(e){return d(`generateSessionName failed: ${u(e)}`,{level:`error`}),null}}var g=e((()=>{t(),f(),l(),c(),n(),p(),o()}));export{g as n,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";import{promises as a}from"fs";async function o(){try{return(await a.readFile(`/etc/hostid`,{encoding:`utf8`})).trim()}catch(e){n.debug(`error reading machine id: ${e}`)}try{return(await i(`kenv -q smbios.system.uuid`)).stdout.trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{o as getMachineId};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";async function a(){try{let e=(await i(`ioreg -rd1 -c "IOPlatformExpertDevice"`)).stdout.split(`
|
|
2
|
-
`).find(e=>e.includes(`IOPlatformUUID`));if(!e)return;let t=e.split(`" = "`);if(t.length===2)return t[1].slice(0,-1)}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{a as getMachineId};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{promises as r}from"fs";async function i(){for(let e of[`/etc/machine-id`,`/var/lib/dbus/machine-id`])try{return(await r.readFile(e,{encoding:`utf8`})).trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{t()}))();export{i as getMachineId};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";async function r(){n.debug(`could not read machine-id: unsupported platform`)}e((()=>{t()}))();export{r as getMachineId};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,s as n}from"./esm-lWlUmoUA.js";import{n as r,t as i}from"./execAsync-Bv2yxuGe.js";import*as a from"process";async function o(){let e=`%windir%\\System32\\REG.exe`;a.arch===`ia32`&&`PROCESSOR_ARCHITEW6432`in a.env&&(e=`%windir%\\sysnative\\cmd.exe /c `+e);try{let t=(await i(`${e} QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`)).stdout.split(`REG_SZ`);if(t.length===2)return t[1].trim()}catch(e){n.debug(`error reading machine id: ${e}`)}}e((()=>{r(),t()}))();export{o as getMachineId};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$c as t,Ag as n,Fg as r,Qc as i,al as a,cl as o,dl as s,el as c,fl as l,il as u,ll as d,nl as f,ol as p,pl as m,rl as h,tl as g}from"./loadAgentsDir-DlPbtIsS.js";import{I as _,P as v,t as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{t as x}from"./select-Bxf5-5sI.js";import{t as S}from"./CustomSelect-DoeEXOIP.js";import{n as C,t as w}from"./PermissionDialog-BaibiQae.js";function T({currentGoal:e,newObjective:t,onConfirm:n,onCancel:r}){function i(e){e===`yes`?n():r()}let o=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,E.jsx)(w,{color:`warning`,title:`Replace active goal?`,children:(0,E.jsxs)(_,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,E.jsx)(v,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,E.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(v,{dimColor:!0,children:`Current goal:`}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Status: `}),a(e.status)]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Time: `}),u(e)]}),(0,E.jsxs)(v,{children:[(0,E.jsx)(v,{dimColor:!0,children:`· Tokens: `}),o]})]}),(0,E.jsxs)(_,{marginTop:1,flexDirection:`column`,children:[(0,E.jsx)(v,{dimColor:!0,children:`New objective:`}),(0,E.jsx)(v,{children:t})]}),(0,E.jsx)(_,{marginTop:1,children:(0,E.jsx)(x,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:i,onCancel:r})})]})})}var E,D=e((()=>{y(),S(),C(),d(),E=b()}));function O(e){let t=e.split(`
|
|
2
|
-
`)[0]??e;return t.length<=F?t:`${t.slice(0,F)}…`}function k(){r(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function A(){let e=p();if(!e)return"No active goal. Set one with `/goal <objective>`.";let t=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`,n=[`Goal: ${e.objective}`,`Status: ${a(e.status)}`,`Time: ${u(e)}`,`Tokens: ${t}`,`Continuation turns: ${e.turnsExecuted}`];return e.status===`max_turns`&&n.push("Hint: Max continuation turns reached (150). Run `/goal continue` to reset and continue."),n.join(`
|
|
3
|
-
`)}function j(e){return m(e),o(),t(),`Goal set.`}async function M(e,n,r){let i=r.trim();if(!i||i.toLowerCase()===`status`)return e(A(),{display:`system`}),null;let a=i.toLowerCase();if(a===`clear`){let t=g();return t&&(c(),k()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(a===`pause`){let n=s();return n&&(t(),k()),e(n?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(a===`resume`){if(p()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let n=l();return n&&t(),e(n?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!n}),null}if(a===`continue`){let n=h();return n&&t(),e(n?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!n}),null}if(a===`complete`){let n=f();return n&&(t(),k()),e(n?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(i.length>P)return e(`Goal objective is too long (${i.length} chars; limit ${P}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let o=p();return o&&o.status!==`complete`?(0,N.jsx)(T,{currentGoal:o,newObjective:i,onConfirm:()=>{k(),e(j(i),{display:`system`,shouldQuery:!0,displayArgs:O(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(j(i),{display:`system`,shouldQuery:!0,displayArgs:O(i),metaMessages:[`<goal-objective-updated>\n${i}\n</goal-objective-updated>`]}),null)}var N,P,F;e((()=>{d(),i(),n(),D(),N=b(),P=4e3,F=80}))();export{M as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{BS as t,FS as n,LS as r,PS as i,RS as a,Yi as o,da as s,et as c,iS as l,la as u,nC as d,n_ as f,o_ as p,rt as m}from"./loadAgentsDir-DlPbtIsS.js";import{c as h,i as g}from"./debug-Bglx1aTu.js";import{M as _,k as v}from"./model-BwBG0V1u.js";import{n as y,t as b}from"./client-CpTCeWba.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,i,o,c,p){try{let l=d(p.model),g=s(e,o),_=(await Promise.all(o.map(e=>m(e,{getToolPermissionContext:p.getToolPermissionContext,tools:o,agents:p.agents,allowedAgentTypes:p.allowedAgentTypes,model:p.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),y=t(g,i),S=a(_),w=r(p.toolChoice),T=b({maxRetries:0,fetchOverride:p.fetchOverride,source:p.querySource});h(`[Grok] Calling model=${l}, messages=${y.length}, tools=${S.length}`);let E=n(await T.chat.completions.create({model:l,messages:y,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...p.temperatureOverride!==void 0&&{temperature:p.temperatureOverride}},{signal:c}),l),D={},O=null,k={input_tokens:0,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0},A=0,j=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,A=Date.now()-j,e.message.usage&&(k=x(k,e.message.usage));break;case`content_block_start`:{let t=e.index,n=e.content_block;n.type===`tool_use`?D[t]={...n,input:``}:n.type===`text`?D[t]={...n,text:``}:n.type===`thinking`?D[t]={...n,thinking:``,signature:``}:D[t]={...n};break}case`content_block_delta`:{let t=e.index,n=e.delta,r=D[t];if(!r)break;n.type===`text_delta`?r.text=(r.text||``)+n.text:n.type===`input_json_delta`?r.input=(r.input||``)+n.partial_json:n.type===`thinking_delta`?r.thinking=(r.thinking||``)+n.thinking:n.type===`signature_delta`&&(r.signature=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:u([t],o,p.agentId)},requestId:void 0,type:`assistant`,uuid:C(),timestamp:new Date().toISOString()};break}case`message_delta`:{let t=e.usage;t&&(k=x(k,t));break}case`message_stop`:break}e.type===`message_stop`&&k.input_tokens+k.output_tokens>0&&f(v(l,k),k,p.model),yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:A}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);h(`[Grok] Error: ${t}`,{level:`error`}),yield l({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{y(),S(),i(),o(),c(),g(),p(),_()}))();export{w as queryModelGrok};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
async function e(){return{success:!1}}async function t(){}async function n(e){}async function r(){return!1}async function i(){return{success:!1}}function a(e,t,n){return!1}async function o(){}export{r as a,e as i,o as n,t as o,i as r,n as s,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ei as n,Ni as r,Si as i,bb as a,gb as o,hb as s,mb as c}from"./loadAgentsDir-DlPbtIsS.js";import{I as l,Lt as u,P as d,Wt as f,a as p,ai as m,n as h,ot as g,r as _,t as v,x as y}from"./src-DL3w8VPk.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{v as x,y as S}from"./startupProfiler-CJdr3SxP.js";import{n as C,t as w}from"./useExitOnCtrlCDWithKeybindings-C9BYG8Bo.js";import{n as T,t as E}from"./select-Bxf5-5sI.js";import{n as D,r as O}from"./modalContext-DDZdU1J8.js";import{n as k,t as A}from"./PromptInputHelpMenu-oyic20ip.js";function j({commands:e,maxHeight:t,columns:r,title:i,onCancel:a,emptyMessage:o}){let{headerFocused:s,focusHeader:c}=p(),u=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),m=(0,M.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:S(n(e),u,!0)}))},[e,u]);return(0,N.jsx)(l,{flexDirection:`column`,paddingY:1,children:e.length===0&&o?(0,N.jsx)(d,{dimColor:!0,children:o}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{children:i}),(0,N.jsx)(l,{marginTop:1,children:(0,N.jsx)(E,{options:m,visibleOptionCount:f,onCancel:a,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:c,isDisabled:s})})]})})}var M,N,P=e((()=>{M=t(m(),1),r(),x(),v(),T(),N=b()}));function F(){return(0,I.jsxs)(l,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,I.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,I.jsx)(d,{bold:!0,children:`Getting started`}),(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`1. `}),(0,I.jsx)(d,{children:`Ask a question or describe a task — Work Mate will explore your code and respond.`})]}),(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`2. `}),(0,I.jsx)(d,{children:`When Work Mate wants to edit files or run commands, you review and approve each action.`})]}),(0,I.jsxs)(d,{children:[(0,I.jsx)(d,{bold:!0,children:`3. `}),(0,I.jsx)(d,{children:`Type `}),(0,I.jsx)(d,{bold:!0,children:`/help`}),(0,I.jsx)(d,{children:` for commands, or `}),(0,I.jsx)(d,{bold:!0,children:`?`}),(0,I.jsx)(d,{children:` for shortcuts.`})]})]})]}),(0,I.jsxs)(l,{flexDirection:`column`,children:[(0,I.jsx)(l,{children:(0,I.jsx)(d,{bold:!0,children:`Shortcuts`})}),(0,I.jsx)(A,{gap:2,fixedWidth:!0})]})]})}var I,L=e((()=>{v(),k(),I=b()}));function R({onClose:e,commands:t}){let{rows:n,columns:r}=g(),a=Math.floor(n/2),s=O(),c=()=>e(`Help dialog dismissed`,{display:`system`});f(`help:dismiss`,c,{context:`Help`});let p=C(c),m=o(`help:dismiss`,`Help`,`esc`),v=i(),b=t.filter(e=>v.has(e.name)&&!e.isHidden),x=t.filter(e=>!v.has(e.name)&&!e.isHidden),S=[(0,z.jsx)(h,{title:`general`,children:(0,z.jsx)(F,{})},`general`)];return S.push((0,z.jsx)(h,{title:`commands`,children:(0,z.jsx)(j,{commands:b,maxHeight:a,columns:r,title:`Browse default commands:`,onCancel:c})},`commands`)),S.push((0,z.jsx)(h,{title:`custom-commands`,children:(0,z.jsx)(j,{commands:x,maxHeight:a,columns:r,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:c})},`custom`)),(0,z.jsx)(l,{flexDirection:`column`,height:s?void 0:a,children:(0,z.jsxs)(y,{color:`professionalBlue`,children:[(0,z.jsx)(_,{title:`Work Mate v0.0.23`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,z.jsx)(l,{marginTop:1,children:(0,z.jsxs)(d,{children:[`For more help: `,(0,z.jsx)(u,{url:`https://code.workmate.com/docs/en/overview`})]})}),(0,z.jsx)(l,{marginTop:1,children:(0,z.jsx)(d,{dimColor:!0,children:p.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,p.keyName,` again to exit`]}):(0,z.jsxs)(d,{italic:!0,children:[m,` to cancel`]})})})]})})}var z,B=e((()=>{w(),s(),r(),D(),a(),v(),c(),P(),L(),z=b()})),V,H;e((()=>{B(),V=b(),H=async(e,{options:{commands:t}})=>(0,V.jsx)(R,{commands:t,onClose:e})}))();export{H as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DfkgIdYf.js";import{It as i,Q as a,st as o}from"./state-B4jiUise.js";import{$ as s,C as c,I as l,N as u,S as d,c as f,et as p,f as m,h,i as g,x as _}from"./debug-Bglx1aTu.js";import{b as v,x as y}from"./config-C-Y2qtB2.js";import{h as b,m as x}from"./firstPartyEventLogger-M6UMli2c.js";import{a as S,i as C,n as w,r as T}from"./pasteStore-P0zP-ch0.js";import{join as E}from"path";import{appendFile as D,writeFile as O}from"fs/promises";function k(e){return(e.match(/\r\n|\r|\n/g)||[]).length}function A(e,t){return t===0?`[Pasted text #${e}]`:`[Pasted text #${e} +${t} lines]`}function j(e){return`[Image #${e}]`}function M(e){return[...e.matchAll(/\[(Pasted text|Image|\.\.\.Truncated text) #(\d+)(?: \+\d+ lines)?(\.)*\]/g)].map(e=>({id:parseInt(e[2]||`0`,10),match:e[0],index:e.index})).filter(e=>e.id>0)}function N(e,t){let n=M(e),r=e;for(let e=n.length-1;e>=0;e--){let i=n[e],a=t[i.id];a?.type===`text`&&(r=r.slice(0,i.index)+a.content+r.slice(i.index+i.match.length))}return r}function P(e){return d(e)}async function*F(){let e=o();for(let e=q.length-1;e>=0;e--)yield q[e];let n=E(t(),`history.jsonl`);try{for await(let t of h(n))try{let n=P(t);if(n.sessionId===e&&Q.has(n.timestamp))continue;yield n}catch(e){f(`Failed to parse history line: ${e}`)}}catch(e){if(u(e)===`ENOENT`)return;throw e}}async function*I(){for await(let e of F())yield await z(e)}async function*L(){let e=a(),t=o(),n=[],r=0;for await(let i of F())if(!(!i||typeof i.project!=`string`)&&i.project===e&&(i.sessionId===t?(yield await z(i),r++):n.push(i),r+n.length>=G))break;for(let e of n){if(r>=G)return;yield await z(e),r++}}async function R(e){if(e.content)return{id:e.id,type:e.type,content:e.content,mediaType:e.mediaType,filename:e.filename};if(e.contentHash){let t=await C(e.contentHash);if(t)return{id:e.id,type:e.type,content:t,mediaType:e.mediaType,filename:e.filename}}return null}async function z(e){let t={};for(let[n,r]of Object.entries(e.pastedContents||{})){let e=await R(r);e&&(t[Number(n)]=e)}return{display:e.display,pastedContents:t}}async function B(){if(q.length===0)return;let e;try{let n=E(t(),`history.jsonl`);await O(n,``,{encoding:`utf8`,mode:384,flag:`a`}),e=await y(n,{stale:1e4,retries:{retries:3,minTimeout:50}});let r=q.map(e=>`${c(e)}\n`);q=[],await D(n,r.join(``),{mode:384})}catch(e){f(`Failed to write prompt history: ${e}`)}finally{e&&await e()}}async function V(e){if(!(J||q.length===0)&&!(e>5)){J=!0;try{await B()}finally{J=!1,q.length>0&&(await b(500),V(e+1))}}}async function H(e){let t=typeof e==`string`?{display:e,pastedContents:{}}:e,n={};if(t.pastedContents){for(let[e,r]of Object.entries(t.pastedContents))if(r.type!==`image`)if(r.content.length<=K)n[Number(e)]={id:r.id,type:r.type,content:r.content,mediaType:r.mediaType,filename:r.filename};else{let t=w(r.content);n[Number(e)]={id:r.id,type:r.type,contentHash:t,mediaType:r.mediaType,filename:r.filename},S(t,r.content)}}let r={...t,pastedContents:n,timestamp:Date.now(),project:a(),sessionId:o()};q.push(r),Z=r,Y=V(0)}function U(e){n(process.env.CLAUDE_CODE_SKIP_PROMPT_HISTORY)||(X||(X=!0,p(async()=>{Y&&await Y,q.length>0&&await B()})),H(e))}function W(){if(!Z)return;let e=Z;Z=null;let t=q.lastIndexOf(e);t===-1?Q.add(e.timestamp):q.splice(t,1)}var G,K,q,J,Y,X,Z,Q,$=e((()=>{i(),s(),g(),r(),l(),m(),v(),T(),x(),_(),G=100,K=1024,q=[],J=!1,Y=null,X=!1,Z=null,Q=new Set}));export{L as a,I as c,A as i,M as l,N as n,k as o,j as r,$ as s,U as t,W as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Kt as e,mn as t,on as n}from"./loadAgentsDir-DlPbtIsS.js";t();export{e as executeSessionEndHooks,n as getSessionEndHookTimeoutMs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,ai as r,kn as i,s as a,t as o}from"./src-DL3w8VPk.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{I as c,M as l,c as u,i as d}from"./debug-Bglx1aTu.js";import{Wt as f,b as p,h as m,qt as h,t as g}from"./settings-B2jvL8Dp.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{a as y,n as b,r as x,s as S,t as C}from"./nativeInstaller-C3pVPqrZ.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(r(),1);_(),o(),d(),h(),c(),C(),m();var D=s();function O(){let e=f.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(t,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{color:`warning`,children:[(0,D.jsx)(a,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,r)=>(0,D.jsx)(t,{marginLeft:2,children:(0,D.jsxs)(n,{dimColor:!0,children:[`• `,e]})},r))]})}function A({onDone:e,force:r,target:i}){let[o,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{u(`Install: Starting installation process (force=${r}, target=${i})`);let e=i||g()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),u(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${r})`);let t=await S(e,r);if(u(`Install: installLatest returned version=${t.latestVersion}, wasUpdated=${t.wasUpdated}, lockFailed=${t.lockFailed}`),t.lockFailed)throw Error(`Could not install - another process is currently installing Work Mate. Please try again in a moment.`);t.latestVersion||u(`Install: Failed to retrieve version information during install`,{level:`error`}),t.wasUpdated||u(`Install: Already up to date`),s({type:`setting-up`});let n=await b(!0);u(`Install: Setup launcher completed with ${n.length} messages`),n.length>0&&n.forEach(e=>u(`Install: Setup message: ${e.message}`)),u(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:c}=await x();a>0&&u(`Cleaned up ${a} npm installation(s)`),o.length>0&&u(`Cleanup errors: ${o.join(`, `)}`);let l=await y();l.length>0&&u(`Shell alias cleanup: ${l.map(e=>e.message).join(`; `)}`),v(`tengu_claude_install_command`,{has_version:+!!t.latestVersion,forced:+!!r}),(i===`latest`||i===`stable`)&&(p(`userSettings`,{autoUpdatesChannel:i}),u(`Install: Saved autoUpdatesChannel=${i} to user settings`));let d=[...c,...l.map(e=>e.message)];n.length>0?(s({type:`set-up`,messages:n.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:t.latestVersion||`current`,setupMessages:[...n.map(e=>e.message),...d]})):(u(`Install: Shell PATH already configured`),s({type:`success`,version:t.latestVersion||`current`,setupMessages:d.length>0?d:void 0}))}catch(e){u(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:l(e)})}}e()},[r,i]),(0,E.useEffect)(()=>{o.type===`success`?setTimeout(e,2e3,`Work Mate installation completed successfully`,{display:`system`}):o.type===`error`&&setTimeout(e,3e3,`Work Mate installation failed`,{display:`system`})},[o,e]),(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,children:[o.type===`checking`&&(0,D.jsx)(n,{color:`claude`,children:`Checking installation status...`}),o.type===`cleaning-npm`&&(0,D.jsx)(n,{color:`warning`,children:`Cleaning up old npm installations...`}),o.type===`installing`&&(0,D.jsxs)(n,{color:`claude`,children:[`Installing Work Mate native build `,o.version,`...`]}),o.type===`setting-up`&&(0,D.jsx)(n,{color:`claude`,children:`Setting up launcher and shell integration...`}),o.type===`set-up`&&(0,D.jsx)(k,{messages:o.messages}),o.type===`success`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`success`,withSpace:!0}),(0,D.jsx)(n,{color:`success`,bold:!0,children:`Work Mate successfully installed!`})]}),(0,D.jsxs)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:[o.version!==`current`&&(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Version: `}),(0,D.jsx)(n,{color:`claude`,children:o.version})]}),(0,D.jsxs)(t,{children:[(0,D.jsx)(n,{dimColor:!0,children:`Location: `}),(0,D.jsx)(n,{color:`text`,children:O()})]})]}),(0,D.jsx)(t,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(t,{marginTop:1,children:[(0,D.jsx)(n,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(n,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(n,{dimColor:!0,children:` to get started`})]})}),o.setupMessages&&(0,D.jsx)(k,{messages:o.setupMessages})]}),o.type===`error`&&(0,D.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(t,{children:[(0,D.jsx)(a,{status:`error`,withSpace:!0}),(0,D.jsx)(n,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(n,{color:`error`,children:o.message}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(n,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`安装 Work Mate 原生构建`,argumentHint:`[options]`,async call(e,t,n){let r=n.includes(`--force`),a=n.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await i((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:r,target:a}))}};export{j as install};
|