@readmagic/workmate 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{AddWorkspaceDirectory-qFZy3FOD.js → AddWorkspaceDirectory-ag2JTpmU.js} +1 -1
- package/dist/chunks/{App-DW4elk6E.js → App-BuKmqFPm.js} +1 -1
- package/dist/chunks/ApproveApiKey-CIWOi_7v.js +1 -0
- package/dist/chunks/ApproveApiKey-M6U-NafA.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-BuRFF1fQ.js → BypassPermissionsModeDialog-B05t83wa.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-CDrArsSX.js → ClaudeMdExternalIncludesDialog-CSywJdVL.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +1 -0
- package/dist/chunks/{DiffDialog-BIcwpgSr.js → DiffDialog-DUbFrzKu.js} +3 -3
- package/dist/chunks/Doctor-BcnUfJ4I.js +1 -0
- package/dist/chunks/Doctor-Dz4TuYas.js +3 -0
- package/dist/chunks/ExitFlow-BwyAtIHx.js +2 -0
- package/dist/chunks/{Grove-BmirUB6V.js → Grove-BDoVj02t.js} +2 -2
- package/dist/chunks/{HybridTransport-BVmSUHf0.js → HybridTransport-C_U0IJfz.js} +4 -4
- package/dist/chunks/{InvalidConfigDialog-WRywkKeS.js → InvalidConfigDialog-bih293Xt.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-C4n3A72C.js → InvalidSettingsDialog-Br8kQOHz.js} +1 -1
- package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +1 -0
- package/dist/chunks/MCPToolListView-DJ06N1DG.js +1 -0
- package/dist/chunks/{McpParsingWarnings-CH4yyMAL.js → McpParsingWarnings-COa71S9q.js} +1 -1
- package/dist/chunks/MessageSelector-o4ULADFg.js +3 -0
- package/dist/chunks/Messages-qqwHuAW5.js +11 -0
- package/dist/chunks/{Onboarding-BboWs1pp.js → Onboarding-BzuQjney.js} +1 -1
- package/dist/chunks/{PromptInputFooterSuggestions-BpC9COmh.js → PromptInputFooterSuggestions-to5eYBvI.js} +1 -1
- package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +1 -0
- package/dist/chunks/QueryEngine-Dt0BKUeF.js +1 -0
- package/dist/chunks/REPL-CUbEDqEl.js +133 -0
- package/dist/chunks/REPL-DMaKNhTa.js +1 -0
- package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +2 -0
- package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +1 -0
- package/dist/chunks/{SSETransport-1KBBUikF.js → SSETransport-DN4tCDEh.js} +3 -3
- package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +1 -0
- package/dist/chunks/Settings-DfdcmvOV.js +2 -0
- package/dist/chunks/{TeleportProgress-BmgPAZAi.js → TeleportProgress-C2LQVLav.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-sgxNOeM_.js → TeleportRepoMismatchDialog-BZL8Zblz.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-GptvrUdv.js → TeleportResumeWrapper-wPiIs8xg.js} +1 -1
- package/dist/chunks/{ThemePicker-gAMqqD1P.js → ThemePicker-BT_NaRQC.js} +1 -1
- package/dist/chunks/{TrustDialog-CWt-4Evl.js → TrustDialog-ACaJ_m7A.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-De3kzHtz.js → ValidationErrorsList-C-hWdy_8.js} +1 -1
- package/dist/chunks/WelcomeV2-ZQRKlcT4.js +1 -0
- package/dist/chunks/add-dir-SAKTkw0S.js +1 -0
- package/dist/chunks/{agentDisplay-5gnCQwUY.js → agentDisplay-CuSHqgZc.js} +1 -1
- package/dist/chunks/{agents-Bz1MLp4A.js → agents-CMC0iQP4.js} +1 -1
- package/dist/chunks/agents-ZgRKpjHv.js +103 -0
- package/dist/chunks/allErrors-_cOQksHC.js +1 -0
- package/dist/chunks/{api-DzccRM_z.js → api-BbJfMXRS.js} +1 -1
- package/dist/chunks/api-DS1MiW01.js +1 -0
- package/dist/chunks/{auth-Cjnyy10u.js → auth-7mJGtlZp.js} +2 -2
- package/dist/chunks/auth-DGZzCbU0.js +1 -0
- package/dist/chunks/auth-DN1MUpB8.js +1 -0
- package/dist/chunks/{autoMode-CQ5nqP9c.js → autoMode-CBtY7ACs.js} +6 -6
- package/dist/chunks/autonomy-DuQmYhq6.js +15 -0
- package/dist/chunks/{autonomy-CPUCe-YU.js → autonomy-lJV7yWUl.js} +1 -1
- package/dist/chunks/autonomyPanel-DAQm6lDz.js +1 -0
- package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +1 -0
- package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +17 -0
- package/dist/chunks/{banner-BJZNMppT.js → banner-1Wyeyawe.js} +1 -1
- package/dist/chunks/{bg-w3Vlsm3Y.js → bg-CJ0YWFli.js} +2 -2
- package/dist/chunks/bg-CeUrRz_7.js +1 -0
- package/dist/chunks/branch-k3kirqbA.js +3 -0
- package/dist/chunks/{break-cache-DXV0brco.js → break-cache-CAoZ9b72.js} +2 -2
- package/dist/chunks/bridgeConfig-CzRUPn-D.js +1 -0
- package/dist/chunks/{bridgeConfig-vORehbGG.js → bridgeConfig-UgaUfuP6.js} +1 -1
- package/dist/chunks/bridgeMessaging-Ci5H68MX.js +1 -0
- package/dist/chunks/{bridgePointer-D4W9GpWw.js → bridgePointer-BL8-lGvN.js} +1 -1
- package/dist/chunks/bridgeStatusUtil-C36w15ge.js +1 -0
- package/dist/chunks/{btw-DDUC_t0w.js → btw-nVoVuIae.js} +1 -1
- package/dist/chunks/caches-B8sM3Zys.js +1 -0
- package/dist/chunks/caches-Bp9MZ7IE.js +1 -0
- package/dist/chunks/{capacityWake-L7b1mMft.js → capacityWake-BOySRJUJ.js} +1 -1
- package/dist/chunks/ccrClient-Br4LAofR.js +1 -0
- package/dist/chunks/{claudeDesktop-CAmnheYx.js → claudeDesktop-Bgds1-YT.js} +1 -1
- package/dist/chunks/{clear-DdWexxbM.js → clear-C4Vtnbye.js} +1 -1
- package/dist/chunks/{cliLaunch-BWWOgBFh.js → cliLaunch-BTpfAGGI.js} +1 -1
- package/dist/chunks/{client-CoXtVRzi.js → client-B9404qIP.js} +1 -1
- package/dist/chunks/client-BCAbKdNz.js +1 -0
- package/dist/chunks/client-CJE6gEvU.js +1 -0
- package/dist/chunks/commands-DL-BzoMQ.js +1 -0
- package/dist/chunks/compact-Cx7BPXLU.js +2 -0
- package/dist/chunks/config-S5OW4Xqr.js +1 -0
- package/dist/chunks/config-aRiTrtCv.js +3 -0
- package/dist/chunks/{config-CVvUNkj2.js → config-kB2eazPX.js} +1 -1
- package/dist/chunks/{context-BWcfhhDj.js → context-BN7DEjoH.js} +1 -1
- package/dist/chunks/{context-noninteractive-c7jGVWHQ.js → context-noninteractive-D91W2B8e.js} +5 -5
- package/dist/chunks/context-noninteractive-DPacEFJ1.js +1 -0
- package/dist/chunks/conversation-D5Nbu9eT.js +1 -0
- package/dist/chunks/conversation-hcUx9e-C.js +1 -0
- package/dist/chunks/{createSSHSession-DP7B8yvb.js → createSSHSession-DecOR6M5.js} +6 -6
- package/dist/chunks/createSession-D27zvmOs.js +1 -0
- package/dist/chunks/createSession-DRqkLZWt.js +1 -0
- package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +40 -0
- package/dist/chunks/cwd-Cfdf7z7s.js +1 -0
- package/dist/chunks/cwd-ClLru_7T.js +1 -0
- package/dist/chunks/datadog-bm551AVV.js +1 -0
- package/dist/chunks/debug-BecbSVoN.js +39 -0
- package/dist/chunks/{debugUtils-CezNYZ-4.js → debugUtils-CmJfIUxW.js} +1 -1
- package/dist/chunks/{detached-CkPpYMJj.js → detached-CIyF0M5O.js} +1 -1
- package/dist/chunks/detectRepository-C15umvKN.js +1 -0
- package/dist/chunks/detectRepository-DDfLfKcM.js +1 -0
- package/dist/chunks/{diff-DHzz9WAp.js → diff-DeK4bwjw.js} +1 -1
- package/dist/chunks/{directoryCompletion-D5AvL7TF.js → directoryCompletion-BJCu19HJ.js} +1 -1
- package/dist/chunks/doctor-BJORBomU.js +1 -0
- package/dist/chunks/earlyInput-BEjRkAtH.js +1 -0
- package/dist/chunks/{earlyInput-BTC_Wucv.js → earlyInput-IghoCjG5.js} +1 -1
- package/dist/chunks/entry-mdegyj8z.js +14 -0
- package/dist/chunks/esm-Ka3lhafK.js +1 -0
- package/dist/chunks/{execFileNoThrow-5SylUnAI.js → execFileNoThrow-DHyW8FMX.js} +2 -2
- package/dist/chunks/execSyncWrapper-CDzB0BM1.js +1 -0
- package/dist/chunks/exit-CF3KBl-S.js +1 -0
- package/dist/chunks/{extraUsage-Dt5mw35U.js → extraUsage-BrKbpBK-.js} +1 -1
- package/dist/chunks/extractMemories-4lBn134y.js +1 -0
- package/dist/chunks/fast-0Vi354KI.js +1 -0
- package/dist/chunks/{fast-ClYQcEv5.js → fast-DWn40OcQ.js} +1 -1
- package/dist/chunks/featureCheck-D6FjD-nt.js +1 -0
- package/dist/chunks/featureCheck-JOur3pHb.js +1 -0
- package/dist/chunks/{fileSuggestions-fNxREjpe.js → fileSuggestions-C7Pwq2yj.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-BHjBQH0J.js +5 -0
- package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +1 -0
- package/dist/chunks/flushGate-DdJjxCes.js +1 -0
- package/dist/chunks/{gemini-fZ0VPU2A.js → gemini-DHv2iVfy.js} +1 -1
- package/dist/chunks/generateSessionName-DhS_6oHd.js +1 -0
- package/dist/chunks/{genericProcessUtils-BmDSLcMf.js → genericProcessUtils-B2HcDYhg.js} +1 -1
- package/dist/chunks/git-DBlOv64X.js +6 -0
- package/dist/chunks/git-DF4RFFaT.js +1 -0
- package/dist/chunks/githubRepoPathMapping-CK56bUDe.js +1 -0
- package/dist/chunks/{goal-IasZVqKh.js → goal-BZG4gtnb.js} +3 -3
- package/dist/chunks/{grok-Dk3LyzMa.js → grok-BS57ZhyW.js} +1 -1
- package/dist/chunks/{grove-BE4fQ6tG.js → grove-_zlQ83yR.js} +2 -2
- package/dist/chunks/help-C_2tdXHC.js +1 -0
- package/dist/chunks/{hooks-BrKy5XWQ.js → hooks-C7Bn7MBe.js} +2 -2
- package/dist/chunks/hooks-DT80Arzc.js +1 -0
- package/dist/chunks/initReplBridge-NkZRcM77.js +1 -0
- package/dist/chunks/{install-CVGZ55wV.js → install-Du-DSVzj.js} +1 -1
- package/dist/chunks/{instrumentation-BmWotlxR.js → instrumentation-DMs3b82f.js} +5 -5
- package/dist/chunks/intl-D2kgJmX7.js +1 -0
- package/dist/chunks/{job-DEXxW_Zo.js → job-rbX1VZmp.js} +1 -1
- package/dist/chunks/jwtUtils-OzxN2zts.js +1 -0
- package/dist/chunks/keybindings-CwdC_8S0.js +2 -0
- package/dist/chunks/{launchLocalMemory-CLSSVFoj.js → launchLocalMemory-BLRCK1_o.js} +2 -2
- package/dist/chunks/{launchOnboarding-BkJfKviO.js → launchOnboarding-Al_X75Vz.js} +1 -1
- package/dist/chunks/{loadAgentsDir-CKSb56Gp.js → loadAgentsDir-BL93ulMm.js} +2197 -2332
- package/dist/chunks/loadAgentsDir-eVKq8efm.js +1 -0
- package/dist/chunks/loadPluginHooks-B0au35a4.js +1 -0
- package/dist/chunks/{localSearch-CPOnyi8I.js → localSearch-C5ipegd9.js} +1 -1
- package/dist/chunks/localSearch-CZlFfR_X.js +1 -0
- package/dist/chunks/log-Dauqle-Z.js +1 -0
- package/dist/chunks/{logoV2Utils-we1sfJvf.js → logoV2Utils-CkvOihX7.js} +1 -1
- package/dist/chunks/{magicDocs-DmKlTQvK.js → magicDocs-DLav5QK0.js} +3 -3
- package/dist/chunks/main-CVNWNAoh.js +513 -0
- package/dist/chunks/{main-ClXu1ilx.js → main-LMyE3jXY.js} +4 -4
- package/dist/chunks/managedEnv-CYepSnm8.js +1 -0
- package/dist/chunks/{managedEnv-Cl7YbYzf.js → managedEnv-DJSCuqCb.js} +1 -1
- package/dist/chunks/{mappers-xQC-Z4-h.js → mappers-DQxMcezy.js} +1 -1
- package/dist/chunks/mcp-BAbbEaBA.js +1 -0
- package/dist/chunks/mcp-Ct4Sum6A.js +6 -0
- package/dist/chunks/mcp-D5HkCqUh.js +2 -0
- package/dist/chunks/{memoize-FJv2HV1u.js → memoize-FeyE7JEh.js} +1 -1
- package/dist/chunks/memory-COa7aUbx.js +1 -0
- package/dist/chunks/{mode-lYTs0XHs.js → mode-Bl2RZC8M.js} +2 -2
- package/dist/chunks/model-B7rtZ7KV.js +1 -0
- package/dist/chunks/model-Bgh_r4lg.js +1 -0
- package/dist/chunks/model-DiuEAv6h.js +1 -0
- package/dist/chunks/{modelOptions-efCGKnXT.js → modelOptions-BtEZe5BB.js} +1 -1
- package/dist/chunks/nativeInstaller-BEwayifa.js +1 -0
- package/dist/chunks/omit--yH_T4rf.js +1 -0
- package/dist/chunks/onChangeAppState-ZdwI7boX.js +1 -0
- package/dist/chunks/{openai-DJLYqiRl.js → openai-DWs4D-nQ.js} +3 -3
- package/dist/chunks/panel-CoNfXy3K.js +1 -0
- package/dist/chunks/{parser-BdCj2GrE.js → parser-BH4u7QiV.js} +1 -1
- package/dist/chunks/parser-BMIaRErw.js +1 -0
- package/dist/chunks/partition-DLcW5Oo_.js +1 -0
- package/dist/chunks/permissions-CaucYK3s.js +3 -0
- package/dist/chunks/pidLock-DgOBc1Xo.js +3 -0
- package/dist/chunks/{plan-BeoIjNPv.js → plan-BNYDTnQd.js} +1 -1
- package/dist/chunks/{platform-D6IMiyqT.js → platform-B0uTQc9P.js} +1 -1
- package/dist/chunks/plugin-BN-of1_H.js +17 -0
- package/dist/chunks/pluginAutoupdate-BBU9Jn4p.js +1 -0
- package/dist/chunks/pluginBlocklist-DXQlbG0P.js +1 -0
- package/dist/chunks/pluginCliCommands-CfdVNs8D.js +1 -0
- package/dist/chunks/pluginFlagging-DcJ_FQuv.js +1 -0
- package/dist/chunks/pluginOperations-DnhzFbYI.js +2 -0
- package/dist/chunks/pluginStartupCheck-CKBFaMFr.js +1 -0
- package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +1 -0
- package/dist/chunks/{plugins-pmipe7kE.js → plugins-CBW7kPyp.js} +4 -4
- package/dist/chunks/{poorMode-BxsyllUK.js → poorMode-B_xEvuEV.js} +1 -1
- package/dist/chunks/poorMode-yH1o41cQ.js +1 -0
- package/dist/chunks/print-BZOx09SU.js +26 -0
- package/dist/chunks/processBashCommand-dcCNCiBp.js +1 -0
- package/dist/chunks/processSlashCommand-YDiM63Qr.js +5 -0
- package/dist/chunks/prompt-CXGy0llt.js +1 -0
- package/dist/chunks/prompt-DovNDmcx.js +1 -0
- package/dist/chunks/{prompt-CybUvG8G.js → prompt-Dx7IWhBt.js} +34 -34
- package/dist/chunks/{promptEditor-0Ug93P2I.js → promptEditor-WCkmpejM.js} +2 -2
- package/dist/chunks/{protocolHandler-ClfbHTjI.js → protocolHandler-BiVWrpHi.js} +4 -4
- package/dist/chunks/{proxy-Blq4W6Ox.js → proxy-CVn7o19p.js} +3 -3
- package/dist/chunks/reconciler-C2Nd_e4n.js +1 -0
- package/dist/chunks/refresh-B84H2Ezd.js +1 -0
- package/dist/chunks/{registerProtocol-3_ozAuDK.js → registerProtocol-E0Iu5hEx.js} +2 -2
- package/dist/chunks/{reload-plugins-Dn1ibOiI.js → reload-plugins-D-3AUT9g.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-Dpg6Se9C.js → remoteBridgeCore-CV6we3ZA.js} +1 -1
- package/dist/chunks/remoteManagedSettings-D26Q09-7.js +1 -0
- package/dist/chunks/rename-CSavuBIE.js +1 -0
- package/dist/chunks/{renderOptions-CLcco6fc.js → renderOptions-DDLbSMQU.js} +1 -1
- package/dist/chunks/resume-CROylN3J.js +2 -0
- package/dist/chunks/ripgrep-2M1GkXqJ.js +1 -0
- package/dist/chunks/{ripgrep-DkL2S7-I.js → ripgrep-C1ydIMzT.js} +5 -5
- package/dist/chunks/{runtimeObserver-DonWCJOx.js → runtimeObserver-L7pSIWBT.js} +4 -4
- package/dist/chunks/{runtimeObserver-B0xfyLiA.js → runtimeObserver-OU8KrZQG.js} +1 -1
- package/dist/chunks/sandbox-adapter-6UwMLh6e.js +1 -0
- package/dist/chunks/{sandbox-toggle-CSdnHWp-.js → sandbox-toggle-YrQNWGsr.js} +1 -1
- package/dist/chunks/searchExtraTools-Bdv5HJ74.js +1 -0
- package/dist/chunks/{session-BbQlh2S5.js → session-DUYsfPy_.js} +2 -2
- package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +1 -0
- package/dist/chunks/sessionObserver-B0zucj_c.js +1 -0
- package/dist/chunks/{sessionObserver-XV6N0XER.js → sessionObserver-Dv3Ba8eA.js} +2 -2
- package/dist/chunks/sessionState-D-SaBzWD.js +11 -0
- package/dist/chunks/sessionStorage-BM1x51Z7.js +1 -0
- package/dist/chunks/{sessionTitle-E1FvsKM9.js → sessionTitle-uCuYaNif.js} +2 -2
- package/dist/chunks/{sessionTracing-ClGQ08jM.js → sessionTracing-Bqb3vJTt.js} +3 -3
- package/dist/chunks/settings-BG15IFYx.js +1 -0
- package/dist/chunks/settings-D4CpDv2y.js +20 -0
- package/dist/chunks/settingsSync-BSrpnyqo.js +1 -0
- package/dist/chunks/setup-C62oq4AZ.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-B9iSx6mB.js → shadowedRuleDetection-BzAZ57p2.js} +1 -1
- package/dist/chunks/{shellQuote-Bth6IZgX.js → shellQuote-DS6WrivY.js} +2 -2
- package/dist/chunks/{sideQuestion-D2dPToW8.js → sideQuestion-CvMBBjI8.js} +3 -3
- package/dist/chunks/sinks-WJ7nzLQs.js +1 -0
- package/dist/chunks/sinks-f7qYjbKJ.js +2 -0
- package/dist/chunks/skillChangeDetector-U5kRU5nd.js +1 -0
- package/dist/chunks/{skillGapStore-DylpOKJ6.js → skillGapStore-CqaT8c0C.js} +2 -2
- package/dist/chunks/{skillLifecycle-GK-8eyyn.js → skillLifecycle-CnR8IqJM.js} +2 -2
- package/dist/chunks/skillSearchPanel-D9qrOXpI.js +21 -0
- package/dist/chunks/{skills-t6krW8GZ.js → skills-BgcFh0vy.js} +1 -1
- package/dist/chunks/startupProfiler-B4HBBbHN.js +1 -0
- package/dist/chunks/{startupProfiler-jeId9f2i.js → startupProfiler-CmH_aVy2.js} +3 -3
- package/dist/chunks/state-BemZdQIl.js +1 -0
- package/dist/chunks/state-D_lk6z-C.js +1 -0
- package/dist/chunks/{stats-BJBhl-Lc.js → stats-B8uQ-UDi.js} +1 -1
- package/dist/chunks/{status-BtsnKNVY.js → status-BekdWoIj.js} +1 -1
- package/dist/chunks/{status-nZQEar7T.js → status-D6KlRJmR.js} +2 -2
- package/dist/chunks/statusNoticeHelpers-BMM8_uJ1.js +1 -0
- package/dist/chunks/{stringUtils-CbS6OkmE.js → stringUtils-C8PaYpQF.js} +1 -1
- package/dist/chunks/switcher-Ck9CrXrr.js +1 -0
- package/dist/chunks/{switcher-77h2J5HC.js → switcher-DnAhkyIn.js} +1 -1
- package/dist/chunks/syncCache-ClP9aBqK.js +1 -0
- package/dist/chunks/{tasks-BNrdmF9p.js → tasks-Dmh6qikm.js} +1 -1
- package/dist/chunks/teleport-DH3IuAUQ.js +1 -0
- package/dist/chunks/{templateJobs-Dkv4I9c1.js → templateJobs-CxqU-s5i.js} +1 -1
- package/dist/chunks/{terminalSetup-DQopnSPR.js → terminalSetup-BKGcmlWp.js} +1 -1
- package/dist/chunks/{terminalSetup-DTGm1Eo2.js → terminalSetup-Cy19F1Js.js} +4 -4
- package/dist/chunks/{theme-BjpBVRf5.js → theme-U7lMFHQ0.js} +1 -1
- package/dist/chunks/{tmux-CMRiI6CD.js → tmux-D5EvHWi3.js} +1 -1
- package/dist/chunks/{toolEventObserver-D-sNBvOe.js → toolEventObserver-D9qjoVl5.js} +1 -1
- package/dist/chunks/toolPool-69mfSPAs.js +1 -0
- package/dist/chunks/trustedDevice-B6AKlsl_.js +1 -0
- package/dist/chunks/trustedDevice-DL0pWP4_.js +1 -0
- package/dist/chunks/{types-DWRxAH0E.js → types-DafcFtmb.js} +2 -2
- package/dist/chunks/udsClient-CWnfsgFP.js +1 -0
- package/dist/chunks/updateCCB-C6XftzIG.js +11 -0
- package/dist/chunks/{upstreamproxy-DDVMwoRi.js → upstreamproxy-CXmjxHpl.js} +2 -2
- package/dist/chunks/{useExitOnCtrlCDWithKeybindings-D2FvHieH.js → useExitOnCtrlCDWithKeybindings-DEEJhm_W.js} +1 -1
- package/dist/chunks/useMainLoopModel-6w7mhwhU.js +1 -0
- package/dist/chunks/useManagePlugins-CjnsO-Of.js +1 -0
- package/dist/chunks/{useMergedTools-B-Z9XQ6U.js → useMergedTools-DbhqKk1-.js} +1 -1
- package/dist/chunks/{useSearchInput-C6d6nt9S.js → useSearchInput-gUDbkLaC.js} +1 -1
- package/dist/chunks/useSettingsErrors-CgPad-H0.js +1 -0
- package/dist/chunks/{userAgent-Ng_TTjWr.js → userAgent-CU7Ndh79.js} +1 -1
- package/dist/chunks/util-B4oMhJKh.js +1 -0
- package/dist/chunks/validatePlugin-y_O_tCEL.js +1 -0
- package/dist/chunks/{vim-3mUqsEJm.js → vim-w37BfGZ5.js} +1 -1
- package/dist/chunks/{which-DznMOwny.js → which-BRWBO7Gu.js} +1 -1
- package/dist/chunks/windowsPaths-BY-IVNwQ.js +1 -0
- package/dist/chunks/windowsPaths-DtWHLjmE.js +1 -0
- package/dist/chunks/{workSecret-DtiFreRl.js → workSecret-BEhXgH2M.js} +1 -1
- package/dist/chunks/workerRegistry-Bq9bS5pw.js +6 -0
- package/dist/chunks/worktree-4SUJ4dtz.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +2 -3
- package/dist/chunks/ApproveApiKey-D05WywHU.js +0 -1
- package/dist/chunks/ApproveApiKey-DHAbdwkC.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +0 -1
- package/dist/chunks/Doctor-D160J8Ad.js +0 -3
- package/dist/chunks/Doctor-VhJi2cmL.js +0 -1
- package/dist/chunks/ExitFlow-CoWHhKHJ.js +0 -2
- package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +0 -1
- package/dist/chunks/MCPToolListView-BPmE0C2o.js +0 -1
- package/dist/chunks/MessageSelector-kOn2GaU-.js +0 -3
- package/dist/chunks/Messages-4EnHFeh1.js +0 -11
- package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +0 -1
- package/dist/chunks/QueryEngine-J6ElcO16.js +0 -1
- package/dist/chunks/REPL-DBjbAJsm.js +0 -133
- package/dist/chunks/REPL-oBemMXvp.js +0 -1
- package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +0 -2
- package/dist/chunks/ResumeConversation-wBG8OD9P.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +0 -1
- package/dist/chunks/Settings-DptKuJE7.js +0 -2
- package/dist/chunks/WelcomeV2-BWF-cJOu.js +0 -1
- package/dist/chunks/add-dir-DBVT1cEK.js +0 -1
- package/dist/chunks/agents-CnwTOlqO.js +0 -103
- package/dist/chunks/allErrors-DYw_q14e.js +0 -1
- package/dist/chunks/api-DXDXTFGa.js +0 -1
- package/dist/chunks/attributionTrailer-oKKrF3z8.js +0 -1
- package/dist/chunks/auth-CnLb6RWc.js +0 -1
- package/dist/chunks/auth-D-SGHS0K.js +0 -1
- package/dist/chunks/autonomy-dSJl0hN1.js +0 -15
- package/dist/chunks/autonomyPanel-Ccr9ilei.js +0 -1
- package/dist/chunks/backgroundHousekeeping--cs5crp7.js +0 -17
- package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +0 -1
- package/dist/chunks/bg-DWloqGwk.js +0 -1
- package/dist/chunks/branch-CG0AKS1J.js +0 -3
- package/dist/chunks/bridgeConfig-Dmc1ZDev.js +0 -1
- package/dist/chunks/bridgeMessaging-DlczTV9X.js +0 -1
- package/dist/chunks/caches-1IFb6_M_.js +0 -1
- package/dist/chunks/caches-CB8MHqy2.js +0 -1
- package/dist/chunks/ccrClient-CG6HTv_n.js +0 -1
- package/dist/chunks/client-Crrwkw7g.js +0 -1
- package/dist/chunks/client-D8hKghba.js +0 -1
- package/dist/chunks/color-Cuq0c6xy.js +0 -1
- package/dist/chunks/commands-D3sESsTp.js +0 -1
- package/dist/chunks/compact-DIpwuBDq.js +0 -2
- package/dist/chunks/config-D4G8_MqJ.js +0 -3
- package/dist/chunks/config-q9D4hFiK.js +0 -1
- package/dist/chunks/context-noninteractive-Bwt9A3XD.js +0 -1
- package/dist/chunks/conversation-Bjo_8kia.js +0 -1
- package/dist/chunks/conversation-DrHZIQX2.js +0 -1
- package/dist/chunks/createSession-CPo6GBSb.js +0 -1
- package/dist/chunks/createSession-DnykRoia.js +0 -1
- package/dist/chunks/crossProjectResume-D2A-qjgP.js +0 -40
- package/dist/chunks/cwd--q1ONL7P.js +0 -1
- package/dist/chunks/cwd-L4wygFqJ.js +0 -1
- package/dist/chunks/daemon-D2vFIVOz.js +0 -2
- package/dist/chunks/datadog-DrmHyl3_.js +0 -1
- package/dist/chunks/debug-BdqxZ7rV.js +0 -39
- package/dist/chunks/detectRepository-DA1Q_Skc.js +0 -1
- package/dist/chunks/detectRepository-DvxoaPlk.js +0 -1
- package/dist/chunks/doctor-PWqB46xd.js +0 -1
- package/dist/chunks/earlyInput-xcoTbKQn.js +0 -1
- package/dist/chunks/entry-4JtoJONR.js +0 -14
- package/dist/chunks/esm-DcIr7tVd.js +0 -1
- package/dist/chunks/execSyncWrapper-DKuxVTaf.js +0 -1
- package/dist/chunks/exit-OW9g7b9A.js +0 -1
- package/dist/chunks/extractMemories-1VlmCGwa.js +0 -1
- package/dist/chunks/fast-CrvLdpy3.js +0 -1
- package/dist/chunks/featureCheck-CrJeuheQ.js +0 -1
- package/dist/chunks/featureCheck-HslM03dr.js +0 -1
- package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +0 -1
- package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +0 -5
- package/dist/chunks/flushGate-ch-Tvwjj.js +0 -1
- package/dist/chunks/generateRecap-BIBVlB__.js +0 -1
- package/dist/chunks/generateSessionName-nZj_VvKZ.js +0 -1
- package/dist/chunks/git-B9uvt96d.js +0 -6
- package/dist/chunks/git-BfS5Hk4S.js +0 -1
- package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +0 -1
- package/dist/chunks/help-D2-v9Ug9.js +0 -1
- package/dist/chunks/hooks-DGd02IKF.js +0 -1
- package/dist/chunks/initReplBridge-RhCAlmHE.js +0 -1
- package/dist/chunks/intl-cKc-V6Mq.js +0 -1
- package/dist/chunks/jwtUtils-C9sdGhvT.js +0 -1
- package/dist/chunks/keybindings-BRdSOSUD.js +0 -2
- package/dist/chunks/language-C0cIpKE2.js +0 -1
- package/dist/chunks/language-CxThoWRC.js +0 -1
- package/dist/chunks/loadAgentsDir-8UprzS4w.js +0 -1
- package/dist/chunks/loadPluginHooks-LbaURHVH.js +0 -1
- package/dist/chunks/localSearch-DNjbr4S9.js +0 -1
- package/dist/chunks/log-CTFl4qpD.js +0 -1
- package/dist/chunks/main-BIiwW4mM.js +0 -605
- package/dist/chunks/managedEnv-CpiiQx_v.js +0 -1
- package/dist/chunks/mcp-B_m1XBDt.js +0 -6
- package/dist/chunks/mcp-BiyfH9Sd.js +0 -1
- package/dist/chunks/mcp-BjlaPUWX.js +0 -2
- package/dist/chunks/memory-LN8f_p2b.js +0 -1
- package/dist/chunks/model-C2e73CJD.js +0 -1
- package/dist/chunks/model-CvmS-Esk.js +0 -1
- package/dist/chunks/model-DJ8mFfuR.js +0 -1
- package/dist/chunks/nativeInstaller-DQIFwdat.js +0 -1
- package/dist/chunks/omit-CLPZGevl.js +0 -1
- package/dist/chunks/onChangeAppState-DhBO34OK.js +0 -1
- package/dist/chunks/panel-q0_iT9cg.js +0 -1
- package/dist/chunks/panelCall-sum-3zvi.js +0 -1
- package/dist/chunks/parser-BcdhBGx0.js +0 -1
- package/dist/chunks/partition-CpfoVrg1.js +0 -1
- package/dist/chunks/permissions-DTb9wkAP.js +0 -3
- package/dist/chunks/pidLock-BR5M6RQw.js +0 -3
- package/dist/chunks/pipeTransport-B3TIkTAp.js +0 -1
- package/dist/chunks/plugin-D_dHjTud.js +0 -17
- package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +0 -1
- package/dist/chunks/pluginBlocklist-D93Hd1GF.js +0 -1
- package/dist/chunks/pluginCliCommands-vv0wNt4O.js +0 -1
- package/dist/chunks/pluginFlagging-CxuRF2Vc.js +0 -1
- package/dist/chunks/pluginOperations-BTq4AjYB.js +0 -2
- package/dist/chunks/pluginStartupCheck-B6leNWq9.js +0 -1
- package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +0 -1
- package/dist/chunks/poorMode-iV1NwC5L.js +0 -1
- package/dist/chunks/print-CAUvczBM.js +0 -23
- package/dist/chunks/processBashCommand-CdeQg_c6.js +0 -1
- package/dist/chunks/processSlashCommand-CbkshIC6.js +0 -5
- package/dist/chunks/prompt-RBn4JdEg.js +0 -1
- package/dist/chunks/prompt-Rb8zXlDo.js +0 -1
- package/dist/chunks/reconciler-Drq3HSkj.js +0 -4
- package/dist/chunks/refresh-D8TLHO_T.js +0 -1
- package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +0 -1
- package/dist/chunks/rename-CKsSc7Z3.js +0 -1
- package/dist/chunks/replBridgeHandle-DNC797_T.js +0 -1
- package/dist/chunks/resume-B1a5gLVR.js +0 -2
- package/dist/chunks/ripgrep-BisRODQ2.js +0 -1
- package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +0 -1
- package/dist/chunks/searchExtraTools-DbgfnQkH.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +0 -1
- package/dist/chunks/sessionMemory-7UOFdp29.js +0 -1
- package/dist/chunks/sessionMemory-fAzgAS7Q.js +0 -1
- package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +0 -1
- package/dist/chunks/sessionObserver-Cl26OdaW.js +0 -1
- package/dist/chunks/sessionState-BvECKycx.js +0 -11
- package/dist/chunks/sessionStorage-DSj9yZkl.js +0 -1
- package/dist/chunks/settings-B-R9ZJNY.js +0 -1
- package/dist/chunks/settings-Xbq6AaD-.js +0 -20
- package/dist/chunks/settingsSync-NCN0a4sc.js +0 -1
- package/dist/chunks/setup-uZ0dSekt.js +0 -3
- package/dist/chunks/sinks-C7q46rvE.js +0 -2
- package/dist/chunks/sinks-D3bXeHlQ.js +0 -1
- package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +0 -1
- package/dist/chunks/skillSearchPanel-mpaC62y4.js +0 -21
- package/dist/chunks/startupProfiler-BaiXZ9tr.js +0 -1
- package/dist/chunks/state-B4HwLt8i.js +0 -1
- package/dist/chunks/state-Bs5xweDL.js +0 -1
- package/dist/chunks/statusNoticeHelpers-DMqRGFOh.js +0 -1
- package/dist/chunks/switcher-B2CYzCC_.js +0 -1
- package/dist/chunks/syncCache-By_-buUC.js +0 -1
- package/dist/chunks/teleport-mdnhIZBj.js +0 -1
- package/dist/chunks/toolPool-Di30gn_Y.js +0 -1
- package/dist/chunks/trustedDevice-CupLMpO8.js +0 -1
- package/dist/chunks/trustedDevice-j1u2TG5U.js +0 -1
- package/dist/chunks/udsClient-Cm3HqYUu.js +0 -1
- package/dist/chunks/updateCCB-BlUAU2Vp.js +0 -11
- package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +0 -1
- package/dist/chunks/useManagePlugins-BbWJNLe8.js +0 -1
- package/dist/chunks/useSettingsErrors-DKh4rkGi.js +0 -1
- package/dist/chunks/util-D-X8i5Z2.js +0 -1
- package/dist/chunks/validatePlugin-DSw08u76.js +0 -1
- package/dist/chunks/windowsPaths-1mgenSWa.js +0 -1
- package/dist/chunks/windowsPaths-BVztIhXM.js +0 -1
- package/dist/chunks/workerRegistry-DdOYjLm3.js +0 -6
- package/dist/chunks/worktree-BX1ULzrw.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./REPL-DBjbAJsm.js";export{e as REPL};
|
|
@@ -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{$o as i,$x as a,Ar as o,Aw as s,Bx as c,Gv as l,Ho as ee,Mr as u,Oc as d,Ro as f,SE as p,Ux as m,VE as te,Zv as ne,Zx as re,aS as ie,dr as ae,iS as oe,jw as se,kc as ce,oS as h,qx as le,rS as g,tS as _,ts as v,xE as y,zE as b}from"./loadAgentsDir-CKSb56Gp.js";import{di as x,j as S,t as ue,ui as de}from"./src-P_wYS_NJ2.js";import{n as fe,t as C}from"./cwd-L4wygFqJ.js";import{C as pe,F as w,S as T,a as E,l as D,w as O,z as k}from"./debug-BdqxZ7rV.js";import{Gt as A,Jt as j,f as M,g as N,n as P}from"./settings-Xbq6AaD-.js";import{c as F,h as I,o as L,v as R,y as z}from"./config-D4G8_MqJ.js";import{f as B,l as me,m as V,p as he}from"./git-B9uvt96d.js";import{n as H,r as ge}from"./execFileNoThrow-5SylUnAI.js";import{o as U,s as W}from"./log-CTFl4qpD.js";import{i as G,o as _e}from"./platform-D6IMiyqT.js";import{l as ve,u as ye}from"./oauth-C9VBDB0Y.js";import{Bt as be,Vt as xe,_ as Se,ai as Ce,g as K,si as we}from"./model-C2e73CJD.js";import{c as Te,h as Ee,l as De,m as q,s as Oe}from"./proxy-Blq4W6Ox.js";import{l as ke,o as Ae}from"./api-DzccRM_z.js";import{c as je,u as Me}from"./firstPartyEventLogger-DhEPWcit.js";import{c as Ne,i as Pe}from"./terminalSetup-DTGm1Eo2.js";import{randomUUID as Fe}from"crypto";t(),y(),fe(),I(),j(),ge(),V(),U(),Me();var Ie=[/(?:^|\/)(?: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 Le(e){return!Ie.some(t=>t.test(e))}function Re(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(!Le(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 ze(){if(A.platform===`win32`||!await me())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(he(),t,{cwd:C()});r(e)}return Re(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return W(e),[]}}var Be=10080*60*1e3,Ve=e(()=>{let e=L(),t=e.exampleFiles?.length?p(e.exampleFiles):`<filepath>`;return`Try "${p([`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...`])}"`}),He=e(async()=>{let e=L();Date.now()-(e.exampleFilesGeneratedAt??0)>Be&&(e.exampleFiles=[]),e.exampleFiles?.length||ze().then(e=>{e.length&&R(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});we();var Ue={"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 We(e){let t=e.toLowerCase(),n=Ce();for(let[e,r]of Object.entries(Ue)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function Ge(e){if(!e)return null;let t=We(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}n(),x(),ue(),k(),T(),E(),_e(),ye(),N(),be(),Se(),te(),se(),a(),m(),ne(),Pe(),ce(),i(),f(),o(),I();function Ke(e){let t=F().numStartups;z(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function J(e){let t=F(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}I(),j(),V();var Y;async function qe(){return Y===void 0&&(Y=b in await v()),Y}async function X(e,t,n){if(!await qe()||ee(`${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&&c(t.readFileState).some(e=>n.filePath.test(e)))}var Je=[{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 F().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${s(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=F();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=F(),t=M(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return D(`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=F();return await B()<=1&&e.numStartups>50}catch{return!1}}},{id:`color-when-multi-clauding`,content:async()=>`Running multiple Claude sessions? Use /color and /rename to tell them apart at a glance.`,cooldownSessions:10,isRelevant:async()=>!ae()&&await d()>=2},{id:`terminal-setup`,content:async()=>A.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=F();return A.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>A.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=F();return!!((A.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>A.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(!Ne())return!1;let e=F();return!(A.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 F().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&&de.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()=>M().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return F().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 '${A.terminal===`vscode`?`code`:A.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!oe()||G()!==`macos`)return!1;switch(A.terminal){case`vscode`:return!await ie();case`cursor`:return!await _();case`windsurf`:return!await h();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return g()||(await re()).length!==0?!1:(await le()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return F().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()=>!A.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()=>!l()},{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()=>l()},{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()=>u()&&F().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return F().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${s(`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 ${s(`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 F().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return F().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 ${s(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){let e=F(),t=K()===`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@${b}`)}`,cooldownSessions:3,isRelevant:async e=>X(`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@${b}`)}`,cooldownSessions:3,isRelevant:async e=>X(`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()=>(xe(),!1)}],Ye=[];function Xe(){let e=P().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function Ze(e){let t=P().spinnerTipsOverride,n=Xe();if(t?.excludeDefault&&n.length>0)return n;let r=[...Je,...Ye],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>J(e.id)>=e.cooldownSessions),...n]}Ae(),E(),U(),Ee(),De();var Z=2e3,Q=5,Qe=3e4,$=3,$e=new Set([4003]);function et(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var tt=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`){D(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${ve().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;D(`[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:Te(e),tls:q()||void 0});this.ws=n,n.addEventListener(`open`,()=>{D(`[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=>{D(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{D(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:Oe(e),...q()});this.ws=r,r.on(`open`,()=>{D(`[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)=>{D(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{D(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=pe(e);et(t)?this.callbacks.onMessage(t):D(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){W(Error(`[SessionsWebSocket] Failed to parse message: ${w(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,$e.has(e)){D(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){D(`[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}`)):(D(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),D(`[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{}},Qe)}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}D(`[SessionsWebSocket] Sending control response`),this.ws.send(O(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){W(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:Fe(),request:e};D(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(O(t))}isConnected(){return this.state===`connected`}close(){D(`[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(){D(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};E(),U(),n();function nt(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var rt=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(){D(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{D(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{D(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{D(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{W(e),this.callbacks.onError?.(e)}};this.websocket=new tt(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);D(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){D(`[RemoteSessionManager] Received control response`);return}nt(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)D(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{D(`[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){D(`[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}}}};D(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){D(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){D(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){D(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function it(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{Ke as a,He as c,J as i,it as n,Ge as o,Ze as r,Ve as s,rt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ar as n,Au as r,Ew as i,Kr as a,Mr as ee,Pc as te,Vr as ne,Vu as o,di as re,ei as ie,fi as s,ir as c,ix as ae,ju as oe,kc as l,lv as se,my as u,ov as d,pw as f,py as ce,qn as p,rx as m,sv as le,vl as ue,yl as h,zu as g}from"./loadAgentsDir-CKSb56Gp.js";import{I as _,P as v,Wt as y,dr as b,fi 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{Kt as T,lr as de}from"./state-Bs5xweDL.js";import{o as E,s as D}from"./log-CTFl4qpD.js";import{n as O,r as k}from"./analytics-DJobLaWP.js";import{a as fe,n as A,s as j}from"./skillChangeDetector-C1EJ7rUL.js";import{t as M}from"./REPL-DBjbAJsm.js";import{a as N,i as P,n as F,o as I,r as L,t as R}from"./crossProjectResume-D2A-qjgP.js";import{dirname as z}from"path";var B=t(x(),1);f(),T(),I(),o(),m(),C(),i(),O(),d(),u(),P(),l(),r(),F(),E(),n();var V=w();function pe(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function H({commands:t,worktreePaths:n,initialTools:r,mcpClients:i,dynamicMcpConfig:o,debug:l,mainThreadAgentDefinition:u,autoConnectIdeFlag:d,strictMcpConfig:f=!1,systemPrompt:m,appendSystemPrompt:y,initialSearchQuery:x,disableSlashCommands:C=!1,forkSession:w,taskListId:T,filterByPr:E,thinkingConfig:O,onTurnComplete:P}){let{rows:F}=S(),I=le(e=>e.agentDefinitions),H=se(),[U,W]=B.useState([]),[ge,G]=B.useState(!0),[_e,ve]=B.useState(!1),[K,ye]=B.useState(!1),[q,be]=B.useState(null),[J,xe]=B.useState(null),Y=B.useRef(null),X=B.useRef(0),Z=B.useMemo(()=>{let e=U.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=pe(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[U,E]),Se=ee();B.useEffect(()=>{a(n).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{D(e),G(!1)})},[n]);let Q=B.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||c(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=B.useCallback(e=>{G(!0),(e?ne():a(n)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{D(e)}).finally(()=>{G(!1)})},[n]),Ce=B.useCallback(()=>{let e=!K;ye(e),$(e)},[K,$]);function we(){process.exit(1)}async function Te(t){ve(!0);let n=performance.now(),r=R(t,K);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await b(e);t&&process.stdout.write(t),xe(e);return}try{let r=await oe(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!w?(de(ce(r.sessionId),t.fullPath?z(t.fullPath):null),await re(),ae(r.sessionId)):w&&r.contentReplacements?.length&&await ie(r.contentReplacements);let{agentDefinition:i}=fe(r.agentSetting,u,I);H(e=>({...e,agent:i?.agentType}));let a=A(r.agentName,r.agentColor);if(a&&H(e=>({...e,standaloneAgentContext:a})),te(r.agentName),s(w?{...r,worktreeSession:void 0}:r),w||(j(r.worktreeSession),r.sessionId&&p()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(h(),e(ue)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}k(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),W([]),be({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw k(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),D(e),e}}return J?(0,V.jsx)(he,{command:J}):q?(0,V.jsx)(M,{debug:l,commands:t,initialTools:r,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:i,dynamicMcpConfig:o,strictMcpConfig:f,systemPrompt:m,appendSystemPrompt:y,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:C,taskListId:T,thinkingConfig:O,onTurnComplete:P}):ge?(0,V.jsxs)(_,{children:[(0,V.jsx)(g,{}),(0,V.jsx)(v,{children:` Loading conversations…`})]}):_e?(0,V.jsxs)(_,{children:[(0,V.jsx)(g,{}),(0,V.jsx)(v,{children:` Resuming conversation…`})]}):Z.length===0?(0,V.jsx)(me,{}):(0,V.jsx)(N,{logs:Z,maxHeight:F,onCancel:we,onSelect:Te,onLogsChanged:Se?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:x,showAllProjects:K,onToggleAllProjects:Ce,onAgenticSearch:L})}function me(){return y(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,V.jsxs)(_,{flexDirection:`column`,children:[(0,V.jsx)(v,{children:`No conversations found to resume.`}),(0,V.jsx)(v,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function he({command:e}){return B.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,V.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,V.jsx)(v,{children:`This conversation is from a different directory.`}),(0,V.jsxs)(_,{flexDirection:`column`,children:[(0,V.jsx)(v,{children:`To resume, run:`}),(0,V.jsxs)(v,{children:[` `,e]})]}),(0,V.jsx)(v,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{H as ResumeConversation};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vg as e,yg as t}from"./loadAgentsDir-CKSb56Gp.js";t();export{e as clearSearchExtraToolsDescriptionCache};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-BDhHQY0-.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{$_ as ee,$x as c,Ar as te,C as ne,Ew as l,Fx as re,Ix as ie,Mx as ae,P as oe,Px as se,Qx as ce,S as le,Sd as u,_m as d,_o as f,cv as ue,dd as de,ev as fe,fd as p,lv as pe,ov as m,pr as h,pw as me,rS as he,sv as g,ud as _,v as ge,vm as _e,vo as ve,xd as v,yo as ye}from"./loadAgentsDir-CKSb56Gp.js";import{D as y,Gt as be,H as xe,I as b,P as x,T as S,U as Se,Wt as Ce,Xn as we,a as Te,di as Ee,fi as C,k as De,n as w,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{Kt as Ae,mt as je,sr as Me,zt as Ne}from"./state-Bs5xweDL.js";import{n as Pe,t as A}from"./cwd-L4wygFqJ.js";import{Ft as Fe,Nt as Ie,Pt as Le,Rt as Re,c as ze,g as j,jt as Be,n as Ve,x as M,zt as He}from"./settings-Xbq6AaD-.js";import{a as Ue,c as N,h as We,i as Ge,o as Ke,y as P}from"./config-D4G8_MqJ.js";import{o as qe,s as Je}from"./log-CTFl4qpD.js";import{n as Ye,r as F}from"./analytics-DJobLaWP.js";import{G as Xe,K as Ze,Sr as I,_ as Qe,b as $e,et as L,it as et,q as tt,rt as nt,tt as rt,x as it,xr as at}from"./model-C2e73CJD.js";import{d as R}from"./sessionState-BvECKycx.js";import{r as ot,t as st}from"./poorMode-BxsyllUK.js";import{a as ct,c as lt,d as ut,i as dt,l as ft,n as pt,o as mt,r as z,s as ht,t as gt,u as B}from"./status-nZQEar7T.js";import{n as V,t as H}from"./useExitOnCtrlCDWithKeybindings-D2FvHieH.js";import{i as _t,n as vt,r as yt}from"./modalContext-CUThy6Ph.js";import{n as bt,t as xt}from"./ThemePicker-gAMqqD1P.js";import{i as St,n as Ct,r as wt,t as Tt}from"./extraUsage-Dt5mw35U.js";import{n as Et,t as Dt}from"./ClaudeMdExternalIncludesDialog-CDrArsSX.js";import{t as Ot}from"./SearchBox-C9vUA4IM.js";import{n as kt,t as U}from"./useSearchInput-C6d6nt9S.js";function At(){let e=je();return[{label:`Version`,value:`0.0.9`},{label:`Session name`,value:h(e)??(0,K.jsx)(x,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:A()},...pt(),...gt()]}function jt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:B(e)},...z(t.clients,r.options.ideInstallationStatus,n),...mt(t.clients,n),...lt(),...ft()]}async function Mt(){return[...await dt(),...await ct(),...await ht()]}function W({value:e}){return Array.isArray(e)?(0,K.jsx)(b,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(x,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(x,{children:e}):e}function Nt({context:e,diagnosticsPromise:t}){let n=g(e=>e.mainLoopModel),r=g(e=>e.mcp),[i]=xe(),a=Ft.useMemo(()=>[At(),jt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=yt()?1:void 0;return(0,K.jsxs)(b,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(b,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(b,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(b,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(x,{bold:!0,children:[e,`:`]}),(0,K.jsx)(W,{value:t})]},n))},t)),(0,K.jsx)(G.Suspense,{fallback:null,children:(0,K.jsx)(Pt,{promise:t})})]}),(0,K.jsx)(x,{dimColor:!0,children:(0,K.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Pt({promise:e}){let t=(0,G.use)(e);return t.length===0?null:(0,K.jsxs)(b,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(x,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(b,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(x,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(x,{wrap:`wrap`,children:e}):e]},t))]})}var Ft,G,K,It=t((()=>{o(),Ft=n(C(),1),G=n(C(),1),Ae(),vt(),E(),m(),Pe(),te(),ut(),_e(),K=k()}));function Lt({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,Rt.jsxs)(ke,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,Rt.jsxs)(x,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,Rt.jsx)(x,{dimColor:!0,children:`How would you like to handle this?`}),(0,Rt.jsx)(de,{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 Rt,zt=t((()=>{C(),E(),_(),Rt=k()}));function Bt(e){return Object.entries(e).map(([e,t])=>({label:t?.name??Ut,value:e,description:t?.description??Wt}))}function Vt({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,Ht.useState)([]),[o,s]=(0,Ht.useState)(!0);(0,Ht.useEffect)(()=>{ve(A()).then(e=>{let t=Bt(e);a(t),s(!1)}).catch(()=>{let e=Bt(f);a(e),s(!1)})},[]);let ee=(0,Ht.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ke,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(b,{marginTop:1,children:(0,q.jsx)(x,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(x,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(de,{options:i,onChange:ee,visibleOptionCount:10,defaultValue:e})]})})}var Ht,q,Ut,Wt,Gt=t((()=>{C(),Ht=n(C(),1),ye(),E(),Pe(),p(),q=k(),Ut=`Default`,Wt=`Claude completes coding tasks efficiently and provides concise responses`}));function Kt({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,qt.useState)(e),[a,o]=(0,qt.useState)((e??``).length);Ce(`confirm:no`,n,{context:`Settings`});function ee(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(b,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(x,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(b,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(x,{children:s.pointer}),(0,J.jsx)(v,{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)(x,{dimColor:!0,children:`Leave empty for default (English)`})]})}var qt,J,Jt=t((()=>{o(),qt=n(C(),1),E(),l(),u(),J=k()}));function Yt({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ee}){let{headerFocused:c,focusHeader:te}=Te(),ne=yt(),[,l]=xe(),ie=Se(),[u,f]=(0,X.useState)(N()),p=Y.useRef(N()),[m,h]=(0,X.useState)(Ve()),me=Y.useRef(Ve()),[_,_e]=(0,X.useState)(m?.outputStyle||`default`),ve=Y.useRef(_),[v,ye]=(0,X.useState)(m?.language),Ee=Y.useRef(v),[C,w]=(0,X.useState)(0),[T,E]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Ae=we(),{rows:je}=Oe(),Pe=ee??Math.min(Math.floor(je*.8),30),A=Math.max(5,Pe-10),j=g(e=>e.mainLoopModel),Be=g(e=>e.verbose),We=g(e=>e.thinkingEnabled),qe=g(e=>nt()?e.fastMode:!1);g(e=>e.promptSuggestionEnabled);let Ye=Le(m?.permissions?.defaultMode??`default`),Qe=le()||ge()===`enabled`,L=pe(),[at,R]=(0,X.useState)({}),ct=Y.useRef(We),[lt]=(0,X.useState)(()=>ze(`localSettings`)),[ut]=(0,X.useState)(()=>ze(`userSettings`)),dt=Y.useRef(ie),ft=ue(),[pt]=(0,X.useState)(()=>{let e=ft.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[mt]=(0,X.useState)(()=>Ne()),z=Y.useRef(!1),[ht,gt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:_t,cursorOffset:vt}=kt({isActive:O&&B===null&&!c,onExit:()=>k(!1),onExitUp:te,passthroughCtrlKeys:[`c`,`d`]}),bt=O&&!c;Y.useEffect(()=>{o?.(bt)},[bt,o]);let St=ce(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(se(!0)),Ot=re(Et),U=Ue();function At(e){F(`tengu_config_model_changed`,{from_model:j,to_model:e}),L(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=it(e)+(Ct(e,!1,$e())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function jt(e){P(t=>({...t,verbose:e})),f({...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 Mt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:u.autoCompactEnabled,type:`boolean`,onChange(e){P(t=>({...t,autoCompactEnabled:e})),f({...N(),autoCompactEnabled:e}),F(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:m?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){M(`localSettings`,{spinnerTipsEnabled:e}),h(t=>({...t,spinnerTipsEnabled:e})),F(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:m?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){M(`localSettings`,{cacheWarningEnabled:e}),h(t=>({...t,cacheWarningEnabled:e})),F(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:m?.prefersReducedMotion??!1,type:`boolean`,onChange(e){M(`localSettings`,{prefersReducedMotion:e}),h(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:We??!0,type:`boolean`,onChange(e){L(t=>({...t,thinkingEnabled:e})),M(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),F(`tengu_thinking_toggled`,{enabled:e})}},...nt()&&rt()?[{id:`fastMode`,label:`Fast mode (${Xe} only)`,value:!!qe,type:`boolean`,onChange(e){Ze(),M(`userSettings`,{fastMode:e?!0:void 0}),e?(L(e=>({...e,mainLoopModel:tt(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:tt(),"Fast mode":`ON`}))):(L(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(st(),e(ot)).isPoorModeActive(),type:`boolean`,onChange(t){(st(),e(ot)).setPoorMode(t),L(e=>({...e,promptSuggestionEnabled:!t}))}},...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:u.fileCheckpointingEnabled,type:`boolean`,onChange(e){P(t=>({...t,fileCheckpointingEnabled:e})),f({...N(),fileCheckpointingEnabled:e}),F(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Be,type:`boolean`,onChange:jt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:u.terminalProgressBarEnabled,type:`boolean`,onChange(e){P(t=>({...t,terminalProgressBarEnabled:e})),f({...N(),terminalProgressBarEnabled:e}),F(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:u.showTurnDuration,type:`boolean`,onChange(e){P(t=>({...t,showTurnDuration:e})),f({...N(),showTurnDuration:e}),F(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Ye,options:(()=>{let e=[`default`,`plan`];return[...e,...He.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Le(e),n=t===`auto`?t:Ie(t)?Re(t):t,r=M(`userSettings`,{permissions:{...m?.permissions,defaultMode:n}});if(r.error){Je(r.error);return}h(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),F(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Qe?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:m?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){M(`userSettings`,{useAutoModeDuringPlan:e}),h(t=>({...t,useAutoModeDuringPlan:e})),L(e=>{let t=oe(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:u.respectGitignore,type:`boolean`,onChange(e){P(t=>({...t,respectGitignore:e})),f({...N(),respectGitignore:e}),F(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...fe()?[{id:`copyOnSelect`,label:`Copy on select`,value:u.copyOnSelect??!0,type:`boolean`,onChange(e){P(t=>({...t,copyOnSelect:e})),f({...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:m?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:ie,type:`managedEnum`,onChange:l},{id:`notifChannel`,label:`Notifications`,value:u.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){P(t=>({...t,preferredNotifChannel:e})),f({...N(),preferredNotifChannel:e})}},{id:`outputStyle`,label:`Output style`,value:_,type:`managedEnum`,onChange:()=>{}},{id:`language`,label:`Language`,value:v??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:u.editorMode===`emacs`?`normal`:u.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){P(t=>({...t,editorMode:e})),f({...N(),editorMode:e}),F(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:u.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){P(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),f({...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:At},...St?[{id:`diffTool`,label:`Diff tool`,value:u.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){P(t=>({...t,diffTool:e})),f({...N(),diffTool:e}),F(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...he()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:u.autoConnectIde??!1,type:`boolean`,onChange(e){P(t=>({...t,autoConnectIde:e})),f({...N(),autoConnectIde:e}),F(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...he()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:u.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){P(t=>({...t,autoInstallIdeExtension:e})),f({...N(),autoInstallIdeExtension:e}),F(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...Ot?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ke().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(x,{children:[`Use custom API key: `,(0,Z.jsx)(x,{bold:!0,children:I(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&u.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}),f(N())}}]:[]],W=Y.useMemo(()=>{if(!H)return Mt;let e=H.toLowerCase();return Mt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[Mt,H]);Y.useEffect(()=>{if(C>=W.length){let e=Math.max(0,W.length-1);w(e),E(Math.max(0,e-A+1));return}E(e=>C<e?C:C>=e+A?C-A+1:e)},[W.length,C,A]);let Nt=(0,X.useCallback)(e=>{E(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),Pt=(0,X.useCallback)(()=>{if(B!==null)return;let e=Object.entries(at).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&&p.current.customApiKeyResponses?.approved?.includes(I(n))),a=!!(n&&u.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})),u.theme!==p.current.theme&&e.push(`Set theme to ${D.bold(u.theme)}`),u.preferredNotifChannel!==p.current.preferredNotifChannel&&e.push(`Set notifications to ${D.bold(u.preferredNotifChannel)}`),_!==ve.current&&e.push(`Set output style to ${D.bold(_)}`),v!==Ee.current&&e.push(`Set response language to ${D.bold(v??`Default (English)`)}`),u.editorMode!==p.current.editorMode&&e.push(`Set editor mode to ${D.bold(u.editorMode||`emacs`)}`),u.diffTool!==p.current.diffTool&&e.push(`Set diff tool to ${D.bold(u.diffTool)}`),u.autoConnectIde!==p.current.autoConnectIde&&e.push(`${u.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),u.autoInstallIdeExtension!==p.current.autoInstallIdeExtension&&e.push(`${u.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),u.autoCompactEnabled!==p.current.autoCompactEnabled&&e.push(`${u.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),u.respectGitignore!==p.current.respectGitignore&&e.push(`${u.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),u.copyOnSelect!==p.current.copyOnSelect&&e.push(`${u.copyOnSelect?`Enabled`:`Disabled`} copy on select`),u.terminalProgressBarEnabled!==p.current.terminalProgressBarEnabled&&e.push(`${u.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),u.showStatusInTerminalTab!==p.current.showStatusInTerminalTab&&e.push(`${u.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),u.showTurnDuration!==p.current.showTurnDuration&&e.push(`${u.showTurnDuration?`Enabled`:`Disabled`} turn duration`),u.remoteControlAtStartup!==p.current.remoteControlAtStartup){let t=u.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${u.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}m?.autoUpdatesChannel!==me.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${D.bold(m?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
|
|
2
|
-
`)):t(`Config dialog dismissed`,{display:`system`})},[B,at,u,j,_,v,m?.autoUpdatesChannel,nt()?m?.fastMode:void 0,t]),Ft=(0,X.useCallback)(()=>{ie!==dt.current&&l(dt.current),P(()=>p.current);let e=lt;M(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=ut;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=pt;L(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:oe(e.toolPermissionContext)})),Ne()!==mt&&Me(mt)},[ie,l,lt,ut,pt,mt,L]);Ce(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Ft(),t(`Config dialog dismissed`,{display:`system`}))},[B,Ft,t]),{context:`Settings`,isActive:B===null&&!O&&!c}),Ce(`settings:close`,Pt,{context:`Settings`,isActive:B===null&&!O&&!c});let G=(0,X.useCallback)(()=>{let e=W[C];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===ct.current?gt(!1):n.messages.some(e=>e.type===`assistant`)&>(!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}(m?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.current=!0,M(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),h(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,C,m?.autoUpdatesChannel,a]),K=e=>{gt(!1);let t=Math.max(0,Math.min(W.length-1,C+e));w(t),Nt(t)};return be({"select:previous":()=>{C===0?(gt(!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),_t(``)}},{context:`Settings`,isActive:B===null&&!O&&!c}),(0,Z.jsx)(b,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!c){if(O){if(e.key===`escape`){e.preventDefault(),H.length>0?_t(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),w(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),_t(e.key))}},[B,c,O,H,_t,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(xt,{onThemeSelect:e=>{z.current=!0,l(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(b,{children:(0,Z.jsx)(x,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(wt,{initial:j,onSelect:e=>{z.current=!0,At(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:nt()?qe&&et(j)&&rt():!1}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Dt,{onDone:()=>{V(null),a(!1)},externalIncludes:ae(Et)}),(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vt,{initialStyle:_,onComplete:e=>{z.current=!0,_e(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)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Kt,{initialLanguage:v,onComplete:e=>{z.current=!0,ye(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)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(d,{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)(de,{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})),f({...N(),autoUpdates:!0}),M(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),h(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),F(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(x,{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)(x,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(Lt,{currentVersion:`0.0.9`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.9`),M(`userSettings`,t),h(e=>({...e,...t})),F(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(b,{flexDirection:`column`,gap:1,marginY:ne?void 0:1,children:[(0,Z.jsx)(De,{query:H,isFocused:O&&!c,isTerminalFocused:Ae,cursorOffset:vt,placeholder:`Search settings…`}),(0,Z.jsx)(b,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(x,{dimColor:!0,italic:!0,children:[`No settings match "`,H,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[T>0&&(0,Z.jsxs)(x,{dimColor:!0,children:[s.arrowUp,` `,T,` more above`]}),W.slice(T,T+A).map((e,t)=>{let n=T+t===C&&!c&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(b,{width:`100%`,children:[(0,Z.jsx)(b,{width:44,children:(0,Z.jsxs)(x,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(b,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:e.value.toString()}),ht&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(x,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:Zt[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(Xt,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:Fe(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(b,{flexDirection:`column`,children:[(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(x,{dimColor:!0,children:[`(`,Ge(U),`)`]})]}):(0,Z.jsx)(x,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),T+A<W.length&&(0,Z.jsxs)(x,{dimColor:!0,children:[s.arrowDown,` `,W.length-T-A,` more below`]})]})}),c?(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(y,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(y,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(x,{children:`Type to filter`}),(0,Z.jsx)(y,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(y,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(x,{dimColor:!0,children:(0,Z.jsxs)(S,{children:[(0,Z.jsx)(d,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(d,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(d,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(d,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function Xt({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(x,{children:[`iTerm2 `,(0,Z.jsx)(x,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(x,{children:[`Terminal Bell `,(0,Z.jsx)(x,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(x,{children:[`Kitty `,(0,Z.jsx)(x,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(x,{children:[`Ghostty `,(0,Z.jsx)(x,{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,Zt,Qt=t((()=>{E(),Y=n(C(),1),X=n(C(),1),l(),o(),We(),at(),Ee(),Be(),ne(),qe(),Ye(),R(),bt(),m(),St(),Qe(),Tt(),Et(),zt(),_(),Gt(),Jt(),ie(),_e(),vt(),Ot(),c(),j(),Ae(),ye(),a(),U(),me(),L(),ee(),Z=k(),Zt={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 $t({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=yt(),{rows:te}=_t(Oe()),ne=c?te+1:Math.max(15,Math.min(Math.floor(te*.8),30)),[l]=(0,Q.useState)(()=>Mt().catch(()=>[]));return V(),Ce(`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:ne,children:[(0,$.jsx)(w,{title:`Status`,children:(0,$.jsx)(Nt,{context:t,diagnosticsPromise:l})},`status`),(0,$.jsx)(w,{title:`Config`,children:(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(Yt,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:ee,contentHeight:ne})})},`config`)]})})}var Q,$,en=t((()=>{C(),Q=n(C(),1),l(),H(),me(),vt(),E(),It(),Qt(),$=k()}));export{en as n,$t as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-P_wYS_NJ2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Gt as o,Jt as s}from"./settings-Xbq6AaD-.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.9`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u 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{I as i,L as a,R as o,T_ as s,aE as c,cE as l,hw as u,mw as d,w_ as f,x_ as p}from"./loadAgentsDir-CKSb56Gp.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{Kt as x,h as S,on as C}from"./state-Bs5xweDL.js";import{n as w,t as T}from"./AddWorkspaceDirectory-qFZy3FOD.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)(d,{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=p(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=S();o.includes(n)||C([...o,n]),c.refreshConfig();let l;if(r)try{s(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 u=await o(r,a.toolPermissionContext);if(u.resultType!==`success`){let t=i(u);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:u.absolutePath,permissionContext:a.toolPermissionContext,onAddDirectory:l,onCancel:()=>{e(`Did not add ${y.bold(u.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{g(),n(),O=t(_(),1),x(),u(),w(),v(),f(),l(),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{n,o as r}from"./envUtils-BDhHQY0-.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{$ as o,$l as s,AE as c,AS as l,Dp as u,Ep as d,Ew as f,Fm as p,Gm as m,Hn as h,Ia as g,Jl as ee,Km as _,MS as te,Nm as ne,Op as v,Pm as y,Qa as re,Ql as ie,Qm as ae,Sd as oe,Tp as se,Ty as ce,Um as le,Un as ue,Vn as de,Vu as fe,Wm as pe,Yl as me,Zm as he,_m as b,bC as ge,bp as _e,c as ve,d_ as ye,da as be,dd as xe,dl as Se,dw as Ce,eh as we,f_ as Te,fd as Ee,fl as De,fm as Oe,fw as ke,hp as Ae,it as je,iu as Me,jS as Ne,kE as Pe,kS as Fe,l as Ie,lv as Le,mm as Re,mp as ze,n_ as Be,o as Ve,ot as He,ov as Ue,qm as We,r as Ge,r_ as Ke,ru as qe,s as Je,so as Ye,sv as Xe,t as Ze,tt as Qe,ua as $e,vm as x,vp as et,wy as tt,xd as nt,xp as rt,yC as it,yp as at,zg as ot,zu as st}from"./loadAgentsDir-CKSb56Gp.js";import{C as ct,D as S,I as C,P as w,T,Wt as E,di as lt,fi as D,t as O,ui as ut,y as dt}from"./src-P_wYS_NJ2.js";import{t as k}from"./jsx-runtime-Bb4Xn-E0.js";import{n as ft,t as pt}from"./cwd-L4wygFqJ.js";import{C as mt,G as ht,I as gt,Q as _t,S as vt,W as yt,z as bt}from"./debug-BdqxZ7rV.js";import{In as xt,J as St,Ln as Ct,Q as wt,Yt as Tt,Zt as Et,at as Dt,cn as Ot,it as kt,on as At}from"./settings-Xbq6AaD-.js";import{M as jt,P as Mt}from"./config-D4G8_MqJ.js";import{o as Nt,s as Pt}from"./log-CTFl4qpD.js";import{n as Ft,r as It}from"./analytics-DJobLaWP.js";import{C as Lt,v as Rt}from"./startupProfiler-jeId9f2i.js";import{l as zt,n as Bt,o as Vt}from"./stringUtils-CbS6OkmE.js";import{bn as Ht,yn as Ut}from"./prompt-CybUvG8G.js";import{gt as Wt}from"./sessionState-BvECKycx.js";import{a as Gt,i as Kt,n as qt,o as Jt,r as Yt,t as Xt}from"./agentDisplay-5gnCQwUY.js";import{n as Zt,t as Qt}from"./useExitOnCtrlCDWithKeybindings-D2FvHieH.js";import{n as $t,t as en}from"./useMergedTools-B-Z9XQ6U.js";import{n as tn,r as nn,t as rn}from"./promptEditor-0Ug93P2I.js";import{n as an,t as on}from"./useMainLoopModel-ylPQNj7Z.js";import{join as A}from"path";import{mkdir as sn,open as cn,unlink as ln}from"fs/promises";var j,un=e((()=>{j={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function dn(e,t,n,r,i,a,o){return`---
|
|
2
|
-
name: ${e}
|
|
3
|
-
description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
${r}
|
|
7
|
-
`}function fn(e){switch(e){case`flagSettings`:throw Error(`Cannot get directory path for ${e} agents`);case`userSettings`:return A(n(),j.AGENTS_DIR);case`projectSettings`:return A(pt(),j.FOLDER_NAME,j.AGENTS_DIR);case`policySettings`:return A(Tt(),j.FOLDER_NAME,j.AGENTS_DIR);case`localSettings`:return A(pt(),j.FOLDER_NAME,j.AGENTS_DIR)}}function pn(e){switch(e){case`projectSettings`:return A(`.`,j.FOLDER_NAME,j.AGENTS_DIR);default:return fn(e)}}function mn(e){return A(fn(e.source),`${e.agentType}.md`)}function hn(e){if(e.source===`built-in`)return`Built-in`;if(e.source===`plugin`)throw Error(`Cannot get file path for plugin agents`);return A(fn(e.source),`${e.filename||e.agentType}.md`)}function gn(e){return e.source===`built-in`?`Built-in`:A(pn(e.source),`${e.agentType}.md`)}function _n(e){return Je(e)?`Built-in`:Ie(e)?`Plugin: ${e.plugin||`Unknown`}`:e.source===`flagSettings`?`CLI argument`:A(pn(e.source),`${e.filename||e.agentType}.md`)}async function vn(e){let t=fn(e);return await sn(t,{recursive:!0}),t}async function yn(e,t,n,r,i,a=!0,o,s,c){if(e===`built-in`)throw Error(`Cannot save built-in agents`);await vn(e);let l=mn({source:e,agentType:t}),u=dn(t,n,r,i,o,s,c);try{await Sn(l,u,a?`wx`:`w`)}catch(e){throw gt(e)===`EEXIST`?Error(`Agent file already exists: ${l}`):e}}async function bn(e,t,n,r,i,a,o){if(e.source===`built-in`)throw Error(`Cannot update built-in agents`);await Sn(hn(e),dn(e.agentType,t,n,r,i,a,o))}async function xn(e){if(e.source===`built-in`)throw Error(`Cannot delete built-in agents`);let t=hn(e);try{await ln(t)}catch(e){if(gt(e)!==`ENOENT`)throw e}}async function Sn(e,t,n=`w`){let r=await cn(e,n);try{await r.writeFile(t,{encoding:`utf-8`}),await r.datasync()}finally{await r.close()}}var Cn=e((()=>{Et(),Ve(),ft(),r(),bt(),un()}));function wn({agent:e,tools:t,onBack:n}){let r=p(e,t,!1),i=_n(e),o=m(e.agentType);E(`confirm:no`,n,{context:`Confirmation`});let s=e=>{e.key===`return`&&(e.preventDefault(),n())};function c(){return r.hasWildcard?(0,M.jsx)(w,{children:`All tools`}):!e.tools||e.tools.length===0?(0,M.jsx)(w,{children:`None`}):(0,M.jsxs)(M.Fragment,{children:[r.validTools.length>0&&(0,M.jsx)(w,{children:r.validTools.join(`, `)}),r.invalidTools.length>0&&(0,M.jsxs)(w,{color:`warning`,children:[a.warning,` Unrecognized: `,r.invalidTools.join(`, `)]})]})}return(0,M.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,M.jsx)(w,{dimColor:!0,children:i}),(0,M.jsxs)(C,{flexDirection:`column`,children:[(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]}),(0,M.jsx)(C,{marginLeft:2,children:(0,M.jsx)(w,{children:e.whenToUse})})]}),(0,M.jsxs)(C,{children:[(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Tools`}),`:`,` `]}),c()]}),(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Model`}),`: `,he(e.model)]}),e.permissionMode&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Permission mode`}),`: `,e.permissionMode]}),e.memory&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Memory`}),`: `,de(e.memory)]}),e.hooks&&Object.keys(e.hooks).length>0&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Hooks`}),`: `,Object.keys(e.hooks).join(`, `)]}),e.skills&&e.skills.length>0&&(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Skills`}),`:`,` `,e.skills.length>10?`${e.skills.length} skills`:e.skills.join(`, `)]}),o&&(0,M.jsx)(C,{children:(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`Color`}),`:`,` `,(0,M.jsxs)(w,{backgroundColor:o,color:`inverseText`,children:[` `,e.agentType,` `]})]})}),!Je(e)&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(C,{children:(0,M.jsxs)(w,{children:[(0,M.jsx)(w,{bold:!0,children:`System prompt`}),`:`]})}),(0,M.jsx)(C,{marginLeft:2,marginRight:2,children:(0,M.jsx)(Oe,{children:e.getSystemPrompt()})})]})]})}var M,Tn=e((()=>{i(),D(),O(),f(),_(),h(),y(),Ve(),we(),Re(),Cn(),M=k()}));function En({agentName:e,currentColor:t=`automatic`,onConfirm:n}){let[r,i]=(0,Dn.useState)(Math.max(0,On.indexOf(t))),o=e=>{if(e.key===`up`)e.preventDefault(),i(e=>e>0?e-1:On.length-1);else if(e.key===`down`)e.preventDefault(),i(e=>e<On.length-1?e+1:0);else if(e.key===`return`){e.preventDefault();let t=On[r];n(t===`automatic`?void 0:t)}},s=On[r];return(0,N.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:o,children:[(0,N.jsx)(C,{flexDirection:`column`,children:On.map((e,t)=>{let n=t===r;return(0,N.jsxs)(C,{flexDirection:`row`,gap:1,children:[(0,N.jsx)(w,{color:n?`suggestion`:void 0,children:n?a.pointer:` `}),e===`automatic`?(0,N.jsx)(w,{bold:n,children:`Automatic color`}):(0,N.jsxs)(C,{gap:1,children:[(0,N.jsx)(w,{backgroundColor:pe[e],color:`inverseText`,children:` `}),(0,N.jsx)(w,{bold:n,children:Bt(e)})]})]},e)})}),(0,N.jsxs)(C,{marginTop:1,children:[(0,N.jsx)(w,{children:`Preview: `}),s===void 0||s===`automatic`?(0,N.jsxs)(w,{inverse:!0,bold:!0,children:[` `,`@`,e,` `]}):(0,N.jsxs)(w,{backgroundColor:pe[s],color:`inverseText`,bold:!0,children:[` `,`@`,e,` `]})]})]})}var Dn,N,On,kn=e((()=>{i(),Dn=t(D(),1),O(),_(),Vt(),N=k(),On=[`automatic`,...le]}));function An({initialModel:e,onComplete:t,onCancel:n}){let r=jn.useMemo(()=>{let t=ae();return e&&!t.some(t=>t.value===e)?[{value:e,label:e,description:`Current model (custom ID)`},...t]:t},[e]);return(0,Mn.jsxs)(C,{flexDirection:`column`,children:[(0,Mn.jsx)(C,{marginBottom:1,children:(0,Mn.jsx)(w,{dimColor:!0,children:`Model determines the agent's reasoning capabilities and speed.`})}),(0,Mn.jsx)(xe,{options:r,defaultValue:e??`sonnet`,onChange:t,onCancel:()=>n?n():t(void 0)})]})}var jn,Mn,Nn=e((()=>{jn=t(D(),1),O(),we(),Ee(),Mn=k()}));function Pn(){return{READ_ONLY:{name:`Read-only tools`,toolNames:new Set([et.name,_e.name,ee.name,$e.name,ye.name,qe.name,ie.name,Ce.name,Ne.name])},EDIT:{name:`Edit tools`,toolNames:new Set([u.name,se.name,ze.name])},EXECUTION:{name:`Execution tools`,toolNames:new Set([Be.name])},MCP:{name:`MCP tools`,toolNames:new Set,isMcp:!0},OTHER:{name:`Other tools`,toolNames:new Set}}}function Fn(e){let t=new Map;return e.forEach(e=>{if(ge(e)){let n=Dt(e.name);if(n?.serverName){let r=t.get(n.serverName)||[];r.push(e),t.set(n.serverName,r)}}}),Array.from(t.entries()).map(([e,t])=>({serverName:e,tools:t})).sort((e,t)=>e.serverName.localeCompare(t.serverName))}function In({tools:e,initialTools:t,onComplete:n,onCancel:r}){let i=(0,P.useMemo)(()=>ne({tools:e,isBuiltIn:!1,isAsync:!1}),[e]),[o,s]=(0,P.useState)(!t||t.includes(`*`)?i.map(e=>e.name):t),[c,l]=(0,P.useState)(0),[u,d]=(0,P.useState)(!1),f=(0,P.useMemo)(()=>{let e=new Set(i.map(e=>e.name));return o.filter(t=>e.has(t))},[o,i]),p=new Set(f),m=f.length===i.length&&i.length>0,h=e=>{e&&s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},g=(e,t)=>{s(n=>{if(t){let t=e.filter(e=>!n.includes(e));return[...n,...t]}else return n.filter(t=>!e.includes(t))})},ee=()=>{let e=i.map(e=>e.name);n(f.length===e.length&&e.every(e=>f.includes(e))?void 0:f)},_=(0,P.useMemo)(()=>{let e=Pn(),t={readOnly:[],edit:[],execution:[],mcp:[],other:[]};return i.forEach(n=>{ge(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=xt(e,e=>p.has(e.name))<e.length;return()=>{let n=e.map(e=>e.name);g(n,t)}},v=[];v.push({id:`continue`,label:`Continue`,action:ee,isContinue:!0}),v.push({id:`bucket-all`,label:`${m?a.checkboxOn:a.checkboxOff} All tools`,action:()=>{let e=i.map(e=>e.name);g(e,!m)}});let y=Pn();[{id:`bucket-readonly`,name:y.READ_ONLY.name,tools:_.readOnly},{id:`bucket-edit`,name:y.EDIT.name,tools:_.edit},{id:`bucket-execution`,name:y.EXECUTION.name,tools:_.execution},{id:`bucket-mcp`,name:y.MCP.name,tools:_.mcp},{id:`bucket-other`,name:y.OTHER.name,tools:_.other}].forEach(({id:e,name:t,tools:n})=>{if(n.length===0)return;let r=xt(n,e=>p.has(e.name))===n.length;v.push({id:e,label:`${r?a.checkboxOn:a.checkboxOff} ${t}`,action:te(n)})});let re=v.length;v.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,P.useMemo)(()=>Fn(i),[i]);return u&&(ie.length>0&&(v.push({id:`mcp-servers-header`,label:`MCP Servers:`,action:()=>{},isHeader:!0}),ie.forEach(({serverName:e,tools:t})=>{let n=xt(t,e=>p.has(e.name))===t.length;v.push({id:`mcp-server-${e}`,label:`${n?a.checkboxOn:a.checkboxOff} ${e} (${t.length} ${zt(t.length,`tool`)})`,action:()=>{let e=t.map(e=>e.name);g(e,!n)}})}),v.push({id:`tools-header`,label:`Individual Tools:`,action:()=>{},isHeader:!0})),i.forEach(e=>{let t=e.name;if(e.name.startsWith(`mcp__`)){let n=Dt(e.name);t=n?`${n.toolName} (${n.serverName})`:e.name}v.push({id:`tool-${e.name}`,label:`${p.has(e.name)?a.checkboxOn:a.checkboxOff} ${t}`,action:()=>h(e.name)})})),E(`confirm:no`,(0,P.useCallback)(()=>{r?r():n(t)},[r,n,t]),{context:`Confirmation`}),(0,F.jsxs)(C,{flexDirection:`column`,marginTop:1,tabIndex:0,autoFocus:!0,onKeyDown:e=>{if(e.key===`return`){e.preventDefault();let t=v[c];t&&!t.isHeader&&t.action()}else if(e.key===`up`){e.preventDefault();let t=c-1;for(;t>0&&v[t]?.isHeader;)t--;l(Math.max(0,t))}else if(e.key===`down`){e.preventDefault();let t=c+1;for(;t<v.length-1&&v[t]?.isHeader;)t++;l(Math.min(v.length-1,t))}},children:[(0,F.jsxs)(w,{color:c===0?`suggestion`:void 0,bold:c===0,children:[c===0?`${a.pointer} `:` `,`[ Continue ]`]}),(0,F.jsx)(ct,{width:40}),v.slice(1).map((e,t)=>{let n=t+1===c,r=e.isToggle,i=e.isHeader;return(0,F.jsxs)(P.Fragment,{children:[r&&(0,F.jsx)(ct,{width:40}),i&&t>0&&(0,F.jsx)(C,{marginTop:1}),(0,F.jsxs)(w,{color:i?void 0:n?`suggestion`:void 0,dimColor:i,bold:r&&n,children:[i?``:n?`${a.pointer} `:` `,r?`[ ${e.label} ]`:e.label]})]},e.id)}),(0,F.jsx)(C,{marginTop:1,flexDirection:`column`,children:(0,F.jsx)(w,{dimColor:!0,children:m?`All tools selected`:`${p.size} of ${i.length} tools selected`})})]})}var P,F,Ln=e((()=>{i(),P=t(D(),1),kt(),it(),y(),wt(),Ke(),me(),v(),be(),d(),at(),rt(),ke(),Ae(),te(),s(),Me(),Te(),O(),f(),Ct(),Vt(),F=k()}));function Rn(e){return e===`all`?`Agents`:e===`built-in`?`Built-in agents`:e===`plugin`?`Plugin agents`:Pe(At(e))}var zn=e((()=>{c(),Ot()}));function Bn({agent:e,tools:t,onSaved:n,onBack:r}){let i=Le(),[o,s]=(0,I.useState)(`menu`),[c,l]=(0,I.useState)(0),[u,d]=(0,I.useState)(null),[f,p]=(0,I.useState)(e.color),m=(0,I.useCallback)(async()=>{let t=await rn(hn(e));t.error?d(t.error):n(`Opened ${e.agentType} in editor. If you made edits, restart to load the latest version.`)},[e,n]),h=(0,I.useCallback)(async(t={})=>{let{tools:r,color:a,model:o}=t,s=a??f,c=r!==void 0,l=o!==void 0,u=s!==e.color;if(!c&&!l&&!u)return!1;try{return!ve(e)&&!Ie(e)?!1:(await bn(e,e.whenToUse,r??e.tools,e.getSystemPrompt(),s,o??e.model),u&&s&&We(e.agentType,s),i(t=>{let n=t.agentDefinitions.allAgents.map(t=>t.agentType===e.agentType?{...t,tools:r??t.tools,color:s,model:o??t.model}:t);return{...t,agentDefinitions:{...t.agentDefinitions,activeAgents:Ge(n),allAgents:n}}}),n(`Updated agent: ${ut.bold(e.agentType)}`),!0)}catch(e){return d(e instanceof Error?e.message:`Failed to save agent`),!1}},[e,f,n,i]),g=(0,I.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]),ee=(0,I.useCallback)(()=>{d(null),o===`menu`?r():s(`menu`)},[o,r]),_=(0,I.useCallback)(e=>{if(e.key===`up`)e.preventDefault(),l(e=>Math.max(0,e-1));else if(e.key===`down`)e.preventDefault(),l(e=>Math.min(g.length-1,e+1));else if(e.key===`return`){e.preventDefault();let t=g[c];t&&t.action()}},[g,c]);E(`confirm:no`,ee,{context:`Confirmation`});let te=()=>(0,L.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:_,children:[(0,L.jsxs)(w,{dimColor:!0,children:[`Source: `,Rn(e.source)]}),(0,L.jsx)(C,{marginTop:1,flexDirection:`column`,children:g.map((e,t)=>(0,L.jsxs)(w,{color:t===c?`suggestion`:void 0,children:[t===c?`${a.pointer} `:` `,e.label]},e.label))}),u&&(0,L.jsx)(C,{marginTop:1,children:(0,L.jsx)(w,{color:`error`,children:u})})]});switch(o){case`menu`:return te();case`edit-tools`:return(0,L.jsx)(In,{tools:t,initialTools:e.tools,onComplete:async e=>{s(`menu`),await h({tools:e})}});case`edit-color`:return(0,L.jsx)(En,{agentName:e.agentType,currentColor:f||e.color||`automatic`,onConfirm:async e=>{p(e),s(`menu`),await h({color:e})}});case`edit-model`:return(0,L.jsx)(An,{initialModel:e.model,onComplete:async e=>{s(`menu`),await h({model:e})}});default:return null}}var I,L,Vn=e((()=>{lt(),i(),D(),I=t(D(),1),Ue(),O(),f(),_(),Ve(),nn(),Cn(),kn(),Nn(),Ln(),zn(),L=k()}));function Hn({instructions:e=`Press ↑↓ to navigate · Enter to select · Esc to go back`}){let t=Zt();return(0,Un.jsx)(C,{marginLeft:2,children:(0,Un.jsx)(w,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var Un,Wn=e((()=>{D(),Qt(),O(),Un=k()}));function Gn({source:e,agents:t,onBack:n,onSelect:r,onCreateNew:i,changes:o}){let[s,c]=Kn.useState(null),[l,u]=Kn.useState(!0),d=Kn.useMemo(()=>[...t].sort(qt),[t]),f=e=>({isOverridden:!!e.overriddenBy,overriddenBy:e.overriddenBy||null}),p=()=>(0,R.jsxs)(C,{children:[(0,R.jsx)(w,{color:l?`suggestion`:void 0,children:l?`${a.pointer} `:` `}),(0,R.jsx)(w,{color:l?`suggestion`:void 0,children:`Create new agent`})]}),m=e=>{let t=e.source===`built-in`,n=!t&&!l&&s?.agentType===e.agentType&&s?.source===e.source,{isOverridden:r,overriddenBy:i}=f(e),o=t||r,c=!t&&n?`suggestion`:void 0,u=Gt(e);return(0,R.jsxs)(C,{children:[(0,R.jsx)(w,{dimColor:o&&!n,color:c,children:t?``:n?`${a.pointer} `:` `}),(0,R.jsx)(w,{dimColor:o&&!n,color:c,children:e.agentType}),u&&(0,R.jsxs)(w,{dimColor:!0,color:c,children:[` · `,u]}),e.memory&&(0,R.jsxs)(w,{dimColor:!0,color:c,children:[` · `,e.memory,` memory`]}),i&&(0,R.jsxs)(w,{dimColor:!n,color:n?`warning`:void 0,children:[` `,a.warning,` shadowed by `,Yt(i)]})]},`${e.agentType}-${e.source}`)},h=Kn.useMemo(()=>{let t=d.filter(e=>e.source!==`built-in`);return e===`all`?Xt.filter(e=>e.source!==`built-in`).flatMap(({source:e})=>t.filter(t=>t.source===e)):t},[d,e]);Kn.useEffect(()=>{!s&&!l&&h.length>0&&(i?u(!0):c(h[0]||null))},[h,s,l,i]);let g=e=>{if(e.key===`return`){e.preventDefault(),l&&i?i():s&&r(s);return}if(e.key!==`up`&&e.key!==`down`)return;e.preventDefault();let t=!!i,n=h.length+ +!!t;if(n===0)return;let a=0;if(!l&&s){let e=h.findIndex(e=>e.agentType===s.agentType&&e.source===s.source);e>=0&&(a=t?e+1:e)}let o=e.key===`up`?a===0?n-1:a-1:a===n-1?0:a+1;if(t&&o===0)u(!0),c(null);else{let e=t?o-1:o,n=h[e];n&&(u(!1),c(n))}},ee=(e=`Built-in (always available):`)=>{let t=d.filter(e=>e.source===`built-in`);return(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,R.jsx)(w,{bold:!0,dimColor:!0,children:e}),t.map(m)]})},_=(e,t)=>{if(!t.length)return null;let n=t[0]?.baseDir;return(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,children:[(0,R.jsxs)(C,{paddingLeft:2,children:[(0,R.jsx)(w,{bold:!0,dimColor:!0,children:e}),n&&(0,R.jsxs)(w,{dimColor:!0,children:[` (`,n,`)`]})]}),t.map(e=>m(e))]})},te=Rn(e),ne=d.filter(e=>e.source===`built-in`);return!d.length||e!==`built-in`&&!d.some(e=>e.source!==`built-in`)?(0,R.jsx)(dt,{title:te,subtitle:`No agents found`,onCancel:n,hideInputGuide:!0,children:(0,R.jsxs)(C,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,R.jsx)(C,{children:p()}),(0,R.jsx)(w,{dimColor:!0,children:`No agents found. Create specialized subagents that Claude can delegate to.`}),(0,R.jsx)(w,{dimColor:!0,children:`Each subagent has its own context window, custom system prompt, and specific tools.`}),(0,R.jsx)(w,{dimColor:!0,children:`Try creating: Code Reviewer, Code Simplifier, Security Reviewer, Tech Lead, or UX Reviewer.`}),e!==`built-in`&&d.some(e=>e.source===`built-in`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ct,{}),ee()]})]})}):(0,R.jsxs)(dt,{title:te,subtitle:`${xt(d,e=>!e.overriddenBy)} agents`,onCancel:n,hideInputGuide:!0,children:[o&&o.length>0&&(0,R.jsx)(C,{marginTop:1,children:(0,R.jsx)(w,{dimColor:!0,children:o[o.length-1]})}),(0,R.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:[i&&(0,R.jsx)(C,{marginBottom:1,children:p()}),e===`all`?(0,R.jsxs)(R.Fragment,{children:[Xt.filter(e=>e.source!==`built-in`).map(({label:e,source:t})=>(0,R.jsx)(Kn.Fragment,{children:_(e,d.filter(e=>e.source===t))},t)),ne.length>0&&(0,R.jsxs)(C,{flexDirection:`column`,marginBottom:1,paddingLeft:2,children:[(0,R.jsxs)(w,{dimColor:!0,children:[(0,R.jsx)(w,{bold:!0,children:`Built-in agents`}),` (always available)`]}),ne.map(m)]})]}):e===`built-in`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(w,{dimColor:!0,italic:!0,children:`Built-in agents are provided by default and cannot be modified.`}),(0,R.jsx)(C,{marginTop:1,flexDirection:`column`,children:d.map(e=>m(e))})]}):(0,R.jsxs)(R.Fragment,{children:[d.filter(e=>e.source!==`built-in`).map(e=>m(e)),d.some(e=>e.source===`built-in`)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ct,{}),ee()]})]})]})]})}var Kn,R,qn=e((()=>{i(),Kn=t(D(),1),O(),Kt(),Ct(),zn(),R=k()}));function Jn({steps:e,initialData:t={},onComplete:n,onCancel:r,children:i,title:a,showStepCounter:o=!0}){let[s,c]=(0,z.useState)(0),[l,u]=(0,z.useState)(t),[d,f]=(0,z.useState)(!1),[p,m]=(0,z.useState)([]);Zt(),(0,z.useEffect)(()=>{d&&(m([]),n(l))},[d,l,n]);let h=(0,z.useCallback)(()=>{s<e.length-1?(p.length>0&&m(e=>[...e,s]),c(e=>e+1)):f(!0)},[s,e.length,p]),g=(0,z.useCallback)(()=>{if(p.length>0){let e=p[p.length-1];e!==void 0&&(m(e=>e.slice(0,-1)),c(e))}else s>0?c(e=>e-1):r&&r()},[s,p,r]),ee=(0,z.useCallback)(t=>{t>=0&&t<e.length&&(m(e=>[...e,s]),c(t))},[s,e.length]),_=(0,z.useCallback)(()=>{m([]),r&&r()},[r]),te=(0,z.useCallback)(e=>{u(t=>({...t,...e}))},[]),ne=(0,z.useMemo)(()=>({currentStepIndex:s,totalSteps:e.length,wizardData:l,setWizardData:u,updateWizardData:te,goNext:h,goBack:g,goToStep:ee,cancel:_,title:a,showStepCounter:o}),[s,e.length,l,te,h,g,ee,_,a,o]),v=e[s];return!v||d?null:(0,Yn.jsx)(Xn.Provider,{value:ne,children:i||(0,Yn.jsx)(v,{})})}var z,Yn,Xn,Zn=e((()=>{z=t(D(),1),Qt(),Yn=k(),Xn=(0,z.createContext)(null)}));function B(){let e=(0,Qn.useContext)(Xn);if(!e)throw Error(`useWizard must be used within a WizardProvider`);return e}var Qn,$n=e((()=>{Qn=t(D(),1),Zn()}));function er({instructions:e=(0,tr.jsxs)(T,{children:[(0,tr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,tr.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,tr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]})}){let t=Zt();return(0,tr.jsx)(C,{marginLeft:3,marginTop:1,children:(0,tr.jsx)(w,{dimColor:!0,children:t.pending?`Press ${t.keyName} again to exit`:e})})}var tr,nr=e((()=>{Qt(),O(),x(),tr=k()}));function V({title:e,color:t=`suggestion`,children:n,subtitle:r,footerText:i}){let{currentStepIndex:a,totalSteps:o,title:s,showStepCounter:c,goBack:l}=B();return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(dt,{title:`${e||s||`Wizard`}${c===!1?``:` (${a+1}/${o})`}`,subtitle:r,onCancel:l,color:t,hideInputGuide:!0,isCancelActive:!1,children:n}),(0,rr.jsx)(er,{instructions:i})]})}var rr,H=e((()=>{O(),$n(),nr(),rr=k()})),U=e((()=>{$n(),H(),nr(),Zn()}));function ir(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();return E(`confirm:no`,t,{context:`Confirmation`}),(0,W.jsx)(V,{subtitle:`Choose background color`,footerText:(0,W.jsxs)(T,{children:[(0,W.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,W.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,W.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,W.jsx)(C,{children:(0,W.jsx)(En,{agentName:r.agentType||`agent`,currentColor:`automatic`,onConfirm:t=>{n({selectedColor:t,finalAgent:{agentType:r.agentType,whenToUse:r.whenToUse,getSystemPrompt:()=>r.systemPrompt,tools:r.selectedTools,...r.selectedModel?{model:r.selectedModel}:{},...t?{color:t}:{},source:r.location}}),e()}})})})}var W,ar=e((()=>{O(),f(),x(),U(),H(),kn(),W=k()}));function or(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 sr(e,t,n){let r=[],i=[];if(!e.agentType)r.push(`Agent type is required`);else{let t=or(e.agentType);t&&r.push(t);let i=n.find(t=>t.agentType===e.agentType&&t.source!==e.source);i&&r.push(`Agent type "${e.agentType}" already exists in ${Rn(i.source)}`)}if(e.whenToUse?e.whenToUse.length<10?i.push(`Description should be more descriptive (at least 10 characters)`):e.whenToUse.length>5e3&&i.push(`Description is very long (over 5000 characters)`):r.push(`Description (description) is required`),e.tools!==void 0&&!Array.isArray(e.tools))r.push(`Tools must be an array`);else{e.tools===void 0?i.push(`Agent has access to all tools`):e.tools.length===0&&i.push(`No tools selected - agent will have very limited capabilities`);let n=p(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 cr=e((()=>{y(),zn()}));function lr({tools:e,existingAgents:t,onSave:n,onSaveAndEdit:r,error:i}){let{goBack:a,wizardData:o}=B();E(`confirm:no`,a,{context:`Confirmation`});let s=e=>{e.key===`s`||e.key===`return`?(e.preventDefault(),n()):e.key===`e`&&(e.preventDefault(),r())},c=o.finalAgent,l=sr(c,e,t),u=Lt(c.getSystemPrompt(),240),d=Lt(c.whenToUse,240),f=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]}`,p=Mt()?(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Memory`}),`: `,de(c.memory)]}):null;return(0,G.jsx)(V,{subtitle:`Confirm and save`,footerText:(0,G.jsxs)(T,{children:[(0,G.jsx)(S,{shortcut:`s/Enter`,action:`save`}),(0,G.jsx)(S,{shortcut:`e`,action:`edit in your editor`}),(0,G.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,G.jsxs)(C,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:s,children:[(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Name`}),`: `,c.agentType]}),(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Location`}),`:`,` `,gn({source:o.location,agentType:c.agentType})]}),(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Tools`}),`: `,f(c.tools)]}),(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Model`}),`: `,he(c.model)]}),p,(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`Description`}),` (tells Claude when to use this agent):`]})}),(0,G.jsx)(C,{marginLeft:2,marginTop:1,children:(0,G.jsx)(w,{children:d})}),(0,G.jsx)(C,{marginTop:1,children:(0,G.jsxs)(w,{children:[(0,G.jsx)(w,{bold:!0,children:`System prompt`}),`:`]})}),(0,G.jsx)(C,{marginLeft:2,marginTop:1,children:(0,G.jsx)(w,{children:u})}),l.warnings.length>0&&(0,G.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,G.jsx)(w,{color:`warning`,children:`Warnings:`}),l.warnings.map((e,t)=>(0,G.jsxs)(w,{dimColor:!0,children:[` `,`• `,e]},t))]}),l.errors.length>0&&(0,G.jsxs)(C,{marginTop:1,flexDirection:`column`,children:[(0,G.jsx)(w,{color:`error`,children:`Errors:`}),l.errors.map((e,t)=>(0,G.jsxs)(w,{color:`error`,children:[` `,`• `,e]},t))]}),i&&(0,G.jsx)(C,{marginTop:1,children:(0,G.jsx)(w,{color:`error`,children:i})}),(0,G.jsx)(C,{marginTop:2,children:(0,G.jsxs)(w,{color:`success`,children:[`Press `,(0,G.jsx)(w,{bold:!0,children:`s`}),` or `,(0,G.jsx)(w,{bold:!0,children:`Enter`}),` to save, `,(0,G.jsx)(w,{bold:!0,children:`e`}),` to save and edit`]})})]})})}var G,ur=e((()=>{O(),f(),jt(),h(),Rt(),we(),x(),U(),H(),Cn(),cr(),G=k()}));function dr({tools:e,existingAgents:t,onComplete:n}){let{wizardData:r}=B(),[i,a]=(0,fr.useState)(null),o=Le(),s=(0,fr.useCallback)(async e=>{if(r?.finalAgent)try{await yn(r.location,r.finalAgent.agentType,r.finalAgent.whenToUse,r.finalAgent.tools,r.finalAgent.getSystemPrompt(),!0,r.finalAgent.color,r.finalAgent.model,r.finalAgent.memory),o(e=>{if(!r.finalAgent)return e;let t=e.agentDefinitions.allAgents.concat(r.finalAgent);return{...e,agentDefinitions:{...e.agentDefinitions,activeAgents:Ge(t),allAgents:t}}}),Ze(),e&&await rn(mn({source:r.location,agentType:r.finalAgent.agentType})),It(`tengu_agent_created`,{agent_type:r.finalAgent.agentType,generation_method:r.wasGenerated?`generated`:`manual`,source:r.location,tool_count:r.finalAgent.tools?.length??`all`,has_custom_model:!!r.finalAgent.model,has_custom_color:!!r.finalAgent.color,has_memory:!!r.finalAgent.memory,memory_scope:r.finalAgent.memory??`none`,...e?{opened_in_editor:!0}:{}}),n(e?`Created agent: ${ut.bold(r.finalAgent.agentType)} and opened in editor. If you made edits, restart to load the latest version.`:`Created agent: ${ut.bold(r.finalAgent.agentType)}`)}catch(e){a(e instanceof Error?e.message:`Failed to save agent`)}},[r,n,o]);return(0,pr.jsx)(lr,{tools:e,existingAgents:t,onSave:(0,fr.useCallback)(()=>s(!1),[s]),onSaveAndEdit:(0,fr.useCallback)(()=>s(!0),[s]),error:i})}var fr,pr,mr=e((()=>{lt(),fr=t(D(),1),Ft(),Ue(),Ve(),nn(),U(),Cn(),ur(),pr=k()}));function hr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B(),[i,a]=(0,gr.useState)(r.whenToUse||``),[o,s]=(0,gr.useState)(i.length),[c,l]=(0,gr.useState)(null);return E(`confirm:no`,t,{context:`Settings`}),E(`chat:externalEditor`,(0,gr.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,K.jsx)(V,{subtitle:`Description (tell Claude when to use this agent)`,footerText:(0,K.jsxs)(T,{children:[(0,K.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,K.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,K.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,K.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,K.jsxs)(C,{flexDirection:`column`,children:[(0,K.jsx)(w,{children:`When should Claude use this agent?`}),(0,K.jsx)(C,{marginTop:1,children:(0,K.jsx)(nt,{value:i,onChange:a,onSubmit:t=>{let r=t.trim();if(!r){l(`Description is required`);return}l(null),n({whenToUse:r}),e()},placeholder:`e.g., use this agent after you're done writing code...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,K.jsx)(C,{marginTop:1,children:(0,K.jsx)(w,{color:`error`,children:c})})]})})}var gr,K,_r=e((()=>{gr=t(D(),1),O(),f(),nn(),x(),oe(),U(),H(),K=k()}));async function vr(e,t,n,r){let i=g({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=He([i],a),s=Mt()?yr+br:yr,c=await Qe({messages:Ye(o),systemPrompt:Wt([s]),thinkingConfig:{type:`disabled`},tools:[],signal:r,options:{getToolPermissionContext:async()=>Ut(),model:t,toolChoice:void 0,agents:[],isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,querySource:`agent_creation`,mcpTools:[]}}),l=(Array.isArray(c.message.content)?c.message.content:[]).filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
9
|
-
`),u;try{u=mt(l.trim())}catch{let e=l.match(/\{[\s\S]*\}/);if(!e)throw Error(`No JSON object found in response`);u=mt(e[0])}if(!u.identifier||!u.whenToUse||!u.systemPrompt)throw Error(`Invalid agent configuration generated`);return It(`tengu_agent_definition_generated`,{agent_identifier:u.identifier}),{identifier:u.identifier,whenToUse:u.whenToUse,systemPrompt:u.systemPrompt}}var yr,br,xr=e((()=>{ce(),o(),Ht(),wt(),je(),re(),jt(),Ft(),vt(),ot(),yr=`You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.
|
|
10
|
-
|
|
11
|
-
**Important Context**: You may have access to project-specific instructions from CLAUDE.md files and other context that may include coding standards, project structure, and custom requirements. Consider this context when creating agents to ensure they align with the project's established patterns and practices.
|
|
12
|
-
|
|
13
|
-
When a user describes what they want an agent to do, you will:
|
|
14
|
-
|
|
15
|
-
1. **Extract Core Intent**: Identify the fundamental purpose, key responsibilities, and success criteria for the agent. Look for both explicit requirements and implicit needs. Consider any project-specific context from CLAUDE.md files. For agents that are meant to review code, you should assume that the user is asking to review recently written code and not the whole codebase, unless the user has explicitly instructed you otherwise.
|
|
16
|
-
|
|
17
|
-
2. **Design Expert Persona**: Create a compelling expert identity that embodies deep domain knowledge relevant to the task. The persona should inspire confidence and guide the agent's decision-making approach.
|
|
18
|
-
|
|
19
|
-
3. **Architect Comprehensive Instructions**: Develop a system prompt that:
|
|
20
|
-
- Establishes clear behavioral boundaries and operational parameters
|
|
21
|
-
- Provides specific methodologies and best practices for task execution
|
|
22
|
-
- Anticipates edge cases and provides guidance for handling them
|
|
23
|
-
- Incorporates any specific requirements or preferences mentioned by the user
|
|
24
|
-
- Defines output format expectations when relevant
|
|
25
|
-
- Aligns with project-specific coding standards and patterns from CLAUDE.md
|
|
26
|
-
|
|
27
|
-
4. **Optimize for Performance**: Include:
|
|
28
|
-
- Decision-making frameworks appropriate to the domain
|
|
29
|
-
- Quality control mechanisms and self-verification steps
|
|
30
|
-
- Efficient workflow patterns
|
|
31
|
-
- Clear escalation or fallback strategies
|
|
32
|
-
|
|
33
|
-
5. **Create Identifier**: Design a concise, descriptive identifier that:
|
|
34
|
-
- Uses lowercase letters, numbers, and hyphens only
|
|
35
|
-
- Is typically 2-4 words joined by hyphens
|
|
36
|
-
- Clearly indicates the agent's primary function
|
|
37
|
-
- Is memorable and easy to type
|
|
38
|
-
- Avoids generic terms like "helper" or "assistant"
|
|
39
|
-
|
|
40
|
-
6 **Example agent descriptions**:
|
|
41
|
-
- in the 'whenToUse' field of the JSON object, you should include examples of when this agent should be used.
|
|
42
|
-
- examples should be of the form:
|
|
43
|
-
- <example>
|
|
44
|
-
Context: The user is creating a test-runner agent that should be called after a logical chunk of code is written.
|
|
45
|
-
user: "Please write a function that checks if a number is prime"
|
|
46
|
-
assistant: "Here is the relevant function: "
|
|
47
|
-
<function call omitted for brevity only for this example>
|
|
48
|
-
<commentary>
|
|
49
|
-
Since a significant piece of code was written, use the ${St} tool to launch the test-runner agent to run the tests.
|
|
50
|
-
</commentary>
|
|
51
|
-
assistant: "Now let me use the test-runner agent to run the tests"
|
|
52
|
-
</example>
|
|
53
|
-
- <example>
|
|
54
|
-
Context: User is creating an agent to respond to the word "hello" with a friendly jok.
|
|
55
|
-
user: "Hello"
|
|
56
|
-
assistant: "I'm going to use the ${St} tool to launch the greeting-responder agent to respond with a friendly joke"
|
|
57
|
-
<commentary>
|
|
58
|
-
Since the user is greeting, use the greeting-responder agent to respond with a friendly joke.
|
|
59
|
-
</commentary>
|
|
60
|
-
</example>
|
|
61
|
-
- If the user mentioned or implied that the agent should be used proactively, you should include examples of this.
|
|
62
|
-
- NOTE: Ensure that in the examples, you are making the assistant use the Agent tool and not simply respond directly to the task.
|
|
63
|
-
|
|
64
|
-
Your output must be a valid JSON object with exactly these fields:
|
|
65
|
-
{
|
|
66
|
-
"identifier": "A unique, descriptive identifier using lowercase letters, numbers, and hyphens (e.g., 'test-runner', 'api-docs-writer', 'code-formatter')",
|
|
67
|
-
"whenToUse": "A precise, actionable description starting with 'Use this agent when...' that clearly defines the triggering conditions and use cases. Ensure you include examples as described above.",
|
|
68
|
-
"systemPrompt": "The complete system prompt that will govern the agent's behavior, written in second person ('You are...', 'You will...') and structured for maximum clarity and effectiveness"
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
Key principles for your system prompts:
|
|
72
|
-
- Be specific rather than generic - avoid vague instructions
|
|
73
|
-
- Include concrete examples when they would clarify behavior
|
|
74
|
-
- Balance comprehensiveness with clarity - every instruction should add value
|
|
75
|
-
- Ensure the agent has enough context to handle variations of the core task
|
|
76
|
-
- Make the agent proactive in seeking clarification when needed
|
|
77
|
-
- Build in quality assurance and self-correction mechanisms
|
|
78
|
-
|
|
79
|
-
Remember: The agents you create should be autonomous experts capable of handling their designated tasks with minimal additional guidance. Your system prompts are their complete operational manual.
|
|
80
|
-
`,br=`
|
|
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 Sr(){let{updateWizardData:e,goBack:t,goToStep:n,wizardData:r}=B(),[i,a]=(0,q.useState)(r.generationPrompt||``),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(null),[u,d]=(0,q.useState)(i.length),f=an(),p=(0,q.useRef)(null);E(`confirm:no`,(0,q.useCallback)(()=>{p.current&&(p.current.abort(),p.current=null,s(!1),l(`Generation cancelled`))},[]),{context:`Settings`,isActive:o}),E(`chat:externalEditor`,(0,q.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),d(e.content.length))},[i]),{context:`Chat`,isActive:!o}),E(`confirm:no`,(0,q.useCallback)(()=>{e({generationPrompt:``,agentType:``,systemPrompt:``,whenToUse:``,generatedAgent:void 0,wasGenerated:!1}),a(``),l(null),t()},[e,t]),{context:`Settings`,isActive:!o});let m=async()=>{let t=i.trim();if(!t){l(`Please describe what the agent should do`);return}l(null),s(!0),e({generationPrompt:t,isGenerating:!0});let r=Fe();p.current=r;try{let i=await vr(t,f,[],r.signal);e({agentType:i.identifier,whenToUse:i.whenToUse,systemPrompt:i.systemPrompt,generatedAgent:i,isGenerating:!1,wasGenerated:!0}),n(6)}catch(t){t instanceof _t||t instanceof Error&&!t.message.includes(`No assistant message found`)&&l(t.message||`Failed to generate agent`),e({isGenerating:!1})}finally{s(!1),p.current=null}},h=`Describe what this agent should do and when it should be used (be comprehensive for best results)`;return o?(0,J.jsx)(V,{subtitle:h,footerText:(0,J.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`}),children:(0,J.jsxs)(C,{flexDirection:`row`,alignItems:`center`,children:[(0,J.jsx)(st,{}),(0,J.jsx)(w,{color:`suggestion`,children:` Generating agent from description...`})]})}):(0,J.jsx)(V,{subtitle:h,footerText:(0,J.jsxs)(T,{children:[(0,J.jsx)(b,{action:`confirm:yes`,context:`Confirmation`,fallback:`Enter`,description:`submit`}),(0,J.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,J.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,J.jsxs)(C,{flexDirection:`column`,children:[c&&(0,J.jsx)(C,{marginBottom:1,children:(0,J.jsx)(w,{color:`error`,children:c})}),(0,J.jsx)(nt,{value:i,onChange:a,onSubmit:m,placeholder:`e.g., Help me write unit tests for my code...`,columns:80,cursorOffset:u,onChangeCursorOffset:d,focus:!0,showCursor:!0})]})})}var q,J,Cr=e((()=>{ht(),q=t(D(),1),on(),O(),f(),l(),nn(),x(),fe(),oe(),U(),H(),xr(),J=k()}));function wr(){let{goNext:e,updateWizardData:t,cancel:n}=B();return(0,Y.jsx)(V,{subtitle:`Choose location`,footerText:(0,Y.jsxs)(T,{children:[(0,Y.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Y.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,Y.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}),children:(0,Y.jsx)(C,{children:(0,Y.jsx)(xe,{options:[{label:`Project (.claude/agents/)`,value:`projectSettings`},{label:`Personal (~/.claude/agents/)`,value:`userSettings`}],onChange:n=>{t({location:n}),e()},onCancel:()=>n()},`location-select`)})})}var Y,Tr=e((()=>{O(),x(),Ee(),U(),H(),Y=k()}));function Er(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();E(`confirm:no`,t,{context:`Confirmation`});let i=r.location===`userSettings`?[{label:`User scope (~/.claude/agent-memory/) (Recommended)`,value:`user`},{label:`None (no persistent memory)`,value:`none`},{label:`Project scope (.claude/agent-memory/)`,value:`project`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}]:[{label:`Project scope (.claude/agent-memory/) (Recommended)`,value:`project`},{label:`None (no persistent memory)`,value:`none`},{label:`User scope (~/.claude/agent-memory/)`,value:`user`},{label:`Local scope (.claude/agent-memory-local/)`,value:`local`}];return(0,X.jsx)(V,{subtitle:`Configure agent memory`,footerText:(0,X.jsxs)(T,{children:[(0,X.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,X.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,X.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,X.jsx)(C,{children:(0,X.jsx)(xe,{options:i,onChange:t=>{let i=t===`none`?void 0:t,a=r.finalAgent?.agentType;n({selectedMemory:i,finalAgent:r.finalAgent?{...r.finalAgent,memory:i,getSystemPrompt:Mt()&&i&&a?()=>r.systemPrompt+`
|
|
101
|
-
|
|
102
|
-
`+ue(a,i):()=>r.systemPrompt}:void 0}),e()},onCancel:t},`memory-select`)})})}var X,Dr=e((()=>{O(),f(),jt(),h(),x(),Ee(),U(),H(),X=k()}));function Or(){let{goNext:e,goBack:t,updateWizardData:n,goToStep:r}=B();return(0,kr.jsx)(V,{subtitle:`Creation method`,footerText:(0,kr.jsxs)(T,{children:[(0,kr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,kr.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,kr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,kr.jsx)(C,{children:(0,kr.jsx)(xe,{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 kr,Ar=e((()=>{O(),x(),Ee(),U(),H(),kr=k()}));function jr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B();return(0,Mr.jsx)(V,{subtitle:`Select model`,footerText:(0,Mr.jsxs)(T,{children:[(0,Mr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Mr.jsx)(S,{shortcut:`Enter`,action:`select`}),(0,Mr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Mr.jsx)(An,{initialModel:r.selectedModel,onComplete:t=>{n({selectedModel:t}),e()},onCancel:t})})}var Mr,Nr=e((()=>{x(),O(),U(),H(),Nn(),Mr=k()}));function Pr(){let{goNext:e,goBack:t,updateWizardData:n,wizardData:r}=B(),[i,a]=(0,Fr.useState)(r.systemPrompt||``),[o,s]=(0,Fr.useState)(i.length),[c,l]=(0,Fr.useState)(null);return E(`confirm:no`,t,{context:`Settings`}),E(`chat:externalEditor`,(0,Fr.useCallback)(async()=>{let e=await tn(i);e.content!==null&&(a(e.content),s(e.content.length))},[i]),{context:`Chat`}),(0,Z.jsx)(V,{subtitle:`System prompt`,footerText:(0,Z.jsxs)(T,{children:[(0,Z.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,Z.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(b,{action:`chat:externalEditor`,context:`Chat`,fallback:`ctrl+g`,description:`open in editor`}),(0,Z.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Z.jsxs)(C,{flexDirection:`column`,children:[(0,Z.jsx)(w,{children:`Enter the system prompt for your agent:`}),(0,Z.jsx)(w,{dimColor:!0,children:`Be comprehensive for best results`}),(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(nt,{value:i,onChange:a,onSubmit:()=>{let t=i.trim();if(!t){l(`System prompt is required`);return}l(null),n({systemPrompt:t}),e()},placeholder:`You are a helpful code reviewer who...`,columns:80,cursorOffset:o,onChangeCursorOffset:s,focus:!0,showCursor:!0})}),c&&(0,Z.jsx)(C,{marginTop:1,children:(0,Z.jsx)(w,{color:`error`,children:c})})]})})}var Fr,Z,Ir=e((()=>{Fr=t(D(),1),O(),f(),nn(),x(),oe(),U(),H(),Z=k()}));function Lr({tools:e}){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=B(),a=e=>{r({selectedTools:e}),t()},o=i.selectedTools;return(0,Rr.jsx)(V,{subtitle:`Select tools`,footerText:(0,Rr.jsxs)(T,{children:[(0,Rr.jsx)(S,{shortcut:`Enter`,action:`toggle selection`}),(0,Rr.jsx)(S,{shortcut:`↑↓`,action:`navigate`}),(0,Rr.jsx)(b,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`})]}),children:(0,Rr.jsx)(In,{tools:e,initialTools:o,onComplete:a,onCancel:n})})}var Rr,zr=e((()=>{O(),x(),U(),H(),Ln(),Rr=k()}));function Br(e){let{goNext:t,goBack:n,updateWizardData:r,wizardData:i}=B(),[a,o]=(0,Vr.useState)(i.agentType||``),[s,c]=(0,Vr.useState)(null),[l,u]=(0,Vr.useState)(a.length);return E(`confirm:no`,n,{context:`Settings`}),(0,Q.jsx)(V,{subtitle:`Agent type (identifier)`,footerText:(0,Q.jsxs)(T,{children:[(0,Q.jsx)(S,{shortcut:`Type`,action:`enter text`}),(0,Q.jsx)(S,{shortcut:`Enter`,action:`continue`}),(0,Q.jsx)(b,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`go back`})]}),children:(0,Q.jsxs)(C,{flexDirection:`column`,children:[(0,Q.jsx)(w,{children:`Enter a unique identifier for your agent:`}),(0,Q.jsx)(C,{marginTop:1,children:(0,Q.jsx)(nt,{value:a,onChange:o,onSubmit:e=>{let n=e.trim(),i=or(n);if(i){c(i);return}c(null),r({agentType:n}),t()},placeholder:`e.g., test-runner, tech-lead, etc`,columns:60,cursorOffset:l,onChangeCursorOffset:u,focus:!0,showCursor:!0})}),s&&(0,Q.jsx)(C,{marginTop:1,children:(0,Q.jsx)(w,{color:`error`,children:s})})]})})}var Vr,Q,Hr=e((()=>{Vr=t(D(),1),O(),f(),x(),oe(),U(),H(),cr(),Q=k()}));function Ur({tools:e,existingAgents:t,onComplete:n,onCancel:r}){return(0,Wr.jsx)(Jn,{steps:[wr,Or,Sr,()=>(0,Wr.jsx)(Br,{existingAgents:t}),Pr,hr,()=>(0,Wr.jsx)(Lr,{tools:e}),jr,ir,...Mt()?[Er]:[],()=>(0,Wr.jsx)(dr,{tools:e,existingAgents:t,onComplete:n})],initialData:{},onComplete:()=>{},onCancel:r,title:`Create new agent`,showStepCounter:!1})}var Wr,Gr=e((()=>{jt(),U(),ar(),mr(),_r(),Cr(),Tr(),Dr(),Ar(),Nr(),Ir(),zr(),Hr(),Wr=k()}));function Kr({tools:e,onExit:t}){let[n,r]=(0,qr.useState)({mode:`list-agents`,source:`all`}),i=Xe(e=>e.agentDefinitions),a=Xe(e=>e.mcp.tools),o=Xe(e=>e.toolPermissionContext),s=Le(),{allAgents:c,activeAgents:l}=i,[u,d]=(0,qr.useState)([]),f=$t(e,a,o);Zt();let p=(0,qr.useMemo)(()=>({"built-in":c.filter(e=>e.source===`built-in`),userSettings:c.filter(e=>e.source===`userSettings`),projectSettings:c.filter(e=>e.source===`projectSettings`),policySettings:c.filter(e=>e.source===`policySettings`),localSettings:c.filter(e=>e.source===`localSettings`),flagSettings:c.filter(e=>e.source===`flagSettings`),plugin:c.filter(e=>e.source===`plugin`),all:c}),[c]),m=(0,qr.useCallback)(e=>{d(t=>[...t,e]),r({mode:`list-agents`,source:`all`})},[]),h=(0,qr.useCallback)(async e=>{try{await xn(e),s(t=>{let n=t.agentDefinitions.allAgents.filter(t=>!(t.agentType===e.agentType&&t.source===e.source));return{...t,agentDefinitions:{...t.agentDefinitions,allAgents:n,activeAgents:Ge(n)}}}),d(t=>[...t,`Deleted agent: ${ut.bold(e.agentType)}`]),r({mode:`list-agents`,source:`all`})}catch(e){Pt(yt(e))}},[s]);switch(n.mode){case`list-agents`:{let e=Jt(n.source===`all`?[...p[`built-in`],...p.userSettings,...p.projectSettings,...p.localSettings,...p.policySettings,...p.flagSettings,...p.plugin]:p[n.source],l);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Gn,{source:n.source,agents:e,onBack:()=>{t((u.length>0?`Agent changes:\n${u.join(`
|
|
103
|
-
`)}`:void 0)??`Agents dialog dismissed`,{display:u.length===0?`system`:void 0})},onSelect:e=>r({mode:`agent-menu`,agent:e,previousMode:n}),onCreateNew:()=>r({mode:`create-agent`}),changes:u}),(0,$.jsx)(Hn,{})]})}case`create-agent`:return(0,$.jsx)(Ur,{tools:f,existingAgents:l,onComplete: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)(dt,{title:n.agent.agentType,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsxs)(C,{flexDirection:`column`,children:[(0,$.jsx)(xe,{options:t,onChange:t=>{switch(t){case`view`:r({mode:`view-agent`,agent:e,previousMode:n.previousMode});break;case`edit`:r({mode:`edit-agent`,agent:e,previousMode:n});break;case`delete`:r({mode:`delete-confirm`,agent:e,previousMode:n});break;case`back`:r(n.previousMode);break}},onCancel:()=>r(n.previousMode)}),u.length>0&&(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(w,{dimColor:!0,children:u[u.length-1]})})]})}),(0,$.jsx)(Hn,{})]})}case`view-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dt,{title:e.agentType,onCancel:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode}),hideInputGuide:!0,children:(0,$.jsx)(wn,{agent:e,tools:f,allAgents:c,onBack:()=>r({mode:`agent-menu`,agent:e,previousMode:n.previousMode})})}),(0,$.jsx)(Hn,{instructions:`Press Enter or Esc to go back`})]})}case`delete-confirm`:return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(dt,{title:`Delete agent`,onCancel:()=>{`previousMode`in n&&r(n.previousMode)},color:`error`,children:[(0,$.jsxs)(w,{children:[`Are you sure you want to delete the agent `,(0,$.jsx)(w,{bold:!0,children:n.agent.agentType}),`?`]}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsxs)(w,{dimColor:!0,children:[`Source: `,n.agent.source]})}),(0,$.jsx)(C,{marginTop:1,children:(0,$.jsx)(xe,{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)(Hn,{instructions:`Press ↑↓ to navigate, Enter to select, Esc to cancel`})]});case`edit-agent`:{let e=c.find(e=>e.agentType===n.agent.agentType&&e.source===n.agent.source)||n.agent;return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(dt,{title:`Edit agent: ${e.agentType}`,onCancel:()=>r(n.previousMode),hideInputGuide:!0,children:(0,$.jsx)(Bn,{agent:e,tools:f,onSaved:e=>{m(e),r(n.previousMode)},onBack:()=>r(n.previousMode)})}),(0,$.jsx)(Hn,{})]})}default:return null}}var qr,$,Jr=e((()=>{lt(),D(),qr=t(D(),1),Qt(),en(),O(),Ue(),Kt(),Ve(),bt(),Nt(),Ee(),Tn(),Vn(),Wn(),qn(),Cn(),Gr(),$=k()}));async function Yr(e,t){let n=t.getAppState().toolPermissionContext;return(0,Xr.jsx)(Kr,{tools:Se(n),onExit:e})}var Xr;e((()=>{D(),Jr(),De(),Xr=k()}))();export{Yr as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{AC as t,MC as n}from"./loadAgentsDir-CKSb56Gp.js";import{g as r,u as i}from"./settings-Xbq6AaD-.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-DzccRM_z.js";t();export{e as getOAuthHeaders};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";var t;e((()=>{t=()=>[]}))();export{t as buildPRTrailers};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Bt as e,It as t,Ot as n,mt as r,yt as i}from"./model-C2e73CJD.js";e();export{r as checkAndRefreshOAuthTokenIfNeeded,i as clearOAuthTokenCache,n as getClaudeAIOAuthTokens,t as handleOAuth401Error};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./auth-Cjnyy10u.js";export{t as authLogin,e as authStatus};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ab as t,Ah as n,C as r,Ch as i,Dh as a,Dl as ee,E as o,Eh as s,El as te,Fh as c,Ib as l,Mh as u,Nh as d,Oh as f,Ol as p,Ph as m,Th as h,Vb as g,jh as _,kh as v,wh as y,x as ne}from"./loadAgentsDir-CKSb56Gp.js";import{Kt as re,at as ie}from"./state-Bs5xweDL.js";import{s as ae,u as oe}from"./types-DWRxAH0E.js";import{a as se,n as ce,o as le,t as ue}from"./bridgeConfig-vORehbGG.js";import{i as b,o as x}from"./bg-w3Vlsm3Y.js";import{n as S,t as C}from"./state-BAGmpVBn.js";import{n as w,r as T}from"./pipeTransport-B3TIkTAp.js";import{join as E}from"path";import"crypto";import{readFile as D,readdir as O}from"fs/promises";function k(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function A(e){return typeof e==`string`&&z.includes(e)}function j(e){return typeof e==`string`&&B.includes(e)}function M(e){return!k(e)||typeof e.name!=`string`||!j(e.status)?null:{name:e.name,...typeof e.prompt==`string`?{prompt:e.prompt}:{},status:e.status,...typeof e.startedAt==`number`?{startedAt:e.startedAt}:{},...typeof e.completedAt==`number`?{completedAt:e.completedAt}:{}}}function N(e){if(!k(e)||typeof e.runId!=`string`||typeof e.workflow!=`string`||!A(e.status)||typeof e.createdAt!=`number`||typeof e.updatedAt!=`number`||typeof e.currentStepIndex!=`number`||!Array.isArray(e.steps))return null;let t=e.steps.map(M).filter(e=>e!==null);return t.length===e.steps.length?{runId:e.runId,workflow:e.workflow,...typeof e.args==`string`?{args:e.args}:{},status:e.status,createdAt:e.createdAt,updatedAt:e.updatedAt,currentStepIndex:e.currentStepIndex,steps:t}:null}async function P(e,t){try{return N(oe(await D(E(e,L,`${t}.json`),`utf-8`),!1))}catch{return null}}async function F(e=ie()){let t;try{t=await O(E(e,L))}catch{return[]}let n=t.filter(e=>e.endsWith(`.json`));return(await Promise.all(n.slice(0,R).map(t=>P(e,t.slice(0,-5))))).filter(e=>e!==null).sort((e,t)=>t.updatedAt-e.updatedAt)}function I(e){if(e.length===0)return[`Workflow runs: 0`,` none`].join(`
|
|
2
|
-
`);let t=e.filter(e=>e.status===`running`).length,n=e.filter(e=>e.status===`completed`).length,r=e.filter(e=>e.status===`cancelled`).length,i=[`Workflow runs: ${e.length}`,` Running: ${t}`,` Completed: ${n}`,` Cancelled: ${r}`];for(let t of e.slice(0,10)){let e=t.steps[t.currentStepIndex];i.push(` ${t.runId}: ${t.workflow}: ${t.status} step=${e?.name??`none`} updated=${new Date(t.updatedAt).toLocaleString()}`)}return e.length>10&&i.push(` ... ${e.length-10} more workflow run(s)`),i.join(`
|
|
3
|
-
`)}var L,R,z,B,V=e((()=>{re(),ae(),L=E(`.claude`,`workflow-runs`),R=200,z=[`running`,`completed`,`cancelled`],B=[`pending`,`running`,`completed`,`cancelled`]}));function H(){return E(w(),`registry.json`)}async function U(){try{let e=await D(H(),`utf8`),t=JSON.parse(e);return t.version===1?t:{...W}}catch{return{...W}}}var W,de=e((()=>{T(),W={version:1,mainMachineId:null,main:null,subs:[]}}));async function fe(){return pe(await U())}function pe(e){let t=[`Pipe registry: ${+!!e.main} main, ${e.subs.length} sub(s)`];e.mainMachineId&&t.push(` main_machine=${e.mainMachineId.slice(0,8)}...`),e.main&&t.push(` [main] ${e.main.pipeName} pid=${e.main.pid} host=${e.main.hostname} tcp=${e.main.tcpPort??`none`}`);for(let n of e.subs.slice(0,10))t.push(` [sub-${n.subIndex}] ${n.pipeName} pid=${n.pid} host=${n.hostname} bound=${n.boundToMain??`none`} tcp=${n.tcpPort??`none`}`);return!e.main&&e.subs.length===0&&t.push(` none`),e.subs.length>10&&t.push(` ... ${e.subs.length-10} more sub pipe(s)`),t.join(`
|
|
4
|
-
`)}var me=e((()=>{de()}));function he(){try{let e=le(),t=ue();return[`Remote Control: ${e?`self-hosted`:`official`}`,` base_url=${ce()}`,` token=${t?`present`:`missing`}`,` entitlement=checked at remote-control startup`].join(`
|
|
5
|
-
`)}catch(e){return[`Remote Control: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
|
|
6
|
-
`)}}var ge=e((()=>{se()}));async function _e(){let e=S(),t=await x(),n=[`Daemon: ${e.status}${e.state?` pid=${e.state.pid} workers=${e.state.workerKinds.join(`,`)}`:``}`,`Background sessions: ${t.length}`];for(let e of t.slice(0,8))n.push(` pid=${e.pid} kind=${e.kind} status=${e.status??`unknown`} cwd=${e.cwd}`);return t.length>8&&n.push(` ... ${t.length-8} more session(s)`),n.join(`
|
|
7
|
-
`)}function ve(){let e=!1,t=null;try{e=o(),t=ne()}catch(e){return[`Auto mode: unknown`,` reason=${e instanceof Error?e.message:String(e)}`].join(`
|
|
8
|
-
`)}return[`Auto mode: ${e?`available`:`unavailable`}`,` reason=${t??`none`}`].join(`
|
|
9
|
-
`)}async function G({runs:e,flows:t,nowMs:n=Date.now()}){return Promise.all([Promise.resolve({id:`auto-mode`,title:`Auto Mode`,content:ve()}),Promise.resolve({id:`runs`,title:`Runs`,content:y(e)}),Promise.resolve({id:`flows`,title:`Flows`,content:_(t)}),F().then(e=>({id:`workflow-runs`,title:`Workflow Runs`,content:I(e)})),fe().then(e=>({id:`pipes`,title:`Pipes`,content:e})),_e().then(e=>({id:`runtime`,title:`Runtime`,content:e})),Promise.resolve({id:`remote-control`,title:`Remote Control`,content:he()}),p().then(e=>({id:`remote-trigger`,title:`RemoteTrigger`,content:te(e)}))])}async function ye(e){return(await G(e)).map((e,t)=>[t===0?`# Autonomy Deep Status`:`## ${e.title}`,e.content].join(`
|
|
10
|
-
`)).join(`
|
|
11
|
-
|
|
12
|
-
`)}var be=e((()=>{C(),b(),d(),h(),r(),ee(),V(),me(),ge()}));function xe(e){let[t=`status`,n,r]=e.trim().split(/\s+/,3);return t===``||t===`status`?{type:`status`,deep:n===`--deep`}:t===`runs`?{type:`runs`,limit:n}:t===`flows`?{type:`flows`,limit:n}:t===`flow`?n===`cancel`?r?{type:`flow-cancel`,flowId:r}:{type:`usage`}:n===`resume`?r?{type:`flow-resume`,flowId:r}:{type:`usage`}:n?{type:`flow-detail`,flowId:n}:{type:`usage`}:{type:`usage`}}var K,Se=e((()=>{K=`Usage: /autonomy [status [--deep]|runs [limit]|flows [limit]|flow <id>|flow cancel <id>|flow resume <id>]`}));function q(e){let t=typeof e==`number`?e:Number.parseInt(e??``,10);return!Number.isFinite(t)||t<=0?10:Math.min(t,50)}async function J(e){let t=e?.rootDir,[n,r]=await Promise.all([s(t),m(t)]);return e?.deep?ye({runs:n,flows:r}):[y(n),_(r)].join(`
|
|
13
|
-
`)}async function Ce(e,t){let[n,r]=await Promise.all([s(t?.rootDir),m(t?.rootDir)]),i=(await G({runs:n,flows:r})).find(t=>t.id===e);return i?[`# ${i.title}`,i.content].join(`
|
|
14
|
-
`):`Autonomy deep status section not found: ${e}`}async function we(e){process.stdout.write(`${await J(e)}\n`)}async function Y(e,t){return i(await s(t?.rootDir),q(e))}async function Te(e){process.stdout.write(`${await Y(e)}\n`)}async function X(e,t){return n(await m(t?.rootDir),q(e))}async function Ee(e){process.stdout.write(`${await X(e)}\n`)}async function Z(e,t){return v(await u(e,t?.rootDir))}async function De(e){process.stdout.write(`${await Z(e)}\n`)}async function Q(e,t){let n=await c({flowId:e,rootDir:t?.rootDir});if(!n)return`Autonomy flow not found.`;if(!n.accepted)return`Autonomy flow ${e} is already terminal (${n.flow.status}).`;let r=0;if(t?.removeQueuedInMemory){let n=g(t=>t.autonomy?.flowId===e);r=n.length;for(let e of n)e.autonomy?.runId&&await a(e.autonomy.runId,t?.rootDir)}else{for(let e of n.queuedRunIds)await a(e,t?.rootDir);r=n.queuedRunIds.length}return n.flow.status===`running`?`Cancellation requested for flow ${e}. The current step is still running, and no new steps will be started.`:`Cancelled flow ${e}. Removed ${r} queued step(s).`}async function Oe(e){process.stdout.write(`${await Q(e)}\n`)}async function $(e,n){let r=await f({flowId:e,rootDir:n?.rootDir,currentDir:n?.currentDir});if(!r)return`Autonomy flow is not waiting or was not found.`;if(n?.enqueueInMemory)return t(r),`Queued the next managed step for flow ${e}.`;let i=r.autonomy?.runId??`unknown`;return[`Prepared the next managed step for flow ${e}.`,`Run ID: ${i}`,``,`Prompt:`,typeof r.value==`string`?r.value:String(r.value)].join(`
|
|
15
|
-
`)}async function ke(e){process.stdout.write(`${await $(e)}\n`)}async function Ae(e,t){let n=xe(e);switch(n.type){case`status`:return J({deep:n.deep});case`runs`:return Y(n.limit);case`flows`:return X(n.limit);case`flow-detail`:return Z(n.flowId);case`flow-cancel`:return Q(n.flowId,{removeQueuedInMemory:t?.removeQueuedInMemory});case`flow-resume`:return $(n.flowId,{enqueueInMemory:t?.enqueueInMemory});case`usage`:return K}}var je=e((()=>{d(),h(),be(),Se(),l()}));export{Te as a,Ae as c,X as d,Y as f,$ as g,q as h,Ee as i,Ce as l,je as m,De as n,we as o,J as p,ke as r,Q as s,Oe as t,Z as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Nh as n,Ph as r,hd as i,vd as a}from"./loadAgentsDir-CKSb56Gp.js";import{I as o,P as s,fi as c,hn as l,t as u,y as d}from"./src-P_wYS_NJ2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{c as p,l as m,m as h,p as g}from"./autonomy-dSJl0hN1.js";function _(){return S}function v({onDone:e}){a(`autonomy-panel`);let[t,n]=(0,b.useState)(0),[i,c]=(0,b.useState)([]);(0,b.useEffect)(()=>{let e=!1;return r().then(t=>{e||c(t.slice(0,5))}),()=>{e=!0}},[]);let u=(0,b.useMemo)(()=>{let e=[{label:`Overview`,description:`Show run and flow counts plus the latest automatic activity`,run:()=>g()},{label:`Full deep status`,description:`Print every local autonomy surface in one diagnostic report`,run:()=>g({deep:!0})},{label:`Auto mode`,description:`Check whether auto permission mode is available and why`,run:()=>m(`auto-mode`)},{label:`Runs summary`,description:`Show queued/running/completed/failed run totals and latest run`,run:()=>m(`runs`)},{label:`Recent runs`,description:`List recent autonomy run IDs, triggers, statuses, and prompts`,run:()=>p(`runs 10`)},{label:`Flows summary`,description:`Show managed flow totals across queued/running/waiting states`,run:()=>m(`flows`)},{label:`Recent flows`,description:`List recent managed flow IDs, status, current step, and goal`,run:()=>p(`flows 10`)},{label:`Workflow runs`,description:`Show persisted WorkflowTool runs and their current workflow step`,run:()=>m(`workflow-runs`)},{label:`Pipes`,description:`Show UDS/named-pipe and LAN registry for terminal messaging`,run:()=>m(`pipes`)},{label:`Runtime`,description:`Show daemon state and live background or interactive sessions`,run:()=>m(`runtime`)},{label:`Remote Control`,description:`Show bridge mode, base URL, token presence, and entitlement note`,run:()=>m(`remote-control`)},{label:`RemoteTrigger`,description:`Show recent remote trigger audit records, failures, and latest call`,run:()=>m(`remote-trigger`)}],t=i.flatMap(e=>{let t=e.flowId.slice(0,8),n=[{label:`Flow ${t}`,description:`${e.status}: ${e.goal}`,run:()=>p(`flow ${e.flowId}`)}];return e.status===`waiting`&&n.push({label:`Resume ${t}`,description:e.currentStep?`Resume waiting step: ${e.currentStep}`:`Resume waiting flow`,run:()=>p(`flow resume ${e.flowId}`,{enqueueInMemory:!0})}),(e.status===`queued`||e.status===`running`||e.status===`waiting`||e.status===`blocked`)&&n.push({label:`Cancel ${t}`,description:`Cancel ${e.status} flow`,run:()=>p(`flow cancel ${e.flowId}`,{removeQueuedInMemory:!0})}),n});return[...e,...t]},[i]),f=()=>{let n=u[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(u.length-1,e+1));return}t.return&&f()}),(0,x.jsx)(d,{title:`Autonomy`,subtitle:`${u.length} actions`,onCancel:()=>e(`Autonomy panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,x.jsxs)(o,{flexDirection:`column`,children:[u.map((e,n)=>(0,x.jsxs)(o,{flexDirection:`row`,children:[(0,x.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(C)}),(0,x.jsx)(s,{dimColor:!0,children:e.description})]},`${e.label}-${n}`)),(0,x.jsx)(o,{marginTop:1,children:(0,x.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function y(e,t,n){let r=n?.trim()??``;return r?(e(await p(r,{enqueueInMemory:!0,removeQueuedInMemory:!0}),{display:`system`}),null):(0,x.jsx)(v,{onDone:e})}var b,x,S,C;e((()=>{b=t(c(),1),u(),i(),h(),n(),x=f(),S=14,C=24}))();export{y as call,_ as getAutonomyPanelBaseActionCountForTests};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,o as n}from"./envUtils-BDhHQY0-.js";import{$ as r,$d as i,AS as a,Ar as o,Bp as s,FS as c,Hc as l,Hp as ee,Ia as te,NS as ne,Qa as u,Qd as re,Ra as d,Tt as f,Uc as p,kS as m,mt as h,sh as g,tt as ie,yr as ae,za as oe,zg as _}from"./loadAgentsDir-CKSb56Gp.js";import{G as v,Kt as y,R as b}from"./state-Bs5xweDL.js";import{n as x,t as S}from"./cwd-L4wygFqJ.js";import{S as C,W as w,a as T,d as E,l as D,p as O,z as k}from"./debug-BdqxZ7rV.js";import{f as A,g as j,y as M}from"./settings-Xbq6AaD-.js";import{S as N}from"./config-D4G8_MqJ.js";import{o as P,s as F,v as I,y as L}from"./log-CTFl4qpD.js";import{n as R,r as z}from"./analytics-DJobLaWP.js";import{_ as B,h as V}from"./model-C2e73CJD.js";import{bn as H,yn as U}from"./prompt-CybUvG8G.js";import{gt as W}from"./sessionState-BvECKycx.js";import{i as se,t as G}from"./nativeInstaller-DQIFwdat.js";import{n as K,t as ce}from"./allErrors-DYw_q14e.js";import{r as le}from"./magicDocs-DmKlTQvK.js";import{n as ue,t as de}from"./pluginAutoupdate-BHKlOOXI.js";import{n as fe,r as pe}from"./registerProtocol-3_ozAuDK.js";import"os";import{join as q}from"path";import"crypto";n(),y(),x(),C(),O(),T(),L(),j(),H(),B(),p(),o(),le(),r(),P(),k(),u(),_(),r(),a(),k(),P(),u(),_(),g();async function me(e,t){if(!e)return;let{join:n}=await import(`path`),r=await import(`fs/promises`),i=n(S(),`.claude`,`skills`,e,`SKILL.md`),a;try{a=await r.readFile(i,`utf-8`)}catch{F(Error(`Failed to read skill file for improvement: ${i}`));return}let o=t.map(e=>`- ${e.section}: ${e.change}`).join(`
|
|
2
|
-
`),s=V(),c=await ie({messages:[te({content:`You are editing a skill definition file. Apply the following improvements to the skill.
|
|
3
|
-
|
|
4
|
-
<current_skill_file>
|
|
5
|
-
${a}
|
|
6
|
-
</current_skill_file>
|
|
7
|
-
|
|
8
|
-
<improvements>
|
|
9
|
-
${o}
|
|
10
|
-
</improvements>
|
|
11
|
-
|
|
12
|
-
Rules:
|
|
13
|
-
- Integrate the improvements naturally into the existing structure
|
|
14
|
-
- Preserve frontmatter (--- block) exactly as-is
|
|
15
|
-
- Preserve the overall format and style
|
|
16
|
-
- Do not remove existing content unless an improvement explicitly replaces it
|
|
17
|
-
- Output the complete updated file inside <updated_file> tags`})],systemPrompt:W([`You edit skill definition files to incorporate user preferences. Output only the updated file content.`]),thinkingConfig:{type:`disabled`},tools:[],signal:m().signal,options:{getToolPermissionContext:async()=>U(),model:s,toolChoice:void 0,isNonInteractiveSession:!1,hasAppendSystemPrompt:!1,temperatureOverride:0,agents:[],querySource:`skill_improvement_apply`,mcpTools:[]}}),l=d(oe(Array.isArray(c.message.content)?c.message.content:[]).trim(),`updated_file`);if(!l){F(Error(`Skill improvement apply: no updated_file tag in response`));return}try{await r.writeFile(i,l,`utf-8`)}catch(e){F(w(e))}}R(),ee(),N(),P(),G(),i(),K(),c(),f();var he=30;function J(){let e=((A()||{}).cleanupPeriodDays??he)*24*60*60*1e3;return new Date(Date.now()-e)}function ge(e,t){return{messages:e.messages+t.messages,errors:e.errors+t.errors}}function _e(e){let t=e.split(`.`)[0].replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/,`T$1:$2:$3.$4Z`);return new Date(t)}async function Y(e,t,n){let r={messages:0,errors:0};try{let i=await E().readdir(e);for(let a of i)try{_e(a.name)<t&&(await E().unlink(q(e,a.name)),n?r.messages++:r.errors++)}catch(e){F(e)}}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return r}async function ve(){let e=E(),t=J(),n=I.errors(),r=I.baseLogs(),i=await Y(n,t,!1);try{let n;try{n=await e.readdir(r)}catch{return i}let a=n.filter(e=>e.isDirectory()&&e.name.startsWith(`mcp-logs-`)).map(e=>q(r,e.name));for(let n of a)i=ge(i,await Y(n,t,!0)),await Z(n,e)}catch(e){e instanceof Error&&`code`in e&&e.code!==`ENOENT`&&F(e)}return i}async function X(e,t,n){return(await n.stat(e)).mtime<t?(await n.unlink(e),!0):!1}async function Z(e,t){try{await t.rmdir(e)}catch{}}async function ye(){let e=J(),t={messages:0,errors:0},n=ae(),r=E(),i;try{i=await r.readdir(n)}catch{return t}for(let a of i){if(!a.isDirectory())continue;let i=q(n,a.name),o;try{o=await r.readdir(i)}catch{t.errors++;continue}for(let n of o)if(n.isFile()){if(!n.name.endsWith(`.jsonl`)&&!n.name.endsWith(`.cast`))continue;try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}}else if(n.isDirectory()){let a=q(i,n.name),o=q(a,ne),s;try{s=await r.readdir(o)}catch{await Z(a,r);continue}for(let n of s)if(n.isFile())try{await X(q(o,n.name),e,r)&&t.messages++}catch{t.errors++}else if(n.isDirectory()){let i=q(o,n.name),a;try{a=await r.readdir(i)}catch{continue}for(let n of a)if(n.isFile())try{await X(q(i,n.name),e,r)&&t.messages++}catch{t.errors++}await Z(i,r)}await Z(o,r),await Z(a,r)}await Z(i,r)}return t}async function be(e,t,n=!0){let r=J(),i={messages:0,errors:0},a=E(),o;try{o=await a.readdir(e)}catch{return i}for(let n of o)if(!(!n.isFile()||!n.name.endsWith(t)))try{await X(q(e,n.name),r,a)&&i.messages++}catch{i.errors++}return n&&await Z(e,a),i}function xe(){return be(q(t(),`plans`),`.md`)}async function Se(){let e=J(),n={messages:0,errors:0},r=E();try{let i=q(t(),`file-history`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));await Promise.all(o.map(async t=>{try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}})),await Z(i,r)}catch(e){F(e)}return n}async function Ce(){let e=J(),n={messages:0,errors:0},r=E();try{let i=q(t(),`session-env`),a;try{a=await r.readdir(i)}catch{return n}let o=a.filter(e=>e.isDirectory()).map(e=>q(i,e.name));for(let t of o)try{(await r.stat(t)).mtime<e&&(await r.rm(t,{recursive:!0,force:!0}),n.messages++)}catch{n.errors++}await Z(i,r)}catch(e){F(e)}return n}async function we(){let e=J(),n={messages:0,errors:0},r=E(),i=q(t(),`debug`),a;try{a=await r.readdir(i)}catch{return n}for(let t of a)if(!(!t.isFile()||!t.name.endsWith(`.txt`)||t.name===`latest`))try{await X(q(i,t.name),e,r)&&n.messages++}catch{n.errors++}return n}async function Q(){let{errors:e}=ce();if(e.length>0&&M(`cleanupPeriodDays`)){D(`Skipping cleanup: settings have validation errors but cleanupPeriodDays was explicitly set. Fix settings errors to enable cleanup.`);return}await ve(),await ye(),await xe(),await Se(),await Ce(),await we(),await s(),await re(J());let t=await h(J());t>0&&z(`tengu_worktree_cleanup`,{removed:t})}y(),G(),ue();var Te=(fe(),e(pe)),$=600*1e3;function Ee(){import(`./extractMemories-1VlmCGwa.js`).then(({initExtractMemories:e})=>{e()}).catch(()=>{}),l(),de(),b()&&Te.ensureDeepLinkProtocolRegistered();let e=!0;async function t(){if(b()&&v()>Date.now()-1e3*60){setTimeout(t,$).unref();return}if(e&&(e=!1,await Q()),b()&&v()>Date.now()-1e3*60){setTimeout(t,$).unref();return}await se()}setTimeout(t,$).unref()}export{me as n,Ee as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./backgroundHousekeeping--cs5crp7.js";export{e as startBackgroundHousekeeping};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,r,s as i,t as a}from"./bg-w3Vlsm3Y.js";n();export{a as attachHandler,r as handleBgStart,e as killHandler,i as logsHandler,t as psHandler};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ar as t,Ci as n,Er as r,Ir as i,Tr as a,_i as o,vr as s}from"./loadAgentsDir-CKSb56Gp.js";import{Kt as c,mt as l,tt as u}from"./state-Bs5xweDL.js";import{S as d,w as f}from"./debug-BdqxZ7rV.js";import{c as p,s as m}from"./types-DWRxAH0E.js";import{n as h,r as g}from"./analytics-DJobLaWP.js";import{i as _,o as v}from"./stringUtils-CbS6OkmE.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 t=y(),n=l(),o=s(u()),c=r(t),d=a();await b(o,{recursive:!0,mode:448});let m;try{m=await x(d)}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=>i(e)&&!e.isSidechain),_=h.filter(e=>e.type===`content-replacement`&&e.sessionId===n).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 r={...e,sessionId:t,parentUuid:v,isSidechain:!1,forkedFrom:{sessionId:n,messageUuid:e.uuid}},i={...e,sessionId:t};w.push(i),C.push(f(r)),e.type!==`progress`&&(v=e.uuid)}if(_.length>0){let e={type:`content-replacement`,sessionId:t,replacements:_};C.push(f(e))}return await S(c,C.join(`
|
|
2
|
-
`)+`
|
|
3
|
-
`,{encoding:`utf8`,mode:384}),{sessionId:t,title:e,forkPath:c,serializedMessages:w,contentReplacementRecords:_}}async function T(e){let t=`${e} (Branch)`;if((await n(t,{exact:!0})).length===0)return t;let r=await n(`${e} (Branch`),i=new Set([1]),a=RegExp(`^${_(e)} \\(Branch(?: (\\d+))?\\)$`);for(let e of r){let t=e.customTitle?.match(a);t&&(t[1]?i.add(parseInt(t[1],10)):i.add(1))}let o=2;for(;i.has(o);)o++;return`${e} (Branch ${o})`}async function E(e,t,n){let r=n?.trim()||void 0,i=l();try{let{sessionId:n,title:a,forkPath:s,serializedMessages:c,contentReplacementRecords:l}=await w(r),u=new Date,d=C(c.find(e=>e.type===`user`)),f=await T(a??d);await o(n,f,s),g(`tengu_conversation_forked`,{message_count:c.length,has_custom_title:!!a});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=a?` "${a}"`:``,h=`Branched conversation${m}. You are now in the branch.${`\nTo resume the original: claude -r ${i}`}`;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(),t(),d(),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-vORehbGG.js";e();export{r as getBridgeAccessToken,t as getBridgeBaseUrl,n as isSelfHostedBridge};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{C as n,F as r,S as i,a,l as o,z as s}from"./debug-BdqxZ7rV.js";import{B as c,F as l,I as u,J as d,O as f,U as p,b as m,g as h,m as g}from"./log-CTFl4qpD.js";import{n as _,r as v}from"./analytics-DJobLaWP.js";import{U as y,vt as b}from"./sessionState-BvECKycx.js";import{n as x,t as S}from"./rcDebugLog-CARUIORE.js";import{t as C}from"./controlMessageCompat-IFu4Gc1y.js";import{randomUUID as w}from"crypto";_(),y(),a(),S(),g(),s(),i(),d(),e();function T(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function E(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_response`&&`response`in e}function D(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`control_request`&&`request_id`in e&&`request`in e}function O(e){return(e.type===`user`||e.type===`assistant`)&&e.isVirtual?!1:e.type===`user`||e.type===`assistant`||e.type===`system`&&e.subtype===`local_command`}function k(e){if(e.type!==`user`||e.isMeta||e.toolUseResult||e.isCompactSummary||e.origin&&e.origin.kind!==`human`)return;let t=e.message.content,n;if(typeof t==`string`)n=t;else for(let e of t??[])if(e.type===`text`){n=e.text;break}if(n)return h(n)||void 0}var A=`system-reminder`,j=/\s*<([a-z][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>\s*/gy,M=new Set([m,f,l,u,c,p]);function N(e){let t=e.message?.content;return typeof t==`string`?t:Array.isArray(t)?t.filter(e=>!!e&&typeof e==`object`&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``):``}function P(e){let t=e.trim();if(!t)return null;j.lastIndex=0;let n=[];for(;j.lastIndex<t.length;){let e=j.exec(t);if(!e)return null;n.push(e[1])}return n.length>0?n:null}function F(e){if(e.type!==`user`||e.isVisibleInTranscriptOnly)return!1;if(e.toolUseResult!==void 0||!e.isMeta)return!0;let t=P(N(e));return!t||t.some(e=>e!==`local-command-caveat`&&e!==A&&M.has(e))}function I(e){return e.some(F)}function L(e,t,i,a,s,c){try{let r=C(n(e));if(E(r)){o(`[bridge:repl] Ingress message type=control_response`),s?.(r);return}if(D(r)){o(`[bridge:repl] Inbound control_request subtype=${r.request.subtype}`),c?.(r);return}if(!T(r))return;let l=`uuid`in r&&typeof r.uuid==`string`?r.uuid:void 0;if(l&&t.has(l)){o(`[bridge:repl] Ignoring echo: type=${r.type} uuid=${l}`);return}if(l&&i.has(l)){o(`[bridge:repl] Ignoring re-delivered inbound: type=${r.type} uuid=${l}`);return}o(`[bridge:repl] Ingress message type=${r.type}${l?` uuid=${l}`:``}`),r.type===`user`?(l&&i.add(l),v(`tengu_bridge_message_received`,{is_repl:!0}),a?.(r)):o(`[bridge:repl] Ignoring non-user inbound message: type=${r.type}`)}catch(e){o(`[bridge:repl] Failed to parse ingress message: ${r(e)}`)}}var R=`This session is outbound-only. Enable Remote Control locally to allow inbound control.`;function z(e,t){let{transport:n,sessionId:r,outboundOnly:i,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:c,onSetPermissionMode:l}=t;if(!n){o(`[bridge:repl] Cannot respond to control_request: transport not configured`);return}let u,d=e.request;if(i&&d.subtype!==`initialize`){u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:R}};let t={...u,session_id:r};n.write(t),o(`[bridge:repl] Rejected ${d.subtype} (outbound-only) request_id=${e.request_id}`);return}switch(d.subtype){case`initialize`:u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id,response:{commands:[],output_style:`normal`,available_output_styles:[`normal`],models:[],account:{},pid:process.pid}}};break;case`set_model`:s?.(d.model),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_max_thinking_tokens`:c?.(d.max_thinking_tokens??null),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;case`set_permission_mode`:{let t=l?.(d.mode)??{ok:!1,error:`set_permission_mode is not supported in this context (onSetPermissionMode callback not registered)`};u=t.ok?{type:`control_response`,response:{subtype:`success`,request_id:e.request_id}}:{type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:t.error}};break}case`interrupt`:a?.(),u={type:`control_response`,response:{subtype:`success`,request_id:e.request_id}};break;default:u={type:`control_response`,response:{subtype:`error`,request_id:e.request_id,error:`REPL bridge does not handle control_request subtype: ${d.subtype}`}}}let f={...u,session_id:r};n.write(f),x(`control_response: subtype=${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`),o(`[bridge:repl] Sent control_response for ${d.subtype} request_id=${e.request_id} result=${u.response.subtype}`)}function B(e){return{type:`result_success`,subtype:`success`,duration_ms:0,duration_api_ms:0,is_error:!1,num_turns:0,result:``,stop_reason:null,total_cost_usd:0,usage:{...b},modelUsage:{},permission_denials:[],session_id:e,uuid:w()}}var V=class{constructor(e){t(this,`capacity`,void 0),t(this,`ring`,void 0),t(this,`set`,new Set),t(this,`writeIdx`,0),this.capacity=e,this.ring=Array(e)}add(e){if(this.set.has(e))return;let t=this.ring[this.writeIdx];t!==void 0&&this.set.delete(t),this.ring[this.writeIdx]=e,this.set.add(e),this.writeIdx=(this.writeIdx+1)%this.capacity}has(e){return this.set.has(e)}clear(){this.set.clear(),this.ring.fill(void 0),this.writeIdx=0}};export{O as a,I as c,z as i,k as n,B as o,L as r,F as s,V as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$y as t,Bg as n,Cv as r,Cy as i,Dy as a,Ey as o,Gh as s,Hp as c,Hs as l,Ix as u,J as d,Ji as f,Lp as p,Lx as m,Mu as h,Nu as g,Oy as _,Ri as v,Rp as y,Sv as b,Sy as x,Ty as S,Vp as C,Vs as w,Wg as T,X as E,nh as D,qh as O,tb as k,wy as A}from"./loadAgentsDir-CKSb56Gp.js";import{An as j,Kt as M,l as N}from"./state-Bs5xweDL.js";import{S as P,v as F}from"./git-B9uvt96d.js";import{i as I,t as L}from"./detectRepository-DvxoaPlk.js";import{a as R,n as z}from"./fileSuggestions-fNxREjpe.js";import{r as B,t as V}from"./magicDocs-DmKlTQvK.js";function H(e=new Set){let t=e.size>0;A.cache.clear?.(),i.cache.clear?.(),x.cache.clear?.(),a.cache.clear?.(),z(),v(),t||k(),o(null),j(null),O(),l(),m(`session_start`),C(),h(),import(`./attributionHooks-CUAoGkU6.js`).then(({clearAttributionCaches:e})=>e()),L(),d(),N(e),F(),n(),y(),V(),b(),import(`./SearchExtraToolsTool-BugrzImr.js`).then(({clearSearchExtraToolsDescriptionCache:e})=>e()),import(`./loadAgentsDir-8UprzS4w.js`).then(({clearAgentDefinitionsCache:e})=>e()),import(`./prompt-RBn4JdEg.js`).then(({clearPromptCache:e})=>e())}var U=e((()=>{M(),f(),_(),S(),R(),D(),t(),g(),s(),p(),B(),T(),w(),E(),u(),I(),P(),c(),r()}));export{U as n,H as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./caches-1IFb6_M_.js";e();export{t as clearSessionCaches};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{F as n,I as r,S as i,a,l as o,w as s,z as c}from"./debug-BdqxZ7rV.js";import{O as l,k as u}from"./git-B9uvt96d.js";import{_n as d,vn as f}from"./model-C2e73CJD.js";import{l as p,r as m}from"./proxy-Blq4W6Ox.js";import{n as h,t as g}from"./userAgent-Ng_TTjWr.js";import{F as _,I as v,P as y,S as b,g as x,v as S}from"./sessionState-BvECKycx.js";import{n as C}from"./jwtUtils-C9sdGhvT.js";import{randomUUID as w}from"crypto";c(),a(),l(),p(),h(),d(),v(),x(),i(),e();var T=class extends Error{constructor(e,n){super(e),t(this,`retryAfterMs`,void 0),this.retryAfterMs=n}},E=class{constructor(e){t(this,`pending`,[]),t(this,`pendingAtClose`,0),t(this,`draining`,!1),t(this,`closed`,!1),t(this,`backpressureResolvers`,[]),t(this,`sleepResolve`,null),t(this,`flushResolvers`,[]),t(this,`droppedBatches`,0),t(this,`config`,void 0),this.config=e}get droppedBatchCount(){return this.droppedBatches}get pendingCount(){return this.closed?this.pendingAtClose:this.pending.length}async enqueue(e){if(this.closed)return;let t=Array.isArray(e)?e:[e];if(t.length!==0){for(;this.pending.length+t.length>this.config.maxQueueSize&&!this.closed;)await new Promise(e=>{this.backpressureResolvers.push(e)});this.closed||(this.pending.push(...t),this.drain())}}flush(){return this.pending.length===0&&!this.draining?Promise.resolve():(this.drain(),new Promise(e=>{this.flushResolvers.push(e)}))}close(){if(!this.closed){this.closed=!0,this.pendingAtClose=this.pending.length,this.pending=[],this.sleepResolve?.(),this.sleepResolve=null;for(let e of this.backpressureResolvers)e();this.backpressureResolvers=[];for(let e of this.flushResolvers)e();this.flushResolvers=[]}}async drain(){if(this.draining||this.closed)return;this.draining=!0;let e=0;try{for(;this.pending.length>0&&!this.closed;){let t=this.takeBatch();if(t.length!==0){try{await this.config.send(t),e=0}catch(n){if(e++,this.config.maxConsecutiveFailures!==void 0&&e>=this.config.maxConsecutiveFailures){this.droppedBatches++,this.config.onBatchDropped?.(t.length,e),e=0,this.releaseBackpressure();continue}this.pending=t.concat(this.pending);let r=n instanceof T?n.retryAfterMs:void 0;await this.sleep(this.retryDelay(e,r));continue}this.releaseBackpressure()}}}finally{if(this.draining=!1,this.pending.length===0){for(let e of this.flushResolvers)e();this.flushResolvers=[]}}}takeBatch(){let{maxBatchSize:e,maxBatchBytes:t}=this.config;if(t===void 0)return this.pending.splice(0,e);let n=0,r=0;for(;r<this.pending.length&&r<e;){let e;try{e=Buffer.byteLength(s(this.pending[r]))}catch{this.pending.splice(r,1);continue}if(r>0&&n+e>t)break;n+=e,r++}return this.pending.splice(0,r)}retryDelay(e,t){let n=Math.random()*this.config.jitterMs;return t===void 0?Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+n:Math.max(this.config.baseDelayMs,Math.min(t,this.config.maxDelayMs))+n}releaseBackpressure(){let e=this.backpressureResolvers;this.backpressureResolvers=[];for(let t of e)t()}sleep(e){return new Promise(t=>{this.sleepResolve=t,setTimeout((e,t)=>{e.sleepResolve=null,t()},e,this,t)})}};e();var D=class{constructor(e){t(this,`inflight`,null),t(this,`pending`,null),t(this,`closed`,!1),t(this,`config`,void 0),this.config=e}enqueue(e){this.closed||(this.pending=this.pending?O(this.pending,e):e,this.drain())}close(){this.closed=!0,this.pending=null}async drain(){if(this.inflight||this.closed||!this.pending)return;let e=this.pending;this.pending=null,this.inflight=this.sendWithRetry(e).then(()=>{this.inflight=null,this.pending&&!this.closed&&this.drain()})}async sendWithRetry(e){let t=e,n=0;for(;!this.closed;){if(await this.config.send(t))return;n++,await f(this.retryDelay(n)),this.pending&&!this.closed&&(t=O(t,this.pending),this.pending=null)}}retryDelay(e){return Math.min(this.config.baseDelayMs*2**(e-1),this.config.maxDelayMs)+Math.random()*this.config.jitterMs}};function O(e,t){let n={...e};for(let[e,r]of Object.entries(t))(e===`external_metadata`||e===`internal_metadata`)&&n[e]&&typeof n[e]==`object`&&typeof r==`object`&&r?n[e]={...n[e],...r}:n[e]=r;return n}d(),e();var k=2e4,A=100;function j(){return!0}var M=class extends Error{constructor(e){super(`CCRClient init failed: ${e}`),t(this,`reason`,void 0),this.reason=e}},N=10;function P(){return{byMessage:new Map,scopeToMessage:new Map}}function F(e){return`${e.session_id}:${e.parent_tool_use_id??``}`}function I(e,t){let n=[],r=new Map;for(let i of e){let e=i.event;switch(e.type){case`message_start`:{let r=e.message.id,a=t.scopeToMessage.get(F(i));a&&t.byMessage.delete(a),t.scopeToMessage.set(F(i),r),t.byMessage.set(r,[]),n.push(i);break}case`content_block_delta`:{let a=e.delta;if(a.type!==`text_delta`){n.push(i);break}let o=t.scopeToMessage.get(F(i)),s=o?t.byMessage.get(o):void 0;if(!s){n.push(i);break}let c=e.index,l=s[c]??(s[c]=[]);l.push(a.text);let u=r.get(l);if(u){u.event.delta={type:`text_delta`,text:l.join(``)};break}let d={type:`stream_event`,uuid:i.uuid,session_id:i.session_id,parent_tool_use_id:i.parent_tool_use_id,event:{type:`content_block_delta`,index:c,delta:{type:`text_delta`,text:l.join(``)}}};r.set(l,d),n.push(d);break}default:n.push(i)}}return n}function L(e,t){e.byMessage.delete(t.message.id);let n=F(t);e.scopeToMessage.get(n)===t.message.id&&e.scopeToMessage.delete(n)}var R=class{constructor(e,n,r){if(t(this,`workerEpoch`,0),t(this,`heartbeatIntervalMs`,void 0),t(this,`heartbeatJitterFraction`,void 0),t(this,`heartbeatTimer`,null),t(this,`heartbeatInFlight`,!1),t(this,`closed`,!1),t(this,`consecutiveAuthFailures`,0),t(this,`currentState`,null),t(this,`sessionBaseUrl`,void 0),t(this,`sessionId`,void 0),t(this,`http`,m({keepAlive:!0})),t(this,`streamEventBuffer`,[]),t(this,`streamEventTimer`,null),t(this,`streamTextAccumulator`,P()),t(this,`workerState`,void 0),t(this,`eventUploader`,void 0),t(this,`internalEventUploader`,void 0),t(this,`deliveryUploader`,void 0),t(this,`onEpochMismatch`,void 0),t(this,`getAuthHeaders`,void 0),this.onEpochMismatch=r?.onEpochMismatch??(()=>{process.exit(1)}),this.heartbeatIntervalMs=r?.heartbeatIntervalMs??k,this.heartbeatJitterFraction=r?.heartbeatJitterFraction??0,this.getAuthHeaders=r?.getAuthHeaders??y,n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`CCRClient: Expected http(s) URL, got ${n.protocol}`);let i=n.pathname.replace(/\/$/,``);this.sessionBaseUrl=`${n.protocol}//${n.host}${i}`,this.sessionId=i.split(`/`).pop()||``,this.workerState=new D({send:e=>this.request(`put`,`/worker`,{worker_epoch:this.workerEpoch,...e},`PUT worker`).then(e=>e.ok),baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.eventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:1e5,send:async e=>{let t=await this.request(`post`,`/worker/events`,{worker_epoch:this.workerEpoch,events:e},`client events`);if(!t.ok)throw new T(`client event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.internalEventUploader=new E({maxBatchSize:100,maxBatchBytes:10*1024*1024,maxQueueSize:200,send:async e=>{let t=await this.request(`post`,`/worker/internal-events`,{worker_epoch:this.workerEpoch,events:e},`internal events`);if(!t.ok)throw new T(`internal event POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),this.deliveryUploader=new E({maxBatchSize:64,maxQueueSize:64,send:async e=>{let t=await this.request(`post`,`/worker/events/delivery`,{worker_epoch:this.workerEpoch,updates:e.map(e=>({event_id:e.eventId,status:e.status}))},`delivery batch`);if(!t.ok)throw new T(`delivery POST failed`,t.retryAfterMs)},baseDelayMs:500,maxDelayMs:3e4,jitterMs:500}),e.setOnEvent(e=>{this.reportDelivery(e.event_id,`received`)})}async initialize(e){let t=Date.now();if(Object.keys(this.getAuthHeaders()).length===0)throw new M(`no_auth_headers`);if(e===void 0){let t=process.env.CLAUDE_CODE_WORKER_EPOCH;e=t?parseInt(t,10):NaN}if(isNaN(e))throw new M(`missing_epoch`);this.workerEpoch=e;let n=this.getWorkerState();if(!(await this.request(`put`,`/worker`,{worker_status:`idle`,worker_epoch:this.workerEpoch,external_metadata:{pending_action:null,task_summary:null,automation_state:null}},`PUT worker (init)`)).ok)throw new M(`worker_register_failed`);this.currentState=`idle`,this.startHeartbeat(),S(()=>{this.writeEvent({type:`keep_alive`})}),o(`CCRClient: initialized, epoch=${this.workerEpoch}`),u(`info`,`cli_worker_lifecycle_initialized`,{epoch:this.workerEpoch,duration_ms:Date.now()-t});let{metadata:r,durationMs:i}=await n;return this.closed||u(`info`,`cli_worker_state_restored`,{duration_ms:i,had_state:r!==null}),r}async getWorkerState(){let e=Date.now(),t=this.getAuthHeaders();return Object.keys(t).length===0?{metadata:null,durationMs:0}:{metadata:(await this.getWithRetry(`${this.sessionBaseUrl}/worker`,t,`worker_state`))?.worker?.external_metadata??null,durationMs:Date.now()-e}}async request(e,t,i,a,{timeout:s=1e4}={}){let c=this.getAuthHeaders();if(Object.keys(c).length===0)return{ok:!1};try{let n=await this.http[e](`${this.sessionBaseUrl}${t}`,i,{headers:{...c,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:s});if(n.status>=200&&n.status<300)return this.consecutiveAuthFailures=0,{ok:!0};if(n.status===409&&this.handleEpochMismatch(),n.status===401||n.status===403){let e=_(),t=e?C(e):null;t!==null&&t*1e3<Date.now()&&(o(`CCRClient: session_token expired (exp=${new Date(t*1e3).toISOString()}) — no refresh was delivered, exiting`,{level:`error`}),u(`error`,`cli_worker_token_expired_no_refresh`),this.onEpochMismatch()),this.consecutiveAuthFailures++,this.consecutiveAuthFailures>=N&&(o(`CCRClient: ${this.consecutiveAuthFailures} consecutive auth failures with a valid-looking token — server-side auth unrecoverable, exiting`,{level:`error`}),u(`error`,`cli_worker_auth_failures_exhausted`),this.onEpochMismatch())}if(o(`CCRClient: ${a} returned ${n.status}`,{level:`warn`}),u(`warn`,`cli_worker_request_failed`,{method:e,path:t,status:n.status}),n.status===429){let e=n.headers?.[`retry-after`],t=typeof e==`string`?parseInt(e,10):NaN;if(!isNaN(t)&&t>=0)return{ok:!1,retryAfterMs:t*1e3}}return{ok:!1}}catch(i){return o(`CCRClient: ${a} failed: ${n(i)}`,{level:`warn`}),u(`warn`,`cli_worker_request_error`,{method:e,path:t,error_code:r(i)}),{ok:!1}}}reportState(e,t){e===this.currentState&&!t||(this.currentState=e,this.workerState.enqueue({worker_status:e,requires_action_details:t?{tool_name:t.tool_name,action_description:t.action_description,request_id:t.request_id}:null}))}reportMetadata(e){this.workerState.enqueue({external_metadata:e})}handleEpochMismatch(){o(`CCRClient: Epoch mismatch (409), shutting down`,{level:`error`}),u(`error`,`cli_worker_epoch_mismatch`),this.onEpochMismatch()}startHeartbeat(){this.stopHeartbeat();let e=()=>{let e=this.heartbeatIntervalMs*this.heartbeatJitterFraction*(2*Math.random()-1);this.heartbeatTimer=setTimeout(t,this.heartbeatIntervalMs+e)},t=()=>{this.sendHeartbeat(),this.heartbeatTimer!==null&&e()};e()}stopHeartbeat(){this.heartbeatTimer&&(clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null)}async sendHeartbeat(){if(!this.heartbeatInFlight){this.heartbeatInFlight=!0;try{(await this.request(`post`,`/worker/heartbeat`,{session_id:this.sessionId,worker_epoch:this.workerEpoch},`Heartbeat`,{timeout:5e3})).ok&&o(`CCRClient: Heartbeat sent`)}finally{this.heartbeatInFlight=!1}}}async writeEvent(e){if(e.type===`stream_event`){this.streamEventBuffer.push(e),this.streamEventTimer||(this.streamEventTimer=setTimeout(()=>void this.flushStreamEventBuffer(),A));return}await this.flushStreamEventBuffer(),e.type===`assistant`&&L(this.streamTextAccumulator,e),await this.eventUploader.enqueue(this.toClientEvent(e))}toClientEvent(e){let t=e;return{payload:{...t,uuid:typeof t.uuid==`string`?t.uuid:w()}}}async flushStreamEventBuffer(){if(this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer.length===0)return;let e=this.streamEventBuffer;this.streamEventBuffer=[];let t=I(e,this.streamTextAccumulator);await this.eventUploader.enqueue(t.map(e=>({payload:e,ephemeral:!0})))}async writeInternalEvent(e,t,{isCompaction:n=!1,agentId:r}={}){let i={payload:{type:e,...t,uuid:typeof t.uuid==`string`?t.uuid:w()},...n&&{is_compaction:!0},...r&&{agent_id:r}};await this.internalEventUploader.enqueue(i)}flushInternalEvents(){return this.internalEventUploader.flush()}async flush(){return await this.flushStreamEventBuffer(),this.eventUploader.flush()}async readInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{},`internal_events`)}async readSubagentInternalEvents(){return this.paginatedGet(`/worker/internal-events`,{subagents:`true`},`subagent_events`)}async paginatedGet(e,t,n){let r=this.getAuthHeaders();if(Object.keys(r).length===0)return null;let i=[],a;do{let o=new URL(`${this.sessionBaseUrl}${e}`);for(let[e,n]of Object.entries(t))o.searchParams.set(e,n);a&&o.searchParams.set(`cursor`,a);let s=await this.getWithRetry(o.toString(),r,n);if(!s)return null;i.push(...s.data??[]),a=s.next_cursor}while(a);return o(`CCRClient: Read ${i.length} internal events from ${e}${t.subagents?` (subagents)`:``}`),i}async getWithRetry(e,t,r){for(let r=1;r<=10;r++){let i;try{i=await this.http.get(e,{headers:{...t,"anthropic-version":`2023-06-01`,"User-Agent":g()},validateStatus:j,timeout:3e4})}catch(t){o(`CCRClient: GET ${e} failed (attempt ${r}/10): ${n(t)}`,{level:`warn`}),r<10&&await f(Math.min(500*2**(r-1),3e4)+Math.random()*500);continue}if(i.status>=200&&i.status<300)return i.data;i.status===409&&this.handleEpochMismatch(),o(`CCRClient: GET ${e} returned ${i.status} (attempt ${r}/10)`,{level:`warn`}),r<10&&await f(Math.min(500*2**(r-1),3e4)+Math.random()*500)}return o(`CCRClient: GET retries exhausted`,{level:`error`}),u(`error`,`cli_worker_get_retries_exhausted`,{context:r}),null}reportDelivery(e,t){this.deliveryUploader.enqueue({eventId:e,status:t})}getWorkerEpoch(){return this.workerEpoch}get internalEventsPending(){return this.internalEventUploader.pendingCount}close(){this.closed=!0,this.stopHeartbeat(),b(),this.streamEventTimer&&(clearTimeout(this.streamEventTimer),this.streamEventTimer=null),this.streamEventBuffer=[],this.streamTextAccumulator.byMessage.clear(),this.streamTextAccumulator.scopeToMessage.clear(),this.workerState.close(),this.eventUploader.close(),this.internalEventUploader.close(),this.deliveryUploader.close()}};export{M as n,E as r,R as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Fr as e,Pr as t}from"./model-C2e73CJD.js";e();export{t as getOrganizationUUID};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./client-CoXtVRzi.js";e();export{t as clearOpenAIClientCache};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Ar as t,Km as n,Tr as r,Um as i,pi as a}from"./loadAgentsDir-CKSb56Gp.js";import{Kt as o,mt as s}from"./state-Bs5xweDL.js";async function c(e,t,n){if(!n||n.trim()===``)return e(`Please provide a color. Available colors: ${i.join(`, `)}, default`,{display:`system`}),null;let o=n.trim().toLowerCase();return l.includes(o)?(await a(s(),`default`,r()),t.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:void 0}})),e(`Session color reset to default`,{display:`system`}),null):i.includes(o)?(await a(s(),o,r()),t.setAppState(e=>({...e,standaloneAgentContext:{...e.standaloneAgentContext,name:e.standaloneAgentContext?.name??``,color:o}})),e(`Session color set to: ${o}`,{display:`system`}),null):(e(`Invalid color "${o}". Available colors: ${i.join(`, `)}, default`,{display:`system`}),null)}var l;e((()=>{o(),n(),t(),l=[`default`,`reset`,`none`,`gray`,`grey`]}))();export{c as call};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ji as e,Ri as t,Ui as n}from"./loadAgentsDir-CKSb56Gp.js";e();export{t as clearCommandsCache,n as getCommands};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$h as t,$y as n,Aw as r,Ay as i,Cy as a,Gh as o,Lg as s,Ny as c,Py as l,Qa as u,Rg as d,Ty as f,Vh as p,Wa as m,Wy as h,Xy as g,cm as _,ct as v,eb as y,eg as b,jw as x,ky as S,lt as C,ng as w,qh as T,rg as E,sm as D,vn as O,wy as k,zh as A}from"./loadAgentsDir-CKSb56Gp.js";import{di as j,ui as M}from"./src-P_wYS_NJ2.js";import{Kt as N,Yt as P}from"./state-Bs5xweDL.js";import{R as F,z as I}from"./debug-BdqxZ7rV.js";import{o as L,s as R}from"./log-CTFl4qpD.js";function z(e,t){let n=D(`tip`),i=r(`app:toggleTranscript`,`Global`,`ctrl+o`),a=[...e.options.verbose?[]:[`(${i} to see full summary)`],...t?[t]:[],...n?[n]:[]];return M.dim(`Compacted `+a.join(`
|
|
2
|
-
`))}async function B(e,t){let n=e.getAppState(),r=await v(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}),[o,c]=await Promise.all([k(),a()]);return{systemPrompt:i,userContext:o,systemContext:c,toolUseContext:e,forkContextMessages:t}}var V;e((()=>{j(),N(),C(),f(),x(),n(),E(),c(),S(),o(),A(),h(),I(),O(),L(),u(),_(),d(),V=async(e,n)=>{let{abortController:r}=n,{messages:a}=n;if(a=m(a),a.length===0)throw Error(`No messages to compact`);let o=e.trim();try{if(!o){let e=await p(a,n.agentId);if(e)return k.cache.clear?.(),T(),y(n.options.querySource??`compact`,n.agentId),P(),l(),{type:`compact`,compactionResult:e,displayText:z(n)}}let e=(await i(a,n)).messages,t=await w(e,n,await B(n,e),!1,o,!1);return g(void 0),l(),k.cache.clear?.(),T(),{type:`compact`,compactionResult:t,displayText:z(n,t.userDisplayMessage)}}catch(e){throw r.signal.aborted?Error(`Compaction canceled.`):F(e,`Not enough messages to compact. Send a few more messages first, then try again.`)?Error(b):F(e,`Compaction interrupted · This may be due to network issues — please try again.`)?Error(t):(R(e),Error(`Error during compaction: ${e}`))}}}))();export{V as call};
|