claude-code-best 2.6.6 → 2.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/dist/chunks/{AddWorkspaceDirectory-Bb6crGWh.js → AddWorkspaceDirectory-_RSNUS7K.js} +1 -1
- package/dist/chunks/{App-CW0Y4ceR.js → App-4VqMMjIu.js} +1 -1
- package/dist/chunks/{ApproveApiKey-9rkwQfgT.js → ApproveApiKey-B7oSxzWc.js} +1 -1
- package/dist/chunks/ApproveApiKey-Bmcop2Do.js +1 -0
- package/dist/chunks/{AssistantSessionChooser-XzXZZdiH.js → AssistantSessionChooser-Lf5l_1Dh.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Ckgmqm6u.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-DlLWAKw2.js → BypassPermissionsModeDialog-DNqPpiPC.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-CjGydpBk.js → ClaudeInChromeOnboarding-BODZ64gw.js} +1 -1
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-B04cjDwX.js → ClaudeMdExternalIncludesDialog-DLI6ey3G.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DO61Zz-S.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-FSHC5mxO.js +1 -0
- package/dist/chunks/{DesktopHandoff-CFBUqcCf.js → DesktopHandoff--xyI5kTQ.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-ByTf41du.js → DevChannelsDialog-DJ4mHsA_.js} +1 -1
- package/dist/chunks/{DiffDialog-CY-8kw_Q.js → DiffDialog-CVWUlOjm.js} +2 -2
- package/dist/chunks/Doctor-DVoFX-9y.js +3 -0
- package/dist/chunks/Doctor-Dcntgp5Z.js +1 -0
- package/dist/chunks/{ExitFlow-BlON8IgH.js → ExitFlow-BKzQPr75.js} +2 -2
- package/dist/chunks/{Feedback-CSeD3k4M.js → Feedback-hFZwDSRp.js} +2 -2
- package/dist/chunks/Grove-Cmcsx2UE.js +1 -0
- package/dist/chunks/{Grove-Tp_UtIMg.js → Grove-G0DtwY22.js} +1 -1
- package/dist/chunks/{HybridTransport-CAko699F.js → HybridTransport-xN03sWrt.js} +1 -1
- package/dist/chunks/{ITermBackend-5P3WJumD.js → ITermBackend-DzN3ZWds.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-CVcdra9v.js → InvalidConfigDialog-Iy4Su1Lm.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-CfLdbmSI.js → InvalidSettingsDialog-dx4y_nY-.js} +1 -1
- package/dist/chunks/{MCPConnectionManager-BK_3uwQj.js → MCPConnectionManager-kVO-4BcA.js} +1 -1
- package/dist/chunks/{McpParsingWarnings-BOj-T8F3.js → McpParsingWarnings-D420-W8M.js} +1 -1
- package/dist/chunks/MessageSelector-CDVC2CAj.js +3 -0
- package/dist/chunks/Messages-C5gVVVmY.js +11 -0
- package/dist/chunks/{Onboarding-C06Mxlf-.js → Onboarding-BkidUre_.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-abcPm3PB.js → OverageCreditUpsell-DoRUucoN.js} +1 -1
- package/dist/chunks/PluginSettings-DhpNtjTm.js +17 -0
- package/dist/chunks/{PromptInputFooterSuggestions-ihnbjU0K.js → PromptInputFooterSuggestions-BnpXzkW9.js} +1 -1
- package/dist/chunks/{PromptInputHelpMenu-CMm8z7Gk.js → PromptInputHelpMenu-DKbiO4C0.js} +1 -1
- package/dist/chunks/QueryEngine-J15EOjWx.js +1 -0
- package/dist/chunks/REPL-Dk3Ics9i.js +1 -0
- package/dist/chunks/{REPL-CBFcgD4r.js → REPL-nrJ13J1o.js} +34 -34
- package/dist/chunks/{RemoteCallout-Cy6lH-CZ.js → RemoteCallout-DGXIcTKv.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-C7iGd5Og.js → RemoteSessionManager-3KsuTCZM.js} +2 -2
- package/dist/chunks/ResumeConversation-kS7lkjJm.js +1 -0
- package/dist/chunks/{SSETransport-B5xlXeAN.js → SSETransport-Cy1rXP6E.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-C998WSxs.js +1 -0
- package/dist/chunks/SentryErrorBoundary-BJLT-ebr.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-iih9eFpM.js → SentryErrorBoundary-B_6MfzRa.js} +1 -1
- package/dist/chunks/Settings-DBopjMkN.js +2 -0
- package/dist/chunks/{TeleportProgress-BX-uLwuL.js → TeleportProgress-CQUN_zoe.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-D8oPPTWd.js → TeleportRepoMismatchDialog-CPquWrd-.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-B_CvNDbr.js → TeleportResumeWrapper-NIFNCHIO.js} +1 -1
- package/dist/chunks/{ThemePicker-BG1ykSpX.js → ThemePicker-DnK0DStD.js} +1 -1
- package/dist/chunks/{TmuxBackend-CnMCWNS4.js → TmuxBackend-C00k5RF9.js} +1 -1
- package/dist/chunks/{TrustDialog-Z_maAYj8.js → TrustDialog-CUnvtDeS.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-C9swVkZ-.js → ValidationErrorsList-CJbO1qub.js} +1 -1
- package/dist/chunks/{WelcomeV2-Au_5ddlT.js → WelcomeV2-BBFGft_e.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-CGxaYH74.js → WindowsTerminalBackend-DSsgxuNK.js} +1 -1
- package/dist/chunks/{add-dir-Cm9u56YX.js → add-dir-BPqd010H.js} +1 -1
- package/dist/chunks/{agentDisplay-Bi_bEyEn.js → agentDisplay-C0B1b_90.js} +1 -1
- package/dist/chunks/{agents-CbjR7hNr.js → agents-CYs7WGHP.js} +1 -1
- package/dist/chunks/{agents-CMF9fLzV.js → agents-DMzVeRly.js} +7 -7
- package/dist/chunks/{ant-Bu1Gs4WJ.js → ant-BO0Hmoii.js} +1 -1
- package/dist/chunks/api-B2HW-oZI.js +1 -0
- package/dist/chunks/{api-D_t0nHsS.js → api-DLLVkmRJ.js} +1 -1
- package/dist/chunks/asciicast-C3nf97NR.js +1 -0
- package/dist/chunks/{asciicast-o5Zg4dJt.js → asciicast-DIsaWcsJ.js} +1 -1
- package/dist/chunks/assistant-BmM44yln.js +1 -0
- package/dist/chunks/{assistant-C_pfWe2a.js → assistant-CHp4-EaF.js} +1 -1
- package/dist/chunks/{assistant-EA-MHNQ-.js → assistant-_dIpsqHM.js} +1 -1
- package/dist/chunks/{auth-D7PZvVPf.js → auth-DelyQc8g.js} +1 -1
- package/dist/chunks/auth-ndSNSeqS.js +1 -0
- package/dist/chunks/{autoMode-B8iO05xy.js → autoMode-D3-o7xPK.js} +1 -1
- package/dist/chunks/{autonomy-CaLvE5N6.js → autonomy-CzSRoxjl.js} +12 -12
- package/dist/chunks/{autonomy-dQVtSiCJ.js → autonomy-tTAucjip.js} +1 -1
- package/dist/chunks/{autonomyPanel-DSswVlCF.js → autonomyPanel-DcK8N52K.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-Bbkz61_-.js +17 -0
- package/dist/chunks/backgroundHousekeeping-DVo3ndZr.js +1 -0
- package/dist/chunks/{branch-C7pM8Sjh.js → branch-ZJF4xAh9.js} +1 -1
- package/dist/chunks/{bridge-CTYdzSWg.js → bridge-C6gSt_32.js} +2 -2
- package/dist/chunks/{bridgeConfig-Df6uyp3q.js → bridgeConfig-DXUNQp2l.js} +1 -1
- package/dist/chunks/bridgeConfig-ZcbBdhji.js +1 -0
- package/dist/chunks/bridgeEnabled-D5qCI5v2.js +1 -0
- package/dist/chunks/{bridgeEnabled-A-_xJ94c.js → bridgeEnabled-G6vxQV-7.js} +1 -1
- package/dist/chunks/bridgeMain-B4Zv8UOe.js +1 -0
- package/dist/chunks/bridgeMain-DlnIQOtX.js +68 -0
- package/dist/chunks/{bridgeMessaging-DPVLAIzl.js → bridgeMessaging-mek-AaFi.js} +1 -1
- package/dist/chunks/{bridgePointer-FvAMj3re.js → bridgePointer-B2FPGDWR.js} +1 -1
- package/dist/chunks/{btw-CqgjLlFN.js → btw-Cz2lyle-.js} +1 -1
- package/dist/chunks/{buddy-DCGBAqF2.js → buddy-BMqKttFw.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CK0jeZTW.js → bypassPermissionsKillswitch-BxvX48jr.js} +1 -1
- package/dist/chunks/caches-D_W3nCFE.js +1 -0
- package/dist/chunks/{caches-CdVW8fYV.js → caches-wtRUk5y5.js} +2 -2
- package/dist/chunks/{ccrClient-B_3AmY7K.js → ccrClient-BOrmrmgF.js} +1 -1
- package/dist/chunks/changeDetector-CUsHUdul.js +1 -0
- package/dist/chunks/channelNotification-CLVU5AuO.js +1 -0
- package/dist/chunks/{channelNotification-BbDQdLZC.js → channelNotification-D8do6HUN.js} +1 -1
- package/dist/chunks/{chrome-CGyqsCkL.js → chrome-JF2BXNK6.js} +1 -1
- package/dist/chunks/clear-BP-G1JWa.js +1 -0
- package/dist/chunks/client-BHfY6SC5.js +1 -0
- package/dist/chunks/color-oh8CGhkI.js +1 -0
- package/dist/chunks/commands-E0eNJ_XZ.js +1 -0
- package/dist/chunks/commitAttribution-B4DOgUS7.js +1 -0
- package/dist/chunks/{commitAttribution-e0kkanVT.js → commitAttribution-CUdm_sRl.js} +1 -1
- package/dist/chunks/{compact-Dh9RewNA.js → compact-R6vMbGQQ.js} +3 -3
- package/dist/chunks/{companion-DVFacTUw.js → companion-ClxqTyG9.js} +1 -1
- package/dist/chunks/{config-DwiVCSrY.js → config-BQ-MayP6.js} +1 -1
- package/dist/chunks/{config-CkSmYDJY.js → config-CPK9PlWS.js} +1 -1
- package/dist/chunks/{context-B8VDDHTv.js → context-CWfsKYEB.js} +1 -1
- package/dist/chunks/{context-noninteractive-IZfWniex.js → context-noninteractive-BJ4hE3MX.js} +2 -2
- package/dist/chunks/context-noninteractive-D1Kxn5e0.js +1 -0
- package/dist/chunks/conversation-C23rDJe3.js +1 -0
- package/dist/chunks/conversation-DizpkPtq.js +1 -0
- package/dist/chunks/{copy-CIjrYoFa.js → copy-BuPCS2HG.js} +2 -2
- package/dist/chunks/{createSSHSession-ArNlbIZB.js → createSSHSession-Di9Je4Th.js} +1 -1
- package/dist/chunks/createSession-Bsa0VJKS.js +1 -0
- package/dist/chunks/{createSession-CBheIT_G.js → createSession-D6v0lBtG.js} +1 -1
- package/dist/chunks/{cronJitterConfig-DcMGWOa-.js → cronJitterConfig-By18m-PD.js} +3 -3
- package/dist/chunks/{crossProjectResume-Z-aR2q-d.js → crossProjectResume-C4YT2T6P.js} +3 -3
- package/dist/chunks/{datadog-BK8eJz8B.js → datadog-BFSdlK6C.js} +1 -1
- package/dist/chunks/datadog-MUvg76p3.js +1 -0
- package/dist/chunks/{desktop-B9vWJeRu.js → desktop-Bd-JHrBo.js} +1 -1
- package/dist/chunks/{diff-BTV7_Dca.js → diff-DGmINgOc.js} +1 -1
- package/dist/chunks/{directoryCompletion-DP_4B1GL.js → directoryCompletion-D7EGwonO.js} +1 -1
- package/dist/chunks/{doctor-Dpbh0aRz.js → doctor-DQ42RQPx.js} +1 -1
- package/dist/chunks/{effort-Czlwa5qF.js → effort-E6XjzPYR.js} +2 -2
- package/dist/chunks/entry-Di8oWZUk.js +14 -0
- package/dist/chunks/{envLessBridgeConfig-BAFYaZ0E.js → envLessBridgeConfig-BNvozi46.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-CUTBQKDY.js +1 -0
- package/dist/chunks/{exit-DzOm62Dn.js → exit-CVlpMwCq.js} +1 -1
- package/dist/chunks/{export-DHOR3z3Z.js → export-CXcPQd0T.js} +1 -1
- package/dist/chunks/{exportRenderer-CiNXeNr9.js → exportRenderer-B9WXgMV2.js} +1 -1
- package/dist/chunks/{extra-usage-DIYR_3ZR.js → extra-usage-B2KmuAZe.js} +1 -1
- package/dist/chunks/extra-usage-DVtAa1zD.js +1 -0
- package/dist/chunks/{extra-usage-core-C3uM9bOP.js → extra-usage-core-B20tawuN.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-Ctz9TfY8.js → extra-usage-noninteractive-DZRe98BZ.js} +1 -1
- package/dist/chunks/{extraUsage-CBwIvl73.js → extraUsage-CxqJdnGC.js} +1 -1
- package/dist/chunks/extractMemories-8uB606Y0.js +1 -0
- package/dist/chunks/{fast-BpBwjbSD.js → fast-CPmJ2bp3.js} +1 -1
- package/dist/chunks/fast-DTGg3pRh.js +1 -0
- package/dist/chunks/{feedback-BkVnsZVx.js → feedback-4GY3ahvw.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-BCzGkdpd.js → firstPartyEventLogger-CISUrAsf.js} +1 -1
- package/dist/chunks/{flushGate-CQsnMw8g.js → flushGate-Dr8sMjB7.js} +1 -1
- package/dist/chunks/gates-BbF5S-Dy.js +1 -0
- package/dist/chunks/{gates-CxWIWtmd.js → gates-DI4pxvrD.js} +1 -1
- package/dist/chunks/{gemini-BbV8D2SS.js → gemini-Dcfosr2Z.js} +1 -1
- package/dist/chunks/{generateRecap-B3j2nUgh.js → generateRecap-CH_fgtxk.js} +1 -1
- package/dist/chunks/{generateSessionName-aGnXSNgN.js → generateSessionName-DO0R__8w.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-DCJLSTLl.js → githubRepoPathMapping-D5I8CVDz.js} +1 -1
- package/dist/chunks/grok-X0FzcE6Y.js +1 -0
- package/dist/chunks/{growthbook-prtWhMRg.js → growthbook-DZPT2JzB.js} +1 -1
- package/dist/chunks/{heapdump-Czm-2XiG.js → heapdump-Cq6i0wJH.js} +1 -1
- package/dist/chunks/{help-CSAFsN0-.js → help-B8ddA-Ec.js} +1 -1
- package/dist/chunks/{hooks-DkbOP-bI.js → hooks-CvFNccdv.js} +2 -2
- package/dist/chunks/hooks-gwB4Eotj.js +1 -0
- package/dist/chunks/{hostAdapter-BcdDPVTj.js → hostAdapter-D3s4JFk-.js} +1 -1
- package/dist/chunks/{ide-BXERRFZF.js → ide-CzxV5_D7.js} +2 -2
- package/dist/chunks/{inboundAttachments-7rXrAtkb.js → inboundAttachments-B3ZTyNKF.js} +1 -1
- package/dist/chunks/inboundAttachments-DxrrrqBW.js +1 -0
- package/dist/chunks/initReplBridge-DWpGy3aE.js +1 -0
- package/dist/chunks/{insights-DrvqJgF8.js → insights-DiWlKgVQ.js} +5 -5
- package/dist/chunks/{install-BGnxwO00.js → install-BFpg1zm1.js} +1 -1
- package/dist/chunks/{install-github-app-CIpBHlr9.js → install-github-app-BUCGGSw0.js} +2 -2
- package/dist/chunks/{install-slack-app-By4Lh7ww.js → install-slack-app-D5JDqzbs.js} +1 -1
- package/dist/chunks/{instrumentation-D9y7Ph_R.js → instrumentation--BToLJT9.js} +3 -3
- package/dist/chunks/{job-BPVIMW_P.js → job-mUyxSEc2.js} +1 -1
- package/dist/chunks/{keybindings-Ce6AHMLI.js → keybindings-D4DbE4G0.js} +2 -2
- package/dist/chunks/{lang-DfDG_fSa.js → lang-cMcnaxAR.js} +1 -1
- package/dist/chunks/language-DC6bsdvI.js +1 -0
- package/dist/chunks/{language-yGoDFP3X.js → language-sTn9sA3E.js} +1 -1
- package/dist/chunks/{launchAgentsPlatform-DT01xZM7.js → launchAgentsPlatform-CAfyCAsQ.js} +1 -1
- package/dist/chunks/{launchAutofixPr-DrYd7WVf.js → launchAutofixPr-CSMamZS6.js} +3 -3
- package/dist/chunks/{launchLocalMemory-Bt3tMYVJ.js → launchLocalMemory-nYAwNsNT.js} +2 -2
- package/dist/chunks/{launchLocalVault-jyRHEa_Y.js → launchLocalVault-yPp8S-tG.js} +3 -3
- package/dist/chunks/{launchMemoryStores-cmXnLAF5.js → launchMemoryStores-Dk3SXucB.js} +1 -1
- package/dist/chunks/{launchOnboarding-BPTNFftb.js → launchOnboarding-BoqmHyRx.js} +1 -1
- package/dist/chunks/{launchSchedule-141GqGC8.js → launchSchedule-C2HBjD6C.js} +1 -1
- package/dist/chunks/{launchSkillStore-Bz0lok_o.js → launchSkillStore-B5Yjvi-k.js} +1 -1
- package/dist/chunks/{launchTeleport-BMquJxIq.js → launchTeleport-BayvAnwh.js} +3 -3
- package/dist/chunks/{launchVault-Bsuwqad6.js → launchVault-BszsgPbZ.js} +1 -1
- package/dist/chunks/loadAgentsDir-6_9ZFegv.js +1 -0
- package/dist/chunks/{loadAgentsDir-D7kapZB5.js → loadAgentsDir-Cl2w3uvH.js} +810 -791
- package/dist/chunks/loadPluginHooks-YHtjByxm.js +1 -0
- package/dist/chunks/{localSearch-r1_G8kfV.js → localSearch-CpeqVibs.js} +1 -1
- package/dist/chunks/localSearch-DbEm6f3k.js +1 -0
- package/dist/chunks/login-D2x89UCR.js +1 -0
- package/dist/chunks/{login-7MvpaOkt.js → login-TVtq34WQ.js} +1 -1
- package/dist/chunks/{logoV2Utils-DjThKW15.js → logoV2Utils-DwaRnvOY.js} +1 -1
- package/dist/chunks/logout-BBPihkXp.js +1 -0
- package/dist/chunks/{magicDocs-Dy72LHIj.js → magicDocs-_yNWB88A.js} +2 -2
- package/dist/chunks/{main-CF6Im-LV.js → main-gTbhsbIs.js} +48 -48
- package/dist/chunks/{mappers-CkMESMy7.js → mappers-COd8OOml.js} +1 -1
- package/dist/chunks/mcp-CChzTC5v.js +6 -0
- package/dist/chunks/{mcp-BTgHgOhR.js → mcp-D-0wE0nJ.js} +2 -2
- package/dist/chunks/mcp-DoraEndj.js +1 -0
- package/dist/chunks/{mcpServer-BueM5fWI.js → mcpServer-CpBN77YB.js} +1 -1
- package/dist/chunks/{mcpServer-Dqm2PQQx.js → mcpServer-Wd9rZG_E.js} +1 -1
- package/dist/chunks/{memory-BNZmqma1.js → memory-I21QZZ9h.js} +1 -1
- package/dist/chunks/{model-DOw7wIKQ.js → model-BrHh21Db.js} +1 -1
- package/dist/chunks/model-C6_WjCy0.js +1 -0
- package/dist/chunks/{onChangeAppState-Cb9_yIuW.js → onChangeAppState-Cn_HSmmQ.js} +1 -1
- package/dist/chunks/openai-BD2V4lHN.js +10 -0
- package/dist/chunks/openaiShared-Bjrci9n8.js +1 -0
- package/dist/chunks/{overageCreditGrant-BrN7dk3d.js → overageCreditGrant-B47t5a73.js} +1 -1
- package/dist/chunks/{passes-vgcY8_l8.js → passes-DAOPYX0C.js} +1 -1
- package/dist/chunks/{path-C4kbwvSH.js → path-B3lx7yHn.js} +1 -1
- package/dist/chunks/{paths-1ngPRtu3.js → paths-q1-Ni8Oh.js} +7 -7
- package/dist/chunks/permissions-BmxTU-Pk.js +3 -0
- package/dist/chunks/{pipeTransport-KU8psPDI.js → pipeTransport-DnHE3axn.js} +1 -1
- package/dist/chunks/{plan-5NVPuxp6.js → plan-4dmnQ9bv.js} +1 -1
- package/dist/chunks/{plugin-t8jMqdsY.js → plugin-CG7lJIpf.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-CAa4KLro.js → pluginAutoupdate-CPLuidh-.js} +1 -1
- package/dist/chunks/{pluginBlocklist-BG2LkLq1.js → pluginBlocklist-BHxIUqu4.js} +1 -1
- package/dist/chunks/{pluginCliCommands-vqAtVibb.js → pluginCliCommands-BcDIvxR3.js} +1 -1
- package/dist/chunks/{pluginFlagging-BFCtv3kY.js → pluginFlagging-Dh6rYOvj.js} +1 -1
- package/dist/chunks/{pluginOperations-C9XP-mko.js → pluginOperations-fdLcp72i.js} +2 -2
- package/dist/chunks/{pluginStartupCheck-RRcAbKfx.js → pluginStartupCheck-Dy7EckW4.js} +1 -1
- package/dist/chunks/pluginStartupCheck-fyqW-stg.js +1 -0
- package/dist/chunks/plugins-C3-iYKTp.js +4 -0
- package/dist/chunks/policyLimits-DUGrXcje.js +1 -0
- package/dist/chunks/{pollConfig-DTYIJ8lQ.js → pollConfig-BGXMaSla.js} +1 -1
- package/dist/chunks/{poor-Dw5dMZpM.js → poor-CxAil0Mi.js} +1 -1
- package/dist/chunks/poorMode-BkPHRLuG.js +1 -0
- package/dist/chunks/{poorMode-CsGLI_hm.js → poorMode-DFcYVnMT.js} +1 -1
- package/dist/chunks/print-Cog1o-Tw.js +39 -0
- package/dist/chunks/{privacy-settings-P2r-kg2i.js → privacy-settings-D6g7p6sB.js} +1 -1
- package/dist/chunks/{processBashCommand-a8W8aTRu.js → processBashCommand-DqgujTR4.js} +1 -1
- package/dist/chunks/processSlashCommand-DUPS9Xx3.js +6 -0
- package/dist/chunks/prompt-B-8CD-W_.js +1 -0
- package/dist/chunks/{prompt-BBg3jtfc.js → prompt-BmOnuQfF.js} +1 -1
- package/dist/chunks/prompt-Da3gIGA8.js +1 -0
- package/dist/chunks/{promptEditor-CvaugNTt.js → promptEditor-ClGwMkWl.js} +2 -2
- package/dist/chunks/{protocolHandler-DxBaHlaD.js → protocolHandler--b0d38gF.js} +1 -1
- package/dist/chunks/{rate-limit-options-Df_sgE0b.js → rate-limit-options-DD2ZRREl.js} +1 -1
- package/dist/chunks/{rcDebugLog-CPGWJbI4.js → rcDebugLog-fhwD4wm-.js} +1 -1
- package/dist/chunks/{referral-BKeCKnOJ.js → referral-rRvT6UDX.js} +1 -1
- package/dist/chunks/refresh-C7S_6LOQ.js +1 -0
- package/dist/chunks/{registerProtocol-DLuRm0mf.js → registerProtocol-Bu_tz5Au.js} +1 -1
- package/dist/chunks/{registry-DVSgtCq5.js → registry-Bk0vdx_8.js} +1 -1
- package/dist/chunks/{release-notes-CZcf8zB7.js → release-notes-BShc_V-B.js} +1 -1
- package/dist/chunks/{releaseNotes-CvfZb3fZ.js → releaseNotes-D3wZdQVZ.js} +2 -2
- package/dist/chunks/{reload-plugins-pSlDLk3b.js → reload-plugins-CpytFAAC.js} +1 -1
- package/dist/chunks/{remote-env-BH89NuwC.js → remote-env-B9Of1v31.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-CrXlWEL1.js → remoteBridgeCore-BXp6nJ8q.js} +1 -1
- package/dist/chunks/{remoteControlServer-BSOnq4yY.js → remoteControlServer-BvlTaHu4.js} +2 -2
- package/dist/chunks/{rename-DNGvNQm2.js → rename-DhTddAd7.js} +1 -1
- package/dist/chunks/{resume-6UL38yL3.js → resume-DwVeFqnc.js} +2 -2
- package/dist/chunks/{runtimeObserver-Cp-DN8fP.js → runtimeObserver-BtgDP8Gz.js} +1 -1
- package/dist/chunks/{runtimeObserver-BhvHeiwD.js → runtimeObserver-dtT0QHYO.js} +4 -4
- package/dist/chunks/sandbox-adapter-Cm8kCM_U.js +1 -0
- package/dist/chunks/{sandbox-toggle-D19YbI5G.js → sandbox-toggle-CG2vZNAb.js} +1 -1
- package/dist/chunks/searchExtraTools-D-RZ9DId.js +1 -0
- package/dist/chunks/{sentry-BZmpC-iI.js → sentry-DFk8bzvt.js} +1 -1
- package/dist/chunks/{session-lLpGqp0B.js → session-DifFcUdR.js} +1 -1
- package/dist/chunks/{sessionDiscovery-BX3fjgzD.js → sessionDiscovery-CRbLIQv1.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-Bixkjai4.js +1 -0
- package/dist/chunks/sessionMemory-BdptRKL8.js +1 -0
- package/dist/chunks/sessionMemory-T1K_mJRE.js +1 -0
- package/dist/chunks/sessionMemoryUtils-q3xRtP-z.js +1 -0
- package/dist/chunks/{sessionObserver-CujNIWks.js → sessionObserver-D3vw6SJ_.js} +1 -1
- package/dist/chunks/sessionObserver-i_3day_6.js +1 -0
- package/dist/chunks/sessionStorage-CusaYoh0.js +1 -0
- package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +3 -0
- package/dist/chunks/{sessionTitle-QxXslbJY.js → sessionTitle-DnvlYJ-c.js} +2 -2
- package/dist/chunks/{sessionTracing-DognYcDf.js → sessionTracing-BkzKJi0v.js} +1 -1
- package/dist/chunks/{settingsSync-DEPET5O1.js → settingsSync-CHZVpM34.js} +1 -1
- package/dist/chunks/{setup-C6G0lasE.js → setup-BfecYO-n.js} +1 -1
- package/dist/chunks/setup-BpwYOhci.js +2 -0
- package/dist/chunks/{setup-BUBUidOg.js → setup-GxlEx1KG.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CQayPrmM.js → shadowedRuleDetection-FNzEipG0.js} +1 -1
- package/dist/chunks/{sideQuestion-B9EE1vTM.js → sideQuestion-Bfa0SZn5.js} +1 -1
- package/dist/chunks/sink-BSwQ045N.js +1 -0
- package/dist/chunks/{sink-Cugto5We.js → sink-DpAjuilF.js} +1 -1
- package/dist/chunks/{sinks-B9A94oIj.js → sinks-C37Xl5c3.js} +2 -2
- package/dist/chunks/sinks-DHHmQJi-.js +1 -0
- package/dist/chunks/{skill-learning-CroDcatu.js → skill-learning-BSeEbCnP.js} +1 -1
- package/dist/chunks/skillChangeDetector-BEDBRGbY.js +1 -0
- package/dist/chunks/{skillGapStore-91Mb3xDY.js → skillGapStore-B4GmZRJ0.js} +2 -2
- package/dist/chunks/{skillGapStore-LKwap3o4.js → skillGapStore-BCO6YB3H.js} +1 -1
- package/dist/chunks/{skillGenerator-B9GM0LHk.js → skillGenerator-QgDWAvzK.js} +2 -2
- package/dist/chunks/skillLearning-CFYgFRPE.js +1 -0
- package/dist/chunks/skillLearning-en7AuVDZ.js +1 -0
- package/dist/chunks/{skillPanel-rIIYgnBE.js → skillPanel-srZjMIbC.js} +3 -3
- package/dist/chunks/{skillSearchPanel-xAL-6uJF.js → skillSearchPanel-DTvHcwNK.js} +4 -4
- package/dist/chunks/{skills-Doe47wxK.js → skills-BlVUkWg4.js} +1 -1
- package/dist/chunks/{sprites-D11F3i1M.js → sprites-QO9r_mXk.js} +1 -1
- package/dist/chunks/{stats-WNUyieG-.js → stats-DdXM-u7l.js} +1 -1
- package/dist/chunks/{status-CjBS9SkF.js → status-BIZWtZqI.js} +1 -1
- package/dist/chunks/{statusNoticeHelpers-cnI4TiGw.js → statusNoticeHelpers-9sIAjiE6.js} +1 -1
- package/dist/chunks/{tag-Gfb8vTAR.js → tag-DDJ8pAsl.js} +2 -2
- package/dist/chunks/{tasks-BwX1rzOD.js → tasks-DYt6udr3.js} +1 -1
- package/dist/chunks/{teamHelpers-DEgaCpta.js → teamHelpers-BJuKEuyS.js} +1 -1
- package/dist/chunks/teamHelpers-Cw5dPQor.js +1 -0
- package/dist/chunks/teammateModeSnapshot-BXC7ssXX.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-Dyukgtp9.js → teammateModeSnapshot-Zp1weNIZ.js} +1 -1
- package/dist/chunks/teleport-DkoFG3EI.js +1 -0
- package/dist/chunks/{templateJobs-DQXuFnkl.js → templateJobs-V2-TVeGE.js} +1 -1
- package/dist/chunks/{terminalSetup-bSbq4LE7.js → terminalSetup-DMUDhXur.js} +1 -1
- package/dist/chunks/{terminalSetup-CTEIn08j.js → terminalSetup-l0Vv_v1c.js} +1 -1
- package/dist/chunks/{theme-DazaKPy8.js → theme-Dm1yCDce.js} +1 -1
- package/dist/chunks/thinkback-D1mk7cq1.js +1 -0
- package/dist/chunks/thinkback-DQAZE5SA.js +1 -0
- package/dist/chunks/thinkback-play-BJcGmc9X.js +1 -0
- package/dist/chunks/{toolEventObserver-Dfvv2trb.js → toolEventObserver-BgkqkNwy.js} +1 -1
- package/dist/chunks/{toolEventObserver-D4h-QqVP.js → toolEventObserver-C-BImvCz.js} +1 -1
- package/dist/chunks/toolPool-DNH5H4Jg.js +1 -0
- package/dist/chunks/toolPool-DYvz_Mjt.js +1 -0
- package/dist/chunks/{trustedDevice-CQ9PK-8m.js → trustedDevice-BDrK9AQ6.js} +1 -1
- package/dist/chunks/{trustedDevice-rdvUkS1W.js → trustedDevice-CXsk3eij.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-Zf9hO4wr.js → ultrareviewCommand-Bc8hMzHz.js} +2 -2
- package/dist/chunks/undercover-DUrQYxYo.js +1 -0
- package/dist/chunks/{undercover-DLyKv5TE.js → undercover-kRoI_nlN.js} +1 -1
- package/dist/chunks/{updateCCB-7WQRz9lW.js → updateCCB-BPGNN7VA.js} +1 -1
- package/dist/chunks/upgrade-BTI562Ce.js +1 -0
- package/dist/chunks/{upgrade-ByIumMQe.js → upgrade-DmEGLk6v.js} +1 -1
- package/dist/chunks/{upload-CvOMbA9_.js → upload-49qk5TBL.js} +1 -1
- package/dist/chunks/{usage-DE4PSQiF.js → usage-DhJDFJVx.js} +1 -1
- package/dist/chunks/{usage-C_d-Z-eb.js → usage-sYgTL8wR.js} +1 -1
- package/dist/chunks/{useMainLoopModel-Os8Ao8-x.js → useMainLoopModel-CJaR_qEJ.js} +1 -1
- package/dist/chunks/{useManagePlugins-BYBubfHU.js → useManagePlugins-B1FpmxFo.js} +1 -1
- package/dist/chunks/{useMergedTools-BJAn2i-F.js → useMergedTools-eMPZ95TX.js} +1 -1
- package/dist/chunks/{useSearchInput-CF77X2OV.js → useSearchInput-CR-b0Qi6.js} +1 -1
- package/dist/chunks/useSettingsErrors-p-PFBeaC.js +1 -0
- package/dist/chunks/{useVoice-DwzMN0fq.js → useVoice-D3PqTfCK.js} +1 -1
- package/dist/chunks/{util-DD30Y4o8.js → util-BZ2fS3PR.js} +1 -1
- package/dist/chunks/utils-hhztcb0b.js +1 -0
- package/dist/chunks/validatePlugin-QtcXXmZu.js +1 -0
- package/dist/chunks/{vim-zc9EiMil.js → vim-LmepJftY.js} +1 -1
- package/dist/chunks/{voice-BRhZt4jW.js → voice-CNRTt4gH.js} +2 -2
- package/dist/chunks/voiceModeEnabled-B57V7REx.js +1 -0
- package/dist/chunks/{voiceModeEnabled-168-1Ocs.js → voiceModeEnabled-wWM929QG.js} +1 -1
- package/dist/chunks/{voiceStreamSTT-B80UegKG.js → voiceStreamSTT-CnK9GN6Q.js} +1 -1
- package/dist/chunks/voiceStreamSTT-Dp-1uSjP.js +1 -0
- package/dist/chunks/{workerRegistry-s8nnpmUO.js → workerRegistry-CrIpKIZe.js} +1 -1
- package/dist/chunks/worktree-YbEK6b36.js +1 -0
- package/dist/chunks/{xml-DTMvLcPg.js → xml-CMdTGiv6.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +0 -1
- package/dist/chunks/Doctor-2D5Wz58o.js +0 -1
- package/dist/chunks/Doctor-CDez_u_U.js +0 -3
- package/dist/chunks/Grove-Dwu_0zRw.js +0 -1
- package/dist/chunks/MessageSelector-BRkxpO1O.js +0 -3
- package/dist/chunks/Messages-wyMyMP7U.js +0 -11
- package/dist/chunks/PluginSettings-DGpIVGvV.js +0 -17
- package/dist/chunks/QueryEngine-I3Bqzbiz.js +0 -1
- package/dist/chunks/REPL-BxAsVlx3.js +0 -1
- package/dist/chunks/ResumeConversation-AdLtgdVB.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +0 -1
- package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +0 -1
- package/dist/chunks/Settings-PioHwsvg.js +0 -2
- package/dist/chunks/api-CFNGoLoL.js +0 -1
- package/dist/chunks/asciicast-aoKFhc7C.js +0 -1
- package/dist/chunks/assistant-BLd4y2FJ.js +0 -1
- package/dist/chunks/auth-DGfZCD_B.js +0 -1
- package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +0 -1
- package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +0 -17
- package/dist/chunks/bridgeConfig-7c07tJm9.js +0 -1
- package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +0 -1
- package/dist/chunks/bridgeMain-B7FZpvo0.js +0 -68
- package/dist/chunks/bridgeMain-C5UxF8ST.js +0 -1
- package/dist/chunks/caches-Dt52PedI.js +0 -1
- package/dist/chunks/changeDetector-uO9CBvut.js +0 -1
- package/dist/chunks/channelNotification-DzTzUrCe.js +0 -1
- package/dist/chunks/clear-B_cVk64B.js +0 -1
- package/dist/chunks/client-BcqXgcrx.js +0 -1
- package/dist/chunks/color-DEXUx7gE.js +0 -1
- package/dist/chunks/commands-BX0_wEGw.js +0 -1
- package/dist/chunks/commitAttribution-CSVDcgTO.js +0 -1
- package/dist/chunks/context-noninteractive-SBxqQ3iu.js +0 -1
- package/dist/chunks/conversation-CQBl9Yy2.js +0 -1
- package/dist/chunks/conversation-DVZplNag.js +0 -1
- package/dist/chunks/createSession-DfEQy2dZ.js +0 -1
- package/dist/chunks/datadog-Uj6FjEuU.js +0 -1
- package/dist/chunks/entry-CdfuWjKu.js +0 -14
- package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +0 -1
- package/dist/chunks/extra-usage-CJcyfVCt.js +0 -1
- package/dist/chunks/extractMemories-C3SU-Osb.js +0 -1
- package/dist/chunks/fast-7iinMwk-.js +0 -1
- package/dist/chunks/gates-qgzva-fO.js +0 -1
- package/dist/chunks/grok-C4QFXJnR.js +0 -1
- package/dist/chunks/hooks-Ch2vPE8u.js +0 -1
- package/dist/chunks/inboundAttachments-C0rkLl2x.js +0 -1
- package/dist/chunks/initReplBridge-tXqkba08.js +0 -1
- package/dist/chunks/language-B1yHC1d6.js +0 -1
- package/dist/chunks/loadAgentsDir-DxPE2bIO.js +0 -1
- package/dist/chunks/loadPluginHooks-CL5aGDrb.js +0 -1
- package/dist/chunks/localSearch-iozuZZhZ.js +0 -1
- package/dist/chunks/login-Dxza_KNT.js +0 -1
- package/dist/chunks/logout-BeGQR78E.js +0 -1
- package/dist/chunks/mcp-UJZ22IDJ.js +0 -6
- package/dist/chunks/mcp-fHf8Uc7h.js +0 -1
- package/dist/chunks/model-D3g2QdU-.js +0 -1
- package/dist/chunks/openai-Bvo0Gcec.js +0 -10
- package/dist/chunks/openaiShared-D5lOejS1.js +0 -16
- package/dist/chunks/permissions-BDbIjTT6.js +0 -3
- package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +0 -1
- package/dist/chunks/plugins-0SyID4Kx.js +0 -4
- package/dist/chunks/policyLimits-Cmmzuv-E.js +0 -1
- package/dist/chunks/poorMode-D_hB-rDf.js +0 -1
- package/dist/chunks/print-Ct8N4PYT.js +0 -39
- package/dist/chunks/processSlashCommand-BaUdUg3T.js +0 -6
- package/dist/chunks/prompt-B1Qy8mi4.js +0 -1
- package/dist/chunks/prompt-D4kWWEZC.js +0 -1
- package/dist/chunks/refresh-Cjv4jA6L.js +0 -1
- package/dist/chunks/sandbox-adapter-DGVtPPD0.js +0 -1
- package/dist/chunks/searchExtraTools-DXWkpOIg.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +0 -1
- package/dist/chunks/sessionMemory-LMOQk90c.js +0 -1
- package/dist/chunks/sessionMemory-UpILj5ww.js +0 -1
- package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +0 -1
- package/dist/chunks/sessionObserver-HqvTXhs9.js +0 -1
- package/dist/chunks/sessionStorage-BN56DAAd.js +0 -1
- package/dist/chunks/sessionStoragePortable-BI9q2WcJ.js +0 -3
- package/dist/chunks/setup-BZMVuIIx.js +0 -2
- package/dist/chunks/sink-BRrEbL6h.js +0 -1
- package/dist/chunks/sinks-CKaSBvU8.js +0 -1
- package/dist/chunks/skillChangeDetector-DnyEQqe6.js +0 -1
- package/dist/chunks/skillLearning-D6latSKi.js +0 -1
- package/dist/chunks/skillLearning-DbOOqb6b.js +0 -1
- package/dist/chunks/teamHelpers-EJxTXoTV.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +0 -1
- package/dist/chunks/teleport-B4p8XlAv.js +0 -1
- package/dist/chunks/thinkback-BOfZP_QG.js +0 -1
- package/dist/chunks/thinkback-CxWZV2Oz.js +0 -1
- package/dist/chunks/thinkback-play-CHe1x2Hc.js +0 -1
- package/dist/chunks/toolPool-BHChMuLr.js +0 -1
- package/dist/chunks/toolPool-C5K43w4_.js +0 -1
- package/dist/chunks/undercover-DNS9V_JT.js +0 -1
- package/dist/chunks/upgrade-bK4x32Ma.js +0 -1
- package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +0 -1
- package/dist/chunks/utils-D44M8obg.js +0 -1
- package/dist/chunks/validatePlugin-DpHiJRsT.js +0 -1
- package/dist/chunks/voiceModeEnabled-CTT25yFj.js +0 -1
- package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +0 -1
- package/dist/chunks/worktree-CkB4jLXK.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Ac as u,Pc as d,Sc as f}from"./paths-
|
|
2
|
-
https://docs.claude.com/s/claude-code-jetbrains`:`No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.`}),e.length!==0&&(0,Q.jsx)(
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{Ac as u,Pc as d,Sc as f}from"./paths-q1-Ni8Oh.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{r as _,t as v}from"./execFileNoThrow-CuQN1sz8.js";import{BS as y,LS as b,Nx as x,RS as S,Sx as C,Xb as w,Zb as T,cx as E,ix as D,kx as O,lx as k,my as A,px as j,sx as M,wt as N,xt as P}from"./loadAgentsDir-Cl2w3uvH.js";import*as F from"path";function I({onComplete:e}){return(0,V.jsxs)(o,{title:`Do you wish to enable auto-connect to IDE?`,color:`ide`,onCancel:e,children:[(0,V.jsx)(x,{options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}],onChange:(0,B.useCallback)(async t=>{let n=t===`yes`;d(e=>({...e,autoConnectIde:n,hasIdeAutoConnectDialogBeenShown:!0})),e()},[e]),defaultValue:`yes`}),(0,V.jsx)(a,{dimColor:!0,children:`You can also configure this in /config or with the --ide flag`})]})}function L(){let e=f();return!k()&&e.autoConnectIde!==!0&&e.hasIdeAutoConnectDialogBeenShown!==!0}function R({onComplete:e}){let t=(0,B.useCallback)(t=>{let n=t===`yes`;n&&d(e=>({...e,autoConnectIde:!1})),e(n)},[e]);return(0,V.jsx)(o,{title:`Do you wish to disable auto-connect to IDE?`,subtitle:`You can also configure this in /config`,onCancel:(0,B.useCallback)(()=>{e(!1)},[e]),color:`ide`,children:(0,V.jsx)(x,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=f();return!k()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),u(),D(),A(),V=l()}));function U({availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:r,onSelect:i}){let[s,l]=(0,Z.useState)(n?.port?.toString()??`None`),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=(0,Z.useCallback)(t=>{t!==`None`&&L()?d(!0):t===`None`&&z()?p(!0):i(e.find(e=>e.port===parseInt(t,10)))},[e,i]),h=e.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{}),g=e.map(e=>{let t=(h[e.name]||0)>1&&e.workspaceFolders.length>0;return{label:e.name,value:e.port.toString(),description:t?X(e.workspaceFolders):void 0}}).concat([{label:`None`,value:`None`,description:void 0}]);return u?(0,Q.jsx)(I,{onComplete:()=>m(s)}):f?(0,Q.jsx)(R,{onComplete:()=>{i(void 0)}}):(0,Q.jsx)(o,{title:`Select IDE`,subtitle:`Connect to an IDE for integrated development features.`,onCancel:r,color:`ide`,children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[e.length===0&&(0,Q.jsx)(a,{dimColor:!0,children:E()?`No available IDEs detected. Please install the plugin and restart your IDE:
|
|
2
|
+
https://docs.claude.com/s/claude-code-jetbrains`:`No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.`}),e.length!==0&&(0,Q.jsx)(x,{defaultValue:s,defaultFocusValue:s,options:g,onChange:e=>{l(e),m(e)}}),e.length!==0&&e.some(e=>e.name===`VS Code`||e.name===`Visual Studio Code`)&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{color:`warning`,children:`Note: Only one Claude Code instance can be connected to VS Code at a time.`})}),e.length!==0&&!k()&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{dimColor:!0,children:`Tip: You can enable auto-connect to IDE in /config or with the --ide flag`})}),t.length>0&&(0,Q.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,Q.jsxs)(a,{dimColor:!0,children:[`Found `,t.length,` other running IDE(s). However, their workspace/project directories do not match the current cwd.`]}),(0,Q.jsx)(c,{marginTop:1,flexDirection:`column`,children:t.map((e,t)=>(0,Q.jsx)(c,{paddingLeft:3,children:(0,Q.jsxs)(a,{dimColor:!0,children:[`• `,e.name,`: `,X(e.workspaceFolders)]})},t))})]})]})})}async function W(e,t){let n=t?.ide;if(!n||n.type!==`sse-ide`&&n.type!==`ws-ide`)return null;for(let t of e)if(t.url===n.url)return t;return null}function G({availableIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]?.port?.toString()??``),a=(0,Z.useCallback)(n=>{t(e.find(e=>e.port===parseInt(n,10)))},[e,t]),s=e.map(e=>({label:e.name,value:e.port.toString()}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select an IDE to open the project`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultValue:r,defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function K({runningIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]??``),a=(0,Z.useCallback)(e=>{t(e)},[t]),s=e.map(e=>({label:j(e),value:e}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select IDE to install extension`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function q({ide:e,onInstall:t}){return(0,Z.useEffect)(()=>{t(e)},[e,t]),null}async function J(e,t,r){m(`tengu_ext_ide_command`,{});let{options:{dynamicMcpConfig:i},onChangeDynamicMcpConfig:a}=t;if(r?.trim()===`open`){let t=P(),r=t?t.worktreePath:g(),i=(await w(!0)).filter(e=>e.isValid);return i.length===0?(e(`No IDEs with Claude Code extension detected.`),null):(0,Q.jsx)(G,{availableIDEs:i,onSelectIDE:async i=>{if(!i){e(`No IDE selected.`);return}if(i.name.toLowerCase().includes(`vscode`)||i.name.toLowerCase().includes(`cursor`)||i.name.toLowerCase().includes(`windsurf`)){let{code:a}=await v(`code`,[r]);e(a===0?`Opened ${t?`worktree`:`project`} in ${n.bold(i.name)}`:`Failed to open in ${i.name}. Try opening manually: ${r}`)}else E(),e(`Please open the ${t?`worktree`:`project`} manually in ${n.bold(i.name)}: ${r}`)},onDone:()=>{e(`Exited without opening IDE`,{display:`system`})}})}let o=await w(!0);if(o.length===0&&t.onInstallIDEExtension&&!k()){let r=await T(),i=r=>{t.onInstallIDEExtension&&(t.onInstallIDEExtension(r),M(r)?e(`Installed plugin to ${n.bold(j(r))}\nPlease ${n.bold(`restart your IDE`)} completely for it to take effect`):e(`Installed extension to ${n.bold(j(r))}`))};if(r.length>1)return(0,Q.jsx)(K,{runningIDEs:r,onSelectIDE:i,onDone:()=>{e(`No IDE selected.`,{display:`system`})}});if(r.length===1)return(0,Q.jsx)(q,{ide:r[0],onInstall:i})}let s=o.filter(e=>e.isValid);return(0,Q.jsx)(Y,{availableIDEs:s,unavailableIDEs:o.filter(e=>!e.isValid),currentIDE:await W(s,i),dynamicMcpConfig:i,onChangeDynamicMcpConfig:a,onDone:e})}function Y({availableIDEs:e,unavailableIDEs:t,currentIDE:n,dynamicMcpConfig:r,onChangeDynamicMcpConfig:i,onDone:o}){let[s,c]=(0,Z.useState)(null),l=S(e=>e.mcp.clients.find(e=>e.name===`ide`)),u=y(),d=(0,Z.useRef)(!0);(0,Z.useEffect)(()=>{if(s){if(d.current){d.current=!1;return}!l||l.type===`pending`||(l.type===`connected`?o(`Connected to ${s.name}.`):l.type===`failed`&&o(`Failed to connect to ${s.name}.`))}},[l,s,o]),(0,Z.useEffect)(()=>{if(!s)return;let e=setTimeout(o,$,`Connection to ${s.name} timed out.`);return()=>clearTimeout(e)},[s,o]);let f=(0,Z.useCallback)(e=>{if(!i){o(`Error connecting to IDE.`);return}let t={...r||{}};if(n&&delete t.ide,!e){l&&l.type===`connected`&&n&&(l.client.onclose=()=>{},C(`ide`,l.config),u(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.filter(e=>e.name!==`ide`),tools:e.mcp.tools.filter(e=>!e.name?.startsWith(`mcp__ide__`)),commands:e.mcp.commands.filter(e=>!e.name?.startsWith(`mcp__ide__`))}}))),i(t),o(n?`Disconnected from ${n.name}.`:`No IDE selected.`);return}let a=e.url;t.ide={type:a.startsWith(`ws:`)?`ws-ide`:`sse-ide`,url:a,ideName:e.name,authToken:e.authToken,ideRunningInWindows:e.ideRunningInWindows,scope:`dynamic`},d.current=!0,c(e),i(t)},[r,n,l,u,i,o]);return s?(0,Q.jsxs)(a,{dimColor:!0,children:[`Connecting to `,s.name,`…`]}):(0,Q.jsx)(U,{availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:()=>o(`IDE selection cancelled`,{display:`system`}),onSelect:f})}function X(e,t=100){if(e.length===0)return``;let n=g(),r=e.slice(0,2),i=e.length>2,a=i?3:0,o=t-(r.length-1)*2-a,s=Math.floor(o/r.length),c=n.normalize(`NFC`),l=r.map(e=>{let t=e.normalize(`NFC`);return t.startsWith(c+F.sep)&&(e=t.slice(c.length+1)),e.length<=s?e:`…`+e.slice(-(s-1))}).join(`, `);return i&&(l+=`, …`),l}var Z,Q,$;e((()=>{r(),Z=t(i(),1),p(),A(),s(),H(),O(),b(),h(),_(),D(),N(),Q=l(),$=35e3}))();export{J as call,X as formatWorkspaceFolders};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,n as h,t as g}from"./bridgeConfig-
|
|
1
|
+
import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,n as h,t as g}from"./bridgeConfig-DXUNQp2l.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),s(),l(),d(),t(),p(),m();var S=3e4;function C(e){u(`[bridge:inbound-attach] ${e}`)}var w=f(()=>o({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,c())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./inboundAttachments-B3ZTyNKF.js";export{e as resolveAndPrepend};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,cn as a,ot as o}from"./state-sIHsFpDu.js";import{Ac as s,Jt as c,Pc as l,Pt as u,S as d,Sc as f,la as p,nn as m,on as h,ua as g,v as _}from"./paths-q1-Ni8Oh.js";import{L as v,V as y,X as ee,Y as b,d as x,s as S}from"./debug-UI3T040K.js";import{n as te,r as C}from"./analytics-DqMQntaB.js";import{F as w,P as T,i as ne,m as re,v as E}from"./git-CN3qtTb_.js";import{g as D,m as O}from"./log-CzsijfHZ.js";import{n as k,t as A}from"./sleep-8Eb9j_Ly.js";import{Aa as ie,Ar as ae,Ba as j,Ca as M,Da as N,Ea as oe,Eo as se,Ka as P,Lo as ce,Ma as F,Oa as le,Oo as I,Ra as L,Sa as ue,Ta as de,Vo as fe,Xv as pe,Zv as me,cd as R,fd as he,hr as z,ja as B,ka as ge,wa as _e}from"./loadAgentsDir-Cl2w3uvH.js";import{O as V,_ as ve,d as H,k as ye,n as be,t as U}from"./rcDebugLog-fhwD4wm-.js";import{a as W,c as G,d as xe,f as Se,o as K,r as Ce,s as q,u as J}from"./debugUtils-BBMFODKH.js";import{a as we,i as Te}from"./trustedDevice-CXsk3eij.js";import{a as Y,i as Ee,n as X,o as Z,t as Q}from"./bridgeConfig-DXUNQp2l.js";import{a as De,o as Oe,r as ke,s as Ae,t as je}from"./bridgeEnabled-G6vxQV-7.js";import{i as Me,t as $}from"./assistant-_dIpsqHM.js";import{t as Ne}from"./capacityWake-BXlUpptF.js";import{n as Pe,t as Fe}from"./pollConfig-BGXMaSla.js";import{a as Ie,n as Le,r as Re,t as ze}from"./workSecret-mS2OrpxF.js";import{a as Be,i as Ve,n as He,t as Ue}from"./createSession-D6v0lBtG.js";import{i as We,n as Ge}from"./envLessBridgeConfig-BNvozi46.js";import{n as Ke,o as qe}from"./mappers-COd8OOml.js";import{n as Je,r as Ye,t as Xe}from"./sessionTitle-DnvlYJ-c.js";import{a as Ze,i as Qe,n as $e,o as et,r as tt,t as nt}from"./bridgeMessaging-mek-AaFi.js";import{t as rt}from"./HybridTransport-xN03sWrt.js";import{n as it,r as at,t as ot}from"./flushGate-Dr8sMjB7.js";import{hostname as st}from"os";import{randomUUID as ct}from"crypto";a(),O(),E(),s(),g(),h(),d(),Y(),me(),ke(),ce(),L(),ae(),Ve(),We(),Ke(),Ye(),ge(),S(),U(),T(),te(),b(),G(),R(),we(),V(),H(),n(),K(),y(),A(),M();var lt=2e3,ut=6e4,dt=900*1e3,ft=0;async function pt(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:l,workerType:u,getAccessToken:d,createSession:f,archiveSession:p,getCurrentTitle:m=()=>s,toSDKMessages:h=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:g,getPollIntervalConfig:_=()=>Pe,initialHistoryCap:y=200,initialMessages:b,previouslyFlushedUUIDs:S,onInboundMessage:te,onPermissionResponse:T,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D,onStateChange:O,onUserMessage:k,perpetual:A,initialSSESequenceNum:ie=0}=e,ae=++ft,{writeBridgePointer:j,clearBridgePointer:M,readBridgePointer:N}=await import(`./bridgePointer-B2FPGDWR.js`),se=A?await N(n):null,P=se?.source===`repl`?se:null;x(`[bridge:repl] initBridgeCore #${ae} starting (initialMessages=${b?.length??0}${P?` perpetual prior=env:${P.environmentId}`:``})`);let ce=le({baseUrl:c,getAccessToken:d,runnerVersion:`2.6.9`,onDebug:x,onAuth401:g,getTrustedDeviceToken:Te}),F=process.env.USER_TYPE===`ant`?oe(ce):ce,I={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:ct(),workerType:u,environmentId:ct(),reuseEnvironmentId:P?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},L,fe;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,fe=e.environment_secret}catch(e){return q(`registration_failed`,`[bridge:repl] Environment registration failed: ${v(e)}`),P&&await M(n),O?.(`failed`,v(e)),null}x(`[bridge:repl] Environment registered: ${L}`),w(`info`,`bridge_repl_env_registered`),C(`tengu_bridge_repl_env_registered`,{});async function pe(e,t){if(L!==e)return x(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=Se(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),x(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){x(`[bridge:repl] reconnectSession(${e}) failed: ${v(t)}`)}return x(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let me=P?await pe(P.environmentId,P.sessionId):!1;P&&!me&&await M(n);let R;if(me&&P){if(R=P.sessionId,x(`[bridge:repl] Perpetual session reused: ${R}`),b&&S)for(let e of b)S.add(e.uuid)}else{let e=await f({environmentId:L,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return x(`[bridge:repl] Session creation failed, deregistering environment`),C(`tengu_bridge_repl_session_failed`,{}),await F.deregisterEnvironment(L).catch(()=>{}),O?.(`failed`,`Session creation failed`),null;R=e,x(`[bridge:repl] Session created: ${R}`)}await j(n,{sessionId:R,environmentId:L,source:`repl`}),w(`info`,`bridge_repl_session_created`),C(`tengu_bridge_repl_started`,{has_initial_messages:!!(b&&b.length>0),inProtectedNamespace:t()});let z=new Set;if(b)for(let e of b)z.add(e.uuid);let B=new nt(2e3);for(let e of z)B.add(e);let ge=new nt(2e3),V=new AbortController,H=null;ve(e=>{V.signal.aborted||H?.reportMetadata(e)},{replayCurrent:!0});let U=0,W=me?ie:0,G=null,K=null,Ce=Ne(V.signal),J=Ce.wake,we=Ce.signal,Y=new ot,Ee=!k,X=0,Z=null;async function Q(){if(Z)return Z;Z=De();try{return await Z}finally{Z=null}}async function De(){if(X++,be(`doReconnect: attempt=${X}/3 envId=${L} sessionId=${R} workId=${G}`),U++,x(`[bridge:repl] Reconnecting after env lost (attempt ${X}/3)`),X>3)return x(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}if(J(),Y.drop(),G){let e=G;if(await F.stopWork(L,e,!1).catch(()=>{}),G!==e)return x(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),X=0,!0;G=null,K=null}if(V.signal.aborted)return x(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,fe=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,x(`[bridge:repl] Environment re-registration failed: ${v(e)}`),!1}if(I.reuseEnvironmentId=void 0,x(`[bridge:repl] Re-registered: requested=${e} got=${L}`),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(H!==null)return x(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),X=0,!0;if(await pe(e,R))return C(`tengu_bridge_repl_reconnected_in_place`,{}),X=0,!0;if(L!==e&&C(`tengu_bridge_repl_env_expired_fresh_session`,{}),await p(R),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=m(),r=await f({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?V.signal.aborted?(x(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await p(r),!1):(R=r,he(xe(r)).catch(()=>{}),W=0,ge.clear(),Ee=!k,x(`[bridge:repl] Re-created session: ${R}`),await j(n,{sessionId:R,environmentId:L,source:`repl`}),S?.clear(),X=0,!0):(x(`[bridge:repl] Session creation failed during reconnection`),!1)}function Oe(){return d()}function ke(){let e=Y.end();if(e.length===0)return;if(!H){x(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)B.add(t.uuid);let t=h(e).map(e=>({...e,session_id:R}));x(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),H.writeBatch(t)}let Ae=null;function je(){Ae?.()}function Me(e){if(be(`handleTransportPermanentClose: code=${e} transport=${H?`exists`:`null`} pollAborted=${V.signal.aborted}`),x(`[bridge:repl] Transport permanently closed: code=${e}`),C(`tengu_bridge_repl_ws_closed`,{code:e}),H){let e=H.getLastSequenceNum();e>W&&(W=e),H=null}J();let t=Y.drop();if(t>0&&x(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){O?.(`failed`,`session ended`),V.abort(),je();return}O?.(`reconnecting`,`Remote Control connection lost (code ${e})`),x(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),Q().then(t=>{t||V.signal.aborted||(x(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),C(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),O?.(`failed`,`reconnection failed`),je())})}let $;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&($=()=>{x(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),Q()},process.on(`SIGUSR2`,$));let Fe=null;process.env.USER_TYPE===`ant`&&de({fireClose:e=>{if(!Fe){x(`[bridge:debug] fireClose: no transport wired yet`);return}x(`[bridge:debug] fireClose(${e}) — injecting`),Fe(e)},forceReconnect:()=>{x(`[bridge:debug] forceReconnect — injecting`),Q()},injectFault:_e,wakePollLoop:J,describe:()=>`env=${L} session=${R} transport=${H?.getStateLabel()??`null`} workId=${G??`null`}`}),mt({api:F,getCredentials:()=>({environmentId:L,environmentSecret:fe}),signal:V.signal,getPollIntervalConfig:_,onStateChange:O,getWsState:()=>H?.getStateLabel()??`null`,isAtCapacity:()=>H!==null,capacitySignal:we,onFatalError:je,getHeartbeatInfo:()=>!G||!K?null:{environmentId:L,workId:G,sessionToken:K},onHeartbeatFatal:e=>{if(x(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),H){let e=H.getLastSequenceNum();e>W&&(W=e),H.close(),H=null}Y.drop(),G&&F.stopWork(L,G,!1).catch(e=>{x(`[bridge:repl] stopWork after heartbeat fatal: ${v(e)}`)}),G=null,K=null,J(),O?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await Q()?{environmentId:L,environmentSecret:fe}:null},onWorkReceived:(e,t,i,a)=>{if(H?.isConnectedStatus()&&x(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),x(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${R} match=${Ie(e,R)}`),j(n,{sessionId:R,environmentId:L,source:`repl`}),!Ie(e,R)){x(`[bridge:repl] Rejecting foreign session: expected=${R} got=${e}`);return}G=i,K=t;let o=a||r(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=Oe(),!s){x(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ye(s)}if(C(`tengu_bridge_repl_work_received`,{}),H){let e=H;H=null;let t=e.getLastSequenceNum();t>W&&(W=t),e.close()}Y.deactivate();let u=e=>Qe(e,{transport:H,sessionId:R,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D}),d=!1,f=e=>{H=e,e.setOnConnect(()=>{if(H===e){if(x(`[bridge:repl] Ingress transport connected`),C(`tengu_bridge_repl_ws_connected`,{}),!o){let e=Oe();e&&ye(e)}if(He=!1,!d&&b&&b.length>0){d=!0;let t=y,n=b.filter(e=>Ze(e)&&!S?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(x(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),C(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=h(r);if(i.length>0){x(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:R})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){x(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(S)for(let e of i)e.uuid&&S.add(e.uuid)}).catch(e=>x(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{H===e&&(ke(),O?.(`connected`))})}else ke(),O?.(`connected`)}else Y.active||O?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);be(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{be(`ingress (non-JSON): ${String(e).slice(0,200)}`)}tt(e,B,ge,te,T,u)}),Fe=Me,e.setOnClose(t=>{H===e&&(be(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Me(t))}),!d&&b&&b.length>0&&Y.start(),e.connect()};if(U++,o){let n=ze(c,e),r=U;x(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),at({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:W}).then(e=>{if(V.signal.aborted){e.close();return}if(r!==U){x(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${U}`),e.close();return}f(e)},e=>{x(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${v(e)}`,{level:`error`}),C(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===U&&(G&&(F.stopWork(L,G,!1).catch(e=>{x(`[bridge:repl] stopWork after v2 init failure: ${v(e)}`)}),G=null,K=null),J())})}else{let t=Le(l,e);x(`[bridge:repl] Ingress URL: ${t}`),x(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(it(new rt(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${Oe()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{O?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),J()}})))}}});let Re=A?setInterval(()=>{Z||j(n,{sessionId:R,environmentId:L,source:`repl`})},60*6e4):null;Re?.unref?.();let Be=_().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{H&&(x(`[bridge:repl] keep_alive sent`),H.write({type:`keep_alive`}).catch(e=>{x(`[bridge:repl] keep_alive write failed: ${v(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;Ae=async()=>{if(He){x(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${R}`);return}He=!0;let e=Date.now();if(x(`[bridge:repl] Teardown starting: env=${L} session=${R} workId=${G??`none`} transportState=${H?.getStateLabel()??`null`}`),Re!==null&&clearInterval(Re),Ve!==null&&clearInterval(Ve),$&&process.off(`SIGUSR2`,$),process.env.USER_TYPE===`ant`&&(ue(),Fe=null),V.abort(),x(`[bridge:repl] Teardown: poll loop aborted`),H){let e=H.getLastSequenceNum();e>W&&(W=e)}if(A){H=null,Y.drop(),await j(n,{sessionId:R,environmentId:L,source:`repl`}),x(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${R} alive on server, duration=${Date.now()-e}ms`);return}let t=H;if(H=null,Y.drop(),t){let e={...et(R),session_id:R};t.write(e)}let r=G?F.stopWork(L,G,!0).then(()=>{x(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{x(`[bridge:repl] Teardown stopWork failed: ${v(e)}`)}):Promise.resolve();await Promise.all([r,p(R)]),t?.close(),x(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{x(`[bridge:repl] Teardown deregister failed: ${v(e)}`)}),await M(n),x(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Ue=ee(()=>Ae?.());return x(`[bridge:repl] Ready: env=${L} session=${R}`),O?.(`ready`),{get bridgeSessionId(){return R},get environmentId(){return L},getSSESequenceNum(){let e=H?.getLastSequenceNum()??0;return Math.max(W,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Ze(e)&&!z.has(e.uuid)&&!B.has(e.uuid));if(t.length===0)return;if(!Ee)for(let e of t){let t=$e(e);if(t!==void 0&&k?.(t,R)){Ee=!0;break}}if(Y.enqueue(...t)){x(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!H){let e=t.map(e=>e.type).join(`,`);x(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${R}`,{level:`warn`});return}for(let e of t)B.add(e.uuid);x(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:R}));H.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!B.has(e.uuid));if(t.length===0)return;if(!H){x(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${R}`,{level:`warn`});return}for(let e of t)e.uuid&&B.add(e.uuid);let n=t.map(e=>({...e,session_id:R}));H.writeBatch(n)},sendControlRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:R};H.write(t),x(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:R};H.write(t),x(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:R};H.write(t),x(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!H){x(`[bridge:repl] sendResult: skipping, transport not configured session=${R}`);return}H.reportState(`idle`);let e={...et(R),session_id:R};H.write(e),x(`[bridge:repl] Sent result for session=${R}`)},async teardown(){Ue(),await Ae?.(),x(`[bridge:repl] Torn down`),C(`tengu_bridge_repl_teardown`,{})}}}async function mt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:s,capacitySignal:c,onFatalError:l,getPollIntervalConfig:u=()=>Pe,getHeartbeatInfo:d,onHeartbeatFatal:f}){x(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let p=0,m=null,h=null,g=0,_=!1;for(;!n.aborted;){let{environmentId:y,environmentSecret:ee}=t(),b=u();try{let t=await e.pollForWork(y,ee,n,b.reclaim_older_than_ms);if(g=0,p>0&&(x(`[bridge:repl] Poll recovered after ${p} consecutive error(s)`),p=0,m=null,h=null,r?.(`ready`)),!t){let t=_;if(_=!1,s?.()&&c&&!t){let t=b.poll_interval_ms_at_capacity;if(b.non_exclusive_heartbeat_interval_ms>0&&d){C(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:b.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&s()&&(r===null||Date.now()<r);){let t=u();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=d();if(!n)break;let r=c();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(x(`[bridge:repl:heartbeat] Failed: ${v(e)}`),e instanceof N){r.cleanup(),C(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),f?(f(e),x(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await k(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:s()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&x(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:b.non_exclusive_heartbeat_interval_ms;if(r>0){let e=c(),t=Date.now();await k(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(x(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),C(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),_=!0)}}else await k(b.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Re(t.secret)}catch(n){x(`[bridge:repl] Failed to decode work secret: ${v(n)}`),C(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(y,t.id,!1).catch(()=>{});continue}x(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(y,t.id,a.session_ingress_token)}catch(e){x(`[bridge:repl] Acknowledge failed workId=${t.id}: ${v(e)}`)}if(t.data.type===`healthcheck`){x(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{F(e,`session_id`)}catch{x(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),x(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof N&&i.status===404&&a){let e=t().environmentId;if(y!==e){x(`[bridge:repl] Stale poll error for old env=${y}, current env=${e} — skipping onEnvironmentLost`),p=0,m=null;continue}if(g++,x(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${g}/3)`),C(`tengu_bridge_repl_env_lost`,{attempt:g}),g>3){x(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),l?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){p=0,m=null,r?.(`ready`),x(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),l?.();break}if(i instanceof N){let e=ie(i.errorType),t=B(i);x(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),C(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),w(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),l?.();break}let s=Date.now();h!==null&&s-h>6e4*2&&(x(`[bridge:repl] Detected system sleep (${Math.round((s-h)/1e3)}s gap), resetting poll error budget`),w(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:s-h}),p=0,m=null),h=s,p++,m===null&&(m=s);let c=s-m,f=W(i),_=Ce(i),v=o?.()??`unknown`;if(x(`[bridge:repl] Poll error (attempt ${p}, elapsed ${Math.round(c/1e3)}s, ws=${v}): ${_}`),C(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:p,elapsedMs:c}),p===1&&r?.(`reconnecting`,_),c>=9e5){x(`[bridge:repl] Poll failures exceeded ${dt/1e3}s (${p} errors), giving up`),w(`info`,`bridge_repl_poll_give_up`),C(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:p,elapsedMs:c,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let ee=Math.min(lt*2**(p-1),ut);if(u().non_exclusive_heartbeat_interval_ms>0){let t=d?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await k(ee,n)}}x(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}S(),y(),K(),G();async function ht(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,initialMessages:y,getMessages:ee,previouslyFlushedUUIDs:b,initialName:S,perpetual:te,outboundOnly:C,tags:w}=t??{};if(J(Oe),!await De())return q(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!Q())return q(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),g?.(`failed`,`/login`),null;if(await P(),!j(`allow_remote_control`))return q(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),g?.(`failed`,`disabled by your organization's policy`),null;if(!Ee()){let e=f();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&c()?.expiresAt===e.bridgeOauthDeadExpiresAt)return x(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await u();let t=c();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){q(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),g?.(`failed`,`/login`);let e=t.expiresAt;return l(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let T=X(),E=`remote-control-${pe()}`,D=!1,O=!1;if(S)E=S,D=!0,O=!0;else{let e=i(),t=e?z(e):void 0;if(t)E=t,D=!0,O=!0;else if(y&&y.length>0)for(let e=y.length-1;e>=0;e--){let t=y[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||fe(t))continue;let n=se(t.message.content);if(!n)continue;let r=_t(n);if(r){E=r,D=!0;break}}}let k=0,A,ie=0,ae=(e,t,n)=>{D=!0,E=e,x(`[bridge:repl] derived title from message ${n}: ${e}`),Be(t,e,{baseUrl:T,getAccessToken:Q}).catch(()=>{})},M=(e,t)=>{let n=++ie,r=k;Je(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===ie&&A===t&&!z(i())&&ae(e,t,r)})},N=(e,t)=>{if(O||z(i()))return!0;if(A!==void 0&&A!==t&&(k=0),A=t,k++,k===1&&!D){let n=_t(e);n&&ae(n,t,k),M(e,t)}else if(k===3){let n=ee?.();M(n?Xe(I(n)):e,t)}return k>=3},oe=_(`tengu_bridge_initial_history_cap`,200,300*1e3),ce=Z()?`self-hosted`:await p();if(!ce)return q(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),g?.(`failed`,`/login`),null;if(Ae()&&!te){let e=await Ge();if(e)return q(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),g?.(`failed`,"run `claude update` to upgrade"),null;x(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-BXp6nJ8q.js`);return t({baseUrl:T,orgUUID:ce,title:E,getAccessToken:Q,onAuth401:m,toSDKMessages:qe,initialHistoryCap:oe,initialMessages:y,onInboundMessage:n,onUserMessage:N,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,outboundOnly:C,tags:w})}let F=je();if(F)return q(`version_too_old`,`[bridge:repl] Skipping: ${F}`),g?.(`failed`,"run `claude update` to upgrade"),null;let le=await ne(),L=await re(),ue=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||T,de=`claude_code`;{let{isAssistantMode:t}=(Me(),e($));t()&&(de=`claude_code_assistant`)}return pt({dir:o(),machineName:st(),branch:le,gitRepoUrl:L,title:E,baseUrl:T,sessionIngressUrl:ue,workerType:de,getAccessToken:Q,createSession:e=>He({...e,events:[],baseUrl:T,getAccessToken:Q}),archiveSession:e=>Ue(e,{baseUrl:T,getAccessToken:Q,timeoutMs:1500}).catch(e=>{x(`[bridge:repl] archiveBridgeSession threw: ${v(e)}`,{level:`error`})}),getCurrentTitle:()=>z(i())??E,onUserMessage:N,toSDKMessages:qe,onAuth401:m,getPollIntervalConfig:Fe,initialHistoryCap:oe,initialMessages:y,previouslyFlushedUUIDs:b,onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,perpetual:te})}var gt=50;function _t(e){let t=D(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>gt?n.slice(0,gt-1)+`…`:n}export{ht as initReplBridge};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{Oo as r,Pr as i,Tr as a,jo as o,rs as s}from"./paths-
|
|
2
|
-
`)+1)}let t=s.command||``;t.includes(`git commit`)&&i++,t.includes(`git push`)&&a++}}}}if(
|
|
3
|
-
`)}async function ye(e){try{return
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{Oo as r,Pr as i,Tr as a,jo as o,rs as s}from"./paths-q1-Ni8Oh.js";import{E as c,K as l,T as u,V as d,w as f}from"./debug-UI3T040K.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{r as h,t as g}from"./execFileNoThrow-CuQN1sz8.js";import{Ar as _,Co as v,Cr as y,LO as b,Lo as x,Uk as S,Wk as ee,it as C,tt as te,wr as ne,xr as re,zr as ie}from"./loadAgentsDir-Cl2w3uvH.js";import{n as w,r as ae}from"./xml-CMdTGiv6.js";import{X as T}from"./rcDebugLog-fhwD4wm-.js";import{tmpdir as oe}from"os";import{extname as se,join as E}from"path";import{constants as ce}from"fs";import{copyFile as le,mkdir as D,mkdtemp as ue,readFile as O,readdir as k,rm as de,unlink as fe,writeFile as A}from"fs/promises";import{execFileSync as pe}from"child_process";function j(){return a()}function me(){return a()}function M(){return E(t(),`usage-data`)}function N(){return E(M(),`facets`)}function P(){return E(M(),`session-meta`)}function he(e){return K[se(e).toLowerCase()]||null}function ge(e){let t={},n={},i=0,a=0,o=0,s=0,c=0,l=[],u=0,d={},f=!1,p=0,m=0,h=new Set,g=[],_=[],v=!1,y=!1,b=!1,x=null;for(let S of e.messages){let e=S.timestamp;if(S.type===`assistant`&&S.message){e&&(x=e);let c=S.message.usage;c&&(o+=c.input_tokens||0,s+=c.output_tokens||0);let l=S.message.content;if(Array.isArray(l)){for(let e of l)if(e.type===`tool_use`&&`name`in e){let o=e.name;t[o]=(t[o]||0)+1,(o===`Agent`||o===`Task`)&&(f=!0),o.startsWith(`mcp__`)&&(v=!0),o===`WebSearch`&&(y=!0),o===`WebFetch`&&(b=!0);let s=e.input;if(s){let e=s.file_path||``;if(e){let t=he(e);t&&(n[t]=(n[t]||0)+1),(o===`Edit`||o===`Write`)&&h.add(e)}if(o===`Edit`){let e=s.old_string||``,t=s.new_string||``;for(let n of ee(e,t))n.added&&(p+=n.count||0),n.removed&&(m+=n.count||0)}if(o===`Write`){let e=s.content||``;e&&(p+=r(e,`
|
|
2
|
+
`)+1)}let t=s.command||``;t.includes(`git commit`)&&i++,t.includes(`git push`)&&a++}}}}if(S.type===`user`&&S.message){let t=S.message.content,n=!1;if(typeof t==`string`&&t.trim())n=!0;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e){n=!0;break}}if(n){if(e)try{let t=new Date(e).getHours();g.push(t),_.push(e)}catch{}if(x&&e){let t=new Date(x).getTime(),n=(new Date(e).getTime()-t)/1e3;n>2&&n<3600&&l.push(n)}}if(Array.isArray(t)){for(let e of t)if(e.type===`tool_result`&&`content`in e&&e.is_error){u++;let t=e.content,n=`Other`;if(typeof t==`string`){let e=t.toLowerCase();e.includes(`exit code`)?n=`Command Failed`:e.includes(`rejected`)||e.includes(`doesn't want`)?n=`User Rejected`:e.includes(`string to replace not found`)||e.includes(`no changes`)?n=`Edit Failed`:e.includes(`modified since read`)?n=`File Changed`:e.includes(`exceeds maximum`)||e.includes(`too large`)?n=`File Too Large`:(e.includes(`file not found`)||e.includes(`does not exist`))&&(n=`File Not Found`)}d[n]=(d[n]||0)+1}}if(typeof t==`string`)t.includes(`[Request interrupted by user`)&&c++;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e&&e.text.includes(`[Request interrupted by user`)){c++;break}}}}return{toolCounts:t,languages:n,gitCommits:i,gitPushes:a,inputTokens:o,outputTokens:s,userInterruptions:c,userResponseTimes:l,toolErrors:u,toolErrorCategories:d,usesTaskAgent:f,usesMcp:v,usesWebSearch:y,usesWebFetch:b,linesAdded:p,linesRemoved:m,filesModified:h,messageHours:g,userMessageTimestamps:_}}function _e(e){return!Number.isNaN(e.created.getTime())&&!Number.isNaN(e.modified.getTime())}function F(e){let t=ge(e),n=ne(e)||`unknown`,r=e.created.toISOString(),i=Math.round((e.modified.getTime()-e.created.getTime())/1e3/60),a=0,o=0;for(let t of e.messages)if(t.type===`assistant`&&o++,t.type===`user`&&t.message){let e=t.message.content,n=!1;if(typeof e==`string`&&e.trim())n=!0;else if(Array.isArray(e)){for(let t of e)if(t.type===`text`&&`text`in t){n=!0;break}}n&&a++}return{session_id:n,project_path:e.projectPath||``,start_time:r,duration_minutes:i,user_message_count:a,assistant_message_count:o,tool_counts:t.toolCounts,languages:t.languages,git_commits:t.gitCommits,git_pushes:t.gitPushes,input_tokens:t.inputTokens,output_tokens:t.outputTokens,first_prompt:e.firstPrompt||``,summary:e.summary,user_interruptions:t.userInterruptions,user_response_times:t.userResponseTimes,tool_errors:t.toolErrors,tool_error_categories:t.toolErrorCategories,uses_task_agent:t.usesTaskAgent,uses_mcp:t.usesMcp,uses_web_search:t.usesWebSearch,uses_web_fetch:t.usesWebFetch,lines_added:t.linesAdded,lines_removed:t.linesRemoved,files_modified:t.filesModified.size,message_hours:t.messageHours,user_message_timestamps:t.userMessageTimestamps}}function ve(e){let t=[],n=F(e);t.push(`Session: ${n.session_id.slice(0,8)}`),t.push(`Date: ${n.start_time}`),t.push(`Project: ${n.project_path}`),t.push(`Duration: ${n.duration_minutes} min`),t.push(``);for(let n of e.messages)if(n.type===`user`&&n.message){let e=n.message.content;if(typeof e==`string`)t.push(`[User]: ${e.slice(0,500)}`);else if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n&&t.push(`[User]: ${n.text.slice(0,500)}`)}else if(n.type===`assistant`&&n.message){let e=n.message.content;if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n?t.push(`[Assistant]: ${n.text.slice(0,300)}`):n.type===`tool_use`&&`name`in n&&t.push(`[Tool: ${n.name}]`)}return t.join(`
|
|
3
|
+
`)}async function ye(e){try{return v((await C({systemPrompt:T([]),userPrompt:Y+e,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:500}})).message.content)||e.slice(0,2e3)}catch{return e.slice(0,2e3)}}async function be(e){let t=ve(e);if(t.length<=3e4)return t;let n=25e3,r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n));let i=await Promise.all(r.map(ye)),a=F(e);return[`Session: ${a.session_id.slice(0,8)}`,`Date: ${a.start_time}`,`Project: ${a.project_path}`,`Duration: ${a.duration_minutes} min`,`[Long session - ${r.length} parts summarized]`,``].join(`
|
|
4
4
|
`)+i.join(`
|
|
5
5
|
|
|
6
6
|
---
|
|
@@ -19,7 +19,7 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema:
|
|
|
19
19
|
"friction_detail": "One sentence describing friction or empty",
|
|
20
20
|
"primary_success": "none|fast_accurate_search|correct_code_edits|good_explanations|proactive_help|multi_file_changes|good_debugging",
|
|
21
21
|
"brief_summary": "One sentence: what user wanted and whether they got it"
|
|
22
|
-
}`,r=
|
|
22
|
+
}`,r=v((await C({systemPrompt:T([]),userPrompt:n,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:4096}})).message.content).match(/\{[\s\S]*\}/);if(!r)return null;let i=u(r[0]);return V(i)?{...i,session_id:t}:null}catch(e){return m(Error(`Facet extraction failed: ${l(e).message}`)),null}}function Ee(e){let t=[];for(let n of e)for(let e of n.user_message_timestamps)try{let r=new Date(e).getTime();t.push({ts:r,sessionId:n.session_id})}catch{}t.sort((e,t)=>e.ts-t.ts);let n=new Set,r=new Set,i=0,a=new Map;for(let e=0;e<t.length;e++){let o=t[e];for(;i<e&&o.ts-t[i].ts>18e5;){let e=t[i];a.get(e.sessionId)===i&&a.delete(e.sessionId),i++}let s=a.get(o.sessionId);if(s!==void 0)for(let i=s+1;i<e;i++){let e=t[i];if(e.sessionId!==o.sessionId){let i=[o.sessionId,e.sessionId].sort().join(`:`);n.add(i),r.add(`${t[s].ts}:${o.sessionId}`),r.add(`${e.ts}:${e.sessionId}`),r.add(`${o.ts}:${o.sessionId}`);break}}a.set(o.sessionId,e)}let o=new Set;for(let e of n){let[t,n]=e.split(`:`);t&&o.add(t),n&&o.add(n)}return{overlap_events:n.size,sessions_involved:o.size,user_messages_during:r.size}}function De(e,t){let n={total_sessions:e.length,sessions_with_facets:t.size,date_range:{start:``,end:``},total_messages:0,total_duration_hours:0,total_input_tokens:0,total_output_tokens:0,tool_counts:{},languages:{},git_commits:0,git_pushes:0,projects:{},goal_categories:{},outcomes:{},satisfaction:{},helpfulness:{},session_types:{},friction:{},success:{},session_summaries:[],total_interruptions:0,total_tool_errors:0,tool_error_categories:{},user_response_times:[],median_response_time:0,avg_response_time:0,sessions_using_task_agent:0,sessions_using_mcp:0,sessions_using_web_search:0,sessions_using_web_fetch:0,total_lines_added:0,total_lines_removed:0,total_files_modified:0,days_active:0,messages_per_day:0,message_hours:[],multi_clauding:{overlap_events:0,sessions_involved:0,user_messages_during:0}},r=[],i=[],a=[];for(let o of e){r.push(o.start_time),n.total_messages+=o.user_message_count,n.total_duration_hours+=o.duration_minutes/60,n.total_input_tokens+=o.input_tokens,n.total_output_tokens+=o.output_tokens,n.git_commits+=o.git_commits,n.git_pushes+=o.git_pushes,n.total_interruptions+=o.user_interruptions,n.total_tool_errors+=o.tool_errors;for(let[e,t]of Object.entries(o.tool_error_categories))n.tool_error_categories[e]=(n.tool_error_categories[e]||0)+t;i.push(...o.user_response_times),o.uses_task_agent&&n.sessions_using_task_agent++,o.uses_mcp&&n.sessions_using_mcp++,o.uses_web_search&&n.sessions_using_web_search++,o.uses_web_fetch&&n.sessions_using_web_fetch++,n.total_lines_added+=o.lines_added,n.total_lines_removed+=o.lines_removed,n.total_files_modified+=o.files_modified,a.push(...o.message_hours);for(let[e,t]of Object.entries(o.tool_counts))n.tool_counts[e]=(n.tool_counts[e]||0)+t;for(let[e,t]of Object.entries(o.languages))n.languages[e]=(n.languages[e]||0)+t;o.project_path&&(n.projects[o.project_path]=(n.projects[o.project_path]||0)+1);let e=t.get(o.session_id);if(e){for(let[t,r]of B(e.goal_categories))r>0&&(n.goal_categories[t]=(n.goal_categories[t]||0)+r);n.outcomes[e.outcome]=(n.outcomes[e.outcome]||0)+1;for(let[t,r]of B(e.user_satisfaction_counts))r>0&&(n.satisfaction[t]=(n.satisfaction[t]||0)+r);n.helpfulness[e.claude_helpfulness]=(n.helpfulness[e.claude_helpfulness]||0)+1,n.session_types[e.session_type]=(n.session_types[e.session_type]||0)+1;for(let[t,r]of B(e.friction_counts))r>0&&(n.friction[t]=(n.friction[t]||0)+r);e.primary_success!==`none`&&(n.success[e.primary_success]=(n.success[e.primary_success]||0)+1)}n.session_summaries.length<50&&n.session_summaries.push({id:o.session_id.slice(0,8),date:o.start_time.split(`T`)[0]||``,summary:o.summary||o.first_prompt.slice(0,100),goal:e?.underlying_goal})}if(r.sort(),n.date_range.start=r[0]?.split(`T`)[0]||``,n.date_range.end=r[r.length-1]?.split(`T`)[0]||``,n.user_response_times=i,i.length>0){let e=[...i].sort((e,t)=>e-t);n.median_response_time=e[Math.floor(e.length/2)]||0,n.avg_response_time=i.reduce((e,t)=>e+t,0)/i.length}return n.days_active=new Set(r.map(e=>e.split(`T`)[0])).size,n.messages_per_day=n.days_active>0?Math.round(n.total_messages/n.days_active*10)/10:0,n.message_hours=a,n.multi_clauding=Ee(e),n}async function I(e,t){try{let n=v((await C({systemPrompt:T([]),userPrompt:e.prompt+`
|
|
23
23
|
|
|
24
24
|
DATA:
|
|
25
25
|
`+t,signal:new AbortController().signal,options:{model:me(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:e.maxTokens}})).message.content);if(n){let t=n.match(/\{[\s\S]*\}/);if(t)try{return{name:e.name,result:u(t[0])}}catch{return{name:e.name,result:null}}}return{name:e.name,result:null}}catch(t){return m(Error(`${e.name} failed: ${l(t).message}`)),{name:e.name,result:null}}}async function Oe(e,t){let n=Array.from(t.values()).slice(0,50).map(e=>`- ${e.brief_summary} (${e.outcome}, ${e.claude_helpfulness})`).join(`
|
|
@@ -639,7 +639,7 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
|
|
|
639
639
|
</div>
|
|
640
640
|
<script>${S}<\/script>
|
|
641
641
|
</body>
|
|
642
|
-
</html>`}async function Me(){let e=
|
|
642
|
+
</html>`}async function Me(){let e=re(),t;try{t=await k(e,{withFileTypes:!0})}catch{return[]}let n=t.filter(e=>e.isDirectory()).map(t=>E(e,t.name)),r=[];for(let e=0;e<n.length;e++){let t=await y(n[e]);for(let[e,n]of t)r.push({sessionId:e,path:n.path,mtime:n.mtime,size:n.size});e%10==9&&await new Promise(e=>setImmediate(e))}return r.sort((e,t)=>t.mtime-e.mtime),r}async function Ne(e){let n;if(process.env.USER_TYPE===`ant`&&e?.collectRemote){let{hosts:e,totalCopied:r}=await G(E(t(),`projects`));n={hosts:e,totalCopied:r}}let r=await Me(),i=r.length,a=[],o=[];for(let e=0;e<r.length;e+=50){let t=r.slice(e,e+50),n=await Promise.all(t.map(async e=>({sessionInfo:e,cached:await Ce(e.sessionId)})));for(let{sessionInfo:e,cached:t}of n)t?a.push(t):o.length<200&&o.push(e)}let s=new Map,c=e=>{for(let t of e.messages.slice(0,5))if(t.type===`user`&&t.message){let e=t.message.content;if(typeof e==`string`&&(e.includes(`RESPOND WITH ONLY A VALID JSON OBJECT`)||e.includes(`record_facets`)))return!0}return!1};for(let e=0;e<o.length;e+=10){let t=o.slice(e,e+10),n=await Promise.all(t.map(async e=>{try{return await ie(e.path)}catch{return[]}})),r=[];for(let e of n)for(let t of e){if(c(t)||!_e(t))continue;let e=F(t);a.push(e),r.push(e),s.set(e.session_id,t)}await Promise.all(r.map(e=>we(e)))}let l=new Map;for(let e of a){let t=l.get(e.session_id);(!t||e.user_message_count>t.user_message_count||e.user_message_count===t.user_message_count&&e.duration_minutes>t.duration_minutes)&&l.set(e.session_id,e)}let u=new Set(l.keys());a=[...l.values()];for(let e of s.keys())u.has(e)||s.delete(e);a.sort((e,t)=>t.start_time.localeCompare(e.start_time));let d=a.filter(e=>!(e.user_message_count<2||e.duration_minutes<1)),f=new Map,p=[],m=await Promise.all(d.map(async e=>({sessionId:e.session_id,cached:await xe(e.session_id)})));for(let{sessionId:e,cached:t}of m)if(t)f.set(e,t);else{let t=s.get(e);t&&p.length<50&&p.push({log:t,sessionId:e})}for(let e=0;e<p.length;e+=50){let t=p.slice(e,e+50),n=await Promise.all(t.map(async({log:e,sessionId:t})=>({sessionId:t,newFacets:await Te(e,t)}))),r=[];for(let{sessionId:e,newFacets:t}of n)t&&(f.set(e,t),r.push(t));await Promise.all(r.map(e=>Se(e)))}let h=e=>{let t=f.get(e);if(!t)return!1;let n=t.goal_categories,r=Pe(n).filter(e=>(n[e]??0)>0);return r.length===1&&r[0]===`warmup_minimal`},g=d.filter(e=>!h(e.session_id)),_=new Map;for(let[e,t]of f)h(e)||_.set(e,t);let v=De(g,_);v.total_sessions_scanned=i;let y=await Oe(v,f),b=je(v,y);try{await D(M(),{recursive:!0})}catch{}let x=E(M(),`report.html`);return await A(x,b,{encoding:`utf-8`,mode:384}),{insights:y,htmlPath:x,data:v,remoteStats:n,facets:_}}function B(e){return e?Object.entries(e):[]}function Pe(e){return e?Object.keys(e):[]}function V(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.underlying_goal==`string`&&typeof t.outcome==`string`&&typeof t.brief_summary==`string`&&t.goal_categories!==null&&typeof t.goal_categories==`object`&&t.user_satisfaction_counts!==null&&typeof t.user_satisfaction_counts==`object`&&t.friction_counts!==null&&typeof t.friction_counts==`object`}var H,U,W,G,K,q,J,Y,X,Z,Q,$;e((()=>{S(),te(),s(),n(),d(),h(),p(),x(),i(),_(),f(),o(),b(),ae(),H=process.env.USER_TYPE===`ant`?async()=>{let{stdout:e,code:t}=await g(`coder`,[`list`,`-o`,`json`],{timeout:3e4});if(t!==0)return[];try{return u(e).filter(e=>e.latest_build?.status===`running`).map(e=>e.name)}catch{return[]}}:async()=>[],U=process.env.USER_TYPE===`ant`?async e=>{let{stdout:t,code:n}=await g(`ssh`,[`${e}.coder`,`find /root/.claude/projects -name "*.jsonl" 2>/dev/null | wc -l`],{timeout:3e4});return n===0&&parseInt(t.trim(),10)||0}:async()=>0,W=process.env.USER_TYPE===`ant`?async(e,t)=>{let n={copied:0,skipped:0},r=await ue(E(oe(),`claude-hs-`));try{if((await g(`scp`,[`-rq`,`${e}.coder:/root/.claude/projects/`,r],{timeout:3e5})).code!==0)return n;let i=E(r,`projects`),a;try{a=await k(i,{withFileTypes:!0})}catch{return n}await Promise.all(a.map(async r=>{let a=r.name,o=E(i,a);if(!r.isDirectory())return;let s=E(t,`${a}__${e}`);try{await D(s,{recursive:!0})}catch{}let c;try{c=await k(o,{withFileTypes:!0})}catch{return}await Promise.all(c.map(async e=>{let t=e.name;if(!t.endsWith(`.jsonl`))return;let r=E(o,t),i=E(s,t);try{await le(r,i,ce.COPYFILE_EXCL),n.copied++}catch{n.skipped++}}))}))}finally{try{await de(r,{recursive:!0,force:!0})}catch{}}return n}:async()=>({copied:0,skipped:0}),G=process.env.USER_TYPE===`ant`?async e=>{let t=await H(),n=[],r=0,i=0,a=await Promise.all(t.map(async t=>{let n=await U(t);if(n>0){let{copied:r,skipped:i}=await W(t,e);return{name:t,sessionCount:n,copied:r,skipped:i}}return{name:t,sessionCount:n,copied:0,skipped:0}}));for(let e of a)n.push({name:e.name,sessionCount:e.sessionCount}),r+=e.copied,i+=e.skipped;return{hosts:n,totalCopied:r,totalSkipped:i}}:async()=>({hosts:[],totalCopied:0,totalSkipped:0}),K={".ts":`TypeScript`,".tsx":`TypeScript`,".js":`JavaScript`,".jsx":`JavaScript`,".py":`Python`,".rb":`Ruby`,".go":`Go`,".rs":`Rust`,".java":`Java`,".md":`Markdown`,".json":`JSON`,".yaml":`YAML`,".yml":`YAML`,".sh":`Shell`,".css":`CSS`,".html":`HTML`},q={debug_investigate:`Debug/Investigate`,implement_feature:`Implement Feature`,fix_bug:`Fix Bug`,write_script_tool:`Write Script/Tool`,refactor_code:`Refactor Code`,configure_system:`Configure System`,create_pr_commit:`Create PR/Commit`,analyze_data:`Analyze Data`,understand_codebase:`Understand Codebase`,write_tests:`Write Tests`,write_docs:`Write Docs`,deploy_infra:`Deploy/Infra`,warmup_minimal:`Cache Warmup`,fast_accurate_search:`Fast/Accurate Search`,correct_code_edits:`Correct Code Edits`,good_explanations:`Good Explanations`,proactive_help:`Proactive Help`,multi_file_changes:`Multi-file Changes`,handled_complexity:`Multi-file Changes`,good_debugging:`Good Debugging`,misunderstood_request:`Misunderstood Request`,wrong_approach:`Wrong Approach`,buggy_code:`Buggy Code`,user_rejected_action:`User Rejected Action`,claude_got_blocked:`Claude Got Blocked`,user_stopped_early:`User Stopped Early`,wrong_file_or_location:`Wrong File/Location`,excessive_changes:`Excessive Changes`,slow_or_verbose:`Slow/Verbose`,tool_failed:`Tool Failed`,user_unclear:`User Unclear`,external_issue:`External Issue`,frustrated:`Frustrated`,dissatisfied:`Dissatisfied`,likely_satisfied:`Likely Satisfied`,satisfied:`Satisfied`,happy:`Happy`,unsure:`Unsure`,neutral:`Neutral`,delighted:`Delighted`,single_task:`Single Task`,multi_task:`Multi Task`,iterative_refinement:`Iterative Refinement`,exploration:`Exploration`,quick_question:`Quick Question`,fully_achieved:`Fully Achieved`,mostly_achieved:`Mostly Achieved`,partially_achieved:`Partially Achieved`,not_achieved:`Not Achieved`,unclear_from_transcript:`Unclear`,unhelpful:`Unhelpful`,slightly_helpful:`Slightly Helpful`,moderately_helpful:`Moderately Helpful`,very_helpful:`Very Helpful`,essential:`Essential`},J=`Analyze this Claude Code session and extract structured facets.
|
|
643
643
|
|
|
644
644
|
CRITICAL GUIDELINES:
|
|
645
645
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DR8-3Aex.js";import{Mt as t,Rn as n,b as r,o as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ka as c,lo as l,oo as u}from"./paths-
|
|
1
|
+
import{o as e}from"./chunk-DR8-3Aex.js";import{Mt as t,Rn as n,b as r,o as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ka as c,lo as l,oo as u}from"./paths-q1-Ni8Oh.js";import{L as d,V as f,d as p,s as m}from"./debug-UI3T040K.js";import{n as h,r as g}from"./analytics-DqMQntaB.js";import{a as _,n as v}from"./env-chR0gV31.js";import{Bb as y,Hb as b,Rb as x,Ub as S,zb as C}from"./loadAgentsDir-Cl2w3uvH.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(n(),1);h(),a(),m(),_(),f(),x(),u();var D=s();function O(){let e=v.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(o,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(o,{children:(0,D.jsxs)(r,{color:`warning`,children:[(0,D.jsx)(i,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,t)=>(0,D.jsx)(o,{marginLeft:2,children:(0,D.jsxs)(r,{dimColor:!0,children:[`• `,e]})},t))]})}function A({onDone:e,force:t,target:n}){let[a,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{p(`Install: Starting installation process (force=${t}, target=${n})`);let e=n||c()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),p(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${t})`);let r=await S(e,t);if(p(`Install: installLatest returned version=${r.latestVersion}, wasUpdated=${r.wasUpdated}, lockFailed=${r.lockFailed}`),r.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);r.latestVersion||p(`Install: Failed to retrieve version information during install`,{level:`error`}),r.wasUpdated||p(`Install: Already up to date`),s({type:`setting-up`});let i=await C(!0);p(`Install: Setup launcher completed with ${i.length} messages`),i.length>0&&i.forEach(e=>p(`Install: Setup message: ${e.message}`)),p(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:u}=await y();a>0&&p(`Cleaned up ${a} npm installation(s)`),o.length>0&&p(`Cleanup errors: ${o.join(`, `)}`);let d=await b();d.length>0&&p(`Shell alias cleanup: ${d.map(e=>e.message).join(`; `)}`),g(`tengu_claude_install_command`,{has_version:+!!r.latestVersion,forced:+!!t}),(n===`latest`||n===`stable`)&&(l(`userSettings`,{autoUpdatesChannel:n}),p(`Install: Saved autoUpdatesChannel=${n} to user settings`));let f=[...u,...d.map(e=>e.message)];i.length>0?(s({type:`set-up`,messages:i.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:r.latestVersion||`current`,setupMessages:[...i.map(e=>e.message),...f]})):(p(`Install: Shell PATH already configured`),s({type:`success`,version:r.latestVersion||`current`,setupMessages:f.length>0?f:void 0}))}catch(e){p(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:d(e)})}}e()},[t,n]),(0,E.useEffect)(()=>{a.type===`success`?setTimeout(e,2e3,`Claude Code installation completed successfully`,{display:`system`}):a.type===`error`&&setTimeout(e,3e3,`Claude Code installation failed`,{display:`system`})},[a,e]),(0,D.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[a.type===`checking`&&(0,D.jsx)(r,{color:`claude`,children:`Checking installation status...`}),a.type===`cleaning-npm`&&(0,D.jsx)(r,{color:`warning`,children:`Cleaning up old npm installations...`}),a.type===`installing`&&(0,D.jsxs)(r,{color:`claude`,children:[`Installing Claude Code native build `,a.version,`...`]}),a.type===`setting-up`&&(0,D.jsx)(r,{color:`claude`,children:`Setting up launcher and shell integration...`}),a.type===`set-up`&&(0,D.jsx)(k,{messages:a.messages}),a.type===`success`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`success`,withSpace:!0}),(0,D.jsx)(r,{color:`success`,bold:!0,children:`Claude Code successfully installed!`})]}),(0,D.jsxs)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:[a.version!==`current`&&(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Version: `}),(0,D.jsx)(r,{color:`claude`,children:a.version})]}),(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Location: `}),(0,D.jsx)(r,{color:`text`,children:O()})]})]}),(0,D.jsx)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(o,{marginTop:1,children:[(0,D.jsx)(r,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(r,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(r,{dimColor:!0,children:` to get started`})]})}),a.setupMessages&&(0,D.jsx)(k,{messages:a.setupMessages})]}),a.type===`error`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`error`,withSpace:!0}),(0,D.jsx)(r,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(r,{color:`error`,children:a.message}),(0,D.jsx)(o,{marginTop:1,children:(0,D.jsx)(r,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Claude Code native build`,argumentHint:`[options]`,async call(e,n,r){let i=r.includes(`--force`),a=r.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await t((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:i,target:a}))}};export{j as install};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Q as a,Rn as o,T as s,b as c,f as l,g as u,h as d,nt as f,t as p,tn as m,tt as h,v as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ac as y,Mn as b,Pc as x,Po as ee,Vt as te,cn as S,jo as C,on as w}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Q as a,Rn as o,T as s,b as c,f as l,g as u,h as d,nt as f,t as p,tn as m,tt as h,v as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ac as y,Mn as b,Pc as x,Po as ee,Vt as te,cn as S,jo as C,on as w}from"./paths-q1-Ni8Oh.js";import{n as T,r as E}from"./analytics-DqMQntaB.js";import{l as ne,v as re}from"./git-CN3qtTb_.js";import{r as ie,t as ae}from"./execa-CGue6Z3n.js";import{o as oe,s as D}from"./log-CzsijfHZ.js";import{r as se,t as O}from"./execFileNoThrow-CuQN1sz8.js";import{Bx as k,Nx as ce,OT as le,Sy as ue,Uw as A,by as j,eC as de,gy as fe,hy as pe,kT as me,my as he,tC as ge,zx as M}from"./loadAgentsDir-Cl2w3uvH.js";import{n as _e,t as ve}from"./browser-fLRXxIsQ.js";import{t as N}from"./useKeybinding-FsOnjW6T.js";import{l as ye,u as be}from"./referral-rRvT6UDX.js";function xe(e){return e.pending?(0,F.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{shortcut:`↑↓`,action:`navigate`}),(0,F.jsx)(u,{shortcut:`Space`,action:`toggle`}),(0,F.jsx)(u,{shortcut:`Enter`,action:`confirm`}),(0,F.jsx)(de,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}function Se({onSubmit:e,defaultSelections:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useCallback)(t=>{if(t.length===0){r(!0);return}r(!1),e(t)},[e]),o=(0,P.useCallback)(()=>{r(!1)},[]),s=(0,P.useCallback)(()=>{r(!0)},[]);return(0,F.jsxs)(l,{title:`Select GitHub workflows to install`,subtitle:`We'll create a workflow file in your repository for each one you select.`,onCancel:s,inputGuide:xe,children:[(0,F.jsx)(_,{children:(0,F.jsxs)(c,{dimColor:!0,children:[`More workflow examples (issue triage, CI fixes, etc.) at:`,` `,(0,F.jsx)(a,{url:`https://github.com/anthropics/claude-code-action/blob/main/examples/`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/`})]})}),(0,F.jsx)(pe,{options:Ce.map(e=>({label:e.label,value:e.value})),defaultValue:t,onSubmit:i,onChange:o,onCancel:s,hideIndexes:!0}),n&&(0,F.jsx)(_,{children:(0,F.jsx)(c,{color:`error`,children:`You must select at least one workflow to continue`})})]})}var P,F,Ce,we=e((()=>{P=t(o(),1),p(),ge(),fe(),F=v(),Ce=[{value:`claude`,label:`@Claude Code - Tag @claude in issues and PR comments`},{value:`claude-review`,label:`Claude Code Review - Automated code review on new PRs`}]})),Te,I,Ee,De,Oe,L=e((()=>{Te=`Add Claude Code GitHub Workflow`,I=`https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md`,Ee=`name: Claude Code
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
issue_comment:
|
|
@@ -132,7 +132,7 @@ jobs:
|
|
|
132
132
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
133
133
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
|
134
134
|
|
|
135
|
-
`}));function ke({existingApiKey:e,apiKeyOrOAuthToken:t,onApiKeyChange:n,onSubmit:r,onToggleUseExistingKey:a,onCreateOAuthToken:o,selectedOption:l=e?`existing`:o?`oauth`:`new`,onSelectOption:u}){let[d,p]=(0,R.useState)(0),m=i(),[h]=s(),v=(0,R.useCallback)(()=>{l===`new`&&o?u?.(`oauth`):l===`oauth`&&e&&(u?.(`existing`),a(!0))},[l,o,e,u,a]),y=(0,R.useCallback)(()=>{l===`existing`?(u?.(o?`oauth`:`new`),a(!1)):l===`oauth`&&u?.(`new`)},[l,o,u,a]),b=(0,R.useCallback)(()=>{l===`oauth`&&o?o():r()},[l,o,r]),x=l===`new`;return f({"confirm:previous":v,"confirm:next":y,"confirm:yes":b},{context:`Confirmation`,isActive:!x}),f({"confirm:previous":v,"confirm:next":y},{context:`Confirmation`,isActive:x}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,z.jsx)(c,{dimColor:!0,children:`Choose API key`})]}),e&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`existing`?g(`success`,h)(`> `):` `,`Use your existing Claude Code API key`]})}),o&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`oauth`?g(`success`,h)(`> `):` `,`Create a long-lived token with your Claude subscription`]})}),(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`new`?g(`success`,h)(`> `):` `,`Enter a new API key`]})}),l===`new`&&(0,z.jsx)(k,{value:t,onChange:n,onSubmit:r,onPaste:n,focus:!0,placeholder:`sk-ant… (Create a new key at https://platform.claude.com/settings/keys)`,mask:`*`,columns:m.columns,cursorOffset:d,onChangeCursorOffset:p,showCursor:!0})]}),(0,z.jsx)(_,{marginLeft:3,children:(0,z.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var R,z,Ae=e((()=>{R=t(o(),1),A(),M(),p(),N(),z=v()}));function je({useExistingSecret:e,secretName:t,onToggleUseExistingSecret:n,onSecretNameChange:r,onSubmit:a}){let[o,l]=(0,B.useState)(0),u=i(),[d]=s(),p=(0,B.useCallback)(()=>n(!0),[n]),m=(0,B.useCallback)(()=>n(!1),[n]);return f({"confirm:previous":p,"confirm:next":m,"confirm:yes":a},{context:`Confirmation`,isActive:e}),f({"confirm:previous":p,"confirm:next":m},{context:`Confirmation`,isActive:!e}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,V.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,V.jsx)(c,{dimColor:!0,children:`Setup API key secret`})]}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{color:`warning`,children:`ANTHROPIC_API_KEY already exists in repository secrets!`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Would you like to:`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?g(`success`,d)(`> `):` `,`Use the existing API key`]})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?` `:g(`success`,d)(`> `),`Create a new secret with a different name`]})}),!e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Enter new secret name (alphanumeric with underscores):`})}),(0,V.jsx)(k,{value:t,onChange:r,onSubmit:a,focus:!0,placeholder:`e.g., CLAUDE_API_KEY`,columns:u.columns,cursorOffset:o,onChangeCursorOffset:l,showCursor:!0})]})]}),(0,V.jsx)(_,{marginLeft:3,children:(0,V.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var B,V,Me=e((()=>{B=t(o(),1),A(),M(),p(),N(),V=v()}));function Ne(){return(0,Pe.jsx)(c,{children:`Checking GitHub CLI installation…`})}var Pe,Fe=e((()=>{p(),Pe=v()}));function Ie({currentRepo:e,useCurrentRepo:t,repoUrl:n,onRepoUrlChange:r,onSubmit:a,onToggleUseCurrentRepo:o}){let[s,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),p=i().columns,m=(0,H.useCallback)(()=>{if(!(t?e:n)?.trim()){d(!0);return}a()},[t,e,n,a]),h=!t||!e,g=(0,H.useCallback)(()=>{o(!0),d(!1)},[o]),v=(0,H.useCallback)(()=>{o(!1),d(!1)},[o]);return f({"confirm:previous":g,"confirm:next":v,"confirm:yes":m},{context:`Confirmation`,isActive:!h}),f({"confirm:previous":g,"confirm:next":v},{context:`Confirmation`,isActive:h}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,U.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,U.jsx)(c,{dimColor:!0,children:`Select GitHub repository`})]}),e&&(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:t,color:t?`permission`:void 0,children:[t?`> `:` `,`Use current repository: `,e]})}),(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:!t||!e,color:!t||!e?`permission`:void 0,children:[!t||!e?`> `:` `,e?`Enter a different repository`:`Enter repository`]})}),(!t||!e)&&(0,U.jsx)(_,{marginLeft:2,marginBottom:1,children:(0,U.jsx)(k,{value:n,onChange:e=>{r(e),d(!1)},onSubmit:m,focus:!0,placeholder:`Enter a repo as owner/repo or https://github.com/owner/repo…`,columns:p,cursorOffset:s,onChangeCursorOffset:l,showCursor:!0})})]}),u&&(0,U.jsx)(_,{marginLeft:3,marginBottom:1,children:(0,U.jsx)(c,{color:`error`,children:`Please enter a repository name to continue`})}),(0,U.jsx)(_,{marginLeft:3,children:(0,U.jsxs)(c,{dimColor:!0,children:[e?`↑/↓ to select · `:``,`Enter to continue`]})})]})}var H,U,Le=e((()=>{H=t(o(),1),A(),M(),p(),N(),U=v()}));function Re({currentWorkflowInstallStep:e,secretExists:t,useExistingSecret:n,secretName:r,skipWorkflow:i=!1,selectedWorkflows:a}){let o=i?[`Getting repository information`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`]:[`Getting repository information`,`Creating branch`,a.length>1?`Creating workflow files`:`Creating workflow file`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`,`Opening pull request page`];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,W.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,W.jsx)(c,{dimColor:!0,children:`Create GitHub Actions workflow`})]}),o.map((t,n)=>{let r=`pending`;return n<e?r=`completed`:n===e&&(r=`in-progress`),(0,W.jsx)(_,{children:(0,W.jsxs)(c,{color:r===`completed`?`success`:r===`in-progress`?`warning`:void 0,children:[r===`completed`?`✓ `:``,t,r===`in-progress`?`…`:``]})},n)})]})})}var W,ze=e((()=>{p(),W=v()}));function Be({error:e,errorReason:t,errorInstructions:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,G.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,G.jsx)(c,{bold:!0,children:`Install GitHub App`})}),(0,G.jsxs)(c,{color:`error`,children:[`Error: `,e]}),t&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`Reason: `,t]})}),n&&n.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(c,{dimColor:!0,children:`How to fix:`}),n.map((e,t)=>(0,G.jsxs)(_,{marginLeft:2,children:[(0,G.jsx)(c,{dimColor:!0,children:`• `}),(0,G.jsx)(c,{children:e})]},t))]}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`For manual setup instructions, see: `,(0,G.jsx)(c,{color:`claude`,children:I})]})})]}),(0,G.jsx)(_,{marginLeft:3,children:(0,G.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var G,Ve=e((()=>{L(),p(),G=v()}));function He({repoName:e,onSelectAction:t}){return(0,K.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(c,{bold:!0,children:`Existing Workflow Found`}),(0,K.jsxs)(c,{dimColor:!0,children:[`Repository: `,e]})]}),(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(c,{children:[`A Claude workflow file already exists at `,(0,K.jsx)(c,{color:`claude`,children:`.github/workflows/claude.yml`})]}),(0,K.jsx)(c,{dimColor:!0,children:`What would you like to do?`})]}),(0,K.jsx)(_,{flexDirection:`column`,children:(0,K.jsx)(pe,{options:[{label:`Update workflow file with latest version`,value:`update`},{label:`Skip workflow update (configure secrets only)`,value:`skip`},{label:`Exit without making changes`,value:`exit`}],onChange:e=>{t(e)},onCancel:()=>{t(`exit`)}})}),(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[`View the latest workflow template at:`,` `,(0,K.jsx)(c,{color:`claude`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml`})]})})]})}var K,Ue=e((()=>{me(),p(),K=v()}));function We({repoUrl:e,onSubmit:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,q.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,q.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,q.jsx)(c,{bold:!0,children:`Install the Claude GitHub App`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`Opening browser to install the Claude GitHub App…`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`If your browser doesn't open automatically, visit:`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{underline:!0,children:`https://github.com/apps/claude`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsxs)(c,{children:[`Please install the app for repository: `,(0,q.jsx)(c,{bold:!0,children:e})]})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{dimColor:!0,children:`Important: Make sure to grant access to this specific repository`})}),(0,q.jsx)(_,{children:(0,q.jsxs)(c,{bold:!0,color:`permission`,children:[`Press Enter once you've installed the app`,r.ellipsis]})}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(c,{dimColor:!0,children:[`Having trouble? See manual setup instructions at: `,(0,q.jsx)(c,{color:`claude`,children:I})]})})]})}var q,Ge=e((()=>{n(),L(),p(),N(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new ge),[s,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)(!1),y=(0,J.useRef)(new Set),x=(0,J.useRef)(void 0),ee=i(),te=Math.max(50,ee.columns-30-4);function S(e){n.state===`error`&&(e.preventDefault(),e.key===`return`&&n.toRetry?(l(``),f(0),r({state:`about_to_retry`,nextState:n.toRetry})):t())}async function C(e,t){try{let[n,i]=e.split(`#`);if(!n||!i){r({state:`error`,message:`Invalid code. Please make sure the full code was copied`,toRetry:{state:`waiting_for_login`,url:t}});return}E(`tengu_oauth_manual_entry`,{}),o.handleManualAuthCodeInput({authorizationCode:n,state:i})}catch(e){D(e),r({state:`error`,message:e.message,toRetry:{state:`waiting_for_login`,url:t}})}}let w=(0,J.useCallback)(async()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear();try{let t=await o.startOAuthFlow(async e=>{r({state:`waiting_for_login`,url:e});let t=setTimeout(h,3e3,!0);y.current.add(t)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:365*24*60*60});r({state:`processing`}),b(t);let n=setTimeout((e,t,n,r)=>{e({state:`success`,token:t});let i=setTimeout(n,1e3,t);r.current.add(i)},100,r,t.accessToken,e,y);y.current.add(n)}catch(e){let t=e.message;r({state:`error`,message:t,toRetry:{state:`starting`}}),D(e),E(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&w()},[n.state,w]),(0,J.useEffect)(()=>{if(n.state===`about_to_retry`){let e=setTimeout((e,t,n)=>{t(e.state===`waiting_for_login`),n(e)},500,n.nextState,h,r);y.current.add(e)}},[n]),(0,J.useEffect)(()=>{s===`c`&&n.state===`waiting_for_login`&&p&&!g&&(m(n.url).then(e=>{e&&process.stdout.write(e),v(!0),clearTimeout(x.current),x.current=setTimeout(v,2e3,!1)}),l(``))},[s,n,p,g]),(0,J.useEffect)(()=>{let e=y.current;return()=>{o.cleanup(),e.forEach(e=>clearTimeout(e)),e.clear(),clearTimeout(x.current)}},[o]);function T(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Starting authentication…`})]});case`waiting_for_login`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[!p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Opening browser to sign in with your Claude account…`})]}),p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(c,{children:qe}),(0,Y.jsx)(k,{value:s,onChange:l,onSubmit:e=>C(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:te})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Processing authentication…`})]});case`success`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(c,{color:`success`,children:`✓ Authentication token created successfully!`}),(0,Y.jsx)(c,{dimColor:!0,children:`Using token for GitHub Actions setup…`})]});case`error`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(c,{color:`error`,children:[`OAuth error: `,n.message]}),n.toRetry?(0,Y.jsx)(c,{dimColor:!0,children:`Press Enter to try again, or any other key to cancel`}):(0,Y.jsx)(c,{dimColor:!0,children:`Press any key to return to API key selection`})]});case`about_to_retry`:return(0,Y.jsx)(_,{flexDirection:`column`,gap:1,children:(0,Y.jsx)(c,{color:`permission`,children:`Retrying…`})});default:return null}}return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[n.state===`starting`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]}),n.state!==`success`&&n.state!==`starting`&&n.state!==`processing`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]},`header`),n.state===`waiting_for_login`&&p&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsxs)(_,{paddingX:1,children:[(0,Y.jsx)(c,{dimColor:!0,children:`Browser didn't open? Use the url below to sign in `}),g?(0,Y.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,Y.jsx)(c,{dimColor:!0,children:(0,Y.jsx)(u,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,Y.jsx)(a,{url:n.url,children:(0,Y.jsx)(c,{dimColor:!0,children:n.url})})]},`urlToCopy`),(0,Y.jsx)(_,{paddingLeft:1,flexDirection:`column`,gap:1,children:T()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),T(),p(),he(),A(),M(),ce(),w(),oe(),Y=v(),qe=`Paste code here if prompted > `}));function Ye({secretExists:e,useExistingSecret:t,secretName:n,skipWorkflow:r=!1}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,X.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,X.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,X.jsx)(c,{dimColor:!0,children:`Success`})]}),!r&&(0,X.jsx)(c,{color:`success`,children:`✓ GitHub Actions workflow created!`}),e&&t&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{color:`success`,children:`✓ Using existing ANTHROPIC_API_KEY secret`})}),(!e||!t)&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsxs)(c,{color:`success`,children:[`✓ API key saved as `,n,` secret`]})}),(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{children:`Next steps:`})}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`2. Your workflow file was kept unchanged`}),(0,X.jsx)(c,{children:`3. API key is configured and ready to use`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. A pre-filled PR page has been created`}),(0,X.jsx)(c,{children:`2. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`3. Merge the PR to enable Claude PR assistance`})]})]}),(0,X.jsx)(_,{marginLeft:3,children:(0,X.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var X,Xe=e((()=>{o(),p(),X=v()}));async function Ze(e,t,n,r,i,a,o){let s=await O(`gh`,[`api`,`repos/${e}/contents/${n}`,`--jq`,`.sha`]),c=null;s.code===0&&(c=s.stdout.trim());let l=r;i===`CLAUDE_CODE_OAUTH_TOKEN`?l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}"):i!==`ANTHROPIC_API_KEY`&&(l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${i} }}`));let u=Buffer.from(l).toString(`base64`),d=[`api`,`--method`,`PUT`,`repos/${e}/contents/${n}`,`-f`,`message=${c?`"Update ${a}"`:`"${a}"`}`,`-f`,`content=${u}`,`-f`,`branch=${t}`];c&&d.push(`-f`,`sha=${c}`);let f=await O(`gh`,d);if(f.code!==0)throw f.stderr.includes(`422`)&&f.stderr.includes(`sha`)?(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`)):(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: ${f.stderr}
|
|
135
|
+
`}));function ke({existingApiKey:e,apiKeyOrOAuthToken:t,onApiKeyChange:n,onSubmit:r,onToggleUseExistingKey:a,onCreateOAuthToken:o,selectedOption:l=e?`existing`:o?`oauth`:`new`,onSelectOption:u}){let[d,p]=(0,R.useState)(0),m=i(),[h]=s(),v=(0,R.useCallback)(()=>{l===`new`&&o?u?.(`oauth`):l===`oauth`&&e&&(u?.(`existing`),a(!0))},[l,o,e,u,a]),y=(0,R.useCallback)(()=>{l===`existing`?(u?.(o?`oauth`:`new`),a(!1)):l===`oauth`&&u?.(`new`)},[l,o,u,a]),b=(0,R.useCallback)(()=>{l===`oauth`&&o?o():r()},[l,o,r]),x=l===`new`;return f({"confirm:previous":v,"confirm:next":y,"confirm:yes":b},{context:`Confirmation`,isActive:!x}),f({"confirm:previous":v,"confirm:next":y},{context:`Confirmation`,isActive:x}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,z.jsx)(c,{dimColor:!0,children:`Choose API key`})]}),e&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`existing`?g(`success`,h)(`> `):` `,`Use your existing Claude Code API key`]})}),o&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`oauth`?g(`success`,h)(`> `):` `,`Create a long-lived token with your Claude subscription`]})}),(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`new`?g(`success`,h)(`> `):` `,`Enter a new API key`]})}),l===`new`&&(0,z.jsx)(M,{value:t,onChange:n,onSubmit:r,onPaste:n,focus:!0,placeholder:`sk-ant… (Create a new key at https://platform.claude.com/settings/keys)`,mask:`*`,columns:m.columns,cursorOffset:d,onChangeCursorOffset:p,showCursor:!0})]}),(0,z.jsx)(_,{marginLeft:3,children:(0,z.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var R,z,Ae=e((()=>{R=t(o(),1),k(),A(),p(),N(),z=v()}));function je({useExistingSecret:e,secretName:t,onToggleUseExistingSecret:n,onSecretNameChange:r,onSubmit:a}){let[o,l]=(0,B.useState)(0),u=i(),[d]=s(),p=(0,B.useCallback)(()=>n(!0),[n]),m=(0,B.useCallback)(()=>n(!1),[n]);return f({"confirm:previous":p,"confirm:next":m,"confirm:yes":a},{context:`Confirmation`,isActive:e}),f({"confirm:previous":p,"confirm:next":m},{context:`Confirmation`,isActive:!e}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,V.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,V.jsx)(c,{dimColor:!0,children:`Setup API key secret`})]}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{color:`warning`,children:`ANTHROPIC_API_KEY already exists in repository secrets!`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Would you like to:`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?g(`success`,d)(`> `):` `,`Use the existing API key`]})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?` `:g(`success`,d)(`> `),`Create a new secret with a different name`]})}),!e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Enter new secret name (alphanumeric with underscores):`})}),(0,V.jsx)(M,{value:t,onChange:r,onSubmit:a,focus:!0,placeholder:`e.g., CLAUDE_API_KEY`,columns:u.columns,cursorOffset:o,onChangeCursorOffset:l,showCursor:!0})]})]}),(0,V.jsx)(_,{marginLeft:3,children:(0,V.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var B,V,Me=e((()=>{B=t(o(),1),k(),A(),p(),N(),V=v()}));function Ne(){return(0,Pe.jsx)(c,{children:`Checking GitHub CLI installation…`})}var Pe,Fe=e((()=>{p(),Pe=v()}));function Ie({currentRepo:e,useCurrentRepo:t,repoUrl:n,onRepoUrlChange:r,onSubmit:a,onToggleUseCurrentRepo:o}){let[s,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),p=i().columns,m=(0,H.useCallback)(()=>{if(!(t?e:n)?.trim()){d(!0);return}a()},[t,e,n,a]),h=!t||!e,g=(0,H.useCallback)(()=>{o(!0),d(!1)},[o]),v=(0,H.useCallback)(()=>{o(!1),d(!1)},[o]);return f({"confirm:previous":g,"confirm:next":v,"confirm:yes":m},{context:`Confirmation`,isActive:!h}),f({"confirm:previous":g,"confirm:next":v},{context:`Confirmation`,isActive:h}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,U.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,U.jsx)(c,{dimColor:!0,children:`Select GitHub repository`})]}),e&&(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:t,color:t?`permission`:void 0,children:[t?`> `:` `,`Use current repository: `,e]})}),(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:!t||!e,color:!t||!e?`permission`:void 0,children:[!t||!e?`> `:` `,e?`Enter a different repository`:`Enter repository`]})}),(!t||!e)&&(0,U.jsx)(_,{marginLeft:2,marginBottom:1,children:(0,U.jsx)(M,{value:n,onChange:e=>{r(e),d(!1)},onSubmit:m,focus:!0,placeholder:`Enter a repo as owner/repo or https://github.com/owner/repo…`,columns:p,cursorOffset:s,onChangeCursorOffset:l,showCursor:!0})})]}),u&&(0,U.jsx)(_,{marginLeft:3,marginBottom:1,children:(0,U.jsx)(c,{color:`error`,children:`Please enter a repository name to continue`})}),(0,U.jsx)(_,{marginLeft:3,children:(0,U.jsxs)(c,{dimColor:!0,children:[e?`↑/↓ to select · `:``,`Enter to continue`]})})]})}var H,U,Le=e((()=>{H=t(o(),1),k(),A(),p(),N(),U=v()}));function Re({currentWorkflowInstallStep:e,secretExists:t,useExistingSecret:n,secretName:r,skipWorkflow:i=!1,selectedWorkflows:a}){let o=i?[`Getting repository information`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`]:[`Getting repository information`,`Creating branch`,a.length>1?`Creating workflow files`:`Creating workflow file`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`,`Opening pull request page`];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,W.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,W.jsx)(c,{dimColor:!0,children:`Create GitHub Actions workflow`})]}),o.map((t,n)=>{let r=`pending`;return n<e?r=`completed`:n===e&&(r=`in-progress`),(0,W.jsx)(_,{children:(0,W.jsxs)(c,{color:r===`completed`?`success`:r===`in-progress`?`warning`:void 0,children:[r===`completed`?`✓ `:``,t,r===`in-progress`?`…`:``]})},n)})]})})}var W,ze=e((()=>{p(),W=v()}));function Be({error:e,errorReason:t,errorInstructions:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,G.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,G.jsx)(c,{bold:!0,children:`Install GitHub App`})}),(0,G.jsxs)(c,{color:`error`,children:[`Error: `,e]}),t&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`Reason: `,t]})}),n&&n.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(c,{dimColor:!0,children:`How to fix:`}),n.map((e,t)=>(0,G.jsxs)(_,{marginLeft:2,children:[(0,G.jsx)(c,{dimColor:!0,children:`• `}),(0,G.jsx)(c,{children:e})]},t))]}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`For manual setup instructions, see: `,(0,G.jsx)(c,{color:`claude`,children:I})]})})]}),(0,G.jsx)(_,{marginLeft:3,children:(0,G.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var G,Ve=e((()=>{L(),p(),G=v()}));function He({repoName:e,onSelectAction:t}){return(0,K.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(c,{bold:!0,children:`Existing Workflow Found`}),(0,K.jsxs)(c,{dimColor:!0,children:[`Repository: `,e]})]}),(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(c,{children:[`A Claude workflow file already exists at `,(0,K.jsx)(c,{color:`claude`,children:`.github/workflows/claude.yml`})]}),(0,K.jsx)(c,{dimColor:!0,children:`What would you like to do?`})]}),(0,K.jsx)(_,{flexDirection:`column`,children:(0,K.jsx)(ce,{options:[{label:`Update workflow file with latest version`,value:`update`},{label:`Skip workflow update (configure secrets only)`,value:`skip`},{label:`Exit without making changes`,value:`exit`}],onChange:e=>{t(e)},onCancel:()=>{t(`exit`)}})}),(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[`View the latest workflow template at:`,` `,(0,K.jsx)(c,{color:`claude`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml`})]})})]})}var K,Ue=e((()=>{he(),p(),K=v()}));function We({repoUrl:e,onSubmit:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,q.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,q.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,q.jsx)(c,{bold:!0,children:`Install the Claude GitHub App`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`Opening browser to install the Claude GitHub App…`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`If your browser doesn't open automatically, visit:`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{underline:!0,children:`https://github.com/apps/claude`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsxs)(c,{children:[`Please install the app for repository: `,(0,q.jsx)(c,{bold:!0,children:e})]})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{dimColor:!0,children:`Important: Make sure to grant access to this specific repository`})}),(0,q.jsx)(_,{children:(0,q.jsxs)(c,{bold:!0,color:`permission`,children:[`Press Enter once you've installed the app`,r.ellipsis]})}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(c,{dimColor:!0,children:[`Having trouble? See manual setup instructions at: `,(0,q.jsx)(c,{color:`claude`,children:I})]})})]})}var q,Ge=e((()=>{n(),L(),p(),N(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new le),[s,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)(!1),y=(0,J.useRef)(new Set),x=(0,J.useRef)(void 0),ee=i(),te=Math.max(50,ee.columns-30-4);function S(e){n.state===`error`&&(e.preventDefault(),e.key===`return`&&n.toRetry?(l(``),f(0),r({state:`about_to_retry`,nextState:n.toRetry})):t())}async function C(e,t){try{let[n,i]=e.split(`#`);if(!n||!i){r({state:`error`,message:`Invalid code. Please make sure the full code was copied`,toRetry:{state:`waiting_for_login`,url:t}});return}E(`tengu_oauth_manual_entry`,{}),o.handleManualAuthCodeInput({authorizationCode:n,state:i})}catch(e){D(e),r({state:`error`,message:e.message,toRetry:{state:`waiting_for_login`,url:t}})}}let w=(0,J.useCallback)(async()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear();try{let t=await o.startOAuthFlow(async e=>{r({state:`waiting_for_login`,url:e});let t=setTimeout(h,3e3,!0);y.current.add(t)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:365*24*60*60});r({state:`processing`}),b(t);let n=setTimeout((e,t,n,r)=>{e({state:`success`,token:t});let i=setTimeout(n,1e3,t);r.current.add(i)},100,r,t.accessToken,e,y);y.current.add(n)}catch(e){let t=e.message;r({state:`error`,message:t,toRetry:{state:`starting`}}),D(e),E(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&w()},[n.state,w]),(0,J.useEffect)(()=>{if(n.state===`about_to_retry`){let e=setTimeout((e,t,n)=>{t(e.state===`waiting_for_login`),n(e)},500,n.nextState,h,r);y.current.add(e)}},[n]),(0,J.useEffect)(()=>{s===`c`&&n.state===`waiting_for_login`&&p&&!g&&(m(n.url).then(e=>{e&&process.stdout.write(e),v(!0),clearTimeout(x.current),x.current=setTimeout(v,2e3,!1)}),l(``))},[s,n,p,g]),(0,J.useEffect)(()=>{let e=y.current;return()=>{o.cleanup(),e.forEach(e=>clearTimeout(e)),e.clear(),clearTimeout(x.current)}},[o]);function T(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Starting authentication…`})]});case`waiting_for_login`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[!p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Opening browser to sign in with your Claude account…`})]}),p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(c,{children:qe}),(0,Y.jsx)(M,{value:s,onChange:l,onSubmit:e=>C(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:te})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Processing authentication…`})]});case`success`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(c,{color:`success`,children:`✓ Authentication token created successfully!`}),(0,Y.jsx)(c,{dimColor:!0,children:`Using token for GitHub Actions setup…`})]});case`error`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(c,{color:`error`,children:[`OAuth error: `,n.message]}),n.toRetry?(0,Y.jsx)(c,{dimColor:!0,children:`Press Enter to try again, or any other key to cancel`}):(0,Y.jsx)(c,{dimColor:!0,children:`Press any key to return to API key selection`})]});case`about_to_retry`:return(0,Y.jsx)(_,{flexDirection:`column`,gap:1,children:(0,Y.jsx)(c,{color:`permission`,children:`Retrying…`})});default:return null}}return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[n.state===`starting`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]}),n.state!==`success`&&n.state!==`starting`&&n.state!==`processing`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]},`header`),n.state===`waiting_for_login`&&p&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsxs)(_,{paddingX:1,children:[(0,Y.jsx)(c,{dimColor:!0,children:`Browser didn't open? Use the url below to sign in `}),g?(0,Y.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,Y.jsx)(c,{dimColor:!0,children:(0,Y.jsx)(u,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,Y.jsx)(a,{url:n.url,children:(0,Y.jsx)(c,{dimColor:!0,children:n.url})})]},`urlToCopy`),(0,Y.jsx)(_,{paddingLeft:1,flexDirection:`column`,gap:1,children:T()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),T(),p(),ue(),k(),A(),me(),w(),oe(),Y=v(),qe=`Paste code here if prompted > `}));function Ye({secretExists:e,useExistingSecret:t,secretName:n,skipWorkflow:r=!1}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,X.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,X.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,X.jsx)(c,{dimColor:!0,children:`Success`})]}),!r&&(0,X.jsx)(c,{color:`success`,children:`✓ GitHub Actions workflow created!`}),e&&t&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{color:`success`,children:`✓ Using existing ANTHROPIC_API_KEY secret`})}),(!e||!t)&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsxs)(c,{color:`success`,children:[`✓ API key saved as `,n,` secret`]})}),(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{children:`Next steps:`})}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`2. Your workflow file was kept unchanged`}),(0,X.jsx)(c,{children:`3. API key is configured and ready to use`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. A pre-filled PR page has been created`}),(0,X.jsx)(c,{children:`2. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`3. Merge the PR to enable Claude PR assistance`})]})]}),(0,X.jsx)(_,{marginLeft:3,children:(0,X.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var X,Xe=e((()=>{o(),p(),X=v()}));async function Ze(e,t,n,r,i,a,o){let s=await O(`gh`,[`api`,`repos/${e}/contents/${n}`,`--jq`,`.sha`]),c=null;s.code===0&&(c=s.stdout.trim());let l=r;i===`CLAUDE_CODE_OAUTH_TOKEN`?l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}"):i!==`ANTHROPIC_API_KEY`&&(l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${i} }}`));let u=Buffer.from(l).toString(`base64`),d=[`api`,`--method`,`PUT`,`repos/${e}/contents/${n}`,`-f`,`message=${c?`"Update ${a}"`:`"${a}"`}`,`-f`,`content=${u}`,`-f`,`branch=${t}`];c&&d.push(`-f`,`sha=${c}`);let f=await O(`gh`,d);if(f.code!==0)throw f.stderr.includes(`422`)&&f.stderr.includes(`sha`)?(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`)):(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: ${f.stderr}
|
|
136
136
|
|
|
137
137
|
Need help? Common issues:
|
|
138
138
|
· Permission denied → Run: gh auth refresh -h github.com -s repo,workflow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n}from"./paths-q1-Ni8Oh.js";import{n as r,r as i}from"./analytics-DqMQntaB.js";import{n as a,t as o}from"./browser-fLRXxIsQ.js";async function s(){return i(`tengu_install_slack_app_clicked`,{}),n(e=>({...e,slackAppInstallCount:(e.slackAppInstallCount??0)+1})),await a(c)?{type:`text`,value:`Opening Slack app installation page in browser…`}:{type:`text`,value:`Couldn't open browser. Visit: ${c}`}}var c;e((()=>{r(),o(),t(),c=`https://slack.com/marketplace/A08SF47R6P4-claude`}))();export{s as call};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{n as o,o as s,r as c,x as ee}from"./esm-CJlBxjtx.js";import{Q as te,Z as ne,_ as l,at as u,c as d,i as re,j as f,n as ie,o as p,r as ae,t as m}from"./esm-DcdOXSzi.js";import{n as h,t as oe}from"./esm-BGQPWnJy.js";import{a as g,i as se,l as ce,n as le,r as ue}from"./esm-QgL6y---.js";import{n as de,t as fe}from"./axios-DhfaybwJ.js";import{$ as _,$n as v,Dr as pe,Gt as y,Pn as b,U as me,cn as x,ir as S,nt as he}from"./state-sIHsFpDu.js";import{Ac as C,At as w,Pc as ge,Qt as _e,Sc as T,Tt as ve,an as ye,bt as E,dn as D,dt as be,ft as O,gc as xe,jt as k,mt as A,no as Se,on as j,oo as Ce,pt as we,sn as Te,tn as M,wt as N}from"./paths-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{n as o,o as s,r as c,x as ee}from"./esm-CJlBxjtx.js";import{Q as te,Z as ne,_ as l,at as u,c as d,i as re,j as f,n as ie,o as p,r as ae,t as m}from"./esm-DcdOXSzi.js";import{n as h,t as oe}from"./esm-BGQPWnJy.js";import{a as g,i as se,l as ce,n as le,r as ue}from"./esm-QgL6y---.js";import{n as de,t as fe}from"./axios-DhfaybwJ.js";import{$ as _,$n as v,Dr as pe,Gt as y,Pn as b,U as me,cn as x,ir as S,nt as he}from"./state-sIHsFpDu.js";import{Ac as C,At as w,Pc as ge,Qt as _e,Sc as T,Tt as ve,an as ye,bt as E,dn as D,dt as be,ft as O,gc as xe,jt as k,mt as A,no as Se,on as j,oo as Ce,pt as we,sn as Te,tn as M,wt as N}from"./paths-q1-Ni8Oh.js";import{E as P,K as Ee,L as F,V as I,X as L,Y as De,a as Oe,d as R,s as z,w as ke}from"./debug-UI3T040K.js";import{d as Ae,f as je,o as B,s as V}from"./log-CzsijfHZ.js";import{a as Me,i as Ne,o as Pe}from"./platform-CuyedWpe.js";import{r as Fe,t as Ie}from"./memoize-DxwLawI2.js";import{a as Le,n as Re}from"./startupProfiler-DnXZaX4A.js";import{b as H,d as ze,g as Be,m as Ve,s as He,u as Ue,v as U,x as We,y as Ge}from"./proxy-CfZp-wce.js";import{_ as Ke,b as qe,c as Je,l as Ye,r as W,v as Xe,y as Ze}from"./sessionTracing-BkzKJi0v.js";import{a as G,i as K,r as Qe,t as $e}from"./esm-C-1qL9Mn.js";async function et(){let e=E();if(e.error)throw Error(`Auth error: ${e.error}`);let t={"Content-Type":`application/json`,"User-Agent":w(),...e.headers};return(await de.get(`https://api.anthropic.com/api/claude_code/organizations/metrics_enabled`,{headers:t,timeout:5e3})).data}async function tt(){if(je())return{enabled:!1,hasError:!1};try{let e=await ve(et,{also403Revoked:!0});return R(`Metrics opt-out API response: enabled=${e.metrics_logging_enabled}`),{enabled:e.metrics_logging_enabled,hasError:!1}}catch(e){return R(`Failed to check metrics opt-out status: ${F(e)}`),V(e),{enabled:!1,hasError:!0}}}async function nt(){let e=await at();if(e.hasError)return e;let t=T().metricsStatusCache;return t!==void 0&&t.enabled===e.enabled&&Date.now()-t.timestamp<q||ge(t=>({...t,metricsStatusCache:{enabled:e.enabled,timestamp:Date.now()}})),e}async function rt(){if(D()&&!ye())return{enabled:!1,hasError:!1};let e=T().metricsStatusCache;return e?(Date.now()-e.timestamp>q&&nt().catch(V),{enabled:e.enabled,hasError:!1}):nt()}var it,q,at,ot=e((()=>{fe(),j(),C(),z(),I(),N(),B(),Ie(),Ae(),k(),it=3600*1e3,q=1440*60*1e3,at=Fe(tt,it)})),st,ct=e((()=>{d(),le(),fe(),ot(),x(),j(),C(),z(),I(),N(),B(),ke(),k(),i(),st=class{constructor(e={}){a(this,`endpoint`,void 0),a(this,`timeout`,void 0),a(this,`pendingExports`,[]),a(this,`isShutdown`,!1),process.env.USER_TYPE===`ant`&&process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT?this.endpoint=process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT+`/api/claude_code/metrics`:this.endpoint=`https://api.anthropic.com/api/claude_code/metrics`,this.timeout=e.timeout||5e3}async export(e,t){if(this.isShutdown){t({code:l.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{if(!(xe()||me())){R(`BigQuery metrics export: trust not established, skipping`),t({code:l.SUCCESS});return}if(!(await rt()).enabled){R(`Metrics export disabled by organization setting`),t({code:l.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=E();if(r.error){R(`Metrics export failed: ${r.error}`),t({code:l.FAILED,error:Error(r.error)});return}let i={"Content-Type":`application/json`,"User-Agent":w(),...r.headers},a=await de.post(this.endpoint,n,{timeout:this.timeout,headers:i});R(`BigQuery metrics exported successfully`),R(`BigQuery API Response: ${P(a.data,null,2)}`),t({code:l.SUCCESS})}catch(e){R(`BigQuery metrics export failed: ${F(e)}`),V(e),t({code:l.FAILED,error:Ee(e)})}}transformMetricsForInternal(e){let t=e.resource.attributes,n={"service.name":t[`service.name`]||`claude-code`,"service.version":t[`service.version`]||`unknown`,"os.type":t[`os.type`]||`unknown`,"os.version":t[`os.version`]||`unknown`,"host.arch":t[`host.arch`]||`unknown`,"aggregation.temporality":this.selectAggregationTemporality()===ce.DELTA?`delta`:`cumulative`};if(t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),D()){n[`user.customer_type`]=`claude_ai`;let e=M();e&&(n[`user.subscription_type`]=e)}else n[`user.customer_type`]=`api`;return{resource_attributes:n,metrics:e.scopeMetrics.flatMap(e=>e.metrics.map(e=>({name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit,data_points:this.extractDataPoints(e)})))}}extractDataPoints(e){return(e.dataPoints||[]).filter(e=>typeof e.value==`number`).map(e=>({attributes:this.convertAttributes(e.attributes),value:e.value,timestamp:this.hrTimeToISOString(e.endTime||e.startTime||[Date.now()/1e3,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),R(`BigQuery metrics exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),R(`BigQuery metrics exporter flush complete`)}convertAttributes(e){let t={};if(e)for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}hrTimeToISOString(e){let[t,n]=e;return new Date(t*1e3+n/1e6).toISOString()}selectAggregationTemporality(){return ce.DELTA}}})),lt,ut=e((()=>{z(),B(),lt=class{error(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}}}));function J(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new $(t)),e,r,t).unref()})}function dt(){process.env.USER_TYPE===`ant`&&(process.env.ANT_OTEL_METRICS_EXPORTER&&(process.env.OTEL_METRICS_EXPORTER=process.env.ANT_OTEL_METRICS_EXPORTER),process.env.ANT_OTEL_LOGS_EXPORTER&&(process.env.OTEL_LOGS_EXPORTER=process.env.ANT_OTEL_LOGS_EXPORTER),process.env.ANT_OTEL_TRACES_EXPORTER&&(process.env.OTEL_TRACES_EXPORTER=process.env.ANT_OTEL_TRACES_EXPORTER),process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL&&(process.env.OTEL_EXPORTER_OTLP_PROTOCOL=process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL),process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT&&(process.env.OTEL_EXPORTER_OTLP_ENDPOINT=process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT),process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS&&(process.env.OTEL_EXPORTER_OTLP_HEADERS=process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS)),process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function Y(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function ft(){let e=Y(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||St.toString(),10),r=[];for(let n of e)if(n===`console`){let e=new se,t=e.export.bind(e);e.export=(e,n)=>(e.resource&&e.resource.attributes&&(R(`
|
|
2
2
|
=== Resource Attributes ===`),R(P(e.resource.attributes)),R(`===========================
|
|
3
|
-
`)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=X();switch(e){case`grpc`:{let{OTLPMetricExporter:e}=await import(`./src-BRC_BuUP.js`).then(e=>t(e.default,1));r.push(new e);break}case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-B2HIF0XY.js`);r.push(new e(n));break}case`http/protobuf`:{let{OTLPMetricExporter:e}=await import(`./esm-DxPW7qPs.js`);r.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:e}=await import(`./src-DsMd9Q9e.js`).then(e=>t(e.default,1));r.push(new e)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new g({exporter:e,exportIntervalMillis:n}):e)}async function pt(){let e=Y(process.env.OTEL_LOGS_EXPORTER),n=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;R(`[3P telemetry] getOtlpLogExporters: types=${P(e)}, protocol=${n}, endpoint=${r}`);let i=[];for(let r of e)if(r===`console`)i.push(new we);else if(r===`otlp`){let e=X();switch(n){case`grpc`:{let{OTLPLogExporter:e}=await import(`./src-CYLfL70h.js`).then(e=>t(e.default,1));i.push(new e);break}case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm--xjzB1hI.js`);i.push(new t(e));break}case`http/protobuf`:{let{OTLPLogExporter:t}=await import(`./esm-v0kPjgVS.js`);i.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${r}`);return i}async function mt(){let e=Y(process.env.OTEL_TRACES_EXPORTER),n=[];for(let r of e)if(r===`console`)n.push(new Qe);else if(r===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=X();switch(e){case`grpc`:{let{OTLPTraceExporter:e}=await import(`./src-DJXCzwyJ.js`).then(e=>t(e.default,1));n.push(new e);break}case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-C97WL9nC.js`);n.push(new e(r));break}case`http/protobuf`:{let{OTLPTraceExporter:e}=await import(`./esm-FBUWr3vI.js`);n.push(new e(r));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${r}`);return n}function ht(){return r(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function gt(){return new g({exporter:new st,exportIntervalMillis:300*1e3})}function _t(){let e=M(),t=D()&&(e===`enterprise`||e===`team`);return Te()||t}async function vt(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-C97WL9nC.js`),import(`./esm--xjzB1hI.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new K({resource:e,spanProcessors:[new G(new n(i),{scheduledDelayMillis:Q})]});c.setGlobalTracerProvider(o),pe(o);let s=new A({resource:e,processors:[new O(new r(a),{scheduledDelayMillis:Z})]});h.setGlobalLoggerProvider(s),v(s),b(h.getLogger(`com.anthropic.claude_code.events`,`2.6.
|
|
3
|
+
`)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=X();switch(e){case`grpc`:{let{OTLPMetricExporter:e}=await import(`./src-BRC_BuUP.js`).then(e=>t(e.default,1));r.push(new e);break}case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-B2HIF0XY.js`);r.push(new e(n));break}case`http/protobuf`:{let{OTLPMetricExporter:e}=await import(`./esm-DxPW7qPs.js`);r.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:e}=await import(`./src-DsMd9Q9e.js`).then(e=>t(e.default,1));r.push(new e)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new g({exporter:e,exportIntervalMillis:n}):e)}async function pt(){let e=Y(process.env.OTEL_LOGS_EXPORTER),n=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;R(`[3P telemetry] getOtlpLogExporters: types=${P(e)}, protocol=${n}, endpoint=${r}`);let i=[];for(let r of e)if(r===`console`)i.push(new we);else if(r===`otlp`){let e=X();switch(n){case`grpc`:{let{OTLPLogExporter:e}=await import(`./src-CYLfL70h.js`).then(e=>t(e.default,1));i.push(new e);break}case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm--xjzB1hI.js`);i.push(new t(e));break}case`http/protobuf`:{let{OTLPLogExporter:t}=await import(`./esm-v0kPjgVS.js`);i.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${r}`);return i}async function mt(){let e=Y(process.env.OTEL_TRACES_EXPORTER),n=[];for(let r of e)if(r===`console`)n.push(new Qe);else if(r===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=X();switch(e){case`grpc`:{let{OTLPTraceExporter:e}=await import(`./src-DJXCzwyJ.js`).then(e=>t(e.default,1));n.push(new e);break}case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-C97WL9nC.js`);n.push(new e(r));break}case`http/protobuf`:{let{OTLPTraceExporter:e}=await import(`./esm-FBUWr3vI.js`);n.push(new e(r));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${r}`);return n}function ht(){return r(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function gt(){return new g({exporter:new st,exportIntervalMillis:300*1e3})}function _t(){let e=M(),t=D()&&(e===`enterprise`||e===`team`);return Te()||t}async function vt(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-C97WL9nC.js`),import(`./esm--xjzB1hI.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new K({resource:e,spanProcessors:[new G(new n(i),{scheduledDelayMillis:Q})]});c.setGlobalTracerProvider(o),pe(o);let s=new A({resource:e,processors:[new O(new r(a),{scheduledDelayMillis:Z})]});h.setGlobalLoggerProvider(s),v(s),b(h.getLogger(`com.anthropic.claude_code.events`,`2.6.9`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function yt(){if(Le(`telemetry_init_start`),dt(),Oe())for(let e of[`OTEL_METRICS_EXPORTER`,`OTEL_LOGS_EXPORTER`,`OTEL_TRACES_EXPORTER`]){let t=process.env[e];t?.includes(`console`)&&(process.env[e]=t.split(`,`).map(e=>e.trim()).filter(e=>e!==`console`).join(`,`))}s.setLogger(new lt,ee.ERROR),qe();let e=[],t=ht();R(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await ft()),_t()&&e.push(gt());let n=Ne(),r={[ne]:`claude-code`,[te]:`2.6.9`};if(n===`wsl`){let e=Me();e&&(r[`wsl.version`]=e)}let i=p(r),a=p(ie.detect().attributes||{}),o=ae.detect(),l=p(o.attributes?.[`host.arch`]?{[u]:o.attributes[u]}:{}),d=p(re.detect().attributes||{}),f=i.merge(a).merge(l).merge(d);if(Xe()){vt(f).catch(e=>R(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new ue({resource:f,views:[],readers:e});return S(t),L(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let n=_(),r=y(),i=[t.shutdown()];n&&i.push(n.forceFlush().then(()=>n.shutdown())),r&&i.push(r.forceFlush().then(()=>r.shutdown())),await Promise.race([Promise.all(i),J(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`2.6.9`)}let m=new ue({resource:f,views:[],readers:e});if(S(m),t){let e=await pt();if(R(`[3P telemetry] Created ${e.length} log exporter(s)`),e.length>0){let t=new A({resource:f,processors:e.map(e=>new O(e,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10)}))});h.setGlobalLoggerProvider(t),v(t),b(h.getLogger(`com.anthropic.claude_code.events`,`2.6.9`)),R(`[3P telemetry] Event logger set successfully`),process.on(`beforeExit`,async()=>{await t?.forceFlush(),await y()?.forceFlush()}),process.on(`exit`,()=>{t?.forceFlush(),y()?.forceFlush()})}}if(t&&Ye()){let e=await mt();if(e.length>0){let t=new K({resource:f,spanProcessors:e.map(e=>new G(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||Q.toString(),10)}))});c.setGlobalTracerProvider(t),pe(t)}}return L(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let t=[m.shutdown()],n=_();n&&t.push(n.shutdown());let r=y();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),J(e,`OpenTelemetry shutdown timeout`)])}catch(t){throw t instanceof Error&&t.message.includes(`timeout`)&&R(`
|
|
4
4
|
OpenTelemetry telemetry flush timed out after ${e}ms
|
|
5
5
|
|
|
6
6
|
To resolve this issue, you can:
|
|
@@ -9,4 +9,4 @@ To resolve this issue, you can:
|
|
|
9
9
|
3. Disable OpenTelemetry by unsetting CLAUDE_CODE_ENABLE_TELEMETRY env var
|
|
10
10
|
|
|
11
11
|
Current timeout: ${e}ms
|
|
12
|
-
`,{level:`error`}),t}}),m.getMeter(`com.anthropic.claude_code`,`2.6.
|
|
12
|
+
`,{level:`error`}),t}}),m.getMeter(`com.anthropic.claude_code`,`2.6.9`)}async function bt(){let e=he();if(!e)return;let t=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||`5000`,10);try{let n=[e.forceFlush()],r=_();r&&n.push(r.forceFlush());let i=y();i&&n.push(i.forceFlush()),await Promise.race([Promise.all(n),J(t,`OpenTelemetry flush timeout`)]),R(`Telemetry flushed successfully`)}catch(e){e instanceof $?R(`Telemetry flush timed out after ${t}ms. Some metrics may not be exported.`,{level:`warn`}):R(`Telemetry flush failed: ${F(e)}`,{level:`error`})}}function xt(){let e={},t=process.env.OTEL_EXPORTER_OTLP_HEADERS;if(t)for(let n of t.split(`,`)){let[t,...r]=n.split(`=`);t&&r.length>0&&(e[t.trim()]=r.join(`=`).trim())}return e}function X(){let e=He(),t=Ve(),n=Se(),r={},i=xt();n?.otelHeadersHelper?r.headers=async()=>{let e=_e();return{...i,...e}}:Object.keys(i).length>0&&(r.headers=async()=>i);let a=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||a&&ze(a)){let e=U();return(t||e)&&(r.httpAgentOptions={...t,...e&&{ca:e}}),r}let o=U();return r.httpAgentOptions=n=>t||o?new H(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...o&&{ca:o}}):new H(e),r}var St,Z,Q,$;e((()=>{o(),oe(),m(),be(),le(),$e(),f(),We(),x(),j(),Pe(),Ge(),De(),z(),n(),I(),Be(),Ue(),Ce(),ke(),Re(),Ke(),ct(),ut(),Ze(),Je(),St=6e4,Z=5e3,Q=5e3,$=class extends Error{}}))();export{bt as flushTelemetry,yt as initializeTelemetry};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,n){let r=n?n.trim().split(/\s+/):[],i=r[0]||`list`,a=[],o=console.log,s=console.error;console.log=(...e)=>a.push(e.map(String).join(` `)),console.error=(...e)=>a.push(e.map(String).join(` `));try{let{templatesMain:e}=await import(`./templateJobs-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,n){let r=n?n.trim().split(/\s+/):[],i=r[0]||`list`,a=[],o=console.log,s=console.error;console.log=(...e)=>a.push(e.map(String).join(` `)),console.error=(...e)=>a.push(e.map(String).join(` `));try{let{templatesMain:e}=await import(`./templateJobs-V2-TVeGE.js`);await e([i,...r.slice(1)])}finally{console.log=o,console.error=s}return e(a.join(`
|
|
2
2
|
`)||`Done.`,{display:`system`}),null}e((()=>{}))();export{t as call};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,R as n,V as r,w as i}from"./debug-UI3T040K.js";import{
|
|
2
|
-
`}var b=e((()=>{i(),
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{E as t,R as n,V as r,w as i}from"./debug-UI3T040K.js";import{_T as a,dT as o,gT as s,lT as c,mT as l,uT as u,vT as d,yT as f}from"./loadAgentsDir-Cl2w3uvH.js";import{r as p,t as m}from"./promptEditor-ClGwMkWl.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(l.map(e=>a(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(a(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return t({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(d)},null,2)+`
|
|
2
|
+
`}var b=e((()=>{i(),f(),s()}));async function x(){if(!o())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=c(),t=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(n(e)===`EEXIST`)t=!0;else throw e}let r=await m(e);return r.error?{type:`text`,value:`${t?`Opened`:`Created`} ${e}. Could not open in editor: ${r.error}`}:{type:`text`,value:t?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{u(),b(),r(),p()}))();export{x as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-q1-Ni8Oh.js";import{n as i,r as a,t as o}from"./language-sTn9sA3E.js";async function s(e,t,a){let s=a.trim().toLowerCase();if(!s){let t=r().preferredLanguage??`auto`,n=i(),a=t===`auto`?` → ${o(n)}`:``;return e(`Language: ${o(t)}${a}`,{display:`system`}),null}if(!c.includes(s))return e(`Invalid language "${s}". Use: en, zh, or auto`,{display:`system`}),null;let l=s;n(e=>({...e,preferredLanguage:l}));let u=i(),d=l===`auto`?` → ${o(u)}`:``;return e(`Language set to ${o(l)}${d}`,{display:`system`}),null}var c;e((()=>{t(),a(),c=[`en`,`zh`,`auto`]}))();export{s as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./language-sTn9sA3E.js";t();export{e as getResolvedLanguage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ac as t,Sc as n}from"./paths-q1-Ni8Oh.js";import{i as r,s as i}from"./intl-Pse97ORk.js";function a(){let e=n().preferredLanguage??`auto`;return e===`en`||e===`zh`?e:r()===`zh`?`zh`:`en`}function o(e){return s[e]??e}var s,c=e((()=>{t(),i(),s={auto:`Auto (follow system)`,en:`English`,zh:`中文`}}));export{a as n,c as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{i as f,n as p,r as m}from"./cron-DiW7eIPP.js";import{o as h,u as g}from"./api-
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{i as f,n as p,r as m}from"./cron-DiW7eIPP.js";import{o as h,u as g}from"./api-DLLVkmRJ.js";import{n as _,r as v}from"./hostGuard-zim_4F9V.js";import{n as y,t as b}from"./launchCommand-Du91jxMC.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e;try{e=(await g()).apiKey}catch(e){throw new N(e instanceof Error?e.message:String(e),501)}return _(C()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":j,"content-type":`application/json`}}function C(){return`${u().BASE_API_URL}/v1/agents`}function w(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new N(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new N(`Subscription required. Scheduled agents require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new N(`Agent not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new N(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new N((e.response?.data)?.error?.message??e.message,t)}return e instanceof N?e:new N(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let n;for(let r=0;r<M;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){n=i,r<M-1&&await x(T(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new N(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await t.get(C(),{headers:e})).data.data??[]})}async function O(e,n){return E(async()=>{let r=await S();return(await t.post(C(),{cron_expr:e,prompt:n,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`},{headers:r})).data})}async function k(e){return E(async()=>{let n=await S();await t.delete(`${C()}/${e}`,{headers:n})})}async function A(e){return E(async()=>{let n=await S();return(await t.post(`${C()}/${e}/run`,{},{headers:n})).data})}var j,M,N,P=e((()=>{n(),d(),v(),h(),j=`managed-agents-2026-04-01`,M=3,N=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`AgentsApiError`}}}));function F({agent:e}){let t=p(e.cron_expr,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`;return(0,L.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(o,{children:[(0,L.jsx)(i,{bold:!0,children:e.id}),(0,L.jsx)(i,{dimColor:!0,children:` · `}),(0,L.jsx)(i,{color:`suggestion`,children:e.status})]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Next run: `,n]})]})}function I(e){if(e.mode===`list`)return e.agents.length===0?(0,L.jsx)(o,{children:(0,L.jsx)(i,{dimColor:!0,children:`No scheduled agents. Use /agents-platform create <cron> <prompt> to create one.`})}):(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{marginBottom:1,children:(0,L.jsxs)(i,{bold:!0,children:[`Scheduled Agents (`,e.agents.length,`)`]})}),e.agents.map(e=>(0,L.jsx)(F,{agent:e},e.id))]});if(e.mode===`created`){let t=p(e.agent.cron_expr,{utc:!0});return(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsx)(i,{bold:!0,color:`success`,children:`Agent created`})}),(0,L.jsxs)(i,{children:[`ID: `,e.agent.id]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{children:[`Prompt: `,e.agent.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Status: `,e.agent.status]})]})}return e.mode===`deleted`?(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` deleted.`]})}):e.mode===`ran`?(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` triggered.`]})}),(0,L.jsxs)(i,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):(0,L.jsx)(o,{children:(0,L.jsx)(i,{color:`error`,children:e.message})})}var L,R=e((()=>{r(),a(),m(),L=s()}));function z(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function B(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run daily standup`};let e=z(i);if(!e)return{action:`invalid`,reason:`create requires at least 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run daily standup`};let{cron:t,prompt:n}=e;return n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires an agent id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires an agent id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". Use: list | create CRON PROMPT | delete ID | run ID`}}var V=e((()=>{}));async function H(e,t){if(e.action===`list`){l(`tengu_agents_platform_list`,{});try{let e=await D();return t(e.length===0?`No scheduled agents found.`:`${e.length} scheduled agent(s).`,{display:`system`}),{mode:`list`,agents:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to list agents: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`create`){let{cron:n,prompt:r}=e;if(!f(n)){let e=`Invalid cron expression: "${n}". Expected 5 fields (minute hour day month weekday).`;return l(`tengu_agents_platform_failed`,{reason:e}),t(e,{display:`system`}),null}l(`tengu_agents_platform_create`,{cron:n});try{let e=await O(n,r);return t(`Agent created: ${e.id}`,{display:`system`}),{mode:`created`,agent:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to create agent: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete`){let{id:n}=e;l(`tengu_agents_platform_delete`,{id:n});try{return await k(n),t(`Agent ${n} deleted.`,{display:`system`}),{mode:`deleted`,id:n}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to delete agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{id:n}=e;l(`tengu_agents_platform_run`,{id:n});try{let e=await A(n);return t(`Agent ${n} triggered. Run ID: ${e.run_id}`,{display:`system`}),{mode:`ran`,id:n,runId:e.run_id}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to run agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}var U;e((()=>{c(),m(),P(),R(),V(),b(),U=y({commandName:`agents-platform`,parseArgs:e=>{l(`tengu_agents_platform_started`,{args:e});let t=B(e);return t.action===`invalid`?(l(`tengu_agents_platform_failed`,{reason:t.reason}),{action:`invalid`,reason:`Usage: /agents-platform list | create CRON PROMPT | delete ID | run ID\n${t.reason}`}):t},dispatch:H,View:I,errorView:e=>null})}))();export{U as callAgentsPlatform};
|