@readmagic/workmate 0.0.13 → 0.0.15
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-DcVnvL_u.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-0Qdg3Rh7.js +1 -0
- package/dist/chunks/{AgentsMdExternalIncludesDialog-CH9x1Ngp.js → AgentsMdExternalIncludesDialog-D6DopTxc.js} +1 -1
- package/dist/chunks/App-BoI5EJry.js +1 -0
- package/dist/chunks/ApproveApiKey-BjlQDcMx.js +1 -0
- package/dist/chunks/ApproveApiKey-PWFcscjY.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-ClSMkcGp.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-KCZv-PXl.js +1 -0
- package/dist/chunks/DiffDialog-BGBkuVIn.js +6 -0
- package/dist/chunks/Doctor-CI04juFO.js +3 -0
- package/dist/chunks/Doctor-DCrqcW68.js +1 -0
- package/dist/chunks/ExitFlow-qrCDVA9i.js +2 -0
- package/dist/chunks/Grove-B-M3DWD3.js +11 -0
- package/dist/chunks/{HybridTransport-BQNLZNa_.js → HybridTransport-n5jji6SI.js} +2 -4
- package/dist/chunks/InvalidConfigDialog-By-j6fHE.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-C_reeMzL.js +1 -0
- package/dist/chunks/MCPConnectionManager-BNG7iSlw.js +1 -0
- package/dist/chunks/MCPToolListView-jw0tITfc.js +1 -0
- package/dist/chunks/{McpParsingWarnings-CUx2zexI.js → McpParsingWarnings-BeZ3Bn8N.js} +1 -1
- package/dist/chunks/MessageSelector-Ci6N-gCw.js +3 -0
- package/dist/chunks/Messages-D6CRTH2m.js +10 -0
- package/dist/chunks/{Onboarding-t-P6Q5O6.js → Onboarding-DDkVEq-G.js} +1 -1
- package/dist/chunks/PermissionDialog-BPhvs5xH.js +1 -0
- package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +1 -0
- package/dist/chunks/{PromptInputFooterSuggestions-R12fbdmp.js → PromptInputFooterSuggestions-BlhZuQ5F.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-kKyPIMau.js +1 -0
- package/dist/chunks/QueryEngine-DXpS0Ytq.js +1 -0
- package/dist/chunks/REPL-D1BCm7cR.js +128 -0
- package/dist/chunks/REPL-JQgCrSEv.js +1 -0
- package/dist/chunks/RemoteSessionManager-mWVrdNfS.js +2 -0
- package/dist/chunks/ResumeConversation-BzTn_1jS.js +1 -0
- package/dist/chunks/SSETransport-D86IVNn1.js +2 -0
- package/dist/chunks/{SearchBox-C9vUA4IM.js → SearchBox-CwwV0W-w.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-BXIja1MR.js +1 -0
- package/dist/chunks/Settings-D_i8HzEW.js +2 -0
- package/dist/chunks/{TeleportProgress-3hmIApkj.js → TeleportProgress-CW8mLRy2.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-BA1a66RK.js → TeleportRepoMismatchDialog-DZD32R-l.js} +1 -1
- package/dist/chunks/TeleportResumeWrapper-BhuUE1aq.js +1 -0
- package/dist/chunks/ThemePicker-ByQZgIbH.js +1 -0
- package/dist/chunks/{TrustDialog-Dpk03V1Y.js → TrustDialog-BzwibD_8.js} +1 -1
- package/dist/chunks/ValidationErrorsList-Cuq6W2yc.js +2 -0
- package/dist/chunks/add-dir-BQ-ljgk6.js +1 -0
- package/dist/chunks/{agentDisplay-D7bdOOG7.js → agentDisplay-tRprY4gB.js} +1 -1
- package/dist/chunks/agents-DMyQUXwl.js +101 -0
- package/dist/chunks/{agents-22wiC58F.js → agents-Dq4BCf0H.js} +1 -1
- package/dist/chunks/allErrors-CQWZ6BPw.js +1 -0
- package/dist/chunks/{api-f3GN2I_J.js → api-ClAyS7cQ.js} +1 -1
- package/dist/chunks/api-CpD5jeKe.js +1 -0
- package/dist/chunks/attributionHooks-C0aXyx9L.js +1 -0
- package/dist/chunks/{auth-Czy7GoRh.js → auth-CWAvPfX7.js} +7 -12
- package/dist/chunks/auth-DG5bkWDc.js +1 -0
- package/dist/chunks/auth-DuHfQBuH.js +1 -0
- package/dist/chunks/backgroundHousekeeping-kf_v7Vfr.js +1 -0
- package/dist/chunks/backgroundHousekeeping-rzQFJiND.js +17 -0
- package/dist/chunks/{banner-BcAM7iSx.js → banner-HfMnBd03.js} +2 -2
- package/dist/chunks/{bg-Ci7pG4eo.js → bg-DltfF1_K.js} +2 -2
- package/dist/chunks/branch-BWbCrXBJ.js +2 -0
- package/dist/chunks/{break-cache-4rlQORVk.js → break-cache-Cd1yQ-0h.js} +2 -3
- package/dist/chunks/bridgeConfig-CABsoOum.js +1 -0
- package/dist/chunks/{bridgeConfig-B80T_lw7.js → bridgeConfig-CPHAyzdg.js} +1 -1
- package/dist/chunks/{bridgeMessaging-DyvHd16Z.js → bridgeMessaging-vR7uQXB9.js} +1 -1
- package/dist/chunks/{bridgePointer-DHWK3LEe.js → bridgePointer-CiHy2tTN.js} +1 -1
- package/dist/chunks/bridgeStatusUtil-CHTx7XwJ.js +1 -0
- package/dist/chunks/btw-IGcgP-Qq.js +1 -0
- package/dist/chunks/caches-Dj1YhqrG.js +1 -0
- package/dist/chunks/caches-FP8mGB4k.js +1 -0
- package/dist/chunks/{capacityWake-ByL6fM6I.js → capacityWake-LRiPhPeM.js} +1 -1
- package/dist/chunks/{ccrClient-BALhzhPF.js → ccrClient--8aPutWE.js} +1 -1
- package/dist/chunks/claudeDesktop-CB3UCt7U.js +1 -0
- package/dist/chunks/{clear-B_yVyJXP.js → clear-CF-FZwpe.js} +1 -1
- package/dist/chunks/{cliLaunch-OPOtzhvA.js → cliLaunch-xIVvtPZy.js} +1 -1
- package/dist/chunks/{client-BMA05FW8.js → client-B7WkO81L.js} +1 -1
- package/dist/chunks/client-BCzhAEd0.js +1 -0
- package/dist/chunks/client-BU7upHOb.js +1 -0
- package/dist/chunks/commands-Cr1p7OPH.js +1 -0
- package/dist/chunks/compact-BrJGpEFZ.js +2 -0
- package/dist/chunks/{config-9rLTDOYW.js → config-BSkuQZNf.js} +1 -1
- package/dist/chunks/config-BohF3_IV.js +1 -0
- package/dist/chunks/{config-DMKtiMzJ.js → config-D78R57VA.js} +1 -1
- package/dist/chunks/context-DADnwl4t.js +1 -0
- package/dist/chunks/context-noninteractive-BAbzwNxu.js +1 -0
- package/dist/chunks/{context-noninteractive-CHzerxnH.js → context-noninteractive-kACWzgS1.js} +2 -2
- package/dist/chunks/conversation-C8w1DtXk.js +1 -0
- package/dist/chunks/conversation-Ds7zRD0x.js +1 -0
- package/dist/chunks/{createSSHSession-XkHMiGRN.js → createSSHSession-B71Plec6.js} +3 -4
- package/dist/chunks/{createSession-BNGm9fL4.js → createSession-BJeDECzt.js} +1 -1
- package/dist/chunks/createSession-Bozo4Bu8.js +1 -0
- package/dist/chunks/crossProjectResume-B1I6YzXr.js +40 -0
- package/dist/chunks/{datadog-3WUWcCFn.js → datadog-C9uqPA6N.js} +1 -1
- package/dist/chunks/{debug-Dr1SjdXn.js → debug-BQj6h99Q.js} +1 -1
- package/dist/chunks/debugUtils-B86DM1Sp.js +1 -0
- package/dist/chunks/{detached-CqfQYVOi.js → detached--wGwkuHX.js} +1 -2
- package/dist/chunks/{detectRepository-CMEkS5_2.js → detectRepository-Qy3zKoyn.js} +1 -1
- package/dist/chunks/detectRepository-tRUoPOKy.js +1 -0
- package/dist/chunks/{diff-CKlLimGq.js → diff-CzChvQyK.js} +1 -1
- package/dist/chunks/directoryCompletion-i2oWpaUe.js +1 -0
- package/dist/chunks/doctor-DdvdGkNX.js +1 -0
- package/dist/chunks/{entry-DCbq734V.js → entry-BoL8sy1Y.js} +5 -6
- package/dist/chunks/esm-DtcV71xh.js +1 -0
- package/dist/chunks/{execFileNoThrow-mXq4K0rl.js → execFileNoThrow-DYm1GeGn.js} +1 -1
- package/dist/chunks/{execSyncWrapper-Ne33rRiD.js → execSyncWrapper-CqvQqke-.js} +1 -1
- package/dist/chunks/exit-Af27f74w.js +1 -0
- package/dist/chunks/exit-s9XGerrH.js +1 -0
- package/dist/chunks/{extraUsage-C86bZVgt.js → extraUsage-DsFwXMAj.js} +1 -1
- package/dist/chunks/extractMemories-B1KbTMY0.js +1 -0
- package/dist/chunks/fast-BGU8p2uY.js +1 -0
- package/dist/chunks/fast-CuUjONVV.js +1 -0
- package/dist/chunks/{fileSuggestions-BalHmi1-.js → fileSuggestions-DU7gmksK.js} +2 -2
- package/dist/chunks/{firstPartyEventLogger-1RTgXHSz.js → firstPartyEventLogger-7pAyUdbp.js} +3 -5
- package/dist/chunks/firstPartyEventLogger-sMeCTEUW.js +1 -0
- package/dist/chunks/flushGate-4DfYr-Ru.js +1 -0
- package/dist/chunks/{fpsMetrics-DffAomdg.js → fpsMetrics-Dk_pnSHJ.js} +1 -1
- package/dist/chunks/gemini-Cll4fVQn.js +1 -0
- package/dist/chunks/generateSessionName-BgGMwpps.js +1 -0
- package/dist/chunks/{genericProcessUtils-Dc1pfb7J.js → genericProcessUtils-Bbcbi11g.js} +1 -1
- package/dist/chunks/git-BaSq69E7.js +1 -0
- package/dist/chunks/{git-CoQQ6YEf.js → git-DplvjXEY.js} +2 -3
- package/dist/chunks/{githubRepoPathMapping-CmpEaQoo.js → githubRepoPathMapping-Px3_GeD1.js} +1 -1
- package/dist/chunks/goal-D4E2WQVn.js +3 -0
- package/dist/chunks/grok-HF1PHxXb.js +1 -0
- package/dist/chunks/{grove-b9gGKgu4.js → grove-Bck1zFaD.js} +2 -2
- package/dist/chunks/help-DJp61Job.js +1 -0
- package/dist/chunks/{hooks-C-QMGvCg.js → hooks-CJ17byYD.js} +7 -7
- package/dist/chunks/hooks-CjR3Eq0Z.js +1 -0
- package/dist/chunks/initReplBridge-D09JEKHt.js +1 -0
- package/dist/chunks/install-Dd5fw0cA.js +1 -0
- package/dist/chunks/{instrumentation-DQ705pC7.js → instrumentation-jsPu6qqs.js} +4 -4
- package/dist/chunks/{job-BaMT6Lb2.js → job-BHhkQbvu.js} +1 -1
- package/dist/chunks/{jwtUtils-FQWtM6iM.js → jwtUtils-YCoZL0FW.js} +1 -1
- package/dist/chunks/keybindings-Ch5lzNB8.js +1 -0
- package/dist/chunks/{launchLocalMemory-CtZrkmaw.js → launchLocalMemory-DsaijVcO.js} +2 -2
- package/dist/chunks/launchOnboarding-DHOylaqn.js +8 -0
- package/dist/chunks/loadAgentsDir-8FioUEwX.js +1 -0
- package/dist/chunks/{loadAgentsDir-mcRW90aq.js → loadAgentsDir-CwEfQDOw.js} +661 -698
- package/dist/chunks/loadPluginHooks-C-Yk5KlI.js +1 -0
- package/dist/chunks/localSearch-BEnlgSB7.js +1 -0
- package/dist/chunks/localSearch-LcgRjjl3.js +1 -0
- package/dist/chunks/{log-27kCA_9u.js → log-BlJ7CcKG.js} +1 -1
- package/dist/chunks/{logoV2Utils--8OUQQPd.js → logoV2Utils-DG9GwFjl.js} +1 -1
- package/dist/chunks/{magicDocs-26J_l1De.js → magicDocs-qGHR3Cqh.js} +2 -2
- package/dist/chunks/main-CBVQ8bRm.js +356 -0
- package/dist/chunks/{main-CGLCy2pM.js → main-Zh18lf2J.js} +2 -2
- package/dist/chunks/{managedEnv-Ds6MlFQE.js → managedEnv-3MbOWrVs.js} +1 -1
- package/dist/chunks/managedEnv-B4YV3A_y.js +1 -0
- package/dist/chunks/{mappers-DwZw084m.js → mappers-CdY45PDA.js} +1 -1
- package/dist/chunks/mcp-BA8XQ6h1.js +1 -0
- package/dist/chunks/mcp-DI8pGrqi.js +2 -0
- package/dist/chunks/mcp-DvY_FibT.js +6 -0
- package/dist/chunks/{memoize-Co4vS6UF.js → memoize-_2f7NWDv.js} +1 -1
- package/dist/chunks/memory-C2U7CCmM.js +1 -0
- package/dist/chunks/{modalContext-CUThy6Ph.js → modalContext-wY9CeN4G.js} +1 -1
- package/dist/chunks/{mode-B80CHkqo.js → mode-ByV6NqmB.js} +2 -2
- package/dist/chunks/model-C73ETGu9.js +1 -0
- package/dist/chunks/model-CVG_RRTy.js +1 -0
- package/dist/chunks/model-CeG-iOKF.js +1 -0
- package/dist/chunks/modelOptions-A5jrCUBp.js +1 -0
- package/dist/chunks/nativeInstaller-CXFD8LDV.js +1 -0
- package/dist/chunks/{omit-KEhe84f4.js → omit-B65XeX8r.js} +1 -1
- package/dist/chunks/{onChangeAppState-Dq1tIEJI.js → onChangeAppState-EtUxsgYz.js} +1 -1
- package/dist/chunks/openai-Dx5mvMjY.js +10 -0
- package/dist/chunks/{panel-CoF2a-h4.js → panel-Bg_0PHE6.js} +1 -1
- package/dist/chunks/{parser-CUUiH40T.js → parser-a2S_eFyE.js} +1 -1
- package/dist/chunks/parser-x-w3ikxt.js +1 -0
- package/dist/chunks/{partition-DeT341qu.js → partition-8vZDG3rY.js} +1 -1
- package/dist/chunks/permissions-CJUBfBTr.js +3 -0
- package/dist/chunks/pidLock-tjm2n1Nd.js +3 -0
- package/dist/chunks/plan-eFur8bdH.js +1 -0
- package/dist/chunks/{platform-Dg1c9F_1.js → platform-DVeTi9mp.js} +2 -2
- package/dist/chunks/plugin-fYLRLdOY.js +17 -0
- package/dist/chunks/pluginAutoupdate-B4w7SSYc.js +1 -0
- package/dist/chunks/{pluginBlocklist-BfoLN9a-.js → pluginBlocklist-CMwb7gmY.js} +1 -1
- package/dist/chunks/{pluginCliCommands-Bc2Iybhz.js → pluginCliCommands-3YCj7Y3Q.js} +1 -1
- package/dist/chunks/{pluginFlagging-Cr0d0hBA.js → pluginFlagging-srvq9H7p.js} +1 -1
- package/dist/chunks/pluginOperations-C7BCR7pw.js +2 -0
- package/dist/chunks/{pluginStartupCheck-DiCDQQlr.js → pluginStartupCheck-BLc0U7W7.js} +1 -1
- package/dist/chunks/pluginStartupCheck-nzVDPI1k.js +1 -0
- package/dist/chunks/plugins-CPtmmDDi.js +4 -0
- package/dist/chunks/poorMode-DD88nPJ4.js +1 -0
- package/dist/chunks/{poorMode-DxgO_bUb.js → poorMode-wm2WkPF0.js} +1 -1
- package/dist/chunks/print-BCud0ukQ.js +14 -0
- package/dist/chunks/processBashCommand-C9-FonuX.js +1 -0
- package/dist/chunks/processSlashCommand-Bi8_1MRC.js +5 -0
- package/dist/chunks/{prompt-DIlq8NTy.js → prompt-Bm2EEG4F.js} +21 -23
- package/dist/chunks/prompt-CX_v9F3s.js +1 -0
- package/dist/chunks/prompt-V0WQJrkO2.js +1 -0
- package/dist/chunks/{promptEditor-BILqOGl1.js → promptEditor-DQ9fpdQD.js} +3 -3
- package/dist/chunks/protocolHandler--eQQuSyx.js +13 -0
- package/dist/chunks/{proxy-BEKNaTXI.js → proxy-C0j74LqT.js} +1 -1
- package/dist/chunks/reconciler-DgQ4y1Vn.js +1 -0
- package/dist/chunks/refresh-CayVRWUY.js +1 -0
- package/dist/chunks/registerProtocol-DrWIX3Lb.js +1 -0
- package/dist/chunks/{reload-plugins-CGb0HTsH.js → reload-plugins-6xcH3dLg.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-BmteXmI9.js → remoteBridgeCore-BnZYGaMH.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-CwDGxL5p.js → remoteManagedSettings-CfFmrRze.js} +1 -1
- package/dist/chunks/rename-mDtCTbnD.js +1 -0
- package/dist/chunks/{renderOptions-45A-EdsK.js → renderOptions-CkqTbz6d.js} +1 -1
- package/dist/chunks/resume-DRvz4QFs.js +2 -0
- package/dist/chunks/ripgrep-Di-2j8Ws.js +1 -0
- package/dist/chunks/{ripgrep-DQ_ILUJV.js → ripgrep-DsLUmulz.js} +2 -2
- package/dist/chunks/{runtimeObserver-CtNY8Al2.js → runtimeObserver-Ba6SM-sI.js} +1 -1
- package/dist/chunks/{runtimeObserver-4ZqaCXYy.js → runtimeObserver-Dt5sGJVb.js} +4 -4
- package/dist/chunks/sandbox-adapter-Cmrd6tBj.js +1 -0
- package/dist/chunks/sandbox-toggle-DKcw3SbO.js +1 -0
- package/dist/chunks/searchExtraTools-DIgC0CFB.js +1 -0
- package/dist/chunks/{session-wb6X4Wrq.js → session-COVyD8UU.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-yAPDTrbm.js +1 -0
- package/dist/chunks/{sessionIdCompat-DMayYBrf.js → sessionIdCompat-Dgp6PW_1.js} +1 -1
- package/dist/chunks/sessionObserver-BizdPx8P.js +1 -0
- package/dist/chunks/{sessionObserver-BJQ5hwjU.js → sessionObserver-iAgSetlC.js} +2 -2
- package/dist/chunks/sessionState-zhvcDpb2.js +11 -0
- package/dist/chunks/sessionStorage-LMY409Ji.js +1 -0
- package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +3 -0
- package/dist/chunks/{sessionTitle-Cbzrb9jT.js → sessionTitle-QPRly1tZ.js} +2 -2
- package/dist/chunks/{sessionTracing-CEsm8pZL.js → sessionTracing-C4uqAdud.js} +2 -2
- package/dist/chunks/settings-BgHApyGL.js +1 -0
- package/dist/chunks/settings-CvhsRFaT.js +19 -0
- package/dist/chunks/settingsSync-BGo6dHJo.js +1 -0
- package/dist/chunks/setup-Bjw5VS6x.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-D5X5fhzj.js → shadowedRuleDetection-CzRAzcC1.js} +1 -1
- package/dist/chunks/{shellQuote-C_I6DHLV.js → shellQuote-D3Ocv_U-.js} +1 -1
- package/dist/chunks/{sideQuestion-BHRtwhyj.js → sideQuestion-oIYrx5ar.js} +3 -3
- package/dist/chunks/sinks-Bje3hCkR.js +1 -0
- package/dist/chunks/sinks-FaljTZ-c.js +1 -0
- package/dist/chunks/skillChangeDetector-v6mAYzXX.js +1 -0
- package/dist/chunks/{skillGapStore-BjQSSz2E.js → skillGapStore-CJjt3IW7.js} +2 -2
- package/dist/chunks/{skillLifecycle-Sp8strFv.js → skillLifecycle-BsgH84vl.js} +2 -2
- package/dist/chunks/{skillSearchPanel-3sYRez_Q.js → skillSearchPanel-CneXymsb.js} +4 -4
- package/dist/chunks/skills-DZRBy7vT.js +1 -0
- package/dist/chunks/{src-r6ZFgWPx2.js → src-D3yIF9I42.js} +1 -1
- package/dist/chunks/src-DL3w8VPk2.js +51 -0
- package/dist/chunks/{startupProfiler-Dc5r6LgE.js → startupProfiler-2sjXZkIP.js} +1 -1
- package/dist/chunks/startupProfiler-B2fyaBEa.js +1 -0
- package/dist/chunks/{staticRender-DrU6eWoq.js → staticRender-D9AbnQFr.js} +1 -1
- package/dist/chunks/{stats-BkadEKa-.js → stats-Dq-5qizS.js} +1 -1
- package/dist/chunks/status-BP_R8051.js +2 -0
- package/dist/chunks/status-CZYD3NGb.js +1 -0
- package/dist/chunks/statusNoticeHelpers-ODrnrLAZ.js +1 -0
- package/dist/chunks/{stringUtils-Df-Lnjxd.js → stringUtils-BjnclTLB.js} +3 -3
- package/dist/chunks/{switcher-uoQMHmEZ.js → switcher-BkGOeIzI.js} +1 -1
- package/dist/chunks/switcher-DwKN9daN.js +1 -0
- package/dist/chunks/{syncCache-BooMjgU6.js → syncCache-CpmpvjfC.js} +1 -1
- package/dist/chunks/tasks-CIUuwrX4.js +1 -0
- package/dist/chunks/teleport-IzyDplC7.js +1 -0
- package/dist/chunks/{templateJobs-BYYfF4m5.js → templateJobs-De57J461.js} +1 -3
- package/dist/chunks/{terminalSetup-CbXKCpWM.js → terminalSetup-DDvQ0K5e.js} +1 -1
- package/dist/chunks/terminalSetup-JJiXmszo.js +32 -0
- package/dist/chunks/theme-Nwii7354.js +1 -0
- package/dist/chunks/{tmux-d3cNCIZA.js → tmux-g0cQ0Buz.js} +1 -1
- package/dist/chunks/{toolEventObserver-BFEl47bq.js → toolEventObserver-Cq-uBb0-.js} +1 -1
- package/dist/chunks/toolPool-BBU4ll_p.js +1 -0
- package/dist/chunks/trustedDevice-BKzkA7fq.js +1 -0
- package/dist/chunks/{trustedDevice-BLiKbGpG.js → trustedDevice-DWZxDUxS.js} +1 -1
- package/dist/chunks/{types-BJ7qTz75.js → types-BomO8WUz.js} +1 -1
- package/dist/chunks/{udsClient-CF8BmZgN.js → udsClient-DSvRPCvR.js} +1 -1
- package/dist/chunks/upstreamproxy-DYoLvdM9.js +10 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-D48aDPG9.js +1 -0
- package/dist/chunks/useMainLoopModel-89eUU13X.js +1 -0
- package/dist/chunks/useManagePlugins-EqoQELMT.js +1 -0
- package/dist/chunks/useMergedTools-BJ4L9QSK.js +1 -0
- package/dist/chunks/{useSearchInput-KFKh2ozY.js → useSearchInput-DkVER3cm.js} +1 -1
- package/dist/chunks/useSettingsErrors-D3MlQ1GF.js +1 -0
- package/dist/chunks/{userAgent-DUrr02yh.js → userAgent-aoe_xVAb.js} +1 -1
- package/dist/chunks/util-g-5UX5gH.js +1 -0
- package/dist/chunks/validatePlugin-CSE8zjZn.js +1 -0
- package/dist/chunks/{vim-C4Hs5U2h.js → vim-s-wmybpU.js} +1 -1
- package/dist/chunks/{which-mplwBbc0.js → which-BR8YVCCW.js} +1 -1
- package/dist/chunks/{windowsPaths-C7Mdo9aU.js → windowsPaths-BmXyrasP.js} +1 -1
- package/dist/chunks/windowsPaths-BybjGW7e.js +1 -0
- package/dist/chunks/{workSecret-XLodD7tw.js → workSecret-BUd8cQ6-.js} +1 -1
- package/dist/chunks/workerRegistry-DGwy0YHB.js +2 -0
- package/dist/chunks/worktree-jjuORs7p.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-BzNj9rS6.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CDZPR488.js +0 -1
- package/dist/chunks/App-D-bYAYAl.js +0 -1
- package/dist/chunks/ApproveApiKey-BEGV9Zj9.js +0 -1
- package/dist/chunks/ApproveApiKey-CjacpIqq.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-A9hw_SV0.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-B0BizN_J.js +0 -1
- package/dist/chunks/DiffDialog-mQ-5_TSv.js +0 -6
- package/dist/chunks/Doctor-BC6IuQhd.js +0 -3
- package/dist/chunks/Doctor-i_5_AQd-.js +0 -1
- package/dist/chunks/ExitFlow-Bu2cVGpC.js +0 -2
- package/dist/chunks/Grove-D0nn8zOV.js +0 -11
- package/dist/chunks/InvalidConfigDialog-C5CIiSIE.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-Dq7hKXcO.js +0 -1
- package/dist/chunks/MCPConnectionManager-aDDsYkGM.js +0 -1
- package/dist/chunks/MCPToolListView-Cr0MDkzT.js +0 -1
- package/dist/chunks/MessageSelector-DwGOWKKL.js +0 -3
- package/dist/chunks/Messages-C1jh4ixt.js +0 -11
- package/dist/chunks/PermissionDialog-Cb3z8OUP.js +0 -1
- package/dist/chunks/PressEnterToContinue-Dq0Imo9c.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-BgADIzRj.js +0 -1
- package/dist/chunks/QueryEngine-HlLQJmsd.js +0 -1
- package/dist/chunks/REPL-Rs_JQkDc.js +0 -1
- package/dist/chunks/REPL-VKAmKkII.js +0 -133
- package/dist/chunks/RemoteSessionManager-BbgXeM-t.js +0 -2
- package/dist/chunks/ResumeConversation-66zbx12g.js +0 -1
- package/dist/chunks/SSETransport-BBQkdn4e.js +0 -4
- package/dist/chunks/SearchExtraToolsTool-Bq87I_vu.js +0 -1
- package/dist/chunks/Settings-BKdLcyXe.js +0 -2
- package/dist/chunks/TeleportResumeWrapper-BT4O-Wsi.js +0 -1
- package/dist/chunks/ThemePicker-DUlhcoso.js +0 -1
- package/dist/chunks/ValidationErrorsList-DSSUWdgd.js +0 -2
- package/dist/chunks/add-dir-BUr0z-VU.js +0 -1
- package/dist/chunks/agents-8ELI8RJo.js +0 -103
- package/dist/chunks/allErrors-C1eMbHSv.js +0 -1
- package/dist/chunks/api-DgjIFdMn.js +0 -1
- package/dist/chunks/attributionHooks-CUAoGkU6.js +0 -1
- package/dist/chunks/auth-B73a4Cob.js +0 -1
- package/dist/chunks/auth-D_0waidQ.js +0 -1
- package/dist/chunks/autoModeDenials-BxNzGJdR.js +0 -1
- package/dist/chunks/backgroundHousekeeping-C_ArdTFX.js +0 -17
- package/dist/chunks/backgroundHousekeeping-YJhvZ0dh.js +0 -1
- package/dist/chunks/branch-bb4-bErF.js +0 -3
- package/dist/chunks/bridgeConfig-DywkIo_k.js +0 -1
- package/dist/chunks/bridgeStatusUtil-DStiD05t.js +0 -1
- package/dist/chunks/btw-BRmV51bR.js +0 -1
- package/dist/chunks/caches-C5DIVdvI.js +0 -1
- package/dist/chunks/caches-zDZEgNKq.js +0 -1
- package/dist/chunks/claudeDesktop-Ct_hyICL.js +0 -1
- package/dist/chunks/client-7lIxWcaM.js +0 -1
- package/dist/chunks/client-DVg8PpFX.js +0 -1
- package/dist/chunks/commands-ByFXqW43.js +0 -1
- package/dist/chunks/compact-BUShp2eQ.js +0 -2
- package/dist/chunks/config-BwHNU_pI.js +0 -1
- package/dist/chunks/context-6Pk3iVhh.js +0 -1
- package/dist/chunks/context-noninteractive-DFwRQyFE.js +0 -1
- package/dist/chunks/conversation-5zb5XkSA.js +0 -1
- package/dist/chunks/conversation-JP2ZXrwu.js +0 -1
- package/dist/chunks/createSession-VTqzWAu6.js +0 -1
- package/dist/chunks/crossProjectResume-DxgQVYSi.js +0 -40
- package/dist/chunks/debugUtils-cK-iOsEV.js +0 -1
- package/dist/chunks/detectRepository-BsKZDRoI.js +0 -1
- package/dist/chunks/directoryCompletion-ByBTSuLu.js +0 -1
- package/dist/chunks/doctor-Bvx0u0sO.js +0 -1
- package/dist/chunks/esm-CtQkOk5D.js +0 -1
- package/dist/chunks/exit-BOhGfSlm.js +0 -2
- package/dist/chunks/exit-DTsz5Lcb.js +0 -1
- package/dist/chunks/extractMemories-6OnMgL2S.js +0 -1
- package/dist/chunks/fast-B2ziqJEA.js +0 -1
- package/dist/chunks/fast-BkhjaTkZ.js +0 -1
- package/dist/chunks/firstPartyEventLogger-CXMzhLrF.js +0 -1
- package/dist/chunks/flushGate-DWL05x7v.js +0 -1
- package/dist/chunks/gemini-BLpLJyli.js +0 -1
- package/dist/chunks/generateSessionName-CdbMksHi.js +0 -1
- package/dist/chunks/git-Bs1vtuvX.js +0 -1
- package/dist/chunks/goal-V3qix-i1.js +0 -3
- package/dist/chunks/grok-BLLATotv.js +0 -1
- package/dist/chunks/help-BR7UEr5R.js +0 -1
- package/dist/chunks/hooks-D6wtd0Qq.js +0 -1
- package/dist/chunks/initReplBridge-DyScxedy.js +0 -1
- package/dist/chunks/install-DGH_bjUh.js +0 -1
- package/dist/chunks/keybindings-CG292HS1.js +0 -2
- package/dist/chunks/launchOnboarding-CyOtdZkT.js +0 -8
- package/dist/chunks/loadAgentsDir-4UC4yLg1.js +0 -1
- package/dist/chunks/loadPluginHooks-CWI0RMUx.js +0 -1
- package/dist/chunks/localSearch-CCCDKpYx.js +0 -1
- package/dist/chunks/localSearch-D4hVR7-d.js +0 -1
- package/dist/chunks/main-DUjtDK1Q.js +0 -513
- package/dist/chunks/managedEnv-BuCurT_S.js +0 -1
- package/dist/chunks/mcp-CEKR7PjL.js +0 -6
- package/dist/chunks/mcp-DCAf2hHD.js +0 -1
- package/dist/chunks/mcp-mCuc8dNe.js +0 -2
- package/dist/chunks/memory-B5SkpC7u.js +0 -1
- package/dist/chunks/model-BqaneI4D.js +0 -1
- package/dist/chunks/model-C29_32BD.js +0 -1
- package/dist/chunks/model-NG8fvuT2.js +0 -1
- package/dist/chunks/modelOptions-CiZgZxZC.js +0 -1
- package/dist/chunks/nativeInstaller-DqbEfGSX.js +0 -1
- package/dist/chunks/openai-BvnsYTpQ.js +0 -10
- package/dist/chunks/parser-B2PlJg4C.js +0 -1
- package/dist/chunks/permissions-BPpeHxpk.js +0 -3
- package/dist/chunks/pidLock-DQGDoFQP.js +0 -3
- package/dist/chunks/plan-BRiC5ujG.js +0 -1
- package/dist/chunks/plugin-Dcg_GGR9.js +0 -17
- package/dist/chunks/pluginAutoupdate-ByH9IPC9.js +0 -1
- package/dist/chunks/pluginOperations-CKNyYjS-.js +0 -2
- package/dist/chunks/pluginStartupCheck-B48_cGgo.js +0 -1
- package/dist/chunks/plugins-BP_36tOl.js +0 -4
- package/dist/chunks/poorMode-Djw0P9Gu.js +0 -1
- package/dist/chunks/print-2uavraPq.js +0 -26
- package/dist/chunks/processBashCommand-g3sAMpHt.js +0 -1
- package/dist/chunks/processSlashCommand-tIbeCrv5.js +0 -5
- package/dist/chunks/prompt-DLv-Cd67.js +0 -1
- package/dist/chunks/prompt-DV5tCLRh.js +0 -1
- package/dist/chunks/protocolHandler-B83fCYI4.js +0 -13
- package/dist/chunks/reconciler-CDq6XgAS.js +0 -1
- package/dist/chunks/refresh-ysrhoWCo.js +0 -1
- package/dist/chunks/registerProtocol-DduKPsn_.js +0 -36
- package/dist/chunks/rename-1GLIUlYk.js +0 -1
- package/dist/chunks/resume-DWtlUiHW.js +0 -2
- package/dist/chunks/ripgrep-BLQnqPnE.js +0 -1
- package/dist/chunks/sandbox-adapter-BzjRQh_r.js +0 -1
- package/dist/chunks/sandbox-toggle-Bz49-F6e.js +0 -1
- package/dist/chunks/searchExtraTools-D6vj8qJ-.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Da97UA2n.js +0 -1
- package/dist/chunks/sessionObserver-DXO4trhk.js +0 -1
- package/dist/chunks/sessionState-Bn3ESS5f.js +0 -11
- package/dist/chunks/sessionStorage-DlPVsQn9.js +0 -1
- package/dist/chunks/sessionStoragePortable-BhkGMZWp.js +0 -3
- package/dist/chunks/settings-3ionQKNv.js +0 -1
- package/dist/chunks/settings-DiBMs2gM.js +0 -20
- package/dist/chunks/settingsSync-eHaSngKo.js +0 -1
- package/dist/chunks/setup-DeyiuGNX.js +0 -3
- package/dist/chunks/sinks-Bgy2UNK-.js +0 -2
- package/dist/chunks/sinks-CgzLmim2.js +0 -1
- package/dist/chunks/skillChangeDetector-BlSP16j6.js +0 -1
- package/dist/chunks/skills-CJhWI8t1.js +0 -1
- package/dist/chunks/src-P_wYS_NJ2.js +0 -53
- package/dist/chunks/startupProfiler-CUlV07MD.js +0 -1
- package/dist/chunks/status-CDCurOqs.js +0 -2
- package/dist/chunks/status-yoQIQ2Ni.js +0 -1
- package/dist/chunks/statusNoticeHelpers-Sl4jjauz.js +0 -1
- package/dist/chunks/switcher-C-m6MUwE.js +0 -1
- package/dist/chunks/tasks-CHG_6sXQ.js +0 -1
- package/dist/chunks/teleport-C9KRE4X8.js +0 -1
- package/dist/chunks/terminalSetup-fwhFTxGi.js +0 -33
- package/dist/chunks/theme-MvX7hojJ.js +0 -1
- package/dist/chunks/toolPool-Cq74Cvjp.js +0 -1
- package/dist/chunks/trustedDevice-BGwujSqc.js +0 -1
- package/dist/chunks/updateCCB-CfckOy7T.js +0 -11
- package/dist/chunks/upstreamproxy-BuBFDFAD.js +0 -11
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-CPLBDluY.js +0 -1
- package/dist/chunks/useMainLoopModel-C00PbZ1Q.js +0 -1
- package/dist/chunks/useManagePlugins-DFaGntzJ.js +0 -1
- package/dist/chunks/useMergedTools-DYobZ5N4.js +0 -1
- package/dist/chunks/useSettingsErrors-BRgjvaHd.js +0 -1
- package/dist/chunks/util-D7uwPgF1.js +0 -1
- package/dist/chunks/validatePlugin-VukX52bx.js +0 -1
- package/dist/chunks/windowsPaths-B8p9tFRF.js +0 -1
- package/dist/chunks/workerRegistry-BA37PVbv.js +0 -6
- package/dist/chunks/worktree-Lik8xuKd.js +0 -1
- package/dist/chunks/xdg-DcF9ejUM.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{AC as i,AT as a,Bo as o,Bw as s,Co as c,Db as ee,Do as l,Eb as u,Eg as te,Ro as ne,Rw as d,Sb as f,Sr as p,Tb as m,bb as h,bg as g,jC as _,jT as v,mb as y,sb as b,ub as x,vb as re,wb as ie,wr as ae}from"./loadAgentsDir-mcRW90aq.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-Besi3Os3.js";import{C as w,P as ue,R as de,S as fe,c as T,i as E,x as D}from"./debug-Dr1SjdXn.js";import{Kt as O,Yt as k,f as A,g as j,n as M}from"./settings-DiBMs2gM.js";import{c as N,h as P,o as F,v as I,y as L}from"./config-9rLTDOYW.js";import{f as R,l as z,m as B,p as V}from"./git-CoQQ6YEf.js";import{n as H,r as pe}from"./execFileNoThrow-mXq4K0rl.js";import{o as U,s as W}from"./log-27kCA_9u.js";import{i as G,o as me}from"./platform-Dg1c9F_1.js";import{l as he,u as ge}from"./oauth-D38aRTUb.js";import{Bt as _e,Vt as ve,_ as ye,ai as be,g as xe,si as Se}from"./model-C29_32BD.js";import{c as Ce,h as we,l as Te,m as K,s as Ee}from"./proxy-BEKNaTXI.js";import{c as De,i as Oe}from"./terminalSetup-fwhFTxGi.js";import{l as ke,o as Ae}from"./api-f3GN2I_J.js";import{c as je,u as Me}from"./firstPartyEventLogger-1RTgXHSz.js";import{randomUUID as Ne}from"crypto";t(),a(),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?v(e.exampleFiles):`<filepath>`;return`Try "${v([`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(),de(),D(),E(),me(),ge(),j(),_e(),ye(),s(),_(),h(),x(),te(),Oe(),ne(),c(),p(),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=d in await o()),J}async function Y(e,t,n){if(!await Ge()||l(`${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&&b(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 ${i(`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(!m()||G()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await u();case`cursor`:return!await f();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 ie()||(await re()).length!==0?!1:(await y()).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()=>!g()},{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()=>g()},{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()=>ae()&&N().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .workmate/skills/ in your project or ~/.workmate/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return N().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${i(`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 ${i(`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 ${i(`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@${d}`)}`,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@${d}`)}`,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(),E(),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=fe(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: ${ue(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(w(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(w(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)}};E(),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{Au as n,Bn as ee,Cu as te,EC as r,Hg as i,Kr as ne,MC as a,Mu as o,My as re,Nr as ie,Rr as s,Sc as c,Sr as l,Su as u,Ug as d,Zn as ae,_c as f,ag as oe,gl as se,hl as ce,ii as le,jy as p,ng as m,rg as h,ri as g,wr as _}from"./loadAgentsDir-mcRW90aq.js";import{I as v,P as y,Wt as b,dr as ue,fi as x,ot as de,t as S}from"./src-P_wYS_NJ2.js";import{t as C}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as w,or as fe}from"./state-BPFYBqm1.js";import{o as T,s as E}from"./log-27kCA_9u.js";import{n as D,r as O}from"./analytics-DJobLaWP.js";import{a as pe,n as k,s as A}from"./skillChangeDetector-BlSP16j6.js";import{t as j}from"./REPL-VKAmKkII.js";import{a as M,i as N,n as P,o as F,r as I,t as L}from"./crossProjectResume-DxgQVYSi.js";import{dirname as R}from"path";var z=t(x(),1);a(),w(),F(),o(),p(),S(),r(),D(),m(),d(),N(),f(),u(),P(),T(),l();var B=C();function me(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 V({commands:t,worktreePaths:r,initialTools:a,mcpClients:o,dynamicMcpConfig:l,debug:u,mainThreadAgentDefinition:d,autoConnectIdeFlag:f,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:b,initialSearchQuery:x,disableSlashCommands:S=!1,forkSession:C,taskListId:w,filterByPr:T,thinkingConfig:D,onTurnComplete:N}){let{rows:P}=de(),F=h(e=>e.agentDefinitions),V=oe(),[H,U]=z.useState([]),[_e,W]=z.useState(!0),[ve,ye]=z.useState(!1),[G,be]=z.useState(!1),[K,xe]=z.useState(null),[q,Se]=z.useState(null),J=z.useRef(null),Y=z.useRef(0),X=z.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(T!==void 0){if(T===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof T==`number`)e=e.filter(e=>e.prNumber===T);else if(typeof T==`string`){let t=me(T);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,T]),Z=_();z.useEffect(()=>{s(r).then(e=>{J.current=e,Y.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{E(e),W(!1)})},[r]);let Q=z.useCallback(e=>{let t=J.current;!t||t.nextIndex>=t.allStatLogs.length||ae(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=Y.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),Y.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{W(!0),(e?ie():s(r)).then(e=>{J.current=e,Y.current=e.logs.length,U(e.logs)}).catch(e=>{E(e)}).finally(()=>{W(!1)})},[r]),Ce=z.useCallback(()=>{let e=!G;be(e),$(e)},[G,$]);function we(){process.exit(1)}async function Te(t){ye(!0);let n=performance.now(),r=L(t,G);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await ue(e);t&&process.stdout.write(t),Se(e);return}try{let r=await te(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(fe(i(r.sessionId),t.fullPath?R(t.fullPath):null),await g(),re(r.sessionId)):C&&r.contentReplacements?.length&&await ne(r.contentReplacements);let{agentDefinition:a}=pe(r.agentSetting,d,F);V(e=>({...e,agent:a?.agentType}));let o=k(r.agentName,r.agentColor);if(o&&V(e=>({...e,standaloneAgentContext:o})),c(r.agentName),le(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&ee()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(se(),e(ce)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}O(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),U([]),xe({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:a})}catch(e){throw O(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),E(e),e}}return q?(0,B.jsx)(ge,{command:q}):K?(0,B.jsx)(j,{debug:u,commands:t,initialTools:a,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:o,dynamicMcpConfig:l,strictMcpConfig:p,systemPrompt:m,appendSystemPrompt:b,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:S,taskListId:w,thinkingConfig:D,onTurnComplete:N}):_e?(0,B.jsxs)(v,{children:[(0,B.jsx)(n,{}),(0,B.jsx)(y,{children:` Loading conversations…`})]}):ve?(0,B.jsxs)(v,{children:[(0,B.jsx)(n,{}),(0,B.jsx)(y,{children:` Resuming conversation…`})]}):X.length===0?(0,B.jsx)(he,{}):(0,B.jsx)(M,{logs:X,maxHeight:P,onCancel:we,onSelect:Te,onLogsChanged:Z?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:x,showAllProjects:G,onToggleAllProjects:Ce,onAgenticSearch:I})}function he(){return b(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(v,{flexDirection:`column`,children:[(0,B.jsx)(y,{children:`No conversations found to resume.`}),(0,B.jsx)(y,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function ge({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(v,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(y,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(v,{flexDirection:`column`,children:[(0,B.jsx)(y,{children:`To resume, run:`}),(0,B.jsxs)(y,{children:[` `,e]})]}),(0,B.jsx)(y,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,S as c,c as l,i as u,x as d}from"./debug-Dr1SjdXn.js";import{O as f,k as p}from"./git-CoQQ6YEf.js";import{_n as m,vn as h}from"./model-C29_32BD.js";import{n as g,t as _}from"./userAgent-DUrr02yh.js";import{A as v,O as y}from"./sessionState-Bn3ESS5f.js";import{n as b,t as x}from"./rcDebugLog-DSchf3Hs.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
|
|
2
|
-
`)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`)){s=!0;continue}let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);switch(r){case`event`:o.event=i;break;case`id`:o.id=i;break;case`data`:o.data=o.data?o.data+`
|
|
3
|
-
`+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),u(),x(),f(),s(),v(),m(),d(),g(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),l(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),p(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??y,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),p(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),p(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":_()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),l(`SSETransport: Opening ${t.href}`),p(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(l(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),p(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`SSETransport: Connected`),p(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Connection error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){l(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),p(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))l(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),p(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(l(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),p(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),p(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),p(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=c(t)}catch(e){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),p(`info`,`cli_sse_message_received`),this.onData?.(a(r)+`
|
|
4
|
-
`)}else l(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),l(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));l(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),p(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else l(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),p(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){l(`SSETransport: No session token available for POST`),p(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":_()};l(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${a(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),p(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),p(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`SSETransport: POST failed after ${A} attempts, continuing`),p(`warn`,`cli_sse_post_retries_exhausted`);return}await h(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{M_ as e,j_ as t}from"./loadAgentsDir-mcRW90aq.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-DcaKZlRU.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{$y as ee,Ap as c,EC as l,MC as u,N as te,S as ne,Sr as re,Xh as ie,Xu as ae,Yh as oe,Yu as d,Zu as f,ag as se,ar as p,bb as m,ig as ce,io as h,jp as g,nb as le,ng as ue,no as _,od as de,rb as fe,rg as v,ro as y,sd as pe,tb as me,v as he,wb as ge,x as _e,yb as ve}from"./loadAgentsDir-mcRW90aq.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-BPFYBqm1.js";import{n as Me,t as A}from"./cwd-Besi3Os3.js";import{Bt as Ne,Ft as Pe,It as Fe,Mt as j,Pt as Ie,c as Le,g as Re,n as ze,x as M,zt as Be}from"./settings-DiBMs2gM.js";import{a as Ve,c as N,h as He,i as Ue,o as We,y as P}from"./config-9rLTDOYW.js";import{o as Ge,s as Ke}from"./log-27kCA_9u.js";import{n as qe,r as F}from"./analytics-DJobLaWP.js";import{G as Je,K as Ye,Sr as I,_ as Xe,b as Ze,et as L,it as Qe,q as $e,rt as et,tt,x as nt,xr as rt}from"./model-C29_32BD.js";import{r as it,t as at}from"./poorMode-DxgO_bUb.js";import{a as R,c as ot,d as st,i as ct,l as lt,n as ut,o as dt,r as z,s as ft,t as pt,u as B}from"./status-CDCurOqs.js";import{n as V,t as H}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";import{i as mt,n as ht,r as gt}from"./modalContext-CUThy6Ph.js";import{n as _t,t as vt}from"./ThemePicker-DUlhcoso.js";import{i as yt,n as bt,r as xt,t as St}from"./extraUsage-C86bZVgt.js";import{n as Ct,t as wt}from"./AgentsMdExternalIncludesDialog-CH9x1Ngp.js";import{t as Tt}from"./SearchBox-C9vUA4IM.js";import{n as Et,t as U}from"./useSearchInput-KFKh2ozY.js";function Dt(){let e=je();return[{label:`Version`,value:`0.0.13`},{label:`Session name`,value:p(e)??(0,K.jsx)(S,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:A()},...ut(),...pt()]}function Ot({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:B(e)},...z(t.clients,r.options.ideInstallationStatus,n),...dt(t.clients,n),...ot(),...lt()]}async function kt(){return[...await ct(),...await R(),...await ft()]}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=v(e=>e.mainLoopModel),r=v(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)(c,{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(),ue(),Me(),re(),st(),g(),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)(ae,{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(),d(),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)(()=>{y(A()).then(e=>{let t=Lt(e);a(t),s(!1)}).catch(()=>{let e=Lt(_);a(e),s(!1)})},[]);let ee=(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)(ae,{options:i,onChange:ee,visibleOptionCount:10,defaultValue:e})]})})}var zt,q,Bt,Vt,Ht=t((()=>{w(),zt=n(w(),1),h(),E(),Me(),f(),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 ee(){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)(de,{value:r??``,onChange:i,onSubmit:ee,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(),l(),pe(),J=k()}));function Kt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:l}){let{headerFocused:u,focusHeader:ne}=we(),re=gt(),[,oe]=be(),d=xe(),[f,p]=(0,X.useState)(N()),m=Y.useRef(N()),[h,g]=(0,X.useState)(ze()),ue=Y.useRef(ze()),[_,de]=(0,X.useState)(h?.outputStyle||`default`),fe=Y.useRef(_),[y,pe]=(0,X.useState)(h?.language),Te=Y.useRef(y),[w,De]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Ae=Ce(),{rows:je}=Oe(),Me=l??Math.min(Math.floor(je*.8),30),A=Math.max(5,Me-10),j=v(e=>e.mainLoopModel),Re=v(e=>e.verbose),He=v(e=>e.thinkingEnabled),Ge=v(e=>et()?e.fastMode:!1);v(e=>e.promptSuggestionEnabled);let qe=Pe(h?.permissions?.defaultMode??`default`),Xe=_e()||he()===`enabled`,L=se(),[rt,R]=(0,X.useState)({}),ot=Y.useRef(He),[st]=(0,X.useState)(()=>Le(`localSettings`)),[ct]=(0,X.useState)(()=>Le(`userSettings`)),lt=Y.useRef(d),ut=ce(),[dt]=(0,X.useState)(()=>{let e=ut.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}}),z=Y.useRef(!1),[ft,pt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:mt,cursorOffset:ht}=Et({isActive:O&&B===null&&!u,onExit:()=>k(!1),onExitUp:ne,passthroughCtrlKeys:[`c`,`d`]}),_t=O&&!u;Y.useEffect(()=>{o?.(_t)},[_t,o]);let yt=ve(n.options.mcpClients),St=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Ct=Y.use(me(!0)),Tt=le(Ct),U=Ve();function Dt(e){F(`tengu_config_model_changed`,{from_model:j,to_model:e}),L(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=nt(e)+(bt(e,!1,Ze())?` · 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}),L(t=>({...t,verbose:e})),R(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})),L(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){L(t=>({...t,thinkingEnabled:e})),M(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),F(`tengu_thinking_toggled`,{enabled:e})}},...et()&&tt()?[{id:`fastMode`,label:`Fast mode (${Je} only)`,value:!!Ge,type:`boolean`,onChange(e){Ye(),M(`userSettings`,{fastMode:e?!0:void 0}),e?(L(e=>({...e,mainLoopModel:$e(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:$e(),"Fast mode":`ON`}))):(L(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(at(),e(it)).isPoorModeActive(),type:`boolean`,onChange(t){(at(),e(it)).setPoorMode(t),L(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,...Ne.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Pe(e),n=t===`auto`?t:Ie(t)?Be(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}})),R(t=>({...t,defaultPermissionMode:e})),F(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Xe?[{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})),L(e=>{let t=te(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(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})}},...ie()?[{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:d,type:`managedEnum`,onChange:oe},{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:y??`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`})}}]:[],...ge()?[]:[{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`})}}],...ge()?[{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 AGENTS.md includes`,value:We().hasAgentsMdExternalIncludesApproved?`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:I(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&f.customApiKeyResponses?.approved?.includes(I(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=I(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(!H)return kt;let e=H.toLowerCase();return kt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[kt,H]);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(B!==null)return;let e=Object.entries(rt).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(I(n))),a=!!(n&&f.customApiKeyResponses?.approved?.includes(I(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)}`),_!==fe.current&&e.push(`Set output style to ${D.bold(_)}`),y!==Te.current&&e.push(`Set response language to ${D.bold(y??`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!==ue.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`})},[B,rt,f,j,_,y,h?.autoUpdatesChannel,et()?h?.fastMode:void 0,t]),Mt=(0,X.useCallback)(()=>{d!==lt.current&&oe(lt.current),P(()=>m.current);let e=st;M(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ct;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=dt;L(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:te(e.toolPermissionContext)}))},[d,oe,st,ct,dt,L]);Se(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Mt(),t(`Config dialog dismissed`,{display:`system`}))},[B,Mt,t]),{context:`Settings`,isActive:B===null&&!O&&!u}),Se(`settings:close`,jt,{context:`Settings`,isActive:B===null&&!O&&!u});let G=(0,X.useCallback)(()=>{let e=W[w];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ot.current?pt(!1):n.messages.some(e=>e.type===`assistant`)&&pt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:V(`Theme`),a(!0);return;case`model`:V(`Model`),a(!0);return;case`showExternalIncludesDialog`:V(`ExternalIncludes`),a(!0);return;case`outputStyle`:V(`OutputStyle`),a(!0);return;case`language`:V(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){V(`EnableAutoUpdates`),a(!0);return}(h?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.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`){z.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=>{pt(!1);let t=Math.max(0,Math.min(W.length-1,w+e));De(t),At(t)};return ye({"select:previous":()=>{w===0?(pt(!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),mt(``)}},{context:`Settings`,isActive:B===null&&!O&&!u}),(0,Z.jsx)(x,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!u){if(O){if(e.key===`escape`){e.preventDefault(),H.length>0?mt(``):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),mt(e.key))}},[B,u,O,H,mt,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(vt,{onThemeSelect:e=>{z.current=!0,oe(e),V(null),a(!1)},onCancel:()=>{V(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)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{initial:j,onSelect:e=>{z.current=!0,Dt(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:et()?Ge&&Qe(j)&&tt():!1}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{onDone:()=>{V(null),a(!1)},externalIncludes:ee(Ct)}),(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(b,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Rt,{initialStyle:_,onComplete:e=>{z.current=!0,de(e??`default`),V(null),a(!1),M(`localSettings`,{outputStyle:e}),F(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{V(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)(c,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ut,{initialLanguage:y,onComplete:e=>{z.current=!0,pe(e),V(null),a(!1),M(`userSettings`,{language:e}),F(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{V(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)(c,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):B===`EnableAutoUpdates`?(0,Z.jsx)(ke,{title:`Enable Auto-Updates`,onCancel:()=>{V(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(ae,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{z.current=!0,V(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.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(Pt,{currentVersion:`0.0.13`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.13`),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:H,isFocused:O&&!u,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 "`,H,`"`]}):(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&&!u&&!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()}),ft&&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:Fe(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`]})]})}),u?(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)(c,{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)(c,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(S,{dimColor:!0,children:(0,Z.jsxs)(C,{children:[(0,Z.jsx)(c,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(c,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(c,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(c,{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),l(),o(),He(),rt(),Te(),j(),ne(),Ge(),qe(),_t(),ue(),yt(),Xe(),St(),Ct(),It(),d(),Ht(),Gt(),fe(),g(),ht(),Tt(),m(),Re(),h(),a(),U(),u(),L(),oe(),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,ee]=(0,Q.useState)(!1),c=gt(),{rows:l}=mt(Oe()),u=c?l+1:Math.max(15,Math.min(Math.floor(l*.8),30)),[te]=(0,Q.useState)(()=>kt().catch(()=>[]));return V(),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||c?void 0:u,children:[(0,$.jsx)(De,{title:`Status`,children:(0,$.jsx)(At,{context:t,diagnosticsPromise:te})},`status`),(0,$.jsx)(De,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Kt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:ee,contentHeight:u})})},`config`)]})})}var Q,$,Zt=t((()=>{w(),Q=n(w(),1),l(),H(),u(),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{Ap as t,Au as n,DC as r,EC as i,MC as a,Mu as o,OC as s,Ou as c,Xu as l,Yu as u,du as d,jp as f,ku as p,su as m}from"./loadAgentsDir-mcRW90aq.js";import{D as h,I as g,P as _,T as v,Wt as y,fi as b,hn as x,ot as S,t as C}from"./src-P_wYS_NJ2.js";import{t as w}from"./jsx-runtime-Bb4Xn-E0.js";import{Wt as T,nr as E}from"./state-BPFYBqm1.js";import{M as D,P as O,R as k,c as A,i as j}from"./debug-Dr1SjdXn.js";import{n as M,r as N}from"./analytics-DJobLaWP.js";import{p as P,v as F}from"./startupProfiler-Dc5r6LgE.js";import{i as I,n as L}from"./detectRepository-CMEkS5_2.js";import{n as R,o as z}from"./api-f3GN2I_J.js";var B=e(b(),1);T(),M(),k(),m();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),N(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await d(t.id);return E({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:O(e),formattedMessage:e instanceof D?e.formattedMessage:void 0,isOperationError:e instanceof D};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}a(),z(),C(),i(),r(),j(),I(),F(),f(),u(),o(),p();var H=w(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:r,isEmbedded:i=!1}){let{rows:a}=S(),[o,u]=(0,B.useState)([]),[d,f]=(0,B.useState)(null),[p,m]=(0,B.useState)(!0),[b,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,k]=(0,B.useState)(1),j=s(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{m(!0),C(null);let e=await L();f(e),A(`Current repository: ${e||`not detected`}`);let t=await R(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),A(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});u(r)}catch(e){let t=e instanceof Error?e.message:String(e);A(`Error loading code sessions: ${t}`),C(K(t))}finally{m(!1),T(!1)}},[]),N=()=>{T(!0),M()};y(`confirm:no`,r,{context:`Confirmation`}),x((e,t)=>{if(t.ctrl&&e===`c`){r();return}if(t.ctrl&&e===`r`&&b){N();return}if(b!==null&&t.return){r();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(c,{onComplete:F});if(p)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(n,{}),(0,H.jsx)(_,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(_,{dimColor:!0,children:w?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(b)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(b),(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})]});if(o.length===0)return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(_,{bold:!0,children:[`No Claude Code sessions found`,d&&(0,H.jsxs)(_,{children:[` for `,d]})]}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:j}),` to cancel`]})})]});let I=o.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...I.map(e=>e.timeString.length)),V=I.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,i?Math.min(o.length,5,a-6-7):Math.min(o.length,a-1-7));return(0,H.jsxs)(g,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(_,{bold:!0,children:[`Select a session to resume`,o.length>G&&(0,H.jsxs)(_,{dimColor:!0,children:[` `,`(`,O,` of `,o.length,`)`]}),d&&(0,H.jsxs)(_,{dimColor:!0,children:[` (`,d,`)`]}),`:`]}),(0,H.jsxs)(g,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(g,{marginLeft:2,children:(0,H.jsxs)(_,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(l,{visibleOptionCount:G,options:V,onChange:t=>{let n=o.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&k(t+1)}})]}),(0,H.jsx)(g,{flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:(0,H.jsxs)(v,{children:[(0,H.jsx)(h,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(h,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(t,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}function K(e){let t=e.toLowerCase();return t.includes(`fetch`)||t.includes(`network`)||t.includes(`timeout`)?`network`:t.includes(`auth`)||t.includes(`token`)||t.includes(`permission`)||t.includes(`oauth`)||t.includes(`not authenticated`)||t.includes(`/login`)||t.includes(`console account`)||t.includes(`403`)?`auth`:t.includes(`api`)||t.includes(`rate limit`)||t.includes(`500`)||t.includes(`529`)?`api`:`other`}function q(e){switch(e){case`network`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Teleport requires a Claude account`})});case`api`:return(0,H.jsx)(g,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(g,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(_,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}M(),C(),i(),o();function J({onComplete:e,onCancel:t,onError:r,isEmbedded:i=!1,source:a}){let{resumeSession:o,isResuming:s,error:c,selectedSession:l}=V(a);(0,B.useEffect)(()=>{N(`tengu_teleport_started`,{source:a})},[a]);let u=async t=>{let n=await o(t);n?e(n):c&&r&&r(c.message,c.formattedMessage)},d=()=>{N(`tengu_teleport_cancelled`,{}),t()};return y(`app:interrupt`,d,{context:`Global`,isActive:!!c&&!r}),s&&l?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(g,{flexDirection:`row`,children:[(0,H.jsx)(n,{}),(0,H.jsx)(_,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(_,{dimColor:!0,children:[`Loading "`,l.title,`"…`]})]}):c&&!r?(0,H.jsxs)(g,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(_,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(_,{dimColor:!0,children:c.message}),(0,H.jsx)(g,{marginTop:1,children:(0,H.jsxs)(_,{dimColor:!0,children:[`Press `,(0,H.jsx)(_,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:u,onCancel:d,isEmbedded:i})}export{J as TeleportResumeWrapper};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bh as t,DC as n,EC as r,Gh as i,MC as a,OC as o,Uh as s,Wh as c,Xu as l,Yd as u,Yu as d,Zd as f,ag as p,kC as m,ng as h,rg as g,zh as _}from"./loadAgentsDir-mcRW90aq.js";import{D as v,H as y,I as b,P as x,T as S,U as C,V as w,Wt as T,Xt as E,fi as D,ot as O,t as k}from"./src-P_wYS_NJ2.js";import{t as A}from"./jsx-runtime-Bb4Xn-E0.js";import{g as j,x as M}from"./settings-DiBMs2gM.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";function F({onThemeSelect:e,showIntroText:t=!1,helpText:n=``,showHelpTextBelow:r=!1,hideEscToCancel:i=!1,skipExitHandling:a=!1,onCancel:d}){let[f]=y(),m=C(),{columns:h}=O(),D=s(),k=D===null?c(f):null,{setPreviewTheme:A,savePreview:j,cancelPreview:P}=w(),F=g(e=>e.settings.syntaxHighlightingDisabled)??!1,L=p();E(`ThemePicker`);let R=o(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);T(`theme:toggleSyntaxHighlighting`,()=>{if(D===null){let e=!F;M(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(a?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(b,{flexDirection:`column`,gap:1,children:[t?(0,I.jsx)(x,{children:`Let's get started.`}):(0,I.jsx)(x,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(b,{flexDirection:`column`,children:[(0,I.jsx)(x,{bold:!0,children:`Choose the text style that looks best with your terminal`}),n&&!r&&(0,I.jsx)(x,{dimColor:!0,children:n})]}),(0,I.jsx)(l,{options:B,onFocus:e=>{A(e)},onChange:t=>{j(),e(t)},onCancel:a?()=>{P(),d?.()}:async()=>{P(),await u(0)},visibleOptionCount:B.length,defaultValue:m,defaultFocusValue:m})]}),(0,I.jsxs)(b,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(b,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(_,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:h})}),(0,I.jsxs)(x,{dimColor:!0,children:[` `,D===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:k?`Syntax theme: ${k.theme}${k.source?` (from ${k.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return t?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{flexDirection:`column`,children:V}),(0,I.jsxs)(b,{marginTop:1,children:[r&&n&&(0,I.jsx)(b,{marginLeft:3,children:(0,I.jsx)(x,{dimColor:!0,children:n})}),!i&&(0,I.jsx)(b,{children:(0,I.jsx)(x,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(S,{children:[(0,I.jsx)(v,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(v,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{D(),P(),a(),k(),m(),r(),n(),h(),f(),j(),d(),i(),t(),I=A()}));export{L as n,F as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{D as u,E as d}from"./config-9rLTDOYW.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:d(e,t,n,r)}var p=e((()=>{u()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
|
|
2
|
-
`)}var h,g=e((()=>{t(),c(),h={branch:n.lineUpDownRight,lastBranch:n.lineUpRight,line:n.lineVertical,empty:` `}}));function _(e){let t={};return e.forEach(e=>{if(!e.path){t[``]=e.message;return}let n=e.path.split(`.`),r=e.path;if(e.invalidValue!==null&&e.invalidValue!==void 0&&n.length>0){let t=[];for(let r=0;r<n.length;r++){let i=n[r];if(i)if(!isNaN(parseInt(i,10))&&r===n.length-1){let n;n=typeof e.invalidValue==`string`?`"${e.invalidValue}"`:e.invalidValue===null?`null`:e.invalidValue===void 0?`undefined`:String(e.invalidValue),t.push(n)}else t.push(i)}r=t.join(`.`)}f(t,r,e.message,Object)}),t}function v({errors:e}){let[t]=r();if(e.length===0)return null;let n=e.reduce((e,t)=>{let n=t.file||`(file not specified)`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,y.jsx)(i,{flexDirection:`column`,children:Object.keys(n).sort().map(e=>{let r=n[e]||[];r.sort((e,t)=>!e.path&&t.path?-1:e.path&&!t.path?1:(e.path||``).localeCompare(t.path||``));let o=_(r),s=new Map;r.forEach(e=>{if(e.suggestion||e.docLink){let t=`${e.suggestion||``}|${e.docLink||``}`;s.has(t)||s.set(t,{suggestion:e.suggestion,docLink:e.docLink})}});let c=m(o,{showValues:!0,themeName:t,treeCharColors:{treeChar:`inactive`,key:`text`,value:`inactive`}});return(0,y.jsxs)(i,{flexDirection:`column`,children:[(0,y.jsx)(a,{children:e}),(0,y.jsx)(i,{marginLeft:1,children:(0,y.jsx)(a,{dimColor:!0,children:c})}),s.size>0&&(0,y.jsx)(i,{flexDirection:`column`,marginTop:1,children:Array.from(s.values()).map((e,t)=>(0,y.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[e.suggestion&&(0,y.jsx)(a,{dimColor:!0,wrap:`wrap`,children:e.suggestion}),e.docLink&&(0,y.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Learn more: `,e.docLink]})]},`suggestion-pair-${t}`))})]},e)})})}var y,b=e((()=>{p(),o(),c(),g(),y=l()}));export{b as n,v as t};
|
|
@@ -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{F as i,I as a,Jg as o,L as s,Qg as c,Zg as l,gT as u,hC as d,mC as f,yT as p}from"./loadAgentsDir-mcRW90aq.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-BPFYBqm1.js";import{n as w,t as T}from"./AddWorkspaceDirectory-BzNj9rS6.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)(f,{children:(0,k.jsx)(h,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),a=t.getAppState(),l=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=o(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let s=S();s.includes(n)||C([...s,n]),u.refreshConfig();let l;if(r)try{c(i),l=`Added ${y.bold(n)} as a working directory and saved to local settings`}catch(e){l=`Added ${y.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else l=`Added ${y.bold(n)} as a working directory for this session`;e(`${l} ${y.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:a.toolPermissionContext,onAddDirectory:l,onCancel:()=>{e(`Did not add a working directory.`)}});let d=await s(r,a.toolPermissionContext);if(d.resultType!==`success`){let t=i(d);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:d.absolutePath,permissionContext:a.toolPermissionContext,onAddDirectory:l,onCancel:()=>{e(`Did not add ${y.bold(d.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{g(),n(),O=t(_(),1),x(),d(),w(),v(),l(),p(),a(),k=b()}))();export{D as call};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{i as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$b as o,$c as s,$f as c,Ap as l,Au as u,BT as d,Bl as f,Dp as p,EC as m,Fx as h,Gl as g,Gp as _,Ja as ee,Jm as v,Jp as te,Kp as y,Mu as ne,Px as re,Q as ie,Q_ as ae,Qb as oe,Qf as se,Tp as ce,VT as le,Vl as ue,Wl as de,Wp as fe,Xb as pe,Xf as me,Xl as he,Xp as ge,Xu as _e,Yl as ve,Yp as ye,Zb as be,Zf as xe,Zp as Se,Zu as Ce,ag as we,at as Te,bE as Ee,bS as De,c as Oe,ch as ke,dC as Ae,dh as je,el as Me,et as Ne,gh as Pe,hh as Fe,im as Ie,jp as b,l as Le,lh as Re,ng as ze,nh as Be,nm as Ve,nv as He,o as Ue,od as We,qm as Ge,qp as Ke,r as qe,rg as Je,rh as Ye,rt as Xe,s as Ze,sd as Qe,t as $e,tm as et,tv as tt,uC as nt,uh as rt,wa as it,xE as at,yE as ot,yS as st,za as ct}from"./loadAgentsDir-mcRW90aq.js";import{C as lt,D as x,I as S,P as C,T as w,Wt as T,di as ut,fi as E,t as D,ui as dt,y as ft}from"./src-P_wYS_NJ2.js";import{t as O}from"./jsx-runtime-Bb4Xn-E0.js";import{n as pt,t as mt}from"./cwd-Besi3Os3.js";import{F as ht,R as gt,S as _t,U as vt,W as yt,Z as bt,x as xt}from"./debug-Dr1SjdXn.js";import{J as St,Ln as Ct,Q as wt,Qt as Tt,Rn as Et,Xt as Dt,at as Ot,it as kt,ln as At,sn as jt}from"./settings-DiBMs2gM.js";import{M as Mt,P as Nt}from"./config-9rLTDOYW.js";import{o as Pt,s as Ft}from"./log-27kCA_9u.js";import{n as It,r as Lt}from"./analytics-DJobLaWP.js";import{C as Rt,v as zt}from"./startupProfiler-Dc5r6LgE.js";import{l as Bt,n as Vt,o as Ht}from"./stringUtils-Df-Lnjxd.js";import{bn as Ut,yn as Wt}from"./prompt-DIlq8NTy.js";import{at as Gt}from"./sessionState-Bn3ESS5f.js";import{a as Kt,i as qt,n as Jt,o as Yt,r as Xt,t as Zt}from"./agentDisplay-D7bdOOG7.js";import{n as Qt,t as $t}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";import{n as en,t as tn}from"./useMergedTools-DYobZ5N4.js";import{n as nn,r as rn,t as an}from"./promptEditor-BILqOGl1.js";import{n as on,t as sn}from"./useMainLoopModel-C00PbZ1Q.js";import{join as k}from"path";import{mkdir as cn,open as ln,unlink as un}from"fs/promises";var A,dn=e((()=>{A={FOLDER_NAME:`.workmate`,AGENTS_DIR:`agents`}}));function fn(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 pn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return k(n(),A.AGENTS_DIR);case`projectSettings`:return k(mt(),A.FOLDER_NAME,A.AGENTS_DIR);case`policySettings`:return k(Dt(),A.FOLDER_NAME,A.AGENTS_DIR);case`localSettings`:return k(mt(),A.FOLDER_NAME,A.AGENTS_DIR)}}function mn(e){switch(e){case`projectSettings`:return k(`.`,A.FOLDER_NAME,A.AGENTS_DIR);default:return pn(e)}}function hn(e){return k(pn(e.source),`${e.agentType}.md`)}function gn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return k(pn(e.source),`${e.filename||e.agentType}.md`)}function _n(e){return e.source===`built-in`?`Built-in`:k(mn(e.source),`${e.agentType}.md`)}function vn(e){return Ze(e)?`Built-in`:Le(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:k(mn(e.source),`${e.filename||e.agentType}.md`)}async function yn(e){let t=pn(e);return await cn(t,{recursive:!0}),t}async function bn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await yn(e);let l=hn({source:e,agentType:t}),u=fn(t,n,r,i,o,s,c);try{await Cn(l,u,a?`wx`:`w`)}catch(e){throw ht(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function xn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Cn(gn(e),fn(e.agentType,t,n,r,i,a,o))}async function Sn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=gn(e);try{await un(t)}catch(e){if(ht(e)!==`ENOENT`)throw e}}async function Cn(e,t,n=`w`){let r=await ln(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var wn=e((()=>{Tt(),Ue(),pt(),r(),gt(),dn()}));function Tn({agent:e,tools:t,onBack:n}){let r=y(e,t,!1),i=vn(e),o=ye(e.agentType);T(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,j.jsx)(C,{children:`All tools`}):!e.tools||e.tools.length===0?(0,j.jsx)(C,{children:`None`}):(0,j.jsxs)(j.Fragment,{children:[r.validTools.length>0&&(0,j.jsx)(C,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,j.jsxs)(C,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,j.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,j.jsx)(C,{dimColor:!0,children:i}),(0,j.jsxs)(S,{flexDirection:`column`,children:[(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,j.jsx)(S,{marginLeft:2,children:(0,j.jsx)(C,{children:e.whenToUse})})]}),(0,j.jsxs)(S,{children:[(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Model`}),`: `,et(e.model)]}),e.permissionMode&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Memory`}),`: `,ot(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,j.jsx)(S,{children:(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`Color`}),`:`,` `,(0,j.jsxs)(C,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Ze(e)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(S,{children:(0,j.jsxs)(C,{children:[(0,j.jsx)(C,{bold:!0,children:`System prompt`}),`:`]})}),(0,j.jsx)(S,{marginLeft:2,marginRight:2,children:(0,j.jsx)(ce,{children:e.getSystemPrompt()})})]})]})}var j,En=e((()=>{i(),E(),D(),m(),ge(),Ee(),_(),Ue(),Ie(),p(),wn(),j=O()}));function Dn({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,On.useState)(Math.max(0,kn.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:kn.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<kn.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=kn[r];n(t===`automatic`?void 0:t)}},s=kn[r];return(0,M.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,M.jsx)(S,{flexDirection:`column`,children:kn.map((e,t)=>{let n=t===r;return(0,M.jsxs)(S,{flexDirection:`row`,gap:1,children:[(0,M.jsx)(C,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,M.jsx)(C,{bold:n,children:`Automatic color`}):(0,M.jsxs)(S,{gap:1,children:[(0,M.jsx)(C,{backgroundColor:te[e],color:`inverseText`,children:` `}),(0,M.jsx)(C,{bold:n,children:Vt(e)})]})]},e)})}),(0,M.jsxs)(S,{marginTop:1,children:[(0,M.jsx)(C,{children:`Preview: `}),s===void 0||s===`automatic`?(0,M.jsxs)(C,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,M.jsxs)(C,{backgroundColor:te[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var On,M,kn,An=e((()=>{i(),On=t(E(),1),D(),ge(),Ht(),M=O(),kn=[`automatic`,...Ke]}));function jn({initialModel:e,onComplete:t,onCancel:n}){let r=Mn.useMemo(()=>{let t=Ve();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Nn.jsxs)(S,{flexDirection:`column`,children:[(0,Nn.jsx)(S,{marginBottom:1,children:(0,Nn.jsx)(C,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Nn.jsx)(_e,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var Mn,Nn,Pn=e((()=>{Mn=t(E(),1),D(),Ie(),Ce(),Nn=O()}));function Fn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([ke.name,rt.name,f.name,nt.name,Be.name,ve.name,de.name,st.name,oe.name])},EDIT:{name:`Edit tools`,toolNames:new Set([se.name,Fe.name,me.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Ge.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function In(e){let t=new Map;return e.forEach(e=>{if(h(e)){let n=Ot(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 Ln({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,N.useMemo)(()=>fe({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[o,s]=(0,N.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,N.useState)(0),[u,d]=(0,N.useState)(!1),f=(0,N.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,g=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},_=(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))})},ee=()=>{let e=i.map(e=>e.name);n(f.length===e.length&&e.every(e=>f.includes(e))?void 0:f)},v=(0,N.useMemo)(()=>{let e=Fn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{h(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]),te=e=>{let t=Ct(e,e=>p.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);_(n,t)}},y=[];y.push({id:`continue`,label:`Continue`,action:ee,isContinue:!0}),y.push({id:`bucket-all`,label:`${m?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);_(e,!m)}});let ne=Fn();[{id:`bucket-readonly`,name:ne.READ_ONLY.name,tools:v.readOnly},{id:`bucket-edit`,name:ne.EDIT.name,tools:v.edit},{id:`bucket-execution`,name:ne.EXECUTION.name,tools:v.execution},{id:`bucket-mcp`,name:ne.MCP.name,tools:v.mcp},{id:`bucket-other`,name:ne.OTHER.name,tools:v.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=Ct(n,e=>p.has(e.name))===n.length;y.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:te(n)})});let re=y.length;y.push({id:`toggle-individual`,label:u?`Hide advanced options`:`Show advanced options`,action:()=>{d(!u),u&&c>re&&l(re)},isToggle:!0});let ie=(0,N.useMemo)(()=>In(i),[i]);return u&&(ie.length>0&&(y.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),ie.forEach(({serverName:e,tools:t})=>{let n=Ct(t,e=>p.has(e.name))===t.length;y.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${Bt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);_(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=Ot(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:()=>g(e.name)})})),T(`confirm:no`,(0,N.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,P.jsxs)(S,{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,P.jsxs)(C,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,P.jsx)(lt,{width:40}),y.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,P.jsxs)(N.Fragment,{children:[r&&(0,P.jsx)(lt,{width:40}),i&&t>0&&(0,P.jsx)(S,{marginTop:1}),(0,P.jsxs)(C,{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,P.jsx)(S,{marginTop:1,flexDirection:`column`,children:(0,P.jsx)(C,{dimColor:!0,children:m?`All tools selected`:`${p.size} of ${i.length} tools selected`})})]})}var N,P,Rn=e((()=>{i(),N=t(E(),1),kt(),re(),_(),wt(),v(),ue(),c(),Ae(),Pe(),Re(),je(),De(),xe(),o(),g(),he(),Ye(),D(),m(),Et(),Ht(),P=O()}));function zn(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:d(jt(e))}var Bn=e((()=>{le(),At()}));function Vn({agent:e,tools:t,onSaved:n,onBack:r}){let i=we(),[o,s]=(0,F.useState)(`menu`),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(null),[f,p]=(0,F.useState)(e.color),m=(0,F.useCallback)(async()=>{let t=await an(gn(e));t.error?d(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),h=(0,F.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!Oe(e)&&!Le(e)?!1:(await xn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&Se(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:qe(n),allAgents:n}}}),n(`Updated agent: ${dt.bold(e.agentType)}`),!0)}catch(e){return d(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,f,n,i]),g=(0,F.useMemo)(()=>[{label:`Open in editor`,action:m},{label:`Edit tools`,action:()=>s(`edit-tools`)},{label:`Edit model`,action:()=>s(`edit-model`)},{label:`Edit color`,action:()=>s(`edit-color`)}],[m]),_=(0,F.useCallback)(()=>{d(null),o===`menu`?r():s(`menu`)},[o,r]),ee=(0,F.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(g.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=g[c];t&&t.action()}},[g,c]);T(`confirm:no`,_,{context:`Confirmation`});let v=()=>(0,I.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:ee,children:[(0,I.jsxs)(C,{dimColor:!0,children:[`Source: `,zn(e.source)]}),(0,I.jsx)(S,{marginTop:1,flexDirection:`column`,children:g.map((e,t)=>(0,I.jsxs)(C,{color:t===c?`suggestion`:void 0,children:[t===c?`${a.pointer} `:` `,e.label]},e.label))}),u&&(0,I.jsx)(S,{marginTop:1,children:(0,I.jsx)(C,{color:`error`,children:u})})]});switch(o){case`menu`:return v();case`edit-tools`:return(0,I.jsx)(Ln,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await h({tools:e})}});case`edit-color`:return(0,I.jsx)(Dn,{agentName:e.agentType,currentColor:f||e.color||`automatic`,onConfirm:async e=>{p(e),s(`menu`),await h({color:e})}});case`edit-model`:return(0,I.jsx)(jn,{initialModel:e.model,onComplete:async e=>{s(`menu`),await h({model:e})}});default:return null}}var F,I,Hn=e((()=>{ut(),i(),E(),F=t(E(),1),ze(),D(),m(),ge(),Ue(),rn(),wn(),An(),Pn(),Rn(),Bn(),I=O()}));function Un({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Qt();return(0,Wn.jsx)(S,{marginLeft:2,children:(0,Wn.jsx)(C,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Wn,Gn=e((()=>{E(),$t(),D(),Wn=O()}));function Kn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:o}){let[s,c]=qn.useState(null),[l,u]=qn.useState(!0),d=qn.useMemo(()=>[...t].sort(Jt),[t]),f=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),p=()=>(0,L.jsxs)(S,{children:[(0,L.jsx)(C,{color:l?`suggestion`:void 0,children:l?`${a.pointer} `:` `}),(0,L.jsx)(C,{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=Kt(e);return(0,L.jsxs)(S,{children:[(0,L.jsx)(C,{dimColor:o&&!n,color:c,children:t?``:n?`${a.pointer} `:` `}),(0,L.jsx)(C,{dimColor:o&&!n,color:c,children:e.agentType}),u&&(0,L.jsxs)(C,{dimColor:!0,color:c,children:[` · `,u]}),e.memory&&(0,L.jsxs)(C,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,L.jsxs)(C,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Xt(i)]})]},`${e.agentType}-${e.source}`)},h=qn.useMemo(()=>{let t=d.filter(e=>e.source!==`built-in`);return e===`all`?Zt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[d,e]);qn.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,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsx)(C,{bold:!0,dimColor:!0,children:e}),t.map(m)]})},ee=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(S,{paddingLeft:2,children:[(0,L.jsx)(C,{bold:!0,dimColor:!0,children:e}),n&&(0,L.jsxs)(C,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>m(e))]})},v=zn(e),te=d.filter(e=>e.source===`built-in`);return!d.length||e!==`built-in`&&!d.some(e=>e.source!==`built-in`)?(0,L.jsx)(ft,{title:v,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,L.jsxs)(S,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,L.jsx)(S,{children:p()}),(0,L.jsx)(C,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,L.jsx)(C,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,L.jsx)(C,{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,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lt,{}),_()]})]})}):(0,L.jsxs)(ft,{title:v,subtitle:`${Ct(d,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[o&&o.length>0&&(0,L.jsx)(S,{marginTop:1,children:(0,L.jsx)(C,{dimColor:!0,children:o[o.length-1]})}),(0,L.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,L.jsx)(S,{marginBottom:1,children:p()}),e===`all`?(0,L.jsxs)(L.Fragment,{children:[Zt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,L.jsx)(qn.Fragment,{children:ee(e,d.filter(e=>e.source===t))},t)),te.length>0&&(0,L.jsxs)(S,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,L.jsxs)(C,{dimColor:!0,children:[(0,L.jsx)(C,{bold:!0,children:`Built-in agents`}),` (always available)`]}),te.map(m)]})]}):e===`built-in`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(C,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,L.jsx)(S,{marginTop:1,flexDirection:`column`,children:d.map(e=>m(e))})]}):(0,L.jsxs)(L.Fragment,{children:[d.filter(e=>e.source!==`built-in`).map(e=>m(e)),d.some(e=>e.source===`built-in`)&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(lt,{}),_()]})]})]})]})}var qn,L,Jn=e((()=>{i(),qn=t(E(),1),D(),qt(),Et(),Bn(),L=O()}));function Yn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,R.useState)(0),[l,u]=(0,R.useState)(t),[d,f]=(0,R.useState)(!1),[p,m]=(0,R.useState)([]);Qt(),(0,R.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,R.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,R.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,R.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),ee=(0,R.useCallback)(()=>{m([]),r&&r()},[r]),v=(0,R.useCallback)(e=>{u(t=>({...t,...e}))},[]),te=(0,R.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:v,goNext:h,goBack:g,goToStep:_,cancel:ee,title:a,showStepCounter:o}),[s,e.length,l,v,h,g,_,ee,a,o]),y=e[s];return!y||d?null:(0,Xn.jsx)(Zn.Provider,{value:te,children:i||(0,Xn.jsx)(y,{})})}var R,Xn,Zn,Qn=e((()=>{R=t(E(),1),$t(),Xn=O(),Zn=(0,R.createContext)(null)}));function z(){let e=(0,$n.useContext)(Zn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var $n,er=e((()=>{$n=t(E(),1),Qn()}));function tr({instructions:e=(0,nr.jsxs)(w,{children:[(0,nr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,nr.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,nr.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Qt();return(0,nr.jsx)(S,{marginLeft:3,marginTop:1,children:(0,nr.jsx)(C,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var nr,rr=e((()=>{$t(),D(),b(),nr=O()}));function B({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=z();return(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(ft,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,ir.jsx)(tr,{instructions:i})]})}var ir,V=e((()=>{D(),er(),rr(),ir=O()})),H=e((()=>{er(),V(),rr(),Qn()}));function ar(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return T(`confirm:no`,t,{context:`Confirmation`}),(0,U.jsx)(B,{subtitle:`Choose background color`,footerText:(0,U.jsxs)(w,{children:[(0,U.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,U.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,U.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,U.jsx)(S,{children:(0,U.jsx)(Dn,{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 U,or=e((()=>{D(),m(),b(),H(),V(),An(),U=O()}));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 ${zn(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=y(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((()=>{_(),Bn()}));function ur({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=z();T(`confirm:no`,a,{context:`Confirmation`});let s=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},c=o.finalAgent,u=cr(c,e,t),d=Rt(c.getSystemPrompt(),240),f=Rt(c.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=Nt()?(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Memory`}),`: `,ot(c.memory)]}):null;return(0,W.jsx)(B,{subtitle:`Confirm and save`,footerText:(0,W.jsxs)(w,{children:[(0,W.jsx)(x,{shortcut:`s/Enter`,action:`save`}),(0,W.jsx)(x,{shortcut:`e`,action:`edit in your editor`}),(0,W.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,W.jsxs)(S,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Location`}),`:`,` `,_n({source:o.location,agentType:c.agentType})]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Tools`}),`: `,p(c.tools)]}),(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Model`}),`: `,et(c.model)]}),m,(0,W.jsx)(S,{marginTop:1,children:(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,W.jsx)(S,{marginLeft:2,marginTop:1,children:(0,W.jsx)(C,{children:f})}),(0,W.jsx)(S,{marginTop:1,children:(0,W.jsxs)(C,{children:[(0,W.jsx)(C,{bold:!0,children:`System prompt`}),`:`]})}),(0,W.jsx)(S,{marginLeft:2,marginTop:1,children:(0,W.jsx)(C,{children:d})}),u.warnings.length>0&&(0,W.jsxs)(S,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(C,{color:`warning`,children:`Warnings:`}),u.warnings.map((e,t)=>(0,W.jsxs)(C,{dimColor:!0,children:[` `,`• `,e]},t))]}),u.errors.length>0&&(0,W.jsxs)(S,{marginTop:1,flexDirection:`column`,children:[(0,W.jsx)(C,{color:`error`,children:`Errors:`}),u.errors.map((e,t)=>(0,W.jsxs)(C,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,W.jsx)(S,{marginTop:1,children:(0,W.jsx)(C,{color:`error`,children:i})}),(0,W.jsx)(S,{marginTop:2,children:(0,W.jsxs)(C,{color:`success`,children:[`Press `,(0,W.jsx)(C,{bold:!0,children:`s`}),` or `,(0,W.jsx)(C,{bold:!0,children:`Enter`}),` to save, `,(0,W.jsx)(C,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var W,dr=e((()=>{D(),m(),Mt(),Ee(),zt(),Ie(),b(),H(),V(),wn(),lr(),W=O()}));function fr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=z(),[i,a]=(0,pr.useState)(null),o=we(),s=(0,pr.useCallback)(async e=>{if(r?.finalAgent)try{await bn(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:qe(t),allAgents:t}}}),$e(),e&&await an(hn({source:r.location,agentType:r.finalAgent.agentType})),Lt(`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: ${dt.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${dt.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((()=>{ut(),pr=t(E(),1),It(),ze(),Ue(),rn(),H(),wn(),dr(),mr=O()}));function gr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,_r.useState)(r.whenToUse||``),[o,s]=(0,_r.useState)(i.length),[c,u]=(0,_r.useState)(null);return T(`confirm:no`,t,{context:`Settings`}),T(`chat:externalEditor`,(0,_r.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,G.jsx)(B,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,G.jsxs)(w,{children:[(0,G.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,G.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,G.jsx)(l,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,G.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,G.jsxs)(S,{flexDirection:`column`,children:[(0,G.jsx)(C,{children:`When should Claude use this agent?`}),(0,G.jsx)(S,{marginTop:1,children:(0,G.jsx)(We,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){u(`Description is required`);return}u(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)(S,{marginTop:1,children:(0,G.jsx)(C,{color:`error`,children:c})})]})})}var _r,G,vr=e((()=>{_r=t(E(),1),D(),m(),rn(),b(),Qe(),H(),V(),G=O()}));async function yr(e,t,n,r){let i=it({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 tt(),o=Te([i],a),s=Nt()?br+xr:br,c=await Ne({messages:ee(o),systemPrompt:Gt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Wt(),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=_t(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=_t(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return Lt(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var br,xr,Sr=e((()=>{He(),ie(),Ut(),wt(),Xe(),ct(),Mt(),It(),xt(),ae(),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 AGENTS.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 AGENTS.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 AGENTS.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}=z(),[i,a]=(0,K.useState)(r.generationPrompt||``),[o,s]=(0,K.useState)(!1),[c,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(i.length),m=on(),h=(0,K.useRef)(null);T(`confirm:no`,(0,K.useCallback)(()=>{h.current&&(h.current.abort(),h.current=null,s(!1),d(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),T(`chat:externalEditor`,(0,K.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),p(e.content.length))},[i]),{context:`Chat`,isActive:!o}),T(`confirm:no`,(0,K.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),d(null),t()},[e,t]),{context:`Settings`,isActive:!o});let g=async()=>{let t=i.trim();if(!t){d(`Please describe what the agent should do`);return}d(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=pe();h.current=r;try{let i=await yr(t,m,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof bt||t instanceof Error&&!t.message.includes(`No assistant message found`)&&d(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),h.current=null}},_=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,q.jsx)(B,{subtitle:_,footerText:(0,q.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,q.jsxs)(S,{flexDirection:`row`,alignItems:`center`,children:[(0,q.jsx)(u,{}),(0,q.jsx)(C,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,q.jsx)(B,{subtitle:_,footerText:(0,q.jsxs)(w,{children:[(0,q.jsx)(l,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,q.jsx)(l,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,q.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,q.jsxs)(S,{flexDirection:`column`,children:[c&&(0,q.jsx)(S,{marginBottom:1,children:(0,q.jsx)(C,{color:`error`,children:c})}),(0,q.jsx)(We,{value:i,onChange:a,onSubmit:g,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:f,onChangeCursorOffset:p,focus:!0,showCursor:!0})]})})}var K,q,wr=e((()=>{yt(),K=t(E(),1),sn(),D(),m(),be(),rn(),b(),ne(),Qe(),H(),V(),Sr(),q=O()}));function Tr(){let{goNext:e,updateWizardData:t,cancel:n}=z();return(0,J.jsx)(B,{subtitle:`Choose location`,footerText:(0,J.jsxs)(w,{children:[(0,J.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,J.jsx)(S,{children:(0,J.jsx)(_e,{options:[{label:`Project (.workmate/agents/)`,value:`projectSettings`},{label:`Personal (~/.workmate/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var J,Er=e((()=>{D(),b(),Ce(),H(),V(),J=O()}));function Dr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();T(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.workmate/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.workmate/agent-memory/)`,value:`project`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.workmate/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.workmate/agent-memory/)`,value:`user`},{label:`Local scope (.workmate/agent-memory-local/)`,value:`local`}];return(0,Y.jsx)(B,{subtitle:`Configure agent memory`,footerText:(0,Y.jsxs)(w,{children:[(0,Y.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Y.jsx)(S,{children:(0,Y.jsx)(_e,{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:Nt()&&i&&a?()=>r.systemPrompt+`
|
|
101
|
-
|
|
102
|
-
`+at(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var Y,Or=e((()=>{D(),m(),Mt(),Ee(),b(),Ce(),H(),V(),Y=O()}));function kr(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=z();return(0,X.jsx)(B,{subtitle:`Creation method`,footerText:(0,X.jsxs)(w,{children:[(0,X.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(S,{children:(0,X.jsx)(_e,{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((()=>{D(),b(),Ce(),H(),V(),X=O()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z();return(0,Mr.jsx)(B,{subtitle:`Select model`,footerText:(0,Mr.jsxs)(w,{children:[(0,Mr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Mr.jsx)(x,{shortcut:`Enter`,action:`select`}),(0,Mr.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Mr.jsx)(jn,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Mr,Nr=e((()=>{b(),D(),H(),V(),Pn(),Mr=O()}));function Pr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=z(),[i,a]=(0,Fr.useState)(r.systemPrompt||``),[o,s]=(0,Fr.useState)(i.length),[c,u]=(0,Fr.useState)(null);return T(`confirm:no`,t,{context:`Settings`}),T(`chat:externalEditor`,(0,Fr.useCallback)(async()=>{let e=await nn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(B,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(w,{children:[(0,Z.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(l,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(S,{flexDirection:`column`,children:[(0,Z.jsx)(C,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(C,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(S,{marginTop:1,children:(0,Z.jsx)(We,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){u(`System prompt is required`);return}u(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)(S,{marginTop:1,children:(0,Z.jsx)(C,{color:`error`,children:c})})]})})}var Fr,Z,Ir=e((()=>{Fr=t(E(),1),D(),m(),rn(),b(),Qe(),H(),V(),Z=O()}));function Lr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Rr.jsx)(B,{subtitle:`Select tools`,footerText:(0,Rr.jsxs)(w,{children:[(0,Rr.jsx)(x,{shortcut:`Enter`,action:`toggle selection`}),(0,Rr.jsx)(x,{shortcut:`↑↓`,action:`navigate`}),(0,Rr.jsx)(l,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Rr.jsx)(Ln,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Rr,zr=e((()=>{D(),b(),H(),V(),Rn(),Rr=O()}));function Br(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=z(),[a,o]=(0,Vr.useState)(i.agentType||``),[s,c]=(0,Vr.useState)(null),[u,d]=(0,Vr.useState)(a.length);return T(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(B,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(w,{children:[(0,Q.jsx)(x,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(x,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(l,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(S,{flexDirection:`column`,children:[(0,Q.jsx)(C,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(S,{marginTop:1,children:(0,Q.jsx)(We,{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:u,onChangeCursorOffset:d,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(S,{marginTop:1,children:(0,Q.jsx)(C,{color:`error`,children:s})})]})})}var Vr,Q,Hr=e((()=>{Vr=t(E(),1),D(),m(),b(),Qe(),H(),V(),lr(),Q=O()}));function Ur({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Wr.jsx)(Yn,{steps:[Tr,kr,Cr,()=>(0,Wr.jsx)(Br,{existingAgents:t}),Pr,gr,()=>(0,Wr.jsx)(Lr,{tools:e}),jr,ar,...Nt()?[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((()=>{Mt(),H(),or(),hr(),vr(),wr(),Er(),Or(),Ar(),Nr(),Ir(),zr(),Hr(),Wr=O()}));function Kr({tools:e,onExit:t}){let[n,r]=(0,qr.useState)({mode:`list-agents`,source:`all`}),i=Je(e=>e.agentDefinitions),a=Je(e=>e.mcp.tools),o=Je(e=>e.toolPermissionContext),s=we(),{allAgents:c,activeAgents:l}=i,[u,d]=(0,qr.useState)([]),f=en(e,a,o);Qt();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]),m=(0,qr.useCallback)(e=>{d(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),h=(0,qr.useCallback)(async e=>{try{await Sn(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:qe(n)}}}),d(t=>[...t,`Deleted agent: ${dt.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Ft(vt(e))}},[s]);switch(n.mode){case`list-agents`:{let e=Yt(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)(Kn,{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)(Un,{})]})}case`create-agent`:return(0,$.jsx)(Ur,{tools:f,existingAgents:l,onComplete:m,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)(ft,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(S,{flexDirection:`column`,children:[(0,$.jsx)(_e,{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)(S,{marginTop:1,children:(0,$.jsx)(C,{dimColor:!0,children:u[u.length-1]})})]})}),(0,$.jsx)(Un,{})]})}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)(ft,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(Tn,{agent:e,tools:f,allAgents:c,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Un,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(ft,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(C,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(C,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(S,{marginTop:1,children:(0,$.jsxs)(C,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(S,{marginTop:1,children:(0,$.jsx)(_e,{options:[{label:`Yes, delete`,value:`yes`},{label:`No, cancel`,value:`no`}],onChange:e=>{e===`yes`?h(n.agent):`previousMode`in n&&r(n.previousMode)},onCancel:()=>{`previousMode`in n&&r(n.previousMode)}})})]}),(0,$.jsx)(Un,{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)(ft,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Vn,{agent:e,tools:f,onSaved:e=>{m(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Un,{})]})}default:return null}}var qr,$,Jr=e((()=>{ut(),E(),qr=t(E(),1),$t(),tn(),D(),ze(),qt(),Ue(),gt(),Pt(),Ce(),En(),Hn(),Gn(),Jn(),wn(),Gr(),$=O()}));async function Yr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Xr.jsx)(Kr,{tools:s(n),onExit:e})}var Xr;e((()=>{E(),Jr(),Me(),Xr=O()}))();export{Yr as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Wx as t,qx as n}from"./loadAgentsDir-mcRW90aq.js";import{g as r,u as i}from"./settings-DiBMs2gM.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-f3GN2I_J.js";t();export{e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";var t,n,r;e((()=>{t=()=>{},n=()=>{},r=()=>{}}))();export{t as clearAttributionCaches,r as registerAttributionHooks,n as sweepFileContentCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./auth-Czy7GoRh.js";export{t as authLogin,e as authStatus};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-C29_32BD.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(e){r=[e,...r.slice(0,i-1)]}function n(){return r}var r,i,a=e((()=>{r=[],i=20}));export{a as n,t as r,n as t};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{Ac as r,Da as i,Ea as a,IC as o,Ld as s,Q as c,Q_ as l,RC as u,Rd as d,Sr as ee,Xb as te,Zb as ne,dm as re,dr as f,et as p,jc as m,pt as h,rp as g,tp as ie,wa as ae,wt as oe,za as _}from"./loadAgentsDir-mcRW90aq.js";import{R as v,W as y,Wt as b}from"./state-BPFYBqm1.js";import{n as se,t as x}from"./cwd-Besi3Os3.js";import{R as S,U as C,c as w,f as T,i as E,u as D,x as O}from"./debug-Dr1SjdXn.js";import{f as k,g as A,y as j}from"./settings-DiBMs2gM.js";import{S as M}from"./config-9rLTDOYW.js";import{o as N,s as P,v as F,y as I}from"./log-27kCA_9u.js";import{n as L,r as R}from"./analytics-DJobLaWP.js";import{_ as z,h as B}from"./model-C29_32BD.js";import{bn as V,yn as H}from"./prompt-DIlq8NTy.js";import{at as U}from"./sessionState-Bn3ESS5f.js";import{i as W,t as G}from"./nativeInstaller-DqbEfGSX.js";import{n as K,t as ce}from"./allErrors-C1eMbHSv.js";import{r as le}from"./magicDocs-26J_l1De.js";import{n as ue,t as de}from"./pluginAutoupdate-ByH9IPC9.js";import{n as fe,r as pe}from"./registerProtocol-DduKPsn_.js";import"os";import{join as q}from"path";import"crypto";n(),b(),se(),O(),T(),E(),I(),A(),V(),z(),m(),ee(),le(),c(),N(),S(),_(),l(),c(),ne(),S(),N(),_(),l(),re();async function me(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),o=n(x(),`.workmate`,`skills`,e,`SKILL.md`),s;try{s=await r.readFile(o,`utf-8`)}catch{P(Error(`Failed to read skill file for improvement: ${o}`));return}let c=t.map(e=>`- ${e.section}: ${e.change}`).join(`
|
|
2
|
-
`),l=B(),u=await p({messages:[ae({content:`You are editing a skill definition file. Apply the following improvements to the skill.
|
|
3
|
-
|
|
4
|
-
<current_skill_file>
|
|
5
|
-
${s}
|
|
6
|
-
</current_skill_file>
|
|
7
|
-
|
|
8
|
-
<improvements>
|
|
9
|
-
${c}
|
|
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:U([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:te().signal,options:{getToolPermissionContext:async()=>H(),model:l,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),d=a(i(Array.isArray(u.message.content)?u.message.content:[]).trim(),`updated_file`);if(!d){P(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(o,d,`utf-8`)}catch(e){P(C(e))}}L(),g(),M(),N(),G(),d(),K(),u(),oe();var he=30;function J(){let e=((k()||{}).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 D().readdir(e);for(let a of i)try{_e(a.name)<t&&(await D().unlink(q(e,a.name)),n?r.messages++:r.errors++)}catch(e){P(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&P(e)}return r}async function ve(){let e=D(),t=J(),n=F.errors(),r=F.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`&&P(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=f(),r=D(),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),s;try{s=await r.readdir(i)}catch{t.errors++;continue}for(let n of s)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),s=q(a,o),c;try{c=await r.readdir(s)}catch{await Z(a,r);continue}for(let n of c)if(n.isFile())try{await X(q(s,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=q(s,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(s,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=D(),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=D();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){P(e)}return n}async function Ce(){let e=J(),n={messages:0,errors:0},r=D();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){P(e)}return n}async function we(){let e=J(),n={messages:0,errors:0},r=D(),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&&j(`cleanupPeriodDays`)){w(`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 s(J());let t=await h(J());t>0&&R(`tengu_worktree_cleanup`,{removed:t})}b(),G(),ue();var Te=(fe(),e(pe)),$=600*1e3;function Ee(){import(`./extractMemories-6OnMgL2S.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),r(),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 W()}setTimeout(t,$).unref()}export{me as n,Ee as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping-C_ArdTFX.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Or as t,Sr as n,_r as r,ci as i,mi as a,ur as o,vr as s}from"./loadAgentsDir-mcRW90aq.js";import{Wt as c,et as l,pt as u}from"./state-BPFYBqm1.js";import{C as d,x as f}from"./debug-Dr1SjdXn.js";import{c as p,s as m}from"./types-BJ7qTz75.js";import{n as h,r as g}from"./analytics-DJobLaWP.js";import{i as _,o as v}from"./stringUtils-Df-Lnjxd.js";import{randomUUID as y}from"crypto";import{mkdir as b,readFile as x,writeFile as S}from"fs/promises";function C(e){let t=e?.message?.content;if(!t)return`Branched conversation`;let n=typeof t==`string`?t:t.find(e=>e.type===`text`)?.text;return n&&n.replace(/\s+/g,` `).trim().slice(0,100)||`Branched conversation`}async function w(e){let n=y(),i=u(),a=o(l()),c=s(n),f=r();await b(a,{recursive:!0,mode:448});let m;try{m=await x(f)}catch{throw Error(`No conversation to branch`)}if(m.length===0)throw Error(`No conversation to branch`);let h=p(m),g=h.filter(e=>t(e)&&!e.isSidechain),_=h.filter(e=>e.type===`content-replacement`&&e.sessionId===i).flatMap(e=>e.replacements);if(g.length===0)throw Error(`No messages to branch`);let v=null,C=[],w=[];for(let e of g){let t={...e,sessionId:n,parentUuid:v,isSidechain:!1,forkedFrom:{sessionId:i,messageUuid:e.uuid}},r={...e,sessionId:n};w.push(r),C.push(d(t)),e.type!==`progress`&&(v=e.uuid)}if(_.length>0){let e={type:`content-replacement`,sessionId:n,replacements:_};C.push(d(e))}return await S(c,C.join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`,{encoding:`utf8`,mode:384}),{sessionId:n,title:e,forkPath:c,serializedMessages:w,contentReplacementRecords:_}}async function T(e){let t=`${e} (Branch)`;if((await a(t,{exact:!0})).length===0)return t;let n=await a(`${e} (Branch`),r=new Set([1]),i=RegExp(`^${_(e)} \\(Branch(?: (\\d+))?\\)$`);for(let e of n){let t=e.customTitle?.match(i);t&&(t[1]?r.add(parseInt(t[1],10)):r.add(1))}let o=2;for(;r.has(o);)o++;return`${e} (Branch ${o})`}async function E(e,t,n){let r=n?.trim()||void 0,a=u();try{let{sessionId:n,title:o,forkPath:s,serializedMessages:c,contentReplacementRecords:l}=await w(r),u=new Date,d=C(c.find(e=>e.type===`user`)),f=await T(o??d);await i(n,f,s),g(`tengu_conversation_forked`,{message_count:c.length,has_custom_title:!!o});let p={date:u.toISOString().split(`T`)[0],messages:c,fullPath:s,value:u.getTime(),created:u,modified:u,firstPrompt:d,messageCount:c.length,isSidechain:!1,sessionId:n,customTitle:f,contentReplacements:l},m=o?` "${o}"`:``,h=`Branched conversation${m}. You are now in the branch.${`\nTo resume the original: claude -r ${a}`}`;return t.resume?(await t.resume(n,p,`fork`),e(h,{display:`system`})):e(`Branched conversation${m}. Resume with: /resume ${n}`),null}catch(t){return e(`Failed to branch conversation: ${t instanceof Error?t.message:`Unknown error occurred`}`),null}}e((()=>{c(),h(),m(),n(),f(),v()}))();export{E as call,C as deriveFirstPrompt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n,t as r}from"./bridgeConfig-B80T_lw7.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CS as e,xS as t}from"./loadAgentsDir-mcRW90aq.js";import{t as n}from"./src-P_wYS_NJ2.js";import{v as r}from"./startupProfiler-Dc5r6LgE.js";import{a as i,n as a,o}from"./bridgeConfig-B80T_lw7.js";e(),i(),n(),r();function s(e,n){return`${o()?a():t(void 0,n)}/code?bridge=${e}`}function c({error:e,connected:t,sessionActive:n,reconnecting:r}){return e?{label:`Remote Control failed`,color:`error`}:r?{label:`Remote Control reconnecting`,color:`warning`}:n||t?{label:`Remote Control active`,color:`success`}:{label:`Remote Control connecting…`,color:`warning`}}function l(e){return`Code everywhere with the Claude app or ${e}`}function u(e){return`Continue coding in the Claude app or ${e}`}var d=`Something went wrong, please try again`;export{c as a,l as i,u as n,s as r,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Dp as n,Fu as r,Iu as i,MC as a,Q_ as o,Tp as s,Xb as c,Zb as l,ct as u,dc as d,ev as f,ja as p,nv as m,st as h,tv as g,uc as _,za as v}from"./loadAgentsDir-mcRW90aq.js";import{I as y,P as b,bn as x,fi as S,ot as C,t as w,vn as T,xt as E}from"./src-P_wYS_NJ2.js";import{t as D}from"./jsx-runtime-Bb4Xn-E0.js";import{P as O,R as k}from"./debug-Dr1SjdXn.js";import{Wt as A}from"./settings-DiBMs2gM.js";import{h as j,y as M}from"./config-9rLTDOYW.js";import{at as N}from"./sessionState-Bn3ESS5f.js";import{n as P,r as F}from"./sideQuestion-BHRtwhyj.js";import{i as I,n as L}from"./modalContext-CUThy6Ph.js";function R({question:e,context:t,onDone:n}){let[i,a]=(0,H.useState)(null),[o,l]=(0,H.useState)(null),[u,d]=(0,H.useState)(0),f=(0,H.useRef)(null),{rows:p}=I(C());x(()=>d(e=>e+1),i||o?null:80);function m(e){if(e.key===`escape`||e.key===`return`||e.key===` `||e.ctrl&&(e.key===`c`||e.key===`d`)){e.preventDefault(),n(void 0,{display:`skip`});return}(e.key===`up`||e.ctrl&&e.key===`p`)&&(e.preventDefault(),f.current?.scrollBy(-3)),(e.key===`down`||e.ctrl&&e.key===`n`)&&(e.preventDefault(),f.current?.scrollBy(K))}(0,H.useEffect)(()=>{let n=c();async function r(){try{let r=await F({question:e,cacheSafeParams:await B(t)});n.signal.aborted||(r.response?a(r.response):l(`No response received`))}catch(e){n.signal.aborted||l(O(e)||`Failed to get response`)}}return r(),()=>{n.abort()}},[e,t]);let h=Math.max(5,p-W-G);return(0,U.jsxs)(y,{flexDirection:`column`,paddingLeft:2,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:m,children:[(0,U.jsxs)(y,{children:[(0,U.jsxs)(b,{color:`warning`,bold:!0,children:[`/btw`,` `]}),(0,U.jsx)(b,{dimColor:!0,children:e})]}),(0,U.jsx)(y,{marginTop:1,marginLeft:2,maxHeight:h,children:(0,U.jsx)(E,{ref:f,flexDirection:`column`,flexGrow:1,children:o?(0,U.jsx)(b,{color:`error`,children:o}):i?(0,U.jsx)(s,{children:i}):(0,U.jsxs)(y,{children:[(0,U.jsx)(r,{frame:u,messageColor:`warning`}),(0,U.jsx)(b,{color:`warning`,children:`Answering...`})]})})}),(i||o)&&(0,U.jsx)(y,{marginTop:1,children:(0,U.jsxs)(b,{dimColor:!0,children:[`↑`,`/`,`↓`,` to scroll · Space, Enter, or Escape to dismiss`]})})]})}function z(e){let t=e.at(-1);return t?.type===`assistant`&&t.message.stop_reason===null?e.slice(0,-1):e}async function B(e){let t=p(z(e.messages)),n=_();if(n)return{systemPrompt:n.systemPrompt,userContext:n.userContext,systemContext:n.systemContext,toolUseContext:e,forkContextMessages:t};let[r,i,a]=await Promise.all([h(e.options.tools,e.options.mainLoopModel,[],e.options.mcpClients),g(),f()]);return{systemPrompt:N(r),userContext:i,systemContext:a,toolUseContext:e,forkContextMessages:t}}async function V(e,t,n){let r=n?.trim();return r?(M(e=>({...e,btwUseCount:e.btwUseCount+1})),(0,U.jsx)(R,{question:r,context:t,onDone:e})):(e(`Usage: /btw <your question>`,{display:`system`}),null)}var H,U,W,G,K;e((()=>{S(),H=t(S(),1),T(),n(),i(),A(),u(),L(),m(),a(),w(),l(),j(),k(),d(),v(),P(),o(),U=D(),W=5,G=6,K=3}))();export{V as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$_ as t,As as n,Dv as r,Eh as i,JC as a,Ji as o,Lm as s,Qi as c,Th as l,Tu as u,Y as d,av as f,ev as p,ib as m,iv as h,ki as g,ks as _,kv as v,np as y,nv as b,om as x,q as S,qC as C,rb as w,rp as T,rv as E,tv as D,wu as O,zi as k,zm as A}from"./loadAgentsDir-mcRW90aq.js";import{On as j,Wt as M,l as N}from"./state-BPFYBqm1.js";import{S as P,v as F}from"./git-CoQQ6YEf.js";import{i as I,t as L}from"./detectRepository-CMEkS5_2.js";import{a as R,n as z}from"./fileSuggestions-BalHmi1-.js";import{r as B,t as V}from"./magicDocs-26J_l1De.js";function H(e=new Set){let r=e.size>0;D.cache.clear?.(),p.cache.clear?.(),t.cache.clear?.(),h.cache.clear?.(),z(),g(),r||v(),E(null),j(null),A(),n(),m(`session_start`),y(),O(),import(`./attributionHooks-CUAoGkU6.js`).then(({clearAttributionCaches:e})=>e()),L(),S(),N(e),F(),o(),i(),V(),C(),import(`./SearchExtraToolsTool-Bq87I_vu.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-4UC4yLg1.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-DV5tCLRh.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),k(),f(),b(),R(),x(),r(),u(),s(),l(),B(),c(),_(),d(),w(),I(),P(),T(),a()}));export{U as n,H as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-C5DIVdvI.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as e,R as t}from"./debug-Dr1SjdXn.js";import{o as n,s as r}from"./log-27kCA_9u.js";import{i,o as a,t as o}from"./platform-Dg1c9F_1.js";import{a as s,i as c,s as l,u}from"./types-BJ7qTz75.js";import{homedir as d}from"os";import{join as f}from"path";import{readFile as p,readdir as m,stat as h}from"fs/promises";s(),t(),l(),n(),a();async function g(){let e=i();if(!o.includes(e))throw Error(`Unsupported platform: ${e} - Claude Desktop integration only works on macOS and WSL.`);if(e===`macos`)return f(d(),`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);let t=process.env.USERPROFILE?process.env.USERPROFILE.replace(/\\/g,`/`):null;if(t){let e=`/mnt/c${t.replace(/^[A-Z]:/,``)}/AppData/Roaming/Claude/claude_desktop_config.json`;try{return await h(e),e}catch{}}try{let e=`/mnt/c/Users`;try{let t=await m(e,{withFileTypes:!0});for(let n of t){if(n.name===`Public`||n.name===`Default`||n.name===`Default User`||n.name===`All Users`)continue;let t=f(e,n.name,`AppData`,`Roaming`,`Claude`,`claude_desktop_config.json`);try{return await h(t),t}catch{}}}catch{}}catch(e){r(e)}throw Error(`Could not find Claude Desktop config file in Windows. Make sure Claude Desktop is installed on Windows.`)}async function _(){if(!o.includes(i()))throw Error(`Unsupported platform - Claude Desktop integration only works on macOS and WSL.`);try{let t=await g(),n;try{n=await p(t,{encoding:`utf8`})}catch(t){if(e(t)===`ENOENT`)return{};throw t}let r=u(n);if(!r||typeof r!=`object`)return{};let i=r.mcpServers;if(!i||typeof i!=`object`)return{};let a={};for(let[e,t]of Object.entries(i)){if(!t||typeof t!=`object`)continue;let n=c().safeParse(t);n.success&&(a[e]=n.data)}return a}catch(e){return r(e),{}}}export{_ as readClaudeDesktopMcpServers};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./client-BMA05FW8.js";e();export{t as clearOpenAIClientCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fr as e,Pr as t}from"./model-C29_32BD.js";e();export{t as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Pi as e,ki as t,zi as n}from"./loadAgentsDir-mcRW90aq.js";n();export{t as clearCommandsCache,e as getCommands};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,Dv as n,Lm as r,Nm as i,Ov as a,Tv as o,X_ as s,Z_ as c,_n as l,bp as u,ct as d,dv as f,ev as p,f_ as m,g_ as h,h_ as g,jC as _,ja as v,jm as y,nv as b,ov as x,p_ as S,st as C,sv as w,tv as T,uv as E,xp as D,yv as O,za as k,zm as A}from"./loadAgentsDir-mcRW90aq.js";import{di as j,ui as M}from"./src-P_wYS_NJ2.js";import{Wt as N,qt as P}from"./state-BPFYBqm1.js";import{L as F,R as I}from"./debug-Dr1SjdXn.js";import{o as L,s as R}from"./log-27kCA_9u.js";function z(e,n){let r=u(`tip`),i=t(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...n?[n]:[],...r?[r]:[]];return M.dim(`Compacted `+a.join(`
|
|
2
|
-
`))}async function B(e,t){let n=e.getAppState(),r=await C(e.options.tools,e.options.mainLoopModel,Array.from(n.toolPermissionContext.additionalWorkingDirectories.keys()),e.options.mcpClients),i=s({mainThreadAgentDefinition:void 0,toolUseContext:e,customSystemPrompt:e.options.customSystemPrompt,defaultSystemPrompt:r,appendSystemPrompt:e.options.appendSystemPrompt}),[a,o]=await Promise.all([T(),p()]);return{systemPrompt:i,userContext:a,systemContext:o,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{j(),N(),d(),b(),_(),n(),h(),E(),x(),r(),y(),O(),I(),l(),L(),k(),D(),c(),V=async(e,t)=>{let{abortController:n}=t,{messages:r}=t;if(r=v(r),r.length===0)throw Error(`No messages to compact`);let s=e.trim();try{if(!s){let e=await i(r,t.agentId);if(e)return T.cache.clear?.(),A(),a(t.options.querySource??`compact`,t.agentId),P(),f(),{type:`compact`,compactionResult:e,displayText:z(t)}}let e=(await w(r,t)).messages,n=await g(e,t,await B(t,e),!1,s,!1);return o(void 0),f(),T.cache.clear?.(),A(),{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(S):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(m):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-BKdLcyXe.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Config`})}))();export{a as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{Y_ as r,ja as i,ov as a,q_ as o,sv as s,za as c}from"./loadAgentsDir-mcRW90aq.js";import{I as l,P as u,fi as d,s as f,t as p}from"./src-P_wYS_NJ2.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{cn as h,ln as g,wn as _,xn as v}from"./settings-DiBMs2gM.js";import{_ as y,v as b}from"./startupProfiler-Dc5r6LgE.js";import{Et as x,Zt as S,an as C,on as w,rn as T,wt as E}from"./prompt-DIlq8NTy.js";import{n as D,t as O}from"./staticRender-DrU6eWoq.js";function k(e){let t=[];return A(e,t),j(e,t),N(e,t),P(e,t),F(e,t),t.sort((e,t)=>e.severity===t.severity?(t.savingsTokens??0)-(e.savingsTokens??0):e.severity===`warning`?-1:1),t}function A(e,t){e.percentage>=z&&t.push({severity:`warning`,title:`Context is ${e.percentage}% full`,detail:e.isAutoCompactEnabled?`Autocompact will trigger soon, which discards older messages. Use /compact now to control what gets kept.`:`Autocompact is disabled. Use /compact to free space, or enable autocompact in /config.`})}function j(e,t){if(e.messageBreakdown)for(let n of e.messageBreakdown.toolCallsByType){let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100;if(i<I||r<L)continue;let a=M(n.name,r,i);a&&t.push(a)}}function M(e,t,n){let r=y(t);switch(e){case C:return{severity:`warning`,title:`Bash results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Pipe output through head, tail, or grep to reduce result size. Avoid cat on large files — use Read with offset/limit instead.`,savingsTokens:Math.floor(t*.5)};case S:return{severity:`info`,title:`Read results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Use offset and limit parameters to read only the sections you need. Avoid re-reading entire files when you only need a few lines.`,savingsTokens:Math.floor(t*.3)};case E:return{severity:`info`,title:`Grep results using ${r} tokens (${n.toFixed(0)}%)`,detail:`Add more specific patterns or use the glob or type parameter to narrow file types. Consider Glob for file discovery instead of Grep.`,savingsTokens:Math.floor(t*.3)};default:return n>=20?{severity:`info`,title:`${e} using ${r} tokens (${n.toFixed(0)}%)`,detail:`This tool is consuming a significant portion of context.`,savingsTokens:Math.floor(t*.2)}:null}}function N(e,t){if(!e.messageBreakdown)return;let n=e.messageBreakdown.toolCallsByType.find(e=>e.name===S);if(!n)return;let r=n.callTokens+n.resultTokens,i=r/e.rawMaxTokens*100,a=n.resultTokens/e.rawMaxTokens*100;i>=I&&r>=L||a>=R&&n.resultTokens>=L&&t.push({severity:`info`,title:`File reads using ${y(n.resultTokens)} tokens (${a.toFixed(0)}%)`,detail:`If you are re-reading files, consider referencing earlier reads. Use offset/limit for large files.`,savingsTokens:Math.floor(n.resultTokens*.3)})}function P(e,t){let n=e.memoryFiles.reduce((e,t)=>e+t.tokens,0),r=n/e.rawMaxTokens*100;if(r>=B&&n>=V){let i=[...e.memoryFiles].sort((e,t)=>t.tokens-e.tokens).slice(0,3).map(e=>`${v(e.path)} (${y(e.tokens)})`).join(`, `);t.push({severity:`info`,title:`Memory files using ${y(n)} tokens (${r.toFixed(0)}%)`,detail:`Largest: ${i}. Use /memory to review and prune stale entries.`,savingsTokens:Math.floor(n*.3)})}}function F(e,t){!e.isAutoCompactEnabled&&e.percentage>=50&&e.percentage<z&&t.push({severity:`info`,title:`Autocompact is disabled`,detail:`Without autocompact, you will hit context limits and lose the conversation. Enable it in /config or use /compact manually.`})}var I,L,R,z,B,V,H=e((()=>{w(),T(),x(),_(),b(),I=15,L=1e4,R=5,z=80,B=5,V=5e3}));function U({suggestions:e}){return e.length===0?null:(0,W.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,W.jsx)(u,{bold:!0,children:`Suggestions`}),e.map((e,t)=>(0,W.jsxs)(l,{flexDirection:`column`,marginTop:t===0?0:1,children:[(0,W.jsxs)(l,{children:[(0,W.jsx)(f,{status:e.severity,withSpace:!0}),(0,W.jsx)(u,{bold:!0,children:e.title}),e.savingsTokens?(0,W.jsxs)(u,{dimColor:!0,children:[` `,n.arrowRight,` save ~`,y(e.savingsTokens)]}):null]}),(0,W.jsx)(l,{marginLeft:2,children:(0,W.jsx)(u,{dimColor:!0,children:e.detail})})]},t))]})}var W,G=e((()=>{t(),d(),p(),b(),W=m()}));function K(){return null}function q(e){let t=new Map;for(let n of e){let e=h(n.source),r=t.get(e)||[];r.push(n),t.set(e,r)}for(let[e,n]of t.entries())t.set(e,n.sort((e,t)=>t.tokens-e.tokens));let n=new Map;for(let e of Z){let r=t.get(e);r&&n.set(e,r)}return n}function J({data:e}){let{categories:t,totalTokens:n,rawMaxTokens:r,percentage:i,gridRows:a,model:o,memoryFiles:s,mcpTools:c,deferredBuiltinTools:d=[],agents:f,skills:p,cacheHitRate:m,cacheThreshold:h}=e,g=t.filter(e=>e.tokens>0&&e.name!==`Free space`&&e.name!==X&&!e.isDeferred),_=t.some(e=>e.isDeferred&&e.name.includes(`MCP`)),b=t.find(e=>e.name===X);return(0,Y.jsxs)(l,{flexDirection:`column`,paddingLeft:1,children:[(0,Y.jsx)(u,{bold:!0,children:`Context Usage`}),(0,Y.jsxs)(l,{flexDirection:`row`,gap:2,children:[(0,Y.jsx)(l,{flexDirection:`column`,flexShrink:0,children:a.map((e,t)=>(0,Y.jsx)(l,{flexDirection:`row`,marginLeft:-1,children:e.map((e,t)=>e.categoryName===`Free space`?(0,Y.jsx)(u,{dimColor:!0,children:`⛶ `},t):e.categoryName===X?(0,Y.jsx)(u,{color:e.color,children:`⛝ `},t):(0,Y.jsx)(u,{color:e.color,children:e.squareFullness>=.7?`⛁ `:`⛀ `},t))},t))}),(0,Y.jsxs)(l,{flexDirection:`column`,gap:0,flexShrink:0,children:[(0,Y.jsxs)(u,{dimColor:!0,children:[o,` · `,y(n),`/`,y(r),` tokens (`,i,`%)`]}),(0,Y.jsx)(K,{}),m!==void 0&&h!==void 0&&(0,Y.jsxs)(u,{color:m<h?`warning`:void 0,children:[`Cache hit rate: `,m.toFixed(0),`%`,m<h?` (below ${h}% threshold)`:``]}),(0,Y.jsx)(u,{children:` `}),(0,Y.jsx)(u,{dimColor:!0,italic:!0,children:`Estimated usage by category`}),g.map((e,t)=>{let n=y(e.tokens),i=e.isDeferred?`N/A`:`${(e.tokens/r*100).toFixed(1)}%`,a=e.name===X,o=e.name,s=e.isDeferred?` `:a?`⛝`:`⛁`;return(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{color:e.color,children:s}),(0,Y.jsxs)(u,{children:[` `,o,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[n,` tokens (`,i,`)`]})]},t)}),(t.find(e=>e.name===`Free space`)?.tokens??0)>0&&(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{dimColor:!0,children:`⛶`}),(0,Y.jsx)(u,{children:` Free space: `}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(t.find(e=>e.name===`Free space`)?.tokens||0),` (`,((t.find(e=>e.name===`Free space`)?.tokens||0)/r*100).toFixed(1),`%)`]})]}),b&&b.tokens>0&&(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{color:b.color,children:`⛝`}),(0,Y.jsxs)(u,{dimColor:!0,children:[` `,b.name,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(b.tokens),` tokens (`,(b.tokens/r*100).toFixed(1),`%)`]})]})]})]}),(0,Y.jsxs)(l,{flexDirection:`column`,marginLeft:-1,children:[c.length>0&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{bold:!0,children:`MCP tools`}),(0,Y.jsxs)(u,{dimColor:!0,children:[` · /mcp`,_?` (loaded on-demand)`:``]})]}),c.some(e=>e.isLoaded)&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsx)(u,{dimColor:!0,children:`Loaded`}),c.filter(e=>e.isLoaded).map((e,t)=>(0,Y.jsxs)(l,{children:[(0,Y.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(e.tokens),` tokens`]})]},t))]}),_&&c.some(e=>!e.isLoaded)&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsx)(u,{dimColor:!0,children:`Available`}),c.filter(e=>!e.isLoaded).map((e,t)=>(0,Y.jsx)(l,{children:(0,Y.jsxs)(u,{dimColor:!0,children:[`└ `,e.name]})},t))]}),!_&&c.map((e,t)=>(0,Y.jsxs)(l,{children:[(0,Y.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(e.tokens),` tokens`]})]},t))]}),f.length>0&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{bold:!0,children:`Custom agents`}),(0,Y.jsx)(u,{dimColor:!0,children:` · /agents`})]}),Array.from(q(f).entries()).map(([e,t])=>(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsx)(u,{dimColor:!0,children:e}),t.map((e,t)=>(0,Y.jsxs)(l,{children:[(0,Y.jsxs)(u,{children:[`└ `,e.agentType,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(e.tokens),` tokens`]})]},t))]},e))]}),s.length>0&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{bold:!0,children:`Memory files`}),(0,Y.jsx)(u,{dimColor:!0,children:` · /memory`})]}),s.map((e,t)=>(0,Y.jsxs)(l,{children:[(0,Y.jsxs)(u,{children:[`└ `,v(e.path),`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(e.tokens),` tokens`]})]},t))]}),p&&p.tokens>0&&(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsxs)(l,{children:[(0,Y.jsx)(u,{bold:!0,children:`Skills`}),(0,Y.jsx)(u,{dimColor:!0,children:` · /skills`})]}),Array.from(q(p.skillFrontmatter).entries()).map(([e,t])=>(0,Y.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,Y.jsx)(u,{dimColor:!0,children:e}),t.map((e,t)=>(0,Y.jsxs)(l,{children:[(0,Y.jsxs)(u,{children:[`└ `,e.name,`: `]}),(0,Y.jsxs)(u,{dimColor:!0,children:[y(e.tokens),` tokens`]})]},t))]},e))]})]}),(0,Y.jsx)(U,{suggestions:k(e)})]})}var Y,X,Z,Q=e((()=>{d(),p(),H(),_(),b(),g(),G(),Y=m(),X=`Autocompact buffer`,Z=[`Project`,`User`,`Managed`,`Plugin`,`Built-in`]}));function ee(e){return i(e)}async function te(e,t){let{messages:n,getAppState:r,options:{mainLoopModel:i,tools:a}}=t,c=ee(n),{messages:l}=await s(c),u=process.stdout.columns||80,d=r();return e(await D((0,$.jsx)(J,{data:await o(l,i,async()=>d.toolPermissionContext,a,d.agentDefinitions,u,t,void 0,c)}))),null}var $;e((()=>{d(),Q(),a(),r(),c(),O(),$=m()}))();export{te as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./context-noninteractive-CHzerxnH.js";t();export{n as call,e as collectContextData};
|