@readmagic/workmate 0.0.10 → 0.0.12
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-Vmmm7p1c.js → AddWorkspaceDirectory-CtRxzRny.js} +1 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-_yJJ0wqu.js +1 -0
- package/dist/chunks/App-DoAZ7CYS.js +1 -0
- package/dist/chunks/ApproveApiKey-C8LwmDM2.js +1 -0
- package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-CLSACUmo.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
- package/dist/chunks/{DiffDialog-9AYwtupw.js → DiffDialog-CRWtQ1R5.js} +3 -3
- package/dist/chunks/Doctor-CZ513Df9.js +3 -0
- package/dist/chunks/Doctor-CzPvNZzF.js +1 -0
- package/dist/chunks/ExitFlow-BFeftDv0.js +2 -0
- package/dist/chunks/{Grove-B9-hhkZA.js → Grove-DRZrhbF0.js} +2 -2
- package/dist/chunks/{HybridTransport-MxJ_W_np.js → HybridTransport-BadJQe6u.js} +4 -4
- package/dist/chunks/InvalidConfigDialog-DQaT6aen.js +1 -0
- package/dist/chunks/{InvalidSettingsDialog-YyQcHocx.js → InvalidSettingsDialog-ISzcIGPU.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +1 -0
- package/dist/chunks/MCPToolListView-Rb1Q--jG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-BCpfHaBK.js → McpParsingWarnings-xv0RZCSL.js} +1 -1
- package/dist/chunks/MessageSelector-BHB55sZb.js +3 -0
- package/dist/chunks/Messages-CPX-nIdA.js +11 -0
- package/dist/chunks/Onboarding-CymgipoF.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-BSA9NrZc.js → PromptInputFooterSuggestions-8-awCxOn.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +1 -0
- package/dist/chunks/QueryEngine-HkswHUNv.js +1 -0
- package/dist/chunks/REPL-CZfg65kg.js +133 -0
- package/dist/chunks/REPL-eZsYNBfl.js +1 -0
- package/dist/chunks/RemoteSessionManager-B4jqKVd3.js +2 -0
- package/dist/chunks/ResumeConversation-B03XN_SP.js +1 -0
- package/dist/chunks/{SSETransport-CoxQ8YpH.js → SSETransport-je346ofV.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
- package/dist/chunks/Settings-C8GKWod1.js +2 -0
- package/dist/chunks/{TeleportProgress-Doucj-50.js → TeleportProgress-zmdAsogZ.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-B5I73j7Y.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-D6kpr2c6.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
- package/dist/chunks/{ThemePicker-DrC8tlp0.js → ThemePicker-p7_hHk1V.js} +1 -1
- package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
- package/dist/chunks/{ValidationErrorsList-D_OUa4RT.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
- package/dist/chunks/{WelcomeV2-DvfQHnZY.js → WelcomeV2-BnSYhyfu.js} +1 -1
- package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
- package/dist/chunks/{agentDisplay-B755vMZE.js → agentDisplay-CfMLGPGH.js} +1 -1
- package/dist/chunks/{agents-CIvP8l0s.js → agents-BT82hwBN.js} +1 -1
- package/dist/chunks/agents-qR6r94-F.js +103 -0
- package/dist/chunks/allErrors-CS77lRvU.js +1 -0
- package/dist/chunks/api-C4VflFau.js +1 -0
- package/dist/chunks/{api-nSHc_GIQ.js → api-DAubp5q9.js} +1 -1
- package/dist/chunks/auth-CNCehj7y.js +1 -0
- package/dist/chunks/auth-DrD9DW6X.js +1 -0
- package/dist/chunks/{auth-5QB6tsfB.js → auth-yDsvFcM7.js} +2 -2
- package/dist/chunks/{autoMode-BnUiK9Cu.js → autoMode-C2lnBot9.js} +6 -6
- package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
- package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
- package/dist/chunks/{banner-D0P7wXdw.js → banner-BcAM7iSx.js} +1 -1
- package/dist/chunks/bg-Ci7pG4eo.js +9 -0
- package/dist/chunks/{branch-DFWa4Oxo.js → branch-DJiMa8td.js} +2 -2
- package/dist/chunks/{break-cache-Chj9i9MP.js → break-cache-4rlQORVk.js} +2 -2
- package/dist/chunks/{bridgeConfig-Bb6URf4Q.js → bridgeConfig-BB6Hgali.js} +1 -1
- package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
- package/dist/chunks/{bridgeMessaging-C3huGcR3.js → bridgeMessaging-C9D0Lly2.js} +1 -1
- package/dist/chunks/{bridgePointer-DLYyvRKb.js → bridgePointer-DHWK3LEe.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-DFMftajD.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
- package/dist/chunks/{btw-DSK9R2C8.js → btw-BO2B23f-.js} +1 -1
- package/dist/chunks/caches-BQmbXerw.js +1 -0
- package/dist/chunks/caches-Dtjmjm6G.js +1 -0
- package/dist/chunks/{capacityWake-amzeeBz0.js → capacityWake-ByL6fM6I.js} +1 -1
- package/dist/chunks/ccrClient-BG9HU_fW.js +1 -0
- package/dist/chunks/{claudeDesktop-CsJfF1b-.js → claudeDesktop-Ct_hyICL.js} +1 -1
- package/dist/chunks/{clear-ClFDpWVJ.js → clear-B4XN2fib.js} +1 -1
- package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
- package/dist/chunks/client-7lIxWcaM.js +1 -0
- package/dist/chunks/client-B-2ccQZk.js +1 -0
- package/dist/chunks/{client-DFlE4fYh.js → client-BMA05FW8.js} +1 -1
- package/dist/chunks/commands-D_-v6_A0.js +1 -0
- package/dist/chunks/compact-kM0ETtB2.js +2 -0
- package/dist/chunks/config-9rLTDOYW.js +3 -0
- package/dist/chunks/config-Crf6Mzu3.js +1 -0
- package/dist/chunks/{config-CVHMRMwd.js → config-DMKtiMzJ.js} +1 -1
- package/dist/chunks/context-BY5oO5is.js +1 -0
- package/dist/chunks/{context-noninteractive-D5iQhasu.js → context-noninteractive-mAQt1p9l.js} +5 -5
- package/dist/chunks/context-noninteractive-tc4KTYfI.js +1 -0
- package/dist/chunks/conversation-CFIn-KsW.js +1 -0
- package/dist/chunks/conversation-DPI7VKBL.js +1 -0
- package/dist/chunks/createSSHSession-DjLSGm-0.js +6 -0
- package/dist/chunks/createSession-CftIZ3aq.js +1 -0
- package/dist/chunks/createSession-CjdLcRec.js +1 -0
- package/dist/chunks/crossProjectResume-BJqXBzkf.js +40 -0
- package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
- package/dist/chunks/cwd-DpqwaYHw.js +1 -0
- package/dist/chunks/datadog-BGati3aQ.js +1 -0
- package/dist/chunks/debug-Dr1SjdXn.js +39 -0
- package/dist/chunks/{debugUtils-DX0KAXNK.js → debugUtils-cK-iOsEV.js} +1 -1
- package/dist/chunks/detached-CqfQYVOi.js +5 -0
- package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
- package/dist/chunks/detectRepository-CMEkS5_2.js +1 -0
- package/dist/chunks/{diff-jEJJe58I.js → diff-1HsxKGBh.js} +1 -1
- package/dist/chunks/{directoryCompletion-BbXR2bfy.js → directoryCompletion-ByBTSuLu.js} +1 -1
- package/dist/chunks/doctor-CJfvt9zR.js +1 -0
- package/dist/chunks/entry-CrZCZQQC.js +14 -0
- package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
- package/dist/chunks/{esm-Cf4nSRjF.js → esm-BkOWaWVb.js} +1 -1
- package/dist/chunks/{execFileNoThrow-Dwu6psHW.js → execFileNoThrow-mXq4K0rl.js} +2 -2
- package/dist/chunks/execSyncWrapper-Ne33rRiD.js +1 -0
- package/dist/chunks/exit-B8MA4Ltm.js +1 -0
- package/dist/chunks/{extraUsage-Mi66JwFZ.js → extraUsage-0pUcYexI.js} +1 -1
- package/dist/chunks/extractMemories-DqhN0lba.js +1 -0
- package/dist/chunks/fast-DT5WDe3L.js +1 -0
- package/dist/chunks/{fast-BU4iUZ8E.js → fast-VOu2FUlV.js} +1 -1
- package/dist/chunks/{fileSuggestions-BMfQIDdW.js → fileSuggestions-Be-pyLLq.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
- package/dist/chunks/{firstPartyEventLogger-B3cXgR67.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
- package/dist/chunks/{flushGate-DgSDVGKZ.js → flushGate-BUSrMj_6.js} +1 -1
- package/dist/chunks/gemini-DB4M-MYv.js +1 -0
- package/dist/chunks/generateSessionName-DhCypqJ_.js +1 -0
- package/dist/chunks/{genericProcessUtils-CmsUPyRz.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
- package/dist/chunks/git-Bs1vtuvX.js +1 -0
- package/dist/chunks/git-CoQQ6YEf.js +6 -0
- package/dist/chunks/githubRepoPathMapping-CmpEaQoo.js +1 -0
- package/dist/chunks/goal-TxXtfkQ6.js +3 -0
- package/dist/chunks/{grok-BXMvezWb.js → grok-D2a_J5wE.js} +1 -1
- package/dist/chunks/{grove-CeOjTaY6.js → grove-BnzBbGsX.js} +1 -1
- package/dist/chunks/{help-5DNZO6_H.js → help-C5ankDi4.js} +1 -1
- package/dist/chunks/{hooks-C637tFtd.js → hooks-BZS105Rd.js} +3 -3
- package/dist/chunks/hooks-D-twhU_z.js +1 -0
- package/dist/chunks/{initReplBridge-D1h10vQ9.js → initReplBridge-DL4klK0C.js} +1 -1
- package/dist/chunks/{install-C-6ItpH0.js → install-NZvHd_40.js} +1 -1
- package/dist/chunks/{instrumentation-DaiPDUst.js → instrumentation-CjBlVlFq.js} +5 -5
- package/dist/chunks/{job-BeYzQUiR.js → job-D502Zf8J.js} +1 -1
- package/dist/chunks/jwtUtils-FQWtM6iM.js +1 -0
- package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
- package/dist/chunks/{launchLocalMemory-CE4J98xO.js → launchLocalMemory-DxC3LojF.js} +2 -2
- package/dist/chunks/{launchOnboarding-BfTdC6vp.js → launchOnboarding-BLp5k_H4.js} +1 -1
- package/dist/chunks/{loadAgentsDir-C7lOqvfh.js → loadAgentsDir-BXtV2jiO.js} +563 -570
- package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
- package/dist/chunks/loadPluginHooks-Dt3XQ-3N.js +1 -0
- package/dist/chunks/{localSearch-BKrznW5x.js → localSearch-CeP4ef0a.js} +1 -1
- package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
- package/dist/chunks/{log-CezCRpAN.js → log-27kCA_9u.js} +1 -1
- package/dist/chunks/{logoV2Utils-BkQfyQ1-.js → logoV2Utils-CEnU8qad.js} +1 -1
- package/dist/chunks/{magicDocs-BpVcON9o.js → magicDocs-YtfrqVC6.js} +4 -4
- package/dist/chunks/main-CGLCy2pM.js +31 -0
- package/dist/chunks/main-CkjTzYj1.js +513 -0
- package/dist/chunks/{managedEnv-DhWRJ5DK.js → managedEnv-B-BNY0xC.js} +1 -1
- package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
- package/dist/chunks/{mappers-bOab8ipV.js → mappers-IuJeXgvr.js} +1 -1
- package/dist/chunks/mcp-DMBoeQzm.js +6 -0
- package/dist/chunks/mcp-TMOPfLcW.js +1 -0
- package/dist/chunks/mcp-x5rgv-uv.js +2 -0
- package/dist/chunks/{memoize-DsqYrbeR.js → memoize-Co4vS6UF.js} +1 -1
- package/dist/chunks/memory-DDUoR63T.js +1 -0
- package/dist/chunks/{mode-DlKnUM8l.js → mode-GzBwK--u.js} +2 -2
- package/dist/chunks/model-BydaMaPr.js +1 -0
- package/dist/chunks/model-CDnVaVDR.js +1 -0
- package/dist/chunks/model-CIvbC7rW.js +1 -0
- package/dist/chunks/{modelOptions-CxP067Qv.js → modelOptions-ut0xePEe.js} +1 -1
- package/dist/chunks/nativeInstaller-fgCMR_c0.js +1 -0
- package/dist/chunks/oauth-D38aRTUb.js +1 -0
- package/dist/chunks/oauth-U649LV5H.js +1 -0
- package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
- package/dist/chunks/omit-D4Udf-p-.js +1 -0
- package/dist/chunks/onChangeAppState-WbvtqDtk.js +1 -0
- package/dist/chunks/{openai-B9C2XN5Q.js → openai-DaVFXyBB.js} +3 -3
- package/dist/chunks/panel-CoF2a-h4.js +1 -0
- package/dist/chunks/parser-B2PlJg4C.js +1 -0
- package/dist/chunks/{parser-BwPXQomy.js → parser-CUUiH40T.js} +1 -1
- package/dist/chunks/{partition-D-UhsUCx.js → partition-CzW_31Y1.js} +1 -1
- package/dist/chunks/permissions-BT3lxYBM.js +3 -0
- package/dist/chunks/pidLock-d1VPd6CG.js +3 -0
- package/dist/chunks/{plan-CyU2zrCK.js → plan-M9DG3AqN.js} +1 -1
- package/dist/chunks/{platform-BMPbglug.js → platform-Dg1c9F_1.js} +1 -1
- package/dist/chunks/plugin-BiNHuq3h.js +17 -0
- package/dist/chunks/pluginAutoupdate-B5lel6s5.js +1 -0
- package/dist/chunks/pluginBlocklist-CNGmIlwU.js +1 -0
- package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
- package/dist/chunks/pluginFlagging-CXSSOj4J.js +1 -0
- package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
- package/dist/chunks/pluginStartupCheck-BEd0VeQC.js +1 -0
- package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
- package/dist/chunks/plugins-BMZ3aYKP.js +4 -0
- package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
- package/dist/chunks/{poorMode-DEwQOAJt.js → poorMode-DxgO_bUb.js} +1 -1
- package/dist/chunks/print-DmoLcwVq.js +26 -0
- package/dist/chunks/processBashCommand-B-VqME9O.js +1 -0
- package/dist/chunks/processSlashCommand-D6zEooTy.js +5 -0
- package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
- package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
- package/dist/chunks/prompt-C3RRe4kW.js +1 -0
- package/dist/chunks/{prompt-M2lu8_Oa.js → prompt-CRc2QEZ5.js} +5 -5
- package/dist/chunks/prompt-EtAanewG.js +1 -0
- package/dist/chunks/{promptEditor-DhcZY-iu.js → promptEditor-Bo1d8ZLq.js} +2 -2
- package/dist/chunks/{protocolHandler-CkFaJKKo.js → protocolHandler-B83fCYI4.js} +4 -4
- package/dist/chunks/{proxy-CuMaO_YV.js → proxy-BEKNaTXI.js} +3 -3
- package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
- package/dist/chunks/reconciler-BGav_ezX.js +1 -0
- package/dist/chunks/refresh-DumNiLvM.js +1 -0
- package/dist/chunks/{registerProtocol-CsNYRZKr.js → registerProtocol-DduKPsn_.js} +2 -2
- package/dist/chunks/{reload-plugins-B7JAE3b4.js → reload-plugins-DNEgQ5vo.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CFLJhsB6.js → remoteBridgeCore-BGOqHADF.js} +1 -1
- package/dist/chunks/remoteManagedSettings-26nhzuca.js +1 -0
- package/dist/chunks/{rename-BCp2Vtqu.js → rename-BPknfVGF.js} +1 -1
- package/dist/chunks/{renderOptions-Q5oCLFIC.js → renderOptions-45A-EdsK.js} +1 -1
- package/dist/chunks/resume-DGz04xDh.js +2 -0
- package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
- package/dist/chunks/{ripgrep-DvOOsDMv.js → ripgrep-DQ_ILUJV.js} +5 -5
- package/dist/chunks/{runtimeObserver-CS_3BDNo.js → runtimeObserver-BZrF3GnQ.js} +4 -4
- package/dist/chunks/{runtimeObserver-DYUva6g-.js → runtimeObserver-CBV-7-w7.js} +1 -1
- package/dist/chunks/sandbox-adapter-DUqeqkQD.js +1 -0
- package/dist/chunks/sandbox-toggle-D61gVqcT.js +1 -0
- package/dist/chunks/searchExtraTools-CgsV6kb1.js +1 -0
- package/dist/chunks/{session-CO3gEqQP.js → session-Dy-_R7KP.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +1 -0
- package/dist/chunks/sessionObserver-BGYoLRGx.js +1 -0
- package/dist/chunks/{sessionObserver-YkRHC-Aa.js → sessionObserver-CyLpHSkw.js} +1 -1
- package/dist/chunks/{sessionState-Bifmu95-.js → sessionState-DSWN4tMV.js} +2 -2
- package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
- package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
- package/dist/chunks/{sessionTitle-COBSgSXS.js → sessionTitle-L5tyJgdU.js} +2 -2
- package/dist/chunks/{sessionTracing-BrNx1k2V.js → sessionTracing-DpHGGIZm.js} +3 -3
- package/dist/chunks/settings-3ionQKNv.js +1 -0
- package/dist/chunks/settings-DiBMs2gM.js +20 -0
- package/dist/chunks/settingsSync-dBqlrbcU.js +1 -0
- package/dist/chunks/setup-zf3v3ICe.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-DEaw-X5j.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
- package/dist/chunks/{shellQuote-BYeOv3Ip.js → shellQuote-C_I6DHLV.js} +2 -2
- package/dist/chunks/{sideQuestion-D0OKljee.js → sideQuestion-BYT8FdPF.js} +2 -2
- package/dist/chunks/sinks-DppGvgz1.js +1 -0
- package/dist/chunks/sinks-mFsijQ_S.js +2 -0
- package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
- package/dist/chunks/{skillGapStore-N_kmvXML.js → skillGapStore-DQXHqoP7.js} +2 -2
- package/dist/chunks/{skillLifecycle-C4F5RXuh.js → skillLifecycle-BG_RnGSh.js} +2 -2
- package/dist/chunks/skillSearchPanel-DxYP4Q6R.js +21 -0
- package/dist/chunks/skills-BD-2ofXA.js +1 -0
- package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
- package/dist/chunks/{startupProfiler-L_UWZ03w.js → startupProfiler-Dc5r6LgE.js} +2 -2
- package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
- package/dist/chunks/state-CsdHk8n-.js +1 -0
- package/dist/chunks/{stats-IzV0_vEc.js → stats-BkadEKa-.js} +1 -1
- package/dist/chunks/status-BmHu-c7I.js +2 -0
- package/dist/chunks/{status-CeVP_uDT.js → status-CrmnCDIE.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-Bb9gxdSt.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
- package/dist/chunks/{stringUtils-C84IJ91d.js → stringUtils-Df-Lnjxd.js} +1 -1
- package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
- package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
- package/dist/chunks/switcher-Dm646gO5.js +1 -0
- package/dist/chunks/switcher-sYTxnJQA.js +1 -0
- package/dist/chunks/syncCache-BofuFJEe.js +1 -0
- package/dist/chunks/{tasks-DZDhgx0w.js → tasks-NpI1iEem.js} +1 -1
- package/dist/chunks/teleport-Bs3kEipi.js +1 -0
- package/dist/chunks/{templateJobs-CrNPEKkh.js → templateJobs-C94jEE6O.js} +2 -2
- package/dist/chunks/{terminalSetup-CBqcwQll.js → terminalSetup-CbXKCpWM.js} +1 -1
- package/dist/chunks/{terminalSetup-D-N8YPiQ.js → terminalSetup-fwhFTxGi.js} +4 -4
- package/dist/chunks/{theme-Dazsirbw.js → theme-CEi3b_8f.js} +1 -1
- package/dist/chunks/tmux-d3cNCIZA.js +1 -0
- package/dist/chunks/{toolEventObserver-lnHJ9fLQ.js → toolEventObserver-DlL9CHmI.js} +1 -1
- package/dist/chunks/toolPool-DIT_uhtD.js +1 -0
- package/dist/chunks/trustedDevice-BokywSKL.js +1 -0
- package/dist/chunks/trustedDevice-Bzz03jCy.js +1 -0
- package/dist/chunks/{types-3j8PS-Du.js → types-BJ7qTz75.js} +2 -2
- package/dist/chunks/udsClient-CF8BmZgN.js +1 -0
- package/dist/chunks/{updateCCB-BPe9_FW6.js → updateCCB-CzBxsuJe.js} +1 -1
- package/dist/chunks/{upstreamproxy-DF00RzGG.js → upstreamproxy-BuBFDFAD.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js → useExitOnCtrlCDWithKeybindings-BHQfwlAl.js} +1 -1
- package/dist/chunks/useMainLoopModel-BkyIIW9t.js +1 -0
- package/dist/chunks/useManagePlugins-BWROoGDs.js +1 -0
- package/dist/chunks/{useMergedTools-Dk5cPqLc.js → useMergedTools-CHxnwR7R.js} +1 -1
- package/dist/chunks/{useSearchInput-C7Y1I9P9.js → useSearchInput-q2CFPU4W.js} +1 -1
- package/dist/chunks/{useSettingsErrors-DAEO7AyB.js → useSettingsErrors-CPVQbsqq.js} +1 -1
- package/dist/chunks/{userAgent-CIq27vUR.js → userAgent-B7WkjI6I.js} +1 -1
- package/dist/chunks/util-BfqXOA-P.js +1 -0
- package/dist/chunks/{validatePlugin-Kk6pxnO2.js → validatePlugin-jrcrYEIu.js} +1 -1
- package/dist/chunks/{vim-EYQn94Kx.js → vim-C4Hs5U2h.js} +1 -1
- package/dist/chunks/{which-DzFN5TNM.js → which-mplwBbc0.js} +1 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
- package/dist/chunks/windowsPaths-C7Mdo9aU.js +1 -0
- package/dist/chunks/{workSecret-DUqdPy44.js → workSecret-XLodD7tw.js} +1 -1
- package/dist/chunks/workerRegistry-Cfo7bKlm.js +6 -0
- package/dist/chunks/worktree-D0k_pCEz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/App-C2yQjBgY.js +0 -1
- package/dist/chunks/ApproveApiKey-CKbv5C1x.js +0 -1
- package/dist/chunks/ApproveApiKey-MscC-ssL.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CL5NWsFL.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BqNxQOXJ.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C0-psohX.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-4mOvEer_.js +0 -1
- package/dist/chunks/Doctor-DmgAwce2.js +0 -1
- package/dist/chunks/Doctor-jEs9chPk.js +0 -3
- package/dist/chunks/ExitFlow-DVKxFdpX.js +0 -2
- package/dist/chunks/InvalidConfigDialog-o9DF1REI.js +0 -1
- package/dist/chunks/MCPConnectionManager-CUTuaa8T.js +0 -1
- package/dist/chunks/MCPToolListView-CvqB4nCw.js +0 -1
- package/dist/chunks/MessageSelector-BLzw172f.js +0 -3
- package/dist/chunks/Messages-4K5sLmNh.js +0 -11
- package/dist/chunks/Onboarding-ClwHS5rh.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-Bb4KdIX_.js +0 -1
- package/dist/chunks/QueryEngine-DPHLSsax.js +0 -1
- package/dist/chunks/REPL-Bf46iQCN.js +0 -1
- package/dist/chunks/REPL-DIaAo9M9.js +0 -133
- package/dist/chunks/RemoteSessionManager-CS6mywIn.js +0 -2
- package/dist/chunks/ResumeConversation-Br2KsBoe.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-i_YO3QvV.js +0 -1
- package/dist/chunks/Settings-BMXysXIx.js +0 -2
- package/dist/chunks/TrustDialog-Fk4m_Sy4.js +0 -1
- package/dist/chunks/add-dir-CZ6Clvq8.js +0 -1
- package/dist/chunks/agents-DHnNg4h6.js +0 -103
- package/dist/chunks/allErrors-CU89tF-z.js +0 -1
- package/dist/chunks/api-BSeE6MwB.js +0 -1
- package/dist/chunks/auth-BIGJth5U.js +0 -1
- package/dist/chunks/auth-CDQMhIZP.js +0 -1
- package/dist/chunks/autonomy-C1aSgWPQ.js +0 -1
- package/dist/chunks/autonomy-Src6sKCp.js +0 -15
- package/dist/chunks/autonomyPanel-DnHpuiy4.js +0 -1
- package/dist/chunks/backgroundHousekeeping-B-cw0UcS.js +0 -17
- package/dist/chunks/backgroundHousekeeping-BS_8z3_x.js +0 -1
- package/dist/chunks/bg-50rllUNh.js +0 -1
- package/dist/chunks/bg-DAPORXF3.js +0 -9
- package/dist/chunks/bridgeConfig-BeqChxJC.js +0 -1
- package/dist/chunks/caches-BTQAW9zc.js +0 -1
- package/dist/chunks/caches-BVtSCnV1.js +0 -1
- package/dist/chunks/ccrClient-Bu7Tf1Z5.js +0 -1
- package/dist/chunks/cliLaunch-BWcoyZDP.js +0 -1
- package/dist/chunks/client-BWQ4-rN7.js +0 -1
- package/dist/chunks/client-c-3-PW1F.js +0 -1
- package/dist/chunks/commands-Bi7k3Wg-.js +0 -1
- package/dist/chunks/compact-J-h0Yf4b.js +0 -2
- package/dist/chunks/config-Do1870_d.js +0 -3
- package/dist/chunks/config-yyFe87vW.js +0 -1
- package/dist/chunks/context-Tb1Ca2Q-.js +0 -1
- package/dist/chunks/context-noninteractive-soPYKAc9.js +0 -1
- package/dist/chunks/conversation-CSEtUxOY.js +0 -1
- package/dist/chunks/conversation-Dk1WDQuN.js +0 -1
- package/dist/chunks/createSSHSession-CJtzNQdZ.js +0 -6
- package/dist/chunks/createSession-DkT1GL8y.js +0 -1
- package/dist/chunks/createSession-eE8mswkv.js +0 -1
- package/dist/chunks/crossProjectResume-04n3Ppy9.js +0 -40
- package/dist/chunks/cwd-ClLru_7T.js +0 -1
- package/dist/chunks/datadog-DjeJThpV.js +0 -1
- package/dist/chunks/debug-RAynG_nM.js +0 -39
- package/dist/chunks/detached-X_yjYR7x.js +0 -5
- package/dist/chunks/detectRepository-DgpNd87p.js +0 -1
- package/dist/chunks/detectRepository-ctF9KDbb.js +0 -1
- package/dist/chunks/doctor-B-Wag4C1.js +0 -1
- package/dist/chunks/entry-oIqjxIjQ.js +0 -14
- package/dist/chunks/execSyncWrapper-BTZJjCuv.js +0 -1
- package/dist/chunks/exit-BtW7LfRX.js +0 -1
- package/dist/chunks/extractMemories-CUrdiNcr.js +0 -1
- package/dist/chunks/fast-C60p6AqJ.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BfCYN7lt.js +0 -1
- package/dist/chunks/gemini-BwvSxGgn.js +0 -1
- package/dist/chunks/generateSessionName-DlrdedOk.js +0 -1
- package/dist/chunks/git-2c7WlGDL.js +0 -6
- package/dist/chunks/git-XtKbtJMc.js +0 -1
- package/dist/chunks/githubRepoPathMapping-DbWG4hFQ.js +0 -1
- package/dist/chunks/goal-ZmSRBx4q.js +0 -3
- package/dist/chunks/hooks-DWg07LmS.js +0 -1
- package/dist/chunks/jwtUtils-CUPXdX3W.js +0 -1
- package/dist/chunks/keybindings-DgIPdBy9.js +0 -2
- package/dist/chunks/loadAgentsDir-zikjxLvn.js +0 -1
- package/dist/chunks/loadPluginHooks-Cp8MSwAc.js +0 -1
- package/dist/chunks/localSearch-ZFyFy5FN.js +0 -1
- package/dist/chunks/main-9r5gLzUW.js +0 -605
- package/dist/chunks/main-CvOv59-7.js +0 -31
- package/dist/chunks/managedEnv-B61yLpwp.js +0 -1
- package/dist/chunks/mcp-BckPBjaM.js +0 -6
- package/dist/chunks/mcp-CS1DA3JL.js +0 -1
- package/dist/chunks/mcp-VcGPYCkW.js +0 -2
- package/dist/chunks/memory-C5ohwh-T.js +0 -1
- package/dist/chunks/model-BGu1AGq0.js +0 -1
- package/dist/chunks/model-BsZ4sP_H.js +0 -1
- package/dist/chunks/model-D19IIcll.js +0 -1
- package/dist/chunks/nativeInstaller-QB8cEJ18.js +0 -1
- package/dist/chunks/oauth-BN2I0_jl.js +0 -1
- package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
- package/dist/chunks/omit-DDUIPHnl.js +0 -1
- package/dist/chunks/onChangeAppState-RBl6H7ho.js +0 -1
- package/dist/chunks/panel-KW-wmEvU.js +0 -1
- package/dist/chunks/parser-xSBaQRLH.js +0 -1
- package/dist/chunks/permissions-BoLXYN1j.js +0 -3
- package/dist/chunks/pidLock-nJHbufJN.js +0 -3
- package/dist/chunks/plugin-C6-GQke5.js +0 -17
- package/dist/chunks/pluginAutoupdate-SlRFJlTT.js +0 -1
- package/dist/chunks/pluginBlocklist-n6Imlh3y.js +0 -1
- package/dist/chunks/pluginCliCommands-Bd96zSOQ.js +0 -1
- package/dist/chunks/pluginFlagging-DZaYzecY.js +0 -1
- package/dist/chunks/pluginOperations-D90IRawu.js +0 -2
- package/dist/chunks/pluginStartupCheck-Bxkxpm4k.js +0 -1
- package/dist/chunks/pluginStartupCheck-CB2q2dLv.js +0 -1
- package/dist/chunks/plugins-B9eSjLSA.js +0 -4
- package/dist/chunks/poorMode-BAnubpn1.js +0 -1
- package/dist/chunks/print-eCRv_Li-.js +0 -26
- package/dist/chunks/processBashCommand-B5F2Cl7K.js +0 -1
- package/dist/chunks/processSlashCommand-BC_D3cH5.js +0 -5
- package/dist/chunks/prompt-C1JPqinc.js +0 -1
- package/dist/chunks/prompt-DZhBz_Vu.js +0 -1
- package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
- package/dist/chunks/reconciler-B4GDm_iC.js +0 -1
- package/dist/chunks/refresh-DBVizOzg.js +0 -1
- package/dist/chunks/remoteManagedSettings-xh_MViZH.js +0 -1
- package/dist/chunks/resume-DVCSzKvv.js +0 -2
- package/dist/chunks/ripgrep-e-iewvTf.js +0 -1
- package/dist/chunks/sandbox-adapter-BFZFHplu.js +0 -1
- package/dist/chunks/sandbox-toggle--zNSKce_.js +0 -1
- package/dist/chunks/searchExtraTools-ui5y2VSE.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-CZvCqQJ6.js +0 -1
- package/dist/chunks/sessionObserver-Ba7um95p.js +0 -1
- package/dist/chunks/sessionStorage-CedwLLQs.js +0 -1
- package/dist/chunks/settings-DkDH7WQT.js +0 -1
- package/dist/chunks/settings-DnptdP79.js +0 -20
- package/dist/chunks/settingsSync-PmU7SmkU.js +0 -1
- package/dist/chunks/setup-BEsBuzsk.js +0 -3
- package/dist/chunks/sinks-BJHgxz6Y.js +0 -1
- package/dist/chunks/sinks-D5-yhcgU.js +0 -2
- package/dist/chunks/skillChangeDetector-Dd0WPdkO.js +0 -1
- package/dist/chunks/skillSearchPanel-CftorvAM.js +0 -21
- package/dist/chunks/skills-C4CTRN9o.js +0 -1
- package/dist/chunks/startupProfiler-D4FBdEQr.js +0 -1
- package/dist/chunks/state-BAGmpVBn.js +0 -1
- package/dist/chunks/state-D_lk6z-C.js +0 -1
- package/dist/chunks/status-Dzuw3hBv.js +0 -2
- package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
- package/dist/chunks/switcher-4KzBvuKH.js +0 -1
- package/dist/chunks/switcher-CCs9xl1z.js +0 -1
- package/dist/chunks/syncCache-CBRiRU5x.js +0 -1
- package/dist/chunks/teleport-Bw0jSxe9.js +0 -1
- package/dist/chunks/tmux-DewYVEBm.js +0 -1
- package/dist/chunks/toolPool-CkXFlqsn.js +0 -1
- package/dist/chunks/trustedDevice-CFf5yaG-.js +0 -1
- package/dist/chunks/trustedDevice-CuwSv8dG.js +0 -1
- package/dist/chunks/udsClient-e9dIkwVA.js +0 -1
- package/dist/chunks/useMainLoopModel-2-eujv0n.js +0 -1
- package/dist/chunks/useManagePlugins-CYBIkaB1.js +0 -1
- package/dist/chunks/util-VO98TdOz.js +0 -1
- package/dist/chunks/windowsPaths-BU3yQWTB.js +0 -1
- package/dist/chunks/windowsPaths-DgZ3YY4a.js +0 -1
- package/dist/chunks/workerRegistry-C07BcZIw.js +0 -6
- package/dist/chunks/worktree-dFUkhVE_.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./memoize-BK3gG5ob.js";import{n,t as r}from"./defineProperty-C-QyHrDq.js";import{Ao as i,Cr as a,Eo as o,Fb as s,Gb as c,Jb as ee,Kb as l,Ob as u,QC as d,QT as f,Tr as te,Ub as ne,Uo as re,Vb as p,Vg as m,Vo as h,ZC as g,ZT as _,aT as v,jb as y,qb as b,qg as x,sT as ie,zb as ae}from"./loadAgentsDir-C7lOqvfh.js";import{di as oe,j as S,t as se,ui as ce}from"./src-P_wYS_NJ2.js";import{n as le,t as C}from"./cwd-Cfdf7z7s.js";import{C as ue,F as de,S as fe,a as w,l as T,w as E,z as D}from"./debug-RAynG_nM.js";import{Gt as O,Jt as k,f as A,g as j,n as M}from"./settings-DnptdP79.js";import{c as N,h as P,o as F,v as I,y as L}from"./config-Do1870_d.js";import{f as R,l as z,m as B,p as V}from"./git-2c7WlGDL.js";import{n as H,r as pe}from"./execFileNoThrow-Dwu6psHW.js";import{o as U,s as W}from"./log-CezCRpAN.js";import{i as G,o as me}from"./platform-BMPbglug.js";import{l as he,u as ge}from"./oauth-C9VBDB0Y.js";import{Bt as _e,Vt as ve,_ as ye,ai as be,g as xe,si as Se}from"./model-BsZ4sP_H.js";import{c as Ce,h as we,l as Te,m as K,s as Ee}from"./proxy-CuMaO_YV.js";import{c as De,i as Oe}from"./terminalSetup-D-N8YPiQ.js";import{l as ke,o as Ae}from"./api-nSHc_GIQ.js";import{c as je,u as Me}from"./firstPartyEventLogger-B3cXgR67.js";import{randomUUID as Ne}from"crypto";t(),_(),le(),P(),k(),pe(),B(),U(),Me();var Pe=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function Fe(e){return!Pe.some(t=>t.test(e))}function Ie(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!Fe(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function Le(){if(O.platform===`win32`||!await z())return[];try{let e=await je(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
|
|
2
|
-
`)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await H(`git`,[...t,`--author=${e}`],{cwd:C()});r(n)}if(n.size<10){let{stdout:e}=await H(V(),t,{cwd:C()});r(e)}return Ie(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Re=10080*60*1e3,ze=e(()=>{let e=F(),t=e.exampleFiles?.length?f(e.exampleFiles):`<filepath>`;return`Try "${f([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),Be=e(async()=>{let e=F();Date.now()-(e.exampleFilesGeneratedAt??0)>Re&&(e.exampleFiles=[]),e.exampleFiles?.length||Le().then(e=>{e.length&&I(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});Se();var Ve={"claude-3-opus":{modelName:`Claude 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Claude 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Claude 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function He(e){let t=e.toLowerCase(),n=be();for(let[e,r]of Object.entries(Ve)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ue(e){if(!e)return null;let t=He(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),oe(),se(),D(),fe(),w(),me(),ge(),j(),_e(),ye(),ie(),d(),p(),y(),x(),Oe(),h(),o(),a(),P();function We(e){let t=N().numStartups;L(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function q(e){let t=N(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}P(),k(),B();var J;async function Ge(){return J===void 0&&(J=v in await re()),J}async function Y(e,t,n){if(!await Ge()||i(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&u(t.readFileState).some(e=>n.filePath.test(e)))}var Ke=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return N().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=N();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=N(),t=A(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return T(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Claude sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=N();return await R()<=1&&e.numStartups>50}catch{return!1}}},{id:`terminal-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=N();return O.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>O.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=N();return!!((O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!De())return!1;let e=N();return!(O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Claude memory`,cooldownSessions:15,async isRelevant(){return N().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&ce.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>G()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>A().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return N().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Claude while it works to steer Claude in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Claude to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`vscode-command-install`,content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${O.terminal===`vscode`?`code`:O.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!l()||G()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await b();case`cursor`:return!await ne();case`windsurf`:return!await ee();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return c()||(await ae()).length!==0?!1:(await s()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return N().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!O.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>G()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!m()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>m()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>te()&&N().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return N().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${g(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return N().numStartups>5}},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let e=N(),t=xe()===`opusplan`,n=e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0;return t&&n>3}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${S(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`subagent-fanout-nudge`,content:async e=>`Say ${S(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(ve(),!1)}],qe=[];function X(){let e=M().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Je(e){let t=M().spinnerTipsOverride,n=X();if(t?.excludeDefault&&n.length>0)return n;let r=[...Ke,...qe],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>q(e.id)>=e.cooldownSessions),...n]}Ae(),w(),U(),we(),Te();var Z=2e3,Q=5,Ye=3e4,$=3,Xe=new Set([4003]);function Ze(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var Qe=class{constructor(e,t,n,i){r(this,`sessionId`,void 0),r(this,`orgUuid`,void 0),r(this,`getAccessToken`,void 0),r(this,`callbacks`,void 0),r(this,`ws`,null),r(this,`state`,`closed`),r(this,`reconnectAttempts`,0),r(this,`sessionNotFoundRetries`,0),r(this,`pingInterval`,null),r(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=i}async connect(){if(this.state===`connecting`){T(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${he().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;T(`[SessionsWebSocket] Connecting to ${e}`);let t={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":`2023-06-01`};if(typeof Bun<`u`){let n=new globalThis.WebSocket(e,{headers:t,proxy:Ce(e),tls:K()||void 0});this.ws=n,n.addEventListener(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);W(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{T(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Ee(e),...K()});this.ws=r,r.on(`open`,()=>{T(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{W(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{T(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=ue(e);Ze(t)?this.callbacks.onMessage(t):T(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${de(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Xe.has(e)){T(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){T(`[SessionsWebSocket] 4001 retry budget exhausted (${$}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(Z*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${$}`);return}t===`connected`&&this.reconnectAttempts<Q?(this.reconnectAttempts++,this.scheduleReconnect(Z,`attempt ${this.reconnectAttempts}/${Q}`)):(T(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),T(`[SessionsWebSocket] Scheduling reconnect (${t}) in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state===`connected`)try{this.ws.ping?.()}catch{}},Ye)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}T(`[SessionsWebSocket] Sending control response`),this.ws.send(E(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Ne(),request:e};T(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(E(t))}isConnected(){return this.state===`connected`}close(){T(`[SessionsWebSocket] Closing connection`),this.state=`closed`,this.stopPingInterval(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}reconnect(){T(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};w(),U(),n();function $e(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var et=class{constructor(e,t){r(this,`config`,void 0),r(this,`callbacks`,void 0),r(this,`websocket`,null),r(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){T(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{T(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{T(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{T(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new Qe(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,e),this.websocket.connect()}handleMessage(e){if(e.type===`control_request`){this.handleControlRequest(e);return}if(e.type===`control_cancel_request`){let{request_id:t}=e,n=this.pendingPermissionRequests.get(t);T(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){T(`[RemoteSessionManager] Received control response`);return}$e(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)T(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{T(`[RemoteSessionManager] Unsupported control request subtype: ${n.subtype}`);let e={type:`control_response`,response:{subtype:`error`,request_id:t,error:`Unsupported control request subtype: ${n.subtype}`}};this.websocket?.sendControlResponse(e)}}async sendMessage(e,t){T(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await ke(this.config.sessionId,e,t);return n||W(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){W(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};T(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){T(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){T(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){T(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function tt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{We as a,Be as c,q as i,tt as n,Ue as o,Je as r,ze as s,et as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$C as n,$y as r,Cg as i,Cr as a,Eg as o,Iu as s,Ou as c,Pr as ee,Qn as te,Qy as l,Ru as u,Tc as d,Tr as ne,Vn as re,ai as ie,bc as f,ii as ae,ku as oe,l_ as se,qC as p,qr as m,u_ as h,vl as ce,wg as g,yl as _,zr as v}from"./loadAgentsDir-C7lOqvfh.js";import{I as y,P as b,Wt as x,dr as le,fi as S,ot as C,t as w}from"./src-P_wYS_NJ2.js";import{t as T}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as E,or as ue}from"./state-BemZdQIl.js";import{o as D,s as O}from"./log-CezCRpAN.js";import{n as k,r as A}from"./analytics-DJobLaWP.js";import{a as de,n as fe,s as j}from"./skillChangeDetector-Dd0WPdkO.js";import{t as M}from"./REPL-DIaAo9M9.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./crossProjectResume-04n3Ppy9.js";import{dirname as z}from"path";var B=t(S(),1);n(),E(),I(),u(),l(),w(),p(),k(),i(),h(),P(),f(),c(),F(),D(),a();var V=T();function pe(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function H({commands:t,worktreePaths:n,initialTools:i,mcpClients:a,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:u,autoConnectIdeFlag:f,strictMcpConfig:p=!1,systemPrompt:h,appendSystemPrompt:x,initialSearchQuery:S,disableSlashCommands:w=!1,forkSession:T,taskListId:E,filterByPr:D,thinkingConfig:k,onTurnComplete:P}){let{rows:F}=C(),I=g(e=>e.agentDefinitions),H=o(),[U,W]=B.useState([]),[ge,G]=B.useState(!0),[_e,ve]=B.useState(!1),[K,ye]=B.useState(!1),[q,be]=B.useState(null),[J,xe]=B.useState(null),Y=B.useRef(null),X=B.useRef(0),Z=B.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(D!==void 0){if(D===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof D==`number`)e=e.filter(e=>e.prNumber===D);else if(typeof D==`string`){let t=pe(D);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,D]),Se=ne();B.useEffect(()=>{v(n).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{O(e),G(!1)})},[n]);let Q=B.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||te(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=B.useCallback(e=>{G(!0),(e?ee():v(n)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{O(e)}).finally(()=>{G(!1)})},[n]),Ce=B.useCallback(()=>{let e=!K;ye(e),$(e)},[K,$]);function we(){process.exit(1)}async function Te(t){ve(!0);let n=performance.now(),i=R(t,K);if(i.isCrossProject&&!i.isSameRepoWorktree){let e=i.command,t=await le(e);t&&process.stdout.write(t),xe(e);return}try{let i=await oe(t,void 0);if(!i)throw Error(`Failed to load conversation`);i.sessionId&&!T?(ue(se(i.sessionId),t.fullPath?z(t.fullPath):null),await ae(),r(i.sessionId)):T&&i.contentReplacements?.length&&await m(i.contentReplacements);let{agentDefinition:a}=de(i.agentSetting,u,I);H(e=>({...e,agent:a?.agentType}));let o=fe(i.agentName,i.agentColor);if(o&&H(e=>({...e,standaloneAgentContext:o})),d(i.agentName),ie(T?{...i,worktreeSession:void 0}:i),T||(j(i.worktreeSession),i.sessionId&&re()),i.goal&&i.sessionId){let{hydrateGoalFromTranscript:t}=(_(),e(ce)),n=new Map;n.set(i.sessionId,i.goal),t(n,i.sessionId)}A(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),W([]),be({messages:i.messages,fileHistorySnapshots:i.fileHistorySnapshots,contentReplacements:i.contentReplacements,agentName:i.agentName,agentColor:i.agentColor==="default"?void 0:i.agentColor,mainThreadAgentDefinition:a})}catch(e){throw A(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),O(e),e}}return J?(0,V.jsx)(he,{command:J}):q?(0,V.jsx)(M,{debug:l,commands:t,initialTools:i,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:a,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:h,appendSystemPrompt:x,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:w,taskListId:E,thinkingConfig:k,onTurnComplete:P}):ge?(0,V.jsxs)(y,{children:[(0,V.jsx)(s,{}),(0,V.jsx)(b,{children:` Loading conversations…`})]}):_e?(0,V.jsxs)(y,{children:[(0,V.jsx)(s,{}),(0,V.jsx)(b,{children:` Resuming conversation…`})]}):Z.length===0?(0,V.jsx)(me,{}):(0,V.jsx)(N,{logs:Z,maxHeight:F,onCancel:we,onSelect:Te,onLogsChanged:Se?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:S,showAllProjects:K,onToggleAllProjects:Ce,onAgenticSearch:L})}function me(){return x(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,V.jsxs)(y,{flexDirection:`column`,children:[(0,V.jsx)(b,{children:`No conversations found to resume.`}),(0,V.jsx)(b,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function he({command:e}){return B.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,V.jsxs)(y,{flexDirection:`column`,gap:1,children:[(0,V.jsx)(b,{children:`This conversation is from a different directory.`}),(0,V.jsxs)(y,{flexDirection:`column`,children:[(0,V.jsx)(b,{children:`To resume, run:`}),(0,V.jsxs)(b,{children:[` `,e]})]}),(0,V.jsx)(b,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{H as ResumeConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$_ as e,Q_ as t}from"./loadAgentsDir-C7lOqvfh.js";e();export{t as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{$C as c,Bb as ee,C as l,Cb as te,Cg as ne,Cr as re,Eg as ie,Gb as ae,Ip as u,Lp as d,P as oe,S as se,Sb as ce,Tg as le,Vb as ue,_g as de,ao as f,bb as fe,fd as p,gg as m,nd as pe,oo as h,or as g,pd as me,qC as _,rd as he,so as ge,td as v,v as _e,wb as ve,wg as y}from"./loadAgentsDir-C7lOqvfh.js";import{D as b,Gt as ye,H as be,I as x,P as S,T as C,U as xe,Wt as Se,Xn as Ce,a as we,di as Te,fi as w,k as Ee,n as De,ot as Oe,r as T,t as E,ui as D,x as O,y as ke}from"./src-P_wYS_NJ2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as Ae,pt as je}from"./state-BemZdQIl.js";import{n as Me,t as A}from"./cwd-Cfdf7z7s.js";import{Ft as Ne,Nt as Pe,Pt as Fe,Rt as Ie,c as Le,g as j,jt as Re,n as ze,x as M,zt as Be}from"./settings-DnptdP79.js";import{a as Ve,c as N,h as He,i as Ue,o as We,y as P}from"./config-Do1870_d.js";import{o as Ge,s as Ke}from"./log-CezCRpAN.js";import{n as qe,r as F}from"./analytics-DJobLaWP.js";import{G as Je,K as Ye,Sr as Xe,_ as Ze,b as Qe,et as I,it as $e,q as et,rt as tt,tt as nt,x as rt,xr as it}from"./model-BsZ4sP_H.js";import{r as at,t as ot}from"./poorMode-DEwQOAJt.js";import{a as L,c as st,d as ct,i as lt,l as ut,n as dt,o as ft,r as R,s as pt,t as mt,u as z}from"./status-Dzuw3hBv.js";import{n as B,t as V}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";import{i as H,n as ht,r as gt}from"./modalContext-CUThy6Ph.js";import{n as _t,t as vt}from"./ThemePicker-DrC8tlp0.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-Mi66JwFZ.js";import{n as Ct,t as wt}from"./ClaudeMdExternalIncludesDialog-BqNxQOXJ.js";import{t as Tt}from"./SearchBox-C9vUA4IM.js";import{n as Et,t as U}from"./useSearchInput-C7Y1I9P9.js";function Dt(){let e=je();return[{label:`Version`,value:`0.0.10`},{label:`Session name`,value:g(e)??(0,K.jsx)(S,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:A()},...dt(),...mt()]}function Ot({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:z(e)},...R(t.clients,r.options.ideInstallationStatus,n),...ft(t.clients,n),...st(),...ut()]}async function kt(){return[...await lt(),...await L(),...await pt()]}function W({value:e}){return Array.isArray(e)?(0,K.jsx)(x,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(S,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(S,{children:e}):e}function At({context:e,diagnosticsPromise:t}){let n=y(e=>e.mainLoopModel),r=y(e=>e.mcp),[i]=be(),a=Mt.useMemo(()=>[Dt(),Ot({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=gt()?1:void 0;return(0,K.jsxs)(x,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(x,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(x,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(x,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(S,{bold:!0,children:[e,`:`]}),(0,K.jsx)(W,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(jt,{promise:t})})]}),(0,K.jsx)(S,{dimColor:!0,children:(0,K.jsx)(u,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function jt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(x,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(S,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(x,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(S,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(S,{wrap:`wrap`,children:e}):e]},t))]})}var Mt,G,K,Nt=t((()=>{o(),Mt=n(w(),1),G=n(w(),1),Ae(),ht(),E(),ne(),Me(),re(),ct(),d(),K=k()}));function Pt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Ft.jsxs)(ke,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Ft.jsxs)(S,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Ft.jsx)(S,{dimColor:!0,children:`How would you like to handle this?`}),(0,Ft.jsx)(pe,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var Ft,It=t((()=>{w(),E(),v(),Ft=k()}));function Lt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Bt,value:e,description:t?.description??Vt}))}function Rt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,zt.useState)([]),[o,s]=(0,zt.useState)(!0);(0,zt.useEffect)(()=>{h(A()).then(e=>{let t=Lt(e);a(t),s(!1)}).catch(()=>{let e=Lt(f);a(e),s(!1)})},[]);let c=(0,zt.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ke,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(x,{marginTop:1,children:(0,q.jsx)(S,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(S,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(pe,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var zt,q,Bt,Vt,Ht=t((()=>{w(),zt=n(w(),1),ge(),E(),Me(),he(),q=k(),Bt=`Default`,Vt=`Claude completes coding tasks efficiently and provides concise responses`}));function Ut({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,Wt.useState)(e),[a,o]=(0,Wt.useState)((e??``).length);Se(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(S,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(x,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(S,{children:s.pointer}),(0,J.jsx)(p,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(S,{dimColor:!0,children:`Leave empty for default (English)`})]})}var Wt,J,Gt=t((()=>{o(),Wt=n(w(),1),E(),_(),me(),J=k()}));function Kt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:c}){let{headerFocused:l,focusHeader:ne}=we(),re=gt(),[,d]=be(),ue=xe(),[f,p]=(0,X.useState)(N()),m=Y.useRef(N()),[h,g]=(0,X.useState)(ze()),me=Y.useRef(ze()),[_,he]=(0,X.useState)(h?.outputStyle||`default`),ge=Y.useRef(_),[v,ve]=(0,X.useState)(h?.language),Te=Y.useRef(v),[w,De]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Ae=Ce(),{rows:je}=Oe(),Me=c??Math.min(Math.floor(je*.8),30),A=Math.max(5,Me-10),j=y(e=>e.mainLoopModel),Re=y(e=>e.verbose),He=y(e=>e.thinkingEnabled),Ge=y(e=>tt()?e.fastMode:!1);y(e=>e.promptSuggestionEnabled);let qe=Fe(h?.permissions?.defaultMode??`default`),Ze=se()||_e()===`enabled`,I=ie(),[it,L]=(0,X.useState)({}),st=Y.useRef(He),[ct]=(0,X.useState)(()=>Le(`localSettings`)),[lt]=(0,X.useState)(()=>Le(`userSettings`)),ut=Y.useRef(ue),dt=le(),[ft]=(0,X.useState)(()=>{let e=dt.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),R=Y.useRef(!1),[pt,mt]=(0,X.useState)(!1),[z,B]=(0,X.useState)(null),{query:V,setQuery:H,cursorOffset:ht}=Et({isActive:O&&z===null&&!l,onExit:()=>k(!1),onExitUp:ne,passthroughCtrlKeys:[`c`,`d`]}),_t=O&&!l;Y.useEffect(()=>{o?.(_t)},[_t,o]);let yt=ee(n.options.mcpClients),St=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Ct=Y.use(ce(!0)),Tt=te(Ct),U=Ve();function Dt(e){F(`tengu_config_model_changed`,{from_model:j,to_model:e}),I(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),L(t=>{let n=rt(e)+(bt(e,!1,Qe())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function Ot(e){P(t=>({...t,verbose:e})),p({...N(),verbose:e}),I(t=>({...t,verbose:e})),L(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let kt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:f.autoCompactEnabled,type:`boolean`,onChange(e){P(t=>({...t,autoCompactEnabled:e})),p({...N(),autoCompactEnabled:e}),F(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:h?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){M(`localSettings`,{spinnerTipsEnabled:e}),g(t=>({...t,spinnerTipsEnabled:e})),F(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:h?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){M(`localSettings`,{cacheWarningEnabled:e}),g(t=>({...t,cacheWarningEnabled:e})),F(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:h?.prefersReducedMotion??!1,type:`boolean`,onChange(e){M(`localSettings`,{prefersReducedMotion:e}),g(t=>({...t,prefersReducedMotion:e})),I(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),F(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:He??!0,type:`boolean`,onChange(e){I(t=>({...t,thinkingEnabled:e})),M(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),F(`tengu_thinking_toggled`,{enabled:e})}},...tt()&&nt()?[{id:`fastMode`,label:`Fast mode (${Je} only)`,value:!!Ge,type:`boolean`,onChange(e){Ye(),M(`userSettings`,{fastMode:e?!0:void 0}),e?(I(e=>({...e,mainLoopModel:et(),mainLoopModelForSession:null,fastMode:!0})),L(e=>({...e,model:et(),"Fast mode":`ON`}))):(I(e=>({...e,fastMode:!1})),L(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(ot(),e(at)).isPoorModeActive(),type:`boolean`,onChange(t){(ot(),e(at)).setPoorMode(t),I(e=>({...e,promptSuggestionEnabled:!t}))}},...St?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:f.fileCheckpointingEnabled,type:`boolean`,onChange(e){P(t=>({...t,fileCheckpointingEnabled:e})),p({...N(),fileCheckpointingEnabled:e}),F(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Re,type:`boolean`,onChange:Ot},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:f.terminalProgressBarEnabled,type:`boolean`,onChange(e){P(t=>({...t,terminalProgressBarEnabled:e})),p({...N(),terminalProgressBarEnabled:e}),F(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:f.showTurnDuration,type:`boolean`,onChange(e){P(t=>({...t,showTurnDuration:e})),p({...N(),showTurnDuration:e}),F(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:qe,options:(()=>{let e=[`default`,`plan`];return[...e,...Be.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Fe(e),n=t===`auto`?t:Pe(t)?Ie(t):t,r=M(`userSettings`,{permissions:{...h?.permissions,defaultMode:n}});if(r.error){Ke(r.error);return}g(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),L(t=>({...t,defaultPermissionMode:e})),F(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Ze?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:h?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){M(`userSettings`,{useAutoModeDuringPlan:e}),g(t=>({...t,useAutoModeDuringPlan:e})),I(e=>{let t=oe(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),L(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:f.respectGitignore,type:`boolean`,onChange(e){P(t=>({...t,respectGitignore:e})),p({...N(),respectGitignore:e}),F(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...de()?[{id:`copyOnSelect`,label:`Copy on select`,value:f.copyOnSelect??!0,type:`boolean`,onChange(e){P(t=>({...t,copyOnSelect:e})),p({...N(),copyOnSelect:e}),F(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:h?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:ue,type:`managedEnum`,onChange:d},{id:`notifChannel`,label:`Notifications`,value:f.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){P(t=>({...t,preferredNotifChannel:e})),p({...N(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:_,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:v??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:f.editorMode===`emacs`?`normal`:f.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){P(t=>({...t,editorMode:e})),p({...N(),editorMode:e}),F(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:f.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){P(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),p({...N(),prStatusFooterEnabled:e}),F(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:Dt},...yt?[{id:`diffTool`,label:`Diff tool`,value:f.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){P(t=>({...t,diffTool:e})),p({...N(),diffTool:e}),F(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...ae()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:f.autoConnectIde??!1,type:`boolean`,onChange(e){P(t=>({...t,autoConnectIde:e})),p({...N(),autoConnectIde:e}),F(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...ae()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:f.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){P(t=>({...t,autoInstallIdeExtension:e})),p({...N(),autoInstallIdeExtension:e}),F(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...Tt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:We().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(S,{children:[`Use custom API key: `,(0,Z.jsx)(S,{bold:!0,children:Xe(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&f.customApiKeyResponses?.approved?.includes(Xe(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){P(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=Xe(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),p(N())}}]:[]],W=Y.useMemo(()=>{if(!V)return kt;let e=V.toLowerCase();return kt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[kt,V]);Y.useEffect(()=>{if(w>=W.length){let e=Math.max(0,W.length-1);De(e),E(Math.max(0,e-A+1));return}E(e=>w<e?w:w>=e+A?w-A+1:e)},[W.length,w,A]);let At=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),jt=(0,X.useCallback)(()=>{if(z!==null)return;let e=Object.entries(it).map(([e,t])=>(F(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${D.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&m.current.customApiKeyResponses?.approved?.includes(Xe(n))),a=!!(n&&f.customApiKeyResponses?.approved?.includes(Xe(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),F(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),f.theme!==m.current.theme&&e.push(`Set theme to ${D.bold(f.theme)}`),f.preferredNotifChannel!==m.current.preferredNotifChannel&&e.push(`Set notifications to ${D.bold(f.preferredNotifChannel)}`),_!==ge.current&&e.push(`Set output style to ${D.bold(_)}`),v!==Te.current&&e.push(`Set response language to ${D.bold(v??`Default (English)`)}`),f.editorMode!==m.current.editorMode&&e.push(`Set editor mode to ${D.bold(f.editorMode||`emacs`)}`),f.diffTool!==m.current.diffTool&&e.push(`Set diff tool to ${D.bold(f.diffTool)}`),f.autoConnectIde!==m.current.autoConnectIde&&e.push(`${f.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),f.autoInstallIdeExtension!==m.current.autoInstallIdeExtension&&e.push(`${f.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),f.autoCompactEnabled!==m.current.autoCompactEnabled&&e.push(`${f.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),f.respectGitignore!==m.current.respectGitignore&&e.push(`${f.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),f.copyOnSelect!==m.current.copyOnSelect&&e.push(`${f.copyOnSelect?`Enabled`:`Disabled`} copy on select`),f.terminalProgressBarEnabled!==m.current.terminalProgressBarEnabled&&e.push(`${f.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),f.showStatusInTerminalTab!==m.current.showStatusInTerminalTab&&e.push(`${f.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),f.showTurnDuration!==m.current.showTurnDuration&&e.push(`${f.showTurnDuration?`Enabled`:`Disabled`} turn duration`),f.remoteControlAtStartup!==m.current.remoteControlAtStartup){let t=f.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${f.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}h?.autoUpdatesChannel!==me.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${D.bold(h?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
|
|
2
|
-
`)):t(`Config dialog dismissed`,{display:`system`})},[z,it,f,j,_,v,h?.autoUpdatesChannel,tt()?h?.fastMode:void 0,t]),Mt=(0,X.useCallback)(()=>{ue!==ut.current&&d(ut.current),P(()=>m.current);let e=ct;M(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=lt;M(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=ft;I(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:oe(e.toolPermissionContext)}))},[ue,d,ct,lt,ft,I]);Se(`confirm:no`,(0,X.useCallback)(()=>{z===null&&(R.current&&Mt(),t(`Config dialog dismissed`,{display:`system`}))},[z,Mt,t]),{context:`Settings`,isActive:z===null&&!O&&!l}),Se(`settings:close`,jt,{context:`Settings`,isActive:z===null&&!O&&!l});let G=(0,X.useCallback)(()=>{let e=W[w];if(!(!e||!e.onChange)){if(e.type===`boolean`){R.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===st.current?mt(!1):n.messages.some(e=>e.type===`assistant`)&&mt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:B(`Theme`),a(!0);return;case`model`:B(`Model`),a(!0);return;case`showExternalIncludesDialog`:B(`ExternalIncludes`),a(!0);return;case`outputStyle`:B(`OutputStyle`),a(!0);return;case`language`:B(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){B(`EnableAutoUpdates`),a(!0);return}(h?.autoUpdatesChannel??`latest`)===`latest`?(B(`ChannelDowngrade`),a(!0)):(R.current=!0,M(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),g(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),F(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){R.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,w,h?.autoUpdatesChannel,a]),K=e=>{mt(!1);let t=Math.max(0,Math.min(W.length-1,w+e));De(t),At(t)};return ye({"select:previous":()=>{w===0?(mt(!1),k(!0),E(0)):K(-1)},"select:next":()=>K(1),"scroll:lineUp":()=>K(-1),"scroll:lineDown":()=>K(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{k(!0),H(``)}},{context:`Settings`,isActive:z===null&&!O&&!l}),(0,Z.jsx)(x,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(z===null&&!l){if(O){if(e.key===`escape`){e.preventDefault(),V.length>0?H(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),De(0),E(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),H(e.key))}},[z,l,O,V,H,G]),children:z===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{R.current=!0,d(e),B(null),a(!1)},onCancel:()=>{B(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(x,{children:(0,Z.jsx)(S,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):z===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:j,onSelect:e=>{R.current=!0,Dt(e),B(null),a(!1)},onCancel:()=>{B(null),a(!1)},showFastModeNotice:tt()?Ge&&$e(j)&&nt():!1}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{B(null),a(!1)},externalIncludes:fe(Ct)}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):z===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt,{initialStyle:_,onComplete:e=>{R.current=!0,he(e??`default`),B(null),a(!1),M(`localSettings`,{outputStyle:e}),F(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{B(null),a(!1)}}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):z===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{initialLanguage:v,onComplete:e=>{R.current=!0,ve(e),B(null),a(!1),M(`userSettings`,{language:e}),F(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{B(null),a(!1)}}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):z===`EnableAutoUpdates`?(0,Z.jsx)(ke,{title:`Enable Auto-Updates`,onCancel:()=>{B(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(pe,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{R.current=!0,B(null),a(!1),P(e=>({...e,autoUpdates:!0})),p({...N(),autoUpdates:!0}),M(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),g(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),F(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(S,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):z===`ChannelDowngrade`?(0,Z.jsx)(Pt,{currentVersion:`0.0.10`,onChoice:e=>{if(B(null),a(!1),e===`cancel`)return;R.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.10`),M(`userSettings`,t),g(e=>({...e,...t})),F(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(x,{flexDirection:`column`,gap:1,marginY:re?void 0:1,children:[(0,Z.jsx)(Ee,{query:V,isFocused:O&&!l,isTerminalFocused:Ae,cursorOffset:ht,placeholder:`Search settings…`}),(0,Z.jsx)(x,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(S,{dimColor:!0,italic:!0,children:[`No settings match "`,V,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(S,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),W.slice(T,T+A).map((e,t)=>{let n=T+t===w&&!l&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(x,{width:`100%`,children:[(0,Z.jsx)(x,{width:44,children:(0,Z.jsxs)(S,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(x,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:e.value.toString()}),pt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(S,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:Jt[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(qt,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:Ne(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(x,{flexDirection:`column`,children:[(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(S,{dimColor:!0,children:[`(`,Ue(U),`)`]})]}):(0,Z.jsx)(S,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<W.length&&(0,Z.jsxs)(S,{dimColor:!0,children:[s.arrowDown,` `,W.length-T-A,` more below`]})]})}),l?(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(b,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(S,{children:`Type to filter`}),(0,Z.jsx)(b,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(b,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(u,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(u,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(u,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(u,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function qt({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(S,{children:[`iTerm2 `,(0,Z.jsx)(S,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(S,{children:[`Terminal Bell `,(0,Z.jsx)(S,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(S,{children:[`Kitty `,(0,Z.jsx)(S,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(S,{children:[`Ghostty `,(0,Z.jsx)(S,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,Jt,Yt=t((()=>{E(),Y=n(w(),1),X=n(w(),1),_(),o(),He(),it(),Te(),Re(),l(),Ge(),qe(),_t(),ne(),yt(),Ze(),St(),Ct(),It(),v(),Ht(),Gt(),ve(),d(),ht(),Tt(),ue(),j(),ge(),a(),U(),c(),I(),m(),Z=k(),Jt={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function Xt({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),ee=gt(),{rows:l}=H(Oe()),te=ee?l+1:Math.max(15,Math.min(Math.floor(l*.8),30)),[ne]=(0,Q.useState)(()=>kt().catch(()=>[]));return B(),Se(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(O,{color:`permission`,children:(0,$.jsx)(T,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:te,children:[(0,$.jsx)(De,{title:`Status`,children:(0,$.jsx)(At,{context:t,diagnosticsPromise:ne})},`status`),(0,$.jsx)(De,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Kt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:te})})},`config`)]})})}var Q,$,Zt=t((()=>{w(),Q=n(w(),1),_(),V(),c(),ht(),E(),Nt(),Yt(),$=k()}));export{Zt as n,Xt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{C_ as t,S_ as n,fS as r,mS as i,nd as a,nf as o,qC as s,rf as c,td as l}from"./loadAgentsDir-C7lOqvfh.js";import{I as u,P as d,Wt as f,fi as p,t as m}from"./src-P_wYS_NJ2.js";import{t as h}from"./jsx-runtime-Bb4Xn-E0.js";import{$n as g,Wt as _}from"./state-BemZdQIl.js";import{n as v,t as y}from"./cwd-Cfdf7z7s.js";import{d as b,p as x}from"./debug-RAynG_nM.js";import{c as S,g as C}from"./settings-DnptdP79.js";import{h as w,n as T,v as E}from"./config-Do1870_d.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{on as k}from"./prompt-M2lu8_Oa.js";import{n as A,t as j}from"./managedEnvConstants-BPwL2aWI.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";import{n as P,t as F}from"./PermissionDialog-Cb3z8OUP.js";import{homedir as I}from"os";var L=e(p(),1),R=h();m(),_(),v(),x(),D(),w(),s(),i(),c(),l(),N(),P(),C(),k(),A(),t();function z(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function B(){let e=[];return z(S(`projectSettings`))&&e.push(`.claude/settings.json`),z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(n(`projectSettings`))&&e.push(`.claude/settings.json`),V(n(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(S(`projectSettings`))&&e.push(`.claude/settings.json`),U(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(S(`projectSettings`))&&e.push(`.claude/settings.json`),G(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(S(`projectSettings`))&&e.push(`.claude/settings.json`),q(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(S(`projectSettings`))&&e.push(`.claude/settings.json`),Y(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!j.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(S(`projectSettings`))&&e.push(`.claude/settings.json`),Z(S(`localSettings`))&&e.push(`.claude/settings.local.json`),e}k();function $({onDone:e,commands:t}){let{servers:n}=r(`project`),i=Object.keys(n).length>0,s=B().length>0,c=H(),l=K().length>0,p=J().length>0,m=X().length>0,h=W().length>0,_=Q().length>0,v=t?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,x=t?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=c.length>0||v||x,C=T(),[w,D]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>o(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{O(`tengu_trust_dialog_shown`,{isHomeDir:I()===y(),hasMcpServers:i,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_})},[i,s,S,l,p,m,h,_]);function k(t){if(t===`exit`){D(1);return}let n=I()===y();O(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:i,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:l,hasAwsCommands:p,hasGcpCommands:m,hasOtelHeadersHelper:h,hasDangerousEnvVars:_}),n?g(!0):E(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>D(1));return f(`confirm:no`,()=>{D(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(u,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(d,{bold:!0,children:b().cwd()}),(0,R.jsx)(d,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(d,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(a,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,R.jsx)(d,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{BT as i,FC as a,I as o,IC as s,L as c,LT as l,R as u,h_ as d,v_ as f,y_ as p}from"./loadAgentsDir-C7lOqvfh.js";import{I as m,P as h,di as g,fi as _,t as v,ui as y}from"./src-P_wYS_NJ2.js";import{t as b}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as x,h as S,in as C}from"./state-BemZdQIl.js";import{n as w,t as T}from"./AddWorkspaceDirectory-Vmmm7p1c.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(m,{flexDirection:`column`,children:[(0,k.jsxs)(h,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(a,{children:(0,k.jsx)(h,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=d(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=S();o.includes(n)||C([...o,n]),l.refreshConfig();let s;if(r)try{p(i),s=`Added ${y.bold(n)} as a working directory and saved to local settings`}catch(e){s=`Added ${y.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else s=`Added ${y.bold(n)} as a working directory for this session`;e(`${s} ${y.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let s=await u(r,i.toolPermissionContext);if(s.resultType!==`success`){let t=o(s);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:s.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${y.bold(s.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{g(),n(),O=t(_(),1),x(),s(),w(),v(),f(),i(),c(),k=b()}))();export{D as call};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-BDhHQY0-.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$ as o,Ah as s,BE as c,BS as l,Ba as u,Cg as d,Ch as f,Cv as p,Eg as m,HE as h,Ih as g,Ip as _,Iu as v,Kl as ee,Lh as y,Lp as b,MC as te,Mh as ne,Np as re,Qp as ie,Ru as ae,Sv as oe,Ta as se,VE as ce,VS as le,Xl as ue,Xp as de,Ya as fe,Zl as pe,Zp as me,_x as he,am as ge,ap as _e,bx as ve,c as ye,cE as be,dm as xe,fd as Se,hh as Ce,im as we,ip as Te,it as Ee,jC as De,jh as Oe,jp as ke,kh as Ae,l as je,mh as Me,nS as Ne,nd as Pe,nl as Fe,nm as Ie,np as Le,nu as Re,o as ze,om as Be,ot as Ve,pd as He,pm as Ue,qC as x,ql as We,r as Ge,rd as Ke,rl as qe,rm as Je,rp as Ye,s as Xe,sE as Ze,t as Qe,tS as $e,tt as et,tu as tt,um as nt,vx as rt,wg as it,wh as at,yv as ot,yx as st}from"./loadAgentsDir-C7lOqvfh.js";import{C as ct,D as S,I as C,P as w,T,Wt as E,di as lt,fi as D,t as O,ui as ut,y as dt}from"./src-P_wYS_NJ2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{n as ft,t as pt}from"./cwd-Cfdf7z7s.js";import{C as mt,G as ht,I as gt,Q as _t,S as vt,W as yt,z as bt}from"./debug-RAynG_nM.js";import{In as xt,J as St,Ln as Ct,Q as wt,Yt as Tt,Zt as Et,at as Dt,cn as Ot,it as kt,on as At}from"./settings-DnptdP79.js";import{M as jt,P as Mt}from"./config-Do1870_d.js";import{o as Nt,s as Pt}from"./log-CezCRpAN.js";import{n as Ft,r as It}from"./analytics-DJobLaWP.js";import{C as Lt,v as Rt}from"./startupProfiler-L_UWZ03w.js";import{l as zt,n as Bt,o as Vt}from"./stringUtils-C84IJ91d.js";import{bn as Ht,yn as Ut}from"./prompt-M2lu8_Oa.js";import{at as Wt}from"./sessionState-Bifmu95-.js";import{a as Gt,i as Kt,n as qt,o as Jt,r as Yt,t as Xt}from"./agentDisplay-B755vMZE.js";import{n as Zt,t as Qt}from"./useExitOnCtrlCDWithKeybindings-ChqBs9Lr.js";import{n as $t,t as en}from"./useMergedTools-Dk5cPqLc.js";import{n as tn,r as nn,t as rn}from"./promptEditor-DhcZY-iu.js";import{n as an,t as on}from"./useMainLoopModel-2-eujv0n.js";import{join as A}from"path";import{mkdir as sn,open as cn,unlink as ln}from"fs/promises";var j,un=e((()=>{j={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function dn(e,t,n,r,i,a,o){return`---
|
|
2
|
-
name: ${e}
|
|
3
|
-
description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
${r}
|
|
7
|
-
`}function fn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return A(n(),j.AGENTS_DIR);case`projectSettings`:return A(pt(),j.FOLDER_NAME,j.AGENTS_DIR);case`policySettings`:return A(Tt(),j.FOLDER_NAME,j.AGENTS_DIR);case`localSettings`:return A(pt(),j.FOLDER_NAME,j.AGENTS_DIR)}}function pn(e){switch(e){case`projectSettings`:return A(`.`,j.FOLDER_NAME,j.AGENTS_DIR);default:return fn(e)}}function mn(e){return A(fn(e.source),`${e.agentType}.md`)}function hn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return A(fn(e.source),`${e.filename||e.agentType}.md`)}function gn(e){return e.source===`built-in`?`Built-in`:A(pn(e.source),`${e.agentType}.md`)}function _n(e){return Xe(e)?`Built-in`:je(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:A(pn(e.source),`${e.filename||e.agentType}.md`)}async function vn(e){let t=fn(e);return await sn(t,{recursive:!0}),t}async function yn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await vn(e);let l=mn({source:e,agentType:t}),u=dn(t,n,r,i,o,s,c);try{await Sn(l,u,a?`wx`:`w`)}catch(e){throw gt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function bn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Sn(hn(e),dn(e.agentType,t,n,r,i,a,o))}async function xn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=hn(e);try{await ln(t)}catch(e){if(gt(e)!==`ENOENT`)throw e}}async function Sn(e,t,n=`w`){let r=await cn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Cn=e((()=>{Et(),ze(),ft(),r(),bt(),un()}));function wn({agent:e,tools:t,onBack:n}){let r=ie(e,t,!1),i=_n(e),o=we(e.agentType);E(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function l(){return r.hasWildcard?(0,M.jsx)(w,{children:`All tools`}):!e.tools||e.tools.length===0?(0,M.jsx)(w,{children:`None`}):(0,M.jsxs)(M.Fragment,{children:[r.validTools.length>0&&(0,M.jsx)(w,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,M.jsxs)(w,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,M.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,M.jsx)(w,{dimColor:!0,children:i}),(0,M.jsxs)(C,{flexDirection:`column`,children:[(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,M.jsx)(C,{marginLeft:2,children:(0,M.jsx)(w,{children:e.whenToUse})})]}),(0,M.jsxs)(C,{children:[(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Tools`}),`:`,` `]}),l()]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Model`}),`: `,nt(e.model)]}),e.permissionMode&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Memory`}),`: `,c(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,M.jsx)(C,{children:(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Color`}),`:`,` `,(0,M.jsxs)(w,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Xe(e)&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(C,{children:(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`System prompt`}),`:`]})}),(0,M.jsx)(C,{marginLeft:2,marginRight:2,children:(0,M.jsx)(ke,{children:e.getSystemPrompt()})})]})]})}var M,Tn=e((()=>{i(),D(),O(),x(),ge(),ce(),me(),ze(),Ue(),re(),Cn(),M=k()}));function En({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Dn.useState)(Math.max(0,On.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:On.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<On.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=On[r];n(t===`automatic`?void 0:t)}},s=On[r];return(0,N.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,N.jsx)(C,{flexDirection:`column`,children:On.map((e,t)=>{let n=t===r;return(0,N.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,N.jsx)(w,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,N.jsx)(w,{bold:n,children:`Automatic color`}):(0,N.jsxs)(C,{gap:1,children:[(0,N.jsx)(w,{backgroundColor:Je[e],color:`inverseText`,children:` `}),(0,N.jsx)(w,{bold:n,children:Bt(e)})]})]},e)})}),(0,N.jsxs)(C,{marginTop:1,children:[(0,N.jsx)(w,{children:`Preview: `}),s===void 0||s===`automatic`?(0,N.jsxs)(w,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,N.jsxs)(w,{backgroundColor:Je[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Dn,N,On,kn=e((()=>{i(),Dn=t(D(),1),O(),ge(),Vt(),N=k(),On=[`automatic`,...Ie]}));function An({initialModel:e,onComplete:t,onCancel:n}){let r=jn.useMemo(()=>{let t=xe();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Mn.jsxs)(C,{flexDirection:`column`,children:[(0,Mn.jsx)(C,{marginBottom:1,children:(0,Mn.jsx)(w,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Mn.jsx)(Pe,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var jn,Mn,Nn=e((()=>{jn=t(D(),1),O(),Ue(),Ke(),Mn=k()}));function Pn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([Ae.name,Oe.name,ee.name,De.name,f.name,tt.name,ue.name,l.name,st.name])},EDIT:{name:`Edit tools`,toolNames:new Set([Te.name,g.name,Le.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Me.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Fn(e){let t=new Map;return e.forEach(e=>{if(Ne(e)){let n=Dt(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function In({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,P.useMemo)(()=>de({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[o,s]=(0,P.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,P.useState)(0),[u,d]=(0,P.useState)(!1),f=(0,P.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return o.filter(t=>e.has(t))},[o,i]),p=new Set(f),m=f.length===i.length&&i.length>0,h=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},g=(e,t)=>{s(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},_=()=>{let e=i.map(e=>e.name);n(f.length===e.length&&e.every(e=>f.includes(e))?void 0:f)},v=(0,P.useMemo)(()=>{let e=Pn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{Ne(n)?t.mcp.push(n):e.READ_ONLY.toolNames.has(n.name)?t.readOnly.push(n):e.EDIT.toolNames.has(n.name)?t.edit.push(n):e.EXECUTION.toolNames.has(n.name)?t.execution.push(n):n.name!==`Agent`&&t.other.push(n)}),t},[i]),ee=e=>{let t=xt(e,e=>p.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);g(n,t)}},y=[];y.push({id:`continue`,label:`Continue`,action:_,isContinue:!0}),y.push({id:`bucket-all`,label:`${m?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);g(e,!m)}});let b=Pn();[{id:`bucket-readonly`,name:b.READ_ONLY.name,tools:v.readOnly},{id:`bucket-edit`,name:b.EDIT.name,tools:v.edit},{id:`bucket-execution`,name:b.EXECUTION.name,tools:v.execution},{id:`bucket-mcp`,name:b.MCP.name,tools:v.mcp},{id:`bucket-other`,name:b.OTHER.name,tools:v.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=xt(n,e=>p.has(e.name))===n.length;y.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:ee(n)})});let te=y.length;y.push({id:`toggle-individual`,label:u?`Hide advanced options`:`Show advanced options`,action:()=>{d(!u),u&&c>te&&l(te)},isToggle:!0});let ne=(0,P.useMemo)(()=>Fn(i),[i]);return u&&(ne.length>0&&(y.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),ne.forEach(({serverName:e,tools:t})=>{let n=xt(t,e=>p.has(e.name))===t.length;y.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${zt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);g(e,!n)}})}),y.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=Dt(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}y.push({id:`tool-${e.name}`,label:`${p.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>h(e.name)})})),E(`confirm:no`,(0,P.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,F.jsxs)(C,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=y[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&y[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<y.length-1&&y[t]?.isHeader;)t++;l(Math.min(y.length-1,t))}},children:[(0,F.jsxs)(w,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,F.jsx)(ct,{width:40}),y.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,F.jsxs)(P.Fragment,{children:[r&&(0,F.jsx)(ct,{width:40}),i&&t>0&&(0,F.jsx)(C,{marginTop:1}),(0,F.jsxs)(w,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,F.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,F.jsx)(w,{dimColor:!0,children:m?`All tools selected`:`${p.size} of ${i.length} tools selected`})})]})}var P,F,Ln=e((()=>{i(),P=t(D(),1),kt(),$e(),me(),wt(),Ce(),We(),_e(),te(),y(),s(),ne(),le(),Ye(),ve(),pe(),Re(),at(),O(),x(),Ct(),Vt(),F=k()}));function Rn(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:Ze(At(e))}var zn=e((()=>{be(),Ot()}));function Bn({agent:e,tools:t,onSaved:n,onBack:r}){let i=m(),[o,s]=(0,I.useState)(`menu`),[c,l]=(0,I.useState)(0),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(e.color),h=(0,I.useCallback)(async()=>{let t=await rn(hn(e));t.error?d(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),g=(0,I.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??f,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!ye(e)&&!je(e)?!1:(await bn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&Be(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Ge(n),allAgents:n}}}),n(`Updated agent: ${ut.bold(e.agentType)}`),!0)}catch(e){return d(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,f,n,i]),_=(0,I.useMemo)(()=>[{label:`Open in editor`,action:h},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[h]),v=(0,I.useCallback)(()=>{d(null),o===`menu`?r():s(`menu`)},[o,r]),ee=(0,I.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),l(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),l(e=>Math.min(_.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=_[c];t&&t.action()}},[_,c]);E(`confirm:no`,v,{context:`Confirmation`});let y=()=>(0,L.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:ee,children:[(0,L.jsxs)(w,{dimColor:!0,children:[`Source: `,Rn(e.source)]}),(0,L.jsx)(C,{marginTop:1,flexDirection:`column`,children:_.map((e,t)=>(0,L.jsxs)(w,{color:t===c?`suggestion`:void 0,children:[t===c?`${a.pointer} `:` `,e.label]},e.label))}),u&&(0,L.jsx)(C,{marginTop:1,children:(0,L.jsx)(w,{color:`error`,children:u})})]});switch(o){case`menu`:return y();case`edit-tools`:return(0,L.jsx)(In,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await g({tools:e})}});case`edit-color`:return(0,L.jsx)(En,{agentName:e.agentType,currentColor:f||e.color||`automatic`,onConfirm:async e=>{p(e),s(`menu`),await g({color:e})}});case`edit-model`:return(0,L.jsx)(An,{initialModel:e.model,onComplete:async e=>{s(`menu`),await g({model:e})}});default:return null}}var I,L,Vn=e((()=>{lt(),i(),D(),I=t(D(),1),d(),O(),x(),ge(),ze(),nn(),Cn(),kn(),Nn(),Ln(),zn(),L=k()}));function Hn({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Zt();return(0,Un.jsx)(C,{marginLeft:2,children:(0,Un.jsx)(w,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Un,Wn=e((()=>{D(),Qt(),O(),Un=k()}));function Gn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:o}){let[s,c]=Kn.useState(null),[l,u]=Kn.useState(!0),d=Kn.useMemo(()=>[...t].sort(qt),[t]),f=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),p=()=>(0,R.jsxs)(C,{children:[(0,R.jsx)(w,{color:l?`suggestion`:void 0,children:l?`${a.pointer} `:` `}),(0,R.jsx)(w,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),m=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=f(e),o=t||r,c=!t&&n?`suggestion`:void 0,u=Gt(e);return(0,R.jsxs)(C,{children:[(0,R.jsx)(w,{dimColor:o&&!n,color:c,children:t?``:n?`${a.pointer} `:` `}),(0,R.jsx)(w,{dimColor:o&&!n,color:c,children:e.agentType}),u&&(0,R.jsxs)(w,{dimColor:!0,color:c,children:[` · `,u]}),e.memory&&(0,R.jsxs)(w,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,R.jsxs)(w,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Yt(i)]})]},`${e.agentType}-${e.source}`)},h=Kn.useMemo(()=>{let t=d.filter(e=>e.source!==`built-in`);return e===`all`?Xt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[d,e]);Kn.useEffect(()=>{!s&&!l&&h.length>0&&(i?u(!0):c(h[0]||null))},[h,s,l,i]);let g=e=>{if(e.key===`return`){e.preventDefault(),l&&i?i():s&&r(s);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=h.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=h.findIndex(e=>e.agentType===s.agentType&&e.source===s.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)u(!0),c(null);else{let e=t?o-1:o,n=h[e];n&&(u(!1),c(n))}},_=(e=`Built-in (always available):`)=>{let t=d.filter(e=>e.source===`built-in`);return(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,R.jsx)(w,{bold:!0,dimColor:!0,children:e}),t.map(m)]})},v=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,R.jsxs)(C,{paddingLeft:2,children:[(0,R.jsx)(w,{bold:!0,dimColor:!0,children:e}),n&&(0,R.jsxs)(w,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>m(e))]})},ee=Rn(e),y=d.filter(e=>e.source===`built-in`);return!d.length||e!==`built-in`&&!d.some(e=>e.source!==`built-in`)?(0,R.jsx)(dt,{title:ee,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,R.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,R.jsx)(C,{children:p()}),(0,R.jsx)(w,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,R.jsx)(w,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,R.jsx)(w,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&d.some(e=>e.source===`built-in`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ct,{}),_()]})]})}):(0,R.jsxs)(dt,{title:ee,subtitle:`${xt(d,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[o&&o.length>0&&(0,R.jsx)(C,{marginTop:1,children:(0,R.jsx)(w,{dimColor:!0,children:o[o.length-1]})}),(0,R.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,R.jsx)(C,{marginBottom:1,children:p()}),e===`all`?(0,R.jsxs)(R.Fragment,{children:[Xt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,R.jsx)(Kn.Fragment,{children:v(e,d.filter(e=>e.source===t))},t)),y.length>0&&(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,R.jsxs)(w,{dimColor:!0,children:[(0,R.jsx)(w,{bold:!0,children:`Built-in agents`}),` (always available)`]}),y.map(m)]})]}):e===`built-in`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(w,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,R.jsx)(C,{marginTop:1,flexDirection:`column`,children:d.map(e=>m(e))})]}):(0,R.jsxs)(R.Fragment,{children:[d.filter(e=>e.source!==`built-in`).map(e=>m(e)),d.some(e=>e.source===`built-in`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ct,{}),_()]})]})]})]})}var Kn,R,qn=e((()=>{i(),Kn=t(D(),1),O(),Kt(),Ct(),zn(),R=k()}));function Jn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,z.useState)(0),[l,u]=(0,z.useState)(t),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)([]);Zt(),(0,z.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,z.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,z.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),_=(0,z.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),v=(0,z.useCallback)(()=>{m([]),r&&r()},[r]),ee=(0,z.useCallback)(e=>{u(t=>({...t,...e}))},[]),y=(0,z.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:ee,goNext:h,goBack:g,goToStep:_,cancel:v,title:a,showStepCounter:o}),[s,e.length,l,ee,h,g,_,v,a,o]),b=e[s];return!b||d?null:(0,Yn.jsx)(Xn.Provider,{value:y,children:i||(0,Yn.jsx)(b,{})})}var z,Yn,Xn,Zn=e((()=>{z=t(D(),1),Qt(),Yn=k(),Xn=(0,z.createContext)(null)}));function B(){let e=(0,Qn.useContext)(Xn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var Qn,$n=e((()=>{Qn=t(D(),1),Zn()}));function er({instructions:e=(0,tr.jsxs)(T,{children:[(0,tr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,tr.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,tr.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Zt();return(0,tr.jsx)(C,{marginLeft:3,marginTop:1,children:(0,tr.jsx)(w,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var tr,nr=e((()=>{Qt(),O(),b(),tr=k()}));function V({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=B();return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(dt,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,rr.jsx)(er,{instructions:i})]})}var rr,H=e((()=>{O(),$n(),nr(),rr=k()})),U=e((()=>{$n(),H(),nr(),Zn()}));function ir(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();return E(`confirm:no`,t,{context:`Confirmation`}),(0,ar.jsx)(V,{subtitle:`Choose background color`,footerText:(0,ar.jsxs)(T,{children:[(0,ar.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,ar.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,ar.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,ar.jsx)(C,{children:(0,ar.jsx)(En,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var ar,or=e((()=>{O(),x(),b(),U(),H(),kn(),ar=k()}));function sr(e){return e?/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(e)?e.length<3?`Agent type must be at least 3 characters long`:e.length>50?`Agent type must be less than 50 characters`:null:`Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens`:`Agent type is required`}function cr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=sr(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${Rn(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=ie(e,t,!1);n.invalidTools.length>0&&r.push(`Invalid tools: ${n.invalidTools.join(`, `)}`)}let a=e.getSystemPrompt();return a?a.length<20?r.push(`System prompt is too short (minimum 20 characters)`):a.length>1e4&&i.push(`System prompt is very long (over 10,000 characters)`):r.push(`System prompt is required`),{isValid:r.length===0,errors:r,warnings:i}}var lr=e((()=>{me(),zn()}));function ur({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=B();E(`confirm:no`,a,{context:`Confirmation`});let s=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},l=o.finalAgent,u=cr(l,e,t),d=Lt(l.getSystemPrompt(),240),f=Lt(l.whenToUse,240),p=e=>e===void 0?`All tools`:e.length===0?`None`:e.length===1?e[0]||`None`:e.length===2?e.join(` and `):`${e.slice(0,-1).join(`, `)}, and ${e[e.length-1]}`,m=Mt()?(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Memory`}),`: `,c(l.memory)]}):null;return(0,W.jsx)(V,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(T,{children:[(0,W.jsx)(S,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(S,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Name`}),`: `,l.agentType]}),(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Location`}),`:`,` `,gn({source:o.location,agentType:l.agentType})]}),(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Tools`}),`: `,p(l.tools)]}),(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Model`}),`: `,nt(l.model)]}),m,(0,W.jsx)(C,{marginTop:1,children:(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(C,{marginLeft:2,marginTop:1,children:(0,W.jsx)(w,{children:f})}),(0,W.jsx)(C,{marginTop:1,children:(0,W.jsxs)(w,{children:[(0,W.jsx)(w,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(C,{marginLeft:2,marginTop:1,children:(0,W.jsx)(w,{children:d})}),u.warnings.length>0&&(0,W.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(w,{color:`warning`,children:`Warnings:`}),u.warnings.map((e,t)=>(0,W.jsxs)(w,{dimColor:!0,children:[` `,`• `,e]},t))]}),u.errors.length>0&&(0,W.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(w,{color:`error`,children:`Errors:`}),u.errors.map((e,t)=>(0,W.jsxs)(w,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(C,{marginTop:1,children:(0,W.jsx)(w,{color:`error`,children:i})}),(0,W.jsx)(C,{marginTop:2,children:(0,W.jsxs)(w,{color:`success`,children:[`Press `,(0,W.jsx)(w,{bold:!0,children:`s`}),` or `,(0,W.jsx)(w,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(w,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,dr=e((()=>{O(),x(),jt(),ce(),Rt(),Ue(),b(),U(),H(),Cn(),lr(),W=k()}));function fr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=B(),[i,a]=(0,pr.useState)(null),o=m(),s=(0,pr.useCallback)(async e=>{if(r?.finalAgent)try{await yn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),o(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:Ge(t),allAgents:t}}}),Qe(),e&&await rn(mn({source:r.location,agentType:r.finalAgent.agentType})),It(`tengu_agent_created`,{agent_type:r.finalAgent.agentType,generation_method:r.wasGenerated?`generated`:`manual`,source:r.location,tool_count:r.finalAgent.tools?.length??`all`,has_custom_model:!!r.finalAgent.model,has_custom_color:!!r.finalAgent.color,has_memory:!!r.finalAgent.memory,memory_scope:r.finalAgent.memory??`none`,...e?{opened_in_editor:!0}:{}}),n(e?`Created agent: ${ut.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${ut.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,mr.jsx)(ur,{tools:e,existingAgents:t,onSave:(0,pr.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,pr.useCallback)(()=>s(!0),[s]),error:i})}var pr,mr,hr=e((()=>{lt(),pr=t(D(),1),Ft(),d(),ze(),nn(),U(),Cn(),dr(),mr=k()}));function gr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B(),[i,a]=(0,_r.useState)(r.whenToUse||``),[o,s]=(0,_r.useState)(i.length),[c,l]=(0,_r.useState)(null);return E(`confirm:no`,t,{context:`Settings`}),E(`chat:externalEditor`,(0,_r.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,G.jsx)(V,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,G.jsxs)(T,{children:[(0,G.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(_,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(_,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(C,{flexDirection:`column`,children:[(0,G.jsx)(w,{children:`When should Claude use this agent?`}),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(Se,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){l(`Description is required`);return}l(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(w,{color:`error`,children:c})})]})})}var _r,G,vr=e((()=>{_r=t(D(),1),O(),x(),nn(),b(),He(),U(),H(),G=k()}));async function yr(e,t,n,r){let i=se({content:`Create an agent configuration based on this request: "${e}".${n.length>0?`\n\nIMPORTANT: The following identifiers already exist and must NOT be used: ${n.join(`, `)}`:``}
|
|
8
|
-
Return ONLY the JSON object, no other text.`}),a=await oe(),o=Ve([i],a),s=Mt()?br+xr:br,c=await et({messages:fe(o),systemPrompt:Wt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Ut(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
9
|
-
`),u;try{u=mt(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=mt(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return It(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var br,xr,Sr=e((()=>{p(),o(),Ht(),wt(),Ee(),u(),jt(),Ft(),vt(),ot(),br=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
10
|
-
|
|
11
|
-
**Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
12
|
-
|
|
13
|
-
When a user describes what they want an agent to do, you will:
|
|
14
|
-
|
|
15
|
-
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
16
|
-
|
|
17
|
-
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
18
|
-
|
|
19
|
-
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
20
|
-
- Establishes clear behavioral boundaries and operational parameters
|
|
21
|
-
- Provides specific methodologies and best practices for task execution
|
|
22
|
-
- Anticipates edge cases and provides guidance for handling them
|
|
23
|
-
- Incorporates any specific requirements or preferences mentioned by the user
|
|
24
|
-
- Defines output format expectations when relevant
|
|
25
|
-
- Aligns with project-specific coding standards and patterns from CLAUDE.md
|
|
26
|
-
|
|
27
|
-
4. **Optimize for Performance**: Include:
|
|
28
|
-
- Decision-making frameworks appropriate to the domain
|
|
29
|
-
- Quality control mechanisms and self-verification steps
|
|
30
|
-
- Efficient workflow patterns
|
|
31
|
-
- Clear escalation or fallback strategies
|
|
32
|
-
|
|
33
|
-
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
34
|
-
- Uses lowercase letters, numbers, and hyphens only
|
|
35
|
-
- Is typically 2-4 words joined by hyphens
|
|
36
|
-
- Clearly indicates the agent's primary function
|
|
37
|
-
- Is memorable and easy to type
|
|
38
|
-
- Avoids generic terms like "helper" or "assistant"
|
|
39
|
-
|
|
40
|
-
6 **Example agent descriptions**:
|
|
41
|
-
- in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
42
|
-
- examples should be of the form:
|
|
43
|
-
- <example>
|
|
44
|
-
Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
|
|
45
|
-
user: "Please write a function that checks if a number is prime"
|
|
46
|
-
assistant: "Here is the relevant function: "
|
|
47
|
-
<function call omitted for brevity only for this example>
|
|
48
|
-
<commentary>
|
|
49
|
-
Since a significant piece of code was written, use the ${St} tool to launch the test-runner agent to run the tests.
|
|
50
|
-
</commentary>
|
|
51
|
-
assistant: "Now let me use the test-runner agent to run the tests"
|
|
52
|
-
</example>
|
|
53
|
-
- <example>
|
|
54
|
-
Context: User is creating an agent to respond to the word "hello" with a friendly jok.
|
|
55
|
-
user: "Hello"
|
|
56
|
-
assistant: "I'm going to use the ${St} tool to launch the greeting-responder agent to respond with a friendly joke"
|
|
57
|
-
<commentary>
|
|
58
|
-
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
|
|
59
|
-
</commentary>
|
|
60
|
-
</example>
|
|
61
|
-
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
62
|
-
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
63
|
-
|
|
64
|
-
Your output must be a valid JSON object with exactly these fields:
|
|
65
|
-
{
|
|
66
|
-
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
|
|
67
|
-
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
68
|
-
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
Key principles for your system prompts:
|
|
72
|
-
- Be specific rather than generic - avoid vague instructions
|
|
73
|
-
- Include concrete examples when they would clarify behavior
|
|
74
|
-
- Balance comprehensiveness with clarity - every instruction should add value
|
|
75
|
-
- Ensure the agent has enough context to handle variations of the core task
|
|
76
|
-
- Make the agent proactive in seeking clarification when needed
|
|
77
|
-
- Build in quality assurance and self-correction mechanisms
|
|
78
|
-
|
|
79
|
-
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
80
|
-
`,xr=`
|
|
81
|
-
|
|
82
|
-
7. **Agent Memory Instructions**: If the user mentions "memory", "remember", "learn", "persist", or similar concepts, OR if the agent would benefit from building up knowledge across conversations (e.g., code reviewers learning patterns, architects learning codebase structure, etc.), include domain-specific memory update instructions in the systemPrompt.
|
|
83
|
-
|
|
84
|
-
Add a section like this to the systemPrompt, tailored to the agent's specific domain:
|
|
85
|
-
|
|
86
|
-
"**Update your agent memory** as you discover [domain-specific items]. This builds up institutional knowledge across conversations. Write concise notes about what you found and where.
|
|
87
|
-
|
|
88
|
-
Examples of what to record:
|
|
89
|
-
- [domain-specific item 1]
|
|
90
|
-
- [domain-specific item 2]
|
|
91
|
-
- [domain-specific item 3]"
|
|
92
|
-
|
|
93
|
-
Examples of domain-specific memory instructions:
|
|
94
|
-
- For a code-reviewer: "Update your agent memory as you discover code patterns, style conventions, common issues, and architectural decisions in this codebase."
|
|
95
|
-
- For a test-runner: "Update your agent memory as you discover test patterns, common failure modes, flaky tests, and testing best practices."
|
|
96
|
-
- For an architect: "Update your agent memory as you discover codepaths, library locations, key architectural decisions, and component relationships."
|
|
97
|
-
- For a documentation writer: "Update your agent memory as you discover documentation patterns, API structures, and terminology conventions."
|
|
98
|
-
|
|
99
|
-
The memory instructions should be specific to what the agent would naturally learn while performing its core tasks.
|
|
100
|
-
`}));function Cr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=B(),[i,a]=(0,K.useState)(r.generationPrompt||``),[o,s]=(0,K.useState)(!1),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(i.length),f=an(),p=(0,K.useRef)(null);E(`confirm:no`,(0,K.useCallback)(()=>{p.current&&(p.current.abort(),p.current=null,s(!1),l(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),E(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),d(e.content.length))},[i]),{context:`Chat`,isActive:!o}),E(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),l(null),t()},[e,t]),{context:`Settings`,isActive:!o});let m=async()=>{let t=i.trim();if(!t){l(`Please describe what the agent should do`);return}l(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=he();p.current=r;try{let i=await yr(t,f,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof _t||t instanceof Error&&!t.message.includes(`No assistant message found`)&&l(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),p.current=null}},h=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,q.jsx)(V,{subtitle:h,footerText:(0,q.jsx)(_,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(C,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(v,{}),(0,q.jsx)(w,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(V,{subtitle:h,footerText:(0,q.jsxs)(T,{children:[(0,q.jsx)(_,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(_,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(_,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(C,{flexDirection:`column`,children:[c&&(0,q.jsx)(C,{marginBottom:1,children:(0,q.jsx)(w,{color:`error`,children:c})}),(0,q.jsx)(Se,{value:i,onChange:a,onSubmit:m,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:u,onChangeCursorOffset:d,focus:!0,showCursor:!0})]})})}var K,q,wr=e((()=>{ht(),K=t(D(),1),on(),O(),x(),rt(),nn(),b(),ae(),He(),U(),H(),Sr(),q=k()}));function Tr(){let{goNext:e,updateWizardData:t,cancel:n}=B();return(0,J.jsx)(V,{subtitle:`Choose location`,footerText:(0,J.jsxs)(T,{children:[(0,J.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(C,{children:(0,J.jsx)(Pe,{options:[{label:`Project (.claude/agents/)`,value:`projectSettings`},{label:`Personal (~/.claude/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var J,Er=e((()=>{O(),b(),Ke(),U(),H(),J=k()}));function Dr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();E(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.claude/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.claude/agent-memory/)`,value:`project`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.claude/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.claude/agent-memory/)`,value:`user`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}];return(0,Y.jsx)(V,{subtitle:`Configure agent memory`,footerText:(0,Y.jsxs)(T,{children:[(0,Y.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(C,{children:(0,Y.jsx)(Pe,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:Mt()&&i&&a?()=>r.systemPrompt+`
|
|
101
|
-
|
|
102
|
-
`+h(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Or=e((()=>{O(),x(),jt(),ce(),b(),Ke(),U(),H(),Y=k()}));function kr(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=B();return(0,X.jsx)(V,{subtitle:`Creation method`,footerText:(0,X.jsxs)(T,{children:[(0,X.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(C,{children:(0,X.jsx)(Pe,{options:[{label:`Generate with Claude (recommended)`,value:`generate`},{label:`Manual configuration`,value:`manual`}],onChange:t=>{let i=t;n({method:i,wasGenerated:i===`generate`}),i===`generate`?e():r(3)},onCancel:()=>t()},`method-select`)})})}var X,Ar=e((()=>{O(),b(),Ke(),U(),H(),X=k()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();return(0,Mr.jsx)(V,{subtitle:`Select model`,footerText:(0,Mr.jsxs)(T,{children:[(0,Mr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Mr.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,Mr.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Mr.jsx)(An,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Mr,Nr=e((()=>{b(),O(),U(),H(),Nn(),Mr=k()}));function Pr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B(),[i,a]=(0,Fr.useState)(r.systemPrompt||``),[o,s]=(0,Fr.useState)(i.length),[c,l]=(0,Fr.useState)(null);return E(`confirm:no`,t,{context:`Settings`}),E(`chat:externalEditor`,(0,Fr.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(V,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(T,{children:[(0,Z.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(_,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(_,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(w,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(w,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(Se,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){l(`System prompt is required`);return}l(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(w,{color:`error`,children:c})})]})})}var Fr,Z,Ir=e((()=>{Fr=t(D(),1),O(),x(),nn(),b(),He(),U(),H(),Z=k()}));function Lr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=B(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Rr.jsx)(V,{subtitle:`Select tools`,footerText:(0,Rr.jsxs)(T,{children:[(0,Rr.jsx)(S,{shortcut:`Enter`,action:`toggle selection`}),(0,Rr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Rr.jsx)(_,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Rr.jsx)(In,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Rr,zr=e((()=>{O(),b(),U(),H(),Ln(),Rr=k()}));function Br(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=B(),[a,o]=(0,Vr.useState)(i.agentType||``),[s,c]=(0,Vr.useState)(null),[l,u]=(0,Vr.useState)(a.length);return E(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(V,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(T,{children:[(0,Q.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(_,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(C,{flexDirection:`column`,children:[(0,Q.jsx)(w,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(C,{marginTop:1,children:(0,Q.jsx)(Se,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=sr(n);if(i){c(i);return}c(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:l,onChangeCursorOffset:u,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(C,{marginTop:1,children:(0,Q.jsx)(w,{color:`error`,children:s})})]})})}var Vr,Q,Hr=e((()=>{Vr=t(D(),1),O(),x(),b(),He(),U(),H(),lr(),Q=k()}));function Ur({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Wr.jsx)(Jn,{steps:[Tr,kr,Cr,()=>(0,Wr.jsx)(Br,{existingAgents:t}),Pr,gr,()=>(0,Wr.jsx)(Lr,{tools:e}),jr,ir,...Mt()?[Dr]:[],()=>(0,Wr.jsx)(fr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Wr,Gr=e((()=>{jt(),U(),or(),hr(),vr(),wr(),Er(),Or(),Ar(),Nr(),Ir(),zr(),Hr(),Wr=k()}));function Kr({tools:e,onExit:t}){let[n,r]=(0,qr.useState)({mode:`list-agents`,source:`all`}),i=it(e=>e.agentDefinitions),a=it(e=>e.mcp.tools),o=it(e=>e.toolPermissionContext),s=m(),{allAgents:c,activeAgents:l}=i,[u,d]=(0,qr.useState)([]),f=$t(e,a,o);Zt();let p=(0,qr.useMemo)(()=>({"built-in":c.filter(e=>e.source===`built-in`),userSettings:c.filter(e=>e.source===`userSettings`),projectSettings:c.filter(e=>e.source===`projectSettings`),policySettings:c.filter(e=>e.source===`policySettings`),localSettings:c.filter(e=>e.source===`localSettings`),flagSettings:c.filter(e=>e.source===`flagSettings`),plugin:c.filter(e=>e.source===`plugin`),all:c}),[c]),h=(0,qr.useCallback)(e=>{d(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),g=(0,qr.useCallback)(async e=>{try{await xn(e),s(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Ge(n)}}}),d(t=>[...t,`Deleted agent: ${ut.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Pt(yt(e))}},[s]);switch(n.mode){case`list-agents`:{let e=Jt(n.source===`all`?[...p[`built-in`],...p.userSettings,...p.projectSettings,...p.localSettings,...p.policySettings,...p.flagSettings,...p.plugin]:p[n.source],l);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Gn,{source:n.source,agents:e,onBack:()=>{t((u.length>0?`Agent changes:\n${u.join(`
|
|
103
|
-
`)}`:void 0)??`Agents dialog dismissed`,{display:u.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:u}),(0,$.jsx)(Hn,{})]})}case`create-agent`:return(0,$.jsx)(Ur,{tools:f,existingAgents:l,onComplete:h,onCancel:()=>r({mode:`list-agents`,source:`all`})});case`agent-menu`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent,t=[{label:`View agent`,value:`view`},...e.source!==`built-in`&&e.source!==`plugin`&&e.source!==`flagSettings`?[{label:`Edit agent`,value:`edit`},{label:`Delete agent`,value:`delete`}]:[],{label:`Back`,value:`back`}];return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dt,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(C,{flexDirection:`column`,children:[(0,$.jsx)(Pe,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),u.length>0&&(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(w,{dimColor:!0,children:u[u.length-1]})})]})}),(0,$.jsx)(Hn,{})]})}case`view-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dt,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(wn,{agent:e,tools:f,allAgents:c,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Hn,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(dt,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(w,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(w,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsxs)(w,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(Pe,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?g(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(Hn,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dt,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Bn,{agent:e,tools:f,onSaved:e=>{h(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Hn,{})]})}default:return null}}var qr,$,Jr=e((()=>{lt(),D(),qr=t(D(),1),Qt(),en(),O(),d(),Kt(),ze(),bt(),Nt(),Ke(),Tn(),Vn(),Wn(),qn(),Cn(),Gr(),$=k()}));async function Yr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Xr.jsx)(Kr,{tools:Fe(n),onExit:e})}var Xr;e((()=>{D(),Jr(),qe(),Xr=k()}))();export{Yr as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{fS as t,mS as n}from"./loadAgentsDir-C7lOqvfh.js";import{g as r,u as i}from"./settings-DnptdP79.js";function a(){let e=i(),n=[`user`,`project`,`local`].flatMap(e=>t(e).errors);return{settings:e.settings,errors:[...e.errors,...n]}}var o=e((()=>{n(),r()}));export{o as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./api-nSHc_GIQ.js";t();export{e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-BsZ4sP_H.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./auth-5QB6tsfB.js";export{t as authLogin,e as authStatus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,m as r,n as i,o as a,r as o,t as s}from"./autonomy-Src6sKCp.js";r();export{s as autonomyFlowCancelHandler,i as autonomyFlowHandler,o as autonomyFlowResumeHandler,n as autonomyFlowsHandler,e as autonomyRunsHandler,a as autonomyStatusHandler,t as getAutonomyCommandText};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{Bm as r,C as i,E as a,El as ee,Gm as o,Hm as te,Im as s,Iy as ne,Jm as re,Km as c,Lm as l,Rm as u,Tl as d,Ty as f,Um as p,Vm as m,Wm as h,jy as g,qm as _,wl as ie,x as ae,zm as v}from"./loadAgentsDir-C7lOqvfh.js";import{Wt as oe,it as se}from"./state-BemZdQIl.js";import{o as ce}from"./log-CezCRpAN.js";import{s as le,u as ue}from"./types-3j8PS-Du.js";import{a as y,n as b,o as x,t as S}from"./bridgeConfig-Bb6URf4Q.js";import{i as C,o as w}from"./bg-DAPORXF3.js";import{n as T,t as E}from"./state-BAGmpVBn.js";import{join as D}from"path";import"crypto";import{readFile as O,readdir as k}from"fs/promises";import"net";import"events";function A(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function j(e){return typeof e==`string`&&B.includes(e)}function M(e){return typeof e==`string`&&V.includes(e)}function N(e){return!A(e)||typeof e.name!=`string`||!M(e.status)?null:{name:e.name,...typeof e.prompt==`string`?{prompt:e.prompt}:{},status:e.status,...typeof e.startedAt==`number`?{startedAt:e.startedAt}:{},...typeof e.completedAt==`number`?{completedAt:e.completedAt}:{}}}function P(e){if(!A(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!j(e.status)||typeof e.createdAt!=`number`||typeof e.updatedAt!=`number`||typeof e.currentStepIndex!=`number`||!Array.isArray(e.steps))return null;let t=e.steps.map(N).filter(e=>e!==null);return t.length===e.steps.length?{runId:e.runId,workflow:e.workflow,...typeof e.args==`string`?{args:e.args}:{},status:e.status,createdAt:e.createdAt,updatedAt:e.updatedAt,currentStepIndex:e.currentStepIndex,steps:t}:null}async function F(e,t){try{return P(ue(await O(D(e,R,`${t}.json`),`utf-8`),!1))}catch{return null}}async function I(e=se()){let t;try{t=await k(D(e,R))}catch{return[]}let n=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(n.slice(0,z).map(t=>F(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function L(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
|
|
2
|
-
`);let t=e.filter(e=>e.status===`running`).length,n=e.filter(e=>e.status===`completed`).length,r=e.filter(e=>e.status===`cancelled`).length,i=[`Workflow runs: ${e.length}`,` Running: ${t}`,` Completed: ${n}`,` Cancelled: ${r}`];for(let t of e.slice(0,10)){let e=t.steps[t.currentStepIndex];i.push(` ${t.runId}: ${t.workflow}: ${t.status} step=${e?.name??`none`} updated=${new Date(t.updatedAt).toLocaleString()}`)}return e.length>10&&i.push(` ... ${e.length-10} more workflow run(s)`),i.join(`
|
|
3
|
-
`)}var R,z,B,V,H=e((()=>{oe(),le(),R=D(`.claude`,`workflow-runs`),z=200,B=[`running`,`completed`,`cancelled`],V=[`pending`,`running`,`completed`,`cancelled`]}));function U(){return D(t(),`pipes`)}var de=e((()=>{n(),ce()}));function fe(){return D(U(),`registry.json`)}async function pe(){try{let e=await O(fe(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...W}}catch{return{...W}}}var W,me=e((()=>{de(),W={version:1,mainMachineId:null,main:null,subs:[]}}));async function he(){return ge(await pe())}function ge(e){let t=[`Pipe registry: ${+!!e.main} main, ${e.subs.length} sub(s)`];e.mainMachineId&&t.push(` main_machine=${e.mainMachineId.slice(0,8)}...`),e.main&&t.push(` [main] ${e.main.pipeName} pid=${e.main.pid} host=${e.main.hostname} tcp=${e.main.tcpPort??`none`}`);for(let n of e.subs.slice(0,10))t.push(` [sub-${n.subIndex}] ${n.pipeName} pid=${n.pid} host=${n.hostname} bound=${n.boundToMain??`none`} tcp=${n.tcpPort??`none`}`);return!e.main&&e.subs.length===0&&t.push(` none`),e.subs.length>10&&t.push(` ... ${e.subs.length-10} more sub pipe(s)`),t.join(`
|
|
4
|
-
`)}var _e=e((()=>{me()}));function ve(){try{let e=x(),t=S();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${b()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
|
|
5
|
-
`)}catch(e){return[`Remote Control: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
|
|
6
|
-
`)}}var ye=e((()=>{y()}));async function be(){let e=T(),t=await w(),n=[`Daemon: ${e.status}${e.state?` pid=${e.state.pid} workers=${e.state.workerKinds.join(`,`)}`:``}`,`Background sessions: ${t.length}`];for(let e of t.slice(0,8))n.push(` pid=${e.pid} kind=${e.kind} status=${e.status??`unknown`} cwd=${e.cwd}`);return t.length>8&&n.push(` ... ${t.length-8} more session(s)`),n.join(`
|
|
7
|
-
`)}function xe(){let e=!1,t=null;try{e=a(),t=ae()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
|
|
8
|
-
`)}return[`Auto mode: ${e?`available`:`unavailable`}`,` reason=${t??`none`}`].join(`
|
|
9
|
-
`)}async function G({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:xe()}),Promise.resolve({id:`runs`,title:`Runs`,content:l(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:h(t)}),I().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:L(e)})),he().then(e=>({id:`pipes`,title:`Pipes`,content:e})),be().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:ve()}),ee().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:ie(e)}))])}async function Se(e){return(await G(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
|
|
10
|
-
`)).join(`
|
|
11
|
-
|
|
12
|
-
`)}var Ce=e((()=>{E(),C(),c(),u(),i(),d(),H(),_e(),ye()}));function we(e){let[t=`status`,n,r]=e.trim().split(/\s+/,3);return t===``||t===`status`?{type:`status`,deep:n===`--deep`}:t===`runs`?{type:`runs`,limit:n}:t===`flows`?{type:`flows`,limit:n}:t===`flow`?n===`cancel`?r?{type:`flow-cancel`,flowId:r}:{type:`usage`}:n===`resume`?r?{type:`flow-resume`,flowId:r}:{type:`usage`}:n?{type:`flow-detail`,flowId:n}:{type:`usage`}:{type:`usage`}}var K,Te=e((()=>{K=`Usage: /autonomy [status [--deep]|runs [limit]|flows [limit]|flow <id>|flow cancel <id>|flow resume <id>]`}));function q(e){let t=typeof e==`number`?e:Number.parseInt(e??``,10);return!Number.isFinite(t)||t<=0?10:Math.min(t,50)}async function J(e){let t=e?.rootDir,[n,r]=await Promise.all([v(t),_(t)]);return e?.deep?Se({runs:n,flows:r}):[l(n),h(r)].join(`
|
|
13
|
-
`)}async function Ee(e,t){let[n,r]=await Promise.all([v(t?.rootDir),_(t?.rootDir)]),i=(await G({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
|
|
14
|
-
`):`Autonomy deep status section not found: ${e}`}async function De(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return s(await v(t?.rootDir),q(e))}async function Oe(e){process.stdout.write(`${await Y(e)}\n`)}async function X(e,t){return p(await _(t?.rootDir),q(e))}async function ke(e){process.stdout.write(`${await X(e)}\n`)}async function Z(e,t){return te(await o(e,t?.rootDir))}async function Ae(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await re({flowId:e,rootDir:t?.rootDir});if(!n)return`Autonomy flow not found.`;if(!n.accepted)return`Autonomy flow ${e} is already terminal (${n.flow.status}).`;let i=0;if(t?.removeQueuedInMemory){let n=ne(t=>t.autonomy?.flowId===e);i=n.length;for(let e of n)e.autonomy?.runId&&await r(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await r(e,t?.rootDir);i=n.queuedRunIds.length}return n.flow.status===`running`?`Cancellation requested for flow ${e}. The current step is still running, and no new steps will be started.`:`Cancelled flow ${e}. Removed ${i} queued step(s).`}async function je(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,t){let n=await m({flowId:e,rootDir:t?.rootDir,currentDir:t?.currentDir});if(!n)return`Autonomy flow is not waiting or was not found.`;if(t?.enqueueInMemory)return f(n),`Queued the next managed step for flow ${e}.`;let r=n.autonomy?.runId??`unknown`;return[`Prepared the next managed step for flow ${e}.`,`Run ID: ${r}`,``,`Prompt:`,typeof n.value==`string`?n.value:String(n.value)].join(`
|
|
15
|
-
`)}async function Me(e){process.stdout.write(`${await $(e)}\n`)}async function Ne(e,t){let n=we(e);switch(n.type){case`status`:return J({deep:n.deep});case`runs`:return Y(n.limit);case`flows`:return X(n.limit);case`flow-detail`:return Z(n.flowId);case`flow-cancel`:return Q(n.flowId,{removeQueuedInMemory:t?.removeQueuedInMemory});case`flow-resume`:return $(n.flowId,{enqueueInMemory:t?.enqueueInMemory});case`usage`:return K}}var Pe=e((()=>{c(),u(),Ce(),Te(),g()}));export{Oe as a,Ne as c,X as d,Y as f,$ as g,q as h,ke as i,Ee as l,Pe as m,Ae as n,De as o,J as p,Me as r,Q as s,je as t,Z as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Km as n,ld as r,od as i,qm as a}from"./loadAgentsDir-C7lOqvfh.js";import{I as o,P as s,fi as c,hn as l,t as u,y as d}from"./src-P_wYS_NJ2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{c as p,l as m,m as h,p as g}from"./autonomy-Src6sKCp.js";function _(){return S}function v({onDone:e}){r(`autonomy-panel`);let[t,n]=(0,b.useState)(0),[i,c]=(0,b.useState)([]);(0,b.useEffect)(()=>{let e=!1;return a().then(t=>{e||c(t.slice(0,5))}),()=>{e=!0}},[]);let u=(0,b.useMemo)(()=>{let e=[{label:`Overview`,description:`Show run and flow counts plus the latest automatic activity`,run:()=>g()},{label:`Full deep status`,description:`Print every local autonomy surface in one diagnostic report`,run:()=>g({deep:!0})},{label:`Auto mode`,description:`Check whether auto permission mode is available and why`,run:()=>m(`auto-mode`)},{label:`Runs summary`,description:`Show queued/running/completed/failed run totals and latest run`,run:()=>m(`runs`)},{label:`Recent runs`,description:`List recent autonomy run IDs, triggers, statuses, and prompts`,run:()=>p(`runs 10`)},{label:`Flows summary`,description:`Show managed flow totals across queued/running/waiting states`,run:()=>m(`flows`)},{label:`Recent flows`,description:`List recent managed flow IDs, status, current step, and goal`,run:()=>p(`flows 10`)},{label:`Workflow runs`,description:`Show persisted WorkflowTool runs and their current workflow step`,run:()=>m(`workflow-runs`)},{label:`Pipes`,description:`Show UDS/named-pipe and LAN registry for terminal messaging`,run:()=>m(`pipes`)},{label:`Runtime`,description:`Show daemon state and live background or interactive sessions`,run:()=>m(`runtime`)},{label:`Remote Control`,description:`Show bridge mode, base URL, token presence, and entitlement note`,run:()=>m(`remote-control`)},{label:`RemoteTrigger`,description:`Show recent remote trigger audit records, failures, and latest call`,run:()=>m(`remote-trigger`)}],t=i.flatMap(e=>{let t=e.flowId.slice(0,8),n=[{label:`Flow ${t}`,description:`${e.status}: ${e.goal}`,run:()=>p(`flow ${e.flowId}`)}];return e.status===`waiting`&&n.push({label:`Resume ${t}`,description:e.currentStep?`Resume waiting step: ${e.currentStep}`:`Resume waiting flow`,run:()=>p(`flow resume ${e.flowId}`,{enqueueInMemory:!0})}),(e.status===`queued`||e.status===`running`||e.status===`waiting`||e.status===`blocked`)&&n.push({label:`Cancel ${t}`,description:`Cancel ${e.status} flow`,run:()=>p(`flow cancel ${e.flowId}`,{removeQueuedInMemory:!0})}),n});return[...e,...t]},[i]),f=()=>{let n=u[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(u.length-1,e+1));return}t.return&&f()}),(0,x.jsx)(d,{title:`Autonomy`,subtitle:`${u.length} actions`,onCancel:()=>e(`Autonomy panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,x.jsxs)(o,{flexDirection:`column`,children:[u.map((e,n)=>(0,x.jsxs)(o,{flexDirection:`row`,children:[(0,x.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(C)}),(0,x.jsx)(s,{dimColor:!0,children:e.description})]},`${e.label}-${n}`)),(0,x.jsx)(o,{marginTop:1,children:(0,x.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function y(e,t,n){let r=n?.trim()??``;return r?(e(await p(r,{enqueueInMemory:!0,removeQueuedInMemory:!0}),{display:`system`}),null):(0,x.jsx)(v,{onDone:e})}var b,x,S,C;e((()=>{b=t(c(),1),u(),i(),h(),n(),x=f(),S=14,C=24}))();export{y as call,_ as getAutonomyPanelBaseActionCountForTests};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{$ as r,Ba as i,Cr as a,Da as o,Nc as s,Oa as ee,Pc as c,Ta as te,Tt as l,Ud as u,Wd as ne,_x as re,aw as d,bm as f,fr as p,lp as m,mt as h,rw as g,sp as ie,tt as ae,vx as oe,yv as _}from"./loadAgentsDir-C7lOqvfh.js";import{R as v,W as y,Wt as b}from"./state-BemZdQIl.js";import{n as x,t as S}from"./cwd-Cfdf7z7s.js";import{S as C,W as w,a as T,d as E,l as D,p as O,z as k}from"./debug-RAynG_nM.js";import{f as A,g as j,y as M}from"./settings-DnptdP79.js";import{S as N}from"./config-Do1870_d.js";import{o as P,s as F,v as I,y as L}from"./log-CezCRpAN.js";import{n as R,r as z}from"./analytics-DJobLaWP.js";import{_ as B,h as V}from"./model-BsZ4sP_H.js";import{bn as H,yn as U}from"./prompt-M2lu8_Oa.js";import{at as W}from"./sessionState-Bifmu95-.js";import{i as se,t as G}from"./nativeInstaller-QB8cEJ18.js";import{n as K,t as ce}from"./allErrors-CU89tF-z.js";import{r as le}from"./magicDocs-BpVcON9o.js";import{n as ue,t as de}from"./pluginAutoupdate-SlRFJlTT.js";import{n as fe,r as pe}from"./registerProtocol-CsNYRZKr.js";import"os";import{join as q}from"path";import"crypto";n(),b(),x(),C(),O(),T(),L(),j(),H(),B(),c(),a(),le(),r(),P(),k(),i(),_(),r(),oe(),k(),P(),i(),_(),f();async function me(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(S(),`.claude`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{F(Error(`Failed to read skill file for improvement: ${i}`));return}let s=t.map(e=>`- ${e.section}: ${e.change}`).join(`
|
|
2
|
-
`),c=V(),l=await ae({messages:[te({content:`You are editing a skill definition file. Apply the following improvements to the skill.
|
|
3
|
-
|
|
4
|
-
<current_skill_file>
|
|
5
|
-
${a}
|
|
6
|
-
</current_skill_file>
|
|
7
|
-
|
|
8
|
-
<improvements>
|
|
9
|
-
${s}
|
|
10
|
-
</improvements>
|
|
11
|
-
|
|
12
|
-
Rules:
|
|
13
|
-
- Integrate the improvements naturally into the existing structure
|
|
14
|
-
- Preserve frontmatter (--- block) exactly as-is
|
|
15
|
-
- Preserve the overall format and style
|
|
16
|
-
- Do not remove existing content unless an improvement explicitly replaces it
|
|
17
|
-
- Output the complete updated file inside <updated_file> tags`})],systemPrompt:W([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:re().signal,options:{getToolPermissionContext:async()=>U(),model:c,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),u=o(ee(Array.isArray(l.message.content)?l.message.content:[]).trim(),`updated_file`);if(!u){F(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,u,`utf-8`)}catch(e){F(w(e))}}R(),m(),N(),P(),G(),ne(),K(),d(),l();var he=30;function J(){let e=((A()||{}).cleanupPeriodDays??he)*24*60*60*1e3;return new Date(Date.now()-e)}function ge(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function _e(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function Y(e,t,n){let r={messages:0,errors:0};try{let i=await E().readdir(e);for(let a of i)try{_e(a.name)<t&&(await E().unlink(q(e,a.name)),n?r.messages++:r.errors++)}catch(e){F(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return r}async function ve(){let e=E(),t=J(),n=I.errors(),r=I.baseLogs(),i=await Y(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>q(r,e.name));for(let n of a)i=ge(i,await Y(n,t,!0)),await Z(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return i}async function X(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Z(e,t){try{await t.rmdir(e)}catch{}}async function ye(){let e=J(),t={messages:0,errors:0},n=p(),r=E(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=q(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=q(i,n.name),o=q(a,g),s;try{s=await r.readdir(o)}catch{await Z(a,r);continue}for(let n of s)if(n.isFile())try{await X(q(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=q(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Z(i,r)}await Z(o,r),await Z(a,r)}await Z(i,r)}return t}async function be(e,t,n=!0){let r=J(),i={messages:0,errors:0},a=E(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await X(q(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Z(e,a),i}function xe(){return be(q(t(),`plans`),`.md`)}async function Se(){let e=J(),n={messages:0,errors:0},r=E();try{let i=q(t(),`file-history`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));await Promise.all(o.map(async t=>{try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}})),await Z(i,r)}catch(e){F(e)}return n}async function Ce(){let e=J(),n={messages:0,errors:0},r=E();try{let i=q(t(),`session-env`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));for(let t of o)try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}await Z(i,r)}catch(e){F(e)}return n}async function we(){let e=J(),n={messages:0,errors:0},r=E(),i=q(t(),`debug`),a;try{a=await r.readdir(i)}catch{return n}for(let t of a)if(!(!t.isFile()||!t.name.endsWith(`.txt`)||t.name===`latest`))try{await X(q(i,t.name),e,r)&&n.messages++}catch{n.errors++}return n}async function Q(){let{errors:e}=ce();if(e.length>0&&M(`cleanupPeriodDays`)){D(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await ve(),await ye(),await xe(),await Se(),await Ce(),await we(),await ie(),await u(J());let t=await h(J());t>0&&z(`tengu_worktree_cleanup`,{removed:t})}b(),G(),ue();var Te=(fe(),e(pe)),$=600*1e3;function Ee(){import(`./extractMemories-CUrdiNcr.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),s(),de(),v()&&Te.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(v()&&y()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Q()),v()&&y()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await se()}setTimeout(t,$).unref()}export{me as n,Ee as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping-B-cw0UcS.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,r,s as i,t as a}from"./bg-DAPORXF3.js";n();export{a as attachHandler,r as handleBgStart,e as killHandler,i as logsHandler,t as psHandler};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{C as r,S as i}from"./debug-RAynG_nM.js";import{a,i as o}from"./genericProcessUtils-CmsUPyRz.js";import{join as s}from"path";import{randomUUID as c}from"crypto";import{readFile as l,readdir as u,unlink as d}from"fs/promises";async function f(){if(process.platform===`win32`){let{DetachedEngine:e}=await import(`./detached-X_yjYR7x.js`);return new e}let{TmuxEngine:e}=await import(`./tmux-DewYVEBm.js`),t=new e;if(await t.available())return t;let{DetachedEngine:n}=await import(`./detached-X_yjYR7x.js`);return new n}var p=e((()=>{}));function m(){return s(t(),`sessions`)}async function h(){let e=m(),t;try{t=await u(e)}catch{return[]}let n=[];for(let i of t)if(/^\d+\.json$/.test(i)){if(!a(parseInt(i.slice(0,-5),10))){d(s(e,i)).catch(()=>{});continue}try{let t=r(await l(s(e,i),`utf-8`));n.push(t)}catch{}}return n}function g(e,t){let n=parseInt(t,10);return e.find(e=>e.sessionId===t||e.pid===n||e.name&&e.name===t)}function _(e){return new Date(e).toLocaleString()}function v(e){return e.engine?e.engine:e.tmuxSessionName?`tmux`:`detached`}async function y(e){let t=await h();if(t.length===0){console.log(`No active sessions.`);return}console.log(`${t.length} active session${t.length>1?`s`:``}:\n`);for(let e of t){let t=v(e),n=[` PID: ${e.pid}`,` Kind: ${e.kind}`,` Engine: ${t}`,` Session: ${e.sessionId}`,` CWD: ${e.cwd}`];e.name&&n.push(` Name: ${e.name}`),e.startedAt&&n.push(` Started: ${_(e.startedAt)}`),e.status&&n.push(` Status: ${e.status}`),e.waitingFor&&n.push(` Waiting for: ${e.waitingFor}`),e.bridgeSessionId&&n.push(` Bridge: ${e.bridgeSessionId}`),e.tmuxSessionName&&n.push(` Tmux: ${e.tmuxSessionName}`),e.logPath&&n.push(` Log: ${e.logPath}`),console.log(n.join(`
|
|
2
|
-
`)),console.log()}}async function b(e){let t=await h();if(!e){if(t.length===0){console.log(`No active sessions.`);return}if(t.length===1)e=t[0].sessionId;else{console.log(`Multiple sessions active. Specify one:`);for(let e of t){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId;console.log(` ${t} PID=${e.pid}`)}return}}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}if(!n.logPath){console.log(`No log path recorded for session ${n.sessionId}`);return}try{let e=await l(n.logPath,`utf-8`);process.stdout.write(e)}catch(e){console.error(`Failed to read log file: ${n.logPath}`),console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}async function x(e){let t=await h();if(!e){let n=t.filter(e=>e.tmuxSessionName||e.engine===`detached`);if(n.length===0){console.log("No background sessions to attach to. Start one with `claude daemon bg`.");return}if(n.length===1)e=n[0].sessionId;else{console.log(`Multiple background sessions. Specify one:`);for(let e of n){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId,n=v(e);console.log(` ${t} PID=${e.pid} engine=${n}`)}return}}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}let r=v(n);try{if(r===`tmux`){let{TmuxEngine:e}=await import(`./tmux-DewYVEBm.js`),t=new e;if(!await t.available()){console.error(`tmux is no longer available. Cannot attach to tmux session.`),process.exitCode=1;return}await t.attach(n)}else{let{DetachedEngine:e}=await import(`./detached-X_yjYR7x.js`);await new e().attach(n)}}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}async function S(e){let t=await h();if(!e){if(t.length===0){console.log(`No active sessions to kill.`);return}console.log(`Specify a session to kill:`);for(let e of t){let t=e.name?`${e.name} (${e.sessionId})`:e.sessionId;console.log(` ${t} PID=${e.pid}`)}return}let n=g(t,e);if(!n){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(`Killing session ${n.sessionId} (PID: ${n.pid})...`);try{process.kill(n.pid,`SIGTERM`)}catch{console.log(`Session already exited.`);return}if(await new Promise(e=>setTimeout(e,2e3)),a(n.pid))try{process.kill(n.pid,`SIGKILL`),console.log(`Session force-killed.`)}catch{console.log(`Session exited during grace period.`)}else console.log(`Session stopped.`);d(s(m(),`${n.pid}.json`)).catch(()=>{})}async function C(e){let n=await f(),r=e.filter(e=>e!==`--bg`&&e!==`--background`);if(!n.supportsInteractiveInput&&!r.some(e=>e===`-p`||e===`--print`||e===`--pipe`)){console.error(`Error: Background sessions with detached engine require -p/--print flag.
|
|
3
|
-
The detached engine has no terminal for interactive input.
|
|
4
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
claude daemon bg -p "your prompt here"
|
|
7
|
-
echo "prompt" | claude daemon bg --pipe`),process.platform!==`win32`&&console.error(`
|
|
8
|
-
Alternatively, install tmux for interactive background sessions:
|
|
9
|
-
${process.platform===`darwin`?`brew install tmux`:`sudo apt install tmux`}`),process.exitCode=1;return}let i=`claude-bg-${c().slice(0,8)}`,a=s(t(),`sessions`,`logs`,`${i}.log`);try{let e=await n.start({sessionName:i,args:r,env:{...process.env},logPath:a,cwd:process.cwd()});console.log(`Background session started: ${e.sessionName}`),console.log(` Engine: ${e.engineUsed}`),console.log(` Log: ${e.logPath}`),console.log(),console.log(`Use \`claude daemon attach ${e.sessionName}\` to reconnect.`),console.log("Use `claude daemon status` to check status."),console.log(`Use \`claude daemon kill ${e.sessionName}\` to stop.`)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1}}var w=e((()=>{n(),o(),i(),p()}));export{S as a,y as c,w as i,g as n,h as o,C as r,b as s,x as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,t as r}from"./bridgeConfig-Bb6URf4Q.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Ai as n,Au as r,Bi as i,Cv as a,Ev as o,J as s,Jv as c,Kh as l,Ms as u,Ns as d,Sv as f,Tb as p,Tv as m,X as h,Xv as g,Yi as _,bv as v,cp as y,hm as b,hw as x,ih as S,ju as C,lp as w,mw as T,oh as E,qh as D,wb as O,wv as k,xv as A}from"./loadAgentsDir-C7lOqvfh.js";import{On as j,Wt as M,l as N}from"./state-BemZdQIl.js";import{S as P,v as F}from"./git-2c7WlGDL.js";import{i as I,t as L}from"./detectRepository-DgpNd87p.js";import{a as R,n as z}from"./fileSuggestions-BMfQIDdW.js";import{r as B,t as V}from"./magicDocs-BpVcON9o.js";function H(e=new Set){let t=e.size>0;f.cache.clear?.(),A.cache.clear?.(),v.cache.clear?.(),m.cache.clear?.(),z(),n(),t||g(),k(null),j(null),E(),d(),p(`session_start`),y(),r(),import(`./attributionHooks-CUAoGkU6.js`).then(({clearAttributionCaches:e})=>e()),L(),s(),N(e),F(),_(),D(),V(),T(),import(`./SearchExtraToolsTool-i_YO3QvV.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-zikjxLvn.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-DZhBz_Vu.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),i(),o(),a(),R(),b(),c(),C(),S(),l(),B(),t(),u(),h(),O(),I(),P(),w(),x()}));export{U as n,H as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-BTQAW9zc.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{F as n,I as r,S as i,a,l as o,w as s,z as c}from"./debug-RAynG_nM.js";import{O as l,k as u}from"./git-2c7WlGDL.js";import{_n as d,vn as f}from"./model-BsZ4sP_H.js";import{l as p,r as m}from"./proxy-CuMaO_YV.js";import{n as h,t as g}from"./userAgent-CIq27vUR.js";import{A as _,O as v,f as y,g as b,k as x,u as S}from"./sessionState-Bifmu95-.js";import{n as C}from"./jwtUtils-CUPXdX3W.js";import{randomUUID as w}from"crypto";c(),a(),l(),p(),h(),d(),_(),S(),i(),e();var T=class extends Error{constructor(e,n){super(e),t(this,`retryAfterMs`,void 0),this.retryAfterMs=n}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(s(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await f(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}d(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),t(this,`reason`,void 0),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,m({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??v,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),y(()=>{this.writeEvent({type:`keep_alive`})}),o(`CCRClient: initialized, epoch=${this.workerEpoch}`),u(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||u(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,i,a,{timeout:s=1e4}={}){let c=this.getAuthHeaders();if(Object.keys(c).length===0)return{ok:!1};try{let n=await this.http[e](`${this.sessionBaseUrl}${t}`,i,{headers:{...c,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:s});if(n.status>=200&&n.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(n.status===409&&this.handleEpochMismatch(),n.status===401||n.status===403){let e=x(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(o(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),u(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(o(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),u(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(o(`CCRClient: ${a} returned ${n.status}`,{level:`warn`}),u(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:n.status}),n.status===429){let e=n.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(i){return o(`CCRClient: ${a} failed: ${n(i)}`,{level:`warn`}),u(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:r(i)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){o(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),u(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&o(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return o(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,r){for(let r=1;r<=10;r++){let i;try{i=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:3e4})}catch(t){o(`CCRClient: GET ${e} failed (attempt ${r}/10): ${n(t)}`,{level:`warn`}),r<10&&await f(Math.min(500*2**(r-1),3e4)+Math.random()*500);continue}if(i.status>=200&&i.status<300)return i.data;i.status===409&&this.handleEpochMismatch(),o(`CCRClient: GET ${e} returned ${i.status} (attempt ${r}/10)`,{level:`warn`}),r<10&&await f(Math.min(500*2**(r-1),3e4)+Math.random()*500)}return o(`CCRClient: GET retries exhausted`,{level:`error`}),u(`error`,`cli_worker_get_retries_exhausted`,{context:r}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),b(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./bundledMode--fG1S62b.js";import{i as r,r as i}from"./shellQuote-BYeOv3Ip.js";import{spawn as a}from"child_process";function o(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i===`-d`||i.startsWith(`-d `)||i.startsWith(`-d `)){n.push(i),i===`-d`&&r+1<e.length&&n.push(e[++r]);continue}if(i.startsWith(`-d`)&&i.includes(`:`)){n.push(i);continue}if(i===`--feature`){n.push(i),r+1<e.length&&n.push(e[++r]);continue}if(/^--inspect(-brk)?(=|$)/.test(i)){n.push(i);continue}if(i.startsWith(`--`)&&!i.includes(`=`)&&r+1<e.length){if(t())continue;n.push(i),n.push(e[++r]);continue}i.startsWith(`-`)&&!t()&&n.push(i)}return n}function s(e,n){let r=n?.env??process.env,i=t()||!p?[...f,...e]:[...f,p,...e],a={...r};return h&&(process.env.CLAUDE_CODE_GIT_BASH_PATH&&!a.CLAUDE_CODE_GIT_BASH_PATH&&(a.CLAUDE_CODE_GIT_BASH_PATH=process.env.CLAUDE_CODE_GIT_BASH_PATH),process.env.SHELL&&!a.SHELL&&(a.SHELL=process.env.SHELL)),{execPath:m,args:i,env:a,windowsHide:h}}function c(e,t){return a(e.execPath,e.args,{...t,env:{...e.env,...t.env},windowsHide:e.windowsHide})}function l(e){return r([e.execPath,...e.args])}function u(){return f}function d(){return p}var f,p,m,h,g=e((()=>{n(),i(),f=Object.freeze(o(process.execArgv)),p=process.argv[1],m=process.execPath,h=process.platform===`win32`}));export{l as a,g as i,u as n,c as o,d as r,s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fr as e,Pr as t}from"./model-BsZ4sP_H.js";e();export{t as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./client-DFlE4fYh.js";e();export{t as clearOpenAIClientCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ai as e,Bi as t,Fi as n}from"./loadAgentsDir-C7lOqvfh.js";t();export{e as clearCommandsCache,n as getCommands};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ba as t,Bv as n,Cv as r,Dp as i,Dv as a,Ep as o,I_ as s,Jv as c,Kv as l,L_ as u,Ma as d,Mv as f,N_ as p,Ov as m,P_ as h,QC as g,Qm as _,Sv as v,Yv as y,ZC as b,_v as x,ct as S,eh as C,ih as w,jv as T,lt as E,oh as D,vn as O,vv as k,xv as A}from"./loadAgentsDir-C7lOqvfh.js";import{di as j,ui as M}from"./src-P_wYS_NJ2.js";import{Wt as N,qt as P}from"./state-BemZdQIl.js";import{R as F,z as I}from"./debug-RAynG_nM.js";import{o as L,s as R}from"./log-CezCRpAN.js";function z(e,t){let n=o(`tip`),r=b(`app:toggleTranscript`,`Global`,`ctrl+o`),i=[...e.options.verbose?[]:[`(${r} to see full summary)`],...t?[t]:[],...n?[n]:[]];return M.dim(`Compacted `+i.join(`
|
|
2
|
-
`))}async function B(e,t){let n=e.getAppState(),r=await S(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=x({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([v(),A()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{j(),N(),E(),r(),g(),c(),u(),T(),a(),w(),_(),n(),I(),O(),L(),t(),i(),k(),V=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=d(r),r.length===0)throw Error(`No messages to compact`);let i=e.trim();try{if(!i){let e=await C(r,t.agentId);if(e)return v.cache.clear?.(),D(),y(t.options.querySource??`compact`,t.agentId),P(),f(),{type:`compact`,compactionResult:e,displayText:z(t)}}let e=(await m(r,t)).messages,n=await s(e,t,await B(t,e),!1,i,!1);return l(void 0),f(),v.cache.clear?.(),D(),{type:`compact`,compactionResult:n,displayText:z(t,n.userDisplayMessage)}}catch(e){throw n.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(h):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(p):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
|