claude-code-best 2.7.0 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/AddWorkspaceDirectory-V2tF7iCY.js +1 -0
- package/dist/chunks/App-DLdRpU7c.js +1 -0
- package/dist/chunks/ApproveApiKey-B7_TCGwt.js +1 -0
- package/dist/chunks/ApproveApiKey-DPws3jax.js +1 -0
- package/dist/chunks/AssistantSessionChooser-D6rS0OVe.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-hGlbm5z5.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-CuEpdRVd.js +1 -0
- package/dist/chunks/ClaudeInChromeOnboarding-CTTKMRbt.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-B-GkVoA_.js +1 -0
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DxJK9NiM.js +1 -0
- package/dist/chunks/ConsoleOAuthFlow-LPZ97jsm.js +1 -0
- package/dist/chunks/DesktopHandoff-BjPylhOT.js +1 -0
- package/dist/chunks/DevChannelsDialog-c4YVqBX9.js +1 -0
- package/dist/chunks/DiffDialog-I5wuXw2C.js +3 -0
- package/dist/chunks/Doctor-Cr_MlSPc.js +3 -0
- package/dist/chunks/Doctor-hgf3dMAW.js +1 -0
- package/dist/chunks/ExitFlow-Bz5grDWv.js +2 -0
- package/dist/chunks/Feedback-COgMI5tY.js +2 -0
- package/dist/chunks/Grove-Bwmghb-e.js +1 -0
- package/dist/chunks/Grove-m57x4tY1.js +11 -0
- package/dist/chunks/HybridTransport-Bok4-Ptt.js +4 -0
- package/dist/chunks/ITermBackend-BBSP-NNa.js +1 -0
- package/dist/chunks/InvalidConfigDialog-uTSuSBvO.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-B-Os12-H.js +1 -0
- package/dist/chunks/MCPConnectionManager-y97Inszc.js +1 -0
- package/dist/chunks/McpParsingWarnings-DMFUZw92.js +1 -0
- package/dist/chunks/MessageSelector-DwdAC2io.js +3 -0
- package/dist/chunks/Messages-FEBcX-cT.js +11 -0
- package/dist/chunks/Onboarding-B8qMJaBh.js +1 -0
- package/dist/chunks/OverageCreditUpsell-DnFv5z-z.js +1 -0
- package/dist/chunks/PluginSettings-B_xVgTTp.js +17 -0
- package/dist/chunks/PromptInputFooterSuggestions-DhIQ0Nge.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-CoMkWchC.js +1 -0
- package/dist/chunks/QueryEngine-C7r7O-hH.js +1 -0
- package/dist/chunks/REPL-CmJdJrGO.js +147 -0
- package/dist/chunks/REPL-nP7H_-qa.js +1 -0
- package/dist/chunks/RemoteCallout-4JOZROfT.js +1 -0
- package/dist/chunks/RemoteSessionManager-jcPnywfY.js +2 -0
- package/dist/chunks/ResumeConversation-CZ2Uedkf.js +1 -0
- package/dist/chunks/SSETransport-kEH_p4Yq.js +4 -0
- package/dist/chunks/SearchExtraToolsTool-C64oVFUD.js +1 -0
- package/dist/chunks/SentryErrorBoundary-2E2qGV11.js +1 -0
- package/dist/chunks/SentryErrorBoundary-97iY7Nb7.js +2 -0
- package/dist/chunks/Settings-CuljH0mu.js +2 -0
- package/dist/chunks/TeleportProgress-Ctdqi7iS.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-DyTBg1YD.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-B66clYsG.js +1 -0
- package/dist/chunks/ThemePicker-WKmYvrqz.js +1 -0
- package/dist/chunks/TmuxBackend-OKX2NP14.js +9 -0
- package/dist/chunks/TrustDialog-0anSIf-G.js +1 -0
- package/dist/chunks/TungstenTool-B40YHYXC.js +1 -0
- package/dist/chunks/ValidationErrorsList-CfgC1KJb.js +2 -0
- package/dist/chunks/WelcomeV2-BMHXiNt3.js +1 -0
- package/dist/chunks/WindowsTerminalBackend-fCSGVe4W.js +2 -0
- package/dist/chunks/add-dir-CMtuW667.js +1 -0
- package/dist/chunks/agentDisplay-CgYKW3G7.js +1 -0
- package/dist/chunks/agents-CdqcGm9o.js +103 -0
- package/dist/chunks/agents-D90TsYOf.js +2 -0
- package/dist/chunks/ant-DZjimiuz.js +1 -0
- package/dist/chunks/api-CQWbpxLP.js +1 -0
- package/dist/chunks/api-quOYYOhi.js +1 -0
- package/dist/chunks/asciicast-C_1Pi99k.js +4 -0
- package/dist/chunks/asciicast-DA6TudSH.js +1 -0
- package/dist/chunks/assistant-B5_xx00q.js +1 -0
- package/dist/chunks/assistant-CEmC_DlU.js +1 -0
- package/dist/chunks/assistant-CyVcFPIR.js +1 -0
- package/dist/chunks/auth-CjtaiRtF.js +1 -0
- package/dist/chunks/auth-DsQEVs9W.js +1 -0
- package/dist/chunks/autoMode-DEbM9UaE.js +45 -0
- package/dist/chunks/autonomy-Clap6Swl.js +1 -0
- package/dist/chunks/autonomy-lNpGnyiu.js +19 -0
- package/dist/chunks/autonomyPanel-BqEvfI0e.js +1 -0
- package/dist/chunks/backgroundHousekeeping-D-jt-ocx.js +1 -0
- package/dist/chunks/backgroundHousekeeping-KvOpP_4M.js +17 -0
- package/dist/chunks/banner-D9Cq292T.js +2 -0
- package/dist/chunks/bg-CngkAkgc.js +1 -0
- package/dist/chunks/bg-DgpgS_VU.js +9 -0
- package/dist/chunks/branch-CSYB04xC.js +3 -0
- package/dist/chunks/break-cache-DrIa8RdW.js +8 -0
- package/dist/chunks/bridge-DDgASypO.js +2 -0
- package/dist/chunks/bridgeConfig-BdZVEqhx.js +1 -0
- package/dist/chunks/bridgeConfig-DjC4oig1.js +1 -0
- package/dist/chunks/bridgeEnabled-Csn6Ym3k.js +1 -0
- package/dist/chunks/bridgeEnabled-DLRIH243.js +1 -0
- package/dist/chunks/bridgeMain-B5wsmwkN.js +68 -0
- package/dist/chunks/bridgeMain-BN0Sag35.js +1 -0
- package/dist/chunks/bridgeMessaging-ChOzzVWj.js +1 -0
- package/dist/chunks/bridgePointer-Clcvh52n.js +1 -0
- package/dist/chunks/browser-Bt-ckCaU.js +1 -0
- package/dist/chunks/btw-BgjcOoeo.js +1 -0
- package/dist/chunks/buddy-C1wE3noR.js +3 -0
- package/dist/chunks/bypassPermissionsKillswitch-C0diGLRB.js +1 -0
- package/dist/chunks/caches-CIoVGP24.js +3 -0
- package/dist/chunks/caches-DMYdTEAr.js +1 -0
- package/dist/chunks/ccrClient-C1msT1E3.js +1 -0
- package/dist/chunks/changeDetector-DoOBZOt1.js +1 -0
- package/dist/chunks/channelNotification-CWlu9ZWs.js +1 -0
- package/dist/chunks/channelNotification-oZ6vG5R5.js +1 -0
- package/dist/chunks/chrome-Bo9uNZ7s.js +1 -0
- package/dist/chunks/chromeNativeHost-BldB1Zzi.js +1 -0
- package/dist/chunks/claudeDesktop-BqTW_pbB.js +1 -0
- package/dist/chunks/cleanup-rCLlo4w8.js +1 -0
- package/dist/chunks/clear-BxdX_MUP.js +1 -0
- package/dist/chunks/cliLaunch-Citfs01Q.js +1 -0
- package/dist/chunks/client-BSoJ_vaA.js +1 -0
- package/dist/chunks/color-CkzktPHt.js +1 -0
- package/dist/chunks/commands-hyVX9-Lh.js +1 -0
- package/dist/chunks/commitAttribution-BwT0TbYF.js +1 -0
- package/dist/chunks/commitAttribution-csu3NO7Y.js +2 -0
- package/dist/chunks/common-Bi4yZBkh.js +1 -0
- package/dist/chunks/common-Da57Qwms.js +1 -0
- package/dist/chunks/common-NEOWMwtB.js +1 -0
- package/dist/chunks/compact-DNGIVZRN.js +3 -0
- package/dist/chunks/companion-Diuav3lA.js +1 -0
- package/dist/chunks/completionCache-BQgiR45Q.js +1 -0
- package/dist/chunks/completionCache-C7hDqIDL.js +4 -0
- package/dist/chunks/config-B25IrkTA.js +1 -0
- package/dist/chunks/config-ODoYZY8i.js +1 -0
- package/dist/chunks/context-CZ5enuPE.js +1 -0
- package/dist/chunks/context-noninteractive-62P5EnN5.js +54 -0
- package/dist/chunks/context-noninteractive-CjuzL9q5.js +1 -0
- package/dist/chunks/conversation-DyhWeHw2.js +1 -0
- package/dist/chunks/conversation-uY-V0SNK.js +1 -0
- package/dist/chunks/copy-9JLr2-Xs.js +7 -0
- package/dist/chunks/createSSHSession-B1hTuDpB.js +6 -0
- package/dist/chunks/createSession-Qurw-N4x.js +1 -0
- package/dist/chunks/createSession-fzjzy0aS.js +1 -0
- package/dist/chunks/cron-DwR6OJuW.js +1 -0
- package/dist/chunks/cronJitterConfig-9OmmYmIT.js +6 -0
- package/dist/chunks/crossProjectResume-B6efoIur.js +40 -0
- package/dist/chunks/daemon-BRKR4D1D.js +2 -0
- package/dist/chunks/datadog-C-llbwzP.js +1 -0
- package/dist/chunks/datadog-SSxsxcC-.js +1 -0
- package/dist/chunks/desktop-CQnMcbex.js +1 -0
- package/dist/chunks/detached-C_2ZXr7X.js +5 -0
- package/dist/chunks/detectRepository-2ICvGD0U.js +1 -0
- package/dist/chunks/detectRepository-BLwSmun2.js +1 -0
- package/dist/chunks/detection-0mMj--Bt.js +1 -0
- package/dist/chunks/detection-95TCHkW8.js +1 -0
- package/dist/chunks/diff-uAwKYa51.js +1 -0
- package/dist/chunks/directoryCompletion-DqtWZsoW.js +1 -0
- package/dist/chunks/doctor-CBF0fkBF.js +1 -0
- package/dist/chunks/earlyInput-CFYRGxau.js +2 -0
- package/dist/chunks/earlyInput-D3OhUZ4G.js +1 -0
- package/dist/chunks/effort-F-bhAM2u.js +9 -0
- package/dist/chunks/entry-DHN_Gr1b.js +14 -0
- package/dist/chunks/env-C2A9gV_G.js +1 -0
- package/dist/chunks/envLessBridgeConfig-CDVtIEWT.js +1 -0
- package/dist/chunks/envLessBridgeConfig-Dg0hNsdi.js +1 -0
- package/dist/chunks/execFileNoThrow-azCkYhmF.js +1 -0
- package/dist/chunks/executor-BVh1PTF-.js +1561 -0
- package/dist/chunks/executor-CvTuHx-k.js +1 -0
- package/dist/chunks/exit-CqcvZJwI.js +1 -0
- package/dist/chunks/export-c6WoGlsG.js +2 -0
- package/dist/chunks/exportRenderer-CaegIP5N.js +1 -0
- package/dist/chunks/extra-usage-Cj8fokgc.js +1 -0
- package/dist/chunks/extra-usage-Dk-wcvAu.js +1 -0
- package/dist/chunks/extra-usage-core-sHzc4eE1.js +1 -0
- package/dist/chunks/extra-usage-noninteractive-D0kqrqsg.js +1 -0
- package/dist/chunks/extraUsage-CbkqfG1U.js +1 -0
- package/dist/chunks/extractMemories-BP8Opsbp.js +1 -0
- package/dist/chunks/fast-DS3iQ1CH.js +1 -0
- package/dist/chunks/fast-DklfqySb.js +1 -0
- package/dist/chunks/featureCheck-CUJ2rPM6.js +1 -0
- package/dist/chunks/feedback-QJynmG5q.js +1 -0
- package/dist/chunks/fileStateCache-BhVfo23e.js +1 -0
- package/dist/chunks/files-Bdr_PQyV.js +2 -0
- package/dist/chunks/findExecutable-BHQl4NaS.js +1 -0
- package/dist/chunks/firstPartyEventLogger-DlW8BUXq.js +1 -0
- package/dist/chunks/flushGate-CK5B9-Zn.js +1 -0
- package/dist/chunks/gates-6amRNsYl.js +1 -0
- package/dist/chunks/gates-vlrMjO-X.js +1 -0
- package/dist/chunks/gemini-B5ZRjDrh.js +1 -0
- package/dist/chunks/generateRecap-SgRMdsyN.js +1 -0
- package/dist/chunks/generateSessionName-sZFzpwsq.js +1 -0
- package/dist/chunks/genericProcessUtils-tJxf3yqB.js +23 -0
- package/dist/chunks/git-C0IuvuIy.js +6 -0
- package/dist/chunks/git-hSvFiuiG.js +1 -0
- package/dist/chunks/githubRepoPathMapping-DUGvTwPB.js +1 -0
- package/dist/chunks/goal-Dy-GGn9r.js +3 -0
- package/dist/chunks/grok-BG4_buNt.js +1 -0
- package/dist/chunks/growthbook-Br1dDRtd.js +1 -0
- package/dist/chunks/heapdump-B9PVKMxa.js +5 -0
- package/dist/chunks/help-BfWF7xij.js +1 -0
- package/dist/chunks/hooks-BVrhxysz.js +1 -0
- package/dist/chunks/hooks-KK32pxq3.js +79 -0
- package/dist/chunks/hostAdapter-TBJav3vX.js +1 -0
- package/dist/chunks/hostGuard-DSOEyH-P.js +1 -0
- package/dist/chunks/ide-BU1A79BE.js +2 -0
- package/dist/chunks/inboundAttachments-D4tBPCB8.js +1 -0
- package/dist/chunks/inboundAttachments-DWJplT9p.js +1 -0
- package/dist/chunks/initReplBridge-99sUBVEk.js +1 -0
- package/dist/chunks/insights-lDHodCMG.js +822 -0
- package/dist/chunks/install-Bg4ZgW81.js +1 -0
- package/dist/chunks/install-github-app-RLbUq5EL.js +147 -0
- package/dist/chunks/install-slack-app-CHmIwsbm.js +1 -0
- package/dist/chunks/instrumentation-BCiV3SKX.js +12 -0
- package/dist/chunks/job-xOGf0j5Q.js +2 -0
- package/dist/chunks/jwtUtils-BQXXBwqW.js +1 -0
- package/dist/chunks/keybindings-DMbReZ4p.js +2 -0
- package/dist/chunks/lang-A6LUGP_7.js +1 -0
- package/dist/chunks/language-Bzp5KDCE.js +1 -0
- package/dist/chunks/language-CGfURU2y.js +1 -0
- package/dist/chunks/launchAgentsPlatform-Dbpm7Jyo.js +1 -0
- package/dist/chunks/launchAutofixPr-RZfqx5eM.js +18 -0
- package/dist/chunks/launchLocalMemory-DIntbsvg.js +3 -0
- package/dist/chunks/launchLocalVault-CCUw0ayu.js +3 -0
- package/dist/chunks/launchMemoryStores-QJTh8KSP.js +1 -0
- package/dist/chunks/launchOnboarding--Pe30AYd.js +8 -0
- package/dist/chunks/launchSchedule-DjN1RbRX.js +1 -0
- package/dist/chunks/launchSkillStore-CcKmVDz1.js +1 -0
- package/dist/chunks/launchTeleport-BKlEo0yF.js +3 -0
- package/dist/chunks/launchVault-C7UHA-IG.js +1 -0
- package/dist/chunks/loadAgentsDir-ClTeo0nk.js +4697 -0
- package/dist/chunks/loadAgentsDir-CshktEpX.js +1 -0
- package/dist/chunks/loadPluginHooks-DVZmzYLl.js +1 -0
- package/dist/chunks/localSearch-BtLNJRij.js +1 -0
- package/dist/chunks/localSearch-Koc8naSr.js +1 -0
- package/dist/chunks/log-DSV4Ht5l.js +1 -0
- package/dist/chunks/login-BngE89_j.js +1 -0
- package/dist/chunks/login-C3MZQTDL.js +1 -0
- package/dist/chunks/logoV2Utils-DAIIwt5R.js +1 -0
- package/dist/chunks/logout-CXZBaUen.js +1 -0
- package/dist/chunks/magicDocs-C_inI3JJ.js +57 -0
- package/dist/chunks/main-CfkIGrBF.js +31 -0
- package/dist/chunks/main-qqcmncHA.js +1312 -0
- package/dist/chunks/mappers-7BSMbYvH.js +1 -0
- package/dist/chunks/mcp-DRBiobrN.js +2 -0
- package/dist/chunks/mcp-DV8Prhgi.js +1 -0
- package/dist/chunks/mcp-HQ8-nEZ1.js +6 -0
- package/dist/chunks/mcpServer-CLIYAgGs.js +1 -0
- package/dist/chunks/mcpServer-DS0yRfcu.js +1 -0
- package/dist/chunks/memoize-DJ1XCN-z.js +1 -0
- package/dist/chunks/memory-Cz_JaFLF.js +1 -0
- package/dist/chunks/mobile-BMglW1NB.js +2 -0
- package/dist/chunks/mode-Kx0kSZkr.js +2 -0
- package/dist/chunks/model-Bwvn_acH.js +1 -0
- package/dist/chunks/model-CNXtfiLg.js +1 -0
- package/dist/chunks/onChangeAppState-C4ic-Mib.js +1 -0
- package/dist/chunks/openai-CGGSfpPh.js +10 -0
- package/dist/chunks/overageCreditGrant-BqW_6R5v.js +1 -0
- package/dist/chunks/panel-BYfvo_mR.js +1 -0
- package/dist/chunks/panel-D3wvAEFE.js +1 -0
- package/dist/chunks/panelCall-DgPjuhQf.js +1 -0
- package/dist/chunks/parser-DGXE1uWd.js +1 -0
- package/dist/chunks/passes-sYE91Vtr.js +1 -0
- package/dist/chunks/path-BE28AJwZ.js +1 -0
- package/dist/chunks/paths-DO4WOQtD.js +36 -0
- package/dist/chunks/permissions-BE-1pIly.js +1 -0
- package/dist/chunks/permissions-BPerbf1I.js +3 -0
- package/dist/chunks/pipeTransport-CW9zF_UN.js +1 -0
- package/dist/chunks/plan-CDKBVRw6.js +1 -0
- package/dist/chunks/platform-mh9ypxS8.js +2 -0
- package/dist/chunks/plugin-C6US4b8W.js +1 -0
- package/dist/chunks/pluginAutoupdate-BQKtcAhC.js +1 -0
- package/dist/chunks/pluginBlocklist-B8DKXi0i.js +1 -0
- package/dist/chunks/pluginCliCommands-DWCeXYTl.js +1 -0
- package/dist/chunks/pluginFlagging-DFMlWw2P.js +1 -0
- package/dist/chunks/pluginOperations-CKmwDC3G.js +2 -0
- package/dist/chunks/pluginStartupCheck-D6IbyWKe.js +1 -0
- package/dist/chunks/pluginStartupCheck-cYnLsWOs.js +1 -0
- package/dist/chunks/plugins-BwZIRMh_.js +4 -0
- package/dist/chunks/policyLimits-CFLBtFh3.js +1 -0
- package/dist/chunks/pollConfig-C3NjXYFc.js +1 -0
- package/dist/chunks/poller-BA1jhG3F.js +1 -0
- package/dist/chunks/poor-BHhbua95.js +1 -0
- package/dist/chunks/poorMode-CCK7Ek5w.js +1 -0
- package/dist/chunks/poorMode-mtlnXU-z.js +1 -0
- package/dist/chunks/print-kxnXkqGc.js +39 -0
- package/dist/chunks/privacy-settings-DjY1annR.js +1 -0
- package/dist/chunks/processBashCommand-BrqLqSva.js +1 -0
- package/dist/chunks/processSlashCommand-DJGdVGbK.js +6 -0
- package/dist/chunks/projectContext-Cd7V9pES.js +1 -0
- package/dist/chunks/prompt-BZjXpviP.js +1 -0
- package/dist/chunks/prompt-CfM_xGPc.js +227 -0
- package/dist/chunks/prompt-CusKF4-p.js +1 -0
- package/dist/chunks/promptEditor-FI_ewCpV.js +4 -0
- package/dist/chunks/protocolHandler-B7ybKpgJ.js +13 -0
- package/dist/chunks/rate-limit-options-DPJMNNou.js +1 -0
- package/dist/chunks/rcDebugLog-CwU_wJBE.js +11 -0
- package/dist/chunks/referral-Da4mpbd3.js +1 -0
- package/dist/chunks/refresh-B6X4xb9r.js +1 -0
- package/dist/chunks/registerProtocol-D8fFnceq.js +36 -0
- package/dist/chunks/registry-y_z3pTg3.js +1 -0
- package/dist/chunks/release-notes--tnd4K56.js +4 -0
- package/dist/chunks/releaseNotes-BPA229-J.js +2 -0
- package/dist/chunks/reload-plugins-yQ7tEUVh.js +1 -0
- package/dist/chunks/remote-env-CER5UxTX.js +1 -0
- package/dist/chunks/remoteBridgeCore-Bi31i8gt.js +1 -0
- package/dist/chunks/remoteControlServer-oUAcWB4i.js +3 -0
- package/dist/chunks/rename-BTngRRZU.js +1 -0
- package/dist/chunks/renderOptions-Caca3bCd.js +1 -0
- package/dist/chunks/resume-DZHKfBmm.js +2 -0
- package/dist/chunks/ripgrep-Bzwdi5-K.js +5 -0
- package/dist/chunks/ripgrep-DEa1djpJ.js +1 -0
- package/dist/chunks/runtimeObserver-B4KekIF0.js +1 -0
- package/dist/chunks/runtimeObserver-BUOcYxiK.js +10 -0
- package/dist/chunks/sandbox-adapter-C--j-c76.js +1 -0
- package/dist/chunks/sandbox-toggle-DLBL7myN.js +1 -0
- package/dist/chunks/searchExtraTools-CBYp5XeI.js +1 -0
- package/dist/chunks/sentry-B7ZBc8fA.js +13 -0
- package/dist/chunks/session-DWYQk9YN.js +2 -0
- package/dist/chunks/sessionDiscovery-BP0nv36F.js +1 -0
- package/dist/chunks/sessionFileAccessHooks-DVilA3Mm.js +1 -0
- package/dist/chunks/sessionMemory-cMgcTxtP.js +1 -0
- package/dist/chunks/sessionMemory-pT4lc1C-.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BgYf2OvX.js +1 -0
- package/dist/chunks/sessionObserver-CzyEF7mg.js +1 -0
- package/dist/chunks/sessionObserver-D4SV0Ar3.js +20 -0
- package/dist/chunks/sessionStorage-CXBgVAx-.js +1 -0
- package/dist/chunks/sessionStoragePortable-CJUZrbIq.js +3 -0
- package/dist/chunks/sessionTitle-CkrnWEW1.js +14 -0
- package/dist/chunks/sessionTracing-Caw-kvQr.js +11 -0
- package/dist/chunks/settingsSync-Dn_lGonC.js +1 -0
- package/dist/chunks/setup-DGkOT4DX.js +2 -0
- package/dist/chunks/setup-Dihjl7jo.js +9 -0
- package/dist/chunks/setup-II1titXI.js +1 -0
- package/dist/chunks/shadowedRuleDetection-DASW3j9H.js +1 -0
- package/dist/chunks/shellQuote-CBjhlaFO.js +1 -0
- package/dist/chunks/sideQuestion-C1qbLTAL.js +20 -0
- package/dist/chunks/sink-BSPyC453.js +1 -0
- package/dist/chunks/sink-CqOAfFlL.js +1 -0
- package/dist/chunks/sinks-BT_lBY6T.js +2 -0
- package/dist/chunks/sinks-CpuRIC3H.js +1 -0
- package/dist/chunks/skill-learning-kh0HKn6u.js +5 -0
- package/dist/chunks/skillChangeDetector-DQuNepIV.js +1 -0
- package/dist/chunks/skillGapStore-B1gUQXhE.js +5 -0
- package/dist/chunks/skillGapStore-CFmLJlYm.js +1 -0
- package/dist/chunks/skillGenerator-DIAwRpPg.js +8 -0
- package/dist/chunks/skillLearning-Bxu1Uzl-.js +1 -0
- package/dist/chunks/skillLearning-CxAbHYEk.js +1 -0
- package/dist/chunks/skillPanel-B9zJLHKV.js +28 -0
- package/dist/chunks/skillSearchPanel-C1O9sxYS.js +21 -0
- package/dist/chunks/skills-C6_3snFY.js +1 -0
- package/dist/chunks/sprites-59l7vF4l.js +1 -0
- package/dist/chunks/src-BGzuPZ5q.js +26 -0
- package/dist/chunks/src-kgpr3s-l.js +1 -0
- package/dist/chunks/startupProfiler-CAntGAbs.js +3 -0
- package/dist/chunks/startupProfiler-WtUzkMKV.js +1 -0
- package/dist/chunks/stats-BmGdg4nj.js +1 -0
- package/dist/chunks/status-KLPT7uYP.js +1 -0
- package/dist/chunks/statusNoticeHelpers-DuqyBY-N.js +1 -0
- package/dist/chunks/stdio-Cg20AQ5W.js +1 -0
- package/dist/chunks/stickers-DDAm--86.js +1 -0
- package/dist/chunks/stringUtils-KZoO4GUd.js +4 -0
- package/dist/chunks/subprocessEnv-D4Cbyl2J.js +1 -0
- package/dist/chunks/systemPromptSections-CVpefuSD.js +1 -0
- package/dist/chunks/tag-0vahEnrx.js +11 -0
- package/dist/chunks/tasks-zVPemGv7.js +1 -0
- package/dist/chunks/teamHelpers-B83RwCCC.js +1 -0
- package/dist/chunks/teamHelpers-CXAmvFco.js +1 -0
- package/dist/chunks/teammateModeSnapshot-AdUFmPGC.js +1 -0
- package/dist/chunks/teammateModeSnapshot-CdiglTzv.js +1 -0
- package/dist/chunks/teleport-D6PvdjPy.js +1 -0
- package/dist/chunks/templateJobs-Ox5ZTKjW.js +12 -0
- package/dist/chunks/terminalSetup-Dh70ynBX.js +1 -0
- package/dist/chunks/terminalSetup-hLCi-2uB.js +33 -0
- package/dist/chunks/theme-DxgUVq9C.js +1 -0
- package/dist/chunks/thinkback-C5vFU8dM.js +1 -0
- package/dist/chunks/thinkback-DWgU7Qhr.js +1 -0
- package/dist/chunks/thinkback-play-CDzY6Ux4.js +1 -0
- package/dist/chunks/tmux-DelKEjda.js +1 -0
- package/dist/chunks/toolEventObserver-DPoMAJwr.js +1 -0
- package/dist/chunks/toolEventObserver-jO6-mlFU.js +1 -0
- package/dist/chunks/toolPool-BmA-BnAq.js +1 -0
- package/dist/chunks/toolPool-Dgn1Clq8.js +1 -0
- package/dist/chunks/trustedDevice-CYR5AgSB.js +1 -0
- package/dist/chunks/trustedDevice-D35gYkBT.js +1 -0
- package/dist/chunks/tui-DoOiz2RW.js +6 -0
- package/dist/chunks/types-BCy5hsQR.js +1 -0
- package/dist/chunks/types-KeqFPzY5.js +17 -0
- package/dist/chunks/udsClient-CBF_cZFW.js +1 -0
- package/dist/chunks/ultrareviewCommand-o4GjzoXK.js +3 -0
- package/dist/chunks/undercover-B4xr62Ux.js +31 -0
- package/dist/chunks/undercover-nakrQDLh.js +1 -0
- package/dist/chunks/up-DaiW-V1N.js +12 -0
- package/dist/chunks/updateCCB-Cthn50OV.js +11 -0
- package/dist/chunks/upgrade-D4Id4ebd.js +1 -0
- package/dist/chunks/upgrade-DJTCV8sr.js +1 -0
- package/dist/chunks/upload-BFDXvdfb.js +1 -0
- package/dist/chunks/upstreamproxy-CLf1UaJv.js +11 -0
- package/dist/chunks/usage-Csbso5mD.js +1 -0
- package/dist/chunks/usage-DxudeFLL.js +1 -0
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-BHi41Ku_.js +1 -0
- package/dist/chunks/useMainLoopModel-CEqP4HOc.js +1 -0
- package/dist/chunks/useManagePlugins-BmS3Adja.js +1 -0
- package/dist/chunks/useMergedTools-wR6Bglqq.js +1 -0
- package/dist/chunks/useSearchInput-BhKAGgEN.js +1 -0
- package/dist/chunks/useSettingsErrors-CjK3P-Ki.js +1 -0
- package/dist/chunks/useTerminalSize-Du-EamDN.js +1 -0
- package/dist/chunks/useVoice-DP1hHBWA.js +1 -0
- package/dist/chunks/util-CMSErQoz.js +1 -0
- package/dist/chunks/utils-CAQfwbv8.js +1 -0
- package/dist/chunks/validatePlugin-_g0AqWZG.js +1 -0
- package/dist/chunks/vim-8y-2Q09k.js +1 -0
- package/dist/chunks/voice-BJAsr0K-.js +2 -0
- package/dist/chunks/voice-YtzCcIoM.js +8 -0
- package/dist/chunks/voiceModeEnabled-BD9GZhQ3.js +1 -0
- package/dist/chunks/voiceModeEnabled-DZbxaFIg.js +1 -0
- package/dist/chunks/voiceStreamSTT-B1T-8adN.js +1 -0
- package/dist/chunks/voiceStreamSTT-B39XaGOU.js +1 -0
- package/dist/chunks/web-tools-DVIvcP41.js +1 -0
- package/dist/chunks/windowsPaths-BeDSnJ23.js +2 -0
- package/dist/chunks/windowsPaths-ttHiMKpR.js +1 -0
- package/dist/chunks/workerRegistry-60_UCyc3.js +1 -0
- package/dist/chunks/worktree-DNK8NprA.js +1 -0
- package/dist/chunks/worktreeModeEnabled-RtizNgNg.js +1 -0
- package/dist/chunks/xml-CTdKuU6f.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/AddWorkspaceDirectory-BqR8LhJq.js +0 -1
- package/dist/chunks/App-DkBMWXkK.js +0 -1
- package/dist/chunks/ApproveApiKey-5xd0lUV7.js +0 -1
- package/dist/chunks/ApproveApiKey-Dmr2VaVA.js +0 -1
- package/dist/chunks/AssistantSessionChooser-C7rigDkQ.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-RtEwbumC.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-7s3ULbNF.js +0 -1
- package/dist/chunks/ClaudeInChromeOnboarding-Bjv-sERa.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-BTysDIlI.js +0 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-DosNL91g.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-Cc1yaM-M.js +0 -1
- package/dist/chunks/DesktopHandoff-Cy89ZB_9.js +0 -1
- package/dist/chunks/DevChannelsDialog-ws8prcNK.js +0 -1
- package/dist/chunks/DiffDialog-BhqgxA7o.js +0 -3
- package/dist/chunks/Doctor-BWouB_9X.js +0 -1
- package/dist/chunks/Doctor-Ts5k8hn1.js +0 -3
- package/dist/chunks/ExitFlow-BBoImtT_.js +0 -2
- package/dist/chunks/Feedback-BVbSMBwY.js +0 -2
- package/dist/chunks/Grove-CTQrX7WO.js +0 -1
- package/dist/chunks/Grove-ZMHK4CBZ.js +0 -11
- package/dist/chunks/HybridTransport-B9g074Y1.js +0 -4
- package/dist/chunks/ITermBackend-DaFK8DOH.js +0 -1
- package/dist/chunks/InvalidConfigDialog-BkZkVKB4.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-Lr60eQWj.js +0 -1
- package/dist/chunks/MCPConnectionManager-DmJ6dLOp.js +0 -1
- package/dist/chunks/McpParsingWarnings-CE2pQPXV.js +0 -1
- package/dist/chunks/MessageSelector-BT1FDbwv.js +0 -3
- package/dist/chunks/Messages-DT2gDtrJ.js +0 -11
- package/dist/chunks/Onboarding-DsqnXQel.js +0 -1
- package/dist/chunks/OverageCreditUpsell-UWtCrOmN.js +0 -1
- package/dist/chunks/PluginSettings-OJQz3d5V.js +0 -17
- package/dist/chunks/PromptInputFooterSuggestions-BImBB6Yk.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-CblAb9vk.js +0 -1
- package/dist/chunks/QueryEngine-_re1pGHr.js +0 -1
- package/dist/chunks/REPL-eBTeslsR.js +0 -147
- package/dist/chunks/REPL-wIg0cBqS.js +0 -1
- package/dist/chunks/RemoteCallout-DMQai8_P.js +0 -1
- package/dist/chunks/RemoteSessionManager-DQmsHvj_.js +0 -2
- package/dist/chunks/ResumeConversation-D81hDeTl.js +0 -1
- package/dist/chunks/SSETransport-BbeM6bi9.js +0 -4
- package/dist/chunks/SearchExtraToolsTool-QbJQCWXd.js +0 -1
- package/dist/chunks/SentryErrorBoundary-BQJXHbWh.js +0 -2
- package/dist/chunks/SentryErrorBoundary-Cnw74oVG.js +0 -1
- package/dist/chunks/Settings-DiXc-_IG.js +0 -2
- package/dist/chunks/TeleportProgress-B3oRJlWH.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-GPuEipFy.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-CcDuR6o9.js +0 -1
- package/dist/chunks/ThemePicker-BjSRjA_L.js +0 -1
- package/dist/chunks/TmuxBackend-BE3zsPKE.js +0 -9
- package/dist/chunks/TrustDialog-B6Qg0xUr.js +0 -1
- package/dist/chunks/TungstenTool-C5IqKVr0.js +0 -1
- package/dist/chunks/ValidationErrorsList-C5BoLiye.js +0 -2
- package/dist/chunks/WelcomeV2-BJAKZYz1.js +0 -1
- package/dist/chunks/WindowsTerminalBackend-BcwpxU2Q.js +0 -2
- package/dist/chunks/add-dir-OR7-VVcq.js +0 -1
- package/dist/chunks/agentDisplay-CMqTUh0A.js +0 -1
- package/dist/chunks/agents-DRtgUZ6t.js +0 -103
- package/dist/chunks/agents-EolUGDZB.js +0 -2
- package/dist/chunks/ant-Bgl31h7a.js +0 -1
- package/dist/chunks/api-BpQPVgif.js +0 -1
- package/dist/chunks/api-xFvB7WoB.js +0 -1
- package/dist/chunks/asciicast-CJObpRg9.js +0 -1
- package/dist/chunks/asciicast-Dr_Div_R.js +0 -4
- package/dist/chunks/assistant-CENsWvTb.js +0 -1
- package/dist/chunks/assistant-CHawoD04.js +0 -1
- package/dist/chunks/assistant-s7XNIA76.js +0 -1
- package/dist/chunks/auth-DX12yVM8.js +0 -1
- package/dist/chunks/auth-h6VL9BbC.js +0 -1
- package/dist/chunks/autoMode-BDzVqEPm.js +0 -45
- package/dist/chunks/autonomy-CeqOXzJl.js +0 -19
- package/dist/chunks/autonomy-D2YudQnH.js +0 -1
- package/dist/chunks/autonomyPanel-B0OQV4lv.js +0 -1
- package/dist/chunks/backgroundHousekeeping-CvHD981l.js +0 -17
- package/dist/chunks/backgroundHousekeeping-DMkk-QoZ.js +0 -1
- package/dist/chunks/banner-DNLUJFS_.js +0 -2
- package/dist/chunks/bg-D_H-uZDS.js +0 -9
- package/dist/chunks/bg-FtpmvQuT.js +0 -1
- package/dist/chunks/branch-D44HjlJp.js +0 -3
- package/dist/chunks/break-cache-ByJ7U2Ts.js +0 -8
- package/dist/chunks/bridge-4sldfa8u.js +0 -2
- package/dist/chunks/bridgeConfig-BM7iHryd.js +0 -1
- package/dist/chunks/bridgeConfig-CcCNsSBX.js +0 -1
- package/dist/chunks/bridgeEnabled-CYddgTU1.js +0 -1
- package/dist/chunks/bridgeEnabled-DoT2l1Oj.js +0 -1
- package/dist/chunks/bridgeMain-DaO51duk.js +0 -68
- package/dist/chunks/bridgeMain-Dc4-ZK69.js +0 -1
- package/dist/chunks/bridgeMessaging-IlSWKGmC.js +0 -1
- package/dist/chunks/bridgePointer-fFD_tbSk.js +0 -1
- package/dist/chunks/browser-DwnUS505.js +0 -1
- package/dist/chunks/btw-CrdUyRUP.js +0 -1
- package/dist/chunks/buddy-Ci0hdCf9.js +0 -3
- package/dist/chunks/bypassPermissionsKillswitch-BWOlc_sK.js +0 -1
- package/dist/chunks/caches-BHRJHGlc.js +0 -1
- package/dist/chunks/caches-CitduRKp.js +0 -3
- package/dist/chunks/ccrClient-yNKhQYnf.js +0 -1
- package/dist/chunks/changeDetector-B1tCH9Pa.js +0 -1
- package/dist/chunks/channelNotification-D8NPg8I8.js +0 -1
- package/dist/chunks/channelNotification-oE3eipDZ.js +0 -1
- package/dist/chunks/chrome-CwAwCY0V.js +0 -1
- package/dist/chunks/chromeNativeHost-63xqELw-.js +0 -1
- package/dist/chunks/claudeDesktop-CX1AsJie.js +0 -1
- package/dist/chunks/cleanup-C0gyKaOb.js +0 -1
- package/dist/chunks/clear-B5D08sZ0.js +0 -1
- package/dist/chunks/cliLaunch-8aeIk2ts.js +0 -1
- package/dist/chunks/client-un1k_6md.js +0 -1
- package/dist/chunks/color-BtVvrSvq.js +0 -1
- package/dist/chunks/commands--qEK1j9j.js +0 -1
- package/dist/chunks/commitAttribution-AEb-sE-t.js +0 -1
- package/dist/chunks/commitAttribution-HP_CWP0X.js +0 -2
- package/dist/chunks/common-BBRP_KzA.js +0 -1
- package/dist/chunks/common-BD4Q7osK.js +0 -1
- package/dist/chunks/common-C56I-_O3.js +0 -1
- package/dist/chunks/compact-BNhxD2UA.js +0 -3
- package/dist/chunks/companion-BlhNrZiL.js +0 -1
- package/dist/chunks/completionCache-BHSsdkBs.js +0 -1
- package/dist/chunks/completionCache-Daqaxlf3.js +0 -4
- package/dist/chunks/config-9z8716kz.js +0 -1
- package/dist/chunks/config-f8Cx16Z6.js +0 -1
- package/dist/chunks/context-BdOjhAmM.js +0 -1
- package/dist/chunks/context-noninteractive-CnaDbgvf.js +0 -54
- package/dist/chunks/context-noninteractive-DRM7gbFk.js +0 -1
- package/dist/chunks/conversation-B9pq-m4L.js +0 -1
- package/dist/chunks/conversation-DUxXVrGj.js +0 -1
- package/dist/chunks/copy-Cjl0-hg1.js +0 -7
- package/dist/chunks/createSSHSession-CYaHalxc.js +0 -6
- package/dist/chunks/createSession-DoR2K7ay.js +0 -1
- package/dist/chunks/createSession-VlSLvi7J.js +0 -1
- package/dist/chunks/cron-DiW7eIPP.js +0 -1
- package/dist/chunks/cronJitterConfig-DjSd7nvj.js +0 -6
- package/dist/chunks/crossProjectResume-CDWr5DFl.js +0 -40
- package/dist/chunks/daemon-FAp0WyY6.js +0 -2
- package/dist/chunks/datadog-CahWdK03.js +0 -1
- package/dist/chunks/datadog-DPkKCR8M.js +0 -1
- package/dist/chunks/desktop-y3mzgaWo.js +0 -1
- package/dist/chunks/detached-Brq3-vHi.js +0 -5
- package/dist/chunks/detectRepository-CSN3yxkq.js +0 -1
- package/dist/chunks/detectRepository-CbR0WgtE.js +0 -1
- package/dist/chunks/detection-BPPZCanO.js +0 -1
- package/dist/chunks/detection-DrdKrqbQ.js +0 -1
- package/dist/chunks/diff-hpp0dp6U.js +0 -1
- package/dist/chunks/directoryCompletion-DAc3u1K2.js +0 -1
- package/dist/chunks/doctor-B230p0R_.js +0 -1
- package/dist/chunks/earlyInput-BFcdUMaX.js +0 -2
- package/dist/chunks/earlyInput-vv9abU2L.js +0 -1
- package/dist/chunks/effort-D7i2v6vd.js +0 -9
- package/dist/chunks/entry-Du3gtq9o.js +0 -14
- package/dist/chunks/env-BH-OBzcA.js +0 -1
- package/dist/chunks/envLessBridgeConfig-CKD4eOEe.js +0 -1
- package/dist/chunks/envLessBridgeConfig-DI0ouryy.js +0 -1
- package/dist/chunks/execFileNoThrow-B_aZH_GP.js +0 -1
- package/dist/chunks/executor-BJb5d6mo.js +0 -1
- package/dist/chunks/executor-Dmn3RTuI.js +0 -1561
- package/dist/chunks/exit-fntBGxEC.js +0 -1
- package/dist/chunks/export-Dy9M7FnZ.js +0 -2
- package/dist/chunks/exportRenderer-Ckv4v0ye.js +0 -1
- package/dist/chunks/extra-usage-DLEvlKzs.js +0 -1
- package/dist/chunks/extra-usage-core-3KkeQSve.js +0 -1
- package/dist/chunks/extra-usage-noninteractive-DUezD54f.js +0 -1
- package/dist/chunks/extra-usage-pU11YXHS.js +0 -1
- package/dist/chunks/extraUsage-B-l-oe-7.js +0 -1
- package/dist/chunks/extractMemories-CXarlmZp.js +0 -1
- package/dist/chunks/fast-BzfzSH7K.js +0 -1
- package/dist/chunks/fast-CbLu_WYL.js +0 -1
- package/dist/chunks/featureCheck-p7OeCYzj.js +0 -1
- package/dist/chunks/feedback-DiyZIbov.js +0 -1
- package/dist/chunks/fileStateCache-C7-TxF8G.js +0 -1
- package/dist/chunks/files-DYvAZGxp.js +0 -2
- package/dist/chunks/firstPartyEventLogger-Dig8Mv7_.js +0 -1
- package/dist/chunks/flushGate-Ci3NHOV4.js +0 -1
- package/dist/chunks/gates-CtkQH6jy.js +0 -1
- package/dist/chunks/gates-xscCu8-N.js +0 -1
- package/dist/chunks/gemini-BCuY2aYj.js +0 -1
- package/dist/chunks/generateRecap-DA0SNyFR.js +0 -1
- package/dist/chunks/generateSessionName-BtQ4NGXP.js +0 -1
- package/dist/chunks/genericProcessUtils-D-78JZxz.js +0 -23
- package/dist/chunks/git-BZEgupMC.js +0 -1
- package/dist/chunks/git-DayFjsvj.js +0 -6
- package/dist/chunks/githubRepoPathMapping-C5RkiJWj.js +0 -1
- package/dist/chunks/goal-B6GHfd9J.js +0 -3
- package/dist/chunks/grok-DDM6xYuy.js +0 -1
- package/dist/chunks/growthbook-D-Po5Uxl.js +0 -1
- package/dist/chunks/heapdump-DHlUfpVV.js +0 -5
- package/dist/chunks/help-BulgC9m7.js +0 -1
- package/dist/chunks/hooks-D5AcFnD1.js +0 -1
- package/dist/chunks/hooks-jxIrev-X.js +0 -79
- package/dist/chunks/hostAdapter-BvraKy0o.js +0 -1
- package/dist/chunks/hostGuard-CWijeIyE.js +0 -1
- package/dist/chunks/ide-tx4qMFln.js +0 -2
- package/dist/chunks/inboundAttachments-C93Q7Dvt.js +0 -1
- package/dist/chunks/inboundAttachments-DxcFiX4f.js +0 -1
- package/dist/chunks/initReplBridge-BEldrf6f.js +0 -1
- package/dist/chunks/insights-HEsEDeCQ.js +0 -822
- package/dist/chunks/install-DRsM0bJO.js +0 -1
- package/dist/chunks/install-github-app-BVK5Z95c.js +0 -147
- package/dist/chunks/install-slack-app-DCw3O2J_.js +0 -1
- package/dist/chunks/instrumentation-DJ-R1s8C.js +0 -12
- package/dist/chunks/job-CUz_OGIq.js +0 -2
- package/dist/chunks/jwtUtils-DVyv2jab.js +0 -1
- package/dist/chunks/keybindings-Chr5nGBu.js +0 -2
- package/dist/chunks/lang-C7kJlPIh.js +0 -1
- package/dist/chunks/language-CQXwoDkI.js +0 -1
- package/dist/chunks/language-Lx3WlBN6.js +0 -1
- package/dist/chunks/launchAgentsPlatform-Fsslu42L.js +0 -1
- package/dist/chunks/launchAutofixPr-Cww8uS_5.js +0 -18
- package/dist/chunks/launchLocalMemory-BywmyvSJ.js +0 -3
- package/dist/chunks/launchLocalVault-BU3a5NV7.js +0 -3
- package/dist/chunks/launchMemoryStores-QUCODCJS.js +0 -1
- package/dist/chunks/launchOnboarding-BriZ0oIA.js +0 -8
- package/dist/chunks/launchSchedule-uLm7zt_B.js +0 -1
- package/dist/chunks/launchSkillStore-DMo2bV8X.js +0 -1
- package/dist/chunks/launchTeleport-DgQWSfXM.js +0 -3
- package/dist/chunks/launchVault-DfnBBFne.js +0 -1
- package/dist/chunks/loadAgentsDir-Br5fGLLI.js +0 -4697
- package/dist/chunks/loadAgentsDir-DDYPdQKP.js +0 -1
- package/dist/chunks/loadPluginHooks-C4soqr6g.js +0 -1
- package/dist/chunks/localSearch-CELyiWF6.js +0 -1
- package/dist/chunks/localSearch-DhZMcy5t.js +0 -1
- package/dist/chunks/log-DS97_rIr.js +0 -1
- package/dist/chunks/login-CvvIpkpq.js +0 -1
- package/dist/chunks/login-DjgITOAw.js +0 -1
- package/dist/chunks/logoV2Utils-BN_HrHSc.js +0 -1
- package/dist/chunks/logout-DOFJpZEJ.js +0 -1
- package/dist/chunks/magicDocs-2Zr7bYY_.js +0 -57
- package/dist/chunks/main-BafHJuKH.js +0 -31
- package/dist/chunks/main-D61CvHRy.js +0 -1312
- package/dist/chunks/mappers-BCiceNt3.js +0 -1
- package/dist/chunks/mcp-BV4m1Gbl.js +0 -2
- package/dist/chunks/mcp-CrAgAK9u.js +0 -1
- package/dist/chunks/mcp-DK4m73gO.js +0 -6
- package/dist/chunks/mcpServer-7zyXl9Wg.js +0 -1
- package/dist/chunks/mcpServer-sa9Z183j.js +0 -1
- package/dist/chunks/memoize-CPexXTP7.js +0 -1
- package/dist/chunks/memory-BrJPVgxn.js +0 -1
- package/dist/chunks/mobile-Cydobb55.js +0 -2
- package/dist/chunks/mode-Cr-NTlRa.js +0 -2
- package/dist/chunks/model-CCjuMV6k.js +0 -1
- package/dist/chunks/model-aJS_plgM.js +0 -1
- package/dist/chunks/onChangeAppState-C9EvI3EH.js +0 -1
- package/dist/chunks/openai-Cvb_-1A-.js +0 -10
- package/dist/chunks/overageCreditGrant-cGQilawd.js +0 -1
- package/dist/chunks/panel-ByW1omJn.js +0 -1
- package/dist/chunks/panel-DO_faHV-.js +0 -1
- package/dist/chunks/panelCall-DqZuxAf0.js +0 -1
- package/dist/chunks/parser-DbKSpFRq.js +0 -1
- package/dist/chunks/passes-DsrceO14.js +0 -1
- package/dist/chunks/path-nCzt96pE.js +0 -1
- package/dist/chunks/paths-DfGsIjPm.js +0 -39
- package/dist/chunks/permissions-CjPIu4IE.js +0 -3
- package/dist/chunks/permissions-Ps_D01ZB.js +0 -1
- package/dist/chunks/pipeTransport-C5u1K0wu.js +0 -1
- package/dist/chunks/plan-YjMAcn6g.js +0 -1
- package/dist/chunks/platform-DYZVoA9J.js +0 -2
- package/dist/chunks/plugin-Oux5bBQj.js +0 -1
- package/dist/chunks/pluginAutoupdate-Dl9U-fbk.js +0 -1
- package/dist/chunks/pluginBlocklist-BzI5DNeN.js +0 -1
- package/dist/chunks/pluginCliCommands-CExAcsaR.js +0 -1
- package/dist/chunks/pluginFlagging-BeqrbhgG.js +0 -1
- package/dist/chunks/pluginOperations-s0FQGOBm.js +0 -2
- package/dist/chunks/pluginStartupCheck-BVag9B-T.js +0 -1
- package/dist/chunks/pluginStartupCheck-BuorUEEf.js +0 -1
- package/dist/chunks/plugins-DTQHVJtY.js +0 -4
- package/dist/chunks/policyLimits-zoyF_6O4.js +0 -1
- package/dist/chunks/pollConfig-C19GiX7i.js +0 -1
- package/dist/chunks/poller-DADqVTWi.js +0 -1
- package/dist/chunks/poor-Bx5vvamq.js +0 -1
- package/dist/chunks/poorMode-BCoeB5zB.js +0 -1
- package/dist/chunks/poorMode-CTd_csCl.js +0 -1
- package/dist/chunks/print-UXl3rG8y.js +0 -39
- package/dist/chunks/privacy-settings-e43D9a4o.js +0 -1
- package/dist/chunks/processBashCommand-CvR9-gf8.js +0 -1
- package/dist/chunks/processSlashCommand-CB3wyAX7.js +0 -6
- package/dist/chunks/projectContext-D3_u80TY.js +0 -1
- package/dist/chunks/prompt-53lRY98R.js +0 -1
- package/dist/chunks/prompt-B8M-HLIS.js +0 -227
- package/dist/chunks/prompt-CooZNM1u.js +0 -1
- package/dist/chunks/promptEditor-CHiopfD7.js +0 -4
- package/dist/chunks/protocolHandler-DjivYn8H.js +0 -13
- package/dist/chunks/rate-limit-options-B-vndk5W.js +0 -1
- package/dist/chunks/rcDebugLog-BoroyfjB.js +0 -11
- package/dist/chunks/referral-DOqhciQu.js +0 -1
- package/dist/chunks/refresh-C8uLznwm.js +0 -1
- package/dist/chunks/registerProtocol-4lQ7O4Cc.js +0 -36
- package/dist/chunks/registry-q6v98JYd.js +0 -1
- package/dist/chunks/release-notes-C7JHshX3.js +0 -4
- package/dist/chunks/releaseNotes-CXY-xAja.js +0 -2
- package/dist/chunks/reload-plugins-DLS5lQcc.js +0 -1
- package/dist/chunks/remote-env-DhHea8yK.js +0 -1
- package/dist/chunks/remoteBridgeCore-BhOLhQIA.js +0 -1
- package/dist/chunks/remoteControlServer-CI0F83pg.js +0 -3
- package/dist/chunks/rename-DiKWWCzB.js +0 -1
- package/dist/chunks/renderOptions-DKe32LfM.js +0 -1
- package/dist/chunks/resume-DA4ToJFW.js +0 -2
- package/dist/chunks/runtimeObserver-BfVC8KK9.js +0 -1
- package/dist/chunks/runtimeObserver-DetZ5Tek.js +0 -10
- package/dist/chunks/sandbox-adapter-wh4cKN45.js +0 -1
- package/dist/chunks/sandbox-toggle-D8MgV0DT.js +0 -1
- package/dist/chunks/searchExtraTools-DbPpcAPw.js +0 -1
- package/dist/chunks/sentry-C3sL9nhF.js +0 -13
- package/dist/chunks/session-Bd-4QCqc.js +0 -2
- package/dist/chunks/sessionDiscovery-D_KPF86E.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-COne5L2E.js +0 -1
- package/dist/chunks/sessionMemory-0Jqo1_MV.js +0 -1
- package/dist/chunks/sessionMemory-BDt_8bNB.js +0 -1
- package/dist/chunks/sessionMemoryUtils-BFIJ1nqF.js +0 -1
- package/dist/chunks/sessionObserver-CEky1SLb.js +0 -1
- package/dist/chunks/sessionObserver-CQxIKV8D.js +0 -20
- package/dist/chunks/sessionStorage-D1XhqZyW.js +0 -1
- package/dist/chunks/sessionStoragePortable-DJZ_6cL8.js +0 -3
- package/dist/chunks/sessionTitle-CB0ZEkS_.js +0 -14
- package/dist/chunks/sessionTracing-BIKXLTJZ.js +0 -11
- package/dist/chunks/settingsSync-pI3L3CeR.js +0 -1
- package/dist/chunks/setup-BSi50fkU.js +0 -1
- package/dist/chunks/setup-DjsmjRKQ.js +0 -2
- package/dist/chunks/setup-Dq0_SRA1.js +0 -9
- package/dist/chunks/shadowedRuleDetection-DvAjOOPL.js +0 -1
- package/dist/chunks/shellQuote-D8XPeqkc.js +0 -1
- package/dist/chunks/sideQuestion-BrTA8ooG.js +0 -20
- package/dist/chunks/sink-CqWxcRl9.js +0 -1
- package/dist/chunks/sink-Dkat5kH9.js +0 -1
- package/dist/chunks/sinks--frMI4-5.js +0 -2
- package/dist/chunks/sinks-CvPAVcMY.js +0 -1
- package/dist/chunks/skill-learning-2LV0yuwF.js +0 -5
- package/dist/chunks/skillChangeDetector-B5CGPl7e.js +0 -1
- package/dist/chunks/skillGapStore-Dc29T-OG.js +0 -1
- package/dist/chunks/skillGapStore-KzRf6Ezr.js +0 -5
- package/dist/chunks/skillGenerator-BdOHsgc4.js +0 -8
- package/dist/chunks/skillLearning-CdcVIG14.js +0 -1
- package/dist/chunks/skillLearning-DXWMxSA2.js +0 -1
- package/dist/chunks/skillPanel-zMY8o-86.js +0 -28
- package/dist/chunks/skillSearchPanel-l8aolUP8.js +0 -21
- package/dist/chunks/skills-BeMWJPup.js +0 -1
- package/dist/chunks/sprites-qel_EgTP.js +0 -1
- package/dist/chunks/src-BIPP3_mo.js +0 -26
- package/dist/chunks/src-DJXKJavk.js +0 -1
- package/dist/chunks/startupProfiler-CnDpob1v.js +0 -3
- package/dist/chunks/startupProfiler-TrMfE6Q4.js +0 -1
- package/dist/chunks/stats-CEBfahqM.js +0 -1
- package/dist/chunks/status-C9KXyfDk.js +0 -1
- package/dist/chunks/statusNoticeHelpers-CxoN9oDh.js +0 -1
- package/dist/chunks/stdio-BEEzuxaZ.js +0 -1
- package/dist/chunks/stickers-eHrGA1W5.js +0 -1
- package/dist/chunks/subprocessEnv-CggQWZCx.js +0 -1
- package/dist/chunks/systemPromptSections-DB93ZNWP.js +0 -1
- package/dist/chunks/tag-Dvl7Us9y.js +0 -11
- package/dist/chunks/tasks-BhiwUF0n.js +0 -1
- package/dist/chunks/teamHelpers-COQazluD.js +0 -1
- package/dist/chunks/teamHelpers-Mgfrv-Jf.js +0 -1
- package/dist/chunks/teammateModeSnapshot-8EWjlA-s.js +0 -1
- package/dist/chunks/teammateModeSnapshot-BV-P8s5r.js +0 -1
- package/dist/chunks/teleport-U5Zgqw3H.js +0 -1
- package/dist/chunks/templateJobs-C3idypN_.js +0 -12
- package/dist/chunks/terminalSetup-CmAEgt-5.js +0 -33
- package/dist/chunks/terminalSetup-mvAN4no7.js +0 -1
- package/dist/chunks/theme-BD2H4vJi.js +0 -1
- package/dist/chunks/thinkback-BOByXYp2.js +0 -1
- package/dist/chunks/thinkback-Dzu2mnNF.js +0 -1
- package/dist/chunks/thinkback-play-BX1K2UMY.js +0 -1
- package/dist/chunks/tmux-DruHFjDy.js +0 -1
- package/dist/chunks/toolEventObserver-B6cLV_dK.js +0 -1
- package/dist/chunks/toolEventObserver-i6it3p2_.js +0 -1
- package/dist/chunks/toolPool--2gNFbrz.js +0 -1
- package/dist/chunks/toolPool-dNV2JxUI.js +0 -1
- package/dist/chunks/trustedDevice-DY8OosTr.js +0 -1
- package/dist/chunks/trustedDevice-zya_Ml1N.js +0 -1
- package/dist/chunks/tui-KoYD82tT.js +0 -6
- package/dist/chunks/types-CQ1wrnQ0.js +0 -1
- package/dist/chunks/types-D5R26wwH.js +0 -17
- package/dist/chunks/udsClient-RkYuzeZC.js +0 -1
- package/dist/chunks/ultrareviewCommand-CCkKby4J.js +0 -3
- package/dist/chunks/undercover-CIutVLEO.js +0 -1
- package/dist/chunks/undercover-D9O2McNG.js +0 -31
- package/dist/chunks/up-BPM85EYl.js +0 -12
- package/dist/chunks/updateCCB-Bmn3Y63Y.js +0 -11
- package/dist/chunks/upgrade-D3rVOeHO.js +0 -1
- package/dist/chunks/upgrade-Dq3l14ZY.js +0 -1
- package/dist/chunks/upload-1PmElPfW.js +0 -1
- package/dist/chunks/upstreamproxy-BBTSJnad.js +0 -11
- package/dist/chunks/usage-B5G8FOZ3.js +0 -1
- package/dist/chunks/usage-VtTu7beE.js +0 -1
- package/dist/chunks/useMainLoopModel-CaQLIr1V.js +0 -1
- package/dist/chunks/useManagePlugins-BvoeOnqq.js +0 -1
- package/dist/chunks/useMergedTools-C133BfRp.js +0 -1
- package/dist/chunks/useSearchInput-CROB7AbC.js +0 -1
- package/dist/chunks/useSettingsErrors-DRxtFXoe.js +0 -1
- package/dist/chunks/useVoice-BQ9aSFJe.js +0 -1
- package/dist/chunks/util-BZnJgF79.js +0 -1
- package/dist/chunks/utils-4gsxQpga.js +0 -1
- package/dist/chunks/validatePlugin-DlrnBhPA.js +0 -1
- package/dist/chunks/vim-BXQCLoFJ.js +0 -1
- package/dist/chunks/voice-CeRmLRHT.js +0 -2
- package/dist/chunks/voice-QHyDff3f.js +0 -8
- package/dist/chunks/voiceModeEnabled-Bq_rttkL.js +0 -1
- package/dist/chunks/voiceModeEnabled-CLAVCVLW.js +0 -1
- package/dist/chunks/voiceStreamSTT-BDKenO5F.js +0 -1
- package/dist/chunks/voiceStreamSTT-CL52x8wZ.js +0 -1
- package/dist/chunks/windowsPaths-43st5EQF.js +0 -1
- package/dist/chunks/windowsPaths-DerzGPcz.js +0 -2
- package/dist/chunks/workerRegistry-BUD3lBk_.js +0 -1
- package/dist/chunks/worktree-C0f9Ke-R.js +0 -1
- package/dist/chunks/worktreeModeEnabled-THQb19xR.js +0 -1
- package/dist/chunks/xml-DvVQHZ1N.js +0 -1
- /package/dist/chunks/{Dialog-DYFGqyDs.js → Dialog-91X6ZGg9.js} +0 -0
- /package/dist/chunks/{InProcessTransport-B0mmAoxw.js → InProcessTransport-B9II3BiO.js} +0 -0
- /package/dist/chunks/{ListItem-OFARanN7.js → ListItem-DCQhApdJ.js} +0 -0
- /package/dist/chunks/{PermissionDialog-5MlJf7ew.js → PermissionDialog-_WQPRYHQ.js} +0 -0
- /package/dist/chunks/{PressEnterToContinue-BdA9zDGs.js → PressEnterToContinue-BJ58eCFC.js} +0 -0
- /package/dist/chunks/{SearchBox-DfOmUoaI.js → SearchBox-CkO4rQ-9.js} +0 -0
- /package/dist/chunks/{TungstenTool-V-Bwqlx3.js → TungstenTool-CnAF4y0E.js} +0 -0
- /package/dist/chunks/{attributionHooks-DZJjA8p9.js → attributionHooks-VGSpz4mk.js} +0 -0
- /package/dist/chunks/{attributionTrailer-CZY9XTcr.js → attributionTrailer-C8uqiLIb.js} +0 -0
- /package/dist/chunks/{autoModeDenials-CGAtAGGf.js → autoModeDenials-DlO5g6E9.js} +0 -0
- /package/dist/chunks/{bedrockClient-DZgaJTHp.js → bedrockClient-BUmO2U-X.js} +0 -0
- /package/dist/chunks/{capacityWake-BXlUpptF.js → capacityWake-DtmDHwEt.js} +0 -0
- /package/dist/chunks/{ccshareResume-CZggHNOf.js → ccshareResume-DKwcd0Vc.js} +0 -0
- /package/dist/chunks/{computerUseLock-BoEK9xYv.js → computerUseLock-Diig5B8p.js} +0 -0
- /package/dist/chunks/{connectHeadless-KNT0Sg7Z.js → connectHeadless-ByewVfOb.js} +0 -0
- /package/dist/chunks/{constants-41VpZw2G.js → constants-BljlAJOX.js} +0 -0
- /package/dist/chunks/{controlMessageCompat-BJhFiS7u.js → controlMessageCompat-Ds-CF-sM.js} +0 -0
- /package/dist/chunks/{dangerousBackend-ByOAEFld.js → dangerousBackend-Dkjtndh1.js} +0 -0
- /package/dist/chunks/{debugUtils-CiEnbhiz.js → debugUtils-l8nsUZ6R.js} +0 -0
- /package/dist/chunks/{distRoot-CcxmnzqQ.js → distRoot-BNg_iO5-.js} +0 -0
- /package/dist/chunks/{escHotkey-DfdC44i7.js → escHotkey-D8WgbSyj.js} +0 -0
- /package/dist/chunks/{esm-C-1qL9Mn.js → esm-vlR7mK5b.js} +0 -0
- /package/dist/chunks/{eventLoopStallDetector-l83_98VR.js → eventLoopStallDetector-bYy0fesH.js} +0 -0
- /package/dist/chunks/{exit-_obETqBv.js → exit-DOBLl8jN.js} +0 -0
- /package/dist/chunks/{featureCheck-Cm0YNDXO.js → featureCheck-j7P30mry.js} +0 -0
- /package/dist/chunks/{fpsMetrics-DOI_SIeY.js → fpsMetrics-DKWp7vng.js} +0 -0
- /package/dist/chunks/{fuse-Bp7rmZ5x.js → fuse-D3B-UE5Y.js} +0 -0
- /package/dist/chunks/{hash-BRmOQc3c.js → hash-CaUkS-30.js} +0 -0
- /package/dist/chunks/{index.min-BJnb9GQI.js → index.min-BNgJ2wVD.js} +0 -0
- /package/dist/chunks/{instinctParser-Bxhe2LOF.js → instinctParser-DOtj1Kni.js} +0 -0
- /package/dist/chunks/{intl-Pse97ORk.js → intl-CLeE9DsD.js} +0 -0
- /package/dist/chunks/{launchCommand-Du91jxMC.js → launchCommand-9eYsPG7W.js} +0 -0
- /package/dist/chunks/{lazySchema-2sOku3cX.js → lazySchema-B0QShMaQ.js} +0 -0
- /package/dist/chunks/{lib-B4Q0Nrpb.js → lib-Cf16LgKj.js} +0 -0
- /package/dist/chunks/{lockfile-CeCEBLtN.js → lockfile-C3JsqLpb.js} +0 -0
- /package/dist/chunks/{modalContext-CmSKRyea.js → modalContext-c5Yqx_CQ.js} +0 -0
- /package/dist/chunks/{normalization-Cox8C0dP.js → normalization-BLfP0Kqt.js} +0 -0
- /package/dist/chunks/{observationStore-BaPq7CKI.js → observationStore-rLlDwRtG.js} +0 -0
- /package/dist/chunks/{openaiShared-Crt0cZLO.js → openaiShared-C-AuktRP.js} +0 -0
- /package/dist/chunks/{output-style-BkOnFmfe.js → output-style-B64-Zum6.js} +0 -0
- /package/dist/chunks/{parseConnectUrl-BFNiff4c.js → parseConnectUrl-DL390ePs.js} +0 -0
- /package/dist/chunks/{parser-BXWr_mLL.js → parser-aIWfAYnt.js} +0 -0
- /package/dist/chunks/{permissions-DXLfdE7b.js → permissions-BsVJvaEe.js} +0 -0
- /package/dist/chunks/{postCommitAttribution-CA9Z2sqn.js → postCommitAttribution-D8MoHFoz.js} +0 -0
- /package/dist/chunks/{projectContext-CwJlxP2Y.js → projectContext-Dn7umMp6.js} +0 -0
- /package/dist/chunks/{prompt-4tea6NJQ.js → prompt-IqfIbvg9.js} +0 -0
- /package/dist/chunks/{proxy-nPT6a6QY.js → proxy-CF7ZDxaW.js} +0 -0
- /package/dist/chunks/{rewind-DTk4TFYB.js → rewind-Djt1zU_3.js} +0 -0
- /package/dist/chunks/{rollback-DbSpxmJE.js → rollback-CtS4yEQx.js} +0 -0
- /package/dist/chunks/{sanitization-DD414_3t.js → sanitization-Ds6zRQyx.js} +0 -0
- /package/dist/chunks/{sdkHeapDumpMonitor-fNRF2fbK.js → sdkHeapDumpMonitor-DLMMNeqo.js} +0 -0
- /package/dist/chunks/{semver-Tw0AFar5.js → semver-Di5OaTd5.js} +0 -0
- /package/dist/chunks/{server-DTd90dmm.js → server-DONKdvGc.js} +0 -0
- /package/dist/chunks/{serverBanner-B7UaaCCl.js → serverBanner-DIyjgIM-.js} +0 -0
- /package/dist/chunks/{serverLog-DRvGpDtt.js → serverLog-D1N5yx8A.js} +0 -0
- /package/dist/chunks/{sessionDataUploader-BDsz_1Uy.js → sessionDataUploader-CsNePsOb.js} +0 -0
- /package/dist/chunks/{sessionManager-Bh-Z-YXy.js → sessionManager-BOmgJd1l.js} +0 -0
- /package/dist/chunks/{slashCommandParsing-Cari0pNg.js → slashCommandParsing-BfanVchF.js} +0 -0
- /package/dist/chunks/{sleep-8Eb9j_Ly.js → sleep-C6koP5Ka.js} +0 -0
- /package/dist/chunks/{src-x7u_sB6m.js → src-BWpNn6Yz.js} +0 -0
- /package/dist/chunks/{src-BRAdBA8A.js → src-C-Ho8kYe.js} +0 -0
- /package/dist/chunks/{src-BlLavFUS.js → src-Cu58IYYb.js} +0 -0
- /package/dist/chunks/{src-CI_jaaBj.js → src-d2UJ68oX.js} +0 -0
- /package/dist/chunks/{state-Ce1HlR-H.js → state-BiRT9RAF.js} +0 -0
- /package/dist/chunks/{staticRender-Br64h1E1.js → staticRender-C5v46np_.js} +0 -0
- /package/dist/chunks/{stdio-D4cT86R0.js → stdio-Oy68T2eE.js} +0 -0
- /package/dist/chunks/{store-DhI7Lcan.js → store-DYC8zeL1.js} +0 -0
- /package/dist/chunks/{subprocessEnv-DV6q6o6w.js → subprocessEnv-DIeTJ-xE.js} +0 -0
- /package/dist/chunks/{systemPromptSections-BcN_XBTx.js → systemPromptSections-DY7epA2Y.js} +0 -0
- /package/dist/chunks/{systemTheme-dDbitcxB.js → systemTheme-eRWGHYSL.js} +0 -0
- /package/dist/chunks/{teammate-DMYOtLTK.js → teammate-CbskW5G9.js} +0 -0
- /package/dist/chunks/{types-RJTEOuIt.js → types-C0nqJFkV.js} +0 -0
- /package/dist/chunks/{useKeybinding-FsOnjW6T.js → useKeybinding-DPOUuymz.js} +0 -0
- /package/dist/chunks/{workSecret-qRMNrQy2.js → workSecret-DJu7k30X.js} +0 -0
- /package/dist/chunks/{worktreeModeEnabled-Db6b_Iy_.js → worktreeModeEnabled-KtHEqeFA.js} +0 -0
- /package/dist/chunks/{xdg-CBxMmQux.js → xdg-BFD9ydDV.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,p as i,t as a,tt as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{l,p as u}from"./debug-otxXY3j-.js";import{lC as d,uC as f}from"./loadAgentsDir-ClTeo0nk.js";import{t as p}from"./useKeybinding-DPOUuymz.js";import{t as m}from"./lib-Cf16LgKj.js";function h({onDone:e}){let t=f(e=>e.remoteSessionUrl),[n,a]=(0,_.useState)(``);if((0,_.useEffect)(()=>{if(!t)return;let e=t;async function n(){a(await(0,g.toString)(e,{type:`utf8`,errorCorrectionLevel:`L`}))}n().catch(e=>{u(`QR code generation failed`,e)})},[t]),o(`confirm:no`,e,{context:`Confirmation`}),!t)return(0,v.jsxs)(i,{children:[(0,v.jsx)(r,{color:`warning`,children:"Not in remote mode. Start with `claude --remote` to use this command."}),(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})]});let c=n.split(`
|
|
2
|
+
`).filter(e=>e.length>0),l=c.length===0;return(0,v.jsxs)(i,{children:[(0,v.jsx)(s,{marginBottom:1,children:(0,v.jsx)(r,{bold:!0,children:`Remote session`})}),l?(0,v.jsx)(r,{dimColor:!0,children:`Generating QR code…`}):c.map((e,t)=>(0,v.jsx)(r,{children:e},t)),(0,v.jsxs)(s,{marginTop:1,children:[(0,v.jsx)(r,{dimColor:!0,children:`Open in browser: `}),(0,v.jsx)(r,{color:`ide`,children:t})]}),(0,v.jsx)(s,{marginTop:1,children:(0,v.jsx)(r,{dimColor:!0,children:`(press esc to close)`})})]})}var g,_,v,y;e((()=>{g=m(),n(),_=t(n(),1),a(),p(),d(),l(),v=c(),y=async e=>(0,v.jsx)(h,{onDone:e})}))();export{y as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as e,p as t}from"./debug-otxXY3j-.js";e();async function n(){let{fetchCodeSessionsFromSessionsAPI:e}=await import(`./api-quOYYOhi.js`),n;try{n=await e()}catch(e){throw t(`[assistant:discovery] fetchCodeSessionsFromSessionsAPI failed: ${e}`),e}return n.filter(e=>e.status===`idle`||e.status===`working`||e.status===`waiting`).map(e=>({id:e.id,title:e.title||`Untitled`,status:e.status,created_at:e.created_at??``}))}export{n as discoverAssistantSessions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Su as e,bu as t}from"./loadAgentsDir-ClTeo0nk.js";t();export{e as registerSessionFileAccessHooks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./sessionMemory-pT4lc1C-.js";t();export{e as manuallyExtractSessionMemory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{S as a,_ as o,g as s,nc as c,rc as l}from"./paths-DO4WOQtD.js";import{B as u,U as d,_ as ee,h as te,z as ne}from"./debug-otxXY3j-.js";import{n as re,r as f}from"./analytics-DqMQntaB.js";import{b as p,x as ie}from"./teammate-CbskW5G9.js";import{Ak as m,Bk as h,Bl as g,Bn as ae,Ck as oe,Dk as _,Ek as v,Eo as y,Fl as b,Hk as se,Hn as ce,Kc as le,Lk as ue,Mk as de,Ok as x,Pl as fe,Rk as S,Rl as C,Sk as w,Tk as T,Uk as E,Uo as D,Vn as O,Vo as k,Wk as A,aO as j,bk as M,bl as N,ck as P,dt as F,ft as I,iO as L,jk as R,kk as z,ml as B,pl as pe,qc as me,vk as V,vl as H,wk as he,yl as ge}from"./loadAgentsDir-ClTeo0nk.js";import{Hn as _e,zn as U}from"./prompt-CfM_xGPc.js";import{X as ve}from"./rcDebugLog-CwU_wJBE.js";import{writeFile as W}from"fs/promises";function ye(){return o(`tengu_session_memory`,!1)}function G(){return s(`tengu_sm_config`,{})}function be(e,t){let n=0,r=t==null;for(let i of e){if(!r){i.uuid===t&&(r=!0);continue}if(i.type===`assistant`){let e=i.message.content;Array.isArray(e)&&(n+=p(e,e=>e.type===`tool_use`))}}return n}function K(e){let t=h(e);if(!v()){if(!oe(t))return!1;z()}let n=he(t),r=be(e,X)>=w(),i=k(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&(X=t.uuid),!0}return!1}async function q(e){let t=te(),n=ae();await t.mkdir(n,{mode:448});let r=O();try{await W(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await W(r,await N(),{encoding:`utf-8`,mode:384})}catch(e){if(u(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await le.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),f(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}function xe(){if(r())return;let e=B();process.env.USER_TYPE===`ant`&&f(`tengu_session_memory_init`,{auto_compact_enabled:e}),e&&j($)}async function Se(e,t){if(e.length===0)return{success:!1,error:`No messages to summarize`};x();try{let n=b(t),{memoryPath:r,currentMemory:i}=await q(n),a=await H(i,r),{tools:o,mainLoopModel:s}=t.options,[c,l,u]=await Promise.all([F(o,s),E(),se()]),d=ve(c);return await g({promptMessages:[y({content:a})],cacheSafeParams:{systemPrompt:d,userContext:l,systemContext:u,toolUseContext:n,forkContextMessages:e},canUseTool:J(r),querySource:`session_memory`,forkLabel:`session_memory_manual`,overrides:{readFileState:n.readFileState}}),f(`tengu_session_memory_manual_extraction`,{}),m(h(e)),Y(e),{success:!0,memoryPath:r}}catch(e){return{success:!1,error:ne(e)}}finally{_()}}function J(e){return async(t,n)=>{if(t.name===`Edit`&&typeof n==`object`&&n&&`file_path`in n){let t=n.file_path;if(typeof t==`string`&&t===e)return{behavior:`allow`,updatedInput:n}}return{behavior:`deny`,message:`only ${U} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${U} on ${e} is allowed`}}}}function Y(e){if(!k(e)){let t=e[e.length-1];t?.uuid&&R(t.uuid)}}var X,Z,Q,$,Ce=e((()=>{n(),i(),I(),A(),_e(),me(),ie(),C(),ee(),L(),D(),ce(),c(),P(),S(),re(),pe(),ge(),T(),d(),a(),Z=t(()=>{let e=G();de({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:V.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:V.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:V.toolCallsBetweenUpdates})}),Q=!1,$=l(async function(e){let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`)return;{let{isPoorModeActive:e}=await import(`./poorMode-CCK7Ek5w.js`);if(e())return}if(!ye()){process.env.USER_TYPE===`ant`&&!Q&&(Q=!0,f(`tengu_session_memory_gate_disabled`,{}));return}if(Z(),!K(t))return;x();let i=b(n),{memoryPath:a,currentMemory:o}=await q(i);await g({promptMessages:[y({content:await H(o,a)})],cacheSafeParams:fe(e),canUseTool:J(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?ue(s):void 0,l=M();f(`tengu_session_memory_extraction`,{input_tokens:c?.input_tokens,output_tokens:c?.output_tokens,cache_read_input_tokens:c?.cache_read_input_tokens??void 0,cache_creation_input_tokens:c?.cache_creation_input_tokens??void 0,config_min_message_tokens_to_init:l.minimumMessageTokensToInit,config_min_tokens_between_update:l.minimumTokensBetweenUpdate,config_tool_calls_between_updates:l.toolCallsBetweenUpdates}),m(h(t)),Y(t),_()})}));export{K as a,Se as i,xe as n,Ce as r,J as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Tk as e,xk as t}from"./loadAgentsDir-ClTeo0nk.js";e();export{t as getSessionMemoryContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t}from"./sessionObserver-D4SV0Ar3.js";e();export{t as heuristicObserverBackend};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{ck as t,nt as n,tt as r}from"./loadAgentsDir-ClTeo0nk.js";import{X as i}from"./rcDebugLog-CwU_wJBE.js";import{i as a,l as o,r as s,t as c,u as l}from"./instinctParser-DOtj1Kni.js";function u(e){g.set(e.name,e),_||(_=e.name)}function d(e){if(!g.has(e))throw Error(`Observer backend "${e}" is not registered`);_=e}function f(){let e=_?g.get(_):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function p(e,t){return Promise.resolve(f().analyze(e,t))}function m(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&g.has(e)?e:void 0}function h(){let e=m();return e&&d(e),f()}var g,_,v=e((()=>{g=new Map})),y,b=e((()=>{y=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function x(e,t){if(e.length===0)return[];if(Date.now()<L)return S(e,t);let r=e.slice(-P),a=C(r),s=N(o().llm.timeoutMs),c;try{let e=await n({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=E(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)}let l=D(c,t,r);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),S(e,t)):l}async function S(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-CzyEF7mg.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function C(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>w(e,t)).join(`
|
|
2
|
+
`)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function w(e,t){let n=[`#${t+1}`,`event=${e.event}`];return e.toolName&&n.push(`tool=${e.toolName}`),e.outcome&&n.push(`outcome=${e.outcome}`),e.messageText&&n.push(`text=${JSON.stringify(T(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(T(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(T(e.toolOutput,120))}`),n.join(` | `)}function T(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function E(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;e.type===`text`&&typeof e.text==`string`&&t.push(e.text)}return t.join(``).trim()}function D(e,t,n){let r=O(e);if(!r)return[];let i;try{i=JSON.parse(r)}catch{return[]}if(!Array.isArray(i))return[];let a=n.map(e=>e.id),o=[];for(let e of i.slice(0,F)){let n=k(e,t,a);n&&o.push(n)}return o}function O(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function k(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=A(r.trigger,80),a=A(r.action,120);if(!i||!a)return;let o=te(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:j(r.confidence),domain:M(r.domain),source:`session-observation`,scope:ee(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function A(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function j(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function M(e){return typeof e==`string`&&y.includes(e)?e:`project`}function ee(e){return e===`global`?`global`:`project`}function te(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`string`)continue;let e=n.trim();if(e&&(t.push(e.length>200?`${e.slice(0,200)}…`:e),t.length===3))break}return t}function N(e){return AbortSignal.timeout(e)}var P,F,I,L,R,z,B=e((()=>{r(),t(),l(),b(),P=30,F=3,I=0,L=0,R=`You analyse a short sequence of observations from a coding-assistant session (user messages, tool invocations with outcomes, assistant messages) and extract atomic, reusable "instincts" — behavioural patterns that would help the assistant act correctly in future similar situations.
|
|
3
|
+
|
|
4
|
+
Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
"trigger": string, // <= 80 chars, short phrase describing WHEN the instinct applies
|
|
8
|
+
"action": string, // <= 120 chars, short phrase describing WHAT to do
|
|
9
|
+
"confidence": number, // 0..1 — how strongly these observations support the pattern
|
|
10
|
+
"domain": "workflow"|"testing"|"debugging"|"code-style"|"security"|"git"|"project",
|
|
11
|
+
"scope": "project"|"global",
|
|
12
|
+
"evidence": string[] // 1..3 short excerpts copied/paraphrased from the observations
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
Rules:
|
|
16
|
+
- Return [] if nothing clearly reusable. No guessing.
|
|
17
|
+
- At most 3 items, highest confidence first.
|
|
18
|
+
- confidence > 0.7 only when observations show the pattern in action (a correction followed by a successful retry, a repeated sequence, an explicit rule).
|
|
19
|
+
- Never include secrets, tokens, full file contents, or personally-identifying data.
|
|
20
|
+
- Scope "global" only when the pattern is obviously project-agnostic (generic testing, git hygiene); default to "project".`,z={name:`llm`,analyze(e,t){return x(e,t)}}}));function V(e,t){return[...W(e),...G(e),...K(e,t),...q(e)]}function H(e,t){let n=f();return(n.name===`heuristic`?V(e,t):U(n.analyze(e))).map(e=>s(e))}function U(e){if(Array.isArray(e))return e;throw Error(`Active observer backend returned a Promise; use analyzeObservationsAsync instead`)}function W(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim(),i=X(r);return i?[{...c(t),trigger:i.trigger,action:i.action,confidence:.7,domain:Z(r),source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function G(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.event!==`tool_complete`||r.outcome!==`failure`)continue;let i=e.slice(n+1,n+6).find(e=>e.event===`tool_complete`&&e.outcome===`success`&&e.toolName===r.toolName);!i||!r.toolName||t.push({...c(r),trigger:`When ${r.toolName} fails during this project`,action:`Use the follow-up successful ${r.toolName} invocation as the resolution pattern before retrying blindly.`,confidence:.5,domain:`debugging`,source:`session-observation`,scope:`project`,evidence:[r.toolOutput??`${r.toolName} failed`,i.toolOutput??`${i.toolName} succeeded`],evidenceOutcome:`success`,observationIds:[r.id,i.id]})}return t}function K(e,t){let n=t?.minRepeatedSequenceCount??Q,r=e.filter(e=>e.event===`tool_start`||e.event===`tool_complete`),i=r.map(e=>e.toolName??``),a=[`Grep`,`Read`,`Edit`],o=[],s=0;for(let e=0;e<=i.length-a.length;e++)a.every((t,n)=>i[e+n]===t)&&(s++,o.push(...r.slice(e,e+a.length).map(e=>e.id)));if(s<n)return[];let l=`Observed ${s} repeated Grep -> Read -> Edit workflow sequences.`,u=r.find(e=>o.includes(e.id)),d=o[o.length-1],f=r.find(e=>e.id===d),p=f?.event===`tool_complete`?f.outcome:void 0;return[{...c(u??e[0]),trigger:`When changing code in this project`,action:`Prefer the Grep -> Read -> Edit workflow: locate symbols, inspect context, then apply the smallest edit.`,confidence:s>=3?.65:.5,domain:`workflow`,source:`session-observation`,scope:`project`,evidence:[l],evidenceOutcome:Y(p),observationIds:Array.from(new Set(o))}]}function q(e){return e.flatMap((t,n)=>{if(t.event!==`user_message`||!t.messageText)return[];let r=t.messageText.trim();return/(项目约定|规范|必须|convention|always|must)/i.test(r)?[{...c(t),trigger:`When working in this project`,action:`Follow the project convention: ${r}`,confidence:.4,domain:`project`,source:`session-observation`,scope:`project`,evidence:[r],evidenceOutcome:J(e,n),observationIds:[t.id]}]:[]})}function J(e,t){for(let n=t-1;n>=0;n--){let t=e[n];if(t.event===`tool_complete`)return Y(t.outcome)}}function Y(e){if(e===`success`||e===`failure`||e===`unknown`)return e}function X(e){let t=/(?:不要|别|不应(?:该)?|不要再)\s*(?<avoid>[^,,。.;;]+)[,,\s]*(?:用|使用|改用|应该用|要用)\s*(?<prefer>[^,,。.;;]+)/i,n=/(?:do not|don't|avoid)\s+(?<avoid>[^,.;]+)[,;\s]+(?:use|prefer)\s+(?<prefer>[^,.;]+)/i,r=/(?:你应该|应该先|must|should)\s*(?<prefer>[^,,。.;;]+)/i,i=e.match(t)??e.match(n);if(i?.groups){let e=i.groups.avoid.trim(),t=i.groups.prefer.trim();return{trigger:`When choosing between ${e} and ${t}`,action:`Prefer ${t}; avoid ${e}.`}}let a=e.match(r);return a?.groups?{trigger:`When this user gives a corrective instruction`,action:`Prefer this corrected action: ${a.groups.prefer.trim()}.`}:null}function Z(e){let t=e.toLowerCase();return/test|mock|testing-library|vitest|jest|bun test/.test(t)?`testing`:/git|commit|branch/.test(t)?`git`:/security|secret|token|password/.test(t)?`security`:/style|format|lint|naming/.test(t)?`code-style`:`project`}var Q,$,ne=e((()=>{a(),v(),B(),Q=2,$={name:`heuristic`,analyze(e,t){return V(e)}},u($),u(z)}));export{B as a,b as c,v as d,u as f,ne as i,p as l,d as m,V as n,z as o,h as p,$ as r,y as s,H as t,f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Fr as e,Hr as t,di as n}from"./loadAgentsDir-ClTeo0nk.js";e();export{t as linkSessionToPR,n as recordTranscript};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{i as r,t as i}from"./hash-CaUkS-30.js";import{join as a}from"path";import{open as o,readdir as s,realpath as c,stat as l}from"fs/promises";import{promisify as u}from"util";import{execFile as d}from"child_process";async function f(e){try{let{stdout:t}=await p(`git`,[`worktree`,`list`,`--porcelain`],{cwd:e,timeout:5e3});return t?t.split(`
|
|
2
|
+
`).filter(e=>e.startsWith(`worktree `)).map(e=>e.slice(9).normalize(`NFC`)):[]}catch{return[]}}var p,m=e((()=>{p=u(d)}));function h(e){return typeof e==`string`&&B.test(e)?e:null}function g(e){if(!e.includes(`\\`))return e;try{return JSON.parse(`"${e}"`)}catch{return e}}function _(e,t){let n=[`"${t}":"`,`"${t}": "`];for(let t of n){let n=e.indexOf(t);if(n<0)continue;let r=n+t.length,i=r;for(;i<e.length;){if(e[i]===`\\`){i+=2;continue}if(e[i]===`"`)return g(e.slice(r,i));i++}}}function v(e,t){let n=[`"${t}":"`,`"${t}": "`],r;for(let t of n){let n=0;for(;;){let i=e.indexOf(t,n);if(i<0)break;let a=i+t.length,o=a;for(;o<e.length;){if(e[o]===`\\`){o+=2;continue}if(e[o]===`"`){r=g(e.slice(a,o));break}o++}n=o+1}}return r}function y(e){let t=0,n=``;for(;t<e.length;){let r=e.indexOf(`
|
|
3
|
+
`,t),i=r>=0?e.slice(t,r):e.slice(t);if(t=r>=0?r+1:e.length,!(!i.includes(`"type":"user"`)&&!i.includes(`"type": "user"`))&&!i.includes(`"tool_result"`)&&!(i.includes(`"isMeta":true`)||i.includes(`"isMeta": true`))&&!(i.includes(`"isCompactSummary":true`)||i.includes(`"isCompactSummary": true`)))try{let e=JSON.parse(i);if(e.type!==`user`)continue;let t=e.message;if(!t)continue;let r=t.content,a=[];if(typeof r==`string`)a.push(r);else if(Array.isArray(r))for(let e of r)e.type===`text`&&typeof e.text==`string`&&a.push(e.text);for(let e of a){let t=e.replace(/\n/g,` `).trim();if(!t)continue;let r=H.exec(t);if(r){n||(n=r[1]);continue}let i=/<bash-input>([\s\S]*?)<\/bash-input>/.exec(t);if(i)return`! ${i[1].trim()}`;if(!V.test(t))return t.length>200&&(t=t.slice(0,200).trim()+`…`),t}}catch{}}return n||``}async function b(e,t,n){try{let r=await o(e,`r`);try{let e=await r.read(n,0,z,0);if(e.bytesRead===0)return{head:``,tail:``};let i=n.toString(`utf8`,0,e.bytesRead),a=Math.max(0,t-z),o=i;if(a>0){let e=await r.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{head:i,tail:o}}finally{await r.close()}}catch{return{head:``,tail:``}}}async function x(e){try{let t=await o(e,`r`);try{let e=await t.stat(),n=Buffer.allocUnsafe(z),r=await t.read(n,0,z,0);if(r.bytesRead===0)return null;let i=n.toString(`utf8`,0,r.bytesRead),a=Math.max(0,e.size-z),o=i;if(a>0){let e=await t.read(n,0,z,a);o=n.toString(`utf8`,0,e.bytesRead)}return{mtime:e.mtime.getTime(),size:e.size,head:i,tail:o}}finally{await t.close()}}catch{return null}}function S(e){return Math.abs(i(e)).toString(36)}function C(e){let t=e.replace(/[^a-zA-Z0-9]/g,`-`);if(t.length<=200)return t;let n=typeof Bun<`u`?Bun.hash(e).toString(36):S(e);return`${t.slice(0,200)}-${n}`}function w(){return a(t(),`projects`)}function T(e){return a(w(),C(e))}async function E(e){try{return(await c(e)).normalize(`NFC`)}catch{return e.normalize(`NFC`)}}async function D(e){let t=T(e);try{return await s(t),t}catch{let t=C(e);if(t.length<=200)return;let n=t.slice(0,200),r=w();try{let e=(await s(r,{withFileTypes:!0})).find(e=>e.isDirectory()&&e.name.startsWith(n+`-`));return e?a(r,e.name):void 0}catch{return}}}async function O(e,t){let n=`${e}.jsonl`;if(t){let e=await E(t),r=await D(e);if(r){let t=a(r,n);try{let n=await l(t);if(n.size>0)return{filePath:t,projectPath:e,fileSize:n.size}}catch{}}let i;try{i=await f(e)}catch{i=[]}for(let t of i){if(t===e)continue;let r=await D(t);if(!r)continue;let i=a(r,n);try{let e=await l(i);if(e.size>0)return{filePath:i,projectPath:t,fileSize:e.size}}catch{}}return}let r=w(),i;try{i=await s(r)}catch{return}for(let e of i){let t=a(r,e,n);try{let e=await l(t);if(e.size>0)return{filePath:t,projectPath:void 0,fileSize:e.size}}catch{}}}function k(){return G??(G=Buffer.from(`"compact_boundary"`))}function A(e){try{let t=JSON.parse(e);return t.type!==`system`||t.subtype!==`compact_boundary`?null:{hasPreservedSegment:!!t.compactMetadata?.preservedSegment}}catch{return null}}function j(e,t,n,r){let i=r-n;if(!(i<=0)){if(e.len+i>e.buf.length){let t=Buffer.allocUnsafe(Math.min(Math.max(e.buf.length*2,e.len+i),e.cap));e.buf.copy(t,0,0,e.len),e.buf=t}t.copy(e.buf,e.len,n,r),e.len+=i}}function M(e,t,n,r){return r-n>=t.length&&e.compare(t,0,t.length,n,n+t.length)===0}function N(e,t,n){if(e.straddleSnapCarryLen=0,e.straddleSnapTailEnd=0,e.carryLen===0)return 0;let r=e.carryBuf,i=t.indexOf(J);if(i===-1||i>=n)return 0;let a=i+1;if(M(r,K,0,e.carryLen))e.straddleSnapCarryLen=e.carryLen,e.straddleSnapTailEnd=a,e.lastSnapSrc=null;else if(e.carryLen<K.length)return 0;else{if(M(r,q,0,e.carryLen)){let n=A(r.toString(`utf-8`,0,e.carryLen)+t.toString(`utf-8`,0,i));n?.hasPreservedSegment?e.hasPreservedSegment=!0:n&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff,e.hasPreservedSegment=!1,e.lastSnapSrc=null)}j(e.out,r,0,e.carryLen),j(e.out,t,0,a)}return e.bufFileOff+=e.carryLen+a,e.carryLen=0,a}function P(e,t,n){let r=t.indexOf(n),i=0,a=0,o=-1,s=-1,c=t.indexOf(J);for(;c!==-1;){let l=c+1;if(r!==-1&&r<a&&(r=t.indexOf(n,a)),M(t,K,a,l))j(e.out,t,i,a),o=a,s=l,i=l;else if(r>=a&&r<Math.min(a+X,l)){let s=A(t.toString(`utf-8`,a,c));s?.hasPreservedSegment?e.hasPreservedSegment=!0:s&&(e.out.len=0,e.boundaryStartOffset=e.bufFileOff+a,e.hasPreservedSegment=!1,e.lastSnapSrc=null,o=-1,e.straddleSnapCarryLen=0,i=a),r=t.indexOf(n,r+n.length)}a=l,c=t.indexOf(J,a)}return j(e.out,t,i,a),{lastSnapStart:o,lastSnapEnd:s,trailStart:a}}function F(e,t,n,r,i){r===-1?e.straddleSnapCarryLen>0&&(e.lastSnapLen=e.straddleSnapCarryLen+e.straddleSnapTailEnd,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),e.carryBuf.copy(e.lastSnapBuf,0,0,e.straddleSnapCarryLen),n.copy(e.lastSnapBuf,e.straddleSnapCarryLen,0,e.straddleSnapTailEnd),e.lastSnapSrc=e.lastSnapBuf):(e.lastSnapLen=i-r,(e.lastSnapBuf===void 0||e.lastSnapLen>e.lastSnapBuf.length)&&(e.lastSnapBuf=Buffer.allocUnsafe(e.lastSnapLen)),t.copy(e.lastSnapBuf,0,r,i),e.lastSnapSrc=e.lastSnapBuf)}function I(e,t,n){e.carryLen=t.length-n,e.carryLen>0&&((e.carryBuf===void 0||e.carryLen>e.carryBuf.length)&&(e.carryBuf=Buffer.allocUnsafe(e.carryLen)),t.copy(e.carryBuf,0,n,t.length))}function L(e){if(e.carryLen>0){let t=e.carryBuf;M(t,K,0,e.carryLen)?(e.lastSnapSrc=t,e.lastSnapLen=e.carryLen):j(e.out,t,0,e.carryLen)}e.lastSnapSrc&&(e.out.len>0&&e.out.buf[e.out.len-1]!==J&&j(e.out,Y,0,1),j(e.out,e.lastSnapSrc,0,e.lastSnapLen))}async function R(e,t){let n=k(),r=U,i={out:{buf:Buffer.allocUnsafe(Math.min(t,8*1024*1024)),len:0,cap:t+1},boundaryStartOffset:0,hasPreservedSegment:!1,lastSnapSrc:null,lastSnapLen:0,lastSnapBuf:void 0,bufFileOff:0,carryLen:0,carryBuf:void 0,straddleSnapCarryLen:0,straddleSnapTailEnd:0},a=Buffer.allocUnsafe(r),s=await o(e,`r`);try{let e=0;for(;e<t;){let{bytesRead:o}=await s.read(a,0,Math.min(r,t-e),e);if(o===0)break;e+=o;let c=N(i,a,o),l;if(i.carryLen>0){let e=i.carryLen+(o-c);l=Buffer.allocUnsafe(e),i.carryBuf.copy(l,0,0,i.carryLen),a.copy(l,i.carryLen,c,o)}else l=a.subarray(c,o);let u=P(i,l,n);F(i,l,a,u.lastSnapStart,u.lastSnapEnd),I(i,l,u.trailStart),i.bufFileOff+=u.trailStart}L(i)}finally{await s.close()}return{boundaryStartOffset:i.boundaryStartOffset,postBoundaryBuf:i.out.buf.subarray(0,i.out.len),hasPreservedSegment:i.hasPreservedSegment}}var z,B,V,H,U,W,G,K,q,J,Y,X,Z=e((()=>{n(),m(),r(),z=65536,B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,V=/^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/,H=/<command-name>(.*?)<\/command-name>/,U=1024*1024,W=5*1024*1024,K=Buffer.from(`{"type":"attribution-snapshot"`),q=Buffer.from(`{"type":"system"`),J=10,Y=Buffer.from([J]),X=256}));export{m as _,_ as a,w as c,x as d,R as f,f as g,h,y as i,Z as l,C as m,W as n,v as o,O as p,E as r,D as s,z as t,b as u};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Ln as t,wn as n}from"./schemas-BGAvj1T4.js";import{t as r}from"./v4-f1i_CNUT.js";import{U as i,cn as a}from"./state-sIHsFpDu.js";import{l as o,p as s}from"./debug-otxXY3j-.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{s as u,u as d}from"./types-KeqFPzY5.js";import{n as f,t as p}from"./lazySchema-B0QShMaQ.js";import{Uo as m,ck as h,ko as g,nt as _,tt as v}from"./loadAgentsDir-ClTeo0nk.js";import{X as y}from"./rcDebugLog-CwU_wJBE.js";function b(e){let t=[];for(let n of e){if(n.type!==`user`&&n.type!==`assistant`||`isMeta`in n&&n.isMeta||`origin`in n&&n.origin&&n.origin.kind!==`human`)continue;let e=n.message.content;if(typeof e==`string`)t.push(e);else if(Array.isArray(e))for(let n of e)`type`in n&&n.type===`text`&&`text`in n&&t.push(n.text)}let n=t.join(`
|
|
2
|
+
`);return n.length>S?n.slice(-S):n}async function x(e,t){let n=e.trim();if(!n)return null;try{let e=g((await _({systemPrompt:y([C]),userPrompt:n,outputFormat:{type:`json_schema`,schema:{type:`object`,properties:{title:{type:`string`}},required:[`title`],additionalProperties:!1}},signal:t,options:{querySource:`generate_session_title`,agents:[],isNonInteractiveSession:i(),hasAppendSystemPrompt:!1,mcpTools:[]}})).message.content),r=w().safeParse(d(e)),a=r.success&&r.data.title.trim()||null;return l(`tengu_session_title_generated`,{success:a!==null}),a}catch(e){return s(`generateSessionTitle failed: ${e}`,{level:`error`}),l(`tengu_session_title_generated`,{success:!1}),null}}var S,C,w,T=e((()=>{r(),a(),c(),v(),o(),u(),p(),m(),h(),S=1e3,C=`Generate a concise, sentence-case title (3-7 words) that captures the main topic or goal of this coding session. The title should be clear enough that the user recognizes the session in a list. Use sentence case: capitalize only the first word and proper nouns.
|
|
3
|
+
|
|
4
|
+
Return JSON with a single "title" field.
|
|
5
|
+
|
|
6
|
+
Good examples:
|
|
7
|
+
{"title": "Fix login button on mobile"}
|
|
8
|
+
{"title": "Add OAuth authentication"}
|
|
9
|
+
{"title": "Debug failing CI tests"}
|
|
10
|
+
{"title": "Refactor API client error handling"}
|
|
11
|
+
|
|
12
|
+
Bad (too vague): {"title": "Code changes"}
|
|
13
|
+
Bad (too long): {"title": "Investigate and fix the issue where the login button does not respond on mobile devices"}
|
|
14
|
+
Bad (wrong case): {"title": "Fix Login Button On Mobile"}`,w=f(()=>n({title:t()}))}));export{x as n,T as r,b as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{n as r,r as i,s as a}from"./esm-CJlBxjtx.js";import{Ct as o,N as s,U as c,cn as l,pt as u}from"./state-sIHsFpDu.js";import{J as d,S as f,Z as p,Zt as m,_ as h,at as g,hc as _,on as ee,st as te,yc as ne}from"./paths-DO4WOQtD.js";import{D as re,E as ie,O as v,U as ae,l as oe,p as se}from"./debug-otxXY3j-.js";import{i as ce,t as le}from"./hash-CaUkS-30.js";import{i as ue,l as de,n as fe,t as pe}from"./teammate-CbskW5G9.js";import"path";import"fs";import{createHash as me}from"crypto";import"fs/promises";import{AsyncLocalStorage as he}from"async_hooks";function ge(e){let t=BigInt(58),n=Array(b).fill(y[0]),r=b-1,i=e;for(;i>0n;)n[r]=y[Number(i%t)],i/=t,r--;return n.join(``)}function _e(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x`+t)}function ve(e,t){return`${e}_${ye}${ge(_e(t))}`}var y,ye,b,be=e((()=>{y=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,ye=`01`,b=22}));function x(e){let t=xe[e],r=process.env[e];return r===void 0?t:n(r)}function S(){let e=_(),t=o(),n={"user.id":e};x(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),x(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`2.7.2`);let r=m();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&x(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||ve(`user`,i))}return g.terminal&&(n[`terminal.type`]=g.terminal),n}var xe,C=e((()=>{l(),ee(),ne(),te(),t(),be(),xe={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function Se(){return n(process.env.OTEL_LOG_USER_PROMPTS)}function Ce(e){return Se()?e:`<REDACTED>`}async function w(e,t={}){let n=s();if(!n){T||(T=!0,se(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...S(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":we++},i=u();i&&(r[`prompt.id`]=i);let a=process.env.CLAUDE_CODE_WORKSPACE_HOST_PATHS;a&&(r[`workspace.host_paths`]=a.split(`|`));for(let[e,n]of Object.entries(t))n!==void 0&&(r[e]=n);n.emit({body:`claude_code.${e}`,attributes:r})}var we,T,Te=e((()=>{l(),oe(),t(),C(),we=0,T=!1}));function Ee(e){return Math.abs(le(e))||1}function De(e){let t=L.get(e);return t===void 0?(I++,L.set(e,I),I):t}function E(){let e=pe()??o(),t=fe()??`main`,n=ue(),r=P.get(e);if(r)return r;let i={agentId:e,agentName:t,parentAgentId:n,processId:e===o()?1:De(e),threadId:Ee(t)};return P.set(e,i),F++,i}function D(){return(Date.now()-Be)*1e3}function O(){return`span_${++Ve}`}function Oe(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;se(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function ke(e){A&&(j.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),j.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&j.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function k(){return A}function Ae(e,t,n){if(!A)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:De(e),threadId:Ee(t)};P.set(e,r),F++,ke(r)}function je(e){A&&(P.delete(e),L.delete(e))}function Me(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`API Call`,category:`api`,startTime:D(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),M.push({name:`API Call`,cat:`api`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function Ne(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a=t.promptTokens??n.args.prompt_tokens,o=t.ttftMs,s=t.ttltMs,c=t.outputTokens,l=t.cacheReadTokens,u=o!==void 0&&a!==void 0&&o>0?Math.round(a/(o/1e3)*100)/100:void 0,d=s!==void 0&&o!==void 0?s-o:void 0,f=d!==void 0&&c!==void 0&&d>0?Math.round(c/(d/1e3)*100)/100:void 0,p=l!==void 0&&a!==void 0&&a>0?Math.round(l/a*1e4)/100:void 0,m=t.requestSetupMs,h=t.attemptStartTimes,g={...n.args,ttft_ms:o,ttlt_ms:s,prompt_tokens:a,output_tokens:c,cache_read_tokens:l,cache_creation_tokens:t.cacheCreationTokens,message_id:t.messageId??n.args.message_id,success:t.success??!0,error:t.error,duration_ms:i/1e3,request_setup_ms:m,itps:u,otps:f,cache_hit_rate_pct:p},_=m!==void 0&&m>0?m*1e3:0;if(_>0){let e=n.startTime+_;if(M.push({name:`Request Setup`,cat:`api,setup`,ph:`B`,ts:n.startTime,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{request_setup_ms:m,attempt_count:h?.length??1}}),h&&h.length>1){let e=h[0];for(let t=0;t<h.length-1;t++){let r=n.startTime+(h[t]-e)*1e3,i=n.startTime+(h[t+1]-e)*1e3;M.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`B`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{attempt:t+1}}),M.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}M.push({name:`Request Setup`,cat:`api,setup`,ph:`E`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}if(o!==void 0){let e=n.startTime+_,t=e+o*1e3;M.push({name:`First Token`,cat:`api,ttft`,ph:`B`,ts:e,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{ttft_ms:o,prompt_tokens:a,itps:u,cache_hit_rate_pct:p}}),M.push({name:`First Token`,cat:`api,ttft`,ph:`E`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId});let r=s===void 0?void 0:s-o-_/1e3;r!==void 0&&r>0&&(M.push({name:`Sampling`,cat:`api,sampling`,ph:`B`,ts:t,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:{sampling_ms:r,output_tokens:c,otps:f}}),M.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:g}),N.delete(e)}function Pe(e,t){if(!A)return``;let n=O(),r=E();return N.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:D(),agentInfo:r,args:{tool_name:e,...t}}),M.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:N.get(n).startTime,pid:r.processId,tid:r.threadId,args:N.get(n).args}),n}function Fe(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),N.delete(e)}function Ie(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:D(),agentInfo:n,args:{context:e}}),M.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function Le(e,t){if(!A||!e)return;let n=N.get(e);if(!n)return;let r=D(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};M.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),N.delete(e)}function Re(e){if(!A)return``;let t=O(),n=E();return N.set(t,{name:`Interaction`,category:`interaction`,startTime:D(),agentInfo:n,args:{user_prompt_length:e?.length}}),M.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:N.get(t).startTime,pid:n.processId,tid:n.threadId,args:N.get(t).args}),t}function ze(e){if(!A||!e)return;let t=N.get(e);if(!t)return;let n=D(),r=n-t.startTime;M.push({name:t.name,cat:t.category,ph:`E`,ts:n,pid:t.agentInfo.processId,tid:t.agentInfo.threadId,args:{...t.args,duration_ms:r/1e3}}),N.delete(e)}var A,j,M,N,P,F,Be,Ve,I,L,He=e((()=>{l(),oe(),t(),ae(),ce(),ie(),de(),A=!1,j=[],M=[],N=new Map,P=new Map,F=0,Be=0,Ve=0,I=1,L=new Map}));function Ue(){H.clear(),U.clear()}function R(){return n(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT?process.env.USER_TYPE===`ant`?!0:c()||h(`tengu_trace_lantern`,!1):!1}function z(e,t=Qe){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
|
|
2
|
+
|
|
3
|
+
[TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function B(e){return me(`sha256`).update(e).digest(`hex`).slice(0,12)}function We(e){return`sp_${B(e)}`}function Ge(e){return`msg_${B(v(e.message.content))}`}function V(e){let t=e.trim().match($e);return t&&t[1]?t[1].trim():null}function Ke(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=V(e);r?n.push(r):t.push(`[USER]\n${e}`)}else if(Array.isArray(e)){for(let r of e)if(r.type===`text`){let e=V(r.text);e?n.push(e):t.push(`[USER]\n${r.text}`)}else if(r.type===`tool_result`){let e=typeof r.content==`string`?r.content:v(r.content),i=V(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function qe(e,t){if(!R())return;let{content:n,truncated:r}=z(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function Je(e,t,n){if(R()){if(t?.systemPrompt){let n=We(t.systemPrompt),r=t.systemPrompt.slice(0,500);if(e.setAttribute(`system_prompt_hash`,n),e.setAttribute(`system_prompt_preview`,r),e.setAttribute(`system_prompt_length`,t.systemPrompt.length),!H.has(n)){H.add(n);let{content:e,truncated:r}=z(t.systemPrompt);w(`system_prompt`,{system_prompt_hash:n,system_prompt:e,system_prompt_length:String(t.systemPrompt.length),...r&&{system_prompt_truncated:`true`}})}}if(t?.tools)try{let n=re(t.tools).map(e=>{let t=v(e),n=B(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,v(n.map(({name:e,hash:t})=>({name:e,hash:t})))),e.setAttribute(`tools_count`,n.length);for(let{name:e,hash:t,json:r}of n)if(!H.has(`tool_${t}`)){H.add(`tool_${t}`);let{content:n,truncated:i}=z(r);w(`tool`,{tool_name:p(e),tool_hash:t,tool:n,...i&&{tool_truncated:`true`}})}}catch{e.setAttribute(`tools_parse_error`,!0)}if(n&&n.length>0&&t?.querySource){let r=t.querySource,i=U.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&Ge(t)===i){a=e+1;break}}let o=n.slice(a).filter(e=>e.type===`user`);if(o.length>0){let{contextParts:t,systemReminders:i}=Ke(o);if(t.length>0){let n=t.join(`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`),{content:r,truncated:i}=z(n);e.setAttributes({new_context:r,new_context_message_count:o.length,...i&&{new_context_truncated:!0,new_context_original_length:n.length}})}if(i.length>0){let t=i.join(`
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
`),{content:n,truncated:r}=z(t);e.setAttributes({system_reminders:n,system_reminders_count:i.length,...r&&{system_reminders_truncated:!0,system_reminders_original_length:t.length}})}let a=n[n.length-1];a&&U.set(r,Ge(a))}}}}function Ye(e,t){if(!(!R()||!t)){if(t.modelOutput!==void 0){let{content:n,truncated:r}=z(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}if(process.env.USER_TYPE===`ant`&&t.thinkingOutput!==void 0){let{content:n,truncated:r}=z(t.thinkingOutput);e[`response.thinking_output`]=n,r&&(e[`response.thinking_output_truncated`]=!0,e[`response.thinking_output_original_length`]=t.thinkingOutput.length)}}}function Xe(e,t,n){if(!R())return;let{content:r,truncated:i}=z(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function Ze(e,t,n){if(!R())return;let{content:r,truncated:i}=z(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var H,U,Qe,$e,et=e((()=>{l(),f(),d(),t(),ie(),Te(),H=new Set,U=new Map,Qe=60*1024,$e=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function W(e){return e.spanContext().spanId||``}function tt(){if($)return;$=!0;let e=setInterval(()=>{let e=Date.now()-_t;for(let[t,n]of X){let r=n.deref();r===void 0?(X.delete(t),Z.delete(t)):r.startTime<e&&(r.ended||r.span.end(),X.delete(t),Z.delete(t))}},6e4);typeof e.unref==`function`&&e.unref()}function nt(){return!1}function G(){return nt()||R()}function K(){return i.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function q(e,t={}){return{...S(),"span.type":e,...t}}function rt(e){tt();let t=k()?Re(e):void 0;if(!G()){if(t){let e=i.getActiveSpan()||K().startSpan(`dummy`),n=W(e),r={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:t};return X.set(n,new WeakRef(r)),J.enterWith(r),e}return i.getActiveSpan()||K().startSpan(`dummy`)}let r=K(),a=n(process.env.OTEL_LOG_USER_PROMPTS)?e:`<REDACTED>`;Q++;let o=q(`interaction`,{user_prompt:a,user_prompt_length:e.length,"interaction.sequence":Q}),s=r.startSpan(`claude_code.interaction`,{attributes:o});qe(s,e);let c=W(s),l={span:s,startTime:Date.now(),attributes:o,perfettoSpanId:t};return X.set(c,new WeakRef(l)),J.enterWith(l),s}function it(){let e=J.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&ze(e.perfettoSpanId),!G()){e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0);return}let t=Date.now()-e.startTime;e.span.setAttributes({"interaction.duration_ms":t}),e.span.end(),e.ended=!0,X.delete(W(e.span)),J.enterWith(void 0)}function at(e,t,n,r){let o=k()?Me({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!G()){if(o){let t=i.getActiveSpan()||K().startSpan(`dummy`),n=W(t),r={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:o};return X.set(n,new WeakRef(r)),Z.set(n,r),t}return i.getActiveSpan()||K().startSpan(`dummy`)}let s=K(),c=J.getStore(),l=q(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:r?`fast`:`normal`}),u=c?i.setSpan(a.active(),c.span):a.active(),d=s.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),Je(d,t,n);let f=W(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:o};return X.set(f,new WeakRef(p)),Z.set(f,p),d}function ot(e,t){let n;if(e){let t=W(e);n=X.get(t)?.deref()}else n=Array.from(X.values()).findLast(e=>{let t=e.deref();return t?.attributes[`span.type`]===`llm_request`||t?.attributes.model})?.deref();if(!n)return;let r=Date.now()-n.startTime;if(n.perfettoSpanId&&Ne(n.perfettoSpanId,{ttftMs:t?.ttftMs,ttltMs:r,promptTokens:t?.inputTokens,outputTokens:t?.outputTokens,cacheReadTokens:t?.cacheReadTokens,cacheCreationTokens:t?.cacheCreationTokens,success:t?.success,error:t?.error,requestSetupMs:t?.requestSetupMs,attemptStartTimes:t?.attemptStartTimes}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let i={duration_ms:r};t&&(t.inputTokens!==void 0&&(i.input_tokens=t.inputTokens),t.outputTokens!==void 0&&(i.output_tokens=t.outputTokens),t.cacheReadTokens!==void 0&&(i.cache_read_tokens=t.cacheReadTokens),t.cacheCreationTokens!==void 0&&(i.cache_creation_tokens=t.cacheCreationTokens),t.success!==void 0&&(i.success=t.success),t.statusCode!==void 0&&(i.status_code=t.statusCode),t.error!==void 0&&(i.error=t.error),t.attempt!==void 0&&(i.attempt=t.attempt),t.hasToolCall!==void 0&&(i[`response.has_tool_call`]=t.hasToolCall),t.ttftMs!==void 0&&(i.ttft_ms=t.ttftMs),Ye(i,t)),n.span.setAttributes(i),n.span.end();let a=W(n.span);X.delete(a),Z.delete(a)}function st(e,t,n){let r=k()?Pe(e,t):void 0;if(!G()){if(r){let t=i.getActiveSpan()||K().startSpan(`dummy`),n=W(t),a={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:r};return X.set(n,new WeakRef(a)),Y.enterWith(a),t}return i.getActiveSpan()||K().startSpan(`dummy`)}let o=K(),s=J.getStore(),c=q(`tool`,{tool_name:e,...t}),l=s?i.setSpan(a.active(),s.span):a.active(),u=o.startSpan(`claude_code.tool`,{attributes:c},l);n&&Xe(u,e,n);let d=W(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:r};return X.set(d,new WeakRef(f)),Y.enterWith(f),u}function ct(){let e=k()?Ie(`tool_permission`):void 0;if(!G()){if(e){let t=i.getActiveSpan()||K().startSpan(`dummy`),n=W(t),r={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return X.set(n,new WeakRef(r)),Z.set(n,r),t}return i.getActiveSpan()||K().startSpan(`dummy`)}let t=K(),n=Y.getStore(),r=q(`tool.blocked_on_user`),o=n?i.setSpan(a.active(),n.span):a.active(),s=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:r},o),c=W(s),l={span:s,startTime:Date.now(),attributes:r,perfettoSpanId:e};return X.set(c,new WeakRef(l)),Z.set(c,l),s}function lt(e,t){let n=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.blocked_on_user`)?.deref();if(!n)return;if(n.perfettoSpanId&&Le(n.perfettoSpanId,{decision:e,source:t}),!G()){let e=W(n.span);X.delete(e),Z.delete(e);return}let r={duration_ms:Date.now()-n.startTime};e&&(r.decision=e),t&&(r.source=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Z.delete(i)}function ut(){if(!G())return i.getActiveSpan()||K().startSpan(`dummy`);let e=K(),t=Y.getStore(),n=q(`tool.execution`),r=t?i.setSpan(a.active(),t.span):a.active(),o=e.startSpan(`claude_code.tool.execution`,{attributes:n},r),s=W(o),c={span:o,startTime:Date.now(),attributes:n};return X.set(s,new WeakRef(c)),Z.set(s,c),o}function dt(e){if(!G())return;let t=Array.from(X.values()).findLast(e=>e.deref()?.attributes[`span.type`]===`tool.execution`)?.deref();if(!t)return;let n={duration_ms:Date.now()-t.startTime};e&&(e.success!==void 0&&(n.success=e.success),e.error!==void 0&&(n.error=e.error)),t.span.setAttributes(n),t.span.end();let r=W(t.span);X.delete(r),Z.delete(r)}function ft(e,t){let n=Y.getStore();if(!n)return;if(n.perfettoSpanId&&Fe(n.perfettoSpanId,{success:!0,resultTokens:t}),!G()){let e=W(n.span);X.delete(e),Y.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&Ze(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=W(n.span);X.delete(i),Y.enterWith(void 0)}function pt(){return n(process.env.OTEL_LOG_TOOL_CONTENT)}function mt(e,t){if(!G()||!pt())return;let n=Y.getStore();if(!n)return;let r={};for(let[e,n]of Object.entries(t))if(typeof n==`string`){let{content:t,truncated:i}=z(n);r[e]=t,i&&(r[`${e}_truncated`]=!0,r[`${e}_original_length`]=n.length)}else r[e]=n;n.span.addEvent(e,r)}function ht(e,t,n,r){if(!R())return i.getActiveSpan()||K().startSpan(`dummy`);let o=K(),s=Y.getStore()??J.getStore(),c=q(`hook`,{hook_event:e,hook_name:t,num_hooks:n,hook_definitions:r}),l=s?i.setSpan(a.active(),s.span):a.active(),u=o.startSpan(`claude_code.hook`,{attributes:c},l),d=W(u),f={span:u,startTime:Date.now(),attributes:c};return X.set(d,new WeakRef(f)),Z.set(d,f),u}function gt(e,t){if(!R())return;let n=W(e),r=X.get(n)?.deref();if(!r)return;let i={duration_ms:Date.now()-r.startTime};t&&(t.numSuccess!==void 0&&(i.num_success=t.numSuccess),t.numBlocking!==void 0&&(i.num_blocking=t.numBlocking),t.numNonBlockingError!==void 0&&(i.num_non_blocking_error=t.numNonBlockingError),t.numCancelled!==void 0&&(i.num_cancelled=t.numCancelled)),r.span.setAttributes(i),r.span.end(),X.delete(n),Z.delete(n)}var J,Y,X,Z,Q,$,_t,vt=e((()=>{r(),f(),t(),C(),et(),He(),J=new he,Y=new he,X=new Map,Z=new Map,Q=0,$=!1,_t=1800*1e3}));export{je as C,S as D,Ce as E,C as O,Ae as S,w as T,et as _,lt as a,Oe as b,vt as c,rt as d,at as f,Ue as g,st as h,ot as i,nt as l,ut as m,gt as n,dt as o,ct as p,it as r,ft as s,mt as t,ht as u,R as v,Te as w,k as x,He as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Cn as t,Ln as n,Mn as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{cn as o}from"./state-sIHsFpDu.js";import{Fa as s,S as c,on as l,oo as u,yc as d}from"./paths-DO4WOQtD.js";import{U as f}from"./debug-otxXY3j-.js";import{P as p,v as m}from"./git-C0IuvuIy.js";import{u as h}from"./oauth-CdZEzMww.js";import{n as g,t as _}from"./lazySchema-B0QShMaQ.js";import{$a as v,Qk as y}from"./loadAgentsDir-ClTeo0nk.js";import"path";import"fs/promises";var b,x=e((()=>{a(),_(),b=g(()=>i({entries:r(n(),n())})),g(()=>i({userId:n(),version:t(),lastModified:n(),checksum:n(),content:b()}))})),S=e((()=>{o(),h(),l(),y(),d(),p(),f(),m(),s(),u(),c(),v(),x()}));export{S as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{In as r,Ln as i}from"./src-Di342QoJ.js";import{Ct as ee,U as a,cn as o,dr as s,jr as c,lr as l,ut as te}from"./state-sIHsFpDu.js";import{Cc as u,Cn as ne,at as d,dc as f,it as p,lc as re,on as m,rt as h,st as g,yc as _}from"./paths-DO4WOQtD.js";import{U as v,z as y}from"./debug-otxXY3j-.js";import{n as b,r as x}from"./analytics-DqMQntaB.js";import{n as S,t as C}from"./cwd--iizewsn.js";import{F as w,P as T,f as ie,n as E,r as D,v as O}from"./git-C0IuvuIy.js";import{a as k,n as A}from"./env-C2A9gV_G.js";import{o as j,s as M}from"./log-DSV4Ht5l.js";import{a as N,n as P}from"./startupProfiler-CAntGAbs.js";import{Cn as F,Di as I,Fr as L,It as R,KE as z,Ot as B,Qk as V,Sn as H,St as U,Zi as W,_C as G,cy as K,gC as q,gx as J,gy as Y,hC as ae,ly as oe,mh as X,na as se,ph as ce,qE as le,qk as ue,ux as de,vy as fe,wt as Z,xt as pe}from"./loadAgentsDir-ClTeo0nk.js";import{l as me,u as he}from"./terminalSetup-hLCi-2uB.js";import{c as ge,n as _e}from"./releaseNotes-BPA229-J.js";import{s as ve,u as ye}from"./logoV2Utils-DAIIwt5R.js";import{i as be,r as xe}from"./runtimeObserver-BUOcYxiK.js";import{n as Q,r as Se}from"./sessionMemory-pT4lc1C-.js";import{t as Ce}from"./sinks-BT_lBY6T.js";import{homedir as we}from"os";import{join as Te}from"path";import{copyFile as Ee,stat as De}from"fs/promises";t(),i(),o(),b(),S(),v(),T(),k(),O(),m(),g(),h(),V(),le(),q(),he(),K(),ce(),se(),L(),F(),ge(),be(),Se(),_(),j();function $(){u(e=>({...e,iterm2SetupInProgress:!1}))}function Oe(){let e=f();return{inProgress:e.iterm2SetupInProgress??!1,backupPath:e.iterm2BackupPath||null}}function ke(){return Te(we(),`Library`,`Preferences`,`com.googlecode.iterm2.plist`)}async function Ae(){let{inProgress:e,backupPath:t}=Oe();if(!e)return{status:`no_backup`};if(!t)return $(),{status:`no_backup`};try{await De(t)}catch{return $(),{status:`no_backup`}}try{return await Ee(t,ke()),$(),{status:`restored`}}catch(e){return M(Error(`Failed to restore iTerm2 settings with: ${e}`)),$(),{status:`failed`,backupPath:t}}}_(),j(),ye(),de(),fe(),P(),B();async function je(t,i,o,u,m,h,g,_,v){w(`info`,`setup_started`);let b=process.version.match(/^v(\d+)\./)?.[1];if((!b||parseInt(b,10)<18)&&(console.error(r.bold.red(`Error: Claude Code requires Node.js version 18 or higher.`)),process.exit(1)),g&&c(z(g)),e(),!e()&&p()){let{captureTeammateModeSnapshot:e}=await import(`./teammateModeSnapshot-AdUFmPGC.js`);e()}if(!a()){if(p()){let e=await Ae();e.status===`restored`?console.log(r.yellow(`Detected an interrupted iTerm2 setup. Your original settings have been restored. You may need to restart iTerm2 for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore iTerm2 settings. Please manually restore your original settings with: defaults import com.googlecode.iterm2 ${e.backupPath}.`))}try{let e=await me();e.status===`restored`?console.log(r.yellow(`Detected an interrupted Terminal.app setup. Your original settings have been restored. You may need to restart Terminal.app for the changes to take effect.`)):e.status===`failed`&&console.error(r.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){M(e)}}X(t);let S=Date.now();if(ae(),w(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-S}),oe(t),u){let e=H(),n=await ie();!e&&!n&&(process.stderr.write(r.red(`Error: Can only use --worktree in a git repository, but ${r.bold(t)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let i=_?`pr-${_}`:m??Y(),a;if(n){let e=E(C());e||(process.stderr.write(r.red(`Error: Could not determine the main git repository root.
|
|
2
|
+
`)),process.exit(1)),e!==(D(C())??C())&&(w(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),X(e)),a=h?Z(e,R(i)):void 0}else a=h?Z(C(),R(i)):void 0;let o;try{o=await U(ee(),i,a,_?{prNumber:_}:void 0)}catch(e){process.stderr.write(r.red(`Error creating worktree: ${y(e)}\n`)),process.exit(1)}if(x(`tengu_worktree_created`,{tmux_enabled:h}),h&&a){let e=await pe(a,o.worktreePath);e.created?console.log(r.green(`Created tmux session: ${r.bold(a)}\nTo attach: ${r.bold(`tmux attach -t ${a}`)}`)):console.error(r.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(o.worktreePath),X(o.worktreePath),l(C()),s(C()),I(o),ue(),G()}w(`info`,`setup_background_jobs_starting`),e()||(Q(),xe()),J(),w(`info`,`setup_background_jobs_launched`),N(`setup_before_prefetch`),w(`info`,`setup_prefetch_starting`);let T=a()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||e();if(T||W(te()),import(`./loadPluginHooks-DVZmzYLl.js`).then(e=>{T||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),e()||(process.env.USER_TYPE===`ant`&&import(`./commitAttribution-BwT0TbYF.js`).then(async e=>{if(await e.isInternalModelRepo()){let{clearSystemPromptSections:e}=await import(`./systemPromptSections-CVpefuSD.js`);e()}}),setImmediate(()=>{import(`./attributionHooks-VGSpz4mk.js`).then(({registerAttributionHooks:e})=>{e()})}),import(`./sessionFileAccessHooks-DVilA3Mm.js`).then(e=>e.registerSessionFileAccessHooks())),Ce(),x(`tengu_started`,{}),ne(a()),N(`setup_after_prefetch`),!e()){let{hasReleaseNotes:e}=await _e(f().lastReleaseNotesSeen);e&&await ve()}if((i===`bypassPermissions`||o)&&(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP)&&(console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1)),process.env.USER_TYPE===`ant`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`)){let[e,t]=await Promise.all([d.getIsDocker(),A.hasInternetAccess()]),n=d.getIsBubblewrapSandbox(),r=process.env.IS_SANDBOX===`1`;(!(e||n||r)||t)&&(console.error(`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${e}, Bubblewrap: ${n}, IS_SANDBOX: ${r}, hasInternet: ${t}`),process.exit(1))}let O=re();O.lastCost!==void 0&&O.lastDuration!==void 0&&x(`tengu_exit`,{last_session_cost:O.lastCost,last_session_api_duration:O.lastAPIDuration,last_session_tool_duration:O.lastToolDuration,last_session_duration:O.lastDuration,last_session_lines_added:O.lastLinesAdded,last_session_lines_removed:O.lastLinesRemoved,last_session_total_input_tokens:O.lastTotalInputTokens,last_session_total_output_tokens:O.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:O.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:O.lastTotalCacheReadInputTokens,last_session_fps_average:O.lastFpsAverage,last_session_fps_low_1_pct:O.lastFpsLow1Pct,last_session_id:O.lastSessionId,...O.lastSessionMetrics})}export{je as setup};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,n,s as r,u as i}from"./envUtils-BWeoiL4Y.js";import{i as a,t as o}from"./src-BJz1KAd_.js";import{H as ee,U as s,cn as te,yt as ne}from"./state-sIHsFpDu.js";import{Cc as c,S as l,_ as u,dc as d,yc as f}from"./paths-DO4WOQtD.js";import{E as p,K as m,O as re,U as h,l as g,p as _}from"./debug-otxXY3j-.js";import{n as v,t as ie}from"./bundledMode-kSQejuY4.js";import{i as y,o as ae}from"./platform-mh9ypxS8.js";import{n as oe,r as se}from"./execFileNoThrow-azCkYhmF.js";import{n as b,t as x}from"./distRoot-BNg_iO5-.js";import{a as S,c as C,d as w,n as T,r as E,t as D}from"./common-Da57Qwms.js";import{a as O,i as k}from"./prompt-IqfIbvg9.js";import{homedir as A}from"os";import{join as j}from"path";import{chmod as M,mkdir as N,readFile as P,readdir as F,writeFile as I}from"fs/promises";function L(){return process.env.USER_TYPE===`ant`?[B,V,H]:[B]}async function R(e,t){if(e.length===0)return t?.(`[Claude in Chrome] No browser paths to check`),{isInstalled:!1,browser:null};let n=L();for(let{browser:r,path:i}of e){let e=[];try{e=await F(i,{withFileTypes:!0})}catch(e){if(m(e))continue;throw e}let a=e.filter(e=>e.isDirectory()).filter(e=>e.name===`Default`||e.name.startsWith(`Profile `)).map(e=>e.name);a.length>0&&t?.(`[Claude in Chrome] Found ${r} profiles: ${a.join(`, `)}`);for(let e of a)for(let a of n){let n=j(i,e,`Extensions`,a);try{return await F(n),t?.(`[Claude in Chrome] Extension ${a} found in ${r} ${e}`),{isInstalled:!0,browser:r}}catch{}}}return t?.(`[Claude in Chrome] Extension not found in any browser`),{isInstalled:!1,browser:null}}async function z(e,t){return(await R(e,t)).isInstalled}var B,V,H,U=e((()=>{h(),B=`fcoeoabgfenejglbffodgkkbkcdhcgfn`,V=`dihbgbndebgnbjfmelmegjepbnkhlgni`,H=`dngcpimnedloihjnnfngkgjoidhnaolf`}));function W(e){if(s()&&e!==!0)return!1;if(e===!0)return!0;if(e===!1)return!1;if(i(process.env.CLAUDE_CODE_ENABLE_CFC))return!0;if(t(process.env.CLAUDE_CODE_ENABLE_CFC))return!1;let n=d();return n.claudeInChromeDefaultEnabled===void 0?!1:n.claudeInChromeDefaultEnabled}function G(){return $===void 0&&($=ee()&&ue()&&(process.env.USER_TYPE===`ant`||u(`tengu_chrome_auto_enable`,!1))),$}function K(){let e=v(),t=a.map(e=>`mcp__claude-in-chrome__${e.name}`),n={};ne()&&(n.CLAUDE_CHROME_PERMISSION_MODE=`skip_all_permission_checks`);let r=Object.keys(n).length>0;if(e)return J(`"${process.execPath}" --chrome-native-host`).then(e=>q(e)).catch(e=>_(`[Claude in Chrome] Failed to install native host: ${e}`,{level:`error`})),{mcpConfig:{[D]:{type:`stdio`,command:process.execPath,args:[`--claude-in-chrome-mcp`],scope:`dynamic`,...r&&{env:n}}},allowedTools:t,systemPrompt:k()};{let e=j(x,`cli.js`);return J(`"${process.execPath}" "${e}" --chrome-native-host`).then(e=>q(e)).catch(e=>_(`[Claude in Chrome] Failed to install native host: ${e}`,{level:`error`})),{mcpConfig:{[D]:{type:`stdio`,command:process.execPath,args:[`${e}`,`--claude-in-chrome-mcp`],scope:`dynamic`,...r&&{env:n}}},allowedTools:t,systemPrompt:k()}}}function ce(){if(y()===`windows`){let e=A();return[j(process.env.APPDATA||j(e,`AppData`,`Local`),`Claude Code`,`ChromeNativeHost`)]}return E().map(({path:e})=>e)}async function q(e){let t=ce();if(t.length===0)throw Error(`Claude in Chrome Native Host not supported on this platform`);let n=re({name:Z,description:`Claude Code Browser Extension Native Host`,path:e,type:`stdio`,allowed_origins:[`chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/`,...process.env.USER_TYPE===`ant`?[`chrome-extension://dihbgbndebgnbjfmelmegjepbnkhlgni/`,`chrome-extension://dngcpimnedloihjnnfngkgjoidhnaolf/`]:[]]},null,2),r=!1;for(let e of t){let t=j(e,Q);if(await P(t,`utf-8`).catch(()=>null)!==n)try{await N(e,{recursive:!0}),await I(t,n),_(`[Claude in Chrome] Installed native host manifest at: ${t}`),r=!0}catch(e){_(`[Claude in Chrome] Failed to install manifest at ${t}: ${e}`)}}y()===`windows`&&le(j(t[0],Q)),r&&Y().then(e=>{e?(_(`[Claude in Chrome] First-time install detected, opening reconnect page in browser`),w(X)):_(`[Claude in Chrome] First-time install detected, but extension not installed, skipping reconnect`)})}function le(e){let t=S();for(let{browser:n,key:r}of t){let t=`${r}\\${Z}`;oe(`reg`,[`add`,t,`/ve`,`/t`,`REG_SZ`,`/d`,e,`/f`]).then(e=>{e.code===0?_(`[Claude in Chrome] Registered native host for ${n} in Windows registry: ${t}`):_(`[Claude in Chrome] Failed to register native host for ${n} in Windows registry: ${e.stderr}`)})}}async function J(e){let t=y(),r=j(n(),`chrome`),i=t===`windows`?j(r,`chrome-native-host.bat`):j(r,`chrome-native-host`),a=t===`windows`?`@echo off
|
|
2
|
+
REM Chrome native host wrapper script
|
|
3
|
+
REM Generated by Claude Code - do not edit manually
|
|
4
|
+
${e}
|
|
5
|
+
`:`#!/bin/sh
|
|
6
|
+
# Chrome native host wrapper script
|
|
7
|
+
# Generated by Claude Code - do not edit manually
|
|
8
|
+
exec ${e}
|
|
9
|
+
`;return await P(i,`utf-8`).catch(()=>null)===a?i:(await N(r,{recursive:!0}),await I(i,a),t!==`windows`&&await M(i,493),_(`[Claude in Chrome] Created Chrome native host wrapper script: ${i}`),i)}function ue(){return Y().then(e=>{e&&d().cachedChromeExtensionInstalled!==e&&c(t=>({...t,cachedChromeExtensionInstalled:e}))}),d().cachedChromeExtensionInstalled??!1}async function Y(){let e=T();return e.length===0?(_(`[Claude in Chrome] Unsupported platform for extension detection: ${y()}`),!1):z(e,_)}var X,Z,Q,$,de=e((()=>{o(),te(),l(),ie(),b(),f(),g(),r(),se(),ae(),p(),C(),O(),U(),X=`https://clau.de/chrome/reconnect`,Z=`com.anthropic.claude_code_browser_extension`,Q=`${Z}.json`}));export{W as a,G as i,Y as n,K as r,de as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Qo as e,qo as t}from"./paths-DO4WOQtD.js";import{n,t as r}from"./bundledMode-kSQejuY4.js";import{o as i,r as a,t as o}from"./common-NEOWMwtB.js";import{n as s,t as c}from"./distRoot-BNg_iO5-.js";import{i as l,t as u}from"./src-Cu58IYYb.js";import{i as d,t as f}from"./gates-vlrMjO-X.js";import{join as p}from"path";u(),e(),r(),s(),i(),d();function m(){let e=l(o,f()).map(e=>t(a,e.name)),r=n()?[`--computer-use-mcp`]:[p(c,`cli.js`),`--computer-use-mcp`];return{mcpConfig:{[a]:{type:`stdio`,command:process.execPath,args:r,scope:`dynamic`}},allowedTools:e}}export{m as setupComputerUseMCP};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{H as t,K as n,U as r,W as i,q as a}from"./loadAgentsDir-ClTeo0nk.js";import{qn as o}from"./prompt-CfM_xGPc.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return a(e)}function l(e,t,n){let r=c(t.source),i=c(n.source),a=t.ruleValue.toolName;return e===`deny`?`Remove the "${a}" deny rule from ${r}, or remove the specific allow rule from ${i}`:`Remove the "${a}" ask rule from ${r}, or remove the specific allow rule from ${i}`}function u(e,t,n){let{toolName:r,ruleContent:i}=e.ruleValue;if(i===void 0)return{shadowed:!1};let a=t.find(e=>e.ruleValue.toolName===r&&e.ruleValue.ruleContent===void 0);return!a||r===`Bash`&&n.sandboxAutoAllowEnabled&&!s(a.source)?{shadowed:!1}:{shadowed:!0,shadowedBy:a,shadowType:`ask`}}function d(e,t){let{toolName:n,ruleContent:r}=e.ruleValue;if(r===void 0)return{shadowed:!1};let i=t.find(e=>e.ruleValue.toolName===n&&e.ruleValue.ruleContent===void 0);return i?{shadowed:!0,shadowedBy:i,shadowType:`deny`}:{shadowed:!1}}function f(e,n){let a=[],o=t(e),s=r(e),f=i(e);for(let e of o){let t=d(e,f);if(t.shadowed){let n=c(t.shadowedBy.source);a.push({rule:e,reason:`Blocked by "${t.shadowedBy.ruleValue.toolName}" deny rule (from ${n})`,shadowedBy:t.shadowedBy,shadowType:`deny`,fix:l(`deny`,t.shadowedBy,e)});continue}let r=u(e,s,n);if(r.shadowed){let t=c(r.shadowedBy.source);a.push({rule:e,reason:`Shadowed by "${r.shadowedBy.ruleValue.toolName}" ask rule (from ${t})`,shadowedBy:r.shadowedBy,shadowType:`ask`,fix:l(`ask`,r.shadowedBy,e)})}}return a}var p=e((()=>{o(),n()}));export{p as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./chunk-DR8-3Aex.js";import{E as r,O as i}from"./debug-otxXY3j-.js";import{o as a,s as o}from"./log-DSV4Ht5l.js";var s=n(((e,t)=>{t.exports=function(e){return e.map(function(e){return e===``?`''`:e&&typeof e==`object`?e.op.replace(/(.)/g,`\\$1`):/["\s\\]/.test(e)&&!/'/.test(e)?`'`+e.replace(/(['])/g,`\\$1`)+`'`:/["'\s]/.test(e)?`"`+e.replace(/(["\\$`!])/g,`\\$1`)+`"`:String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,`$1\\$2`)}).join(` `)}})),c=n(((e,t)=>{for(var n=`(?:`+[`\\|\\|`,`\\&\\&`,`;;`,`\\|\\&`,`\\<\\(`,`\\<\\<\\<`,`>>`,`>\\&`,`<\\&`,`[&;()|<>]`].join(`|`)+`)`,r=RegExp(`^`+n+`$`),i=`|&;()<> \\t`,a=`"((\\\\"|[^"])*?)"`,o=`'((\\\\'|[^'])*?)'`,s=/^#$/,c=`'`,l=`"`,u=`$`,d=``,f=4294967296,p=0;p<4;p++)d+=(f*Math.random()).toString(16);var m=RegExp(`^`+d);function h(e,t){for(var n=t.lastIndex,r=[],i;i=t.exec(e);)r.push(i),t.lastIndex===i.index&&(t.lastIndex+=1);return t.lastIndex=n,r}function g(e,t,n){var r=typeof e==`function`?e(n):e[n];return r===void 0&&n!=``?r=``:r===void 0&&(r=`$`),typeof r==`object`?t+d+JSON.stringify(r)+d:t+r}function _(e,t,d){d||(d={});var f=d.escape||`\\`,p=`(\\`+f+`['"`+i+`]|[^\\s'"`+i+`])+`,m=h(e,new RegExp([`(`+n+`)`,`(`+p+`|`+a+`|`+o+`)+`].join(`|`),`g`));if(m.length===0)return[];t||(t={});var _=!1;return m.map(function(n){var i=n[0];if(!i||_)return;if(r.test(i))return{op:i};var a=!1,o=!1,d=``,p=!1,m;function h(){m+=1;var e,n,r=i.charAt(m);if(r===`{`){if(m+=1,i.charAt(m)===`}`)throw Error(`Bad substitution: `+i.slice(m-2,m+1));if(e=i.indexOf(`}`,m),e<0)throw Error(`Bad substitution: `+i.slice(m));n=i.slice(m,e),m=e}else if(/[*@#?$!_-]/.test(r))n=r,m+=1;else{var a=i.slice(m);e=a.match(/[^\w\d_]/),e?(n=a.slice(0,e.index),m+=e.index-1):(n=a,m=i.length)}return g(t,``,n)}for(m=0;m<i.length;m++){var v=i.charAt(m);if(p=p||!a&&(v===`*`||v===`?`),o)d+=v,o=!1;else if(a)v===a?a=!1:a==c?d+=v:v===f?(m+=1,v=i.charAt(m),v===l||v===f||v===u?d+=v:d+=f+v):v===u?d+=h():d+=v;else if(v===l||v===c)a=v;else if(r.test(v))return{op:i};else if(s.test(v)){_=!0;var y={comment:e.slice(n.index+m+1)};return d.length?[d,y]:[y]}else v===f?o=!0:v===u?d+=h():d+=v}return p?{op:`glob`,pattern:d}:d}).reduce(function(e,t){return t===void 0?e:e.concat(t)},[])}t.exports=function(e,t,n){var r=_(e,t,n);return typeof t==`function`?r.reduce(function(e,t){if(typeof t==`object`)return e.concat(t);var n=t.split(RegExp(`(`+d+`.*?`+d+`)`,`g`));return n.length===1?e.concat(n[0]):e.concat(n.filter(Boolean).map(function(e){return m.test(e)?JSON.parse(e.split(d)[1]):e}))},[]):r}})),l=n((e=>{e.quote=s(),e.parse=c()}));function u(e,t){try{return{success:!0,tokens:(0,h.parse)(e,t)}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown parse error`}}}function d(e){try{return{success:!0,quoted:(0,h.quote)(e.map((e,t)=>{if(e==null)return String(e);let n=typeof e;if(n===`string`)return e;if(n===`number`||n===`boolean`)return String(e);throw Error(n===`object`?`Cannot quote argument at index ${t}: object values are not supported`:n===`symbol`?`Cannot quote argument at index ${t}: symbol values are not supported`:n===`function`?`Cannot quote argument at index ${t}: function values are not supported`:`Cannot quote argument at index ${t}: unsupported type ${n}`)}))}}catch(e){return e instanceof Error&&o(e),{success:!1,error:e instanceof Error?e.message:`Unknown quote error`}}}function f(e,t){let n=!1,r=!1,i=0,a=0;for(let t=0;t<e.length;t++){let o=e[t];if(o===`\\`&&!n){t++;continue}o===`"`&&!n?(i++,r=!r):o===`'`&&!r&&(a++,n=!n)}if(i%2!=0||a%2!=0)return!0;for(let e of t)if(typeof e==`string`&&((e.match(/{/g)||[]).length!==(e.match(/}/g)||[]).length||(e.match(/\(/g)||[]).length!==(e.match(/\)/g)||[]).length||(e.match(/\[/g)||[]).length!==(e.match(/\]/g)||[]).length||(e.match(/(?<!\\)"/g)||[]).length%2!=0||(e.match(/(?<!\\)'/g)||[]).length%2!=0))return!0;return!1}function p(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`&&!t){r++;continue}if(i===`"`&&!t){n=!n;continue}if(i===`'`&&!n&&(t=!t,!t)){let t=0,n=r-1;for(;n>=0&&e[n]===`\\`;)t++,n--;if(t>0&&t%2==1||t>0&&t%2==0&&e.indexOf(`'`,r+1)!==-1)return!0}}return!1}function m(e){let t=d([...e]);if(t.success)return t.quoted;try{return(0,h.quote)(e.map(e=>{if(e==null)return String(e);let t=typeof e;return t===`string`||t===`number`||t===`boolean`?String(e):i(e)}))}catch(e){throw e instanceof Error&&o(e),Error(`Failed to quote shell arguments safely`)}}var h,g=e((()=>{h=t(l(),1),a(),r()}));export{u as a,m as i,p as n,l as o,g as r,f as t};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{Bl as t,Eo as n,Rl as r,Uo as i,ko as a}from"./loadAgentsDir-ClTeo0nk.js";import{B as o,P as s}from"./rcDebugLog-CwU_wJBE.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:r}){let i=await t({promptMessages:[n({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
|
|
2
|
+
|
|
3
|
+
IMPORTANT CONTEXT:
|
|
4
|
+
- You are a separate, lightweight agent spawned to answer this one question
|
|
5
|
+
- The main agent is NOT interrupted - it continues working independently in the background
|
|
6
|
+
- You share the conversation context but are a completely separate instance
|
|
7
|
+
- Do NOT reference being interrupted or what you were "previously doing" - that framing is incorrect
|
|
8
|
+
|
|
9
|
+
CRITICAL CONSTRAINTS:
|
|
10
|
+
- You have NO tools available - you cannot read files, run commands, search, or take any actions
|
|
11
|
+
- This is a one-off response - there will be no follow-up turns
|
|
12
|
+
- You can ONLY provide information based on what you already know from the conversation context
|
|
13
|
+
- NEVER say things like "Let me try...", "I'll now...", "Let me check...", or promise to take any action
|
|
14
|
+
- If you don't know the answer, say so - do not offer to look it up or investigate
|
|
15
|
+
|
|
16
|
+
Simply answer the question with the information you have.</system-reminder>
|
|
17
|
+
|
|
18
|
+
${e}`})],cacheSafeParams:r,canUseTool:async()=>({behavior:`deny`,message:`Side questions cannot use tools`,decisionReason:{type:`other`,reason:`side_question`}}),querySource:`side_question`,forkLabel:`side_question`,maxTurns:1,skipCacheWrite:!0});return{response:u(i.messages),usage:i.totalUsage}}function u(e){let t=e.flatMap(e=>e.type===`assistant`?e.message.content:[]);if(t.length>0){let e=a(t,`
|
|
19
|
+
|
|
20
|
+
`).trim();if(e)return e;let n=t.find(e=>e.type===`tool_use`);if(n)return`(The model tried to call ${`name`in n?n.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let n=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return n?`(API error: ${o(n.error)})`:null}var d,f=e((()=>{s(),r(),i(),d=/^\/btw\b/gi}));export{f as n,l as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./sink-CqOAfFlL.js";t();export{e as initializeAnalyticsSink};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,F as n,M as r,R as i,S as a,V as o,d as s}from"./paths-DO4WOQtD.js";import{a as c,n as l,t as u}from"./analytics-DqMQntaB.js";import{i as d,t as f}from"./datadog-SSxsxcC-.js";function p(){if(o(`datadog`))return!1;if(y!==void 0)return y;try{return s(v)}catch{return!1}}function m(e,t){let r=i(e);if(r===0)return;let a=r===null?t:{...t,sample_rate:r};p()&&d(e,c(a)),n(e,a)}function h(e,t){return m(e,t),Promise.resolve()}function g(){y=s(v)}function _(){u({logEvent:m,logEventAsync:h})}var v,y,b=e((()=>{f(),r(),a(),l(),t(),v=`tengu_log_datadog_events`}));export{g as n,_ as r,b as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,t}from"./axios-DhfaybwJ.js";import{Ct as n,cn as r}from"./state-sIHsFpDu.js";import{E as i,O as a,Q as o,X as s,Y as c,Z as l,_ as u,h as d,l as f,p}from"./debug-otxXY3j-.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-DSV4Ht5l.js";import{i as y,t as b}from"./sentry-B7ZBc8fA.js";import{r as x,t as S}from"./sink-CqOAfFlL.js";import{dirname as C,join as w}from"path";t(),r(),s(),v(),l(),f(),u(),m(),i(),y();var T=h(new Date);function E(){return w(_.errors(),T+`.jsonl`)}function D(e){return w(_.mcpLogs(e),T+`.jsonl`)}function O(e){let t=c(e);return{write(e){t.write(a(e)+`
|
|
2
|
+
`)},flush:t.flush,dispose:t.dispose}}var k=new Map;function A(e){let t=k.get(e);if(!t){let n=C(e);t=O({writeFn:t=>{try{d().appendFileSync(e,t)}catch{d().mkdirSync(n),d().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),k.set(e,t),o(async()=>t?.dispose())}return t}function j(e,t){if(process.env.USER_TYPE!==`ant`)return;let r={timestamp:new Date().toISOString(),...t,cwd:d().cwd(),userType:process.env.USER_TYPE,sessionId:n(),version:`2.7.2`};A(e).write(r)}function M(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function N(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=M(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}p(`${t.name}: ${r}${n}`,{level:`error`}),j(E(),{error:`${r}${n}`}),b(t)}function P(e,t){p(`MCP server "${e}" ${t}`,{level:`error`});let r=D(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:n(),cwd:d().cwd()};A(r).write(i)}function F(e,t){p(`MCP server "${e}": ${t}`);let r=D(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:n(),cwd:d().cwd()};A(r).write(i)}function I(){g({logError:N,logMCPError:P,logMCPDebug:F,getErrorsPath:E,getMCPLogsPath:D}),p(`Error log sink initialized`)}S();function L(){I(),x()}export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./sinks-BT_lBY6T.js";export{e as initSinks};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{c as r,d as i,f as a}from"./skillGenerator-DIAwRpPg.js";import{d as o,g as s,h as c,l,m as u,p as d,x as f}from"./runtimeObserver-BUOcYxiK.js";import{o as p,r as m}from"./observationStore-rLlDwRtG.js";import{c as h,o as g}from"./projectContext-Dn7umMp6.js";import{t as _}from"./sessionObserver-D4SV0Ar3.js";import{i as v,r as y}from"./skillGapStore-B1gUQXhE.js";import{t as b}from"./skillLearning-CxAbHYEk.js";import{join as x}from"node:path";function S(e,t){let n=e.find(e=>e.startsWith(`${t}=`));if(n)return n.slice(t.length+1)||void 0;let r=e.indexOf(t);if(r>=0&&e[r+1]&&!e[r+1].startsWith(`--`))return e[r+1]}function C(e,t,n){let r=S(e,t);if(r===void 0)return n;let i=Number(r);return Number.isFinite(i)?i:n}var w;e((()=>{n(),b(),w=async e=>{let n=e.trim().split(/\s+/).filter(Boolean),b=n[0]??`status`,w=h(process.cwd()),T=process.env.CLAUDE_SKILL_LEARNING_HOME,E={project:w,rootDir:T};switch(b){case`status`:{let[e,t]=await Promise.all([p(E),d(E)]);return{type:`text`,value:[`Skill Learning status for ${w.projectName} (${w.projectId})`,`Observations: ${e.length}`,`Instincts: ${t.length}`].join(`
|
|
2
|
+
`)}}case`ingest`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning ingest <transcript.jsonl> [--min-session-length=<n>]`};let t=C(n,`--min-session-length`,10),r=await m(e,E);if(r.length<t)return{type:`text`,value:`Session too short for learning (${r.length} < min=${t}). Skipping instinct extraction.`};let i=_(r),a=[];for(let e of i)a.push(await s(e,E));return{type:`text`,value:`Ingested ${r.length} observations and saved ${a.length} instincts.`}}case`evolve`:{let e=n.includes(`--generate`),o=f(await d(E),{cwd:process.cwd()}),s=[];if(e)for(let e of o){let n=a(e,await i(e,[x(process.cwd(),`.claude`,`skills`),x(t(),`skills`)])),o=await r(n);s.push(`${n.type}: ${o.activePath??o.archivedPath??o.deletedPath??`no active write`}`)}return{type:`text`,value:e?`Generated ${s.length} learned skill(s):\n${s.join(`
|
|
3
|
+
`)}`:`Found ${o.length} skill candidate(s). Use --generate to write them.`}}case`export`:{let e=n[1]??`skill-learning-instincts.json`,t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=e=>e.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i)),s=await d(E),c=a(s);if(c.length!==s.length){await o(e,E);let{writeFile:t}=await import(`node:fs/promises`);await t(e,`${JSON.stringify(c,null,2)}\n`)}else await o(e,E);let l=[`Exported ${c.length} instincts to ${e}`];if(t||r!==void 0||i){let e=[];t&&e.push(`scope=${t}`),r!==void 0&&e.push(`min-conf=${r}`),i&&e.push(`domain=${i}`),l.push(`(filters: ${e.join(`, `)})`)}return{type:`text`,value:l.join(` `)}}case`import`:{let e=n[1];if(!e)return{type:`text`,value:`Usage: /skill-learning import <instincts.json> [--scope=<scope>] [--min-conf=<n>] [--domain=<d>] [--dry-run]`};let t=S(n,`--scope`),r=C(n,`--min-conf`,void 0),i=S(n,`--domain`),a=n.includes(`--dry-run`),{readFile:o}=await import(`node:fs/promises`),c=JSON.parse(await o(e,`utf8`)),l=c.filter(e=>!(t&&e.scope!==t||r!==void 0&&e.confidence<r||i&&e.domain!==i));if(a)return{type:`text`,value:`Dry run: would import ${l.length}/${c.length} instincts.`};for(let e of l)await s(e,E);return{type:`text`,value:`Imported ${l.length}/${c.length} instincts.`}}case`prune`:{let e=n.indexOf(`--max-age`);return{type:`text`,value:`Pruned ${(await u(e>=0&&n[e+1]?Number(n[e+1]):30,E)).length} pending instincts.`}}case`promote`:{let e=n[1];if(!e){let e=await v(w,T),t=l(await d(E));return{type:`text`,value:[`Promotion candidates for ${w.projectName} (${w.projectId}):`,`Pending gaps: ${e.filter(e=>e.status===`pending`).length}`,`Global-eligible instincts (>=2 projects, avg confidence >=0.8): ${t.length}`,``,`Usage:`,` /skill-learning promote gap <gap-key> # pending gap -> draft`,` /skill-learning promote instinct <instinct-id> # project instinct -> global`].join(`
|
|
4
|
+
`)}}if(e===`gap`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote gap <gap-key>`};let t=await y(e,w,T);return t?{type:`text`,value:`Promoted gap ${e} to status=${t.status} (draft=${t.draft?.skillPath??`none`}).`}:{type:`text`,value:`No gap found for key "${e}".`}}if(e===`instinct`){let e=n[2];if(!e)return{type:`text`,value:`Usage: /skill-learning promote instinct <instinct-id>`};let t=(await d(E)).find(t=>t.id===e);return t?t.scope===`global`?{type:`text`,value:`Instinct ${e} is already global.`}:(await c({...t,scope:`global`},{scope:`global`,rootDir:T}),{type:`text`,value:`Promoted instinct ${e} to global scope.`}):{type:`text`,value:`No project-scoped instinct found for id "${e}".`}}return{type:`text`,value:`Usage: /skill-learning promote [gap <gap-key>|instinct <instinct-id>]`}}case`projects`:{let e=g();if(e.length===0)return{type:`text`,value:`No known project scopes yet.`};let t=[`Known project scopes:`];for(let n of e){let e={project:n,rootDir:T},[r,i]=await Promise.all([d(e),p(e)]);t.push(`- ${n.projectName} (${n.projectId}) — instincts: ${r.length}, observations: ${i.length}, lastSeen: ${n.lastSeenAt}`)}return{type:`text`,value:t.join(`
|
|
5
|
+
`)}}default:return{type:`text`,value:`Usage: /skill-learning [status|ingest|evolve|export|import|prune|promote|projects]`}}}}))();export{w as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-DR8-3Aex.js";import{i as t,r as n}from"./chokidar-SzksMqYp.js";import{Ct as r,Fr as i,Pr as a,cn as o,et as s,g as c,jr as ee,lr as l,nr as u,tr as te}from"./state-sIHsFpDu.js";import{Br as ne,Pr as re}from"./paths-DO4WOQtD.js";import{Q as ie,Z as ae,_ as oe,h as se,l as d,p as f}from"./debug-otxXY3j-.js";import{n as p,r as ce}from"./analytics-DqMQntaB.js";import{n as le,t as m}from"./cwd--iizewsn.js";import{$n as h,Am as g,Cn as _,Co as ue,Di as v,FE as de,Fc as fe,Fr as pe,Gi as me,Ic as he,Jm as y,KE as ge,Km as _e,Ot as ve,PE as ye,Pt as b,Qk as x,Rt as S,Tt as C,Uo as w,Wi as T,Xm as E,Ym as D,_i as O,_y as k,ai as A,bn as j,gi as M,i as N,id as P,jy as be,km as xe,ky as Se,mh as F,na as Ce,o as we,ph as Te,qE as Ee,qk as I,r as De,rd as Oe,vy as ke,wd as Ae,wi as je,yd as Me}from"./loadAgentsDir-ClTeo0nk.js";import{Xt as L}from"./prompt-CfM_xGPc.js";import{f as Ne,l as Pe,t as Fe}from"./commitAttribution-csu3NO7Y.js";import{F as Ie,P as Le}from"./teamHelpers-CXAmvFco.js";import{n as R,r as Re}from"./systemPromptSections-DY7epA2Y.js";import{r as ze}from"./asciicast-C_1Pi99k.js";import*as z from"path";import{dirname as Be}from"path";o(),Re(),xe(),we(),L(),Ee(),x(),Pe(),Me(),le(),d(),be(),w(),re(),ke(),Te(),pe(),Le(),de(),ve();function Ve(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(!r||r.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=ye().safeParse(i.todos);return a.success?a.data:[]}return[]}function He(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&Se(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),e.attributionSnapshots&&e.attributionSnapshots.length>0&&Fe(e.attributionSnapshots,e=>{t(t=>({...t,attribution:e}))}),!Ie()&&e.messages&&e.messages.length>0){let n=Ve(e.messages);if(n.length>0){let e=r();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function Ue(e){if(e.attributionSnapshots&&e.attributionSnapshots.length>0)return Ne(e.attributionSnapshots)}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t===`default`?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return u(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(u(r.agentType),!s()&&r.model&&r.model!==`inherit`&&te(ne(r.model)),{agentDefinition:r,agentType:r.agentType}):(f(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),u(void 0),{agentDefinition:void 0,agentType:void 0})}async function We(e,t,n,r){if(!e)return r;N.cache.clear?.();let i=await N(t),a=[...i.allAgents,...n];return{...i,allAgents:a,activeAgents:De(a)}}function H(e){let t=C();if(t){v(t);return}if(e){try{process.chdir(e.worktreePath)}catch{v(null);return}F(e.worktreePath),l(m()),b(e),I(),R(),k.cache.clear?.()}}function Ge(){let e=C();if(e){b(null),I(),R(),k.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}F(e.originalCwd),l(m())}}async function Ke(t,n,i){let a;if(a=i.modeApi?.matchSessionMode(t.mode),a&&t.messages.push(ue(a,`warning`)),n.forkSession)t.contentReplacements?.length&&await A(t.contentReplacements);else{let e=n.sessionIdOverride??t.sessionId;e&&(ee(ge(e),n.transcriptPath?Be(n.transcriptPath):null),await ze(),await M(),g(e))}if(O(n.forkSession?{...t,worktreeSession:void 0}:t),t.goal){let{hydrateGoalFromTranscript:i}=(P(),e(Oe)),a=new Map,o=n.sessionIdOverride??t.sessionId??r();a.set(o,t.goal),i(a,o)}n.forkSession||(H(t.worktreeSession),h());let{agentDefinition:o,agentType:s}=V(t.agentSetting,i.mainThreadAgentDefinition,i.agentDefinitions);je(i.modeApi?.isCoordinatorMode()?`coordinator`:`normal`);let c=n.includeAttribution?Ue(t):void 0,l=B(t.agentName,t.agentColor);Ae(t.agentName);let u=await We(!!a,i.currentCwd,i.cliAgents,i.agentDefinitions);return{messages:t.messages,fileHistorySnapshots:t.fileHistorySnapshots,contentReplacements:t.contentReplacements,agentName:t.agentName,agentColor:t.agentColor===`default`?void 0:t.agentColor,restoredAgentDef:o,initialState:{...i.initialState,...s&&{agent:s},...c&&{attribution:c},...l&&{standaloneAgentContext:l},agentDefinitions:u}}}t(),o(),Ce(),p(),D(),fe(),ae(),d(),oe(),_(),i();var qe=1e3,Je=500,Ye=300,Xe=2e3,Ze=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=a(),Z=null;async function Qe(){if(K||q)return;K=!0,J||(J=!0,E(()=>{T(),X.emit()}));let e=await et();e.length!==0&&(f(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=n.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??qe,pollInterval:Z?.pollInterval??Je},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Ze,interval:Z?.chokidarInterval??Xe,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=ie(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var $e=X.subscribe;async function et(){let e=se(),t=[],n=y(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=y(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=y(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=y(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of c()){let r=z.join(n,`.claude`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){f(`Detected skill change: ${e}`),ce(`tengu_skill_file_changed`,{source:`chokidar`}),tt(e)}function tt(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),j(await S(`skills`,e[0]))){f(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}_e(),me(),he(),X.emit()},Z?.reloadDebounce??Ye)}async function nt(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var rt={initialize:Qe,dispose:Q,subscribe:$e,resetForTesting:nt};export{V as a,Ke as i,B as n,He as o,Ge as r,H as s,rt as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,r as n}from"./instinctParser-DOtj1Kni.js";import{i as r,o as i,s as a}from"./skillGenerator-DIAwRpPg.js";import{a as o,c as s,n as c}from"./projectContext-Dn7umMp6.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??s(e.cwd),r=await A(n,e.rootDir),i=F(t),a=new Date().toISOString(),o=r.gaps[i],c={key:i,prompt:t,count:(o?.count??0)+1,draftHits:o?.draftHits??0,draftHitSessions:o?.draftHitSessions??[],status:o?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:o?.createdAt??a,updatedAt:a,draft:o?.draft,active:o?.active};return c.status===`rejected`?(r.gaps[i]=c,await N(n,r,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),r.gaps[i]=c,await N(n,r,e.rootDir),c)}async function v(e=s(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=s(),n){let r=await A(t,n);for(let t of Object.values(r.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=s(),n,r=`unknown-session`){let i=await A(t,n),a=i.gaps[e];if(!a||!a.draft||a.active)return a;let o=a.draftHitSessions??[];if(o.includes(r))return a;let c=new Date().toISOString(),l={...a,draftHits:a.draftHits+1,draftHitSessions:[...o,r],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),i.gaps[e]=l,await N(t,i,n),l}async function x(e,t=s(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;if(i.status===`rejected`||i.draft)return i;let a={...i,draft:await T(i,t),status:`draft`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),await z(),a}async function S(e,t=s(),n){let r=await A(t,n),i=r.gaps[e];if(!i)return;let a={...i,status:`rejected`,updatedAt:new Date().toISOString()};return r.gaps[e]=a,await N(t,r,n),a}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),i=u(t.projectRoot??t.cwd,`.claude`,`skills`,`.drafts`),o=r([n],{cwd:t.projectRoot??t.cwd,outputRoot:i,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),s=u(o.outputPath,`SKILL.md`);return d(s)||await a({...o,content:o.content+`
|
|
2
|
+
## Promotion Rule
|
|
3
|
+
|
|
4
|
+
Do not move this draft into active skills until the same gap repeats or the user explicitly confirms this should become reusable.
|
|
5
|
+
`}),{type:`draft`,name:o.name,skillPath:s}}async function E(e,t){let n=r([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),i=u(n.outputPath,`SKILL.md`);return d(i)||await a(n),{type:`active`,name:n.name,skillPath:i}}function D(e,t){return n({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):c(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-hyVX9-Lh.js`);e()}catch{}}var B,V,H,U=e((()=>{t(),o(),i(),B=2,V=4,H=2}));export{b as a,w as c,v as i,C as l,U as n,_ as o,x as r,S as s,y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./skillGapStore-B1gUQXhE.js";i();export{c as findGapKeyByDraftPath,o as promoteGapToDraft,n as readSkillGaps,e as recordDraftHit,a as recordSkillGap,s as rejectSkillGap,t as shouldPromoteToActive,r as shouldPromoteToDraft};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{o as r,t as i}from"./localSearch-Koc8naSr.js";import{l as a,u as o}from"./instinctParser-DOtj1Kni.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as ee,rm as m,writeFile as h}from"node:fs/promises";function g(e){return e.length===0?!1:e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function _(e){let t=b[e[0]?.domain??`project`],n=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(te(e)&&n.add(e),n.size>=5)break;if(n.size>=5)break}let r=v([t,...n].join(`-`));return y(r)?`${t}-learned-pattern`:r}function v(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function y(e){return x.has(e)}function te(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));async function C(e,t,n){let r=n.length>0&&typeof n[0]==`string`?await w(e,n):n,i=L(`${t.name} ${t.description} ${t.content}`);return r.map(e=>({skill:e,score:R(i,L(`${e.name} ${e.description} ${e.content}`))})).filter(e=>e.score>=.18).sort((e,t)=>t.score-e.score).map(e=>e.skill)}async function ne(e,t){return C(`skill`,e,t)}async function w(e,t){if(e===`skill`)return D(t);let n=[];for(let e of t)u(e)&&await P(e,n);return n}function T(e,t,n={}){let r=t.find(e=>j(e));if(n.allowHardDelete&&r)return{type:`delete`,targetSkill:r,reason:`Existing skill is low quality, unreferenced, and safe to delete.`,confirmed:!0};let i=t[0];if(!i)return{type:`create`,draft:e,reason:`No overlapping active skill found.`};let a=R(L(`${e.name} ${e.description} ${e.content}`),L(`${i.name} ${i.description} ${i.content}`));return a>=.72&&e.confidence>=.75&&ae(e,i)?{type:`replace`,targetSkill:i,draft:e,reason:`New learned skill has high overlap (${a.toFixed(2)}) and higher confidence.`}:a>=.35?{type:`merge`,targetSkill:i,patch:ie(e),reason:`Existing skill overlaps with the learned pattern (${a.toFixed(2)}).`}:{type:`create`,draft:e,reason:`Overlap is too low to merge.`}}async function E(e,t={}){switch(e.type){case`create`:return{activePath:await W(e.draft)};case`merge`:return I(e.targetSkill)?{activePath:await re(e.targetSkill,e.patch)}:(process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{});case`replace`:{if(!I(e.targetSkill))return process.stderr.write(`[skill-learning] skip user-authored skill: ${e.targetSkill.path}\n`),{};let n=e.draft.outputPath;if(e.hardDelete){let{deletedPath:r,manifestPath:i,tombstonePath:a}=await k(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},{...t,allowHardDelete:!0});return{activePath:await W(e.draft),deletedPath:r,manifestPath:i,tombstonePath:a}}let{archivedPath:r,manifestPath:i}=await O(e.targetSkill,e.reason,{newSkill:e.draft.name,newPath:n},t);return{activePath:await W(e.draft),archivedPath:r,manifestPath:i}}case`archive`:return await O(e.targetSkill,e.reason,void 0,t);case`delete`:return await k(e.targetSkill,e.reason,void 0,{...t,allowHardDelete:t.allowHardDelete&&e.confirmed!==!1})}}async function D(e){let t=[];for(let n of e)u(n)&&await N(n,t);return t}async function O(e,t,n,r={}){let a=c(e.path),o=r.archiveRoot??l(c(a),`.archive`),u=l(o,`${s(a)}-${M(r.now)}`);await d(o,{recursive:!0}),await ee(a,u);let f=await A(r.manifestRoot??u,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`archive`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!0});return i(),{archivedPath:u,manifestPath:f}}async function k(e,t,n,r={}){if(!r.allowHardDelete)throw Error(`Hard delete requires allowHardDelete=true`);let a=c(e.path),o=u(e.path)?await f(e.path,`utf8`):``,s=r.manifestRoot??l(c(a),`.tombstones`),d=await A(s,{oldSkill:e.name,oldPath:e.path,newSkill:n?.newSkill,newPath:n?.newPath,action:`delete`,reason:t,replacedAt:(r.now??new Date).toISOString(),recoverable:!1}),p=l(s,`${e.name}-${M(r.now)}.tombstone.json`);return await h(p,`${JSON.stringify({deletedSkill:e.name,oldPath:e.path,content:o},null,2)}\n`,`utf8`),await m(a,{recursive:!0,force:!0}),i(),{deletedPath:e.path,manifestPath:d,tombstonePath:p}}async function A(e,t){await d(e,{recursive:!0});let n=l(e,`replacement-manifest.json`);return await h(n,`${JSON.stringify(t,null,2)}\n`,`utf8`),n}async function re(e,t){let n=l(c(e.path),`learned-skill.patch.md`);return await h(n,t,`utf8`),i(),n}function ie(e){return[`# Learned Skill Merge Patch`,``,`Target learned skill: ${e.name}`,`Confidence: ${e.confidence}`,``,`## Suggested additions`,``,e.content].join(`
|
|
2
|
+
`)}function ae(e,t){if(t.status===`superseded`||t.status===`archived`)return!0;let n=e.confidence-(t.confidence??.5),r=e.content.length-t.content.length;return n>=.15||r>160}function j(e){return e.safeToDelete===!0&&(e.referencedBy?.length??0)===0&&e.quality===`low`}function M(e=new Date){return e.toISOString().replace(/[:.]/g,`-`)}async function N(e,t){let n=await p(e,{withFileTypes:!0});for(let r of n){let n=l(e,r.name);if(r.isDirectory()){if(r.name===`.archive`)continue;await N(n,t);continue}if(r.isFile()&&r.name===`SKILL.md`){let e=await f(n,`utf8`);t.push({name:F(e,`name`)??s(c(n)),description:F(e,`description`)??``,path:n,content:e})}}}async function P(e,t){let n=await p(e,{withFileTypes:!0});for(let r of n){let n=l(e,r.name);if(r.isDirectory()){if(r.name===`.archive`)continue;await P(n,t);continue}if(r.isFile()&&r.name.endsWith(`.md`)){let e=await f(n,`utf8`);t.push({name:F(e,`name`)??r.name.replace(/\.md$/,``),description:F(e,`description`)??``,path:n,content:e})}}}function F(e,t){let n=e.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n)return n[1].match(RegExp(`^${t}:\\s*"?([^"\\n]+)"?`,`m`))?.[1]?.trim()}function I(e){return F(e.content,`origin`)===`skill-learning`}function L(e){return new Set(e.toLowerCase().split(/[^a-z0-9]+/).filter(e=>e.length>2))}function R(e,t){if(e.size===0||t.size===0)return 0;let n=0;for(let r of e)t.has(r)&&n++;return n/Math.min(e.size,t.size)}function z(e,t){return R(L(`${e.name} ${e.description} ${e.content}`),L(`${t.name} ${t.description} ${t.content}`))}var B=e((()=>{r(),$()}));function V(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?v(t.name):K(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??q(e),o=G(r,n,t),s=J({name:r,description:a,confidence:i,instincts:e});return{name:r,description:a,scope:n,sourceInstinctIds:e.map(e=>e.id),confidence:Number(i.toFixed(2)),content:s,outputPath:o}}async function H(e,t,n){let r=V(e,t),i=await C(`skill`,r,n);for(let t of i){let n=z(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await U(t,e)}}return{action:`create`,draft:r}}async function U(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=Q)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,X);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
|
|
3
|
+
`),s=n.endsWith(`
|
|
4
|
+
`)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>Q?s.slice(0,Q):s;return await h(e.path,c,`utf8`),i(),e.path}async function W(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-hyVX9-Lh.js`);e()}catch{}return t}function G(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.claude`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function K(e){return _(e)}function q(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function J(e){let{name:t,description:n,confidence:r,instincts:i}=e;return[`---`,`name: ${t}`,`description: ${JSON.stringify(n)}`,`origin: skill-learning`,`confidence: ${Number(r.toFixed(2))}`,`evolved_from: [${i.map(e=>JSON.stringify(e.id)).join(`, `)}]`,`---`,``,`# ${oe(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
5
|
+
`),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
|
|
6
|
+
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,Z).join(`
|
|
7
|
+
`),``].join(`
|
|
8
|
+
`)}function oe(e){return e.split(`-`).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(` `)}var Y,X,Z,Q,$=e((()=>{n(),r(),S(),B(),Y=.8,X=20,Z=20,Q=5e4}));export{g as C,v as S,z as _,G as a,S as b,E as c,ne as d,T as f,D as g,w as h,V as i,O as l,B as m,U as n,$ as o,k as p,H as r,W as s,Y as t,C as u,A as v,y as x,_ as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./featureCheck-j7P30mry.js";import"./instinctParser-DOtj1Kni.js";import"./skillGenerator-DIAwRpPg.js";import{p as e}from"./runtimeObserver-BUOcYxiK.js";import{o as t}from"./observationStore-rLlDwRtG.js";import{c as n}from"./projectContext-Dn7umMp6.js";import"./sessionObserver-D4SV0Ar3.js";import"./toolEventObserver-jO6-mlFU.js";import"./skillGapStore-B1gUQXhE.js";import{t as r}from"./skillLearning-CxAbHYEk.js";r();export{e as loadInstincts,t as readObservations,n as resolveProjectContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./featureCheck-j7P30mry.js";import{b as n,m as r,o as i}from"./skillGenerator-DIAwRpPg.js";import{S as a,T as o,f as s,i as c,k as l,u}from"./runtimeObserver-BUOcYxiK.js";import{i as d}from"./observationStore-rLlDwRtG.js";import{a as f}from"./projectContext-Dn7umMp6.js";import{a as p,c as m,d as h,i as g}from"./sessionObserver-D4SV0Ar3.js";import{n as _}from"./toolEventObserver-jO6-mlFU.js";import{n as v}from"./skillGapStore-B1gUQXhE.js";var y=e((()=>{t(),a(),n(),s(),d(),u(),f(),c(),h(),p(),l(),o(),_(),g(),v(),i(),r(),m()}));export{y as t};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{sS as l,uS as u}from"./loadAgentsDir-ClTeo0nk.js";import{r as d,t as f}from"./featureCheck-j7P30mry.js";async function p(){let{readObservations:e,loadInstincts:t,resolveProjectContext:n}=await import(`./skillLearning-Bxu1Uzl-.js`),r=n(process.cwd()),[i,a]=await Promise.all([e({project:r}),t({project:r})]);return[`Skill Learning status for ${r.projectName} (${r.projectId})`,`Observations: ${i.length}`,`Instincts: ${a.length}`,``,`Skill Learning: ${d()?`enabled`:`disabled`}`].join(`
|
|
2
|
+
`)}async function m(){let e=[];d()?e.push(`Skill Learning: already enabled`):(process.env.SKILL_LEARNING_ENABLED=`1`,e.push(`Skill Learning: enabled (SKILL_LEARNING_ENABLED=1)`));try{let{initSkillLearning:t}=await import(`./runtimeObserver-B4KekIF0.js`);t(),e.push(`Runtime observer: initialized`)}catch{e.push(`Runtime observer: init skipped (not available)`)}return e.join(`
|
|
3
|
+
`)}async function h(){let e=[];return d()?(process.env.SKILL_LEARNING_ENABLED=`0`,process.env.CLAUDE_SKILL_LEARNING_DISABLE=`1`,e.push(`Skill Learning: disabled (SKILL_LEARNING_ENABLED=0)`)):e.push(`Skill Learning: already disabled`),e.join(`
|
|
4
|
+
`)}function g({onDone:e}){u(`skill-panel`);let[t,n]=(0,v.useState)(0),a=(0,v.useMemo)(()=>[{label:`Status`,description:`Show skill learning status for current project`,run:p},{label:`Start`,description:`Enable skill learning for this session`,run:m},{label:`Stop`,description:`Disable skill learning for this session`,run:h},{label:`About`,description:`Detailed description of skill learning features`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=a[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return s((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(a.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(i,{title:`Skill Learning`,subtitle:`${a.length} actions`,onCancel:()=>e(`Skill panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[a.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;if(r===`start`)return e(await m(),{display:`system`}),null;if(r===`stop`)return e(await h(),{display:`system`}),null;if(r===`about`)return e(x,{display:`system`}),null;if(r===`status`)return e(await p(),{display:`system`}),null;if(r){let{call:t}=await import(`./skill-learning-kh0HKn6u.js`),n=await t(r,{});return n&&typeof n==`object`&&`value`in n&&e(n.value,{display:`system`}),null}return(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(n(),1),a(),l(),f(),y=c(),b=28,x=`# Skill Learning (自动学习)
|
|
5
|
+
|
|
6
|
+
Skill Learning 是一个闭环学习系统,通过观察用户的操作模式自动提取直觉(instinct),
|
|
7
|
+
并在达到阈值后生成可复用的 skill 文件、agent 和 command。
|
|
8
|
+
|
|
9
|
+
## 工作流程
|
|
10
|
+
1. **Observe** — 记录每轮对话中的工具调用、用户纠正、错误解决模式
|
|
11
|
+
2. **Analyze** — 使用启发式或 LLM 后端分析观察数据,提取 instinct candidate
|
|
12
|
+
3. **Evolve** — 将高置信度 instinct 聚类,生成 skill/agent/command 候选
|
|
13
|
+
4. **Lifecycle** — 对生成的 skill 进行去重、版本比较、归档或替换
|
|
14
|
+
|
|
15
|
+
## 子命令
|
|
16
|
+
- /skill-learning status — 查看当前项目的观察和直觉数量
|
|
17
|
+
- /skill-learning ingest — 从 transcript 导入观察数据
|
|
18
|
+
- /skill-learning evolve — 生成 skill 候选 (--generate 写入磁盘)
|
|
19
|
+
- /skill-learning export — 导出 instinct 为 JSON
|
|
20
|
+
- /skill-learning import — 导入 instinct JSON
|
|
21
|
+
- /skill-learning prune — 清理过期的 pending instinct
|
|
22
|
+
- /skill-learning promote — 将 instinct/gap 提升为全局范围
|
|
23
|
+
- /skill-learning projects — 列出所有已知的项目范围
|
|
24
|
+
|
|
25
|
+
## 启用方式
|
|
26
|
+
- SKILL_LEARNING_ENABLED=1 或 FEATURE_SKILL_LEARNING=1
|
|
27
|
+
- 状态: ${d()?`已启用`:`未启用`}
|
|
28
|
+
`}))();export{_ as call};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Xh as l,Zh as u,sS as d,uS as f}from"./loadAgentsDir-ClTeo0nk.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${u()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
|
|
2
|
+
`)}async function m(){if(u()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-BtLNJRij.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
|
|
3
|
+
`)}async function h(){return u()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){f(`skill-search-panel`);let[t,n]=(0,v.useState)(0),a=(0,v.useMemo)(()=>[{label:`Status`,description:`Show whether automatic skill matching is active`,run:()=>Promise.resolve(p())},{label:`Start`,description:`Enable automatic skill matching for this session`,run:m},{label:`Stop`,description:`Disable automatic skill matching for this session`,run:h},{label:`About`,description:`How automatic skill matching works`,run:()=>Promise.resolve(x)}],[]),c=()=>{let n=a[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return s((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(a.length-1,e+1));return}t.return&&c()}),(0,y.jsx)(i,{title:`Skill Search`,subtitle:`${a.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[a.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(r,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(r,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(r,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(n(),1),a(),d(),l(),y=c(),b=28,x=`# Skill Search (自动技能匹配)
|
|
4
|
+
|
|
5
|
+
Skill Search 控制对话中的自动技能匹配功能。
|
|
6
|
+
|
|
7
|
+
启用后,Claude Code 会在每轮对话中自动搜索并加载与当前任务最相关的 skill 文件,
|
|
8
|
+
无需手动指定。搜索基于 TF-IDF 向量余弦相似度,支持英文词干化和 CJK bi-gram 分词。
|
|
9
|
+
|
|
10
|
+
## 工作原理
|
|
11
|
+
1. 对话开始时,自动索引 .claude/skills/ 和 ~/.claude/skills/ 下的 Markdown 文件
|
|
12
|
+
2. 每轮对话根据上下文自动匹配最相关的 skill
|
|
13
|
+
3. 匹配到的 skill 内容会作为上下文注入,指导 Claude Code 的行为
|
|
14
|
+
|
|
15
|
+
## 控制方式
|
|
16
|
+
- /skill-search start — 启用自动匹配
|
|
17
|
+
- /skill-search stop — 禁用自动匹配
|
|
18
|
+
- /skill-search status — 查看当前状态
|
|
19
|
+
|
|
20
|
+
当前状态: ${u()?`已启用`:`未启用`}
|
|
21
|
+
`}))();export{_ as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,u as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Gs as l,Us as u}from"./paths-DO4WOQtD.js";import{b as d,x as f}from"./startupProfiler-CAntGAbs.js";import{l as p,o as m}from"./stringUtils-KZoO4GUd.js";import{DC as h,EC as g,Ym as _,ha as v,na as y,qm as b}from"./loadAgentsDir-ClTeo0nk.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:u(e)}function w({onExit:e,commands:t}){let[n,a]=(0,T.useState)(``),c=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),l=(0,T.useMemo)(()=>x(c.map(e=>({...e,name:v(e),description:e.description??``})),n),[c,n]),u=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of l){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>v(e).localeCompare(v(t)));return e},[l]),f=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(c.length===0)return(0,E.jsxs)(i,{title:`Skills`,subtitle:`No skills found`,onCancel:f,hideInputGuide:!0,children:[(0,E.jsx)(r,{dimColor:!0,children:`Create skills in .claude/skills/ or ~/.claude/skills/`}),(0,E.jsx)(r,{dimColor:!0,italic:!0,children:(0,E.jsx)(g,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let m=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},h=(e,t)=>{let n=`~${d(b(e))}`,i=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,a=m(e.source);return(0,E.jsxs)(s,{children:[(0,E.jsx)(r,{color:t?`suggestion`:void 0,children:v(e)}),a&&(0,E.jsxs)(r,{color:a.color,children:[` [`,a.label,`]`]}),(0,E.jsxs)(r,{dimColor:!0,children:[i?` · ${i}`:``,` · `,C(e.source),` · `,n,` tokens`]})]})};return(0,E.jsx)(o,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>u[e]),[u]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:a,onSelect:t=>{e(`/${v(t)}`,{display:`user`})},onCancel:f,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:n.trim()===``?`${c.length} ${p(c.length,`skill`)}`:`${l.length}/${c.length} ${p(c.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>h(e,t)})}var T,E,D,O=e((()=>{n(),T=t(n(),1),y(),a(),_(),f(),l(),m(),h(),S(),E=c(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{n(),O(),A=c()}))();export{k as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{C as t,E as n,S as r,T as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,m as p,p as m,u as h,v as g,w as _,x as v,y}from"./companion-Diuav3lA.js";function b(e,t=0){let n=C[e.species],r=[...n[t%n.length].map(t=>t.replaceAll(`{E}`,e.eye))];return e.hat!==`none`&&!r[0].trim()&&(r[0]=w[e.hat]),!r[0].trim()&&n.every(e=>!e[0].trim())&&r.shift(),r}function x(e){return C[e].length}function S(e){let g=e.eye;switch(e.species){case d:case a:return`(${g}>`;case f:return`(${g}${g})`;case l:return`=${g}ω${g}=`;case p:return`<${g}~${g}>`;case o:return`~(${g}${g})~`;case v:return`(${g})(${g})`;case r:return`(${g}>)`;case n:return`[${g}_${g}]`;case i:return`${g}(@)`;case u:return`/${g}${g}\\`;case s:return`}${g}.${g}{`;case c:return`(${g}oo${g})`;case h:return`|${g} ${g}|`;case _:return`[${g}${g}]`;case t:return`(${g}..${g})`;case y:return`|${g} ${g}|`;case m:return`(${g}.${g})`}}var C,w,T=e((()=>{g(),C={[d]:[[` `,` __ `,` <({E} )___ `,` ( ._> `," `--´ "],[` `,` __ `,` <({E} )___ `,` ( ._> `," `--´~ "],[` `,` __ `,` <({E} )___ `,` ( .__> `," `--´ "]],[a]:[[` `,` ({E}> `,` || `,` _(__)_ `,` ^^^^ `],[` `,` ({E}> `,` || `,` _(__)_ `,` ^^^^ `],[` `,` ({E}>> `,` || `,` _(__)_ `,` ^^^^ `]],[f]:[[` `,` .----. `,` ( {E} {E} ) `,` ( ) `," `----´ "],[` `,` .------. `,` ( {E} {E} ) `,` ( ) `," `------´ "],[` `,` .--. `,` ({E} {E}) `,` ( ) `," `--´ "]],[l]:[[` `,` /\\_/\\ `,` ( {E} {E}) `,` ( ω ) `,` (")_(") `],[` `,` /\\_/\\ `,` ( {E} {E}) `,` ( ω ) `,` (")_(")~ `],[` `,` /\\-/\\ `,` ( {E} {E}) `,` ( ω ) `,` (")_(") `]],[p]:[[` `,` /^\\ /^\\ `,` < {E} {E} > `,` ( ~~ ) `," `-vvvv-´ "],[` `,` /^\\ /^\\ `,` < {E} {E} > `,` ( ) `," `-vvvv-´ "],[` ~ ~ `,` /^\\ /^\\ `,` < {E} {E} > `,` ( ~~ ) `," `-vvvv-´ "]],[o]:[[` `,` .----. `,` ( {E} {E} ) `,` (______) `,` /\\/\\/\\/\\ `],[` `,` .----. `,` ( {E} {E} ) `,` (______) `,` \\/\\/\\/\\/ `],[` o `,` .----. `,` ( {E} {E} ) `,` (______) `,` /\\/\\/\\/\\ `]],[v]:[[` `,` /\\ /\\ `,` (({E})({E})) `,` ( >< ) `," `----´ "],[` `,` /\\ /\\ `,` (({E})({E})) `,` ( >< ) `,` .----. `],[` `,` /\\ /\\ `,` (({E})(-)) `,` ( >< ) `," `----´ "]],[r]:[[` `,` .---. `,` ({E}>{E}) `,` /( )\\ `," `---´ "],[` `,` .---. `,` ({E}>{E}) `,` |( )| `," `---´ "],[` .---. `,` ({E}>{E}) `,` /( )\\ `," `---´ ",` ~ ~ `]],[n]:[[` `,` _,--._ `,` ( {E} {E} ) `,` /[______]\\ `," `` `` "],[` `,` _,--._ `,` ( {E} {E} ) `,` /[______]\\ `," `` `` "],[` `,` _,--._ `,` ( {E} {E} ) `,` /[======]\\ `," `` `` "]],[i]:[[` `,` {E} .--. `,` \\ ( @ ) `," \\_`--´ ",` ~~~~~~~ `],[` `,` {E} .--. `,` | ( @ ) `," \\_`--´ ",` ~~~~~~~ `],[` `,` {E} .--. `,` \\ ( @ ) `," \\_`--´ ",` ~~~~~~ `]],[u]:[[` `,` .----. `,` / {E} {E} \\ `,` | | `," ~`~``~`~ "],[` `,` .----. `,` / {E} {E} \\ `,` | | `," `~`~~`~` "],[` ~ ~ `,` .----. `,` / {E} {E} \\ `,` | | `," ~~`~~`~~ "]],[s]:[[` `,`}~(______)~{`,`}~({E} .. {E})~{`,` ( .--. ) `,` (_/ \\_) `],[` `,`~}(______){~`,`~}({E} .. {E}){~`,` ( .--. ) `,` (_/ \\_) `],[` `,`}~(______)~{`,`}~({E} .. {E})~{`,` ( -- ) `,` ~_/ \\_~ `]],[c]:[[` `,` n______n `,` ( {E} {E} ) `,` ( oo ) `," `------´ "],[` `,` n______n `,` ( {E} {E} ) `,` ( Oo ) `," `------´ "],[` ~ ~ `,` u______n `,` ( {E} {E} ) `,` ( oo ) `," `------´ "]],[h]:[[` `,` n ____ n `,` | |{E} {E}| | `,` |_| |_| `,` | | `],[` `,` ____ `,` n |{E} {E}| n `,` |_| |_| `,` | | `],[` n n `,` | ____ | `,` | |{E} {E}| | `,` |_| |_| `,` | | `]],[_]:[[` `,` .[||]. `,` [ {E} {E} ] `,` [ ==== ] `," `------´ "],[` `,` .[||]. `,` [ {E} {E} ] `,` [ -==- ] `," `------´ "],[` * `,` .[||]. `,` [ {E} {E} ] `,` [ ==== ] `," `------´ "]],[t]:[[` `,` (\\__/) `,` ( {E} {E} ) `,` =( .. )= `,` (")__(") `],[` `,` (|__/) `,` ( {E} {E} ) `,` =( .. )= `,` (")__(") `],[` `,` (\\__/) `,` ( {E} {E} ) `,` =( . . )= `,` (")__(") `]],[y]:[[` `,` .-o-OO-o-. `,`(__________)`,` |{E} {E}| `,` |____| `],[` `,` .-O-oo-O-. `,`(__________)`,` |{E} {E}| `,` |____| `],[` . o . `,` .-o-OO-o-. `,`(__________)`,` |{E} {E}| `,` |____| `]],[m]:[[` `,` /\\ /\\ `,` ( {E} {E} ) `,` ( .. ) `," `------´ "],[` `,` /\\ /| `,` ( {E} {E} ) `,` ( .. ) `," `------´ "],[` `,` /\\ /\\ `,` ( {E} {E} ) `,` ( .. ) `," `------´~ "]]},w={none:``,crown:` \\^^^/ `,tophat:` [___] `,propeller:` -+- `,halo:` ( ) `,wizard:` /^\\ `,beanie:` (___) `,tinyduck:` ,> `}}));export{x as i,S as n,b as r,T as t};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{B as e,M as t,d as n,n as r,t as i}from"./server-DzOdtq8A.js";import{t as a}from"./lib-Cf16LgKj.js";import{n as o,t as s}from"./stdio-Cg20AQ5W.js";import{basename as c,extname as l,join as u}from"node:path";import{chmodSync as d,existsSync as f,mkdirSync as p,readFileSync as m,unlinkSync as ee,writeFileSync as h}from"node:fs";import{homedir as g,tmpdir as te}from"node:os";import{createCipheriv as ne,createDecipheriv as re,createHash as ie,randomBytes as _,randomUUID as v}from"node:crypto";var y={NONE:0,USER:1,BOT:2},b={NONE:0,TEXT:1,IMAGE:2,VOICE:3,FILE:4,VIDEO:5},x={NEW:0,GENERATING:1,FINISH:2},S={IMAGE:1,VIDEO:2,FILE:3,VOICE:4},ae={TYPING:1,CANCEL:2},oe=`0.1.0`;function C(){return{channel_version:oe}}function w(){return _(4).toString(`base64`)}function T(e){let t={"Content-Type":`application/json`,"X-WECHAT-UIN":w()};return e&&(t.AuthorizationType=`ilink_bot_token`,t.Authorization=`Bearer ${e}`),t}async function E(e,t,n,r,i=4e4,a){let o=new AbortController,s=setTimeout(()=>o.abort(),i);a&&a.addEventListener(`abort`,()=>o.abort(),{once:!0});try{let i=await fetch(`${e}${t}`,{method:`POST`,headers:T(r),body:JSON.stringify(n),signal:o.signal});if(!i.ok)throw Error(`HTTP ${i.status}: ${i.statusText}`);return await i.json()}finally{clearTimeout(s)}}async function se(e,t,n,r){let i={get_updates_buf:n,base_info:C()};try{return await E(e,`/ilink/bot/getupdates`,i,t,4e4,r)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return{ret:0,msgs:[],get_updates_buf:n};throw e}}async function D(e,t,n){await E(e,`/ilink/bot/sendmessage`,{msg:n,base_info:C()},t)}async function O(e,t,n){return E(e,`/ilink/bot/getuploadurl`,{...n,base_info:C()},t)}async function k(e,t,n,r){return E(e,`/ilink/bot/getconfig`,{ilink_user_id:n,context_token:r,base_info:C()},t)}async function A(e,t,n){return E(e,`/ilink/bot/sendtyping`,{...n,base_info:C()},t)}var j=`https://ilinkai.weixin.qq.com`,M=`https://novac2c.cdn.weixin.qq.com/c2c`;function N(){let e=process.env.WEIXIN_STATE_DIR||u(g(),`.claude`,`channels`,`weixin`);return f(e)||p(e,{recursive:!0}),e}function P(){return u(N(),`account.json`)}function F(){let e=P();if(!f(e))return null;try{return JSON.parse(m(e,`utf-8`))}catch{return null}}function ce(e){let t=P();h(t,JSON.stringify(e,null,2),`utf-8`),d(t,384)}function le(){let e=P();f(e)&&ee(e)}var ue=a();async function I(e){let t=await(0,ue.toString)(e,{type:`terminal`,errorCorrectionLevel:`L`,small:!0});process.stderr.write(`${t}\n`)}async function L(e){let t=await fetch(`${e}/ilink/bot/get_bot_qrcode?bot_type=3`);if(!t.ok)throw Error(`Failed to get QR code: HTTP ${t.status}`);let n=await t.json();if(!n.qrcode)throw Error(`No qrcode in response`);let r=n.qrcode_img_content||``;return r&&await I(r),{qrcodeUrl:r,qrcodeId:n.qrcode,message:`Scan the QR code with WeChat to connect.`}}async function R(e){let{qrcodeId:t,apiBaseUrl:n,timeoutMs:r=48e4,maxRetries:i=3}=e,a=Date.now()+r,o=t,s=0;for(;Date.now()<a;){try{let e=new AbortController,t=setTimeout(()=>e.abort(),6e4),r=await fetch(`${n}/ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(o)}`,{headers:{"iLink-App-ClientVersion":`1`},signal:e.signal});if(clearTimeout(t),!r.ok)throw Error(`HTTP ${r.status}`);let a=await r.json();switch(a.status){case`confirmed`:return{connected:!0,token:a.bot_token,accountId:a.ilink_bot_id,baseUrl:a.baseurl,userId:a.ilink_user_id,message:`Connected to WeChat successfully!`};case`scaned`:process.stderr.write(`QR code scanned, waiting for confirmation...
|
|
2
|
+
`);break;case`expired`:if(s+=1,s>=i)return{connected:!1,message:`QR code expired after maximum retries.`};process.stderr.write(`QR code expired, refreshing...
|
|
3
|
+
`),o=(await L(n)).qrcodeId;break;default:break}}catch(e){if(e instanceof Error&&e.name===`AbortError`)continue;throw e}await new Promise(e=>setTimeout(e,1e3))}return{connected:!1,message:`Login timed out.`}}function z(){return u(N(),`access.json`)}function B(){return u(N(),`pending-pairings.json`)}function V(){let e=B();if(!f(e))return{};try{return JSON.parse(m(e,`utf-8`))}catch{return{}}}function H(e){h(B(),JSON.stringify(e,null,2),`utf-8`)}function U(){let e=z();if(!f(e))return{policy:`pairing`,allowFrom:[]};try{return JSON.parse(m(e,`utf-8`))}catch{return{policy:`pairing`,allowFrom:[]}}}function de(e){h(z(),JSON.stringify(e,null,2),`utf-8`)}function fe(e){let t=U();return t.policy===`disabled`?!0:t.allowFrom.includes(e)}function pe(e){let t=V(),n=Date.now();for(let e of Object.keys(t))t[e].expiresAt<n&&delete t[e];for(let[n,r]of Object.entries(t))if(r.userId===e)return H(t),n;let r=String(Math.floor(1e5+Math.random()*9e5));return t[r]={userId:e,expiresAt:n+600*1e3},H(t),r}function me(e){let t=V(),n=t[e];if(!n||n.expiresAt<Date.now())return delete t[e],H(t),null;delete t[e],H(t);let r=U();return r.allowFrom.includes(n.userId)||(r.allowFrom.push(n.userId),de(r)),n.userId}function he(e,t){let n=ne(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function ge(e,t){let n=re(`aes-128-ecb`,t,null);return Buffer.concat([n.update(e),n.final()])}function _e(e,t){return`${t}/download?encrypted_query_param=${encodeURIComponent(e)}`}function ve(e,t,n){return`${e}/upload?encrypted_query_param=${encodeURIComponent(t)}&filekey=${encodeURIComponent(n)}`}function ye(e){let t=Buffer.from(e,`base64`);if(t.length===16)return t;if(t.length===32&&/^[0-9a-fA-F]{32}$/.test(t.toString(`ascii`)))return Buffer.from(t.toString(`ascii`),`hex`);throw Error(`Invalid aes_key: expected 16 raw bytes or 32 hex chars, got ${t.length} bytes`)}async function be(e){let t=_e(e.encryptQueryParam,e.cdnBaseUrl),n=await fetch(t);if(!n.ok)throw Error(`CDN download failed: HTTP ${n.status}`);return ge(Buffer.from(await n.arrayBuffer()),ye(e.aesKey))}async function W(e){let t=m(e.filePath),n=t.length,r=ie(`md5`).update(t).digest(`hex`),i=_(16),a=_(16).toString(`hex`),o=he(t,i),s=o.length,l=await O(e.apiBaseUrl,e.token,{filekey:a,media_type:e.mediaType,to_user_id:e.toUserId,rawsize:n,rawfilemd5:r,filesize:s,no_need_thumb:!0,aeskey:i.toString(`hex`)});if(!l.upload_param)throw Error(`No upload_param in response`);let u=ve(e.cdnBaseUrl,l.upload_param,a),d=await fetch(u,{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:new Uint8Array(o)});if(!d.ok)throw Error(`CDN upload failed: HTTP ${d.status}`);return{encryptQueryParam:d.headers.get(`x-encrypted-param`)||``,aesKey:Buffer.from(i.toString(`hex`)).toString(`base64`),fileSize:s,rawSize:n,fileName:c(e.filePath)}}function xe(e){let t=l(e).toLowerCase();return[`.jpg`,`.jpeg`,`.png`,`.gif`,`.bmp`,`.webp`,`.heic`].includes(t)?S.IMAGE:[`.mp4`,`.mov`,`.avi`,`.mkv`,`.webm`].includes(t)?S.VIDEO:S.FILE}function Se(e){let t=``,n=0;for(;n<e.length;)if(e.startsWith("```",n)){let r=n+3;for(;r<e.length&&e[r]!==`
|
|
4
|
+
`;)r++;r<e.length&&r++;let i=r;for(;r<e.length;){if(e.startsWith("```",r)){for(t+=e.slice(i,r),r+=3;r<e.length&&e[r]!==`
|
|
5
|
+
`;)r++;r<e.length&&r++;break}r++}r>=e.length&&!e.startsWith("```",r-3)&&(t+=e.slice(n)),n=r}else t+=e[n],n++;return t}function G(e){return Se(e).replace(/`([^`]+)`/g,`$1`).replace(/\*\*\*(.+?)\*\*\*/g,`$1`).replace(/\*\*(.+?)\*\*/g,`$1`).replace(/\*(.+?)\*/g,`$1`).replace(/___(.+?)___/g,`$1`).replace(/__(.+?)__/g,`$1`).replace(/_(.+?)_/g,`$1`).replace(/~~(.+?)~~/g,`$1`).replace(/^#{1,6}\s+/gm,``).replace(/\[([^\]]+)\]\(([^)]+)\)/g,`$1 ($2)`).replace(/!\[([^\]]*)\]\([^)]+\)/g,`[$1]`).replace(/^>\s+/gm,``).replace(/^[-*_]{3,}$/gm,`---`).replace(/^[\s]*[-*+]\s+/gm,`- `).replace(/^[\s]*(\d+)\.\s+/gm,`$1. `).replace(/\n{3,}/g,`
|
|
6
|
+
|
|
7
|
+
`).trim()}async function K(e){let t=v();return await D(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:y.BOT,message_state:x.FINISH,context_token:e.contextToken,item_list:[{type:b.TEXT,text_item:{text:G(e.text)}}]}),{messageId:t}}async function Ce(e){let t=``;for(let n of e.items)t=v(),await D(e.baseUrl,e.token,{to_user_id:e.to,from_user_id:``,client_id:t,message_type:y.BOT,message_state:x.FINISH,context_token:e.contextToken,item_list:[n]});return t}async function we(e){let t=xe(e.filePath),n=await W({filePath:e.filePath,toUserId:e.to,mediaType:t,apiBaseUrl:e.baseUrl,token:e.token,cdnBaseUrl:e.cdnBaseUrl}),r={encrypt_query_param:n.encryptQueryParam,aes_key:n.aesKey,encrypt_type:1},i=[];switch(e.text&&i.push({type:b.TEXT,text_item:{text:G(e.text)}}),t){case 1:i.push({type:b.IMAGE,image_item:{media:r,mid_size:n.fileSize}});break;case 2:i.push({type:b.VIDEO,video_item:{media:r,video_size:n.fileSize}});break;default:i.push({type:b.FILE,file_item:{media:r,file_name:n.fileName,len:String(n.rawSize)}});break}return{messageId:await Ce({items:i,to:e.to,baseUrl:e.baseUrl,token:e.token,contextToken:e.contextToken})}}var Te=900*1e3,q=new Map,J=null;function Y(e=Date.now()){for(let[t,n]of q.entries())n.expiresAt<=e&&q.delete(t)}function Ee(e,t){J={chatId:e,contextToken:t,updatedAt:Date.now()}}function De(){return J}function Oe(e,t,n){Y();let r={...e,chatId:t,contextToken:n,createdAt:Date.now(),expiresAt:Date.now()+Te};return q.set(e.request_id.toLowerCase(),r),r}function ke(e,t){Y();let n=e.toLowerCase(),r=q.get(n);return!r||r.chatId!==t?null:(q.delete(n),r)}var Ae=/^\s*(y|yes|n|no)\s+([a-km-z]{5})\s*$/i,X=new Map;function Z(e){return X.get(e)}function Q(){return u(N(),`cursor.txt`)}function je(){let e=Q();return f(e)?m(e,`utf-8`).trim():``}function Me(e){h(Q(),e,`utf-8`)}async function Ne(e,t){let n,r,i=``,a=``;switch(e.type){case b.IMAGE:n=e.image_item?.media?.encrypt_query_param,r=e.image_item?.aeskey?Buffer.from(e.image_item.aeskey,`hex`).toString(`base64`):e.image_item?.media?.aes_key,i=`.jpg`,a=`image`;break;case b.VOICE:n=e.voice_item?.media?.encrypt_query_param,r=e.voice_item?.media?.aes_key,i=`.silk`,a=`voice`;break;case b.FILE:n=e.file_item?.media?.encrypt_query_param,r=e.file_item?.media?.aes_key,i=e.file_item?.file_name?`.${e.file_item.file_name.split(`.`).pop()}`:``,a=`file`;break;case b.VIDEO:n=e.video_item?.media?.encrypt_query_param,r=e.video_item?.media?.aes_key,i=`.mp4`,a=`video`;break;default:return null}if(!n||!r)return null;try{let o=await be({encryptQueryParam:n,aesKey:r,cdnBaseUrl:t}),s=u(te(),`weixin-media`);f(s)||p(s,{recursive:!0});let l=u(s,c(e.file_item?.file_name||`${Date.now()}${i}`));return h(l,o),{path:l,type:a}}catch(e){return process.stderr.write(`[weixin] Failed to download media: ${e}\n`),null}}function Pe(e){let t=e.match(Ae);if(!t)return null;let n=t[1]?.toLowerCase().startsWith(`y`)?`allow`:`deny`,r=t[2]?.toLowerCase();return r?{requestId:r,behavior:n}:null}async function Fe(e){let{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a,abortSignal:o}=e,s=je(),c=0;for(process.stderr.write(`[weixin] Starting message poll loop...
|
|
8
|
+
`);!o.aborted;)try{let e=await se(t,r,s,o);if(e.errcode===-14){process.stderr.write(`[weixin] Session expired (errcode -14). Pausing for 30s...
|
|
9
|
+
`),await new Promise(e=>setTimeout(e,3e4));continue}if(e.ret!==0&&e.ret!==void 0)throw Error(`getUpdates error: ret=${e.ret} errcode=${e.errcode} ${e.errmsg}`);if(c=0,e.get_updates_buf&&(s=e.get_updates_buf,Me(s)),e.msgs&&e.msgs.length>0)for(let o of e.msgs)await Ie(o,{baseUrl:t,cdnBaseUrl:n,token:r,onMessage:i,onPermissionResponse:a})}catch(e){if(o.aborted)break;c+=1,process.stderr.write(`[weixin] Poll error (${c}): ${e instanceof Error?e.message:String(e)}\n`),c>=3?(process.stderr.write(`[weixin] Too many consecutive errors, backing off 30s...
|
|
10
|
+
`),await new Promise(e=>setTimeout(e,3e4)),c=0):await new Promise(e=>setTimeout(e,2e3))}process.stderr.write(`[weixin] Poll loop stopped.
|
|
11
|
+
`)}async function Ie(e,t){if(e.message_type!==y.USER)return;let n=e.from_user_id;if(!n)return;if(e.context_token&&X.set(n,e.context_token),!fe(n)){let r=pe(n);try{await K({to:n,text:`Your pairing code is: ${r}\n\nAsk the operator to confirm:\nccb weixin access pair ${r}`,baseUrl:t.baseUrl,token:t.token,contextToken:e.context_token||``})}catch(e){process.stderr.write(`[weixin] Failed to send pairing code: ${e}\n`)}return}Ee(n,e.context_token);let r=``,i,a;if(e.item_list){for(let n of e.item_list)if(n.type===b.TEXT&&n.text_item?.text)r+=`${r?`
|
|
12
|
+
`:``}${n.text_item.text}`;else if(n.type===b.IMAGE||n.type===b.VOICE||n.type===b.FILE||n.type===b.VIDEO){let e=await Ne(n,t.cdnBaseUrl);e&&(i=e.path,a=e.type),n.type===b.VOICE&&n.voice_item?.text&&(r+=`${r?`
|
|
13
|
+
`:``}[Voice transcription]: ${n.voice_item.text}`)}}if(!(!r&&!i)){if(r&&t.onPermissionResponse){let e=Pe(r);if(e){let r=ke(e.requestId,n);if(r){await t.onPermissionResponse({requestId:r.request_id,behavior:e.behavior,fromUserId:n});return}}}await t.onMessage({fromUserId:n,messageId:String(e.message_id||``),text:r||`(media attachment)`,attachmentPath:i,attachmentType:a})}}r(),o(),e();function Le(e){return[`Claude Code needs your approval.`,``,`Tool: ${e.tool_name}`,`Reason: ${e.description}`,`Input: ${e.input_preview}`,``,`Reply with: yes ${e.request_id}`,`Or deny with: no ${e.request_id}`].join(`
|
|
14
|
+
`)}function Re(e){let r=new i({name:`weixin`,version:e},{capabilities:{experimental:{"claude/channel":{},"claude/channel/permission":{}},tools:{}},instructions:`Messages from WeChat arrive as <channel source="plugin:weixin:weixin" chat_id="..." sender_id="...">. Reply using the reply tool with the chat_id from the channel tag. Use absolute paths for file attachments.`});return r.setRequestHandler(t,async()=>({tools:[{name:`reply`,description:`Reply to a WeChat message. Pass the chat_id from the channel tag.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id from the channel notification`},text:{type:`string`,description:`The reply text`},files:{type:`array`,items:{type:`string`},description:`Optional absolute file paths to attach`}},required:[`chat_id`,`text`]}},{name:`send_typing`,description:`Send a typing indicator to a WeChat user.`,inputSchema:{type:`object`,properties:{chat_id:{type:`string`,description:`The chat_id (user ID)`}},required:[`chat_id`]}}]})),r.setRequestHandler(n,async e=>{let{name:t,arguments:n}=e.params,r=F();if(!r)return{content:[{type:`text`,text:"WeChat not connected. Run `ccb weixin login` first."}],isError:!0};let i=r.baseUrl||`https://ilinkai.weixin.qq.com`,a=M;switch(t){case`reply`:{let e=typeof n?.chat_id==`string`?n.chat_id:``,t=typeof n?.text==`string`?n.text:``,o=Array.isArray(n?.files)?n.files.filter(e=>typeof e==`string`):void 0;if(!e||!t)return{content:[{type:`text`,text:`Missing chat_id or text parameter.`}],isError:!0};let s=Z(e)||``;try{if(o&&o.length>0){for(let[n,c]of o.entries()){if(!f(c))return{content:[{type:`text`,text:`File not found: ${c}`}],isError:!0};await we({filePath:c,to:e,text:n===0?t:``,baseUrl:i,token:r.token,contextToken:s,cdnBaseUrl:a})}return{content:[{type:`text`,text:`Message sent with attachments.`}]}}return await K({to:e,text:t,baseUrl:i,token:r.token,contextToken:s}),{content:[{type:`text`,text:`Message sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send: ${e}`}],isError:!0}}}case`send_typing`:{let e=typeof n?.chat_id==`string`?n.chat_id:``;if(!e)return{content:[{type:`text`,text:`Missing chat_id parameter.`}],isError:!0};try{let t=Z(e),n=await k(i,r.token,e,t);return n.typing_ticket&&await A(i,r.token,{ilink_user_id:e,typing_ticket:n.typing_ticket,status:ae.TYPING}),{content:[{type:`text`,text:`Typing indicator sent.`}]}}catch(e){return{content:[{type:`text`,text:`Failed to send typing: ${e}`}],isError:!0}}}default:return{content:[{type:`text`,text:`Unknown tool: ${t}`}],isError:!0}}}),r}async function ze(e,t){t.enableConfigs(),t.initializeAnalyticsSink();let n=F();n||(process.stderr.write("[weixin] No account configured. Run `ccb weixin login` to connect your WeChat account.\n"),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(1));let r=Re(e),i=new s;t.registerPermissionHandler(r,async e=>{let r=e.channel_context?.chat_id,i=r?{chatId:r,contextToken:Z(r)}:De();if(!i){t.logForDebugging(`[Weixin MCP] No active chat available for permission request ${e.request_id}`);return}try{Oe(e,i.chatId,i.contextToken),await K({to:i.chatId,text:Le(e),baseUrl:a,token:n.token,contextToken:i.contextToken||``})}catch(t){process.stderr.write(`[weixin] Failed to relay permission request ${e.request_id}: ${t}\n`)}}),await r.connect(i);let a=n.baseUrl||`https://ilinkai.weixin.qq.com`,o=new AbortController,c=!1,l=async()=>{c||(c=!0,o.signal.aborted||o.abort(),await Promise.all([t.shutdown1PEventLogging(),t.shutdownDatadog()]),process.exit(0))};process.stdin.on(`end`,()=>void l()),process.stdin.on(`error`,()=>void l()),process.on(`SIGINT`,()=>void l()),process.on(`SIGTERM`,()=>void l()),process.on(`SIGHUP`,()=>void l());let u=process.ppid,d=setInterval(()=>{try{process.kill(u,0)}catch{process.stderr.write(`[weixin] Parent process exited, shutting down...
|
|
15
|
+
`),clearInterval(d),l()}},5e3);t.logForDebugging(`[Weixin MCP] Starting poll loop`),await Fe({baseUrl:a,cdnBaseUrl:M,token:n.token,onMessage:async e=>{await r.notification({method:`notifications/claude/channel`,params:{content:e.text,meta:{chat_id:e.fromUserId,sender_id:e.fromUserId,message_id:e.messageId,...e.attachmentPath&&{attachment_path:e.attachmentPath},...e.attachmentType&&{attachment_type:e.attachmentType}}}})},onPermissionResponse:async e=>{await r.notification({method:`notifications/claude/channel/permission`,params:{request_id:e.requestId,behavior:e.behavior}})},abortSignal:o.signal}),clearInterval(d),await l()}function $(){process.stdout.write([`Usage:`,` ccb weixin serve`,` ccb weixin login`,` ccb weixin login clear`,` ccb weixin access pair <code>`,``,`Session enablement:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
16
|
+
`)+`
|
|
17
|
+
`)}async function Be(e=!1){if(e){le(),process.stdout.write(`WeChat account cleared.
|
|
18
|
+
`);return}let t=F();if(t){process.stdout.write([`Already connected:`,` User ID: ${t.userId||`unknown`}`,` Connected since: ${t.savedAt}`,``,"Run `ccb weixin login clear` to disconnect.",`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
19
|
+
`)+`
|
|
20
|
+
`);return}process.stdout.write(`Starting WeChat QR login...
|
|
21
|
+
|
|
22
|
+
`);let n=await L(j);process.stdout.write(`\nScan the QR code above with WeChat, or open this URL:\n${n.qrcodeUrl||``}\n\n`);let r=await R({qrcodeId:n.qrcodeId,apiBaseUrl:j});(!r.connected||!r.token)&&(process.stderr.write(`Login failed: ${r.message}\n`),process.exit(1)),ce({token:r.token,baseUrl:r.baseUrl||`https://ilinkai.weixin.qq.com`,userId:r.userId,savedAt:new Date().toISOString()}),process.stdout.write([`Connected successfully!`,` User ID: ${r.userId||`unknown`}`,` Base URL: ${r.baseUrl||`https://ilinkai.weixin.qq.com`}`,``,`Restart Claude Code with:`,` ccb --channels plugin:weixin@builtin`].join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`)}function Ve(e){(e[0]!==`pair`||!e[1])&&($(),process.exit(1));let t=me(e[1]);t||(process.stderr.write(`Invalid or expired pairing code.
|
|
25
|
+
`),process.exit(1)),process.stdout.write(`Paired successfully: ${t}\n`)}async function He(e,t,n){let[r,...i]=e;switch(r){case`serve`:t||(process.stderr.write(`[weixin] serve handler not available in this context.
|
|
26
|
+
`),process.exit(1)),await ze(n??`0.0.0`,t);return;case`login`:await Be(i[0]===`clear`);return;case`access`:Ve(i);return;default:$()}}export{He as handleWeixinCli};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./src-BWpNn6Yz.js";t();export{e as prewarm};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{Cn as o,t as s}from"./src-Di342QoJ.js";import{Ct as ee,cn as c}from"./state-sIHsFpDu.js";import{A as te,E as ne,_ as l,h as re,l as ie,p as u}from"./debug-otxXY3j-.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{a as p,n as m,r as h,s as g}from"./intl-CLeE9DsD.js";import{dirname as ae,join as _}from"path";function v(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return y(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return b(e,t);let s=t-1-a;return s<=0?b(r,t):x(i,s)+`…`+r}function y(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of m().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return r+`…`}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...m().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function x(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of m().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function S(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
|
|
2
|
+
`);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?y(r,t):`${r}…`}return o(r)<=t?r:y(r,t)}var C=e((()=>{s(),g()}));function w(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function T(e){return`${(e/1e3).toFixed(1)}s`}function E(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function D(e){return P(e>=1e3).format(e).toLowerCase()}function O(e){return D(e).replace(`.0`,``)}function k(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:h(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:h(n,r).format(0,`second`)}function A(e,t={}){let{now:n=new Date,...r}=t;return e>n?k(e,{...r,now:n}):k(e,{...r,numeric:`always`,now:n})}function oe(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:w(e.fileSize),n=[A(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function j(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${p()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${p()})`:``)}function se(e,t=!1,n=!0){let r=new Date(e);return`${j(Math.floor(r.getTime()/1e3),t,n)}`}var M,N,P,F=e((()=>{g(),C(),M=null,N=null,P=e=>e?(M||(M=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),M):(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),N)}));function I(){return B}function L(e){return e.toFixed(3)}function R(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${w(r.rss)}, Heap: ${w(r.heapUsed)}`:``;return`[+${L(e).padStart(i)}ms] (+${L(t).padStart(a)}ms) ${n}${o}${s}`}var z,B,V=e((()=>{F(),i(),z=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},B=new z}));function H(e){X&&(I().mark(e),J&&Z.push(process.memoryUsage()))}function U(){if(!J)return`Startup profiling not enabled`;let e=I().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(R(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${L(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
|
|
3
|
+
`)}function W(){if(!$){if($=!0,q(),J){let e=K(),t=ae(e);re().mkdirSync(t),te(e,U(),{encoding:`utf8`,flush:!0}),u(`Startup profiling report:`),u(U())}I().clearMarks(),Z.length=0}}function G(){return J}function K(){return _(t(),`startup-perf`,`${ee()}.txt`)}function q(){if(!Y)return;let e=I().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,f(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,ce=e((()=>{c(),d(),ie(),n(),l(),V(),ne(),J=r(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=process.env.USER_TYPE===`ant`||Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&H(`profiler_initialized`),$=!1}));export{S as C,x as D,y as E,C as S,b as T,se as _,H as a,O as b,R as c,E as d,w as f,A as g,k as h,q as i,I as l,D as m,ce as n,W as o,oe as p,G as r,L as s,K as t,V as u,j as v,v as w,F as x,T as y};
|