@readmagic/workmate 0.0.7 → 0.0.9
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-qFZy3FOD.js +1 -0
- package/dist/chunks/App-DW4elk6E.js +1 -0
- package/dist/chunks/ApproveApiKey-D05WywHU.js +1 -0
- package/dist/chunks/ApproveApiKey-DHAbdwkC.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-BuRFF1fQ.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-CDrArsSX.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +1 -0
- package/dist/chunks/DiffDialog-BIcwpgSr.js +6 -0
- package/dist/chunks/Doctor-D160J8Ad.js +3 -0
- package/dist/chunks/Doctor-VhJi2cmL.js +1 -0
- package/dist/chunks/ExitFlow-CoWHhKHJ.js +2 -0
- package/dist/chunks/Grove-BmirUB6V.js +11 -0
- package/dist/chunks/{HybridTransport-rK83Qijz.js → HybridTransport-BVmSUHf0.js} +3 -3
- package/dist/chunks/InvalidConfigDialog-WRywkKeS.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-C4n3A72C.js +1 -0
- package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +1 -0
- package/dist/chunks/MCPToolListView-BPmE0C2o.js +1 -0
- package/dist/chunks/McpParsingWarnings-CH4yyMAL.js +1 -0
- package/dist/chunks/MessageSelector-kOn2GaU-.js +3 -0
- package/dist/chunks/Messages-4EnHFeh1.js +11 -0
- package/dist/chunks/Onboarding-BboWs1pp.js +1 -0
- package/dist/chunks/{PermissionDialog-0ya1CU5k.js → PermissionDialog-Cb3z8OUP.js} +1 -1
- package/dist/chunks/{PressEnterToContinue-Dl9Hg9Mf.js → PressEnterToContinue-Dq0Imo9c.js} +1 -1
- package/dist/chunks/PromptInputFooterSuggestions-BpC9COmh.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +1 -0
- package/dist/chunks/QueryEngine-J6ElcO16.js +1 -0
- package/dist/chunks/REPL-DBjbAJsm.js +133 -0
- package/dist/chunks/REPL-oBemMXvp.js +1 -0
- package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +2 -0
- package/dist/chunks/ResumeConversation-wBG8OD9P.js +1 -0
- package/dist/chunks/{SSETransport-5VK5okFv.js → SSETransport-1KBBUikF.js} +3 -3
- package/dist/chunks/{Dialog-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +1 -0
- package/dist/chunks/Settings-DptKuJE7.js +2 -0
- package/dist/chunks/TeleportProgress-BmgPAZAi.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-sgxNOeM_.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-GptvrUdv.js +1 -0
- package/dist/chunks/ThemePicker-gAMqqD1P.js +1 -0
- package/dist/chunks/TrustDialog-CWt-4Evl.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BYsDtAvX.js → ValidationErrorsList-De3kzHtz.js} +1 -1
- package/dist/chunks/{WelcomeV2-C1BfrqC5.js → WelcomeV2-BWF-cJOu.js} +1 -1
- package/dist/chunks/add-dir-DBVT1cEK.js +1 -0
- package/dist/chunks/{agentDisplay-CMmHIl86.js → agentDisplay-5gnCQwUY.js} +1 -1
- package/dist/chunks/{agents-DE_4mAHG.js → agents-Bz1MLp4A.js} +1 -1
- package/dist/chunks/agents-CnwTOlqO.js +103 -0
- package/dist/chunks/allErrors-DYw_q14e.js +1 -0
- package/dist/chunks/analytics-DJobLaWP.js +1 -0
- package/dist/chunks/api-DXDXTFGa.js +1 -0
- package/dist/chunks/api-DzccRM_z.js +1 -0
- package/dist/chunks/auth-Cjnyy10u.js +15 -0
- package/dist/chunks/auth-CnLb6RWc.js +1 -0
- package/dist/chunks/auth-D-SGHS0K.js +1 -0
- package/dist/chunks/{autoMode-ZW70mpr0.js → autoMode-CQ5nqP9c.js} +5 -5
- package/dist/chunks/{autonomy-CwbWsCnv.js → autonomy-CPUCe-YU.js} +1 -1
- package/dist/chunks/autonomy-dSJl0hN1.js +15 -0
- package/dist/chunks/{autonomyPanel-Mq50H7iM.js → autonomyPanel-Ccr9ilei.js} +1 -1
- package/dist/chunks/backgroundHousekeeping--cs5crp7.js +17 -0
- package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +1 -0
- package/dist/chunks/{banner-CWkrK10u.js → banner-BJZNMppT.js} +2 -2
- package/dist/chunks/bg-DWloqGwk.js +1 -0
- package/dist/chunks/{bg-WnYN5ifx.js → bg-w3Vlsm3Y.js} +2 -2
- package/dist/chunks/branch-CG0AKS1J.js +3 -0
- package/dist/chunks/{break-cache-C_p7Kmx2.js → break-cache-DXV0brco.js} +2 -2
- package/dist/chunks/bridgeConfig-Dmc1ZDev.js +1 -0
- package/dist/chunks/{bridgeConfig-CE6dMsiJ.js → bridgeConfig-vORehbGG.js} +1 -1
- package/dist/chunks/bridgeMessaging-DlczTV9X.js +1 -0
- package/dist/chunks/bridgePointer-D4W9GpWw.js +1 -0
- package/dist/chunks/btw-DDUC_t0w.js +1 -0
- package/dist/chunks/caches-1IFb6_M_.js +1 -0
- package/dist/chunks/caches-CB8MHqy2.js +1 -0
- package/dist/chunks/capacityWake-L7b1mMft.js +3 -0
- package/dist/chunks/ccrClient-CG6HTv_n.js +1 -0
- package/dist/chunks/{claudeDesktop-Fe-QL-sN.js → claudeDesktop-CAmnheYx.js} +1 -1
- package/dist/chunks/{clear-D8m2utXW.js → clear-DdWexxbM.js} +1 -1
- package/dist/chunks/{cliLaunch-BkPAatcs.js → cliLaunch-BWWOgBFh.js} +1 -1
- package/dist/chunks/{client-C6MbjvOB.js → client-CoXtVRzi.js} +1 -1
- package/dist/chunks/client-Crrwkw7g.js +1 -0
- package/dist/chunks/client-D8hKghba.js +1 -0
- package/dist/chunks/color-Cuq0c6xy.js +1 -0
- package/dist/chunks/commands-D3sESsTp.js +1 -0
- package/dist/chunks/compact-DIpwuBDq.js +2 -0
- package/dist/chunks/config-CVvUNkj2.js +1 -0
- package/dist/chunks/config-D4G8_MqJ.js +3 -0
- package/dist/chunks/config-q9D4hFiK.js +1 -0
- package/dist/chunks/context-BWcfhhDj.js +1 -0
- package/dist/chunks/context-noninteractive-Bwt9A3XD.js +1 -0
- package/dist/chunks/context-noninteractive-c7jGVWHQ.js +29 -0
- package/dist/chunks/conversation-Bjo_8kia.js +1 -0
- package/dist/chunks/conversation-DrHZIQX2.js +1 -0
- package/dist/chunks/{createSSHSession-BOdTAX3N.js → createSSHSession-DP7B8yvb.js} +1 -1
- package/dist/chunks/createSession-CPo6GBSb.js +1 -0
- package/dist/chunks/createSession-DnykRoia.js +1 -0
- package/dist/chunks/crossProjectResume-D2A-qjgP.js +40 -0
- package/dist/chunks/cwd--q1ONL7P.js +1 -0
- package/dist/chunks/cwd-L4wygFqJ.js +1 -0
- package/dist/chunks/{daemon-YtZbMQtn.js → daemon-D2vFIVOz.js} +1 -1
- package/dist/chunks/datadog-DrmHyl3_.js +1 -0
- package/dist/chunks/{debug-BrXObCdR.js → debug-BdqxZ7rV.js} +4 -4
- package/dist/chunks/debugUtils-CezNYZ-4.js +1 -0
- package/dist/chunks/{detached-TYk4hMFj.js → detached-CkPpYMJj.js} +1 -1
- package/dist/chunks/detectRepository-DA1Q_Skc.js +1 -0
- package/dist/chunks/{detectRepository-BPr0VWNO.js → detectRepository-DvxoaPlk.js} +1 -1
- package/dist/chunks/{diff-CJEKvOA5.js → diff-DHzz9WAp.js} +1 -1
- package/dist/chunks/directoryCompletion-D5AvL7TF.js +1 -0
- package/dist/chunks/doctor-PWqB46xd.js +1 -0
- package/dist/chunks/entry-4JtoJONR.js +14 -0
- package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
- package/dist/chunks/esm-DcIr7tVd.js +1 -0
- package/dist/chunks/{execFileNoThrow-D244NytW.js → execFileNoThrow-5SylUnAI.js} +1 -1
- package/dist/chunks/{execSyncWrapper-CCMQShK-.js → execSyncWrapper-DKuxVTaf.js} +1 -1
- package/dist/chunks/exit-OW9g7b9A.js +1 -0
- package/dist/chunks/{lazySchema-DULtBUCI.js → external-CEp-aPkt.js} +1 -1
- package/dist/chunks/extraUsage-Dt5mw35U.js +1 -0
- package/dist/chunks/extractMemories-1VlmCGwa.js +1 -0
- package/dist/chunks/fast-ClYQcEv5.js +1 -0
- package/dist/chunks/fast-CrvLdpy3.js +1 -0
- package/dist/chunks/fileSuggestions-fNxREjpe.js +3 -0
- package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +1 -0
- package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +5 -0
- package/dist/chunks/flushGate-ch-Tvwjj.js +1 -0
- package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
- package/dist/chunks/gemini-fZ0VPU2A.js +1 -0
- package/dist/chunks/generateRecap-BIBVlB__.js +1 -0
- package/dist/chunks/generateSessionName-nZj_VvKZ.js +1 -0
- package/dist/chunks/{genericProcessUtils-CdQTApYX.js → genericProcessUtils-BmDSLcMf.js} +1 -1
- package/dist/chunks/git-B9uvt96d.js +6 -0
- package/dist/chunks/git-BfS5Hk4S.js +1 -0
- package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +1 -0
- package/dist/chunks/goal-IasZVqKh.js +3 -0
- package/dist/chunks/grok-Dk3LyzMa.js +1 -0
- package/dist/chunks/grove-BE4fQ6tG.js +7 -0
- package/dist/chunks/help-D2-v9Ug9.js +1 -0
- package/dist/chunks/{hooks-CkA9bhHl.js → hooks-BrKy5XWQ.js} +2 -2
- package/dist/chunks/hooks-DGd02IKF.js +1 -0
- package/dist/chunks/initReplBridge-RhCAlmHE.js +1 -0
- package/dist/chunks/{install-Dzlm4u58.js → install-CVGZ55wV.js} +1 -1
- package/dist/chunks/{instrumentation-Yt31gxWN.js → instrumentation-BmWotlxR.js} +4 -4
- package/dist/chunks/{job-BXujwZNa.js → job-DEXxW_Zo.js} +1 -1
- package/dist/chunks/{jwtUtils-DE2GPUcx.js → jwtUtils-C9sdGhvT.js} +1 -1
- package/dist/chunks/keybindings-BRdSOSUD.js +2 -0
- package/dist/chunks/language-C0cIpKE2.js +1 -0
- package/dist/chunks/{language-Ca4B018X.js → language-CxThoWRC.js} +1 -1
- package/dist/chunks/launchLocalMemory-CLSSVFoj.js +3 -0
- package/dist/chunks/launchOnboarding-BkJfKviO.js +8 -0
- package/dist/chunks/lazySchema-B4D4qJVE.js +1 -0
- package/dist/chunks/loadAgentsDir-8UprzS4w.js +1 -0
- package/dist/chunks/{loadAgentsDir-x3rlgED4.js → loadAgentsDir-CKSb56Gp.js} +1651 -2004
- package/dist/chunks/loadPluginHooks-LbaURHVH.js +1 -0
- package/dist/chunks/{localSearch-DtplGF-l.js → localSearch-CPOnyi8I.js} +1 -1
- package/dist/chunks/localSearch-DNjbr4S9.js +1 -0
- package/dist/chunks/log-CTFl4qpD.js +1 -0
- package/dist/chunks/logoV2Utils-we1sfJvf.js +1 -0
- package/dist/chunks/{magicDocs-qdDB_mKb.js → magicDocs-DmKlTQvK.js} +3 -3
- package/dist/chunks/main-BIiwW4mM.js +605 -0
- package/dist/chunks/{main-D862LI_d.js → main-ClXu1ilx.js} +2 -2
- package/dist/chunks/{managedEnv-Aq5BXfY7.js → managedEnv-Cl7YbYzf.js} +1 -1
- package/dist/chunks/managedEnv-CpiiQx_v.js +1 -0
- package/dist/chunks/{mappers-04gNXJ3w.js → mappers-xQC-Z4-h.js} +1 -1
- package/dist/chunks/mcp-B_m1XBDt.js +6 -0
- package/dist/chunks/mcp-BiyfH9Sd.js +1 -0
- package/dist/chunks/mcp-BjlaPUWX.js +2 -0
- package/dist/chunks/memoize-FJv2HV1u.js +1 -0
- package/dist/chunks/memory-LN8f_p2b.js +1 -0
- package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
- package/dist/chunks/mode-lYTs0XHs.js +2 -0
- package/dist/chunks/model-C2e73CJD.js +1 -0
- package/dist/chunks/model-CvmS-Esk.js +1 -0
- package/dist/chunks/model-DJ8mFfuR.js +1 -0
- package/dist/chunks/modelOptions-efCGKnXT.js +1 -0
- package/dist/chunks/nativeInstaller-DQIFwdat.js +1 -0
- package/dist/chunks/oauth-BN2I0_jl.js +1 -0
- package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
- package/dist/chunks/observationStore-BpjlK0pG.js +3 -0
- package/dist/chunks/omit-CLPZGevl.js +1 -0
- package/dist/chunks/onChangeAppState-DhBO34OK.js +1 -0
- package/dist/chunks/{openai-EYRnUsco.js → openai-DJLYqiRl.js} +3 -3
- package/dist/chunks/{panel-BSZGX6jN.js → panel-q0_iT9cg.js} +1 -1
- package/dist/chunks/panelCall-sum-3zvi.js +1 -0
- package/dist/chunks/parser-BcdhBGx0.js +1 -0
- package/dist/chunks/{parser-DFwaTGf7.js → parser-BdCj2GrE.js} +1 -1
- package/dist/chunks/partition-CpfoVrg1.js +1 -0
- package/dist/chunks/permissions-DTb9wkAP.js +3 -0
- package/dist/chunks/pidLock-BR5M6RQw.js +3 -0
- package/dist/chunks/{pipeTransport-CqCnc-Ys.js → pipeTransport-B3TIkTAp.js} +1 -1
- package/dist/chunks/plan-BeoIjNPv.js +1 -0
- package/dist/chunks/{platform-BrYefG_2.js → platform-D6IMiyqT.js} +1 -1
- package/dist/chunks/plugin-D_dHjTud.js +17 -0
- package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +1 -0
- package/dist/chunks/pluginBlocklist-D93Hd1GF.js +1 -0
- package/dist/chunks/pluginCliCommands-vv0wNt4O.js +1 -0
- package/dist/chunks/pluginFlagging-CxuRF2Vc.js +1 -0
- package/dist/chunks/pluginOperations-BTq4AjYB.js +2 -0
- package/dist/chunks/pluginStartupCheck-B6leNWq9.js +1 -0
- package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +1 -0
- package/dist/chunks/plugins-pmipe7kE.js +4 -0
- package/dist/chunks/pollConfig-BgpfHQPJ.js +1 -0
- package/dist/chunks/{poorMode-CBOtooa0.js → poorMode-BxsyllUK.js} +1 -1
- package/dist/chunks/poorMode-iV1NwC5L.js +1 -0
- package/dist/chunks/print-CAUvczBM.js +23 -0
- package/dist/chunks/processBashCommand-CdeQg_c6.js +1 -0
- package/dist/chunks/processSlashCommand-CbkshIC6.js +5 -0
- package/dist/chunks/{projectContext-D9MDwJUF.js → projectContext-CIxul6vA.js} +1 -1
- package/dist/chunks/{projectContext-BaDZBAoK.js → projectContext-RUMJB798.js} +1 -1
- package/dist/chunks/prompt-CybUvG8G.js +139 -0
- package/dist/chunks/prompt-RBn4JdEg.js +1 -0
- package/dist/chunks/prompt-Rb8zXlDo.js +1 -0
- package/dist/chunks/promptEditor-0Ug93P2I.js +4 -0
- package/dist/chunks/{protocolHandler-JR8pASdH.js → protocolHandler-ClfbHTjI.js} +1 -1
- package/dist/chunks/{proxy-CRN7jYIi.js → proxy-Blq4W6Ox.js} +1 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +1 -0
- package/dist/chunks/reconciler-Drq3HSkj.js +4 -0
- package/dist/chunks/refresh-D8TLHO_T.js +1 -0
- package/dist/chunks/registerProtocol-3_ozAuDK.js +36 -0
- package/dist/chunks/reload-plugins-Dn1ibOiI.js +1 -0
- package/dist/chunks/remoteBridgeCore-Dpg6Se9C.js +1 -0
- package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +1 -0
- package/dist/chunks/rename-CKsSc7Z3.js +1 -0
- package/dist/chunks/{renderOptions-BUJB9nAm.js → renderOptions-CLcco6fc.js} +1 -1
- package/dist/chunks/replBridgeHandle-DNC797_T.js +1 -0
- package/dist/chunks/resume-B1a5gLVR.js +2 -0
- package/dist/chunks/ripgrep-BisRODQ2.js +1 -0
- package/dist/chunks/{ripgrep-BXmXjAzA.js → ripgrep-DkL2S7-I.js} +1 -1
- package/dist/chunks/{runtimeObserver-CiwnPFjK.js → runtimeObserver-B0xfyLiA.js} +1 -1
- package/dist/chunks/runtimeObserver-DonWCJOx.js +10 -0
- package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +1 -0
- package/dist/chunks/sandbox-toggle-CSdnHWp-.js +1 -0
- package/dist/chunks/searchExtraTools-DbgfnQkH.js +1 -0
- package/dist/chunks/session-BbQlh2S5.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +1 -0
- package/dist/chunks/sessionIdCompat-DMayYBrf.js +1 -0
- package/dist/chunks/sessionMemory-7UOFdp29.js +1 -0
- package/dist/chunks/sessionMemory-fAzgAS7Q.js +1 -0
- package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +1 -0
- package/dist/chunks/sessionObserver-Cl26OdaW.js +1 -0
- package/dist/chunks/sessionObserver-XV6N0XER.js +20 -0
- package/dist/chunks/sessionState-BvECKycx.js +11 -0
- package/dist/chunks/sessionStorage-DSj9yZkl.js +1 -0
- package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
- package/dist/chunks/sessionTitle-E1FvsKM9.js +14 -0
- package/dist/chunks/sessionTracing-ClGQ08jM.js +11 -0
- package/dist/chunks/settings-B-R9ZJNY.js +1 -0
- package/dist/chunks/settings-Xbq6AaD-.js +20 -0
- package/dist/chunks/settingsSync-NCN0a4sc.js +1 -0
- package/dist/chunks/setup-uZ0dSekt.js +3 -0
- package/dist/chunks/shadowedRuleDetection-B9iSx6mB.js +1 -0
- package/dist/chunks/{shellQuote-DkSy9MYE.js → shellQuote-Bth6IZgX.js} +1 -1
- package/dist/chunks/{sideQuestion-hUhxls9r.js → sideQuestion-D2dPToW8.js} +3 -3
- package/dist/chunks/sinks-C7q46rvE.js +2 -0
- package/dist/chunks/sinks-D3bXeHlQ.js +1 -0
- package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +1 -0
- package/dist/chunks/skillGapStore-DylpOKJ6.js +5 -0
- package/dist/chunks/skillLifecycle-GK-8eyyn.js +8 -0
- package/dist/chunks/{skillSearchPanel-Cll9ccA5.js → skillSearchPanel-mpaC62y4.js} +4 -4
- package/dist/chunks/skills-t6krW8GZ.js +1 -0
- package/dist/chunks/{src-D06Xyj4g.js → src-BN7QRYLl.js} +1 -1
- package/dist/chunks/{src-CDCSSo0U2.js → src-P_wYS_NJ2.js} +1 -1
- package/dist/chunks/{src-CST_jFnT.js → src-r6ZFgWPx2.js} +1 -1
- package/dist/chunks/startupProfiler-BaiXZ9tr.js +1 -0
- package/dist/chunks/startupProfiler-jeId9f2i.js +3 -0
- package/dist/chunks/state-B4HwLt8i.js +1 -0
- package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
- package/dist/chunks/state-Bs5xweDL.js +1 -0
- package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
- package/dist/chunks/{stats-CqfF4Axp.js → stats-BJBhl-Lc.js} +1 -1
- package/dist/chunks/{status-CC9Q-2Yn.js → status-BtsnKNVY.js} +1 -1
- package/dist/chunks/status-nZQEar7T.js +2 -0
- package/dist/chunks/statusNoticeHelpers-DMqRGFOh.js +1 -0
- package/dist/chunks/{stringUtils-DGLPkqJ4.js → stringUtils-CbS6OkmE.js} +1 -1
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +1 -0
- package/dist/chunks/{subprocessEnv-vrwzMgKn.js → subprocessEnv-Ci8VV_bi.js} +1 -1
- package/dist/chunks/switcher-77h2J5HC.js +1 -0
- package/dist/chunks/switcher-B2CYzCC_.js +1 -0
- package/dist/chunks/syncCache-By_-buUC.js +1 -0
- package/dist/chunks/tasks-BNrdmF9p.js +1 -0
- package/dist/chunks/teleport-mdnhIZBj.js +1 -0
- package/dist/chunks/{templateJobs-D1BdhZsv.js → templateJobs-Dkv4I9c1.js} +1 -1
- package/dist/chunks/{terminalSetup-Cn6jeYw1.js → terminalSetup-DQopnSPR.js} +1 -1
- package/dist/chunks/terminalSetup-DTGm1Eo2.js +33 -0
- package/dist/chunks/{theme-Cg4GNOoQ.js → theme-BjpBVRf5.js} +1 -1
- package/dist/chunks/{tmux-BY7IdQ1f.js → tmux-CMRiI6CD.js} +1 -1
- package/dist/chunks/{toolEventObserver-SFwURL5F.js → toolEventObserver-D-sNBvOe.js} +1 -1
- package/dist/chunks/toolPool-Di30gn_Y.js +1 -0
- package/dist/chunks/trustedDevice-CupLMpO8.js +1 -0
- package/dist/chunks/{trustedDevice-CKedohmT.js → trustedDevice-j1u2TG5U.js} +1 -1
- package/dist/chunks/{types-Dut4311z.js → types-DWRxAH0E.js} +2 -2
- package/dist/chunks/{udsClient-BuCtv7dN.js → udsClient-Cm3HqYUu.js} +1 -1
- package/dist/chunks/{updateCCB-C2G-U-qA.js → updateCCB-BlUAU2Vp.js} +8 -8
- package/dist/chunks/{upstreamproxy-DyR_eXO8.js → upstreamproxy-DDVMwoRi.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-D2FvHieH.js +1 -0
- package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +1 -0
- package/dist/chunks/useManagePlugins-BbWJNLe8.js +1 -0
- package/dist/chunks/useMergedTools-B-Z9XQ6U.js +1 -0
- package/dist/chunks/useSearchInput-C6d6nt9S.js +1 -0
- package/dist/chunks/useSettingsErrors-DKh4rkGi.js +1 -0
- package/dist/chunks/userAgent-Ng_TTjWr.js +1 -0
- package/dist/chunks/util-D-X8i5Z2.js +1 -0
- package/dist/chunks/validatePlugin-DSw08u76.js +1 -0
- package/dist/chunks/vim-3mUqsEJm.js +1 -0
- package/dist/chunks/{which-CKQnSouy.js → which-DznMOwny.js} +1 -1
- package/dist/chunks/windowsPaths-1mgenSWa.js +1 -0
- package/dist/chunks/{windowsPaths-DtapVxOo.js → windowsPaths-BVztIhXM.js} +1 -1
- package/dist/chunks/{workSecret-CNWiR2uQ.js → workSecret-DtiFreRl.js} +1 -1
- package/dist/chunks/workerRegistry-DdOYjLm3.js +6 -0
- package/dist/chunks/worktree-BX1ULzrw.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-CFrrXnt9.js +0 -1
- package/dist/chunks/App-Buad9Llp.js +0 -1
- package/dist/chunks/ApproveApiKey-B2HJUD7h.js +0 -1
- package/dist/chunks/ApproveApiKey-BQbHdvc3.js +0 -1
- package/dist/chunks/AssistantSessionChooser-4lm4eXQ8.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-D4qA0M5O.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-DllL8dxU.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog--ywODh81.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BZSyRqeq.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Wkfw7Ts-.js +0 -1
- package/dist/chunks/DesktopHandoff-DaP4Riar.js +0 -1
- package/dist/chunks/DiffDialog-B7hx8i_Y.js +0 -6
- package/dist/chunks/Doctor-89OgoAUA.js +0 -1
- package/dist/chunks/Doctor-CuKJ-nGt.js +0 -3
- package/dist/chunks/ExitFlow-DnPydE17.js +0 -2
- package/dist/chunks/Feedback-SmGiR3mf.js +0 -2
- package/dist/chunks/Grove-CjN9DO47.js +0 -11
- package/dist/chunks/Grove-Cq88VBmM.js +0 -1
- package/dist/chunks/InvalidConfigDialog-DdO0AxyF.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-s1G0DwXF.js +0 -1
- package/dist/chunks/ListItem-vfLXEPed.js +0 -1
- package/dist/chunks/MCPConnectionManager-NRfIjdlj.js +0 -1
- package/dist/chunks/McpParsingWarnings-Du5IxZos.js +0 -1
- package/dist/chunks/MessageSelector-iIroHvXo.js +0 -3
- package/dist/chunks/Messages-D4Hm4gaY.js +0 -11
- package/dist/chunks/Onboarding-BiZByBK-.js +0 -1
- package/dist/chunks/OverageCreditUpsell-BM7szLgm.js +0 -1
- package/dist/chunks/PluginSettings-uY5KTCtK.js +0 -17
- package/dist/chunks/PromptInputFooterSuggestions-BmsFdOu9.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DX-0wEDo.js +0 -1
- package/dist/chunks/QueryEngine-CGYaShXD.js +0 -1
- package/dist/chunks/REPL-CRJB2t2z.js +0 -142
- package/dist/chunks/REPL-u4Yq29Du.js +0 -1
- package/dist/chunks/RemoteCallout-B-tyvQOe.js +0 -1
- package/dist/chunks/RemoteSessionManager-DCd0O5_l.js +0 -2
- package/dist/chunks/ResumeConversation-DAAXlOCd.js +0 -1
- package/dist/chunks/SearchBox-vfLXEPed.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-B-7Bworf.js +0 -1
- package/dist/chunks/Settings-CUjWlncb.js +0 -2
- package/dist/chunks/TeleportProgress-DxN0bQL2.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-A5Ss0kuk.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-Bz14mUqR.js +0 -1
- package/dist/chunks/ThemePicker-CVSRqTzW.js +0 -1
- package/dist/chunks/TrustDialog-CY8an_Tg.js +0 -1
- package/dist/chunks/TungstenTool-Cb7gJvq4.js +0 -1
- package/dist/chunks/TungstenTool-CxMQVCuF.js +0 -1
- package/dist/chunks/add-dir-DfLYgwox.js +0 -1
- package/dist/chunks/agents-DJtPfvnL.js +0 -103
- package/dist/chunks/allErrors-CQE2k0zO.js +0 -1
- package/dist/chunks/analytics-BotDBGh0.js +0 -1
- package/dist/chunks/ant-ClQkuQjZ.js +0 -1
- package/dist/chunks/api-2cdIPaeq.js +0 -1
- package/dist/chunks/api-CG-lhKe-.js +0 -1
- package/dist/chunks/asciicast-BsWpcxrc.js +0 -1
- package/dist/chunks/asciicast-CbAjUHT_.js +0 -4
- package/dist/chunks/assistant-Bje16tQx.js +0 -1
- package/dist/chunks/assistant-C83quuNj.js +0 -1
- package/dist/chunks/assistant-z2o4-UJe.js +0 -1
- package/dist/chunks/auth-DMfEiQrC.js +0 -1
- package/dist/chunks/auth-D_cGl8WD.js +0 -1
- package/dist/chunks/auth-DqcKPbw8.js +0 -15
- package/dist/chunks/autonomy-Oui8yK8G.js +0 -15
- package/dist/chunks/backgroundHousekeeping-BpLtI45r.js +0 -1
- package/dist/chunks/backgroundHousekeeping-DtJNx4Ja.js +0 -17
- package/dist/chunks/bg-B0iMGM9C.js +0 -1
- package/dist/chunks/branch-DU5O9KZ0.js +0 -3
- package/dist/chunks/bridge-DNNxtPlz.js +0 -2
- package/dist/chunks/bridgeConfig-DP9dD1Cv.js +0 -1
- package/dist/chunks/bridgeEnabled-Cc0mGlTb.js +0 -1
- package/dist/chunks/bridgeEnabled-D8wP3DWQ.js +0 -1
- package/dist/chunks/bridgeMain-CwxMa_pd.js +0 -1
- package/dist/chunks/bridgeMain-D11t1BYQ.js +0 -68
- package/dist/chunks/bridgeMessaging-DdvApEqW.js +0 -1
- package/dist/chunks/bridgePointer-DqHMHa2B.js +0 -1
- package/dist/chunks/browser-BmZuQom6.js +0 -1
- package/dist/chunks/btw-CejSEdNl.js +0 -1
- package/dist/chunks/caches-5HVQSevy.js +0 -3
- package/dist/chunks/caches-B-nJoHLM.js +0 -1
- package/dist/chunks/capacityWake-CV_x9H8j.js +0 -1
- package/dist/chunks/ccrClient-BFyfO67b.js +0 -1
- package/dist/chunks/client-DKXCfdde.js +0 -1
- package/dist/chunks/client-xxikkAoZ.js +0 -1
- package/dist/chunks/color-DWhgZH7A.js +0 -1
- package/dist/chunks/commands-CxJpmEKF.js +0 -1
- package/dist/chunks/commitAttribution-DM6SBMwl.js +0 -1
- package/dist/chunks/commitAttribution-DPnHHKSA.js +0 -2
- package/dist/chunks/compact-CblM7306.js +0 -2
- package/dist/chunks/completionCache-MN3_MqK8.js +0 -4
- package/dist/chunks/completionCache-c4aiyZ_f.js +0 -1
- package/dist/chunks/config-BLVBFi5v.js +0 -1
- package/dist/chunks/config-CMnqm6Se.js +0 -1
- package/dist/chunks/config-DRDuVyzE.js +0 -3
- package/dist/chunks/context-CdSMMM-0.js +0 -1
- package/dist/chunks/context-noninteractive-CPkf2vB9.js +0 -1
- package/dist/chunks/context-noninteractive-DNury4JI.js +0 -54
- package/dist/chunks/conversation-DCMw_rsE.js +0 -1
- package/dist/chunks/conversation-pUtvc-cE.js +0 -1
- package/dist/chunks/createSession-8Ei-Lj7V.js +0 -1
- package/dist/chunks/createSession-CjqxVh_Q.js +0 -1
- package/dist/chunks/cron-3LntnnhJ.js +0 -1
- package/dist/chunks/crossProjectResume-Bj_Pe8oe.js +0 -40
- package/dist/chunks/cwd--nvsx73T.js +0 -1
- package/dist/chunks/cwd-CYmmnQVS.js +0 -1
- package/dist/chunks/datadog-DqHxqiwY.js +0 -1
- package/dist/chunks/debugUtils-NO5KtXqi.js +0 -1
- package/dist/chunks/desktop-Z5FAfunZ.js +0 -1
- package/dist/chunks/detectRepository-BTPgN89l.js +0 -1
- package/dist/chunks/directoryCompletion-CW2ckkQg.js +0 -1
- package/dist/chunks/doctor-BA2ZLDTl.js +0 -1
- package/dist/chunks/entry-DE0uMIf0.js +0 -14
- package/dist/chunks/envLessBridgeConfig-B-LKYNvv.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DyD9XCda.js +0 -1
- package/dist/chunks/envUtils-DSxRz_kt.js +0 -1
- package/dist/chunks/esm-5w3xFBnt.js +0 -1
- package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +0 -1
- package/dist/chunks/exit-Dt9kHtJO.js +0 -1
- package/dist/chunks/extra-usage-C7E2Z1p1.js +0 -1
- package/dist/chunks/extra-usage-D0Kkjp-2.js +0 -1
- package/dist/chunks/extra-usage-core-DjdaD1qO.js +0 -1
- package/dist/chunks/extra-usage-noninteractive-BnD1RhKK.js +0 -1
- package/dist/chunks/extraUsage-CpgRTcMk.js +0 -1
- package/dist/chunks/extractMemories-DhUprYa7.js +0 -1
- package/dist/chunks/fast-C4ZevUNL.js +0 -1
- package/dist/chunks/fast-CChxlAAF.js +0 -1
- package/dist/chunks/feedback-BIhBhV6n.js +0 -1
- package/dist/chunks/file-DcZWPH2V.js +0 -12
- package/dist/chunks/fileStateCache-DDW5toIs.js +0 -1
- package/dist/chunks/files-Cz1-PK3r.js +0 -2
- package/dist/chunks/firstPartyEventLogger-BXY1IJ2D.js +0 -5
- package/dist/chunks/firstPartyEventLogger-CnkGSojw.js +0 -1
- package/dist/chunks/flushGate-CgHq81Gw.js +0 -1
- package/dist/chunks/gemini-C1J-x1g7.js +0 -1
- package/dist/chunks/generateRecap-C0jjCg0Z.js +0 -1
- package/dist/chunks/generateSessionName-w0BMtwS7.js +0 -1
- package/dist/chunks/git-CbcnOf0E.js +0 -1
- package/dist/chunks/git-Do0wJvux.js +0 -6
- package/dist/chunks/githubRepoPathMapping-8D0kpsif.js +0 -1
- package/dist/chunks/goal-B4GsR54_.js +0 -3
- package/dist/chunks/grok-ffNyU3Lt.js +0 -1
- package/dist/chunks/grove-BQisE2JM.js +0 -7
- package/dist/chunks/heapdump-DiCjAPR3.js +0 -5
- package/dist/chunks/help-2hn8VK2-.js +0 -1
- package/dist/chunks/hooks-CBmrBO-J.js +0 -1
- package/dist/chunks/hostGuard-BHI6Q8Mt.js +0 -1
- package/dist/chunks/inboundAttachments-C5K3XPTC.js +0 -1
- package/dist/chunks/inboundAttachments-IH-g95jo.js +0 -1
- package/dist/chunks/index.min-D75yiGLN.js +0 -1
- package/dist/chunks/initReplBridge-C-P4dgAG.js +0 -1
- package/dist/chunks/keybindings-D8FXoO89.js +0 -2
- package/dist/chunks/language-Baosud0X.js +0 -1
- package/dist/chunks/launchAgentsPlatform-D6DmNuDt.js +0 -1
- package/dist/chunks/launchCommand-1qkTCKpf.js +0 -1
- package/dist/chunks/launchLocalMemory-C0FzUq7x.js +0 -3
- package/dist/chunks/launchLocalVault-DkYAre4O.js +0 -3
- package/dist/chunks/launchMemoryStores-D2rKWAPs.js +0 -1
- package/dist/chunks/launchOnboarding-gOVAFEFp.js +0 -8
- package/dist/chunks/launchSchedule-IZdFstT_.js +0 -1
- package/dist/chunks/launchSkillStore-B7LamM1d.js +0 -1
- package/dist/chunks/launchTeleport-C2BQMfYP.js +0 -3
- package/dist/chunks/launchVault-C60WUcCI.js +0 -1
- package/dist/chunks/lib-rQZENxQg.js +0 -8
- package/dist/chunks/loadAgentsDir-B9c3Emvg.js +0 -1
- package/dist/chunks/loadPluginHooks-BhNdAjeY.js +0 -1
- package/dist/chunks/localSearch-BLCGsdyM.js +0 -1
- package/dist/chunks/log-BMCygSzM.js +0 -1
- package/dist/chunks/logoV2Utils-gGK9gErT.js +0 -1
- package/dist/chunks/main-OWFSddRx.js +0 -859
- package/dist/chunks/managedEnv-BHoeDjpS.js +0 -1
- package/dist/chunks/mcp-BSNdwbxR.js +0 -1
- package/dist/chunks/mcp-CMnDNI-4.js +0 -6
- package/dist/chunks/mcp-D1yA9E56.js +0 -2
- package/dist/chunks/memoize-B0zhbT8Z.js +0 -1
- package/dist/chunks/memory-D1zbyjxN.js +0 -1
- package/dist/chunks/mode-DY087x_x.js +0 -2
- package/dist/chunks/model-CZViyZnE.js +0 -1
- package/dist/chunks/model-D0EfJBuw.js +0 -1
- package/dist/chunks/model-DLLkVV6S.js +0 -1
- package/dist/chunks/nativeInstaller-yj81F75v.js +0 -1
- package/dist/chunks/oauth-BqJqV-2M.js +0 -1
- package/dist/chunks/oauth-C8X_p8Gc.js +0 -1
- package/dist/chunks/observationStore-DzCdXq8U.js +0 -4
- package/dist/chunks/onChangeAppState-DhGKPG9g.js +0 -1
- package/dist/chunks/output-style-BM3qAHLA.js +0 -1
- package/dist/chunks/overageCreditGrant-Du3dOYVu.js +0 -1
- package/dist/chunks/p-map-B1EeBuI8.js +0 -1
- package/dist/chunks/p-map-HKDr3iDo.js +0 -1
- package/dist/chunks/panel-Be-OxtqL.js +0 -1
- package/dist/chunks/panelCall-dMvRPAGE.js +0 -1
- package/dist/chunks/parser-Bf6iasPV.js +0 -1
- package/dist/chunks/partition-C4FWzYVm.js +0 -1
- package/dist/chunks/passes-Daz-ARWD.js +0 -1
- package/dist/chunks/path-D5U-tm91.js +0 -1
- package/dist/chunks/permissions-CeYKbtSC.js +0 -1
- package/dist/chunks/permissions-Cn_6f8CB.js +0 -1
- package/dist/chunks/permissions-DF8tAmDF.js +0 -3
- package/dist/chunks/pidLock-CbC_il6r.js +0 -3
- package/dist/chunks/plan-rsb_83Fo.js +0 -1
- package/dist/chunks/plugin-Cm31-nej.js +0 -1
- package/dist/chunks/pluginAutoupdate-0k03PVff.js +0 -1
- package/dist/chunks/pluginBlocklist-wPFCUPdm.js +0 -1
- package/dist/chunks/pluginCliCommands-DhL9LbH0.js +0 -1
- package/dist/chunks/pluginFlagging-CAdaFV_D.js +0 -1
- package/dist/chunks/pluginOperations-Cs_Z4C6O.js +0 -2
- package/dist/chunks/pluginStartupCheck-BRXGKGjG.js +0 -1
- package/dist/chunks/pluginStartupCheck-KeU0efTj.js +0 -1
- package/dist/chunks/plugins-CQNKZmjP.js +0 -4
- package/dist/chunks/policyLimits-D2s8M8P2.js +0 -1
- package/dist/chunks/pollConfig-2nFzv6Hy.js +0 -1
- package/dist/chunks/poor-DXumVTR4.js +0 -1
- package/dist/chunks/poorMode-yNZL5uYf.js +0 -1
- package/dist/chunks/print-uxCF5ka5.js +0 -23
- package/dist/chunks/privacy-settings-BncbJCV0.js +0 -1
- package/dist/chunks/processBashCommand-CGdwvPmD.js +0 -1
- package/dist/chunks/processSlashCommand-DQarepEb.js +0 -5
- package/dist/chunks/prompt-BgOdcHkd.js +0 -1
- package/dist/chunks/prompt-CE3sFmZV.js +0 -139
- package/dist/chunks/prompt-CLJKFebn.js +0 -1
- package/dist/chunks/promptEditor-CyTzyjwG.js +0 -4
- package/dist/chunks/rate-limit-options-C-EqWjeI.js +0 -1
- package/dist/chunks/rcDebugLog-DBB9r8aw.js +0 -11
- package/dist/chunks/reconciler-CYD_XpG4.js +0 -4
- package/dist/chunks/referral-CKmHHxj_.js +0 -1
- package/dist/chunks/refresh-ZqZdmLK5.js +0 -1
- package/dist/chunks/registerProtocol-wZv2uiW_.js +0 -36
- package/dist/chunks/release-notes-B5K7wVqZ.js +0 -4
- package/dist/chunks/releaseNotes-B8gbyFFJ.js +0 -2
- package/dist/chunks/reload-plugins-B9ApSp2m.js +0 -1
- package/dist/chunks/remote-env-CAt1dHIS.js +0 -1
- package/dist/chunks/remoteBridgeCore-Bk3UdSLJ.js +0 -1
- package/dist/chunks/remoteManagedSettings-bswzAB6W.js +0 -1
- package/dist/chunks/rename-CE_U6KE6.js +0 -1
- package/dist/chunks/resume-BicEjsPd.js +0 -2
- package/dist/chunks/ripgrep-BfIpz5uC.js +0 -1
- package/dist/chunks/rollback-BPWRKlIZ.js +0 -11
- package/dist/chunks/runtimeObserver-BrGF5QWX.js +0 -10
- package/dist/chunks/sandbox-adapter-BtMiHImm.js +0 -1
- package/dist/chunks/sandbox-toggle-D8eebdyI.js +0 -1
- package/dist/chunks/sanitization-DV-94a9Z.js +0 -1
- package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +0 -1
- package/dist/chunks/searchExtraTools-hLLPuh7c.js +0 -1
- package/dist/chunks/semver-BMRJYn3q.js +0 -1
- package/dist/chunks/session-BZIlR9Gc.js +0 -2
- package/dist/chunks/sessionDataUploader-CaCjwsA2.js +0 -1
- package/dist/chunks/sessionDiscovery-DfDqTrF1.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Bm8wiqwe.js +0 -1
- package/dist/chunks/sessionMemory-D37S0-jX.js +0 -1
- package/dist/chunks/sessionMemory-DmlAG3jq.js +0 -1
- package/dist/chunks/sessionMemoryUtils-6EWDHSGU.js +0 -1
- package/dist/chunks/sessionObserver-BUw2rzKl.js +0 -1
- package/dist/chunks/sessionObserver-KgquhGWw.js +0 -20
- package/dist/chunks/sessionStorage-CucBSK5Q.js +0 -1
- package/dist/chunks/sessionTitle-DAnM73S0.js +0 -14
- package/dist/chunks/sessionTracing-_Hh5VXxt.js +0 -11
- package/dist/chunks/settings-BeLFUeie.js +0 -19
- package/dist/chunks/settings-Cl16Haug.js +0 -1
- package/dist/chunks/settingsSync-BNvFYH3c.js +0 -1
- package/dist/chunks/setup-D8kXv3ts.js +0 -3
- package/dist/chunks/shadowedRuleDetection-C6R5zOUe.js +0 -1
- package/dist/chunks/sinks-BuE17DeZ.js +0 -2
- package/dist/chunks/sinks-FevoYQqP.js +0 -1
- package/dist/chunks/skill-learning-CMdxGtxr.js +0 -5
- package/dist/chunks/skillChangeDetector-C65ZLSYV.js +0 -1
- package/dist/chunks/skillGapStore-D18LRJAM.js +0 -5
- package/dist/chunks/skillGapStore-Ep62R-2_.js +0 -1
- package/dist/chunks/skillGenerator-Bc7WwNT8.js +0 -8
- package/dist/chunks/skillLearning-Cs9fJgkV.js +0 -1
- package/dist/chunks/skillLearning-duPZl69A.js +0 -1
- package/dist/chunks/skillPanel-Cyzby746.js +0 -28
- package/dist/chunks/skills-BPPeYBy7.js +0 -1
- package/dist/chunks/slashCommandParsing-RQb_7Xzt.js +0 -1
- package/dist/chunks/startupProfiler-DIWVcO4e.js +0 -1
- package/dist/chunks/startupProfiler-xa3NmN7Z.js +0 -3
- package/dist/chunks/state-BOa-3Av3.js +0 -1
- package/dist/chunks/state-ix0xIunV.js +0 -1
- package/dist/chunks/status-D4IQpsNK.js +0 -2
- package/dist/chunks/statusNoticeHelpers-CEGvdm5d.js +0 -1
- package/dist/chunks/stickers-D5teCKMN.js +0 -1
- package/dist/chunks/subprocessEnv-BSQSomcK.js +0 -1
- package/dist/chunks/syncCache-CANQZ9mQ.js +0 -1
- package/dist/chunks/systemPromptSections-CR_AoPIX.js +0 -1
- package/dist/chunks/systemPromptSections-DN0HGVye.js +0 -1
- package/dist/chunks/tag-DDbNqBMu.js +0 -11
- package/dist/chunks/tasks-CZvWJYGr.js +0 -1
- package/dist/chunks/teleport-Dk5j03Ix.js +0 -1
- package/dist/chunks/terminalSetup-3JNy6i_J.js +0 -33
- package/dist/chunks/thinkback-p-vKIRW_.js +0 -1
- package/dist/chunks/thinkback-play-DnPTDE8B.js +0 -1
- package/dist/chunks/thinkback-rFA1do6F.js +0 -1
- package/dist/chunks/toolEventObserver-CzsCuUMc.js +0 -1
- package/dist/chunks/toolPool-BR27AMJO.js +0 -1
- package/dist/chunks/trustedDevice-BYt39fui.js +0 -1
- package/dist/chunks/tui-C2yuCuOU.js +0 -6
- package/dist/chunks/types-Bh9S_JG5.js +0 -3
- package/dist/chunks/types-DHkZVzJe.js +0 -1
- package/dist/chunks/ultrareviewCommand-C_4OSBTW.js +0 -3
- package/dist/chunks/undercover-D30rKimg.js +0 -31
- package/dist/chunks/undercover-DRSwLozU.js +0 -1
- package/dist/chunks/up-BHkC97_C.js +0 -12
- package/dist/chunks/upgrade-Bi-bIz7R.js +0 -1
- package/dist/chunks/upgrade-Chs-OQFd.js +0 -1
- package/dist/chunks/upload-D8FWMSQx.js +0 -1
- package/dist/chunks/usage-BxVeUt60.js +0 -1
- package/dist/chunks/usage-DUO7Yy1f.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js +0 -1
- package/dist/chunks/useMainLoopModel-Gy1Vv4Qr.js +0 -1
- package/dist/chunks/useManagePlugins-B11_87VN.js +0 -1
- package/dist/chunks/useMergedTools-CR56my9t.js +0 -1
- package/dist/chunks/useSearchInput-C5OzQnX6.js +0 -1
- package/dist/chunks/useSettingsErrors-B9vOZL41.js +0 -1
- package/dist/chunks/util-8EHwfg4A.js +0 -1
- package/dist/chunks/validatePlugin-6q1qmnAC.js +0 -1
- package/dist/chunks/vim-CNDzwoTd.js +0 -1
- package/dist/chunks/windowsPaths-9pEkw0oV.js +0 -1
- package/dist/chunks/workerRegistry-CvyHvwx-.js +0 -1
- package/dist/chunks/worktree-ogmNCIpz.js +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./cwd-CYmmnQVS.js";import{H as a,V as o,_ as s,a as c,d as l,l as u,p as d,z as f}from"./debug-BrXObCdR.js";import{o as p,s as m}from"./log-BMCygSzM.js";import{i as h,o as g}from"./platform-BrYefG_2.js";import{i as ee,n as te}from"./path-D5U-tm91.js";import{n as ne,r as re}from"./analytics-BotDBGh0.js";import{homedir as _}from"os";import{basename as v,dirname as y,extname as b,isAbsolute as ie,join as x,normalize as ae,relative as S,resolve as C,sep as w}from"path";import{chmodSync as T,writeFileSync as E}from"fs";import{realpath as D,stat as O}from"fs/promises";function k(e){let{buffer:t,bytesRead:n}=l().readSync(e,{length:4096});return n===0?`utf8`:n>=2&&t[0]===255&&t[1]===254?`utf16le`:(n>=3&&t[0]===239&&t[1]===187&&t[2],`utf8`)}function A(e){let t=0,n=0;for(let r=0;r<e.length;r++)e[r]===`
|
|
2
|
-
`&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function j(e){let t=l(),{resolvedPath:n,isSymlink:r}=s(t,e);r&&u(`Reading through symlink: ${e} -> ${n}`);let i=k(n),a=t.readFileSync(n,{encoding:i}),o=A(a.slice(0,4096));return{content:a.replaceAll(`\r
|
|
3
|
-
`,`
|
|
4
|
-
`),encoding:i,lineEndings:o}}function M(e){return j(e).content}var N=e((()=>{c(),d()})),P,F,I=e((()=>{$(),d(),t(),P=class{constructor(){n(this,`cache`,new Map),n(this,`maxCacheSize`,1e3)}readFile(e){let t=l(),n;try{n=t.statSync(e)}catch(t){throw this.cache.delete(e),t}let r=e,i=this.cache.get(r);if(i&&i.mtime===n.mtimeMs)return{content:i.content,encoding:i.encoding};let a=H(e),o=t.readFileSync(e,{encoding:a}).replaceAll(`\r
|
|
5
|
-
`,`
|
|
6
|
-
`);if(this.cache.set(r,{content:o,encoding:a,mtime:n.mtimeMs}),this.cache.size>this.maxCacheSize){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}return{content:o,encoding:a}}clear(){this.cache.clear()}invalidate(e){this.cache.delete(e)}getStats(){return{size:this.cache.size,entries:Array.from(this.cache.keys())}}},F=new P}));async function L(e){try{return await O(e),!0}catch{return!1}}function R(e){try{return l().readFileSync(e,{encoding:`utf8`})}catch(e){return m(e),null}}function z(e){let t=l();return Math.floor(t.statSync(e).mtimeMs)}async function B(e){let t=await l().stat(e);return Math.floor(t.mtimeMs)}function V(e,t,n,r){let i=t;r===`CRLF`&&(i=t.replaceAll(`\r
|
|
7
|
-
`,`
|
|
8
|
-
`).split(`
|
|
9
|
-
`).join(`\r
|
|
10
|
-
`)),Y(e,i,{encoding:n})}function H(e){try{let{resolvedPath:t}=s(l(),e);return k(t)}catch(e){return a(e)?u(`detectFileEncoding failed for expected reason: ${e.code}`,{level:`debug`}):m(e),`utf8`}}function U(e,t=`utf8`){try{let n=l(),{resolvedPath:r}=s(n,e),{buffer:i,bytesRead:a}=n.readSync(r,{length:4096});return A(i.toString(t,0,a))}catch(e){return m(e),`LF`}}function W(e){return e.includes(` `)?e.replace(/^\t+/gm,e=>` `.repeat(e.length)):e}function G(e){let t=e?te(e):void 0;return{absolutePath:t,relativePath:t?S(i(),t):void 0}}function K(e){let{relativePath:t}=G(e);if(t&&!t.startsWith(`..`))return t;let n=_();return e.startsWith(n+w)?`~`+e.slice(n.length):e}function q(e){let t=l();try{let n=y(e),r=v(e,b(e)),i=t.readdirSync(n).filter(t=>v(t.name,b(t.name))===r&&x(n,t.name)!==e)[0];return i?i.name:void 0}catch(e){o(e)||m(e);return}}async function oe(e){let t=i(),n=y(t),r=e;try{r=x(await D(y(e)),v(e))}catch{}let a=n===w?w:n+w;if(!r.startsWith(a)||r.startsWith(t+w)||r===t)return;let o=x(t,S(n,r));try{return await O(o),o}catch{return}}function J(){return!0}function se({content:e,startLine:t}){if(!e)return``;let n=e.split(/\r?\n/);return J()?n.map((e,n)=>`${n+t}\t${e}`).join(`
|
|
11
|
-
`):n.map((e,n)=>{let r=String(n+t);return r.length>=6?`${r}→${e}`:`${r.padStart(6,` `)}→${e}`}).join(`
|
|
12
|
-
`)}function ce(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function le(e){try{return l().isDirEmptySync(e)}catch(e){return o(e)}}function ue(e){let{content:t}=F.readFile(e);return t}function Y(e,t,n={encoding:`utf-8`}){let r=l(),i=e;try{let t=r.readlinkSync(e);i=ie(t)?t:C(y(e),t),u(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,s,c=!1;try{s=r.statSync(i).mode,c=!0,u(`Preserving file permissions: ${s.toString(8)}`)}catch(e){if(!o(e))throw e;n.mode!==void 0&&(s=n.mode,u(`Setting permissions for new file: ${s.toString(8)}`))}try{u(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!c&&n.mode!==void 0&&(e.mode=n.mode),E(a,t,e),u(`Temp file written successfully, size: ${t.length} bytes`),c&&s!==void 0&&(T(a,s),u(`Applied original permissions to temp file`)),u(`Renaming ${a} to ${i}`),r.renameSync(a,i),u(`File ${i} written atomically`)}catch(e){u(`Failed to write file atomically: ${e}`,{level:`error`}),re(`tengu_atomic_write_error`,{});try{u(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){u(`Failed to clean up temp file: ${e}`)}u(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!c&&n.mode!==void 0&&(e.mode=n.mode),E(i,t,e),u(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw u(`Non-atomic write also failed: ${e}`),e}}}function de(){let e=h(),t=_();if(e===`macos`)return x(t,`Desktop`);if(e===`windows`){let e=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(e){let t=`/mnt/c${e.replace(/^[A-Z]:/,``)}/Desktop`;if(l().existsSync(t))return t}try{let e=`/mnt/c/Users`,t=l().readdirSync(e);for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=x(e,n.name,`Desktop`);if(l().existsSync(t))return t}}catch(e){m(e)}}let n=x(t,`Desktop`);return l().existsSync(n)?n:t}function fe(e,t=Z){try{return l().statSync(e).size<=t}catch{return!1}}function X(e){let t=ae(e);return t=t.replace(/\\/g,`/`),h()===`windows`&&(t=t.toLowerCase()),t}function pe(e,t){return X(e)===X(t)}var Z,Q,$=e((()=>{ne(),r(),c(),f(),N(),I(),d(),p(),ee(),g(),Z=.25*1024*1024,Q=`Note: your current working directory is`}));export{Y as C,M as D,N as E,j as O,oe as S,k as T,L as _,H as a,ue as b,de as c,B as d,$ as f,X as g,fe as h,W as i,K as l,le as m,Z as n,U as o,J as p,se as r,q as s,Q as t,z as u,pe as v,V as w,ce as x,R as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./index.min-D75yiGLN.js";import{normalize as a}from"path";function o(e,t=d){return new f(e,t)}function s(e){return Object.fromEntries(e.entries())}function c(e){return Array.from(e.keys())}function l(e){let t=o(e.max,e.maxSize);return t.load(e.dump()),t}function u(e,t){let n=l(e);for(let[e,r]of t.entries()){let t=n.get(e);(!t||r.timestamp>t.timestamp)&&n.set(e,r)}return n}var d,f,p=e((()=>{r(),t(),d=25*1024*1024,f=class{constructor(e,t){n(this,`cache`,void 0),this.cache=new i({max:e,maxSize:t,sizeCalculation:e=>{let t=e.content,n=typeof t==`string`?t:t==null?``:typeof t==`object`?JSON.stringify(t):String(t);return Math.max(1,Buffer.byteLength(n,`utf8`))}})}get(e){return this.cache.get(a(e))}set(e,t){return this.cache.set(a(e),t),this}has(e){return this.cache.has(a(e))}delete(e){return this.cache.delete(a(e))}clear(){this.cache.clear()}get size(){return this.cache.size}get max(){return this.cache.max}get maxSize(){return this.cache.maxSize}get calculatedSize(){return this.cache.calculatedSize}keys(){return this.cache.keys()}entries(){return this.cache.entries()}dump(){return this.cache.dump()}load(e){this.cache.load(e)}}}));export{o as a,l as i,c as n,p as o,s as r,u as s,f as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./cwd-CYmmnQVS.js";import{n as r,o as i}from"./fileStateCache-DDW5toIs.js";import{relative as a}from"path";async function o(e,t){let i=t.readFileState?r(t.readFileState):[];return i.length===0?{type:`text`,value:`No files in context`}:{type:`text`,value:`Files in context:\n${i.map(e=>a(n(),e)).join(`
|
|
2
|
-
`)}`}}e((()=>{t(),i()}))();export{o as call};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{l as r,n as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./defineProperty-C-QyHrDq.js";import{T as c,w as l,y as u}from"./esm-Cb-L4oAk.js";import{n as d,t as f}from"./axios-DaWTGg7G.js";import{en as p,ht as m,z as ee}from"./state-ix0xIunV.js";import{n as te,t as ne}from"./cwd-CYmmnQVS.js";import{F as h,H as re,S as g,W as ie,a as _,l as v,w as y,z as ae}from"./debug-BrXObCdR.js";import{$t as oe,Qt as se}from"./settings-BeLFUeie.js";import{c as ce,f as le,g as b,n as ue}from"./config-DRDuVyzE.js";import{c as de,o as fe}from"./execFileNoThrow-D244NytW.js";import{d as pe,o as x,p as S,s as C}from"./log-BMCygSzM.js";import{a as me,i as he,o as ge}from"./platform-BrYefG_2.js";import{l as _e,s as ve}from"./types-Dut4311z.js";import{a as ye,n as be}from"./analytics-BotDBGh0.js";import{i as w,n as xe}from"./startupProfiler-xa3NmN7Z.js";import{$n as Se,Bt as T,Ft as Ce,Gt as we,Nt as Te,Ot as Ee,Rr as De,_n as Oe,ar as ke,jt as E,or as Ae,rr as je,vn as Me,zr as Ne,zt as Pe}from"./model-CZViyZnE.js";import{Z as Fe,_ as Ie,c as Le,et as D,it as Re,n as ze,o as Be,t as Ve,v as He,w as O}from"./esm-5w3xFBnt.js";import*as k from"path";import{randomUUID as Ue}from"crypto";import{appendFile as We,mkdir as A,readdir as Ge,unlink as Ke,writeFile as qe}from"fs/promises";function j(){return r(process.env.CLAUDE_CODE_USE_BEDROCK)||r(process.env.CLAUDE_CODE_USE_VERTEX)||r(process.env.CLAUDE_CODE_USE_FOUNDRY)||S()}function Je(){return S()}var M=e((()=>{a(),pe()}));async function Ye(){N===null&&!P&&(P=Qe(),N=await P,P=null,F.cache.clear?.())}function Xe(){N=null,P=null,F.cache.clear?.(),I.cache.clear?.()}function Ze(){if(N!==null)return N;let e=E();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`&&process.env.COO_CREATOR)return`${process.env.COO_CREATOR}@anthropic.com`}async function Qe(){let e=E();if(e?.emailAddress)return e.emailAddress;if(process.env.USER_TYPE===`ant`)return process.env.COO_CREATOR?`${process.env.COO_CREATOR}@anthropic.com`:I()}var N,P,F,I,$e=e((()=>{de(),n(),p(),T(),b(),te(),oe(),a(),N=null,P=null,F=t(e=>{let t=le(),n=ce(),i,a,o;if(e&&(i=Ce()??void 0,a=Te()??void 0,i&&n.claudeCodeFirstTokenDate)){let e=new Date(n.claudeCodeFirstTokenDate).getTime();isNaN(e)||(o=e)}let s=E(),c=s?.organizationUuid,l=s?.accountUuid;return{deviceId:t,sessionId:m(),email:Ze(),appVersion:`0.0.7`,platform:se(),organizationUuid:c,accountUuid:l,userType:process.env.USER_TYPE,subscriptionType:i,rateLimitTier:a,firstTokenTime:o,...r(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}}}}),I=t(async()=>{let e=await fe(`git config --get user.email`,{shell:!0,reject:!1,cwd:ne()});return e.exitCode===0&&e.stdout?e.stdout.trim():void 0})}));function et(){return{seconds:0,nanos:0}}function tt(e){return e!=null}var L,nt=e((()=>{L={fromJSON(e){return{seconds:tt(e.seconds)?globalThis.Number(e.seconds):0,nanos:tt(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 L.fromPartial(e??{})},fromPartial(e){let t=et();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}}}));function rt(){return{account_id:0,organization_uuid:``,account_uuid:``}}function R(e){return e!=null}var z,it=e((()=>{z={fromJSON(e){return{account_id:R(e.account_id)?globalThis.Number(e.account_id):0,organization_uuid:R(e.organization_uuid)?globalThis.String(e.organization_uuid):``,account_uuid:R(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 z.fromPartial(e??{})},fromPartial(e){let t=rt();return t.account_id=e.account_id??0,t.organization_uuid=e.organization_uuid??``,t.account_uuid=e.account_uuid??``,t}}}));function at(){return{actor_id:``,repository_id:``,repository_owner_id:``}}function ot(){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 st(){return{slack_team_id:``,is_enterprise_install:!1,trigger:``,creation_method:``}}function ct(){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 lt(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function B(e){return e instanceof globalThis.Date?e:typeof e==`string`?new globalThis.Date(e):lt(L.fromJSON(e))}function V(e){return e!=null}var H,U,W,G,ut=e((()=>{nt(),it(),H={fromJSON(e){return{actor_id:V(e.actor_id)?globalThis.String(e.actor_id):``,repository_id:V(e.repository_id)?globalThis.String(e.repository_id):``,repository_owner_id:V(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 H.fromPartial(e??{})},fromPartial(e){let t=at();return t.actor_id=e.actor_id??``,t.repository_id=e.repository_id??``,t.repository_owner_id=e.repository_owner_id??``,t}},U={fromJSON(e){return{platform:V(e.platform)?globalThis.String(e.platform):``,node_version:V(e.node_version)?globalThis.String(e.node_version):``,terminal:V(e.terminal)?globalThis.String(e.terminal):``,package_managers:V(e.package_managers)?globalThis.String(e.package_managers):``,runtimes:V(e.runtimes)?globalThis.String(e.runtimes):``,is_running_with_bun:V(e.is_running_with_bun)?globalThis.Boolean(e.is_running_with_bun):!1,is_ci:V(e.is_ci)?globalThis.Boolean(e.is_ci):!1,is_claubbit:V(e.is_claubbit)?globalThis.Boolean(e.is_claubbit):!1,is_github_action:V(e.is_github_action)?globalThis.Boolean(e.is_github_action):!1,is_claude_code_action:V(e.is_claude_code_action)?globalThis.Boolean(e.is_claude_code_action):!1,is_claude_ai_auth:V(e.is_claude_ai_auth)?globalThis.Boolean(e.is_claude_ai_auth):!1,version:V(e.version)?globalThis.String(e.version):``,github_event_name:V(e.github_event_name)?globalThis.String(e.github_event_name):``,github_actions_runner_environment:V(e.github_actions_runner_environment)?globalThis.String(e.github_actions_runner_environment):``,github_actions_runner_os:V(e.github_actions_runner_os)?globalThis.String(e.github_actions_runner_os):``,github_action_ref:V(e.github_action_ref)?globalThis.String(e.github_action_ref):``,wsl_version:V(e.wsl_version)?globalThis.String(e.wsl_version):``,github_actions_metadata:V(e.github_actions_metadata)?H.fromJSON(e.github_actions_metadata):void 0,arch:V(e.arch)?globalThis.String(e.arch):``,is_claude_code_remote:V(e.is_claude_code_remote)?globalThis.Boolean(e.is_claude_code_remote):!1,remote_environment_type:V(e.remote_environment_type)?globalThis.String(e.remote_environment_type):``,claude_code_container_id:V(e.claude_code_container_id)?globalThis.String(e.claude_code_container_id):``,claude_code_remote_session_id:V(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:V(e.deployment_environment)?globalThis.String(e.deployment_environment):``,is_conductor:V(e.is_conductor)?globalThis.Boolean(e.is_conductor):!1,version_base:V(e.version_base)?globalThis.String(e.version_base):``,coworker_type:V(e.coworker_type)?globalThis.String(e.coworker_type):``,build_time:V(e.build_time)?globalThis.String(e.build_time):``,is_local_agent_mode:V(e.is_local_agent_mode)?globalThis.Boolean(e.is_local_agent_mode):!1,linux_distro_id:V(e.linux_distro_id)?globalThis.String(e.linux_distro_id):``,linux_distro_version:V(e.linux_distro_version)?globalThis.String(e.linux_distro_version):``,linux_kernel:V(e.linux_kernel)?globalThis.String(e.linux_kernel):``,vcs:V(e.vcs)?globalThis.String(e.vcs):``,platform_raw:V(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=H.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 U.fromPartial(e??{})},fromPartial(e){let t=ot();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?H.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}},W={fromJSON(e){return{slack_team_id:V(e.slack_team_id)?globalThis.String(e.slack_team_id):``,is_enterprise_install:V(e.is_enterprise_install)?globalThis.Boolean(e.is_enterprise_install):!1,trigger:V(e.trigger)?globalThis.String(e.trigger):``,creation_method:V(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 W.fromPartial(e??{})},fromPartial(e){let t=st();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}},G={fromJSON(e){return{event_name:V(e.event_name)?globalThis.String(e.event_name):``,client_timestamp:V(e.client_timestamp)?B(e.client_timestamp):void 0,model:V(e.model)?globalThis.String(e.model):``,session_id:V(e.session_id)?globalThis.String(e.session_id):``,user_type:V(e.user_type)?globalThis.String(e.user_type):``,betas:V(e.betas)?globalThis.String(e.betas):``,env:V(e.env)?U.fromJSON(e.env):void 0,entrypoint:V(e.entrypoint)?globalThis.String(e.entrypoint):``,agent_sdk_version:V(e.agent_sdk_version)?globalThis.String(e.agent_sdk_version):``,is_interactive:V(e.is_interactive)?globalThis.Boolean(e.is_interactive):!1,client_type:V(e.client_type)?globalThis.String(e.client_type):``,process:V(e.process)?globalThis.String(e.process):``,additional_metadata:V(e.additional_metadata)?globalThis.String(e.additional_metadata):``,auth:V(e.auth)?z.fromJSON(e.auth):void 0,server_timestamp:V(e.server_timestamp)?B(e.server_timestamp):void 0,event_id:V(e.event_id)?globalThis.String(e.event_id):``,device_id:V(e.device_id)?globalThis.String(e.device_id):``,swe_bench_run_id:V(e.swe_bench_run_id)?globalThis.String(e.swe_bench_run_id):``,swe_bench_instance_id:V(e.swe_bench_instance_id)?globalThis.String(e.swe_bench_instance_id):``,swe_bench_task_id:V(e.swe_bench_task_id)?globalThis.String(e.swe_bench_task_id):``,email:V(e.email)?globalThis.String(e.email):``,agent_id:V(e.agent_id)?globalThis.String(e.agent_id):``,parent_session_id:V(e.parent_session_id)?globalThis.String(e.parent_session_id):``,agent_type:V(e.agent_type)?globalThis.String(e.agent_type):``,slack:V(e.slack)?W.fromJSON(e.slack):void 0,team_name:V(e.team_name)?globalThis.String(e.team_name):``,skill_name:V(e.skill_name)?globalThis.String(e.skill_name):``,plugin_name:V(e.plugin_name)?globalThis.String(e.plugin_name):``,marketplace_name:V(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=U.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=z.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=W.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 G.fromPartial(e??{})},fromPartial(e){let t=ct();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?U.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?z.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?W.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 K(){return k.join(i(),`telemetry`)}function dt(e){if(!d.isAxiosError(e))return h(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 q,J,Y,ft=e((()=>{He(),f(),p(),ut(),T(),b(),_(),a(),ae(),je(),ve(),x(),Oe(),g(),Ae(),De(),be(),D(),o(),q=Ue(),J=`1p_failed_events.`,Y=class{constructor(e={}){s(this,`endpoint`,void 0),s(this,`timeout`,void 0),s(this,`maxBatchSize`,void 0),s(this,`skipAuth`,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.skipAuth=e.skipAuth??!1,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 k.join(K(),`${J}${m()}.${q}.json`)}async loadEventsFromFile(e){try{return await _e(e)}catch{return[]}}async loadEventsFromCurrentBatch(){return this.loadEventsFromFile(this.getCurrentBatchFilePath())}async saveEventsToFile(e,t){try{if(t.length===0)try{await Ke(e)}catch{}else await A(K(),{recursive:!0}),await qe(e,t.map(e=>y(e)).join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`,`utf8`)}catch(e){C(e)}}async appendEventsToFile(e,t){if(t.length!==0)try{await A(K(),{recursive:!0}),await We(e,t.map(e=>y(e)).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`,`utf8`)}catch(e){C(e)}}async deleteFile(e){try{await Ke(e)}catch{}}async retryPreviousBatches(){try{let e=`${J}${m()}.`,t;try{t=(await Ge(K())).filter(t=>t.startsWith(e)&&t.endsWith(`.json`)).filter(e=>!e.includes(q))}catch(e){if(re(e))return;throw e}for(let e of t){let t=k.join(K(),e);this.retryFileInBackground(t)}}catch(e){C(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}process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} events from previous batch`);let n=await this.sendEventsInBatches(t);n.length===0?(await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry succeeded`)):(await this.saveEventsToFile(e,n),process.env.USER_TYPE===`ant`&&v(`1P event logging: previous batch retry failed, ${n.length} events remain`))}async export(e,t){if(this.isShutdown){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: Exporter has been shutdown`),t({code:O.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:O.SUCCESS});return}let r=this.transformLogsToEvents(n).events;if(r.length===0){t({code:O.SUCCESS});return}if(this.attempts>=this.maxAttempts){t({code:O.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:O.FAILED,error:Error(`Failed to export ${i.length} events${e}`)});return}this.resetBackoff(),await this.getQueuedEventCount()>0&&!this.isRetrying&&this.retryFailedEvents(),t({code:O.SUCCESS})}catch(e){process.env.USER_TYPE===`ant`&&v(`1P event logging export failed: ${h(e)}`),C(e),t({code:O.FAILED,error:ie(e)})}}async sendEventsInBatches(e){let t=[];for(let n=0;n<e.length;n+=this.maxBatchSize)t.push(e.slice(n,n+this.maxBatchSize));process.env.USER_TYPE===`ant`&&v(`1P event logging: exporting ${e.length} events in ${t.length} batch(es)`);let n=[],r;for(let e=0;e<t.length;e++){let i=t[e];try{await this.sendBatchWithRetry({events:i})}catch(i){r=dt(i);for(let r=e;r<t.length;r++)n.push(...t[r]);if(process.env.USER_TYPE===`ant`){let n=t.length-1-e;v(`1P event logging: batch ${e+1}/${t.length} failed (${r}); short-circuiting ${n} remaining batch(es)`)}break}e<t.length-1&&this.batchDelayMs>0&&await Me(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}`;C(Error(r))}scheduleBackoffRetry(){if(this.cancelBackoff||this.isRetrying||this.isShutdown)return;let e=Math.min(this.baseBackoffDelayMs*this.attempts*this.attempts,this.maxBackoffDelayMs);process.env.USER_TYPE===`ant`&&v(`1P event logging: scheduling backoff retry in ${e}ms (attempt ${this.attempts})`),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){process.env.USER_TYPE===`ant`&&v(`1P event logging: max attempts (${this.maxAttempts}) reached, dropping ${t.length} events`),await this.deleteFile(e),this.resetBackoff();return}this.isRetrying=!0,await this.deleteFile(e),process.env.USER_TYPE===`ant`&&v(`1P event logging: retrying ${t.length} failed events (attempt ${this.attempts+1})`);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(),process.env.USER_TYPE===`ant`&&v(`1P event logging: backoff retry succeeded`)}}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":ke(),"x-service-name":`claude-code`},n=ue()||ee();process.env.USER_TYPE===`ant`&&!n&&v(`1P event logging: Trust not accepted`);let r=this.skipAuth||!n;if(!r&&we()){let e=Ee();Pe()?e&&Ne(e.expiresAt)&&(r=!0,process.env.USER_TYPE===`ant`&&v(`1P event logging: OAuth token expired, skipping auth to avoid 401`)):r=!0}let i=r?{headers:{},error:`trust not established or Oauth token expired`}:Se(),a=!i.error;!a&&process.env.USER_TYPE===`ant`&&v(`1P event logging: auth not available, sending without auth`);let o=a?{...t,...i.headers}:t;try{let t=await d.post(this.endpoint,e,{timeout:this.timeout,headers:o});this.logSuccess(e.events.length,a,t.data);return}catch(n){if(a&&d.isAxiosError(n)&&n.response?.status===401){process.env.USER_TYPE===`ant`&&v(`1P event logging: 401 auth error, retrying without auth`);let n=await d.post(this.endpoint,e,{timeout:this.timeout,headers:t});this.logSuccess(e.events.length,!1,n.data);return}throw n}}logSuccess(e,t,n){process.env.USER_TYPE===`ant`&&(v(`1P event logging: ${e} events exported successfully${t?` (with auth)`:` (without auth)`}`),v(`API Response: ${y(n,null,2)}`))}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){process.env.USER_TYPE===`ant`&&v(`1P event logging: core_metadata missing for event ${r}`),t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.toJSON({event_id:e.event_id,event_name:r,client_timestamp:this.hrTimeToDate(n.hrTime),session_id:m(),additional_metadata:Buffer.from(y({transform_error:`core_metadata attribute is missing`})).toString(`base64`)})});continue}let s=Re(i,a,o),{_PROTO_skill_name:c,_PROTO_plugin_name:l,_PROTO_marketplace_name:u,...d}=s.additional,f=ye(d);t.push({event_type:`ClaudeCodeInternalEvent`,event_data:G.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(y(f)).toString(`base64`):void 0})})}return{events:t}}async shutdown(){this.isShutdown=!0,this.resetBackoff(),await this.forceFlush(),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),process.env.USER_TYPE===`ant`&&v(`1P event logging exporter flush complete`)}}}));function pt(e){return!1}var mt=e((()=>{}));function ht(){return{}}function gt(e){let t=ht()[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 _t(){if($)try{await $.shutdown(),process.env.USER_TYPE===`ant`&&v(`1P event logging: final shutdown complete`)}catch{}}function X(){return!j()}async function vt(e,t,n={}){try{let r=await Fe({model:n.model,betas:n.betas}),i={event_name:t,event_id:Ue(),core_metadata:r,user_metadata:F(!0),event_metadata:n},a=le();a&&(i.user_id=a),process.env.USER_TYPE===`ant`&&v(`[ANT-ONLY] 1P event: ${t} ${y(n,null,0)}`),e.emit({body:t,attributes:i})}catch(e){process.env.USER_TYPE===`ant`&&C(e)}}function yt(e,t={}){X()&&(!Q||pt(`firstParty`)||vt(Q,e,t))}function bt(){if(w(`1p_event_logging_start`),!X()){process.env.USER_TYPE===`ant`&&v(`1P event logging not enabled`);return}w(`1p_event_after_config`);let e=parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10),t=xt,n=St,r=he(),i={[l]:`claude-code`,[c]:`0.0.7`};if(r===`wsl`){let e=me();e&&(i[`wsl.version`]=e)}$=new Be({resource:Ie(i),processors:[new ze(new Y({maxBatchSize:t,isKilled:()=>pt(`firstParty`)}),{scheduledDelayMillis:e,maxExportBatchSize:t,maxQueueSize:n})]}),Q=$.getLogger(`com.anthropic.claude_code.events`,`0.0.7`)}var Z,xt,St,Q,$,Ct=e((()=>{Le(),Ve(),u(),b(),_(),x(),ge(),g(),xe(),$e(),M(),ft(),D(),mt(),Z=1e4,xt=200,St=8192,Q=null,$=null}));export{yt as a,I as c,Xe as d,M as f,X as i,Ye as l,Je as m,Ct as n,gt as o,j as p,bt as r,_t as s,ht as t,$e as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./firstPartyEventLogger-BXY1IJ2D.js";e();export{t as initialize1PEventLogging};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{F as n,a as r,l as i,z as a}from"./debug-BrXObCdR.js";import{O as o,k as s}from"./rcDebugLog-DBB9r8aw.js";import{i as c}from"./workSecret-CNWiR2uQ.js";import{t as l}from"./ccrClient-BFyfO67b.js";import{n as u,t as d}from"./SSETransport-5VK5okFv.js";u(),r(),a(),o();function f(e){return{write:t=>e.write(t),writeBatch:t=>e.writeBatch(t),close:()=>e.close(),isConnectedStatus:()=>e.isConnectedStatus(),getStateLabel:()=>e.getStateLabel(),setOnData:t=>e.setOnData(t),setOnClose:t=>e.setOnClose(t),setOnConnect:t=>e.setOnConnect(t),connect:()=>void e.connect(),getLastSequenceNum:()=>0,get droppedBatchCount(){return e.droppedBatchCount},reportState:()=>{},reportMetadata:()=>{},reportDelivery:()=>{},flush:()=>Promise.resolve()}}async function p(e){let{sessionUrl:t,ingressToken:r,sessionId:a,initialSequenceNum:o,getAuthToken:u}=e,f;u?f=()=>{let e=u();return e?{Authorization:`Bearer ${e}`}:{}}:s(r);let p=e.epoch??await c(t,r);i(`[bridge:repl] CCR v2: worker sessionId=${a} epoch=${p}${e.epoch===void 0?` (via registerWorker)`:` (from /bridge)`}`);let m=new URL(t);m.pathname=m.pathname.replace(/\/$/,``)+`/worker/events/stream`;let h=new d(m,{},a,void 0,o,f),g,_=new l(h,new URL(t),{getAuthHeaders:f,heartbeatIntervalMs:e.heartbeatIntervalMs,heartbeatJitterFraction:e.heartbeatJitterFraction,onEpochMismatch:()=>{i(`[bridge:repl] CCR v2: epoch superseded (409) — closing for poll-loop recovery`);try{_.close(),h.close(),g?.(4090)}catch(e){i(`[bridge:repl] CCR v2: error during epoch-mismatch cleanup: ${n(e)}`,{level:`error`})}throw Error(`epoch superseded`)}});h.setOnEvent(e=>{_.reportDelivery(e.event_id,`received`),_.reportDelivery(e.event_id,`processed`)});let v,y=!1,b=!1;return{write(e){return _.writeEvent(e)},async writeBatch(e){for(let t of e){if(b)break;await _.writeEvent(t)}},close(){b=!0,_.close(),h.close()},isConnectedStatus(){return y},getStateLabel(){return h.isClosedStatus()?`closed`:h.isConnectedStatus()?y?`connected`:`init`:`connecting`},setOnData(e){h.setOnData(e)},setOnClose(e){g=e,h.setOnClose(t=>{_.close(),e(t??4092)})},setOnConnect(e){v=e},getLastSequenceNum(){return h.getLastSequenceNum()},droppedBatchCount:0,reportState(e){_.reportState(e)},reportMetadata(e){_.reportMetadata(e)},reportDelivery(e,t){_.reportDelivery(e,t)},flush(){return _.flush()},connect(){e.outboundOnly||h.connect(),_.initialize(p).then(()=>{y=!0,i(`[bridge:repl] v2 transport ready for writes (epoch=${p}, sse=${h.isConnectedStatus()?`open`:`opening`})`),v?.()},e=>{i(`[bridge:repl] CCR v2 initialize failed: ${n(e)}`,{level:`error`}),_.close(),h.close(),g?.(4091)})}}}e();var m=class{constructor(){t(this,`_active`,!1),t(this,`_pending`,[])}get active(){return this._active}get pendingCount(){return this._pending.length}start(){this._active=!0}end(){return this._active=!1,this._pending.splice(0)}enqueue(...e){return this._active?(this._pending.push(...e),!0):!1}drop(){this._active=!1;let e=this._pending.length;return this._pending.length=0,e}deactivate(){this._active=!1}};export{f as n,p as r,m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Mo as t,Vo as n,ao as r,at as i,ct as a,zo as o}from"./loadAgentsDir-x3rlgED4.js";import{F as s,a as c,l,z as u}from"./debug-BrXObCdR.js";import{a as d,l as f}from"./proxy-CRN7jYIi.js";import{$ as p,J as m,K as h,P as g,Y as _,Z as v,nt as y}from"./rcDebugLog-DBB9r8aw.js";import{n as b,r as x}from"./SSETransport-5VK5okFv.js";import{randomUUID as S}from"crypto";function C(){return(process.env.GEMINI_BASE_URL||E).replace(/\/+$/,``)}function w(e){let t=e.replace(/^\/+/,``);return t.startsWith(`models/`)?t:`models/${t}`}async function*T(e){let t=await(e.fetchOverride??fetch)(`${C()}/${w(e.model)}:streamGenerateContent?alt=sse`,{method:`POST`,headers:{"Content-Type":`application/json`,"x-goog-api-key":process.env.GEMINI_API_KEY||``},body:JSON.stringify(e.body),signal:e.signal,...d({forAnthropicAPI:!1})});if(!t.ok){let e=await t.text();throw Error(`Gemini API request failed (${t.status} ${t.statusText}): ${e||`empty response body`}`)}if(!t.body)throw Error(`Gemini API returned no response body`);let n=t.body.getReader(),r=new TextDecoder,i=``;try{for(;;){let{done:e,value:t}=await n.read();if(e)break;i+=r.decode(t,D);let{frames:a,remaining:o}=x(i);i=o;for(let e of a)if(!(!e.data||e.data===`[DONE]`))try{yield JSON.parse(e.data)}catch(e){throw Error(`Failed to parse Gemini SSE payload: ${s(e)}`)}}i+=r.decode();let{frames:e}=x(i);for(let t of e)if(!(!t.data||t.data===`[DONE]`))try{yield JSON.parse(t.data)}catch(e){throw Error(`Failed to parse trailing Gemini SSE payload: ${s(e)}`)}}finally{n.releaseLock()}}var E,D,O=e((()=>{b(),u(),f(),E=`https://generativelanguage.googleapis.com/v1beta`,D={stream:!0}}));async function*k(e,t,i,s,c,u){try{let r=y(c.model),d=n(e,i),f=(await Promise.all(i.map(e=>a(e,{getToolPermissionContext:c.getToolPermissionContext,tools:i,agents:c.agents,allowedAgentTypes:c.allowedAgentTypes,model:c.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),{contents:g,systemInstruction:b}=v(d,t),x=_(f),C=m(c.toolChoice),w=T({model:r,signal:s,fetchOverride:c.fetchOverride,body:{contents:g,...b&&{systemInstruction:b},...x.length>0&&{tools:x},...C&&{toolConfig:{functionCallingConfig:C}},generationConfig:{...c.temperatureOverride!==void 0&&{temperature:c.temperatureOverride},...u.type!==`disabled`&&{thinkingConfig:{includeThoughts:!0,...u.type===`enabled`&&{thinkingBudget:u.budgetTokens}}}}}});l(`[Gemini] Calling model=${r}, messages=${g.length}, tools=${x.length}`);let E=h(w,r),D={},O=null,k=0,A=Date.now();for await(let e of E){switch(e.type){case`message_start`:O=e.message,k=Date.now()-A;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.type===`thinking`?r.signature=n.signature:r[p]=n.signature);break}case`content_block_stop`:{let t=D[e.index];if(!t||!O)break;yield{message:{...O,content:o([t],i,c.agentId)},requestId:void 0,type:`assistant`,uuid:S(),timestamp:new Date().toISOString()};break}case`message_delta`:case`message_stop`:break}yield{type:`stream_event`,event:e,...e.type===`message_start`?{ttftMs:k}:void 0}}}catch(e){let t=e instanceof Error?e.message:String(e);l(`[Gemini] Error: ${t}`,{level:`error`}),yield r({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{i(),c(),t(),O(),g()}))();export{k as queryModelGemini};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Cl as t,Mo as n,Sl as r,Tl as i,bo as a,ho as o}from"./loadAgentsDir-x3rlgED4.js";import{G as s,Q as c,a as l,l as u}from"./debug-BrXObCdR.js";async function d(){try{let{getResolvedLanguage:e}=await import(`./language-Baosud0X.js`);return e()===`zh`?m:p}catch{return p}}async function f(e){let t=r();if(!t)return u(`[recap] no CacheSafeParams saved, skipping`),{kind:`no-turn`};let n=new AbortController;e.addEventListener(`abort`,()=>n.abort(),{once:!0});try{let{messages:r}=await i({promptMessages:[o({content:await d()})],cacheSafeParams:t,canUseTool:async()=>({behavior:`deny`,message:`Recap cannot use tools`,decisionReason:{type:`other`,reason:`away_summary`}}),overrides:{abortController:n},querySource:`away_summary`,forkLabel:`away_summary`,maxTurns:1,skipCacheWrite:!0,skipTranscript:!0});if(e.aborted)return{kind:`aborted`};let s=r.find(e=>e.type===`assistant`&&e.isApiErrorMessage);if(s)return{kind:`api-error`,text:a(s)??``};let c=r.filter(e=>e.type===`assistant`&&!e.isApiErrorMessage).pop();if(!c)return{kind:`failed`};let l=a(c);return!l||l.trim().length===0?{kind:`failed`}:{kind:`ok`,text:l.trim()}}catch(t){return t instanceof c||e.aborted||n.signal.aborted?{kind:`aborted`}:(u(`[recap] generation failed: ${t}`),{kind:`failed`})}}var p,m;e((()=>{s(),l(),t(),n(),p=`The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences, no markdown. Lead with the overall goal and current task, then the one next action. Skip root-cause narrative, fix internals, secondary to-dos, and em-dash tangents.`,m=`用户离开后回来了。用中文写 1-2 句话,不超过 60 字,无 markdown。先说明高层目标和当前任务,再说明下一步操作。跳过根因分析和次要待办。`}))();export{f as generateRecap};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{HT as t,Mo as n,et as r,tt as i,vo as a}from"./loadAgentsDir-x3rlgED4.js";import{F as o,a as s,l as c,z as l}from"./debug-BrXObCdR.js";import{s as u,u as d}from"./types-Dut4311z.js";import{st as f}from"./rcDebugLog-DBB9r8aw.js";import{r as p,t as m}from"./sessionTitle-DAnM73S0.js";async function h(e,t){let n=m(e);if(!n)return null;try{let e=await i({systemPrompt:f([`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:[]}}),r=d(Array.isArray(e.message.content)?a(e.message.content):e.message.content);return r&&typeof r==`object`&&`name`in r&&typeof r.name==`string`?r.name:null}catch(e){return c(`generateSessionName failed: ${o(e)}`,{level:`error`}),null}}var g=e((()=>{r(),s(),l(),u(),n(),p(),t()}));export{g as n,h as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,a as t,i as n,p as r,r as i}from"./git-Do0wJvux.js";e();export{i as findGitRoot,n as getBranch,t as getDefaultBranch,r as getRemoteUrl};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{br as a,en as o}from"./state-ix0xIunV.js";import{n as s,t as c}from"./cwd-CYmmnQVS.js";import{S as ee,a as te,d as l,nt as ne,p as re,rt as ie,w as ae}from"./debug-BrXObCdR.js";import{r as oe,t as u}from"./execFileNoThrow-D244NytW.js";import{o as se}from"./log-BMCygSzM.js";import{n as d,t as ce}from"./memoize-B0zhbT8Z.js";import{r as le,t as ue}from"./which-CKQnSouy.js";import{basename as de,dirname as f,join as p,resolve as m,sep as fe}from"path";import{readFileSync as h,realpathSync as g,statSync as _,unwatchFile as v,watchFile as pe}from"fs";import{createHash as me}from"crypto";import{readFile as y,readdir as he,stat as ge}from"fs/promises";function b(e,t,n){let r=_e();if(!r)return;let i={timestamp:new Date().toISOString(),level:e,event:t,data:n??{}},a=l(),o=ae(i)+`
|
|
2
|
-
`;try{a.appendFileSync(r,o)}catch{try{a.mkdirSync(f(r)),a.appendFileSync(r,o)}catch{}}}function _e(){return process.env.CLAUDE_CODE_DIAGNOSTICS_FILE}async function ve(e,t,n){let r=Date.now();b(`info`,`${e}_started`);try{let i=await t(),a=n?n(i):{};return b(`info`,`${e}_completed`,{duration_ms:Date.now()-r,...a}),i}catch(t){throw b(`error`,`${e}_failed`,{duration_ms:Date.now()-r}),t}}var x=e((()=>{re(),ee()}));async function S(e,t,n,r){try{return ye(await y(p(e,`config`),`utf-8`),t,n,r)}catch{return null}}function ye(e,t,n,r){let i=e.split(`
|
|
3
|
-
`),a=t.toLowerCase(),o=r.toLowerCase(),s=!1;for(let e of i){let t=e.trim();if(t.length===0||t[0]===`#`||t[0]===`;`)continue;if(t[0]===`[`){s=Ce(t,a,n);continue}if(!s)continue;let r=be(t);if(r&&r.key.toLowerCase()===o)return r.value}return null}function be(e){let t=0;for(;t<e.length&&we(e[t]);)t++;if(t===0)return null;let n=e.slice(0,t);for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`=`)return null;for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return{key:n,value:xe(e,t)}}function xe(e,t){let n=``,r=!1,i=t;for(;i<e.length;){let t=e[i];if(!r&&(t===`#`||t===`;`))break;if(t===`"`){r=!r,i++;continue}if(t===`\\`&&i+1<e.length){let t=e[i+1];if(r){switch(t){case`n`:n+=`
|
|
4
|
-
`;break;case`t`:n+=` `;break;case`b`:n+=`\b`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;default:n+=t;break}i+=2;continue}if(t===`\\`){n+=`\\`,i+=2;continue}}n+=t,i++}return r||(n=Se(n)),n}function Se(e){let t=e.length;for(;t>0&&(e[t-1]===` `||e[t-1]===` `);)t--;return e.slice(0,t)}function Ce(e,t,n){let r=1;for(;r<e.length&&e[r]!==`]`&&e[r]!==` `&&e[r]!==` `&&e[r]!==`"`;)r++;if(e.slice(1,r).toLowerCase()!==t)return!1;if(n===null)return r<e.length&&e[r]===`]`;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`"`)return!1;r++;let i=``;for(;r<e.length&&e[r]!==`"`;){if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];if(t===`\\`||t===`"`){i+=t,r+=2;continue}i+=t,r+=2;continue}i+=e[r],r++}return r>=e.length||e[r]!==`"`||(r++,r>=e.length||e[r]!==`]`)?!1:i===n}function we(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`-`}var C=e((()=>{}));function Te(){j.clear()}async function w(e){let t=m(e??c()),n=j.get(t);if(n!==void 0)return n;let r=z(t);if(!r)return j.set(t,null),null;let i=p(r,`.git`);try{if((await ge(i)).isFile()){let e=(await y(i,`utf-8`)).trim();if(e.startsWith(`gitdir:`)){let n=m(r,e.slice(7).trim());return j.set(t,n),n}}return j.set(t,i),i}catch{return j.set(t,null),null}}function T(e){return!(!e||e.startsWith(`-`)||e.startsWith(`/`)||e.includes(`..`)||e.split(`/`).some(e=>e===`.`||e===``)||!/^[a-zA-Z0-9/._+@-]+$/.test(e))}function E(e){return/^[0-9a-f]{40}$/.test(e)||/^[0-9a-f]{64}$/.test(e)}async function D(e){try{let t=(await y(p(e,`HEAD`),`utf-8`)).trim();if(t.startsWith(`ref:`)){let n=t.slice(4).trim();if(n.startsWith(`refs/heads/`)){let e=n.slice(11);return T(e)?{type:`branch`,name:e}:null}if(!T(n))return null;let r=await O(e,n);return r?{type:`detached`,sha:r}:{type:`detached`,sha:``}}return E(t)?{type:`detached`,sha:t}:null}catch{return null}}async function O(e,t){let n=await k(e,t);if(n)return n;let r=await A(e);return r&&r!==e?k(r,t):null}async function k(e,t){try{let n=(await y(p(e,t),`utf-8`)).trim();if(n.startsWith(`ref:`)){let t=n.slice(4).trim();return T(t)?O(e,t):null}return E(n)?n:null}catch{}try{let n=await y(p(e,`packed-refs`),`utf-8`);for(let e of n.split(`
|
|
5
|
-
`)){if(e.startsWith(`#`)||e.startsWith(`^`))continue;let n=e.indexOf(` `);if(n!==-1&&e.slice(n+1)===t){let t=e.slice(0,n);return E(t)?t:null}}}catch{}return null}async function A(e){try{return m(e,(await y(p(e,`commondir`),`utf-8`)).trim())}catch{return null}}async function Ee(e,t,n){try{let r=(await y(p(e,t),`utf-8`)).trim();if(r.startsWith(`ref:`)){let e=r.slice(4).trim();if(e.startsWith(n)){let t=e.slice(n.length);return T(t)?t:null}}}catch{}return null}async function De(){let e=await w();if(!e)return`HEAD`;let t=await D(e);return t&&t.type===`branch`?t.name:`HEAD`}async function Oe(){let e=await w();if(!e)return``;let t=await D(e);return t?t.type===`branch`?await O(e,`refs/heads/${t.name}`)??``:t.sha:``}async function ke(){let e=await w();if(!e)return null;let t=await S(e,`remote`,`origin`,`url`);if(t)return t;let n=await A(e);return n&&n!==e?S(n,`remote`,`origin`,`url`):null}async function Ae(){let e=await w();if(!e)return`main`;let t=await A(e)??e,n=await Ee(t,`refs/remotes/origin/HEAD`,`refs/remotes/origin/`);if(n)return n;for(let e of[`main`,`master`])if(await O(t,`refs/remotes/origin/${e}`))return e;return`main`}function je(){return P.get(`branch`,De)}function Me(){return P.get(`head`,Oe)}function Ne(){return P.get(`remoteUrl`,ke)}function Pe(){return P.get(`defaultBranch`,Ae)}async function Fe(e){let t=await w(e);if(!t)return null;let n=await D(t);return n?n.type===`branch`?O(t,`refs/heads/${n.name}`):n.sha:null}async function Ie(e){let t;try{let n=(await y(p(e,`.git`),`utf-8`)).trim();if(!n.startsWith(`gitdir:`))return null;t=m(e,n.slice(7).trim())}catch{return null}let n=await D(t);return n?n.type===`branch`?O(t,`refs/heads/${n.name}`):n.sha:null}async function Le(e){let t=await w(e);if(!t)return null;let n=await S(t,`remote`,`origin`,`url`);if(n)return n;let r=await A(t);return r&&r!==t?S(r,`remote`,`origin`,`url`):null}async function Re(){try{let e=await w();return e?(await he(p(await A(e)??e,`worktrees`))).length+1:0}catch{return 1}}var j,M,N,P,F=e((()=>{o(),ne(),s(),$(),C(),r(),j=new Map,M=1e3,N=class{constructor(){i(this,`gitDir`,null),i(this,`commonDir`,null),i(this,`initialized`,!1),i(this,`initPromise`,null),i(this,`watchedPaths`,[]),i(this,`branchRefPath`,null),i(this,`cache`,new Map)}async ensureStarted(){if(!this.initialized)return this.initPromise||(this.initPromise=this.start()),this.initPromise}async start(){this.gitDir=await w(),this.initialized=!0,this.gitDir&&(this.commonDir=await A(this.gitDir),this.watchPath(p(this.gitDir,`HEAD`),()=>{this.onHeadChanged()}),this.watchPath(p(this.commonDir??this.gitDir,`config`),()=>{this.invalidate()}),await this.watchCurrentBranchRef(),ie(async()=>{this.stopWatching()}))}watchPath(e,t){this.watchedPaths.push(e),pe(e,{interval:M},t)}async watchCurrentBranchRef(){if(!this.gitDir)return;let e=await D(this.gitDir),t=this.commonDir??this.gitDir,n=e?.type===`branch`?p(t,`refs`,`heads`,e.name):null;n!==this.branchRefPath&&(this.branchRefPath&&(v(this.branchRefPath),this.watchedPaths=this.watchedPaths.filter(e=>e!==this.branchRefPath)),this.branchRefPath=n,n&&this.watchPath(n,()=>{this.invalidate()}))}async onHeadChanged(){this.invalidate(),await a(),await this.watchCurrentBranchRef()}invalidate(){for(let e of this.cache.values())e.dirty=!0}stopWatching(){for(let e of this.watchedPaths)v(e);this.watchedPaths=[],this.branchRefPath=null}async get(e,t){await this.ensureStarted();let n=this.cache.get(e);if(n&&!n.dirty)return n.value;n&&(n.dirty=!1);let r=await t(),i=this.cache.get(e);return i&&!i.dirty&&(i.value=r),i||this.cache.set(e,{value:r,dirty:!1,compute:t}),r}reset(){this.stopWatching(),this.cache.clear(),this.initialized=!1,this.initPromise=null,this.gitDir=null,this.commonDir=null}},P=new N}));function ze(){function e(e){let t=R(e);return t===L?null:t}return e.cache=R.cache,e}function Be(){function e(e){let t=z(e);return t?B(t):null}return e.cache=B.cache,e}function Ve(e){return w(e)}function I(e){let t=e.trim();if(!t)return null;let n=t.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(n&&n[1]&&n[2])return`${n[1]}/${n[2]}`.toLowerCase();let r=t.match(/^(?:https?|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/);if(r&&r[1]&&r[2]){let e=r[1],t=r[2];if(We(e)&&t.startsWith(`git/`)){let e=t.slice(4),n=e.split(`/`);return n.length>=3&&n[0].includes(`.`)?e.toLowerCase():`github.com/${e}`.toLowerCase()}return`${e}/${t}`.toLowerCase()}return null}async function He(){let e=await J();if(!e)return null;let t=I(e);return t?me(`sha256`).update(t).digest(`hex`).substring(0,16):null}async function Ue(){try{let[e,t,n,r,i,a]=await Promise.all([G(),K(),J(),Y(),X(),Q()]);return{commitHash:e,branchName:t,remoteUrl:n,isHeadOnRemote:r,isClean:i,worktreeCount:a}}catch{return null}}function We(e){let t=e.split(`:`)[0]??``;return t===`localhost`||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function Ge(){let e=l(),t=c(),n=p(t,`.git`);try{let t=e.statSync(n);if(t.isFile())return!1;if(t.isDirectory()){let t=p(n,`HEAD`);try{if(e.statSync(t).isFile())return!1}catch{}}}catch{}try{if(e.statSync(p(t,`HEAD`)).isFile())return!0}catch{}try{if(e.statSync(p(t,`objects`)).isDirectory())return!0}catch{}try{if(e.statSync(p(t,`refs`)).isDirectory())return!0}catch{}return!1}var L,R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q,Ke,$=e((()=>{n(),s(),te(),x(),oe(),re(),F(),se(),ce(),ue(),L=Symbol(`git-root-not-found`),R=d(e=>{let t=Date.now();b(`info`,`find_git_root_started`);let n=m(e),r=n.substring(0,n.indexOf(fe)+1)||fe,i=0;for(;n!==r;){try{let e=p(n,`.git`);i++;let r=_(e);if(r.isDirectory()||r.isFile())return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),n.normalize(`NFC`)}catch{}let e=f(n);if(e===n)break;n=e}try{let e=p(r,`.git`);i++;let n=_(e);if(n.isDirectory()||n.isFile())return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!0}),r.normalize(`NFC`)}catch{}return b(`info`,`find_git_root_completed`,{duration_ms:Date.now()-t,stat_count:i,found:!1}),L},e=>e,50),z=ze(),B=d(e=>{try{let t=h(p(e,`.git`),`utf-8`).trim();if(!t.startsWith(`gitdir:`))return e;let n=m(e,t.slice(7).trim()),r=m(n,h(p(n,`commondir`),`utf-8`).trim());return m(f(n))!==p(r,`worktrees`)||g(h(p(n,`gitdir`),`utf-8`).trim())!==p(g(e),`.git`)?e:de(r)===`.git`?f(r).normalize(`NFC`):r.normalize(`NFC`)}catch{return e}},e=>e,50),V=Be(),H=t(()=>le(`git`)||`git`),U=t(async()=>{let e=Date.now();b(`info`,`is_git_check_started`);let t=z(c())!==null;return b(`info`,`is_git_check_completed`,{duration_ms:Date.now()-e,is_git:t}),t}),W=async e=>z(e)!==null,G=async()=>Me(),K=async()=>je(),q=async()=>Pe(),J=async()=>Ne(),Y=async()=>{let{code:e}=await u(H(),[`rev-parse`,`@{u}`],{preserveOutputOnError:!1});return e===0},X=async e=>{let t=[`--no-optional-locks`,`status`,`--porcelain`];e?.ignoreUntracked&&t.push(`-uno`);let{stdout:n}=await u(H(),t,{preserveOutputOnError:!1});return n.trim().length===0},Z=async()=>{let{stdout:e}=await u(H(),[`--no-optional-locks`,`status`,`--porcelain`],{preserveOutputOnError:!1}),t=[],n=[];return e.trim().split(`
|
|
6
|
-
`).filter(e=>e.length>0).forEach(e=>{let r=e.substring(0,2),i=e.substring(2).trim();r===`??`?n.push(i):i&&t.push(i)}),{tracked:t,untracked:n}},Q=async()=>Re(),Ke=async e=>{try{let t=e||`Work Mate auto-stash - ${new Date().toISOString()}`,{untracked:n}=await Z();if(n.length>0){let{code:e}=await u(H(),[`add`,...n],{preserveOutputOnError:!1});if(e!==0)return!1}let{code:r}=await u(H(),[`stash`,`push`,`--message`,t],{preserveOutputOnError:!1});return r===0}catch{return!1}}}));export{S as A,Fe as C,w as D,Ie as E,b as M,ve as N,O,A as S,F as T,$ as _,q as a,Ke as b,Ue as c,U as d,Y as f,H as g,Q as h,K as i,x as j,C as k,G as l,He as m,V as n,Z as o,J as p,z as r,Ve as s,W as t,X as u,Ge as v,Le as w,Te as x,I as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{en as e,nt as t}from"./state-ix0xIunV.js";import{a as n,l as r}from"./debug-BrXObCdR.js";import{b as i,c as a,g as o}from"./config-DRDuVyzE.js";import{T as s,_ as c,r as l,w as u}from"./git-Do0wJvux.js";import{_ as d,f}from"./file-DcZWPH2V.js";import{a as p,i as m,n as h}from"./detectRepository-BPr0VWNO.js";import{realpath as g}from"fs/promises";e(),o(),n(),m(),f(),s(),c();async function _(){try{let e=await h();if(!e){r(`Not in a GitHub repository, skipping path mapping update`);return}let n=t(),o=l(n)??n,s;try{s=(await g(o)).normalize(`NFC`)}catch{s=o}let c=e.toLowerCase(),u=a().githubRepoPaths?.[c]??[];if(u[0]===s){r(`Path ${s} already tracked for repo ${c}`);return}let d=u.filter(e=>e!==s),f=[s,...d];i(e=>({...e,githubRepoPaths:{...e.githubRepoPaths,[c]:f}})),r(`Added ${s} to tracked paths for repo ${c}`)}catch(e){r(`Error updating repo path mapping: ${e}`)}}function v(e){let t=a(),n=e.toLowerCase();return t.githubRepoPaths?.[n]??[]}async function y(e){let t=await Promise.all(e.map(d));return e.filter((e,n)=>t[n])}async function b(e,t){try{let n=await u(e);if(!n)return!1;let r=p(n);return r?r.toLowerCase()===t.toLowerCase():!1}catch{return!1}}function x(e,t){let n=a(),o=e.toLowerCase(),s=n.githubRepoPaths?.[o]??[],c=s.filter(e=>e!==t);if(c.length===s.length)return;let l={...n.githubRepoPaths};c.length===0?delete l[o]:l[o]=c,i(e=>({...e,githubRepoPaths:l})),r(`Removed ${t} from tracked paths for repo ${o}`)}export{b as a,_ as i,v as n,x as r,y as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{AT as o,Qu as s,TT as c,Xu as l,Zu as u,ap as d,fp as f,ip as p,ix as m,lp as h,mp as g,np as _,op as v,pp as y,rp as b,rx as x,sp as S,up as C}from"./loadAgentsDir-x3rlgED4.js";import{n as w,t as T}from"./PermissionDialog-0ya1CU5k.js";function E({currentGoal:e,newObjective:r,onConfirm:i,onCancel:a}){function o(e){e===`yes`?i():a()}let s=e.tokenBudget===null?`${e.tokensUsed}`:`${e.tokensUsed} / ${e.tokenBudget}`;return(0,D.jsx)(T,{color:`warning`,title:`Replace active goal?`,children:(0,D.jsxs)(t,{flexDirection:`column`,marginTop:1,paddingX:1,children:[(0,D.jsx)(n,{children:`A goal is already in progress. Replacing it will reset all progress and counters.`}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`Current goal:`}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Objective: `}),e.objective]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Status: `}),v(e.status)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Time: `}),d(e)]}),(0,D.jsxs)(n,{children:[(0,D.jsx)(n,{dimColor:!0,children:`· Tokens: `}),s]})]}),(0,D.jsxs)(t,{marginTop:1,flexDirection:`column`,children:[(0,D.jsx)(n,{dimColor:!0,children:`New objective:`}),(0,D.jsx)(n,{children:r})]}),(0,D.jsx)(t,{marginTop:1,children:(0,D.jsx)(m,{options:[{label:`Yes, replace the goal`,value:`yes`},{label:`No, keep the current goal`,value:`no`}],onChange:o,onCancel:a})})]})})}var D,O=e((()=>{r(),i(),x(),w(),C(),D=a()}));function k(e){let t=e.split(`
|
|
2
|
-
`)[0]??e;return t.length<=I?t:t.slice(0,I)+`…`}function A(){o(e=>e.origin===`goal-continuation`||e.origin===`goal-budget-limit`)}function j(){let e=S();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: ${v(e.status)}`,`Time: ${d(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 M(e){return g(e),h(),u(),`Goal set.`}async function N(e,t,n){let r=n.trim();if(!r||r.toLowerCase()===`status`)return e(j(),{display:`system`}),null;let i=r.toLowerCase();if(i===`clear`){let t=_();return t&&(s(),A()),e(t?`Goal cleared.`:`No active goal to clear.`,{display:`system`}),null}if(i===`pause`){let t=f();return t&&(u(),A()),e(t?`Goal paused.`:`No active goal to pause.`,{display:`system`}),null}if(i===`resume`){if(S()?.status===`max_turns`)return e("Goal reached max continuation turns (150). Run `/goal continue` to reset turn counter and continue.",{display:`system`}),null;let t=y();return t&&u(),e(t?`Goal resumed.`:`No paused goal to resume.`,{display:`system`,shouldQuery:!!t}),null}if(i===`continue`){let t=p();return t&&u(),e(t?`Goal continuation counter reset (0/150). Continuing...`:`Current goal is not in max-turns state.`,{display:`system`,shouldQuery:!!t}),null}if(i===`complete`){let t=b();return t&&(u(),A()),e(t?`Goal marked complete.`:`No active goal to complete.`,{display:`system`}),null}if(r.length>F)return e(`Goal objective is too long (${r.length} chars; limit ${F}). Save the detailed instructions to a file and reference it from a shorter objective.`,{display:`system`}),null;let a=S();return a&&a.status!==`complete`?(0,P.jsx)(E,{currentGoal:a,newObjective:r,onConfirm:()=>{A(),e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]})},onCancel:()=>{e(`Kept the current goal. New objective discarded.`,{display:`system`})}}):(e(M(r),{display:`system`,shouldQuery:!0,displayArgs:k(r),metaMessages:[`<goal-objective-updated>\n${r}\n</goal-objective-updated>`]}),null)}var P,F,I;e((()=>{r(),C(),l(),c(),O(),P=a(),F=4e3,I=80}))();export{N as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$f as t,Ah as n,Mo as r,Vo as i,Yf as a,ao as o,at as s,ct as c,kh as l,zo as u}from"./loadAgentsDir-x3rlgED4.js";import{a as d,l as f}from"./debug-BrXObCdR.js";import{V as p,W as m}from"./model-CZViyZnE.js";import{B as h,F as g,L as _,P as v,R as y,it as b}from"./rcDebugLog-DBB9r8aw.js";import{n as x,t as S}from"./openaiShared-G2-w4gJt.js";import{randomUUID as C}from"crypto";async function*w(e,t,n,r,s){try{let o=b(s.model),d=i(e,n),m=(await Promise.all(n.map(e=>c(e,{getToolPermissionContext:s.getToolPermissionContext,tools:n,agents:s.agents,allowedAgentTypes:s.allowedAgentTypes,model:s.model})))).filter(e=>{let t=e;return t.type!==`advisor_20260301`&&t.type!==`computer_20250124`}),v=h(d,t),S=y(m),w=_(s.toolChoice),T=l({maxRetries:0,fetchOverride:s.fetchOverride,source:s.querySource});f(`[Grok] Calling model=${o}, messages=${v.length}, tools=${S.length}`);let E=g(await T.chat.completions.create({model:o,messages:v,...S.length>0&&{tools:S,...w&&{tool_choice:w}},stream:!0,stream_options:{include_usage:!0},...s.temperatureOverride!==void 0&&{temperature:s.temperatureOverride}},{signal:r}),o),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],n,s.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&&a(p(o,k),k,s.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);f(`[Grok] Error: ${t}`,{level:`error`}),yield o({content:`API Error: ${t}`,apiError:`api_error`,error:e instanceof Error?e:Error(String(e))})}}e((()=>{n(),S(),v(),r(),s(),d(),t(),m()}))();export{w as queryModelGrok};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{$S as a,ZS as o}from"./loadAgentsDir-x3rlgED4.js";import{a as s,l as c}from"./debug-BrXObCdR.js";import{b as l,c as u,g as d}from"./config-DRDuVyzE.js";import{a as f,n as p}from"./process-gEbdy6uY.js";import{d as m,f as h,o as g,s as _}from"./log-BMCygSzM.js";import{n as v,r as y}from"./analytics-BotDBGh0.js";import{l as b,u as x}from"./oauth-BqJqV-2M.js";import{$n as S,Bt as C,Kt as w,ar as T,ir as E,jt as D,or as O,rr as k,tr as A}from"./model-CZViyZnE.js";async function j(){try{await E(()=>{let e=S();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.post(`${b().BASE_API_URL}/api/oauth/account/grove_notice_viewed`,{},{headers:{...e.headers,"User-Agent":T()}})}),R.cache.clear?.()}catch(e){_(e)}}async function M(e){try{await E(()=>{let t=S();if(t.error)throw Error(`Failed to get auth headers: ${t.error}`);return r.patch(`${b().BASE_API_URL}/api/oauth/account/settings`,{grove_enabled:e},{headers:{...t.headers,"User-Agent":T()}})}),R.cache.clear?.()}catch(e){_(e)}}async function N(){if(!w())return!1;let e=D()?.accountUuid;if(!e)return!1;let t=u().groveConfigCache?.[e];return t?Date.now()-t.timestamp>L?(c(`Grove: Cache stale, returning cached data and refreshing in background`),P(e),t.grove_enabled):(c(`Grove: Using fresh cached config`),t.grove_enabled):(c(`Grove: No cache, fetching config in background (dialog skipped this session)`),P(e),!1)}async function P(e){try{let t=await z();if(!t.success)return;let n=t.data.grove_enabled,r=u().groveConfigCache?.[e];if(r?.grove_enabled===n&&Date.now()-r.timestamp<=L)return;l(t=>({...t,groveConfigCache:{...t.groveConfigCache,[e]:{grove_enabled:n,timestamp:Date.now()}}}))}catch(e){c(`Grove: Failed to fetch and store config: ${e}`)}}function F(e,t,n){if(!e.success||!t.success)return!1;let r=e.data,i=t.data;if(r.grove_enabled!==null)return!1;if(n||!i.notice_is_grace_period)return!0;let a=i.notice_reminder_frequency;return a!==null&&r.grove_notice_viewed_at?Math.floor((Date.now()-new Date(r.grove_notice_viewed_at).getTime())/(1e3*60*60*24))>=a:r.grove_notice_viewed_at==null}async function I(){let[e,t]=await Promise.all([R(),z()]);if(F(e,t,!1)){let e=t.success?t.data:null;y(`tengu_grove_print_viewed`,{dismissable:e?.notice_is_grace_period}),e===null||e.notice_is_grace_period?(f(`
|
|
2
|
-
An update to our Consumer Terms and Privacy Policy will take effect on October 8, 2025. Run \`claude\` to review the updated terms.
|
|
3
|
-
|
|
4
|
-
`),await j()):(f(`
|
|
5
|
-
[ACTION REQUIRED] An update to our Consumer Terms and Privacy Policy has taken effect on October 8, 2025. You must run \`claude\` to review the updated terms.
|
|
6
|
-
|
|
7
|
-
`),await o(1))}}var L,R,z,B=e((()=>{i(),n(),v(),C(),s(),a(),m(),p(),x(),d(),k(),g(),O(),L=1440*60*1e3,R=t(async()=>{if(h())return{success:!1};try{return{success:!0,data:(await E(()=>{let e=S();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/oauth/account/settings`,{headers:{...e.headers,"User-Agent":T()}})})).data}}catch(e){return _(e),R.cache.clear?.(),{success:!1}}}),z=t(async()=>{if(h())return{success:!1};try{let{grove_enabled:e,domain_excluded:t,notice_is_grace_period:n,notice_reminder_frequency:i}=(await E(()=>{let e=S();if(e.error)throw Error(`Failed to get auth headers: ${e.error}`);return r.get(`${b().BASE_API_URL}/api/claude_code_grove`,{headers:{...e.headers,"User-Agent":A()},timeout:3e3})})).data;return{success:!0,data:{grove_enabled:e,domain_excluded:t??!1,notice_is_grace_period:n??!0,notice_reminder_frequency:i}}}catch(e){return c(`Failed to fetch Grove notice config: ${e}`),{success:!1}}})}));export{B as a,M as c,R as i,I as n,N as o,z as r,j as s,F as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{en as t,ht as n}from"./state-ix0xIunV.js";import{S as r,W as i,a,d as o,l as s,p as c,w as l,z as u}from"./debug-BrXObCdR.js";import{o as d,s as f}from"./log-BMCygSzM.js";import{c as p,f as m}from"./file-DcZWPH2V.js";import{n as h,r as g}from"./analytics-BotDBGh0.js";import{join as _}from"path";import{createWriteStream as v,writeFileSync as y}from"fs";import{readFile as b,readdir as x,writeFile as S}from"fs/promises";import{pipeline as C}from"stream/promises";import{getHeapSnapshot as w,getHeapSpaceStatistics as T,getHeapStatistics as E}from"v8";async function D(e,t=0){let r=process.memoryUsage(),i=E(),a=process.resourceUsage(),o=process.uptime(),s;try{s=T()}catch{}let c=process._getActiveHandles().length,l=process._getActiveRequests().length,u;try{u=(await x(`/proc/self/fd`)).length}catch{}let d;try{d=await b(`/proc/self/smaps_rollup`,`utf8`)}catch{}let f=r.rss-r.heapUsed,p=o>0?r.rss/o:0,m=p*3600/(1024*1024),h=[];return i.number_of_detached_contexts>0&&h.push(`${i.number_of_detached_contexts} detached context(s) - possible iframe/context leak`),c>100&&h.push(`${c} active handles - possible timer/socket leak`),f>r.heapUsed&&h.push(`Native memory > heap - leak may be in native addons (node-pty, sharp, etc.)`),m>100&&h.push(`High memory growth rate: ${m.toFixed(1)} MB/hour`),u&&u>500&&h.push(`${u} open file descriptors - possible file/socket leak`),{timestamp:new Date().toISOString(),sessionId:n(),trigger:e,dumpNumber:t,uptimeSeconds:o,memoryUsage:{heapUsed:r.heapUsed,heapTotal:r.heapTotal,external:r.external,arrayBuffers:r.arrayBuffers,rss:r.rss},memoryGrowthRate:{bytesPerSecond:p,mbPerHour:m},v8HeapStats:{heapSizeLimit:i.heap_size_limit,mallocedMemory:i.malloced_memory,peakMallocedMemory:i.peak_malloced_memory,detachedContexts:i.number_of_detached_contexts,nativeContexts:i.number_of_native_contexts},v8HeapSpaces:s?.map(e=>({name:e.space_name,size:e.space_size,used:e.space_used_size,available:e.space_available_size})),resourceUsage:{maxRSS:a.maxRSS*1024,userCPUTime:a.userCPUTime,systemCPUTime:a.systemCPUTime},activeHandles:c,activeRequests:l,openFileDescriptors:u,analysis:{potentialLeaks:h,recommendation:h.length>0?`WARNING: ${h.length} potential leak indicator(s) found. See potentialLeaks array.`:`No obvious leak indicators. Check heap snapshot for retained objects.`},smapsRollup:d,platform:process.platform,nodeVersion:process.version,ccVersion:`0.0.7`}}async function O(e=`manual`,t=0){try{let r=n(),i=await D(e,t),a=e=>(e/1024/1024/1024).toFixed(3);s(`[HeapDump] Memory state:
|
|
2
|
-
heapUsed: ${a(i.memoryUsage.heapUsed)} GB (in snapshot)
|
|
3
|
-
external: ${a(i.memoryUsage.external)} GB (NOT in snapshot)
|
|
4
|
-
rss: ${a(i.memoryUsage.rss)} GB (total process)
|
|
5
|
-
${i.analysis.recommendation}`);let c=p();await o().mkdir(c);let u=t>0?`-dump${t}`:``,d=`${r}${u}.heapsnapshot`,f=`${r}${u}-diagnostics.json`,m=_(c,d),h=_(c,f);return await S(h,l(i,null,2),{mode:384}),s(`[HeapDump] Diagnostics written to ${h}`),await k(m),s(`[HeapDump] Heap dump written to ${m}`),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!0}),{success:!0,heapPath:m,diagPath:h}}catch(n){let r=i(n);return f(r),g(`tengu_heap_dump`,{triggerManual:e===`manual`,triggerAuto15GB:e===`auto-1.5GB`,dumpNumber:t,success:!1}),{success:!1,error:r.message}}}async function k(e){if(typeof Bun<`u`){y(e,Bun.generateHeapSnapshot(`v8`,`arraybuffer`),{mode:384}),Bun.gc(!0);return}let t=v(e,{mode:384});await C(w(),t)}var A=e((()=>{t(),h(),a(),u(),m(),c(),d(),r()}));async function j(){let e=await O();return e.success?{type:`text`,value:`${e.heapPath}\n${e.diagPath}`}:{type:`text`,value:`Failed to create heap dump: ${e.error}`}}e((()=>{A()}))();export{j as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,Wt as a,a as o,fi as s,n as c,ot as l,r as u,t as d,x as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{Li as m,Qi as h,Wi as g,XS as _,ax as v,hx as y,ix as b,mx as x,zi as S}from"./loadAgentsDir-x3rlgED4.js";import{S as C,x as w}from"./startupProfiler-xa3NmN7Z.js";import{u as T}from"./referral-CKmHHxj_.js";import{n as E,t as D}from"./useExitOnCtrlCDWithKeybindings-BwsZ5f0s.js";import{n as O,r as k}from"./modalContext-DFjKLCB6.js";import{n as A,t as j}from"./PromptInputHelpMenu-DX-0wEDo.js";function M({commands:e,maxHeight:t,columns:r,title:a,onCancel:s,emptyMessage:c}){let{headerFocused:l,focusHeader:u}=o(),d=Math.max(1,r-10),f=Math.max(1,Math.floor((t-10)/2)),p=(0,N.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:C(g(e),d,!0)}))},[e,d]);return(0,P.jsx)(n,{flexDirection:`column`,paddingY:1,children:e.length===0&&c?(0,P.jsx)(i,{dimColor:!0,children:c}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(i,{children:a}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(b,{options:p,visibleOptionCount:f,onCancel:s,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:u,isDisabled:l})})]})})}var N,P,F=e((()=>{s(),N=t(s(),1),h(),w(),d(),v(),P=p()}));function I(){return(0,L.jsxs)(n,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(i,{bold:!0,children:`Getting started`}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`1. `}),(0,L.jsx)(i,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`2. `}),(0,L.jsx)(i,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(i,{children:[(0,L.jsx)(i,{bold:!0,children:`3. `}),(0,L.jsx)(i,{children:`Type `}),(0,L.jsx)(i,{bold:!0,children:`/commit`}),(0,L.jsx)(i,{children:` to commit changes, `}),(0,L.jsx)(i,{bold:!0,children:`/help`}),(0,L.jsx)(i,{children:` for commands, or `}),(0,L.jsx)(i,{bold:!0,children:`?`}),(0,L.jsx)(i,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(n,{flexDirection:`column`,children:[(0,L.jsx)(n,{children:(0,L.jsx)(i,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{s(),d(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:o,columns:s}=l(),d=Math.floor(o/2),p=k(),h=()=>e(`Help dialog dismissed`,{display:`system`});a(`help:dismiss`,h,{context:`Help`});let g=E(h),_=y(`help:dismiss`,`Help`,`esc`),v=S(),b=t.filter(e=>v.has(e.name)&&!e.isHidden),x=[];if(process.env.USER_TYPE===`ant`){let e=new Set(m.map(e=>e.name));b=b.filter(t=>!e.has(t.name)),x=t.filter(t=>e.has(t.name)&&!t.isHidden)}let C=t.filter(e=>!v.has(e.name)&&!e.isHidden),w=[(0,B.jsx)(c,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return w.push((0,B.jsx)(c,{title:`commands`,children:(0,B.jsx)(M,{commands:b,maxHeight:d,columns:s,title:`Browse default commands:`,onCancel:h})},`commands`)),w.push((0,B.jsx)(c,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:C,maxHeight:d,columns:s,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:h})},`custom`)),process.env.USER_TYPE===`ant`&&x.length>0&&w.push((0,B.jsx)(c,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:x,maxHeight:d,columns:s,title:`Browse ant-only commands:`,onCancel:h})},`ant-only`)),(0,B.jsx)(n,{flexDirection:`column`,height:p?void 0:d,children:(0,B.jsxs)(f,{color:`professionalBlue`,children:[(0,B.jsx)(u,{title:process.env.USER_TYPE===`ant`?`/help`:`Work Mate v0.0.7`,color:`professionalBlue`,defaultTab:`general`,children:w}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsxs)(i,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(n,{marginTop:1,children:(0,B.jsx)(i,{dimColor:!0,children:g.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,g.keyName,` again to exit`]}):(0,B.jsxs)(i,{italic:!0,children:[_,` to cancel`]})})})]})})}var B,V=e((()=>{s(),D(),x(),h(),O(),_(),d(),T(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Zt as e,dn as t,vn as n,yn as r}from"./loadAgentsDir-x3rlgED4.js";r();export{e as executeSessionEndHooks,t as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{o as t}from"./log-BMCygSzM.js";function n(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertWorkspaceHost: invalid URL "${e}". Workspace API key requests must target ${i}.`)}if(t!==i)throw Error(`assertWorkspaceHost: refusing to send workspace API key to non-official host "${t}". Workspace API key requests must target ${i}. If you are using a custom base URL, workspace endpoints are only available on the official API.`)}function r(e){let t;try{t=new URL(e).hostname}catch{throw Error(`assertSubscriptionBaseUrl: invalid URL "${e}". Subscription OAuth requests must target ${i}.`)}if(t!==i)throw Error(`assertSubscriptionBaseUrl: refusing subscription OAuth request to non-official host "${t}". Subscription OAuth requests must target ${i}.`)}var i,a=e((()=>{t(),i=`api.anthropic.com`}));export{n,a as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./inboundAttachments-IH-g95jo.js";export{e as resolveAndPrepend};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./envUtils-DSxRz_kt.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{D as i,N as a,g as o,n as s,r as c,t as l}from"./lazySchema-DULtBUCI.js";import{en as u,ht as d}from"./state-ix0xIunV.js";import{a as f,l as p}from"./debug-BrXObCdR.js";import{a as m,n as h,t as g}from"./bridgeConfig-CE6dMsiJ.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),c(),u(),f(),t(),l(),m();var S=3e4;function C(e){p(`[bridge:inbound-attach] ${e}`)}var w=s(()=>i({file_uuid:a(),file_name:a()})),T=s(()=>o(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,d())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l,t as u}from"./classPrivateFieldSet2-D4U5K-I3.js";import{n as d,t as f}from"./classPrivateMethodInitSpec-BXQD0Vh4.js";import{channel as p,tracingChannel as m}from"node:diagnostics_channel";function h(){let e=new ke(c(w,this)),t=new ke(c(w,this));u(U,this,e),u(H,this,t);let n=this.ttlAutopurge?Array.from({length:c(w,this)}):void 0;u(W,this,n),u(he,this,(n,r,a=c(k,this).now())=>{t[n]=r===0?0:a,e[n]=r,i(n,r)}),u(Y,this,n=>{t[n]=e[n]===0?0:c(k,this).now(),i(n,e[n])});let i=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let a=setTimeout(()=>{c(Z,this).call(this,e)?(r(J,this,S).call(this,c(N,this)[e],`expire`),n[e]=void 0):i(e,s(e))},t+1);a.unref&&a.unref(),n[e]=a}}:()=>{};u(X,this,(n,r)=>{if(e[r]){let i=e[r],s=t[r];if(!i||!s)return;n.ttl=i,n.start=s,n.now=a||o(),n.remainingTTL=i-(n.now-s)}});let a=0,o=()=>{let e=c(k,this).now();if(this.ttlResolution>0){a=e;let t=setTimeout(()=>a=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=c(M,this).get(e);return t===void 0?0:s(t)};let s=n=>{let r=e[n],i=t[n];return!r||!i?1/0:r-((a||o())-i)};u(Z,this,n=>{let r=t[n],i=e[n];return!!i&&!!r&&(a||o())-r>i})}function g(){let e=new ke(c(w,this));u(j,this,0),u(V,this,e),u(ge,this,t=>{u(j,this,c(j,this)-e[t]),e[t]=0}),u(ve,this,(e,t,n,i)=>{if(!$(n)){if(r(J,this,x).call(this,t))return this.backgroundFetchSize;if(i){if(typeof i!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=i(t,e),!$(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n}),u(_e,this,(t,n,i)=>{if(e[t]=n,c(T,this)){let n=c(T,this)-e[t];for(;c(j,this)>n;)r(J,this,b).call(this,!0)}u(j,this,c(j,this)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=c(j,this))})}function*_({allowStale:e=this.allowStale}={}){if(c(A,this))for(let t=c(R,this);r(J,this,ee).call(this,t)&&((e||!c(Z,this).call(this,t))&&(yield t),t!==c(L,this));)t=c(I,this)[t]}function*v({allowStale:e=this.allowStale}={}){if(c(A,this))for(let t=c(L,this);r(J,this,ee).call(this,t)&&((e||!c(Z,this).call(this,t))&&(yield t),t!==c(R,this));)t=c(F,this)[t]}function ee(e){return e!==void 0&&c(M,this).get(c(N,this)[e])===e}function y(e,t,n,i){var a;let{ttl:o=this.ttl,start:s,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:d=this.sizeCalculation,status:f}=n,p=r(J,this,x).call(this,t);if(t===void 0)return f&&(f.set=`deleted`),this.delete(e),this;let{noUpdateTTL:m=this.noUpdateTTL}=n;f&&!p&&(f.value=t);let g=c(ve,this).call(this,e,t,n.size||0,d,f);if(this.maxEntrySize&&g>this.maxEntrySize)return r(J,this,S).call(this,e,`set`),f&&(f.set=`miss`,f.maxEntrySizeExceeded=!0),this;let _=c(A,this)===0?void 0:c(M,this).get(e);if(_===void 0)_=c(A,this)===0?c(R,this):c(z,this).length===0?c(A,this)===c(w,this)?r(J,this,b).call(this,!1):c(A,this):c(z,this).pop(),c(N,this)[_]=e,c(P,this)[_]=t,c(M,this).set(e,_),c(F,this)[c(R,this)]=_,c(I,this)[_]=c(R,this),u(R,this,_),u(A,this,(a=c(A,this),a++,a)),c(_e,this).call(this,_,g,f),f&&(f.set=`add`),m=!1,c(q,this)&&!p&&c(D,this)?.call(this,t,e,`add`);else{r(J,this,le).call(this,_);let n=c(P,this)[_];if(t!==n){if(!l)if(r(J,this,x).call(this,n)){n!==i&&n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:r}=n;r!==void 0&&r!==t&&(c(G,this)&&c(E,this)?.call(this,r,e,`set`),c(K,this)&&c(B,this)?.push([r,e,`set`]))}else c(G,this)&&c(E,this)?.call(this,n,e,`set`),c(K,this)&&c(B,this)?.push([n,e,`set`]);if(c(ge,this).call(this,_),c(_e,this).call(this,_,g,f),c(P,this)[_]=t,!p){let i=n&&r(J,this,x).call(this,n)?n.__staleWhileFetching:n,a=i===void 0?`add`:t===i?`update`:`replace`;f&&(f.set=a,i!==void 0&&(f.oldValue=i)),c(q,this)&&this.onInsert?.(t,e,a)}}else p||(f&&(f.set=`update`),c(q,this)&&this.onInsert?.(t,e,`update`))}if(o!==0&&!c(U,this)&&r(J,this,h).call(this),c(U,this)&&(m||c(he,this).call(this,_,o,s),f&&c(X,this).call(this,f,_)),!l&&c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}return this}function b(e){var t;let n=c(L,this),i=c(N,this)[n],a=c(P,this)[n],o=r(J,this,x).call(this,a);o&&a.__abortController.abort(Error(`evicted`));let s=o?a.__staleWhileFetching:a;return(c(G,this)||c(K,this))&&s!==void 0&&(c(G,this)&&c(E,this)?.call(this,s,i,`evict`),c(K,this)&&c(B,this)?.push([s,i,`evict`])),c(ge,this).call(this,n),c(W,this)?.[n]&&(clearTimeout(c(W,this)[n]),c(W,this)[n]=void 0),e&&(c(N,this)[n]=void 0,c(P,this)[n]=void 0,c(z,this).push(n)),c(A,this)===1?(u(L,this,u(R,this,0)),c(z,this).length=0):u(L,this,c(F,this)[n]),c(M,this).delete(i),u(A,this,(t=c(A,this),t--,t)),n}function te(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=c(M,this).get(e);if(a!==void 0){let e=c(P,this)[a];if(r(J,this,x).call(this,e)&&e.__staleWhileFetching===void 0)return!1;if(c(Z,this).call(this,a))i&&(i.has=`stale`,c(X,this).call(this,i,a));else return n&&c(Y,this).call(this,a),i&&(i.has=`hit`,c(X,this).call(this,i,a)),!0}else i&&(i.has=`miss`);return!1}function ne(e,t){let{status:n,allowStale:i=this.allowStale}=t,a=c(M,this).get(e);if(a===void 0||!i&&c(Z,this).call(this,a)){n&&(n.peek=a===void 0?`miss`:`stale`);return}let o=c(P,this)[a],s=r(J,this,x).call(this,o)?o.__staleWhileFetching:o;return n&&(s===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=s)),s}function re(e,t,n,i){let a=t===void 0?void 0:c(P,this)[t];if(r(J,this,x).call(this,a))return a;let o=new AbortController,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=(i,a=!1)=>{let{aborted:s}=o.signal,u=n.ignoreFetchAbort&&i!==void 0,d=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&i!==void 0);if(n.status&&(s&&!a?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,u&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!u&&!a)return f(o.signal.reason,d);let p=m,h=c(P,this)[t];return(h===m||h===void 0&&u&&a)&&(i===void 0?p.__staleWhileFetching===void 0?r(J,this,S).call(this,e,`fetch`):c(P,this)[t]=p.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),r(J,this,y).call(this,e,i,l.options,p))),i},d=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),f(e,!1)),f=(i,a)=>{let{aborted:s}=o.signal,l=s&&n.allowStaleOnFetchAbort,u=l||n.allowStaleOnFetchRejection,d=u||n.noDeleteOnFetchRejection,f=m;if(c(P,this)[t]===m&&(!d||!a&&f.__staleWhileFetching===void 0?r(J,this,S).call(this,e,`fetch`):l||(c(P,this)[t]=f.__staleWhileFetching)),u)return n.status&&f.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),f.__staleWhileFetching;if(f.__returned===f)throw i},p=(t,r)=>{let i=c(fe,this)?.call(this,e,a,l);o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))}),i&&i instanceof Promise?i.then(e=>t(e===void 0?void 0:e),r):i!==void 0&&t(i)};n.status&&(n.status.fetchDispatched=!0);let m=new Promise(p).then(u,d),h=Object.assign(m,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(r(J,this,y).call(this,e,h,{...l.options,status:void 0}),t=c(M,this).get(e)):c(P,this)[t]=h,h}function x(e){if(!c(me,this))return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}async function ie(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:m=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:g,forceRefresh:_=!1,status:v,signal:ee}=t;if(v&&(v.op=`fetch`,v.key=e,_&&(v.forceRefresh=!0),v.cache=this),!c(me,this))return v&&(v.fetch=`get`),r(J,this,se).call(this,e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:v});let y={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:s,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:h,ignoreFetchAbort:m,status:v,signal:ee},b=c(M,this).get(e);if(b===void 0){v&&(v.fetch=`miss`);let t=r(J,this,re).call(this,e,b,y,g);return t.__returned=t}else{let t=c(P,this)[b];if(r(J,this,x).call(this,t)){let e=n&&t.__staleWhileFetching!==void 0;return v&&(v.fetch=`inflight`,e&&(v.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let a=c(Z,this).call(this,b);if(!_&&!a)return v&&(v.fetch=`hit`),r(J,this,le).call(this,b),i&&c(Y,this).call(this,b),v&&c(X,this).call(this,v,b),t;let o=r(J,this,re).call(this,e,b,y,g),s=o.__staleWhileFetching!==void 0&&n;return v&&(v.fetch=a?`stale`:`refresh`,s&&a&&(v.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async function ae(e,t={}){let n=await r(J,this,ie).call(this,e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}function oe(e,t={}){let n=c(pe,this);if(!n)throw Error(`no memoMethod provided to constructor`);let{context:i,status:a,forceRefresh:o,...s}=t;a&&o&&(a.forceRefresh=!0);let l=r(J,this,se).call(this,e,s),u=o||l===void 0;if(a&&(a.memo=u?`miss`:`hit`,u||(a.value=l)),!u)return l;let d=n(e,l,{options:s,context:i});return a&&(a.value=d),r(J,this,y).call(this,e,d,s),d}function se(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=t,s=c(M,this).get(e);if(s===void 0){o&&(o.get=`miss`);return}let l=c(P,this)[s],u=r(J,this,x).call(this,l);return o&&c(X,this).call(this,o,s),c(Z,this).call(this,s)?u?(o&&(o.get=`stale-fetching`),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(a||r(J,this,S).call(this,e,`expire`),o&&(o.get=`stale`),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?`fetching`:`hit`),r(J,this,le).call(this,s),i&&c(Y,this).call(this,s),u?l.__staleWhileFetching:l)}function ce(e,t){c(I,this)[t]=e,c(F,this)[e]=t}function le(e){e!==c(R,this)&&(e===c(L,this)?u(L,this,c(F,this)[e]):r(J,this,ce).call(this,c(I,this)[e],c(F,this)[e]),r(J,this,ce).call(this,c(R,this),e),u(R,this,e))}function S(e,t){Q.hasSubscribers&&Q.publish({op:`delete`,delete:t,key:e,cache:this});let n=!1;if(c(A,this)!==0){let a=c(M,this).get(e);if(a!==void 0)if(c(W,this)?.[a]&&(clearTimeout(c(W,this)[a]),c(W,this)[a]=void 0),n=!0,c(A,this)===1)r(J,this,ue).call(this,t);else{var i;c(ge,this).call(this,a);let n=c(P,this)[a];if(r(J,this,x).call(this,n)?n.__abortController.abort(Error(`deleted`)):(c(G,this)||c(K,this))&&(c(G,this)&&c(E,this)?.call(this,n,e,t),c(K,this)&&c(B,this)?.push([n,e,t])),c(M,this).delete(e),c(N,this)[a]=void 0,c(P,this)[a]=void 0,a===c(R,this))u(R,this,c(I,this)[a]);else if(a===c(L,this))u(L,this,c(F,this)[a]);else{let e=c(I,this)[a];c(F,this)[e]=c(F,this)[a];let t=c(F,this)[a];c(I,this)[t]=c(I,this)[a]}u(A,this,(i=c(A,this),i--,i)),c(z,this).push(a)}}if(c(K,this)&&c(B,this)?.length){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}return n}function ue(e){for(let t of r(J,this,v).call(this,{allowStale:!0})){let n=c(P,this)[t];if(r(J,this,x).call(this,n))n.__abortController.abort(Error(`deleted`));else{let r=c(N,this)[t];c(G,this)&&c(E,this)?.call(this,n,r,e),c(K,this)&&c(B,this)?.push([n,r,e])}}if(c(M,this).clear(),c(P,this).fill(void 0),c(N,this).fill(void 0),c(U,this)&&c(H,this)){c(U,this).fill(0),c(H,this).fill(0);for(let e of c(W,this)??[])e!==void 0&&clearTimeout(e);c(W,this)?.fill(void 0)}if(c(V,this)&&c(V,this).fill(0),u(L,this,0),u(R,this,0),c(z,this).length=0,u(j,this,0),u(A,this,0),c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}}var C,de,w,T,E,D,O,fe,pe,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W,G,me,K,q,J,Y,X,he,Z,ge,_e,ve,ye,be,Q,xe,Se,Ce,we,Te,Ee,De,$,Oe,ke,Ae,je,Me=e((()=>{t(),s(),d(),i(),a(),o(),Q=p(`lru-cache:metrics`),xe=m(`lru-cache`),Se=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Ce=()=>Q.hasSubscribers||xe.hasSubscribers,we=new Set,Te=typeof process==`object`&&process?process:{},Ee=(e,t,n,r)=>{typeof Te.emitWarning==`function`?Te.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},De=e=>!we.has(e),$=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),Oe=e=>$(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ke:null:null,ke=class extends Array{constructor(e){super(e),this.fill(0)}},Ae=(C=class e{static create(t){let n=Oe(t);if(!n)return[];de._=r(C,e,!0);let i=new e(t,n);return de._=r(C,e,!1),i}constructor(t,i){if(n(this,`heap`,void 0),n(this,`length`,void 0),!r(C,e,de)._)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new i(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},de={_:!1},C),je=(w=new WeakMap,T=new WeakMap,E=new WeakMap,D=new WeakMap,O=new WeakMap,fe=new WeakMap,pe=new WeakMap,k=new WeakMap,A=new WeakMap,j=new WeakMap,M=new WeakMap,N=new WeakMap,P=new WeakMap,F=new WeakMap,I=new WeakMap,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,me=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakSet,Y=new WeakMap,X=new WeakMap,he=new WeakMap,Z=new WeakMap,ge=new WeakMap,_e=new WeakMap,ve=new WeakMap,be=Symbol.iterator,ye=Symbol.toStringTag,class e{get perf(){return c(k,this)}static unsafeExposeInternals(e){return{starts:c(H,e),ttls:c(U,e),autopurgeTimers:c(W,e),sizes:c(V,e),keyMap:c(M,e),keyList:c(N,e),valList:c(P,e),next:c(F,e),prev:c(I,e),get head(){return c(L,e)},get tail(){return c(R,e)},free:c(z,e),isBackgroundFetch:t=>r(J,e,x).call(e,t),backgroundFetch:(t,n,i,a)=>r(J,e,re).call(e,t,n,i,a),moveToTail:t=>r(J,e,le).call(e,t),indexes:t=>r(J,e,_).call(e,t),rindexes:t=>r(J,e,v).call(e,t),isStale:t=>c(Z,e).call(e,t)}}get max(){return c(w,this)}get maxSize(){return c(T,this)}get calculatedSize(){return c(j,this)}get size(){return c(A,this)}get fetchMethod(){return c(fe,this)}get memoMethod(){return c(pe,this)}get dispose(){return c(E,this)}get onInsert(){return c(D,this)}get disposeAfter(){return c(O,this)}constructor(t){f(this,J),l(this,w,void 0),l(this,T,void 0),l(this,E,void 0),l(this,D,void 0),l(this,O,void 0),l(this,fe,void 0),l(this,pe,void 0),l(this,k,void 0),n(this,`ttl`,void 0),n(this,`ttlResolution`,void 0),n(this,`ttlAutopurge`,void 0),n(this,`updateAgeOnGet`,void 0),n(this,`updateAgeOnHas`,void 0),n(this,`allowStale`,void 0),n(this,`noDisposeOnSet`,void 0),n(this,`noUpdateTTL`,void 0),n(this,`maxEntrySize`,void 0),n(this,`sizeCalculation`,void 0),n(this,`noDeleteOnFetchRejection`,void 0),n(this,`noDeleteOnStaleGet`,void 0),n(this,`allowStaleOnFetchAbort`,void 0),n(this,`allowStaleOnFetchRejection`,void 0),n(this,`ignoreFetchAbort`,void 0),n(this,`backgroundFetchSize`,void 0),l(this,A,void 0),l(this,j,void 0),l(this,M,void 0),l(this,N,void 0),l(this,P,void 0),l(this,F,void 0),l(this,I,void 0),l(this,L,void 0),l(this,R,void 0),l(this,z,void 0),l(this,B,void 0),l(this,V,void 0),l(this,H,void 0),l(this,U,void 0),l(this,W,void 0),l(this,G,void 0),l(this,me,void 0),l(this,K,void 0),l(this,q,void 0),l(this,Y,()=>{}),l(this,X,()=>{}),l(this,he,()=>{}),l(this,Z,()=>!1),l(this,ge,e=>{}),l(this,_e,(e,t,n)=>{}),l(this,ve,(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0}),n(this,ye,`LRUCache`);let{max:i=0,ttl:a,ttlResolution:o=1,ttlAutopurge:s,updateAgeOnGet:d,updateAgeOnHas:p,allowStale:m,dispose:_,onInsert:v,disposeAfter:ee,noDisposeOnSet:y,noUpdateTTL:b,maxSize:te=0,maxEntrySize:ne=0,sizeCalculation:re,fetchMethod:x,memoMethod:ie,noDeleteOnFetchRejection:ae,noDeleteOnStaleGet:oe,allowStaleOnFetchRejection:se,allowStaleOnFetchAbort:ce,ignoreFetchAbort:le,backgroundFetchSize:S=1,perf:ue}=t;if(this.backgroundFetchSize=S,ue!==void 0&&typeof ue?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(u(k,this,ue??Se),i!==0&&!$(i))throw TypeError(`max option must be a nonnegative integer`);let C=i?Oe(i):Array;if(!C)throw Error(`invalid max value: `+i);if(u(w,this,i),u(T,this,te),this.maxEntrySize=ne||c(T,this),this.sizeCalculation=re,this.sizeCalculation){if(!c(T,this)&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(ie!==void 0&&typeof ie!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(u(pe,this,ie),x!==void 0&&typeof x!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(u(fe,this,x),u(me,this,!!x),u(M,this,new Map),u(N,this,Array.from({length:i}).fill(void 0)),u(P,this,Array.from({length:i}).fill(void 0)),u(F,this,new C(i)),u(I,this,new C(i)),u(L,this,0),u(R,this,0),u(z,this,Ae.create(i)),u(A,this,0),u(j,this,0),typeof _==`function`&&u(E,this,_),typeof v==`function`&&u(D,this,v),typeof ee==`function`?(u(O,this,ee),u(B,this,[])):(u(O,this,void 0),u(B,this,void 0)),u(G,this,!!c(E,this)),u(q,this,!!c(D,this)),u(K,this,!!c(O,this)),this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!ae,this.allowStaleOnFetchRejection=!!se,this.allowStaleOnFetchAbort=!!ce,this.ignoreFetchAbort=!!le,this.maxEntrySize!==0){if(c(T,this)!==0&&!$(c(T,this)))throw TypeError(`maxSize must be a positive integer if specified`);if(!$(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);r(J,this,g).call(this)}if(this.allowStale=!!m,this.noDeleteOnStaleGet=!!oe,this.updateAgeOnGet=!!d,this.updateAgeOnHas=!!p,this.ttlResolution=$(o)||o===0?o:1,this.ttlAutopurge=!!s,this.ttl=a||0,this.ttl){if(!$(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);r(J,this,h).call(this)}if(c(w,this)===0&&this.ttl===0&&c(T,this)===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!c(w,this)&&!c(T,this)){let t=`LRU_CACHE_UNBOUNDED`;De(t)&&(we.add(t),Ee(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return c(M,this).has(e)?1/0:0}*entries(){for(let e of r(J,this,_).call(this))c(P,this)[e]!==void 0&&c(N,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield[c(N,this)[e],c(P,this)[e]])}*rentries(){for(let e of r(J,this,v).call(this))c(P,this)[e]!==void 0&&c(N,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield[c(N,this)[e],c(P,this)[e]])}*keys(){for(let e of r(J,this,_).call(this)){let t=c(N,this)[e];t!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield t)}}*rkeys(){for(let e of r(J,this,v).call(this)){let t=c(N,this)[e];t!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield t)}}*values(){for(let e of r(J,this,_).call(this))c(P,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield c(P,this)[e])}*rvalues(){for(let e of r(J,this,v).call(this))c(P,this)[e]!==void 0&&!r(J,this,x).call(this,c(P,this)[e])&&(yield c(P,this)[e])}[be](){return this.entries()}find(e,t={}){for(let n of r(J,this,_).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,c(N,this)[n],this))return r(J,this,se).call(this,c(N,this)[n],t)}}forEach(e,t=this){for(let n of r(J,this,_).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,c(N,this)[n],this)}}rforEach(e,t=this){for(let n of r(J,this,v).call(this)){let i=c(P,this)[n],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,c(N,this)[n],this)}}purgeStale(){let e=!1;for(let t of r(J,this,v).call(this,{allowStale:!0}))c(Z,this).call(this,t)&&(r(J,this,S).call(this,c(N,this)[t],`expire`),e=!0);return e}info(e){let t=c(M,this).get(e);if(t===void 0)return;let n=c(P,this)[t],i=r(J,this,x).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;let a={value:i};if(c(U,this)&&c(H,this)){let e=c(U,this)[t],n=c(H,this)[t];e&&n&&(a.ttl=e-(c(k,this).now()-n),a.start=Date.now())}return c(V,this)&&(a.size=c(V,this)[t]),a}dump(){let e=[];for(let t of r(J,this,_).call(this,{allowStale:!0})){let n=c(N,this)[t],i=c(P,this)[t],a=r(J,this,x).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;let o={value:a};if(c(U,this)&&c(H,this)){o.ttl=c(U,this)[t];let e=c(k,this).now()-c(H,this)[t];o.start=Math.floor(Date.now()-e)}c(V,this)&&(o.size=c(V,this)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=c(k,this).now()-e}r(J,this,y).call(this,t,n.value,n)}}set(e,t,n={}){let{status:i=Q.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op=`set`,i.key=e,t!==void 0&&(i.value=t),i.cache=this);let a=r(J,this,y).call(this,e,t,n);return i&&Q.hasSubscribers&&Q.publish(i),a}pop(){try{for(;c(A,this);){let e=c(P,this)[c(L,this)];if(r(J,this,b).call(this,!0),r(J,this,x).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(c(K,this)&&c(B,this)){let e=c(B,this),t;for(;t=e?.shift();)c(O,this)?.call(this,...t)}}}has(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`has`,n.key=e,n.cache=this);let i=r(J,this,te).call(this,e,t);return Q.hasSubscribers&&Q.publish(n),i}peek(e,t={}){let{status:n=Ce()?{}:void 0}=t;n&&(n.op=`peek`,n.key=e,n.cache=this),t.status=n;let i=r(J,this,ne).call(this,e,t);return Q.hasSubscribers&&Q.publish(n),i}fetch(e,t={}){let n=xe.hasSubscribers,{status:i=Ce()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let a=r(J,this,ie).call(this,e,t);return i&&n&&(i.trace=!0,xe.tracePromise(()=>a,i).catch(()=>{})),a}forceFetch(e,t={}){let n=xe.hasSubscribers,{status:i=Ce()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let a=r(J,this,ae).call(this,e,t);return i&&n&&(i.trace=!0,xe.tracePromise(()=>a,i).catch(()=>{})),a}memo(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`memo`,n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=r(J,this,oe).call(this,e,t);return n&&(n.value=i),Q.hasSubscribers&&Q.publish(n),i}get(e,t={}){let{status:n=Q.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`get`,n.key=e,n.cache=this);let i=r(J,this,se).call(this,e,t);return n&&(i!==void 0&&(n.value=i),Q.hasSubscribers&&Q.publish(n)),i}delete(e){return r(J,this,S).call(this,e,`delete`)}clear(){return r(J,this,ue).call(this,`delete`)}})}));export{Me as n,je as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,u as r}from"./envUtils-DSxRz_kt.js";import{en as i,ht as a,nt as o}from"./state-ix0xIunV.js";import{Ca as s,Co as c,Da as l,Ea as ee,Ha as u,Ia as d,Io as f,Mo as p,Nl as m,Oa as h,Pa as g,Sa as _,Ta as v,ab as y,ba as b,jr as x,kl as S,mr as C,ob as w,va as T,wa as te,xa as E,xo as ne,ya as D}from"./loadAgentsDir-x3rlgED4.js";import{F as O,a as re,l as k,nt as ie,rt as ae,z as A}from"./debug-BrXObCdR.js";import{b as oe,c as se,g as ce}from"./config-DRDuVyzE.js";import{M as j,_ as le,i as M,j as ue,p as de}from"./git-Do0wJvux.js";import{g as fe,m as N}from"./log-BMCygSzM.js";import{n as pe,r as P}from"./analytics-BotDBGh0.js";import{Bt as F,It as I,Lr as L,Ot as R,Rr as me,_n as he,mt as z,vn as B}from"./model-CZViyZnE.js";import{O as V,_ as ge,d as _e,k as ve,n as ye,t as H}from"./rcDebugLog-DBB9r8aw.js";import{a as U,c as W,d as be,f as xe,o as G,r as K,s as q,u as J}from"./debugUtils-NO5KtXqi.js";import{a as Se,i as Y,n as Ce,o as X,t as Z}from"./bridgeConfig-CE6dMsiJ.js";import{a as Q,o as $,r as we,s as Te,t as Ee}from"./bridgeEnabled-Cc0mGlTb.js";import{i as De,t as Oe}from"./assistant-C83quuNj.js";import{t as ke}from"./capacityWake-CV_x9H8j.js";import{n as Ae,t as je}from"./pollConfig-2nFzv6Hy.js";import{i as Me}from"./trustedDevice-CKedohmT.js";import{a as Ne,n as Pe,r as Fe,t as Ie}from"./workSecret-CNWiR2uQ.js";import{a as Le,i as Re,n as ze,t as Be}from"./createSession-8Ei-Lj7V.js";import{i as Ve,n as He}from"./envLessBridgeConfig-B-LKYNvv.js";import{n as Ue,o as We}from"./mappers-04gNXJ3w.js";import{n as Ge,r as Ke,t as qe}from"./sessionTitle-DAnM73S0.js";import{a as Je,i as Ye,n as Xe,o as Ze,r as Qe,t as $e}from"./bridgeMessaging-DdvApEqW.js";import{t as et}from"./HybridTransport-rK83Qijz.js";import{n as tt,r as nt,t as rt}from"./flushGate-CgHq81Gw.js";import{hostname as it}from"os";import{randomUUID as at}from"crypto";i(),N(),le(),ce(),me(),F(),Se(),w(),we(),p(),g(),x(),Re(),Ve(),Ue(),Ke(),v(),re(),H(),ue(),pe(),ie(),W(),S(),V(),_e(),n(),G(),A(),he(),D();var ot=2e3,st=6e4,ct=900*1e3,lt=0;async function ut(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:l,workerType:ee,getAccessToken:u,createSession:d,archiveSession:f,getCurrentTitle:p=()=>s,toSDKMessages:h=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:g,getPollIntervalConfig:v=()=>Ae,initialHistoryCap:y=200,initialMessages:x,previouslyFlushedUUIDs:S,onInboundMessage:C,onPermissionResponse:w,onInterrupt:ne,onSetModel:D,onSetMaxThinkingTokens:re,onSetPermissionMode:ie,onStateChange:A,onUserMessage:oe,perpetual:se,initialSSESequenceNum:ce=0}=e,le=++lt,{writeBridgePointer:M,clearBridgePointer:ue,readBridgePointer:de}=await import(`./bridgePointer-DqHMHa2B.js`),fe=se?await de(n):null,N=fe?.source===`repl`?fe:null;k(`[bridge:repl] initBridgeCore #${le} starting (initialMessages=${x?.length??0}${N?` perpetual prior=env:${N.environmentId}`:``})`);let pe=te({baseUrl:c,getAccessToken:u,runnerVersion:`0.0.7`,onDebug:k,onAuth401:g,getTrustedDeviceToken:Me}),F=process.env.USER_TYPE===`ant`?_(pe):pe,I={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:at(),workerType:ee,environmentId:at(),reuseEnvironmentId:N?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return q(`registration_failed`,`[bridge:repl] Environment registration failed: ${O(e)}`),N&&await ue(n),A?.(`failed`,O(e)),null}k(`[bridge:repl] Environment registered: ${L}`),j(`info`,`bridge_repl_env_registered`),P(`tengu_bridge_repl_env_registered`,{});async function me(e,t){if(L!==e)return k(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=xe(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),k(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){k(`[bridge:repl] reconnectSession(${e}) failed: ${O(t)}`)}return k(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let he=N?await me(N.environmentId,N.sessionId):!1;N&&!he&&await ue(n);let z;if(he&&N){if(z=N.sessionId,k(`[bridge:repl] Perpetual session reused: ${z}`),x&&S)for(let e of x)S.add(e.uuid)}else{let e=await d({environmentId:L,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return k(`[bridge:repl] Session creation failed, deregistering environment`),P(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),A?.(`failed`,`Session creation failed`),null;z=e,k(`[bridge:repl] Session created: ${z}`)}await M(n,{sessionId:z,environmentId:L,source:`repl`}),j(`info`,`bridge_repl_session_created`),P(`tengu_bridge_repl_started`,{has_initial_messages:!!(x&&x.length>0),inProtectedNamespace:r()});let B=new Set;if(x)for(let e of x)B.add(e.uuid);let V=new $e(2e3);for(let e of B)V.add(e);let _e=new $e(2e3),H=new AbortController,U=null;ge(e=>{H.signal.aborted||U?.reportMetadata(e)},{replayCurrent:!0});let W=0,G=he?ce:0,K=null,J=null,Se=ke(H.signal),Y=Se.wake,Ce=Se.signal,X=new rt,Z=!oe,Q=0,$=null;async function we(){if($)return $;$=Te();try{return await $}finally{$=null}}async function Te(){if(Q++,ye(`doReconnect: attempt=${Q}/3 envId=${L} sessionId=${z} workId=${K}`),W++,k(`[bridge:repl] Reconnecting after env lost (attempt ${Q}/3)`),Q>3)return k(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}if(Y(),X.drop(),K){let e=K;if(await F.stopWork(L,e,!1).catch(()=>{}),K!==e)return k(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Q=0,!0;K=null,J=null}if(H.signal.aborted)return k(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,k(`[bridge:repl] Environment re-registration failed: ${O(e)}`),!1}if(I.reuseEnvironmentId=void 0,k(`[bridge:repl] Re-registered: requested=${e} got=${L}`),H.signal.aborted)return k(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(U!==null)return k(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Q=0,!0;if(await me(e,z))return P(`tengu_bridge_repl_reconnected_in_place`,{}),Q=0,!0;if(L!==e&&P(`tengu_bridge_repl_env_expired_fresh_session`,{}),await f(z),H.signal.aborted)return k(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=p(),r=await d({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?H.signal.aborted?(k(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await f(r),!1):(z=r,m(be(r)).catch(()=>{}),G=0,_e.clear(),Z=!oe,k(`[bridge:repl] Re-created session: ${z}`),await M(n,{sessionId:z,environmentId:L,source:`repl`}),S?.clear(),Q=0,!0):(k(`[bridge:repl] Session creation failed during reconnection`),!1)}function Ee(){return u()}function De(){let e=X.end();if(e.length===0)return;if(!U){k(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)V.add(t.uuid);let t=h(e).map(e=>({...e,session_id:z}));k(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),U.writeBatch(t)}let Oe=null;function je(){Oe?.()}function Fe(e){if(ye(`handleTransportPermanentClose: code=${e} transport=${U?`exists`:`null`} pollAborted=${H.signal.aborted}`),k(`[bridge:repl] Transport permanently closed: code=${e}`),P(`tengu_bridge_repl_ws_closed`,{code:e}),U){let e=U.getLastSequenceNum();e>G&&(G=e),U=null}Y();let t=X.drop();if(t>0&&k(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){A?.(`failed`,`session ended`),H.abort(),je();return}A?.(`reconnecting`,`Remote Control connection lost (code ${e})`),k(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),we().then(t=>{t||H.signal.aborted||(k(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),P(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),A?.(`failed`,`reconnection failed`),je())})}let Le;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Le=()=>{k(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),we()},process.on(`SIGUSR2`,Le));let Re=null;process.env.USER_TYPE===`ant`&&E({fireClose:e=>{if(!Re){k(`[bridge:debug] fireClose: no transport wired yet`);return}k(`[bridge:debug] fireClose(${e}) — injecting`),Re(e)},forceReconnect:()=>{k(`[bridge:debug] forceReconnect — injecting`),we()},injectFault:b,wakePollLoop:Y,describe:()=>`env=${L} session=${z} transport=${U?.getStateLabel()??`null`} workId=${K??`null`}`}),dt({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:H.signal,getPollIntervalConfig:v,onStateChange:A,getWsState:()=>U?.getStateLabel()??`null`,isAtCapacity:()=>U!==null,capacitySignal:Ce,onFatalError:je,getHeartbeatInfo:()=>!K||!J?null:{environmentId:L,workId:K,sessionToken:J},onHeartbeatFatal:e=>{if(k(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),U){let e=U.getLastSequenceNum();e>G&&(G=e),U.close(),U=null}X.drop(),K&&F.stopWork(L,K,!1).catch(e=>{k(`[bridge:repl] stopWork after heartbeat fatal: ${O(e)}`)}),K=null,J=null,Y(),A?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await we()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(e,r,i,a)=>{if(U?.isConnectedStatus()&&k(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),k(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${z} match=${Ne(e,z)}`),M(n,{sessionId:z,environmentId:L,source:`repl`}),!Ne(e,z)){k(`[bridge:repl] Rejecting foreign session: expected=${z} got=${e}`);return}K=i,J=r;let o=a||t(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=Ee(),!s){k(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ve(s)}if(P(`tengu_bridge_repl_work_received`,{}),U){let e=U;U=null;let t=e.getLastSequenceNum();t>G&&(G=t),e.close()}X.deactivate();let ee=e=>Ye(e,{transport:U,sessionId:z,onInterrupt:ne,onSetModel:D,onSetMaxThinkingTokens:re,onSetPermissionMode:ie}),u=!1,d=e=>{U=e,e.setOnConnect(()=>{if(U===e){if(k(`[bridge:repl] Ingress transport connected`),P(`tengu_bridge_repl_ws_connected`,{}),!o){let e=Ee();e&&ve(e)}if(He=!1,!u&&x&&x.length>0){u=!0;let t=y,n=x.filter(e=>Je(e)&&!S?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(k(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),P(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=h(r);if(i.length>0){k(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:z})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){k(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(S)for(let e of i)e.uuid&&S.add(e.uuid)}).catch(e=>k(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{U===e&&(De(),A?.(`connected`))})}else De(),A?.(`connected`)}else X.active||A?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);ye(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{ye(`ingress (non-JSON): ${String(e).slice(0,200)}`)}Qe(e,V,_e,C,w,ee)}),Re=Fe,e.setOnClose(t=>{U===e&&(ye(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Fe(t))}),!u&&x&&x.length>0&&X.start(),e.connect()};if(W++,o){let t=Ie(c,e),n=W;k(`[bridge:repl] CCR v2: sessionUrl=${t} session=${e} gen=${n}`),nt({sessionUrl:t,ingressToken:r,sessionId:e,initialSequenceNum:G}).then(e=>{if(H.signal.aborted){e.close();return}if(n!==W){k(`[bridge:repl] CCR v2: discarding stale handshake gen=${n} current=${W}`),e.close();return}d(e)},e=>{k(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${O(e)}`,{level:`error`}),P(`tengu_bridge_repl_ccr_v2_init_failed`,{}),n===W&&(K&&(F.stopWork(L,K,!1).catch(e=>{k(`[bridge:repl] stopWork after v2 init failure: ${O(e)}`)}),K=null,J=null),Y())})}else{let t=Pe(l,e);k(`[bridge:repl] Ingress URL: ${t}`),k(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;d(tt(new et(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${Ee()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{A?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),Y()}})))}}});let ze=se?setInterval(()=>{$||M(n,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;ze?.unref?.();let Be=v().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{U&&(k(`[bridge:repl] keep_alive sent`),U.write({type:`keep_alive`}).catch(e=>{k(`[bridge:repl] keep_alive write failed: ${O(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;Oe=async()=>{if(He){k(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}He=!0;let e=Date.now();if(k(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${K??`none`} transportState=${U?.getStateLabel()??`null`}`),ze!==null&&clearInterval(ze),Ve!==null&&clearInterval(Ve),Le&&process.off(`SIGUSR2`,Le),process.env.USER_TYPE===`ant`&&(T(),Re=null),H.abort(),k(`[bridge:repl] Teardown: poll loop aborted`),U){let e=U.getLastSequenceNum();e>G&&(G=e)}if(se){U=null,X.drop(),await M(n,{sessionId:z,environmentId:L,source:`repl`}),k(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=U;if(U=null,X.drop(),t){let e={...Ze(z),session_id:z};t.write(e)}let r=K?F.stopWork(L,K,!0).then(()=>{k(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{k(`[bridge:repl] Teardown stopWork failed: ${O(e)}`)}):Promise.resolve();await Promise.all([r,f(z)]),t?.close(),k(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{k(`[bridge:repl] Teardown deregister failed: ${O(e)}`)}),await ue(n),k(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Ue=ae(()=>Oe?.());return k(`[bridge:repl] Ready: env=${L} session=${z}`),A?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=U?.getLastSequenceNum()??0;return Math.max(G,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Je(e)&&!B.has(e.uuid)&&!V.has(e.uuid));if(t.length===0)return;if(!Z)for(let e of t){let t=Xe(e);if(t!==void 0&&oe?.(t,z)){Z=!0;break}}if(X.enqueue(...t)){k(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!U){let e=t.map(e=>e.type).join(`,`);k(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)V.add(e.uuid);k(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:z}));U.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!V.has(e.uuid));if(t.length===0)return;if(!U){k(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&V.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));U.writeBatch(n)},sendControlRequest(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!U){k(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};U.write(t),k(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!U){k(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}U.reportState(`idle`);let e={...Ze(z),session_id:z};U.write(e),k(`[bridge:repl] Sent result for session=${z}`)},async teardown(){Ue(),await Oe?.(),k(`[bridge:repl] Torn down`),P(`tengu_bridge_repl_teardown`,{})}}}async function dt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:c,capacitySignal:u,onFatalError:d,getPollIntervalConfig:f=()=>Ae,getHeartbeatInfo:p,onHeartbeatFatal:m}){k(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let g=0,_=null,v=null,y=0,b=!1;for(;!n.aborted;){let{environmentId:x,environmentSecret:S}=t(),C=f();try{let t=await e.pollForWork(x,S,n,C.reclaim_older_than_ms);if(y=0,g>0&&(k(`[bridge:repl] Poll recovered after ${g} consecutive error(s)`),g=0,_=null,v=null,r?.(`ready`)),!t){let t=b;if(b=!1,c?.()&&u&&!t){let t=C.poll_interval_ms_at_capacity;if(C.non_exclusive_heartbeat_interval_ms>0&&p){P(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:C.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&c()&&(r===null||Date.now()<r);){let t=f();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=p();if(!n)break;let r=u();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(k(`[bridge:repl:heartbeat] Failed: ${O(e)}`),e instanceof s){r.cleanup(),P(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),m?(m(e),k(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await B(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:c()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(P(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&k(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:C.non_exclusive_heartbeat_interval_ms;if(r>0){let e=u(),t=Date.now();await B(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(k(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),P(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),b=!0)}}else await B(C.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Fe(t.secret)}catch(n){k(`[bridge:repl] Failed to decode work secret: ${O(n)}`),P(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(x,t.id,!1).catch(()=>{});continue}k(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(x,t.id,a.session_ingress_token)}catch(e){k(`[bridge:repl] Acknowledge failed workId=${t.id}: ${O(e)}`)}if(t.data.type===`healthcheck`){k(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{h(e,`session_id`)}catch{k(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),k(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof s&&i.status===404&&a){let e=t().environmentId;if(x!==e){k(`[bridge:repl] Stale poll error for old env=${x}, current env=${e} — skipping onEnvironmentLost`),g=0,_=null;continue}if(y++,k(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${y}/3)`),P(`tengu_bridge_repl_env_lost`,{attempt:y}),y>3){k(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),d?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){g=0,_=null,r?.(`ready`),k(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),d?.();break}if(i instanceof s){let e=ee(i.errorType),t=l(i);k(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),P(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),j(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),d?.();break}let c=Date.now();v!==null&&c-v>6e4*2&&(k(`[bridge:repl] Detected system sleep (${Math.round((c-v)/1e3)}s gap), resetting poll error budget`),j(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:c-v}),g=0,_=null),v=c,g++,_===null&&(_=c);let u=c-_,m=U(i),h=K(i),b=o?.()??`unknown`;if(k(`[bridge:repl] Poll error (attempt ${g}, elapsed ${Math.round(u/1e3)}s, ws=${b}): ${h}`),P(`tengu_bridge_repl_poll_error`,{status:m,consecutiveErrors:g,elapsedMs:u}),g===1&&r?.(`reconnecting`,h),u>=9e5){k(`[bridge:repl] Poll failures exceeded ${ct/1e3}s (${g} errors), giving up`),j(`info`,`bridge_repl_poll_give_up`),P(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:g,elapsedMs:u,lastStatus:m}),r?.(`failed`,`connection to server lost`);break}let S=Math.min(ot*2**(g-1),st);if(f().non_exclusive_heartbeat_interval_ms>0){let t=p?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await B(S,n)}}k(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}re(),A(),G(),W();async function ft(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:ee,onStateChange:p,initialMessages:m,getMessages:h,previouslyFlushedUUIDs:g,initialName:_,perpetual:v,outboundOnly:b,tags:x}=t??{};if(J($),!await Q())return q(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!Z())return q(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),p?.(`failed`,`authentication required`),null;if(await u(),!d(`allow_remote_control`))return q(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),p?.(`failed`,`disabled by your organization's policy`),null;if(!Y()){let e=se();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&R()?.expiresAt===e.bridgeOauthDeadExpiresAt)return k(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await z();let t=R();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){q(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),p?.(`failed`,`authentication required`);let e=t.expiresAt;return oe(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let S=Ce(),w=`remote-control-${y()}`,T=!1,te=!1;if(_)w=_,T=!0,te=!0;else{let e=a(),t=e?C(e):void 0;if(t)w=t,T=!0,te=!0;else if(m&&m.length>0)for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||f(t))continue;let n=ne(t.message.content);if(!n)continue;let r=mt(n);if(r){w=r,T=!0;break}}}let E=0,D,re=0,ie=(e,t,n)=>{T=!0,w=e,k(`[bridge:repl] derived title from message ${n}: ${e}`),Le(t,e,{baseUrl:S,getAccessToken:Z}).catch(()=>{})},ae=(e,t)=>{let n=++re,r=E;Ge(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===re&&D===t&&!C(a())&&ie(e,t,r)})},A=(e,t)=>{if(te||C(a()))return!0;if(D!==void 0&&D!==t&&(E=0),D=t,E++,E===1&&!T){let n=mt(e);n&&ie(n,t,E),ae(e,t)}else if(E===3){let n=h?.(),r=n?qe(c(n)):e;ae(r,t)}return E>=3},ce=X()?`self-hosted`:await L();if(!ce)return q(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),p?.(`failed`,`/login`),null;if(Te()&&!v){let e=await He();if(e)return q(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),p?.(`failed`,"run `claude update` to upgrade"),null;k(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-Bk3UdSLJ.js`);return t({baseUrl:S,orgUUID:ce,title:w,getAccessToken:Z,onAuth401:I,toSDKMessages:We,initialHistoryCap:200,initialMessages:m,onInboundMessage:n,onUserMessage:A,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:ee,onStateChange:p,outboundOnly:b,tags:x})}let j=Ee();if(j)return q(`version_too_old`,`[bridge:repl] Skipping: ${j}`),p?.(`failed`,"run `claude update` to upgrade"),null;let le=await M(),ue=await de(),fe=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||S,N=`claude_code`;{let{isAssistantMode:t}=(De(),e(Oe));t()&&(N=`claude_code_assistant`)}return ut({dir:o(),machineName:it(),branch:le,gitRepoUrl:ue,title:w,baseUrl:S,sessionIngressUrl:fe,workerType:N,getAccessToken:Z,createSession:e=>ze({...e,events:[],baseUrl:S,getAccessToken:Z}),archiveSession:e=>Be(e,{baseUrl:S,getAccessToken:Z,timeoutMs:1500}).catch(e=>{k(`[bridge:repl] archiveBridgeSession threw: ${O(e)}`,{level:`error`})}),getCurrentTitle:()=>C(a())??w,onUserMessage:A,toSDKMessages:We,onAuth401:I,getPollIntervalConfig:je,initialHistoryCap:200,initialMessages:m,previouslyFlushedUUIDs:g,onInboundMessage:n,onPermissionResponse:r,onInterrupt:i,onSetModel:s,onSetMaxThinkingTokens:l,onSetPermissionMode:ee,onStateChange:p,perpetual:v})}var pt=50;function mt(e){let t=fe(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>pt?n.slice(0,pt-1)+`…`:n}export{ft as initReplBridge};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AS as t,DS as n,OS as r,SS as i,TS as a,bS as o,kS as s,xS as c}from"./loadAgentsDir-x3rlgED4.js";import{I as l,S as u,w as d,z as f}from"./debug-BrXObCdR.js";import{r as p,t as m}from"./promptEditor-CyTzyjwG.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(a.map(e=>r(e.key)));return e.map(e=>{let n={};for(let[i,a]of Object.entries(e.bindings))t.has(r(i))||(n[i]=a);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return d({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(s)},null,2)+`
|
|
2
|
-
`}var b=e((()=>{u(),t(),n()}));async function x(){if(!i())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=o(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(l(e)===`EEXIST`)t=!0;else throw e}let n=await m(e);return n.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${n.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{c(),b(),f(),p()}))();export{x as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./language-Ca4B018X.js";e();export{t as getResolvedLanguage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{I as a,P as o,fi as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{o as m,u as h}from"./api-2cdIPaeq.js";import{n as g,r as _,t as v}from"./cron-3LntnnhJ.js";import{n as y,r as b}from"./hostGuard-BHI6Q8Mt.js";import{n as x,t as S}from"./launchCommand-1qkTCKpf.js";function C(e){return new Promise(t=>setTimeout(t,e))}async function w(){let e;try{e=(await h()).apiKey}catch(e){let t=e instanceof Error?e.message:String(e);throw new F(t,501)}return y(T()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":N,"content-type":`application/json`}}function T(){return`${f().BASE_API_URL}/v1/agents`}function E(e){if(r.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new F(`Authentication failed.`,401);if(t===403)return new F(`Subscription required. Scheduled agents require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new F(`Agent not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``,n=t?` Retry after ${t}s.`:``;return new F(`Rate limit exceeded.${n}`,429)}let n=(e.response?.data)?.error?.message??e.message;return new F(n,t)}return e instanceof F?e:new F(e instanceof Error?e.message:String(e),0)}function D(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function O(e){let t;for(let n=0;n<P;n++)try{return await e()}catch(e){let i=E(e);if(i.statusCode>=500){t=i,n<P-1&&await C(D(r.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**n);continue}throw i}throw t??new F(`Request failed after retries`,0)}async function k(){return O(async()=>{let e=await w();return(await r.get(T(),{headers:e})).data.data??[]})}async function A(e,t){return O(async()=>{let n=await w();return(await r.post(T(),{cron_expr:e,prompt:t,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`},{headers:n})).data})}async function j(e){return O(async()=>{let t=await w();await r.delete(`${T()}/${e}`,{headers:t})})}async function M(e){return O(async()=>{let t=await w();return(await r.post(`${T()}/${e}/run`,{},{headers:t})).data})}var N,P,F,I=e((()=>{i(),p(),b(),m(),t(),N=`managed-agents-2026-04-01`,P=3,F=class extends Error{constructor(e,t){super(e),n(this,`statusCode`,void 0),this.statusCode=t,this.name=`AgentsApiError`}}}));function L({agent:e}){let t=v(e.cron_expr,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`;return(0,z.jsxs)(a,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsxs)(a,{children:[(0,z.jsx)(o,{bold:!0,children:e.id}),(0,z.jsx)(o,{dimColor:!0,children:` · `}),(0,z.jsx)(o,{color:`suggestion`,children:e.status})]}),(0,z.jsxs)(o,{children:[`Schedule: `,t]}),(0,z.jsxs)(o,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,z.jsxs)(o,{dimColor:!0,children:[`Next run: `,n]})]})}function R(e){if(e.mode===`list`)return e.agents.length===0?(0,z.jsx)(a,{children:(0,z.jsx)(o,{dimColor:!0,children:`No scheduled agents. Use /agents-platform create <cron> <prompt> to create one.`})}):(0,z.jsxs)(a,{flexDirection:`column`,children:[(0,z.jsx)(a,{marginBottom:1,children:(0,z.jsxs)(o,{bold:!0,children:[`Scheduled Agents (`,e.agents.length,`)`]})}),e.agents.map(e=>(0,z.jsx)(L,{agent:e},e.id))]});if(e.mode===`created`){let t=v(e.agent.cron_expr,{utc:!0});return(0,z.jsxs)(a,{flexDirection:`column`,children:[(0,z.jsx)(a,{children:(0,z.jsx)(o,{bold:!0,color:`success`,children:`Agent created`})}),(0,z.jsxs)(o,{children:[`ID: `,e.agent.id]}),(0,z.jsxs)(o,{children:[`Schedule: `,t]}),(0,z.jsxs)(o,{children:[`Prompt: `,e.agent.prompt]}),(0,z.jsxs)(o,{dimColor:!0,children:[`Status: `,e.agent.status]})]})}return e.mode===`deleted`?(0,z.jsx)(a,{children:(0,z.jsxs)(o,{color:`success`,children:[`Agent `,e.id,` deleted.`]})}):e.mode===`ran`?(0,z.jsxs)(a,{flexDirection:`column`,children:[(0,z.jsx)(a,{children:(0,z.jsxs)(o,{color:`success`,children:[`Agent `,e.id,` triggered.`]})}),(0,z.jsxs)(o,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):(0,z.jsx)(a,{children:(0,z.jsx)(o,{color:`error`,children:e.message})})}var z,B=e((()=>{s(),c(),g(),z=l()}));function V(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function H(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run daily standup`};let e=V(i);if(!e)return{action:`invalid`,reason:`create requires at least 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run daily standup`};let{cron:t,prompt:n}=e;return n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires an agent id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires an agent id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". Use: list | create CRON PROMPT | delete ID | run ID`}}var U=e((()=>{}));async function W(e,t){if(e.action===`list`){d(`tengu_agents_platform_list`,{});try{let e=await k();return t(e.length===0?`No scheduled agents found.`:`${e.length} scheduled agent(s).`,{display:`system`}),{mode:`list`,agents:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to list agents: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`create`){let{cron:n,prompt:r}=e;if(!_(n)){let e=`Invalid cron expression: "${n}". Expected 5 fields (minute hour day month weekday).`;return d(`tengu_agents_platform_failed`,{reason:e}),t(e,{display:`system`}),null}d(`tengu_agents_platform_create`,{cron:n});try{let e=await A(n,r);return t(`Agent created: ${e.id}`,{display:`system`}),{mode:`created`,agent:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to create agent: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete`){let{id:n}=e;d(`tengu_agents_platform_delete`,{id:n});try{return await j(n),t(`Agent ${n} deleted.`,{display:`system`}),{mode:`deleted`,id:n}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to delete agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{id:n}=e;d(`tengu_agents_platform_run`,{id:n});try{let e=await M(n);return t(`Agent ${n} triggered. Run ID: ${e.run_id}`,{display:`system`}),{mode:`ran`,id:n,runId:e.run_id}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to run agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}var G;e((()=>{u(),g(),I(),B(),U(),S(),G=x({commandName:`agents-platform`,parseArgs:e=>{d(`tengu_agents_platform_started`,{args:e});let t=H(e);return t.action===`invalid`?(d(`tengu_agents_platform_failed`,{reason:t.reason}),{action:`invalid`,reason:`Usage: /agents-platform list | create CRON PROMPT | delete ID | run ID\n${t.reason}`}):t},dispatch:W,View:R,errorView:e=>null})}))();export{G as callAgentsPlatform};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as n}from"./src-CDCSSo0U2.js";function r(e){return async(t,n,r)=>{let o=e.parseArgs(r??``);if(i(o))return t(`Invalid args: ${o.reason}`,{display:`system`}),e.errorView(o.reason);try{let r=await e.dispatch(o,t,n);return r===null?null:a.createElement(e.View,r)}catch(n){let r=n instanceof Error?n.message:String(n);return e.onDispatchError?.(n),t(`${e.commandName} failed: ${r}`,{display:`system`}),e.errorView(r)}}}function i(e){return typeof e==`object`&&!!e&&`action`in e&&e.action===`invalid`}var a,o=e((()=>{a=t(n(),1)}));export{r as n,o as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ex as l,Tx as u,_d as d,bd as f,fd as p,gd as m,hd as h,md as g,pd as _,vd as v,xd as y,yd as b}from"./loadAgentsDir-x3rlgED4.js";import{n as x,t as S}from"./launchCommand-1qkTCKpf.js";function C(e){return e.mode===`list`?e.stores.length===0?(0,w.jsx)(n,{children:(0,w.jsx)(r,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,w.jsxs)(n,{flexDirection:`column`,children:[(0,w.jsx)(n,{marginBottom:1,children:(0,w.jsxs)(r,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`◆`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Store created: `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Stored entry `}),(0,w.jsx)(r,{bold:!0,children:e.key}),(0,w.jsx)(r,{children:` in `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,w.jsxs)(n,{flexDirection:`column`,children:[(0,w.jsxs)(n,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}),(0,w.jsx)(n,{children:(0,w.jsx)(r,{children:e.value})})]}):e.mode===`not-found`?(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{color:`error`,children:`Not found: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),e.key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{dimColor:!0,children:`No entries in `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,w.jsxs)(n,{flexDirection:`column`,children:[(0,w.jsxs)(n,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`·`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,w.jsxs)(n,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Archived store: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,w.jsx)(n,{children:(0,w.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var w,T=e((()=>{i(),o(),w=c()}));function E(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${D}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${D}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${D}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${D}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${D}`}:{action:`invalid`,reason:`fetch requires a store name. ${D}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${D}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${D}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${D}`}}var D,O=e((()=>{D=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function k(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
|
|
2
|
-
`)}function A(e,t){return t.length===0?`No entries in "${e}".`:[`Entries in "${e}"`,...t.map(e=>`- ${e}`)].join(`
|
|
3
|
-
`)}function j({onDone:e}){let[t,i]=N.useState({kind:`menu`}),[o,c]=N.useState(0),[l,f]=N.useState(``),[h,x]=N.useState(0),[S,C]=N.useState(null),w=N.useCallback(e=>{i(e),f(``),x(0),C(null)},[]),T=N.useCallback(t=>e(t,{display:`system`}),[e]),E=N.useCallback((e,t,n,r,i={})=>{try{if(e===`list`){T(k(v()));return}if(e===`about`){T(F);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){_(t),T(`Store created: ${t}`);return}if(e===`entries`){let e=d(t);T(A(t,e));return}if(e===`archive`){p(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=g(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||r===void 0){C(`Internal: missing key or value`);return}if(!i.confirmedOverwrite&&g(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:r});return}b(t,n,r),T(`Stored ${t}/${n} (${r.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(a((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(L.length-1,e+1));return}if(n.return){let e=L[o];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=L.length&&c(r-1)},{isActive:t.kind===`menu`}),a((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),a((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,P.jsx)(s,{title:`Local Memory`,subtitle:`${L.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(n,{flexDirection:`column`,children:[L.map((e,t)=>(0,P.jsxs)(n,{flexDirection:`row`,children:[(0,P.jsx)(r,{children:`${t===o?`›`:` `} ${e.label}`.padEnd(I)}),(0,P.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,P.jsx)(s,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(n,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,P.jsx)(s,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(n,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,P.jsx)(s,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(n,{flexDirection:`column`,children:[(0,P.jsx)(n,{children:(0,P.jsx)(r,{dimColor:!0,children:D})}),(0,P.jsxs)(n,{children:[(0,P.jsx)(r,{children:`> `}),(0,P.jsx)(u,{value:l,onChange:e=>{f(e),C(null)},cursorOffset:h,onChangeCursorOffset:x,onSubmit:e=>{let n=e.trim();if(t.kind===`collect-store`){if(!n){C(`Store name required`);return}if(!m(n)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:n}):E(t.action,n,void 0,void 0):w({kind:`collect-key`,action:t.action,store:n});return}if(t.kind===`collect-key`){if(!n){C(`Key required`);return}if(!y(n)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,n,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:n});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,P.jsx)(n,{marginTop:0,children:(0,P.jsxs)(r,{color:`warning`,children:[`✗ `,S]})}),(0,P.jsx)(n,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function M(e,t){if(e.action===`list`)return t(k(v()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return _(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:i}=e;return b(n,r,i),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=g(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(A(n,d(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return p(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(F,{display:`system`}),null}var N,P,F,I,L,R,z;e((()=>{N=t(i(),1),o(),h(),f(),l(),T(),O(),S(),P=c(),F=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,I=26,L=[{kind:`list`,label:`List`,description:`Show all stores`},{kind:`create`,label:`Create`,description:`Create a new memory store`},{kind:`store`,label:`Store`,description:`Write an entry: store name + key + value`},{kind:`fetch`,label:`Fetch`,description:`Read an entry by store name + key`},{kind:`entries`,label:`Entries`,description:`List entry keys in a store`},{kind:`archive`,label:`Archive`,description:`Archive a store (rename to *.archived)`},{kind:`about`,label:`About`,description:`Show command syntax`}],R=x({commandName:`local-memory`,parseArgs:e=>{let t=E(e);return t.action===`invalid`?{action:`invalid`,reason:`${F}\n${t.reason}`}:t},dispatch:M,View:C,errorView:e=>N.createElement(C,{mode:`error`,message:e})}),z=async(e,t,n)=>(n??``).trim()===``?(0,P.jsx)(j,{onDone:e}):R(e,t,n)}))();export{z as callLocalMemory};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,hn as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ex as l,Tx as u,bd as d,cd as f,dd as p,ld as m,od as h,sd as g,ud as _,xd as v}from"./loadAgentsDir-x3rlgED4.js";import{n as y,t as b}from"./launchCommand-1qkTCKpf.js";function x(e){return e.mode===`list`?e.keys.length===0?(0,S.jsx)(n,{children:(0,S.jsx)(r,{dimColor:!0,children:`No secrets stored. Use /local-vault set <key> <value> to add one.`})}):(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsx)(n,{marginBottom:1,children:(0,S.jsxs)(r,{bold:!0,children:[`Local Vault Keys (`,e.keys.length,`)`]})}),e.keys.map(e=>(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`●`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`set-ok`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Secret stored: `}),(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:` = [REDACTED]`})]}):e.mode===`get-masked`?(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{children:e.masked})]}),(0,S.jsx)(n,{marginTop:1,children:(0,S.jsxs)(r,{dimColor:!0,children:[`Use /local-vault get `,e.key,` --reveal to see the full value.`]})})]}):e.mode===`get-revealed`?(0,S.jsxs)(n,{flexDirection:`column`,children:[(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{color:`warning`,children:e.value})]}),(0,S.jsx)(n,{marginTop:1,children:(0,S.jsx)(r,{dimColor:!0,color:`warning`,children:`⚠ Secret revealed in terminal — clear scrollback if this session is shared.`})})]}):e.mode===`not-found`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`error`,children:`Key not found: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):e.mode===`deleted`?(0,S.jsxs)(n,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Deleted: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):(0,S.jsx)(n,{children:(0,S.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{i(),o(),S=c()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`set`){let e=n[1];if(!e)return{action:`invalid`,reason:`set requires a key name. ${T}`};if(E.test(e))return{action:`invalid`,reason:`Key name must not start with "-" or a hyphen-like character (reserved for flags). ${T}`};let t=n.slice(2).join(` `);return t?{action:`set`,key:e,value:t}:{action:`invalid`,reason:`set requires a value. ${T}`}}if(r===`get`){let e=[`--reveal`],t=n.filter(t=>!e.includes(t))[1];return t?{action:`get`,key:t,reveal:n.includes(`--reveal`)}:{action:`invalid`,reason:`get requires a key name. ${T}`}}if(r===`delete`){let e=n[1];return e?{action:`delete`,key:e}:{action:`invalid`,reason:`delete requires a key name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E,D=e((()=>{T=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,E=/^[-‐-―−﹘﹣-]/}));function O(e){return e.length===0?`No secrets stored.`:[`Local Vault Keys`,...e.map(e=>`- ${e}`)].join(`
|
|
2
|
-
`)}function k({onDone:e}){let[t,i]=j.useState({kind:`menu`}),[o,c]=j.useState(0),[l,d]=j.useState(``),[f,y]=j.useState(0),[b,x]=j.useState(null),[S,C]=j.useState(!1),w=j.useCallback(e=>{i(e),d(``),y(0),x(null)},[]),T=j.useCallback(t=>e(t,{display:`system`}),[e]);a((e,n)=>{if(t.kind!==`menu`||S)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(F.length-1,e+1));return}if(n.return){let e=F[o];if(!e)return;if(e.kind===`about`){T(N);return}if(e.kind===`list`){C(!0),m().then(e=>{T(O(e))});return}w({kind:`collect-key`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=F.length&&c(r-1)},{isActive:t.kind===`menu`&&!S}),a((e,n)=>{if(t.kind!==`confirm-overwrite`&&t.kind!==`confirm-delete`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();if(r===`y`||n.return)if(t.kind===`confirm-delete`){C(!0);let e=t.key;h(e).then(t=>{T(t?`Deleted: ${e}`:`Key not found: ${e}`)})}else{C(!0);let e=t.key,n=t.value;p(e,n).then(()=>T(`Secret stored: ${e} = [REDACTED]`)).catch(t=>T(`Failed to store ${e}: ${t instanceof Error?t.message:String(t)}`))}else r===`n`&&w({kind:`menu`})},{isActive:(t.kind===`confirm-overwrite`||t.kind===`confirm-delete`)&&!S}),a((e,n)=>{if(!(t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:`set`});return}w({kind:`menu`})}},{isActive:(t.kind===`collect-key`||t.kind===`collect-value`)&&!S});let E=e=>{let n=e.trim();if(!n){x(`Key required`);return}if(!v(n)){x(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}if(t.kind===`collect-key`){if(t.action===`get`){C(!0),g(n).then(e=>{T(e===null?`Key not found: ${n}`:`Key found: ${n} = ${_(e)}`)});return}if(t.action===`delete`){w({kind:`confirm-delete`,key:n});return}if(t.action===`set`){w({kind:`collect-value`,key:n});return}}},D=e=>{if(t.kind!==`collect-value`)return;if(e.length===0){x(`Secret value cannot be empty`);return}let n=t.key;C(!0),g(n).then(t=>{if(t!==null){C(!1),w({kind:`confirm-overwrite`,key:n,value:e});return}return p(n,e).then(()=>T(`Secret stored: ${n} = [REDACTED]`))}).catch(e=>T(`Failed to store ${n}: ${e instanceof Error?e.message:String(e)}`))};if(t.kind===`menu`)return(0,M.jsx)(s,{title:`Local Vault`,subtitle:`${F.length} actions`,onCancel:()=>T(`Local vault panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(n,{flexDirection:`column`,children:[F.map((e,t)=>(0,M.jsxs)(n,{flexDirection:`row`,children:[(0,M.jsx)(r,{children:`${t===o?`›`:` `} ${e.label}`.padEnd(P)}),(0,M.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),S&&(0,M.jsx)(n,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(n,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-5 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-delete`)return(0,M.jsx)(s,{title:`Confirm Delete`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(n,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Delete secret "`,t.key,`"? This cannot be undone.`]}),(0,M.jsx)(n,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = delete · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Deleting...`})]})});if(t.kind===`confirm-overwrite`)return(0,M.jsx)(s,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(n,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Secret "`,t.key,`" already exists. Overwrite? Old value is lost.`]}),(0,M.jsx)(n,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Storing...`})]})});let k=t.kind===`collect-key`?`KEY NAME`:`SECRET VALUE`,A=t.kind===`collect-key`?`e.g. github-token`:`(masked input — value never displayed)`,I=t.kind===`collect-key`?E:D,L=t.kind===`collect-value`;return(0,M.jsx)(s,{title:`Local Vault · ${t.kind===`collect-key`?`KEY`:`VALUE`}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(n,{flexDirection:`column`,children:[(0,M.jsx)(n,{children:(0,M.jsx)(r,{dimColor:!0,children:k})}),(0,M.jsxs)(n,{children:[(0,M.jsx)(r,{children:`> `}),(0,M.jsx)(u,{value:l,onChange:e=>{d(e),x(null)},cursorOffset:f,onChangeCursorOffset:y,onSubmit:I,placeholder:A,columns:70,showCursor:!0,mask:L?`*`:void 0})]}),b!==null&&(0,M.jsx)(n,{marginTop:0,children:(0,M.jsxs)(r,{color:`warning`,children:[`✗ `,b]})}),S&&(0,M.jsx)(n,{marginTop:0,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(n,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function A(e,t){if(e.action===`list`)return t(O(await m()),{display:`system`}),null;if(e.action===`set`){let{key:n,value:r}=e;return await p(n,r),t(`Secret stored: ${n} = [REDACTED]`,{display:`system`}),null}if(e.action===`get`){let{key:n,reveal:r}=e,i=await g(n);return i===null?(t(`Key not found: ${n}`,{display:`system`}),null):r?(t([`Secret revealed for: ${n}`,`Warning: secret revealed in terminal.`,`${n} = ${i}`].join(`
|
|
3
|
-
`),{display:`system`}),null):(t(`Key found: ${n} = ${_(i)}`,{display:`system`}),null)}if(e.action===`delete`){let{key:n}=e;return await h(n)?(t(`Deleted: ${n}`,{display:`system`}),null):(t(`Key not found: ${n}`,{display:`system`}),null)}return t(N,{display:`system`}),null}var j,M,N,P,F,I,L;e((()=>{j=t(i(),1),o(),f(),d(),l(),C(),D(),b(),M=c(),N=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,P=26,F=[{kind:`list`,label:`List`,description:`Show stored secret keys`},{kind:`set`,label:`Set`,description:`Store a secret: KEY + VALUE (input is masked)`},{kind:`get`,label:`Get`,description:`Look up a secret (returns masked preview)`},{kind:`delete`,label:`Delete`,description:`Delete a stored secret by KEY`},{kind:`about`,label:`About`,description:`Show command syntax`}],I=y({commandName:`local-vault`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${N}\n${t.reason}`}:t},dispatch:A,View:x,errorView:e=>j.createElement(x,{mode:`error`,message:e})}),L=async(e,t,n)=>(n??``).trim()===``?(0,M.jsx)(k,{onDone:e}):I(e,t,n)}))();export{L as callLocalVault};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{I as a,P as o,fi as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{l as f,u as p}from"./oauth-BqJqV-2M.js";import{o as m,u as h}from"./api-2cdIPaeq.js";import{n as g,r as _}from"./hostGuard-BHI6Q8Mt.js";import{n as v,t as y}from"./launchCommand-1qkTCKpf.js";function b(e){return new Promise(t=>setTimeout(t,e))}async function x(){let e;try{e=(await h()).apiKey}catch(e){let t=e instanceof Error?e.message:String(e);throw new z(t,501)}return g(S()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":L,"content-type":`application/json`}}function S(){return`${f().BASE_API_URL}/v1/memory_stores`}function C(e){if(r.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new z(`Authentication failed.`,401);if(t===403)return new z(`Subscription required. Memory stores require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new z(`Memory store or memory not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``,n=t?` Retry after ${t}s.`:``;return new z(`Rate limit exceeded.${n}`,429)}let n=(e.response?.data)?.error?.message??e.message;return new z(n,t)}return e instanceof z?e:new z(e instanceof Error?e.message:String(e),0)}function w(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function T(e){let t;for(let n=0;n<R;n++)try{return await e()}catch(e){let i=C(e);if(i.statusCode>=500){t=i,n<R-1&&await b(w(r.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**n);continue}throw i}throw t??new z(`Request failed after retries`,0)}async function E(){return T(async()=>{let e=await x();return(await r.get(S(),{headers:e})).data.data??[]})}async function D(e,t){return T(async()=>{let n=await x(),i={name:e};return t&&(i.namespace=t),(await r.post(S(),i,{headers:n})).data})}async function O(e){return T(async()=>{let t=await x();return(await r.get(`${S()}/${e}`,{headers:t})).data})}async function k(e){return T(async()=>{let t=await x();return(await r.post(`${S()}/${e}/archive`,{},{headers:t})).data})}async function A(e){return T(async()=>{let t=await x();return(await r.get(`${S()}/${e}/memories`,{headers:t})).data.data??[]})}async function j(e,t){return T(async()=>{let n=await x(),i={content:t};return(await r.post(`${S()}/${e}/memories`,i,{headers:n})).data})}async function M(e,t){return T(async()=>{let n=await x();return(await r.get(`${S()}/${e}/memories/${t}`,{headers:n})).data})}async function N(e,t,n){return T(async()=>{let i=await x(),a={content:n};return(await r.patch(`${S()}/${e}/memories/${t}`,a,{headers:i})).data})}async function P(e,t){return T(async()=>{let n=await x();await r.delete(`${S()}/${e}/memories/${t}`,{headers:n})})}async function F(e){return T(async()=>{let t=await x();return(await r.get(`${S()}/${e}/memory_versions`,{headers:t})).data.data??[]})}async function I(e,t){return T(async()=>{let n=await x();return(await r.post(`${S()}/${e}/memory_versions/${t}/redact`,{},{headers:n})).data})}var L,R,z,B=e((()=>{i(),p(),_(),m(),t(),L=`managed-agents-2026-04-01`,R=3,z=class extends Error{constructor(e,t){super(e),n(this,`statusCode`,void 0),this.statusCode=t,this.name=`MemoryStoresApiError`}}}));function V({store:e}){let t=!!e.archived_at,n=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,U.jsxs)(a,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(a,{children:[(0,U.jsx)(o,{bold:!0,children:e.memory_store_id}),(0,U.jsx)(o,{dimColor:!0,children:` · `}),(0,U.jsx)(o,{color:t?`warning`:`success`,children:t?`archived`:`active`}),e.namespace?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(o,{dimColor:!0,children:` · ns: `}),(0,U.jsx)(o,{children:e.namespace})]}):null]}),(0,U.jsxs)(o,{children:[`Name: `,e.name]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Created: `,n]})]})}function H(e){if(e.mode===`list`)return e.stores.length===0?(0,U.jsx)(a,{children:(0,U.jsx)(o,{dimColor:!0,children:`No memory stores found. Use /memory-stores create <name> to create one.`})}):(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{marginBottom:1,children:(0,U.jsxs)(o,{bold:!0,children:[`Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,U.jsx)(V,{store:e},e.memory_store_id))]});if(e.mode===`detail`){let{store:t}=e,n=!!t.archived_at,r=t.created_at?new Date(t.created_at).toLocaleString():`—`,i=t.archived_at?new Date(t.archived_at).toLocaleString():null;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{marginBottom:1,children:(0,U.jsxs)(o,{bold:!0,children:[`Memory Store: `,t.memory_store_id]})}),(0,U.jsxs)(o,{children:[`Name: `,t.name]}),t.namespace?(0,U.jsxs)(o,{children:[`Namespace: `,t.namespace]}):null,(0,U.jsxs)(o,{children:[`Status:`,` `,(0,U.jsx)(o,{color:n?`warning`:`success`,children:n?`archived`:`active`})]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Created: `,r]}),i?(0,U.jsxs)(o,{dimColor:!0,children:[`Archived: `,i]}):null]})}if(e.mode===`created`){let{store:t}=e;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{children:(0,U.jsx)(o,{bold:!0,color:`success`,children:`Memory store created`})}),(0,U.jsxs)(o,{children:[`ID: `,t.memory_store_id]}),(0,U.jsxs)(o,{children:[`Name: `,t.name]}),t.namespace?(0,U.jsxs)(o,{children:[`Namespace: `,t.namespace]}):null]})}if(e.mode===`archived`){let{store:t}=e,n=t.archived_at?new Date(t.archived_at).toLocaleString():`—`;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{children:(0,U.jsx)(o,{bold:!0,color:`warning`,children:`Memory store archived`})}),(0,U.jsxs)(o,{children:[`ID: `,t.memory_store_id]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Archived at: `,n]})]})}if(e.mode===`memory-list`){let{storeId:t,memories:n}=e;return n.length===0?(0,U.jsx)(a,{children:(0,U.jsxs)(o,{dimColor:!0,children:[`No memories in store `,t,`. Use /memory-stores create-memory `,t,` <content> to add one.`]})}):(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{marginBottom:1,children:(0,U.jsxs)(o,{bold:!0,children:[`Memories in `,t,` (`,n.length,`)`]})}),n.map(e=>(0,U.jsxs)(a,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(o,{bold:!0,children:e.memory_id}),(0,U.jsx)(o,{dimColor:!0,children:e.content.length>80?`${e.content.slice(0,80)}…`:e.content})]},e.memory_id))]})}if(e.mode===`memory-detail`){let{memory:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`,r=t.updated_at?new Date(t.updated_at).toLocaleString():`—`;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{marginBottom:1,children:(0,U.jsxs)(o,{bold:!0,children:[`Memory: `,t.memory_id]})}),(0,U.jsxs)(o,{children:[`Store: `,t.memory_store_id]}),(0,U.jsxs)(o,{children:[`Content: `,t.content]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Created: `,n]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Updated: `,r]})]})}if(e.mode===`memory-created`){let{memory:t}=e;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{children:(0,U.jsx)(o,{bold:!0,color:`success`,children:`Memory created`})}),(0,U.jsxs)(o,{children:[`ID: `,t.memory_id]}),(0,U.jsxs)(o,{children:[`Store: `,t.memory_store_id]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-updated`){let{memory:t}=e;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{children:(0,U.jsx)(o,{bold:!0,color:`success`,children:`Memory updated`})}),(0,U.jsxs)(o,{children:[`ID: `,t.memory_id]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-deleted`)return(0,U.jsx)(a,{children:(0,U.jsxs)(o,{color:`success`,children:[`Memory `,e.memoryId,` deleted from store `,e.storeId,`.`]})});if(e.mode===`versions`){let{storeId:t,versions:n}=e;return n.length===0?(0,U.jsx)(a,{children:(0,U.jsxs)(o,{dimColor:!0,children:[`No memory versions found for store `,t,`.`]})}):(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{marginBottom:1,children:(0,U.jsxs)(o,{bold:!0,children:[`Memory Versions in `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`,n=!!e.redacted_at;return(0,U.jsxs)(a,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsxs)(a,{children:[(0,U.jsx)(o,{bold:!0,children:e.version_id}),n?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(o,{dimColor:!0,children:` · `}),(0,U.jsx)(o,{color:`warning`,children:`redacted`})]}):null]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Created: `,t]})]},e.version_id)})]})}if(e.mode===`redacted`){let{version:t}=e,n=t.redacted_at?new Date(t.redacted_at).toLocaleString():`—`;return(0,U.jsxs)(a,{flexDirection:`column`,children:[(0,U.jsx)(a,{children:(0,U.jsx)(o,{bold:!0,color:`warning`,children:`Version redacted`})}),(0,U.jsxs)(o,{children:[`ID: `,t.version_id]}),(0,U.jsxs)(o,{dimColor:!0,children:[`Redacted at: `,n]})]})}return(0,U.jsx)(a,{children:(0,U.jsx)(o,{color:`error`,children:e.message})})}var U,W=e((()=>{s(),c(),U=l()}));function G(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a store id`}}if(r===`create`)return i?{action:`create`,name:i}:{action:`invalid`,reason:`create requires a store name, e.g. create "My Work Store"`};if(r===`archive`){if(!i)return{action:`invalid`,reason:`archive requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`archive`,id:e}:{action:`invalid`,reason:`archive requires a store id`}}if(r===`memories`){if(!i)return{action:`invalid`,reason:`memories requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`memories`,storeId:e}:{action:`invalid`,reason:`memories requires a store id`}}if(r===`create-memory`){let e=i.split(/\s+/);if(e.length<2||!e[0])return{action:`invalid`,reason:`create-memory requires a store id and content, e.g. create-memory ms_123 "The content"`};let t=e[0],n=e.slice(1).join(` `);return n.trim()?{action:`create-memory`,storeId:t,content:n.trim()}:{action:`invalid`,reason:`create-memory requires non-empty content`}}if(r===`get-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`get-memory requires a store id and memory id, e.g. get-memory ms_123 mem_456`}:{action:`get-memory`,storeId:e[0],memoryId:e[1]}}if(r===`update-memory`){let e=i.split(/\s+/);if(e.length<3||!e[0]||!e[1])return{action:`invalid`,reason:`update-memory requires store id, memory id, and content, e.g. update-memory ms_123 mem_456 "New content"`};let t=e[0],n=e[1],r=e.slice(2).join(` `);return r.trim()?{action:`update-memory`,storeId:t,memoryId:n,content:r.trim()}:{action:`invalid`,reason:`update-memory requires non-empty content`}}if(r===`delete-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`delete-memory requires a store id and memory id, e.g. delete-memory ms_123 mem_456`}:{action:`delete-memory`,storeId:e[0],memoryId:e[1]}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,storeId:e}:{action:`invalid`,reason:`versions requires a store id`}}if(r===`redact`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`redact requires a store id and version id, e.g. redact ms_123 ver_456`}:{action:`redact`,storeId:e[0],versionId:e[1]}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${K}`}}var K,q=e((()=>{K=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`}));async function J(e,t){if(e.action===`list`){d(`tengu_memory_stores_list`,{});try{let e=await E();return t(e.length===0?`No memory stores found.`:`${e.length} memory store(s).`,{display:`system`}),{mode:`list`,stores:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to list memory stores: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`get`){let{id:n}=e;d(`tengu_memory_stores_get`,{id:n});try{let e=await O(n);return t(`Memory store ${n} fetched.`,{display:`system`}),{mode:`detail`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to get memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create`){let{name:n}=e;d(`tengu_memory_stores_create`,{name:n});try{let e=await D(n);return t(`Memory store created: ${e.memory_store_id}`,{display:`system`}),{mode:`created`,store:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to create memory store: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`archive`){let{id:n}=e;d(`tengu_memory_stores_archive`,{id:n});try{let e=await k(n);return t(`Memory store ${n} archived.`,{display:`system`}),{mode:`archived`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to archive memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`memories`){let{storeId:n}=e;d(`tengu_memory_stores_list_memories`,{storeId:n});try{let e=await A(n);return t(e.length===0?`No memories in store ${n}.`:`${e.length} memory(ies) in store ${n}.`,{display:`system`}),{mode:`memory-list`,storeId:n,memories:e}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list memories in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create-memory`){let{storeId:n,content:r}=e;d(`tengu_memory_stores_create_memory`,{storeId:n});try{let e=await j(n,r);return t(`Memory created: ${e.memory_id}`,{display:`system`}),{mode:`memory-created`,memory:e}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to create memory in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`get-memory`){let{storeId:n,memoryId:r}=e;d(`tengu_memory_stores_get_memory`,{storeId:n});try{let e=await M(n,r);return t(`Memory ${r} fetched.`,{display:`system`}),{mode:`memory-detail`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to get memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`update-memory`){let{storeId:n,memoryId:r,content:i}=e;d(`tengu_memory_stores_update_memory`,{storeId:n});try{let e=await N(n,r,i);return t(`Memory ${r} updated.`,{display:`system`}),{mode:`memory-updated`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to update memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete-memory`){let{storeId:n,memoryId:r}=e;d(`tengu_memory_stores_delete_memory`,{storeId:n});try{return await P(n,r),t(`Memory ${r} deleted.`,{display:`system`}),{mode:`memory-deleted`,storeId:n,memoryId:r}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to delete memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`versions`){let{storeId:n}=e;d(`tengu_memory_stores_versions`,{storeId:n});try{let e=await F(n);return t(e.length===0?`No memory versions found for store ${n}.`:`${e.length} version(s) in store ${n}.`,{display:`system`}),{mode:`versions`,storeId:n,versions:e}}catch(e){let r=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list versions for store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{storeId:n,versionId:r}=e;d(`tengu_memory_stores_redact`,{storeId:n});try{let e=await I(n,r);return t(`Version ${r} redacted.`,{display:`system`}),{mode:`redacted`,version:e}}catch(e){let n=e instanceof Error?e.message:String(e);return d(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to redact version ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}var Y,X;e((()=>{u(),B(),W(),q(),y(),Y=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`,X=v({commandName:`memory-stores`,parseArgs:e=>{d(`tengu_memory_stores_started`,{args:e});let t=G(e);return t.action===`invalid`?(d(`tengu_memory_stores_failed`,{reason:t.reason}),{action:`invalid`,reason:`${Y}\n${t.reason}`}):t},dispatch:J,View:H,errorView:e=>null})}))();export{X as callMemoryStores};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,I as n,P as r,fi as i,t as a,x as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{b as c,c as l,g as u,y as d}from"./config-DRDuVyzE.js";import{n as f,r as p}from"./analytics-BotDBGh0.js";import{n as m,t as h}from"./ThemePicker-CVSRqTzW.js";function g(e){return e}function _(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:x.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function v({onDone:e}){let[,n]=t();return(0,b.jsx)(o,{color:`permission`,children:(0,b.jsx)(h,{onThemeSelect:t=>{n(t),p(`tengu_onboarding_step`,{stepId:g(`theme`)}),e(`Theme set to ${t}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function y({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:i}){return(0,b.jsxs)(n,{flexDirection:`column`,paddingLeft:1,children:[(0,b.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,b.jsxs)(r,{children:[`- Theme: `,(0,b.jsx)(r,{bold:!0,children:e})]}),(0,b.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,b.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,b.jsxs)(r,{children:[`- Last onboarding version: `,(0,b.jsx)(r,{bold:!0,children:i})]}),(0,b.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var b,x,S;e((()=>{i(),a(),f(),m(),u(),b=s(),x=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),S=async(e,t,n)=>{let{sub:r,unknownArg:i}=_(n);if(p(`tengu_onboarding_step`,{stepId:g(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,b.jsx)(v,{onDone:t=>e(t)});if(r===`trust`)return d(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n - `/mcp` — list configured MCP servers\n - `claude mcp add <name> <command>` — add a server (in your shell)\n - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.claude.json` globally.",{display:`system`}),null;if(r===`status`){let e=l();return(0,b.jsx)(y,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return c(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.
|
|
2
|
-
|
|
3
|
-
For individual steps in this session, use:
|
|
4
|
-
/onboarding theme — re-pick theme inline
|
|
5
|
-
/onboarding trust — re-confirm workspace trust on next launch
|
|
6
|
-
/onboarding model — open /model picker
|
|
7
|
-
/onboarding mcp — show MCP setup hints
|
|
8
|
-
/onboarding status — show current onboarding state`,{display:`system`}),null}}))();export{S as callOnboarding};
|