@readmagic/workmate 0.0.19 → 0.0.21
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-DgAxYgBY.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-DGMRVexR.js +1 -0
- package/dist/chunks/AgentsMdExternalIncludesDialog-Dp6CwZyI.js +1 -0
- package/dist/chunks/App-VWyPd524.js +1 -0
- package/dist/chunks/ApproveApiKey-Bolw0sPs.js +1 -0
- package/dist/chunks/ApproveApiKey-CyNPMd6g.js +1 -0
- package/dist/chunks/BackgroundTasksDialog-DxagIOOw.js +2 -0
- package/dist/chunks/BypassPermissionsModeDialog-OS2S66zQ.js +1 -0
- package/dist/chunks/{DiffDialog-6Srcz3NW.js → DiffDialog-CMtml9iw.js} +3 -3
- package/dist/chunks/Doctor-Bk9P37mU.js +1 -0
- package/dist/chunks/Doctor-D9F3tKsr.js +3 -0
- package/dist/chunks/ExitFlow-DhRv5JPj.js +2 -0
- package/dist/chunks/{Grove-DC4jyxeB.js → Grove-Bbh8PpH0.js} +1 -1
- package/dist/chunks/{HybridTransport-DArmWb1V.js → HybridTransport-P1vEUwhv.js} +1 -1
- package/dist/chunks/InvalidConfigDialog-xAYpE-20.js +1 -0
- package/dist/chunks/InvalidSettingsDialog-CXFSISy3.js +1 -0
- package/dist/chunks/MCPConnectionManager-CoId-C__.js +1 -0
- package/dist/chunks/MCPToolListView-BQkQ-hyF.js +1 -0
- package/dist/chunks/McpParsingWarnings-6ENzOklf.js +1 -0
- package/dist/chunks/MessageSelector-BvRVrfg6.js +3 -0
- package/dist/chunks/Messages-Cykztq1O.js +10 -0
- package/dist/chunks/Onboarding-CfeRwPNQ.js +1 -0
- package/dist/chunks/PermissionDialog-BaibiQae.js +1 -0
- package/dist/chunks/PressEnterToContinue-DZc_s_pE.js +1 -0
- package/dist/chunks/PromptInputFooterSuggestions-Blzgj5yW.js +1 -0
- package/dist/chunks/PromptInputHelpMenu-Ckp0k8E3.js +1 -0
- package/dist/chunks/QueryEngine-DduzztIG.js +1 -0
- package/dist/chunks/REPL-B8e5UU3H.js +128 -0
- package/dist/chunks/REPL-C4mbOhyL.js +1 -0
- package/dist/chunks/{RemoteSessionManager-CRWOHvKf.js → RemoteSessionManager-BPESC6Wu.js} +2 -2
- package/dist/chunks/ResumeConversation-DG1sLryB.js +1 -0
- package/dist/chunks/{SSETransport-pPrlSZNF.js → SSETransport-CDNP2PlK.js} +1 -1
- package/dist/chunks/{SearchBox-CwwV0W-w.js → SearchBox-C9xxQzh1.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-vK2PP628.js +1 -0
- package/dist/chunks/Settings-B7n_dfP-.js +2 -0
- package/dist/chunks/TeleportProgress-QL3ibQfK.js +1 -0
- package/dist/chunks/TeleportRepoMismatchDialog-f-xl7biD.js +1 -0
- package/dist/chunks/TeleportResumeWrapper-DzVcrFuP.js +1 -0
- package/dist/chunks/ThemePicker-CIFKZza0.js +1 -0
- package/dist/chunks/TrustDialog-C0HEwZPk.js +1 -0
- package/dist/chunks/{ValidationErrorsList-BfZ5gcIv.js → ValidationErrorsList-2QWIs_6h.js} +1 -1
- package/dist/chunks/add-dir-DmEhPnvj.js +1 -0
- package/dist/chunks/{agentDisplay-D01ZlnVX.js → agentDisplay-1Y-N-gqz.js} +1 -1
- package/dist/chunks/{agents-Bxenhf8S.js → agents-CvW8XjoJ.js} +1 -1
- package/dist/chunks/agents-D96ng5I9.js +101 -0
- package/dist/chunks/allErrors-CT2dbBF3.js +1 -0
- package/dist/chunks/{api-C5ULzZny.js → api-DTyrmy1O.js} +1 -1
- package/dist/chunks/api-DumFOErN.js +1 -0
- package/dist/chunks/{auth-DvcZHXGk.js → auth-CZ4EsFWF.js} +1 -1
- package/dist/chunks/auth-QvonHoG9.js +1 -0
- package/dist/chunks/auth-jV5THRH8.js +1 -0
- package/dist/chunks/backgroundHousekeeping-C72oPgfD.js +17 -0
- package/dist/chunks/backgroundHousekeeping-D9PScHES.js +1 -0
- package/dist/chunks/{banner-BkUdig-T.js → banner-ChT5Ri7Q.js} +1 -1
- package/dist/chunks/{bg-tGgpwpYx.js → bg-qG2osBbP.js} +2 -2
- package/dist/chunks/{branch-CqQxCSHG.js → branch-K8X6jx0i.js} +1 -1
- package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BZ_UMtEL.js} +1 -1
- package/dist/chunks/{bridgeConfig-MxsnEEPx.js → bridgeConfig-C-bI-slm.js} +1 -1
- package/dist/chunks/bridgeConfig-_xpxhGB5.js +1 -0
- package/dist/chunks/{bridgeMessaging-Bx5pkkkx.js → bridgeMessaging-DSJlYarJ.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-B9EcQksI.js → bridgeStatusUtil-DaEq5c69.js} +1 -1
- package/dist/chunks/btw-BNs5OX7x.js +1 -0
- package/dist/chunks/caches-CC5NHwAz.js +1 -0
- package/dist/chunks/caches-nHxJWXgO.js +1 -0
- package/dist/chunks/{ccrClient-CimQTd0b.js → ccrClient-JnhF5b3z.js} +1 -1
- package/dist/chunks/{clear-KvoD-lFN.js → clear-D2KRoibg.js} +1 -1
- package/dist/chunks/client-BtTkq0YS.js +1 -0
- package/dist/chunks/commands-C_rYjyQZ.js +1 -0
- package/dist/chunks/compact-Cqd6vKpn.js +2 -0
- package/dist/chunks/config-Be0BkAAr.js +1 -0
- package/dist/chunks/{config-DRy1I12M.js → config-DUTgj3js.js} +1 -1
- package/dist/chunks/{config-e0Goy478.js → config-DoEDgAfv.js} +1 -1
- package/dist/chunks/context-Db9tH1VF.js +1 -0
- package/dist/chunks/{context-noninteractive-ApbVPU86.js → context-noninteractive-CacA9VlT.js} +2 -2
- package/dist/chunks/context-noninteractive-D9tJYwi7.js +1 -0
- package/dist/chunks/conversation-DWfE4KGH.js +1 -0
- package/dist/chunks/conversation-Tvo4EDpQ.js +1 -0
- package/dist/chunks/convert-legacy-node-http-options-BZnGSjx2.js +1 -0
- package/dist/chunks/{createSSHSession-DOz_Ox1_.js → createSSHSession-BQ83MMtr.js} +1 -1
- package/dist/chunks/createSession-CqHnHhCR.js +1 -0
- package/dist/chunks/{createSession-yR87Rhiv.js → createSession-DqTtBycR.js} +1 -1
- package/dist/chunks/crossProjectResume-DIXtiODF.js +40 -0
- package/dist/chunks/{datadog-DBgIEaEd.js → datadog-BuElf2EQ.js} +1 -1
- package/dist/chunks/detectRepository-DUJBh5s2.js +1 -0
- package/dist/chunks/{detectRepository-CDOJ-M7h.js → detectRepository-pRAVv8SH.js} +1 -1
- package/dist/chunks/{diff-qOom_T1G.js → diff-yA6v_dpP.js} +1 -1
- package/dist/chunks/{directoryCompletion-BDGcGDuv.js → directoryCompletion-CuA3_YIT.js} +1 -1
- package/dist/chunks/doctor-eNAm6OiS.js +1 -0
- package/dist/chunks/{entry-EmOA7oWN.js → entry-DidpiR-D.js} +5 -5
- package/dist/chunks/esm-0CwQE5CJ.js +10 -0
- package/dist/chunks/esm-BCUC71kt.js +1 -0
- package/dist/chunks/esm-BCmY8V0C.js +1 -0
- package/dist/chunks/esm-BUJtY-Rb.js +1 -0
- package/dist/chunks/esm-BadZVa27.js +1 -0
- package/dist/chunks/esm-BbMeEYcz.js +1 -0
- package/dist/chunks/esm-sVMjGuep.js +1 -0
- package/dist/chunks/execFileNoThrow-B_KRY4cT.js +34 -0
- package/dist/chunks/exit-DywUeiYd.js +1 -0
- package/dist/chunks/extraUsage-DiAirtuk.js +1 -0
- package/dist/chunks/extractMemories-_xiTnX95.js +1 -0
- package/dist/chunks/fast-DCXZACT9.js +1 -0
- package/dist/chunks/fast-Qo4WVqiW.js +1 -0
- package/dist/chunks/{fetchModelList-BbjuFHQT.js → fetchModelList-fQDsmR3E.js} +1 -1
- package/dist/chunks/fetchModelList-woVzIVde.js +1 -0
- package/dist/chunks/{fileSuggestions-Ct7vKEpR.js → fileSuggestions-CRx1D6uk.js} +3 -3
- package/dist/chunks/firstPartyEventLogger-B261Wksn.js +3 -0
- package/dist/chunks/firstPartyEventLogger-DtFTeHy-.js +1 -0
- package/dist/chunks/{flushGate-BZe_QwEz.js → flushGate-BA8dSr0i.js} +1 -1
- package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
- package/dist/chunks/{gemini-8sSwOtEf.js → gemini-BXAyy1JN.js} +1 -1
- package/dist/chunks/generateSessionName-Cwmk2N3F.js +1 -0
- package/dist/chunks/{genericProcessUtils-6E7fB1dI.js → genericProcessUtils-Cnyun_Wr.js} +3 -3
- package/dist/chunks/{git-By_J4XJL.js → git-Wid-XppW.js} +1 -1
- package/dist/chunks/git-hO-TMvXc.js +1 -0
- package/dist/chunks/{githubRepoPathMapping-CzgPGOHQ.js → githubRepoPathMapping-OV8U1VFK.js} +1 -1
- package/dist/chunks/goal-C9clrwEH.js +3 -0
- package/dist/chunks/{grok-cEzUsG-s.js → grok-CjeCecsZ.js} +1 -1
- package/dist/chunks/{grove--HtQL4QZ.js → grove-DqTnK9nn.js} +2 -2
- package/dist/chunks/help-Bb6LdzXK.js +1 -0
- package/dist/chunks/{hooks-CN5hLrhi.js → hooks-BDgToO1Z.js} +2 -2
- package/dist/chunks/hooks-BX2s7aoL.js +1 -0
- package/dist/chunks/{initReplBridge-BJhmlcVt.js → initReplBridge-D7cuY_os.js} +1 -1
- package/dist/chunks/install-eCA8UACi.js +1 -0
- package/dist/chunks/{instrumentation-DpgB3GFx.js → instrumentation-BaRKojJh.js} +6 -6
- package/dist/chunks/{job-DDoX1iFe.js → job-DYMfSglZ.js} +1 -1
- package/dist/chunks/{jwtUtils-C_LG1txt.js → jwtUtils-JE2okZ70.js} +1 -1
- package/dist/chunks/keybindings-iBqc1KHL.js +1 -0
- package/dist/chunks/launchLocalMemory-IZPGEzMk.js +3 -0
- package/dist/chunks/launchOnboarding-BeNf51Ig.js +8 -0
- package/dist/chunks/loadAgentsDir-Bpke9CtB.js +1 -0
- package/dist/chunks/{loadAgentsDir-DXOkUcW3.js → loadAgentsDir-C96o6gCj.js} +601 -626
- package/dist/chunks/loadPluginHooks-0nGlugZ4.js +1 -0
- package/dist/chunks/{localSearch-DnT21UkF.js → localSearch-DLz5IGGu.js} +1 -1
- package/dist/chunks/localSearch-dodgnjGn.js +1 -0
- package/dist/chunks/logoUtils-Cg_6QV1Z.js +1 -0
- package/dist/chunks/{magicDocs-rxv0rR8E.js → magicDocs-DmPNMnNY.js} +2 -2
- package/dist/chunks/{main-Blm02_Js.js → main-7ssnA9Yb.js} +2 -2
- package/dist/chunks/{main-BOvY4O6D.js → main-BEv6MqMX.js} +34 -34
- package/dist/chunks/{managedEnv-CpgCYISH.js → managedEnv-CHYvwXBH.js} +1 -1
- package/dist/chunks/managedEnv-CbjOQmEe.js +1 -0
- package/dist/chunks/mappers-D8VLUZ2N.js +1 -0
- package/dist/chunks/mcp-BUn3yqsT.js +1 -0
- package/dist/chunks/mcp-BskLq9iP.js +2 -0
- package/dist/chunks/mcp-C-0DMaXx.js +6 -0
- package/dist/chunks/memory-vDkJM58W.js +1 -0
- package/dist/chunks/modalContext-DDZdU1J8.js +1 -0
- package/dist/chunks/mode-Dbh21H2Y.js +2 -0
- package/dist/chunks/model-BaMclMXn.js +1 -0
- package/dist/chunks/model-atn3_JBi.js +1 -0
- package/dist/chunks/model-vS1Iewyq.js +1 -0
- package/dist/chunks/{modelOptions-BqBHEyiR.js → modelOptions-Cw1ThINb.js} +1 -1
- package/dist/chunks/{src-l6_O0K-a.js → modifiersNative-BYHdmWw1.js} +1 -1
- package/dist/chunks/modifiersNative-D7nm70eq.js +1 -0
- package/dist/chunks/nativeInstaller-CfZ5uNTh.js +1 -0
- package/dist/chunks/omit-B7eQ9q0x.js +1 -0
- package/dist/chunks/{onChangeAppState-qHXqufwy.js → onChangeAppState-kEAt8nxV.js} +1 -1
- package/dist/chunks/{openai-_FQ9EhuR.js → openai-wh8AX5iz.js} +3 -3
- package/dist/chunks/panel-Cm23FDVt.js +1 -0
- package/dist/chunks/{partition-BgwHlPsO.js → partition-CENvOfiS.js} +1 -1
- package/dist/chunks/permissions-ChuIx-d4.js +3 -0
- package/dist/chunks/{pidLock-CEhbTkBE.js → pidLock-C1hmh3YQ.js} +2 -2
- package/dist/chunks/plan-s228H7IU.js +1 -0
- package/dist/chunks/plugin-DVBEWwMP.js +17 -0
- package/dist/chunks/{pluginAutoupdate-C2YbEHrP.js → pluginAutoupdate-aLXhSUVD.js} +1 -1
- package/dist/chunks/pluginBlocklist-BprCv0En.js +1 -0
- package/dist/chunks/pluginCliCommands-WzzqR1Sr.js +1 -0
- package/dist/chunks/{pluginFlagging-BDTgCYuC.js → pluginFlagging-BSLuTk3M.js} +1 -1
- package/dist/chunks/pluginOperations-Ca9Lup5G.js +2 -0
- package/dist/chunks/pluginStartupCheck-DdtxcNwH.js +1 -0
- package/dist/chunks/{pluginStartupCheck-DhhMk3dA.js → pluginStartupCheck-xQbHZ5gf.js} +1 -1
- package/dist/chunks/plugins-DdIaXpNb.js +4 -0
- package/dist/chunks/{poorMode-CKQfWf3S.js → poorMode-Bt_A2arj.js} +1 -1
- package/dist/chunks/poorMode-ZIq2oz7q.js +1 -0
- package/dist/chunks/print-vxrRE1O2.js +14 -0
- package/dist/chunks/processBashCommand-ISucgwpi.js +1 -0
- package/dist/chunks/processSlashCommand-BnpXO_fI.js +5 -0
- package/dist/chunks/prompt-2AA5W7EH.js +1 -0
- package/dist/chunks/prompt-AXiS2LoO.js +1 -0
- package/dist/chunks/{prompt-DEioJrx_.js → prompt-BNNE5tsG.js} +1 -1
- package/dist/chunks/promptEditor-DT6egmcb.js +4 -0
- package/dist/chunks/{protocolHandler-C-CFTcUJ.js → protocolHandler-DukQ6b4Q.js} +2 -2
- package/dist/chunks/{reconciler-DZP4dJJG.js → reconciler-D3zyJCnV.js} +1 -1
- package/dist/chunks/refresh-BSG0t4cf.js +1 -0
- package/dist/chunks/registerProtocol-BOEYaX-X.js +1 -0
- package/dist/chunks/{reload-plugins-m9CzoIxu.js → reload-plugins-BFMRhbv8.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-C4vSr1gp.js → remoteBridgeCore-D5OwvmAz.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-6RAHPt_g.js → remoteManagedSettings-DyGVvvcW.js} +1 -1
- package/dist/chunks/rename-BrEwj3Xw.js +1 -0
- package/dist/chunks/resume-DR5JbICs.js +2 -0
- package/dist/chunks/{ripgrep-C3jtZL7k.js → ripgrep-Dt4a91S5.js} +1 -1
- package/dist/chunks/ripgrep-KTOU5s9J.js +1 -0
- package/dist/chunks/{runtimeObserver-C2vjqtCE.js → runtimeObserver-CsZw5XBt.js} +2 -2
- package/dist/chunks/{runtimeObserver-CSroopId.js → runtimeObserver-DS1PK6We.js} +1 -1
- package/dist/chunks/sandbox-adapter-BqDyWcol.js +1 -0
- package/dist/chunks/sandbox-toggle-B9f_0NQI.js +1 -0
- package/dist/chunks/sanitization-DV-94a9Z.js +1 -0
- package/dist/chunks/searchExtraTools-2pIT2C8u.js +1 -0
- package/dist/chunks/session-wkRTfdo8.js +2 -0
- package/dist/chunks/sessionFileAccessHooks-DV22q9JO.js +1 -0
- package/dist/chunks/sessionObserver-BLJg0qm_.js +1 -0
- package/dist/chunks/{sessionObserver-iAJLH92a.js → sessionObserver-N7fORFdL.js} +2 -2
- package/dist/chunks/{sessionState-DAcub-HK.js → sessionState-8jutEorw.js} +1 -1
- package/dist/chunks/sessionStorage-DRV7IhZF.js +1 -0
- package/dist/chunks/sessionTracing-fIp8g04N.js +11 -0
- package/dist/chunks/{settings-3xZ0fsvE.js → settings-BowI3jp-.js} +2 -2
- package/dist/chunks/settings-CHn0gJCG.js +1 -0
- package/dist/chunks/settingsSync-DF4JgSNc.js +1 -0
- package/dist/chunks/setup-UiEO9i7F.js +3 -0
- package/dist/chunks/{shadowedRuleDetection-BL7dEv-u.js → shadowedRuleDetection-DEo1hvGi.js} +1 -1
- package/dist/chunks/{sideQuestion-Ct87yvOR.js → sideQuestion-C11KgNGL.js} +3 -3
- package/dist/chunks/sinks-DnLqRPEC.js +1 -0
- package/dist/chunks/{sinks-Bmn3li0M.js → sinks-mGBiINp8.js} +1 -1
- package/dist/chunks/skillChangeDetector-Dc6YZXJE.js +1 -0
- package/dist/chunks/{skillGapStore-MtlRyYmT.js → skillGapStore-H4MkUFUY.js} +2 -2
- package/dist/chunks/{skillLifecycle-Drs6gEv9.js → skillLifecycle-ADUTDK7D.js} +2 -2
- package/dist/chunks/{skillSearchPanel-DkvmjNaw.js → skillSearchPanel-PpfVDMGR.js} +2 -2
- package/dist/chunks/skills-DKtN17ch.js +1 -0
- package/dist/chunks/src-9vmGsuSI.js +1 -0
- package/dist/chunks/{src-CgZmCiiH.js → src-BacxF9BD.js} +2 -2
- package/dist/chunks/{startupProfiler-CbzxVmbv.js → startupProfiler-B90b5vuq.js} +1 -1
- package/dist/chunks/startupProfiler-DG2TN5R_.js +1 -0
- package/dist/chunks/staticRender-BVWx0IM1.js +1 -0
- package/dist/chunks/stats-D4LEtkrw.js +1 -0
- package/dist/chunks/status-0ZBx6Ls0.js +2 -0
- package/dist/chunks/status-BUJ4-omB.js +1 -0
- package/dist/chunks/{statusNoticeHelpers-BrN_2q7H.js → statusNoticeHelpers-BrpQWj0l.js} +1 -1
- package/dist/chunks/{stringUtils-CKD8qDqx.js → stringUtils-D7oJIyY2.js} +1 -1
- package/dist/chunks/switcher-D7Ey5uIi.js +1 -0
- package/dist/chunks/{switcher-99gm2vpe.js → switcher-DWfKi17X.js} +1 -1
- package/dist/chunks/{syncCache-B3OVvp8K.js → syncCache-DUhciJLz.js} +1 -1
- package/dist/chunks/{tasks-t5zT_D32.js → tasks-BwSsj2vI.js} +1 -1
- package/dist/chunks/teleport-DwZMevmQ.js +1 -0
- package/dist/chunks/{templateJobs-Bm8bovHx.js → templateJobs-fiKuu4DK.js} +1 -1
- package/dist/chunks/{terminalSetup-7PdC4fV5.js → terminalSetup-Cte5a4hM.js} +1 -1
- package/dist/chunks/{terminalSetup-kWdZRKWq.js → terminalSetup-a7-BNS4T.js} +1 -1
- package/dist/chunks/theme-CAoGjf2D.js +1 -0
- package/dist/chunks/{tmux-CpGd0Aca.js → tmux-DA06aewY.js} +1 -1
- package/dist/chunks/{toolEventObserver-C_nHI27x.js → toolEventObserver-Cq_ZV7x9.js} +1 -1
- package/dist/chunks/toolPool-mdsxlKWR.js +1 -0
- package/dist/chunks/{trustedDevice-Bb7O8_tj.js → trustedDevice-C1m--Yjw.js} +1 -1
- package/dist/chunks/trustedDevice-CeDIk_ln.js +1 -0
- package/dist/chunks/{udsClient-U7MEfYj7.js → udsClient-BcwsY0XE.js} +1 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-L5idX6Kz.js +1 -0
- package/dist/chunks/useMainLoopModel-VXeS2EC6.js +1 -0
- package/dist/chunks/useManagePlugins-CAXp5CfH.js +1 -0
- package/dist/chunks/useMergedTools-DYXrPTIA.js +1 -0
- package/dist/chunks/useSearchInput-Bxl4wGcZ.js +1 -0
- package/dist/chunks/useSettingsErrors-sbjsaT7k.js +1 -0
- package/dist/chunks/{userAgent-CJ5Rp9kc.js → userAgent-NbKd-hN7.js} +1 -1
- package/dist/chunks/util-DU63xTwZ.js +1 -0
- package/dist/chunks/validatePlugin-DQ_9OCpP.js +1 -0
- package/dist/chunks/{vim-BagKUX4j.js → vim-xruiCyUd.js} +1 -1
- package/dist/chunks/which-B8rchd8P.js +1 -0
- package/dist/chunks/{workerRegistry-BGJtgrko.js → workerRegistry-BBgquE8F.js} +2 -2
- package/dist/chunks/worktree-C28I8mFB.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +3 -25
- package/dist/chunks/AddWorkspaceDirectory-9FcHMKgX.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-Bny8WDwC.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-DLnj3JQO.js +0 -1
- package/dist/chunks/App-NkBqbDbC.js +0 -1
- package/dist/chunks/ApproveApiKey-BKzkEkW-.js +0 -1
- package/dist/chunks/ApproveApiKey-rgB6AsYD.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-CcViruUO.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-D254L98G.js +0 -1
- package/dist/chunks/Doctor-DYEdLRxR.js +0 -1
- package/dist/chunks/Doctor-DiNxlXfC.js +0 -3
- package/dist/chunks/ExitFlow-Bt2De110.js +0 -2
- package/dist/chunks/InvalidConfigDialog-DFiB0Kzc.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-BHNo2__T.js +0 -1
- package/dist/chunks/MCPConnectionManager-CdpO2Tj9.js +0 -1
- package/dist/chunks/MCPToolListView-Ch4jOk_x.js +0 -1
- package/dist/chunks/McpParsingWarnings-D4UQ8Q2e.js +0 -1
- package/dist/chunks/MessageSelector-BgsrdJur.js +0 -3
- package/dist/chunks/Messages-DB1pmDY_.js +0 -10
- package/dist/chunks/Onboarding-BnjdTwci.js +0 -1
- package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
- package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-Chg9U-BC.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-C0ZSo12s.js +0 -1
- package/dist/chunks/QueryEngine-bKlupZpA.js +0 -1
- package/dist/chunks/REPL-Cg8UXYpX.js +0 -128
- package/dist/chunks/REPL-yzvMFfaU.js +0 -1
- package/dist/chunks/ResumeConversation-Ld7tYLKO.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-CdgQlm--.js +0 -1
- package/dist/chunks/Settings-CsOlPcIW.js +0 -2
- package/dist/chunks/TeleportProgress-Di-PMey7.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-CDv1cbo-.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-Bmf13tGU.js +0 -1
- package/dist/chunks/ThemePicker-B3AO3_jA.js +0 -1
- package/dist/chunks/TrustDialog-C0aiR_LU.js +0 -1
- package/dist/chunks/add-dir-w1Ay3861.js +0 -1
- package/dist/chunks/agents-B_hUgPnR.js +0 -101
- package/dist/chunks/allErrors-C_iHQOlK.js +0 -1
- package/dist/chunks/api-CB3e0De0.js +0 -1
- package/dist/chunks/attributionHooks-C0aXyx9L.js +0 -1
- package/dist/chunks/auth-CsYEYXBO.js +0 -1
- package/dist/chunks/auth-CubXYcRl.js +0 -1
- package/dist/chunks/backgroundHousekeeping-BGKR5cdA.js +0 -17
- package/dist/chunks/backgroundHousekeeping-CykbtljP.js +0 -1
- package/dist/chunks/bridgeConfig-Cp2x_wtE.js +0 -1
- package/dist/chunks/btw-DeznoRrw.js +0 -1
- package/dist/chunks/caches-BiVRgePi.js +0 -1
- package/dist/chunks/caches-CGzKSWiP.js +0 -1
- package/dist/chunks/client-CmnPWgLq.js +0 -1
- package/dist/chunks/commands-CrzVgHxp.js +0 -1
- package/dist/chunks/compact-Dgzve3dI.js +0 -2
- package/dist/chunks/config-Df8jooTW.js +0 -1
- package/dist/chunks/context-Dz-bbYCw.js +0 -1
- package/dist/chunks/context-noninteractive-m4O3VtG7.js +0 -1
- package/dist/chunks/conversation-BYBX07j8.js +0 -1
- package/dist/chunks/conversation-CJ-d0O-U.js +0 -1
- package/dist/chunks/createSession-C_-ZEQT5.js +0 -1
- package/dist/chunks/crossProjectResume-DNnZo3gU.js +0 -40
- package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
- package/dist/chunks/doctor-CflXjqVK.js +0 -1
- package/dist/chunks/esm-BYnFh4pG.js +0 -1
- package/dist/chunks/esm-Bx6rTxIs.js +0 -1
- package/dist/chunks/esm-C367Cyo-.js +0 -1
- package/dist/chunks/esm-CXM9jqO_.js +0 -1
- package/dist/chunks/esm-CXczu_-W.js +0 -1
- package/dist/chunks/esm-CXt5K8Xt.js +0 -1
- package/dist/chunks/esm-Cb-L4oAk.js +0 -1
- package/dist/chunks/esm-DBMVQDVv.js +0 -1
- package/dist/chunks/esm-DhRjocaU.js +0 -1
- package/dist/chunks/esm-DklLYEuz.js +0 -1
- package/dist/chunks/esm-IYgGg4wR.js +0 -1
- package/dist/chunks/esm-lyfry1WB.js +0 -10
- package/dist/chunks/execFileNoThrow-Bmb5HEFz.js +0 -34
- package/dist/chunks/exit-DDrAFCzE.js +0 -1
- package/dist/chunks/extraUsage-DylXI7Fc.js +0 -1
- package/dist/chunks/extractMemories-B_8wZpXA.js +0 -1
- package/dist/chunks/fast-4ajfJv-M.js +0 -1
- package/dist/chunks/fast-BCkhj9Dq.js +0 -1
- package/dist/chunks/fetchModelList-V8_e2O1N.js +0 -1
- package/dist/chunks/firstPartyEventLogger-CxUuXQhL.js +0 -3
- package/dist/chunks/firstPartyEventLogger-YQm0DoVu.js +0 -1
- package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
- package/dist/chunks/generateSessionName-vT1khubt.js +0 -1
- package/dist/chunks/git-zJCasBa6.js +0 -1
- package/dist/chunks/goal-CznQA1n1.js +0 -3
- package/dist/chunks/help-B6A_kDQA.js +0 -1
- package/dist/chunks/hooks-CJY5Vfy6.js +0 -1
- package/dist/chunks/install-DUOtI2Hq.js +0 -1
- package/dist/chunks/keybindings-BGTuYfk-.js +0 -1
- package/dist/chunks/launchLocalMemory-CoWeLNeP.js +0 -3
- package/dist/chunks/launchOnboarding-CTIBGSLV.js +0 -8
- package/dist/chunks/loadAgentsDir-Dxz1vp3F.js +0 -1
- package/dist/chunks/loadPluginHooks-DrNVtTBq.js +0 -1
- package/dist/chunks/localSearch-CCs5fOd_.js +0 -1
- package/dist/chunks/logoUtils-YwL3izJt.js +0 -1
- package/dist/chunks/managedEnv-CrnBYTtQ.js +0 -1
- package/dist/chunks/mappers-DYtq2XVS.js +0 -1
- package/dist/chunks/mcp-BPvcoKDY.js +0 -1
- package/dist/chunks/mcp-BfqsHRx0.js +0 -2
- package/dist/chunks/mcp-BoU3TNFs.js +0 -6
- package/dist/chunks/memory-BPKRdkBb.js +0 -1
- package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
- package/dist/chunks/mode-CXpXux2s.js +0 -2
- package/dist/chunks/model-CxPYKiW1.js +0 -1
- package/dist/chunks/model-Cxx3suBa.js +0 -1
- package/dist/chunks/model-aEJ54cMA.js +0 -1
- package/dist/chunks/nativeInstaller-CaXwRpoR.js +0 -1
- package/dist/chunks/omit-DZUxsClb.js +0 -1
- package/dist/chunks/panel-CVd1dzYl.js +0 -1
- package/dist/chunks/permissions-Dv5d5Nu3.js +0 -3
- package/dist/chunks/plan-DVPBW5OS.js +0 -1
- package/dist/chunks/plugin-Bh2eBwLW.js +0 -17
- package/dist/chunks/pluginBlocklist-B2NAKaB9.js +0 -1
- package/dist/chunks/pluginCliCommands-Cw5TrYYb.js +0 -1
- package/dist/chunks/pluginOperations-BBwGEdfC.js +0 -2
- package/dist/chunks/pluginStartupCheck-CHx379_R.js +0 -1
- package/dist/chunks/plugins-r0h93GT_.js +0 -4
- package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
- package/dist/chunks/postCommitAttribution-DoSP9wZD.js +0 -1
- package/dist/chunks/print-CDzhHi2F.js +0 -14
- package/dist/chunks/processBashCommand-DmdCAWOR.js +0 -1
- package/dist/chunks/processSlashCommand-B43TkiaI.js +0 -5
- package/dist/chunks/prompt-C50mDqWv.js +0 -1
- package/dist/chunks/prompt-WGH9CcXh.js +0 -1
- package/dist/chunks/promptEditor-eJzbtNn4.js +0 -4
- package/dist/chunks/refresh-vaY-Sr80.js +0 -1
- package/dist/chunks/registerProtocol-Xsq4ldwg.js +0 -1
- package/dist/chunks/rename-DmauGVBX.js +0 -1
- package/dist/chunks/resume-ut_pBrLN.js +0 -2
- package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
- package/dist/chunks/sandbox-adapter-CL0qdcxn.js +0 -1
- package/dist/chunks/sandbox-toggle-BJKd1ZYk.js +0 -1
- package/dist/chunks/searchExtraTools-ByWuNCGo.js +0 -1
- package/dist/chunks/session-DTin6hOR.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-DorzHolr.js +0 -1
- package/dist/chunks/sessionObserver-Dy6NFlzL.js +0 -1
- package/dist/chunks/sessionStorage-DItJMkwx.js +0 -1
- package/dist/chunks/sessionTracing-Dvi520eN.js +0 -11
- package/dist/chunks/settings-Crx1cI1u.js +0 -1
- package/dist/chunks/settingsSync-aHn3p-6J.js +0 -1
- package/dist/chunks/setup-CK3ybjjM.js +0 -3
- package/dist/chunks/sinks-QQ_6Op7q.js +0 -1
- package/dist/chunks/skillChangeDetector-Bco3UoeW.js +0 -1
- package/dist/chunks/skills-axToWEo0.js +0 -1
- package/dist/chunks/src-D3yIF9I42.js +0 -1
- package/dist/chunks/src-DPUAq5Ty.js +0 -1
- package/dist/chunks/src-DQOX_xI1.js +0 -1
- package/dist/chunks/src-Dt5IJd3C.js +0 -1
- package/dist/chunks/src-Dvp6-vB7.js +0 -19
- package/dist/chunks/src-PM8NIIu_.js +0 -1
- package/dist/chunks/startupProfiler-uHetQush.js +0 -1
- package/dist/chunks/staticRender-D9AbnQFr.js +0 -1
- package/dist/chunks/stats-Ce15gc3E.js +0 -1
- package/dist/chunks/status-3uevwSMo.js +0 -1
- package/dist/chunks/status-CGp4uRlH.js +0 -2
- package/dist/chunks/switcher-DJDxjLPQ.js +0 -1
- package/dist/chunks/teleport-CvX_nUjQ.js +0 -1
- package/dist/chunks/theme-DzaSXOpQ.js +0 -1
- package/dist/chunks/toolPool-CgKK0K8f.js +0 -1
- package/dist/chunks/trustedDevice-C2gnF9Lc.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-D0uqGxGw.js +0 -1
- package/dist/chunks/useMainLoopModel-BGPOmBkl.js +0 -1
- package/dist/chunks/useManagePlugins-ITVFO9dz.js +0 -1
- package/dist/chunks/useMergedTools-rQ19rFvH.js +0 -1
- package/dist/chunks/useSearchInput-CXTa-leH.js +0 -1
- package/dist/chunks/useSettingsErrors-Xc6RYjYF.js +0 -1
- package/dist/chunks/util-CD3ar4of.js +0 -1
- package/dist/chunks/validatePlugin-CxrlCKc1.js +0 -1
- package/dist/chunks/which-BxQ1hpjp.js +0 -1
- package/dist/chunks/worktree-CanG5GhE.js +0 -1
- /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
- /package/dist/chunks/{src-DLz3FZm1.js → urlHandler-DLz3FZm1.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{Di as r,Li as i,
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{Di as r,Li as i,Lp as a,Rp as o}from"./loadAgentsDir-C96o6gCj.js";import{n as s,t as c}from"./featureCheck-D6FjD-nt.js";import{a as l,s as u}from"./projectContext-BN2ZWzOG.js";import{a as d,c as ee,i as f,l as p,n as m,o as h,r as te,s as ne,u as g}from"./instinctParser-Dt-lqnDe.js";import{a as re,i as ie,n as _,o as v,r as y,t as ae}from"./observationStore-D0rm3GhP.js";import{a as oe,i as se,o as ce,r as le}from"./sessionObserver-N7fORFdL.js";import{a as ue,d as b,i as de,l as x,n as S,r as fe,s as C,t as pe,u as w}from"./skillLifecycle-ADUTDK7D.js";import{join as T}from"node:path";import{existsSync as E}from"node:fs";import{randomBytes as me}from"node:crypto";import{mkdir as D,readFile as he,readdir as O,rename as ge,unlink as _e,writeFile as k}from"node:fs/promises";function A(e){let t=_(e),n=e?.project;return(e?.scope??n?.scope??`project`)===`global`||!n||n.projectId===`global`?T(t,`global`,`instincts`,`personal`):T(t,`projects`,n.projectId,`instincts`,`personal`)}async function j(e,t){let n=h(e);await D(A(t),{recursive:!0});let r=N(n.id,t),i=`${r}.${me(6).toString(`hex`)}.tmp`;return await k(i,ee(n)),await ge(i,r),n}async function M(e){let t=A(e),n=[];try{n=await O(t)}catch(e){if(e.code===`ENOENT`)return[];throw e}let r=[];for(let e of n.filter(e=>e.endsWith(`.json`))){let n=await he(T(t,e),`utf8`);r.push(ne(n))}return r.sort((e,t)=>e.id.localeCompare(t.id))}function ve(e,t){let n=P.then(()=>ye(e,t));return P=n.catch(()=>{}),n}async function ye(e,t){let n=await M(t),r=n.find(t=>t.id===e.id)??n.find(t=>t.trigger.toLowerCase()===e.trigger.toLowerCase()&&d(t,e)),i=new Date().toISOString();if(!r)return j(e,t);let a=d(r,e),o=a?-.1:Se(e.evidenceOutcome),s=m(r.confidence+o),c=be(r.status,s,a);return j(h({...r,confidence:s,evidence:[...r.evidence,...e.evidence],evidenceOutcome:e.evidenceOutcome??r.evidenceOutcome,observationIds:[...r.observationIds??[],...e.observationIds??[]],updatedAt:i,status:c}),t)}function be(e,t,n){return n&&t<.3?`conflict-hold`:e===`conflict-hold`&&t>=.5||e===`pending`&&t>=.8?`active`:e}async function xe(e){let t=await M(e),n=Date.now(),r=0;for(let i of t){if(i.status!==`pending`&&i.status!==`active`)continue;let t=Date.parse(i.updatedAt);if(Number.isNaN(t))continue;let a=Math.floor((n-t)/F);if(a<1)continue;let o=-.02*a,s=m(i.confidence+o);s!==i.confidence&&(await j(h({...i,confidence:s,updatedAt:new Date(n).toISOString()}),e),r+=1)}return r}function Se(e){return e===`failure`?-.05:.05}async function Ce(e,t){let n=await M(t),r=Date.now()-e*24*60*60*1e3,i=[];for(let e of n)e.status===`pending`&&Date.parse(e.updatedAt)<r&&(await _e(N(e.id,t)),i.push(e));return i}function N(e,t){return T(A(t),`${e}.json`)}var P,F,I=e((()=>{y(),f(),P=Promise.resolve(),F=10080*60*1e3}));function we(e,t){if(e.length===0)throw Error(`Cannot generate a command draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=w(t?.name??De(e)),i=Ae(e),a=t?.description??Oe(e),o=Ee(r,n,t),s=ke({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 Te(e){await D(e.outputPath,{recursive:!0});let t=T(e.outputPath,`${e.name}.md`);return E(t)?t:(await k(t,e.content,`utf8`),r(),t)}function Ee(e,n,r){return r?.outputRoot?r.outputRoot:n===`project`?T(r?.cwd??process.cwd(),`.workmate`,`commands`):r?.globalCommandsDir??T(t(),`commands`)}function De(e){return w([`learned`,...je(e,4)].join(`-`))||`learned-command`}function Oe(e){return(e[0]?.trigger??`Reuse the learned workflow`).replace(/\s+/g,` `).slice(0,120)}function ke(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(`, `)}]`,`---`,``,`# /${t}`,``,`## When to use`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
2
2
|
`),``,`## Steps`,``,i.map(e=>`- ${e.action}`).join(`
|
|
3
3
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).join(`
|
|
4
4
|
`),``].join(`
|
|
@@ -6,5 +6,5 @@ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./e
|
|
|
6
6
|
`),``,`## Playbook`,``,i.map(e=>`- ${e.action}`).join(`
|
|
7
7
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,20).join(`
|
|
8
8
|
`),``].join(`
|
|
9
|
-
`)}function Re(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function ze(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`debug`,`investigate`,`research`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var R=e((()=>{n(),i(),x()}));function z(e){let t=new Map;for(let n of e){if(n.status!==`active`&&n.status!==`pending`)continue;let e=`${n.domain}:${Ue(n.trigger)}`,r=t.get(e)??[];r.push(n),t.set(e,r)}return Array.from(t.values()).filter(e=>e.length>=p().minClusterSize).map(e=>{let t=e.reduce((e,t)=>e+t.confidence,0)/e.length;return{target:Be(e),trigger:e[0]?.trigger??`learned pattern`,domain:e[0]?.domain??`project`,instincts:e,averageConfidence:Number(t.toFixed(2))}}).sort((e,t)=>t.averageConfidence-e.averageConfidence)}function Be(e){let t=Array.isArray(e)?e:e.instincts,n=t.map(e=>`${e.trigger} ${e.action}`).join(` `).toLowerCase();return/user asks|explicitly request|command|run /.test(n)?`command`:t.length>=4&&/(debug|investigate|research|multi-step)/.test(n)?`agent`:`skill`}function Ve(e,t){return z(e).filter(e=>e.target===`command`&&b(e.instincts)).map(e=>we(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function He(e,t){return z(e).filter(e=>e.target===`agent`&&b(e.instincts)).map(e=>Me(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function Ue(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,` `).split(/\s+/).filter(Boolean).slice(0,6).join(` `)}var We=e((()=>{x(),C(),L(),R(),g()}));function Ge(e){if(H.add(e),H.size>B){let e=H.size-V,t=H.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;H.delete(e.value)}}}function Ke(e,t=2,n=.8){let r=new Map;for(let t of e){if(t.scope!==`project`)continue;let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}return Array.from(r.entries()).flatMap(([e,r])=>{let i=Array.from(new Set(r.map(e=>e.projectId).filter(Boolean))),a=r.reduce((e,t)=>e+t.confidence,0)/r.length;return i.length>=t&&a>=n?[{instinctId:e,projectIds:i,averageConfidence:Number(a.toFixed(2))}]:[]})}async function qe(e={}){let t=e.minProjects??2,n=e.minConfidence??.8,r=await Je(e.rootDir),i=Ke(r,t,n),a=[];for(let t of i){if(H.has(t.instinctId))continue;let n=r.find(e=>e.id===t.instinctId);n&&(await j({...n,scope:`global`,projectId:void 0,projectName:void 0,confidence:t.averageConfidence,updatedAt:new Date().toISOString()},{rootDir:e.rootDir,scope:`global`,project:Ye(e.rootDir)}),Ge(t.instinctId),a.push(t))}return a}async function Je(e){let t=T(_(e?{rootDir:e}:void 0),`projects`);if(!E(t))return[];let n=await O(t,{withFileTypes:!0}),r=[];for(let i of n){if(!i.isDirectory())continue;let n=await M({rootDir:e,project:{projectId:i.name,projectName:i.name,scope:`project`,source:`git_root`,cwd:t,storageDir:T(t,i.name)},scope:`project`});r.push(...n)}return r}function Ye(e){let t=_(e?{rootDir:e}:void 0);return{projectId:`global`,projectName:`Global`,scope:`global`,source:`global`,cwd:t,storageDir:T(t,`global`)}}var B,V,H,Xe=e((()=>{I(),y(),B=256,V=192,H=new Set}));function U(){X=0,Z=0,Q.clear()}function Ze(){return J}function Qe(){if(!q){q=!0;try{ce()}catch{}o(W),$e().catch(()=>{})}}async function $e(){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE)return;let e={project:u(process.cwd())};await Promise.allSettled([xe(e),ie(e),Ce(30,e)])}function et(e){try{let t=_();return e.startsWith(t)}catch{return!1}}async function W(e){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE||!e.querySource?.startsWith(`repl_main_thread`)||e.toolUseContext.agentId)return;let t=process.cwd();if(et(t))return;let n=u(t),r={project:n};++J;let i=[];for(let t of rt(e.messages,n))i.push(await ae(t,r));let a=(await re(r)).filter(e=>e.source===`tool-hook`&&e.sessionId===`runtime-session`&&typeof e.timestamp==`string`&&e.timestamp>Y);i.push(...a);for(let e of a)e.timestamp>Y&&(Y=e.timestamp);if(i.length===0)return;let o=Date.now(),{llm:c}=p(),l=i.length>=5&&X<c.maxCallsPerSession&&o-Z>=c.cooldownMs,d;if(l)X++,Z=o,d=await se(i,{project:n});else{let{heuristicObserverBackend:e}=await import(`./sessionObserver-
|
|
9
|
+
`)}function Re(e){return e.reduce((e,t)=>e+t.confidence,0)/e.length}function ze(e,t){let n=new Set([`when`,`with`,`this`,`that`,`user`,`asks`,`for`,`the`,`and`,`debug`,`investigate`,`research`]),r=[];for(let i of e)for(let e of`${i.trigger} ${i.action}`.toLowerCase().split(/[^a-z0-9]+/))if(e.length>2&&!n.has(e)&&!r.includes(e)&&r.push(e),r.length>=t)return r;return r}var R=e((()=>{n(),i(),x()}));function z(e){let t=new Map;for(let n of e){if(n.status!==`active`&&n.status!==`pending`)continue;let e=`${n.domain}:${Ue(n.trigger)}`,r=t.get(e)??[];r.push(n),t.set(e,r)}return Array.from(t.values()).filter(e=>e.length>=p().minClusterSize).map(e=>{let t=e.reduce((e,t)=>e+t.confidence,0)/e.length;return{target:Be(e),trigger:e[0]?.trigger??`learned pattern`,domain:e[0]?.domain??`project`,instincts:e,averageConfidence:Number(t.toFixed(2))}}).sort((e,t)=>t.averageConfidence-e.averageConfidence)}function Be(e){let t=Array.isArray(e)?e:e.instincts,n=t.map(e=>`${e.trigger} ${e.action}`).join(` `).toLowerCase();return/user asks|explicitly request|command|run /.test(n)?`command`:t.length>=4&&/(debug|investigate|research|multi-step)/.test(n)?`agent`:`skill`}function Ve(e,t){return z(e).filter(e=>e.target===`command`&&b(e.instincts)).map(e=>we(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function He(e,t){return z(e).filter(e=>e.target===`agent`&&b(e.instincts)).map(e=>Me(e.instincts,{...t,scope:e.instincts[0]?.scope??`project`}))}function Ue(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,` `).split(/\s+/).filter(Boolean).slice(0,6).join(` `)}var We=e((()=>{x(),C(),L(),R(),g()}));function Ge(e){if(H.add(e),H.size>B){let e=H.size-V,t=H.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;H.delete(e.value)}}}function Ke(e,t=2,n=.8){let r=new Map;for(let t of e){if(t.scope!==`project`)continue;let e=r.get(t.id)??[];e.push(t),r.set(t.id,e)}return Array.from(r.entries()).flatMap(([e,r])=>{let i=Array.from(new Set(r.map(e=>e.projectId).filter(Boolean))),a=r.reduce((e,t)=>e+t.confidence,0)/r.length;return i.length>=t&&a>=n?[{instinctId:e,projectIds:i,averageConfidence:Number(a.toFixed(2))}]:[]})}async function qe(e={}){let t=e.minProjects??2,n=e.minConfidence??.8,r=await Je(e.rootDir),i=Ke(r,t,n),a=[];for(let t of i){if(H.has(t.instinctId))continue;let n=r.find(e=>e.id===t.instinctId);n&&(await j({...n,scope:`global`,projectId:void 0,projectName:void 0,confidence:t.averageConfidence,updatedAt:new Date().toISOString()},{rootDir:e.rootDir,scope:`global`,project:Ye(e.rootDir)}),Ge(t.instinctId),a.push(t))}return a}async function Je(e){let t=T(_(e?{rootDir:e}:void 0),`projects`);if(!E(t))return[];let n=await O(t,{withFileTypes:!0}),r=[];for(let i of n){if(!i.isDirectory())continue;let n=await M({rootDir:e,project:{projectId:i.name,projectName:i.name,scope:`project`,source:`git_root`,cwd:t,storageDir:T(t,i.name)},scope:`project`});r.push(...n)}return r}function Ye(e){let t=_(e?{rootDir:e}:void 0);return{projectId:`global`,projectName:`Global`,scope:`global`,source:`global`,cwd:t,storageDir:T(t,`global`)}}var B,V,H,Xe=e((()=>{I(),y(),B=256,V=192,H=new Set}));function U(){X=0,Z=0,Q.clear()}function Ze(){return J}function Qe(){if(!q){q=!0;try{ce()}catch{}o(W),$e().catch(()=>{})}}async function $e(){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE)return;let e={project:u(process.cwd())};await Promise.allSettled([xe(e),ie(e),Ce(30,e)])}function et(e){try{let t=_();return e.startsWith(t)}catch{return!1}}async function W(e){if(!s()||process.env.CLAUDE_SKILL_LEARNING_DISABLE||!e.querySource?.startsWith(`repl_main_thread`)||e.toolUseContext.agentId)return;let t=process.cwd();if(et(t))return;let n=u(t),r={project:n};++J;let i=[];for(let t of rt(e.messages,n))i.push(await ae(t,r));let a=(await re(r)).filter(e=>e.source===`tool-hook`&&e.sessionId===`runtime-session`&&typeof e.timestamp==`string`&&e.timestamp>Y);i.push(...a);for(let e of a)e.timestamp>Y&&(Y=e.timestamp);if(i.length===0)return;let o=Date.now(),{llm:c}=p(),l=i.length>=5&&X<c.maxCallsPerSession&&o-Z>=c.cooldownMs,d;if(l)X++,Z=o,d=await se(i,{project:n});else{let{heuristicObserverBackend:e}=await import(`./sessionObserver-BLJg0qm_.js`),t=e.analyze(i,{project:n});d=Array.isArray(t)?t:await t}for(let e of d)await ve(te(e),r);await nt(r)}function tt(){J=0,Y=``,U()}async function nt(e){let n=await M(e),r=process.cwd(),i=[T(r,`.workmate`,`skills`),T(t(),`skills`)],a=z(n).filter(e=>e.target===`skill`&&b(e.instincts));for(let e of a){let t=await ue(e.instincts,{cwd:r,scope:e.instincts[0]?.scope??`project`},i);if(t.action===`append-evidence`)continue;let n=t.draft;E(T(n.outputPath,`SKILL.md`))||await pe(fe(n,await S(`skill`,n,i)))}let o=Ve(n,{cwd:r});for(let e of o)(await S(`command`,e,[T(r,`.workmate`,`commands`),T(t(),`commands`)])).length>0||await Te(e);let s=He(n,{cwd:r});for(let e of s)(await S(`agent`,e,[T(r,`.workmate`,`agents`),T(t(),`agents`)])).length>0||await Ne(e);await qe()}function rt(e,t){let n=K,r={sessionId:n,projectId:t.projectId,projectName:t.projectName,cwd:t.cwd,timestamp:new Date().toISOString(),source:`hook`};return e.flatMap(e=>{let t=`${n}:${String(e.uuid)}`;if(Q.has(t))return[];if(Q.add(t),Q.size>$){let e=Q.size-ot,t=Q.values();for(let n=0;n<e;n++){let e=t.next();if(e.done)break;Q.delete(e.value)}}if(e.type===`user`){let t=at(e.message?.content);if(t.length>0)return t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_complete`,toolName:e.toolName,toolOutput:e.output,outcome:e.isError?`failure`:`success`}));let n=G(e.message?.content);return n.trim()?[{...r,id:crypto.randomUUID(),event:`user_message`,messageText:n}]:[]}if(e.type===`assistant`){let t=it(e.message?.content),n=G(e.message?.content);return[...t.map(e=>({...r,id:crypto.randomUUID(),event:`tool_start`,toolName:e.toolName,toolInput:e.input})),...n.trim()?[{...r,id:crypto.randomUUID(),event:`assistant_message`,messageText:n}]:[]]}return[]})}function G(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return``;let t=e;return typeof t.text==`string`?t.text:``}).filter(Boolean).join(`
|
|
10
10
|
`):``}function it(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_use`?[{toolName:String(t.name??`unknown_tool`),input:v(t.input)}]:[]}):[]}function at(e){return Array.isArray(e)?e.flatMap(e=>{if(!e||typeof e!=`object`)return[];let t=e;return t.type===`tool_result`?[{toolName:String(t.name??t.tool_name??`unknown_tool`),output:v(t.content),isError:t.is_error===!0}]:[]}):[]}var K,q,J,Y,X,Z,Q,$,ot,st=e((()=>{a(),g(),c(),y(),l(),le(),f(),oe(),I(),de(),We(),C(),x(),L(),R(),Xe(),n(),K=`runtime-session`,q=!1,J=0,Y=``,X=0,Z=0,Q=new Set,$=1e3,ot=500}));export{U as a,st as i,Ze as n,tt as o,Qe as r,W as s,K as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./runtimeObserver-
|
|
1
|
+
import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./runtimeObserver-CsZw5XBt.js";t();export{o as RUNTIME_SESSION_ID,n as getRuntimeTurn,i as initSkillLearning,e as resetRuntimeLLMBookkeeping,r as resetRuntimeObserverForTest,a as runSkillLearningPostSampling};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{lT as e,oT as t}from"./loadAgentsDir-C96o6gCj.js";e();export{t as SandboxManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Du as t,Ou as n,fT as r,lT as i,oT as a,sT as o,zS as s}from"./loadAgentsDir-C96o6gCj.js";import{Gt as c,H as l,I as u,Lt as d,P as f,a as p,j as m,n as h,r as g,t as _,x as v}from"./src-DL3w8VPk.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{D as b,Ut as x}from"./state-D5D6QpTX.js";import{d as S,h as C,o as w}from"./settings-BowI3jp-.js";import{i as T,o as E}from"./platform-DMQxcm4K.js";import{relative as D}from"path";function O(){let e=a.isSandboxingEnabled(),t=a.checkDependencies(),n=t.warnings.length>0?(0,k.jsx)(u,{marginTop:1,flexDirection:`column`,children:t.warnings.map((e,t)=>(0,k.jsx)(f,{dimColor:!0,children:e},t))}):null;if(!e)return(0,k.jsxs)(u,{flexDirection:`column`,paddingY:1,children:[(0,k.jsx)(f,{color:`subtle`,children:`Sandbox is not enabled`}),n]});let i=a.getFsReadConfig(),o=a.getFsWriteConfig(),s=a.getNetworkRestrictionConfig(),c=a.getAllowUnixSockets(),l=a.getExcludedCommands(),d=a.getLinuxGlobPatternWarnings();return(0,k.jsxs)(u,{flexDirection:`column`,paddingY:1,children:[(0,k.jsxs)(u,{flexDirection:`column`,children:[(0,k.jsx)(f,{bold:!0,color:`permission`,children:`Excluded Commands:`}),(0,k.jsx)(f,{dimColor:!0,children:l.length>0?l.join(`, `):`None`})]}),i.denyOnly.length>0&&(0,k.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(f,{bold:!0,color:`permission`,children:`Filesystem Read Restrictions:`}),(0,k.jsxs)(f,{dimColor:!0,children:[`Denied: `,i.denyOnly.join(`, `)]}),i.allowWithinDeny&&i.allowWithinDeny.length>0&&(0,k.jsxs)(f,{dimColor:!0,children:[`Allowed within denied: `,i.allowWithinDeny.join(`, `)]})]}),o.allowOnly.length>0&&(0,k.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(f,{bold:!0,color:`permission`,children:`Filesystem Write Restrictions:`}),(0,k.jsxs)(f,{dimColor:!0,children:[`Allowed: `,o.allowOnly.join(`, `)]}),o.denyWithinAllow.length>0&&(0,k.jsxs)(f,{dimColor:!0,children:[`Denied within allowed: `,o.denyWithinAllow.join(`, `)]})]}),(s.allowedHosts&&s.allowedHosts.length>0||s.deniedHosts&&s.deniedHosts.length>0)&&(0,k.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,k.jsxs)(f,{bold:!0,color:`permission`,children:[`Network Restrictions`,r()?` (Managed)`:``,`:`]}),s.allowedHosts&&s.allowedHosts.length>0&&(0,k.jsxs)(f,{dimColor:!0,children:[`Allowed: `,s.allowedHosts.join(`, `)]}),s.deniedHosts&&s.deniedHosts.length>0&&(0,k.jsxs)(f,{dimColor:!0,children:[`Denied: `,s.deniedHosts.join(`, `)]})]}),c&&c.length>0&&(0,k.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(f,{bold:!0,color:`permission`,children:`Allowed Unix Sockets:`}),(0,k.jsx)(f,{dimColor:!0,children:c.join(`, `)})]}),d.length>0&&(0,k.jsxs)(u,{marginTop:1,flexDirection:`column`,children:[(0,k.jsx)(f,{bold:!0,color:`warning`,children:`⚠ Warning: Glob patterns not fully supported on Linux`}),(0,k.jsxs)(f,{dimColor:!0,children:[`The following patterns will be ignored: `,d.slice(0,3).join(`, `),d.length>3&&` (${d.length-3} more)`]})]}),n]})}var k,A=e((()=>{_(),i(),k=y()}));function j({depCheck:e}){let t=T()===`macos`,n=e.errors.some(e=>e.includes(`ripgrep`)),r=e.errors.some(e=>e.includes(`bwrap`)),i=e.errors.some(e=>e.includes(`socat`)),a=e.warnings.length>0,o=e.errors.filter(e=>!e.includes(`ripgrep`)&&!e.includes(`bwrap`)&&!e.includes(`socat`));return(0,M.jsxs)(u,{flexDirection:`column`,paddingY:1,gap:1,children:[t&&(0,M.jsx)(u,{flexDirection:`column`,children:(0,M.jsxs)(f,{children:[`seatbelt: `,(0,M.jsx)(f,{color:`success`,children:`built-in (macOS)`})]})}),(0,M.jsxs)(u,{flexDirection:`column`,children:[(0,M.jsxs)(f,{children:[`ripgrep (rg): `,n?(0,M.jsx)(f,{color:`error`,children:`not found`}):(0,M.jsx)(f,{color:`success`,children:`found`})]}),n&&(0,M.jsxs)(f,{dimColor:!0,children:[` `,`· `,t?`brew install ripgrep`:`apt install ripgrep`]})]}),!t&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(u,{flexDirection:`column`,children:[(0,M.jsxs)(f,{children:[`bubblewrap (bwrap):`,` `,r?(0,M.jsx)(f,{color:`error`,children:`not installed`}):(0,M.jsx)(f,{color:`success`,children:`installed`})]}),r&&(0,M.jsxs)(f,{dimColor:!0,children:[` `,`· apt install bubblewrap`]})]}),(0,M.jsxs)(u,{flexDirection:`column`,children:[(0,M.jsxs)(f,{children:[`socat: `,i?(0,M.jsx)(f,{color:`error`,children:`not installed`}):(0,M.jsx)(f,{color:`success`,children:`installed`})]}),i&&(0,M.jsxs)(f,{dimColor:!0,children:[` `,`· apt install socat`]})]}),(0,M.jsxs)(u,{flexDirection:`column`,children:[(0,M.jsxs)(f,{children:[`seccomp filter:`,` `,a?(0,M.jsx)(f,{color:`warning`,children:`not installed`}):(0,M.jsx)(f,{color:`success`,children:`installed`}),a&&(0,M.jsx)(f,{dimColor:!0,children:` (required to block unix domain sockets)`})]}),a&&(0,M.jsxs)(u,{flexDirection:`column`,children:[(0,M.jsxs)(f,{dimColor:!0,children:[` `,`· npm install -g @anthropic-ai/sandbox-runtime`]}),(0,M.jsxs)(f,{dimColor:!0,children:[` `,`· or copy vendor/seccomp/* from sandbox-runtime and set`]}),(0,M.jsxs)(f,{dimColor:!0,children:[` `,`sandbox.seccomp.bpfPath and applyPath in settings.json`]})]})]})]}),o.map(e=>(0,M.jsx)(f,{color:`error`,children:e},e))]})}var M,N=e((()=>{_(),E(),M=y()}));function P({onComplete:e}){let t=a.isSandboxingEnabled(),n=a.areSandboxSettingsLockedByPolicy(),r=a.areUnsandboxedCommandsAllowed();return t?n?(0,I.jsxs)(u,{flexDirection:`column`,paddingY:1,children:[(0,I.jsx)(f,{color:`subtle`,children:`Override settings are managed by a higher-priority configuration and cannot be changed locally.`}),(0,I.jsx)(u,{marginTop:1,children:(0,I.jsxs)(f,{dimColor:!0,children:[`Current setting: `,r?`Allow unsandboxed fallback`:`Strict sandbox mode`]})})]}):(0,I.jsx)(F,{onComplete:e,currentMode:r?`open`:`closed`}):(0,I.jsx)(u,{flexDirection:`column`,paddingY:1,children:(0,I.jsx)(f,{color:`subtle`,children:`Sandbox is not enabled. Enable sandbox to configure override settings.`})})}function F({onComplete:e,currentMode:n}){let[r]=l(),{headerFocused:i,focusHeader:o}=p(),s=m(`success`,r)(`(current)`),c=[{label:n===`open`?`Allow unsandboxed fallback ${s}`:`Allow unsandboxed fallback`,value:`open`},{label:n===`closed`?`Strict sandbox mode ${s}`:`Strict sandbox mode`,value:`closed`}];async function h(t){let n=t;await a.setSandboxSettings({allowUnsandboxedCommands:n===`open`}),e(n===`open`?`✓ Unsandboxed fallback allowed - commands can run outside sandbox when necessary`:"✓ Strict sandbox mode - all commands must run in sandbox or be excluded via the `excludedCommands` option")}return(0,I.jsxs)(u,{flexDirection:`column`,paddingY:1,children:[(0,I.jsx)(u,{marginBottom:1,children:(0,I.jsx)(f,{bold:!0,children:`Configure Overrides:`})}),(0,I.jsx)(t,{options:c,onChange:h,onCancel:()=>e(void 0,{display:`skip`}),onUpFromFirstItem:o,isDisabled:i}),(0,I.jsxs)(u,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,I.jsxs)(f,{dimColor:!0,children:[(0,I.jsx)(f,{bold:!0,dimColor:!0,children:`Allow unsandboxed fallback:`}),` `,`When a command fails due to sandbox restrictions, Work Mate can retry with dangerouslyDisableSandbox to run outside the sandbox (falling back to default permissions).`]}),(0,I.jsxs)(f,{dimColor:!0,children:[(0,I.jsx)(f,{bold:!0,dimColor:!0,children:`Strict sandbox mode:`}),` `,`All bash commands invoked by the model must run in the sandbox unless they are explicitly listed in excludedCommands.`]}),(0,I.jsxs)(f,{dimColor:!0,children:[`Learn more:`,` `,(0,I.jsx)(d,{url:`https://code.workmate.com/docs/en/sandboxing#configure-sandboxing`,children:`code.workmate.com/docs/en/sandboxing#configure-sandboxing`})]})]})]})}var I,L=e((()=>{_(),i(),n(),I=y()}));function R({onComplete:e,depCheck:t}){let[n]=l(),r=a.isSandboxingEnabled(),i=a.isAutoAllowBashIfSandboxedEnabled(),o=t.warnings.length>0,s=S().sandbox?.network?.allowAllUnixSockets,u=o&&!s,d=r?i?`auto-allow`:`regular`:`disabled`,f=m(`success`,n)(`(current)`),p=[{label:d===`auto-allow`?`Sandbox BashTool, with auto-allow ${f}`:`Sandbox BashTool, with auto-allow`,value:`auto-allow`},{label:d===`regular`?`Sandbox BashTool, with regular permissions ${f}`:`Sandbox BashTool, with regular permissions`,value:`regular`},{label:d===`disabled`?`No Sandbox ${f}`:`No Sandbox`,value:`disabled`}];async function _(t){switch(t){case`auto-allow`:await a.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!0}),e(`✓ Sandbox enabled with auto-allow for bash commands`);break;case`regular`:await a.setSandboxSettings({enabled:!0,autoAllowBashIfSandboxed:!1}),e(`✓ Sandbox enabled with regular bash permissions`);break;case`disabled`:await a.setSandboxSettings({enabled:!1,autoAllowBashIfSandboxed:!1}),e(`○ Sandbox disabled`);break}}c({"confirm:no":()=>e(void 0,{display:`skip`})},{context:`Settings`});let y=(0,B.jsx)(h,{title:`Mode`,children:(0,B.jsx)(z,{showSocketWarning:u,options:p,onSelect:_,onComplete:e})},`mode`),b=(0,B.jsx)(h,{title:`Overrides`,children:(0,B.jsx)(P,{onComplete:e})},`overrides`),x=(0,B.jsx)(h,{title:`Config`,children:(0,B.jsx)(O,{})},`config`);return(0,B.jsx)(v,{color:`permission`,children:(0,B.jsx)(g,{title:`Sandbox:`,color:`permission`,defaultTab:`Mode`,children:t.errors.length>0?[(0,B.jsx)(h,{title:`Dependencies`,children:(0,B.jsx)(j,{depCheck:t})},`dependencies`)]:[y,...o?[(0,B.jsx)(h,{title:`Dependencies`,children:(0,B.jsx)(j,{depCheck:t})},`dependencies`)]:[],b,x]})})}function z({showSocketWarning:e,options:n,onSelect:r,onComplete:i}){let{headerFocused:a,focusHeader:o}=p();return(0,B.jsxs)(u,{flexDirection:`column`,paddingY:1,children:[e&&(0,B.jsx)(u,{marginBottom:1,children:(0,B.jsx)(f,{color:`warning`,children:`Cannot block unix domain sockets (see Dependencies tab)`})}),(0,B.jsx)(u,{marginBottom:1,children:(0,B.jsx)(f,{bold:!0,children:`Configure Mode:`})}),(0,B.jsx)(t,{options:n,onChange:r,onCancel:()=>i(void 0,{display:`skip`}),onUpFromFirstItem:o,isDisabled:a}),(0,B.jsxs)(u,{flexDirection:`column`,marginTop:1,gap:1,children:[(0,B.jsxs)(f,{dimColor:!0,children:[(0,B.jsx)(f,{bold:!0,dimColor:!0,children:`Auto-allow mode:`}),` `,`Commands will try to run in the sandbox automatically, and attempts to run outside of the sandbox fallback to regular permissions. Explicit ask/deny rules are always respected.`]}),(0,B.jsxs)(f,{dimColor:!0,children:[`Learn more:`,` `,(0,B.jsx)(d,{url:`https://code.workmate.com/docs/en/sandboxing`,children:`code.workmate.com/docs/en/sandboxing`})]})]})]})}var B,V=e((()=>{_(),s(),i(),C(),n(),A(),N(),L(),B=y()}));async function H(e,t,n){let r=S().theme||`light`,i=T();if(!a.isSupportedPlatform()){let t=i===`wsl`?`Error: Sandboxing requires WSL2. WSL1 is not supported.`:`Error: Sandboxing is currently only supported on macOS, Linux, and WSL2.`;return e(m(`error`,r)(t)),null}let s=a.checkDependencies();if(!a.isPlatformInEnabledList())return e(m(`error`,r)(`Error: Sandboxing is disabled for this platform (${i}) via the enabledPlatforms setting.`)),null;if(a.areSandboxSettingsLockedByPolicy())return e(m(`error`,r)(`Error: Sandbox settings are overridden by a higher-priority configuration and cannot be changed locally.`)),null;let c=n?.trim()||``;if(!c)return(0,U.jsx)(R,{onComplete:e,depCheck:s});if(c){let t=c.split(` `)[0];if(t===`exclude`){let t=c.slice(8).trim();if(!t)return e(m(`error`,r)(`Error: Please provide a command pattern to exclude (e.g., /sandbox exclude "npm run test:*")`)),null;let n=t.replace(/^["']|["']$/g,``);o(n);let i=w(`localSettings`),a=i?D(b(),i):`.workmate/settings.local.json`;return e(m(`success`,r)(`Added "${n}" to excluded commands in ${a}`)),null}else return e(m(`error`,r)(`Error: Unknown subcommand "${t}". Available subcommand: exclude`)),null}return null}var U;e((()=>{x(),V(),_(),E(),i(),C(),U=y()}))();export{H as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(e){let t=e,n=``,r=0;for(;t!==n&&r<10;)n=t,t=t.normalize(`NFKC`),t=t.replace(/[\p{Cf}\p{Co}\p{Cn}]/gu,``),t=t.replace(/[\u200B-\u200F]/g,``).replace(/[\u202A-\u202E]/g,``).replace(/[\u2066-\u2069]/g,``).replace(/[\uFEFF]/g,``).replace(/[\uE000-\uF8FF]/g,``),r++;if(r>=10)throw Error(`Unicode sanitization reached maximum iterations (10) for input: ${e.slice(0,100)}`);return t}function n(e){if(typeof e==`string`)return t(e);if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={};for(let[r,i]of Object.entries(e))t[n(r)]=n(i);return t}return e}var r=e((()=>{}));export{t as n,n as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c_ as e,u_ as t}from"./loadAgentsDir-C96o6gCj.js";e();export{t as isSearchExtraToolsEnabled};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Eh as n,Th as r,zS as i}from"./loadAgentsDir-C96o6gCj.js";import{I as a,P as o,Wt as s,ai as c,t as l,x as u}from"./src-DL3w8VPk.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{c as f,i as p}from"./debug-D58GQBDG.js";import{t as m}from"./lib-BlVGipXx.js";function h({onDone:e}){let t=n(e=>e.remoteSessionUrl),[r,i]=(0,_.useState)(``);if((0,_.useEffect)(()=>{if(!t)return;let e=t;async function n(){let t=await(0,g.toString)(e,{type:`utf8`,errorCorrectionLevel:`L`});i(t)}n().catch(e=>{f(`QR code generation failed`,e)})},[t]),s(`confirm:no`,e,{context:`Confirmation`}),!t)return(0,v.jsxs)(u,{children:[(0,v.jsx)(o,{color:`warning`,children:"Not in remote mode. Start with `claude --remote` to use this command."}),(0,v.jsx)(o,{dimColor:!0,children:`(press esc to close)`})]});let c=r.split(`
|
|
2
|
+
`).filter(e=>e.length>0),l=c.length===0;return(0,v.jsxs)(u,{children:[(0,v.jsx)(a,{marginBottom:1,children:(0,v.jsx)(o,{bold:!0,children:`Remote session`})}),l?(0,v.jsx)(o,{dimColor:!0,children:`Generating QR code…`}):c.map((e,t)=>(0,v.jsx)(o,{children:e},t)),(0,v.jsxs)(a,{marginTop:1,children:[(0,v.jsx)(o,{dimColor:!0,children:`Open in browser: `}),(0,v.jsx)(o,{color:`ide`,children:t})]}),(0,v.jsx)(a,{marginTop:1,children:(0,v.jsx)(o,{dimColor:!0,children:`(press esc to close)`})})]})}var g,_,v,y;e((()=>{g=m(),_=t(c(),1),l(),i(),r(),p(),v=d(),y=async e=>(0,v.jsx)(h,{onDone:e})}))();export{y as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Mm as e,jm as t}from"./loadAgentsDir-C96o6gCj.js";t();export{e as registerSessionFileAccessHooks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./sessionObserver-N7fORFdL.js";t();export{e as heuristicObserverBackend};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{X as t,
|
|
2
|
-
`)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function C(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(w(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(w(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(w(e.toolOutput,120))}`),n.join(` | `)}function w(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function T(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 E(e,t,n){let r=D(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=O(e,t,a);n&&o.push(n)}return o}function D(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function O(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=k(r.trigger,80),a=k(r.action,120);if(!i||!a)return;let o=N(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:A(r.confidence),domain:j(r.domain),source:`session-observation`,scope:M(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function k(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function A(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function j(e){return typeof e==`string`&&v.includes(e)?e:`project`}function M(e){return e===`global`?`global`:`project`}function N(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 P(e){return AbortSignal.timeout(e)}var F,I,L,R,z,B=e((()=>{t(),
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{X as t,Yv as n,Z as r}from"./loadAgentsDir-C96o6gCj.js";import{Q as i}from"./sessionState-8jutEorw.js";import{i as a,l as o,t as s,u as c}from"./instinctParser-Dt-lqnDe.js";function l(e){h.set(e.name,e),g||(g=e.name)}function u(e){if(!h.has(e))throw Error(`Observer backend "${e}" is not registered`);g=e}function d(){let e=g?h.get(g):void 0;if(!e)throw Error(`No observer backend is active — register one before analyzing observations`);return e}async function f(e,t){return Promise.resolve(d().analyze(e,t))}function p(){let e=process.env.SKILL_LEARNING_OBSERVER_BACKEND?.trim();return e&&h.has(e)?e:void 0}function m(){let e=p();return e&&u(e),d()}var h,g,_=e((()=>{h=new Map})),v,y=e((()=>{v=[`workflow`,`testing`,`debugging`,`code-style`,`security`,`git`,`project`]}));async function b(e,t){if(e.length===0)return[];if(Date.now()<L)return x(e,t);let n=e.slice(-30),a=S(n),s=P(o().llm.timeoutMs),c;try{let e=await r({systemPrompt:i([R]),userPrompt:a,signal:s,options:{querySource:`skill_learning_observer`,enablePromptCaching:!0,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[]}});I=0,c=T(e.message?.content)}catch{return I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),x(e,t)}let l=E(c,t,n);return l.length===0?(I++,I>=o().llm.failureThreshold&&(L=Date.now()+o().llm.circuitCooldownMs),x(e,t)):l}async function x(e,t){try{let{heuristicObserverBackend:n}=await import(`./sessionObserver-BLJg0qm_.js`),r=n.analyze(e,t);return Array.isArray(r)?r:await r}catch{return[]}}function S(e){return`Observations (chronological, newest last):\n${e.map((e,t)=>C(e,t)).join(`
|
|
2
|
+
`)}\n\nExtract up to ${F} atomic instincts. JSON array only.`}function C(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(w(e.messageText,200))}`),e.toolInput&&n.push(`in=${JSON.stringify(w(e.toolInput,120))}`),e.toolOutput&&n.push(`out=${JSON.stringify(w(e.toolOutput,120))}`),n.join(` | `)}function w(e,t){return e.length<=t?e:`${e.slice(0,t)}…`}function T(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 E(e,t,n){let r=D(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=O(e,t,a);n&&o.push(n)}return o}function D(e){if(!e)return;let t=e.indexOf(`[`),n=e.lastIndexOf(`]`);if(!(t<0||n<=t))return e.slice(t,n+1)}function O(e,t,n){if(!e||typeof e!=`object`)return;let r=e,i=k(r.trigger,80),a=k(r.action,120);if(!i||!a)return;let o=N(r.evidence);if(o.length!==0)return{trigger:i,action:a,confidence:A(r.confidence),domain:j(r.domain),source:`session-observation`,scope:M(r.scope),projectId:t?.project?.projectId,projectName:t?.project?.projectName,evidence:o,observationIds:n}}function k(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n)return n.length>t?n.slice(0,t):n}function A(e){return typeof e!=`number`||!Number.isFinite(e)?.5:e<0?0:e>1?1:e}function j(e){return typeof e==`string`&&v.includes(e)?e:`project`}function M(e){return e===`global`?`global`:`project`}function N(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 P(e){return AbortSignal.timeout(e)}var F,I,L,R,z,B=e((()=>{t(),n(),c(),y(),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
3
|
|
|
4
4
|
Respond with ONLY a JSON array (no prose, no code fences, no commentary). Each item must match this schema:
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{t as i}from"./semver-DQo45qGo.js";import{R as a,Ut as o,Yn as s,ft as c,pt as l}from"./state-D5D6QpTX.js";import{P as u,R as d,c as f,f as p,i as m,nt as h,tt as g,u as _}from"./debug-D58GQBDG.js";import{O as ee,k as v}from"./git-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{t as i}from"./semver-DQo45qGo.js";import{R as a,Ut as o,Yn as s,ft as c,pt as l}from"./state-D5D6QpTX.js";import{P as u,R as d,c as f,f as p,i as m,nt as h,tt as g,u as _}from"./debug-D58GQBDG.js";import{O as ee,k as v}from"./git-Wid-XppW.js";import{br as te,vr as y,xr as ne,yr as re}from"./model-BaMclMXn.js";import{randomUUID as b}from"crypto";function x(){return S||(S=i()),S}function ie(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===1:x().gt(e,t,{loose:!0})}function ae(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)>=0:x().gte(e,t,{loose:!0})}function oe(e,t){return typeof Bun<`u`?Bun.semver.order(e,t)===-1:x().lt(e,t,{loose:!0})}function se(e,t){return typeof Bun<`u`?Bun.semver.satisfies(e,t):x().satisfies(e,t,{loose:!0})}var S,ce=e((()=>{})),le=t({activateProactive:()=>ue,deactivateProactive:()=>de,getActivationSource:()=>ye,getNextTickAt:()=>ve,isContextBlocked:()=>ge,isProactiveActive:()=>w,isProactivePaused:()=>fe,pauseProactive:()=>pe,resumeProactive:()=>me,setContextBlocked:()=>he,setNextTickAt:()=>_e,shouldTick:()=>xe,subscribeToProactiveChanges:()=>be});function C(){for(let e of k)try{e()}catch{}}function w(){return T}function ue(e){T||(T=!0,E=!1,D=!1,Se=e,C())}function de(){T&&(T=!1,E=!1,D=!1,O=null,Se=void 0,C())}function fe(){return E}function pe(){!T||E||(E=!0,O=null,C())}function me(){!T||!E||(E=!1,C())}function he(e){D!==e&&(D=e,e&&(O=null),C())}function ge(){return D}function _e(e){O=e,C()}function ve(){return!T||E||D?null:O}function ye(){return Se}function be(e){return k.add(e),()=>{k.delete(e)}}function xe(){return T&&!E&&!D}var T,E,D,O,Se,k,Ce=e((()=>{T=!1,E=!1,D=!1,O=null,k=new Set})),we=e((()=>{})),Te,Ee=e((()=>{Te={input_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:0,output_tokens:0,server_tool_use:{web_search_requests:0,web_fetch_requests:0},service_tier:`standard`,cache_creation:{ephemeral_1h_input_tokens:0,ephemeral_5m_input_tokens:0},inference_geo:``,iterations:[],speed:`standard`}})),De=e((()=>{}));function Oe(e){return e}var ke=e((()=>{})),Ae=e((()=>{we(),Ee(),De(),ke()}));function je(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Me(e){if(process.env.OPENAI_MODEL)return process.env.OPENAI_MODEL;let t=e.replace(/\[1m\]$/,``),n=je(t);if(n){let e=`OPENAI_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return Ne[t]??t}var Ne,Pe=e((()=>{Ne={"claude-sonnet-4-20250514":`gpt-4o`,"claude-sonnet-4-5-20250929":`gpt-4o`,"claude-sonnet-4-6":`gpt-4o`,"claude-opus-4-20250514":`o3`,"claude-opus-4-1-20250805":`o3`,"claude-opus-4-5-20251101":`o3`,"claude-opus-4-6":`o3`,"claude-haiku-4-5-20251001":`gpt-4o-mini`,"claude-3-5-haiku-20241022":`gpt-4o-mini`,"claude-3-7-sonnet-20250219":`gpt-4o`,"claude-3-5-sonnet-20241022":`gpt-4o`}}));function Fe(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function Ie(){let e=process.env.GROK_MODEL_MAP;if(!e)return null;try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t))return t}catch{}return null}function Le(e){if(process.env.GROK_MODEL)return process.env.GROK_MODEL;let t=e.replace(/\[1m\]$/,``),n=Fe(t),r=Ie();if(r&&n&&r[n])return r[n];if(n){let e=`GROK_DEFAULT_${n.toUpperCase()}_MODEL`,t=process.env[e];if(t)return t;let r=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i}return Re[t]?Re[t]:n&&ze[n]?ze[n]:t}var Re,ze,Be=e((()=>{Re={"claude-sonnet-4-20250514":`grok-3-mini-fast`,"claude-sonnet-4-5-20250929":`grok-3-mini-fast`,"claude-sonnet-4-6":`grok-3-mini-fast`,"claude-opus-4-20250514":`grok-4.20-reasoning`,"claude-opus-4-1-20250805":`grok-4.20-reasoning`,"claude-opus-4-5-20251101":`grok-4.20-reasoning`,"claude-opus-4-6":`grok-4.20-reasoning`,"claude-haiku-4-5-20251001":`grok-3-mini-fast`,"claude-3-5-haiku-20241022":`grok-3-mini-fast`,"claude-3-7-sonnet-20250219":`grok-3-mini-fast`,"claude-3-5-sonnet-20241022":`grok-3-mini-fast`},ze={opus:`grok-4.20-reasoning`,sonnet:`grok-3-mini-fast`,haiku:`grok-3-mini-fast`}}));function Ve(e){return/haiku/i.test(e)?`haiku`:/opus/i.test(e)?`opus`:/sonnet/i.test(e)?`sonnet`:null}function He(e){if(process.env.GEMINI_MODEL)return process.env.GEMINI_MODEL;let t=e.replace(/\[1m\]$/i,``),n=Ve(t);if(!n)return t;let r=`GEMINI_DEFAULT_${n.toUpperCase()}_MODEL`,i=process.env[r];if(i)return i;let a=`ANTHROPIC_DEFAULT_${n.toUpperCase()}_MODEL`,o=process.env[a];if(o)return o;throw Error(`Gemini provider requires GEMINI_MODEL or ${r} (or ${a} for backward compatibility) to be configured.`)}var Ue=e((()=>{})),We,A=e((()=>{We=`_geminiThoughtSignature`}));function j(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function Ge(e,t){let n=[],r=new Map;for(let t of e){if(t.type===`assistant`){let e=Ye(t);e.parts.length>0&&n.push(e);let i=t.message.content;if(Array.isArray(i))for(let e of i)typeof e!=`string`&&e.type===`tool_use`&&r.set(e.id,e.name);continue}if(t.type===`user`){let e=qe(t,r);e.parts.length>0&&n.push(e)}}let i=Ke(t);return{contents:n,...i?{systemInstruction:{parts:[{text:i}]}}:{}}}function Ke(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
2
2
|
|
|
3
3
|
`)}function qe(e,t){let n=e.message.content;return typeof n==`string`?{role:`user`,parts:M(n)}:Array.isArray(n)?{role:`user`,parts:n.flatMap(e=>Je(e,t))}:{role:`user`,parts:[]}}function Je(e,t){if(typeof e==`string`)return M(e);if(e.type===`text`)return M(e.text);if(e.type===`tool_result`){let n=e;return[{functionResponse:{name:t.get(n.tool_use_id)??n.tool_use_id,response:Qe(n)}}]}if(e.type===`image`){let t=e.source;if(t?.type===`base64`&&typeof t.data==`string`)return[{inlineData:{mimeType:t.media_type||`image/png`,data:t.data}}];if(t?.type===`url`&&typeof t.url==`string`)return M(`[image: ${t.url}]`)}return[]}function Ye(e){let t=e.message.content;if(typeof t==`string`)return{role:`model`,parts:M(t)};if(!Array.isArray(t))return{role:`model`,parts:[]};let n=[];for(let e of t){if(typeof e==`string`){n.push(...M(e));continue}if(e.type===`text`){n.push(...M(e.text,N(e)));continue}if(e.type===`thinking`){let t=Xe(e.thinking,e.signature);t&&n.push(t);continue}if(e.type===`tool_use`){let t=e;n.push({functionCall:{name:t.name,args:Ze(t.input)},...N(e)&&{thoughtSignature:N(e)}})}}return{role:`model`,parts:n}}function M(e,t){return typeof e!=`string`||e.length===0?[]:[{text:e,...t&&{thoughtSignature:t}}]}function Xe(e,t){if(!(typeof e!=`string`||e.length===0))return{text:e,thought:!0,...t&&{thoughtSignature:t}}}function Ze(e){if(typeof e==`string`){let t=j(e);return t&&typeof t==`object`&&!Array.isArray(t)?t:t===null?{}:{value:t}}return e&&typeof e==`object`&&!Array.isArray(e)?e:e===void 0?{}:{value:e}}function Qe(e){let t=$e(e.content);return t&&typeof t==`object`&&!Array.isArray(t)?e.is_error?{...t,is_error:!0}:t:{result:t,...e.is_error?{is_error:!0}:{}}}function $e(e){if(typeof e==`string`)return j(e)??e;if(Array.isArray(e)){let t=e.map(e=>typeof e==`string`?e:e&&typeof e==`object`&&`text`in e&&typeof e.text==`string`?e.text:``).filter(Boolean).join(`
|
|
4
4
|
`);return j(t)??t}return e??``}function N(e){let t=e[We];return typeof t==`string`&&t.length>0?t:void 0}var et=e((()=>{A()}));function tt(e){if(typeof e==`string`)return F.has(e)?e:void 0;if(Array.isArray(e)){let t=e.filter(e=>typeof e==`string`&&F.has(e)),n=Array.from(new Set(t));return n.length===0?void 0:n.length===1?n[0]:n}}function nt(e){if(e===null)return`null`;if(Array.isArray(e))return`array`;if(typeof e==`string`)return`string`;if(typeof e==`boolean`)return`boolean`;if(typeof e==`number`)return Number.isInteger(e)?`integer`:`number`;if(typeof e==`object`)return`object`}function rt(e){let t=e.map(nt).filter(e=>e!==void 0),n=Array.from(new Set(t));if(n.length!==0)return n.length===1?n[0]:n}function it(e){return e===void 0?[`null`]:Array.isArray(e)?e.includes(`null`)?e:[...e,`null`]:e===`null`?e:[e,`null`]}function at(e){if(!e||typeof e!=`object`||Array.isArray(e))return;let t=Object.entries(e).map(([e,t])=>[e,P(t)]).filter(([,e])=>Object.keys(e).length>0);if(t.length!==0)return Object.fromEntries(t)}function ot(e){if(!Array.isArray(e))return;let t=e.map(e=>P(e)).filter(e=>Object.keys(e).length>0);return t.length>0?t:void 0}function P(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=e,n={},r=tt(t.type);t.const===void 0?Array.isArray(t.enum)&&t.enum.length>0&&(n.enum=t.enum,r=r??rt(t.enum)):(n.enum=[t.const],r=r??nt(t.const)),r||(t.properties&&typeof t.properties==`object`?r=`object`:(t.items!==void 0||t.prefixItems!==void 0)&&(r=`array`)),t.nullable===!0&&(r=it(r)),r&&(n.type=r),typeof t.title==`string`&&(n.title=t.title),typeof t.description==`string`&&(n.description=t.description),typeof t.format==`string`&&(n.format=t.format),typeof t.pattern==`string`&&(n.pattern=t.pattern),typeof t.minimum==`number`?n.minimum=t.minimum:typeof t.exclusiveMinimum==`number`&&(n.minimum=t.exclusiveMinimum),typeof t.maximum==`number`?n.maximum=t.maximum:typeof t.exclusiveMaximum==`number`&&(n.maximum=t.exclusiveMaximum),typeof t.minItems==`number`&&(n.minItems=t.minItems),typeof t.maxItems==`number`&&(n.maxItems=t.maxItems),typeof t.minLength==`number`&&(n.minLength=t.minLength),typeof t.maxLength==`number`&&(n.maxLength=t.maxLength),typeof t.minProperties==`number`&&(n.minProperties=t.minProperties),typeof t.maxProperties==`number`&&(n.maxProperties=t.maxProperties);let i=at(t.properties);if(i&&(n.properties=i,n.propertyOrdering=Object.keys(i)),Array.isArray(t.required)){let e=t.required.filter(e=>typeof e==`string`);e.length>0&&(n.required=e)}if(typeof t.additionalProperties==`boolean`)n.additionalProperties=t.additionalProperties;else{let e=P(t.additionalProperties);Object.keys(e).length>0&&(n.additionalProperties=e)}let a=P(t.items);Object.keys(a).length>0&&(n.items=a);let o=ot(t.prefixItems);o&&(n.prefixItems=o);let s=ot(t.anyOf??t.oneOf);return s&&(n.anyOf=s),n}function st(e){let t=P(e);return Object.keys(t).length>0?t:{type:`object`,properties:{}}}function ct(e){let t=e.filter(e=>{let t=e.type;return e.type===`custom`||!(`type`in e)||t!==`server`}).map(e=>{let t=e;return{name:t.name||``,description:t.description||``,parametersJsonSchema:st(t.input_schema??{type:`object`,properties:{}})}});return t.length>0?[{functionDeclarations:t}]:[]}function lt(e){if(!e||typeof e!=`object`)return;let t=e;switch(t.type){case`auto`:return{mode:`AUTO`};case`any`:return{mode:`ANY`};case`tool`:return{mode:`ANY`,allowedFunctionNames:typeof t.name==`string`?[t.name]:void 0};default:return}}var F,ut=e((()=>{F=new Set([`string`,`number`,`integer`,`boolean`,`object`,`array`,`null`])}));async function*dt(e,t){let n=`msg_${b().replace(/-/g,``).slice(0,24)}`,r=!1,i=!1,a=0,o=null,s=!1,c,l=0,u=0,d=0;for await(let i of e){let e=i.usageMetadata;e&&(l=e.promptTokenCount??l,u=(e.candidatesTokenCount??0)+(e.thoughtsTokenCount??0),d=e.cachedContentTokenCount??d),r||(r=!0,yield{type:`message_start`,message:{id:n,type:`message`,role:`assistant`,content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:l,output_tokens:0,cache_creation_input_tokens:0,cache_read_input_tokens:d}}});let f=i.candidates?.[0],p=f?.content?.parts??[];for(let e of p){if(e.functionCall){o&&(yield{type:`content_block_stop`,index:o.index},o=null),s=!0;let t=a++;yield{type:`content_block_start`,index:t,content_block:{type:`tool_use`,id:`toolu_${b().replace(/-/g,``).slice(0,24)}`,name:e.functionCall.name||``,input:{}}},e.thoughtSignature&&(yield{type:`content_block_delta`,index:t,delta:{type:`signature_delta`,signature:e.thoughtSignature}}),e.functionCall.args&&Object.keys(e.functionCall.args).length>0&&(yield{type:`content_block_delta`,index:t,delta:{type:`input_json_delta`,partial_json:JSON.stringify(e.functionCall.args)}}),yield{type:`content_block_stop`,index:t};continue}let t=ft(e);if(t){(!o||o.type!==t)&&(o&&(yield{type:`content_block_stop`,index:o.index}),o={index:a++,type:t},yield{type:`content_block_start`,index:o.index,content_block:t===`thinking`?{type:`thinking`,thinking:``,signature:``}:{type:`text`,text:``}}),e.text&&(yield{type:`content_block_delta`,index:o.index,delta:t===`thinking`?{type:`thinking_delta`,thinking:e.text}:{type:`text_delta`,text:e.text}}),e.thoughtSignature&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}});continue}e.thoughtSignature&&o&&(yield{type:`content_block_delta`,index:o.index,delta:{type:`signature_delta`,signature:e.thoughtSignature}})}f?.finishReason&&(c=f.finishReason)}r&&(o&&(yield{type:`content_block_stop`,index:o.index}),i||(yield{type:`message_delta`,delta:{stop_reason:pt(c,s),stop_sequence:null},usage:{input_tokens:l,output_tokens:u,cache_creation_input_tokens:0,cache_read_input_tokens:d}},yield{type:`message_stop`},i=!0))}function ft(e){return typeof e.text==`string`?e.thought?`thinking`:`text`:null}function pt(e,t){switch(e){case`MAX_TOKENS`:return`max_tokens`;default:return t?`tool_use`:`end_turn`}}var mt=e((()=>{}));function I(e){if(!e||typeof e!=`object`)return null;let t=e,n=0;for(;t&&n<5;){if(t instanceof Error&&`code`in t&&typeof t.code==`string`){let e=t.code,n=bt.has(e);return{code:e,message:t.message,isSSLError:n}}if(t instanceof Error&&`cause`in t&&t.cause!==t)t=t.cause,n++;else break}return null}function ht(e){let t=I(e);return t?.isSSLError?`SSL certificate error (${t.code}). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run /doctor for details.`:null}function L(e){if(e.includes(`<!DOCTYPE html`)||e.includes(`<html`)){let t=e.match(/<title>([^<]+)<\/title>/);return t?.[1]?t[1].trim():``}return e}function gt(e){let t=e.message;return t?L(t):``}function _t(e){return typeof e==`object`&&!!e&&`error`in e&&typeof e.error==`object`&&e.error!==null}function vt(e){if(!_t(e))return null;let t=e.error,n=t?.error?.message;if(typeof n==`string`&&n.length>0){let e=L(n);if(e.length>0)return e}let r=t?.message;if(typeof r==`string`&&r.length>0){let e=L(r);if(e.length>0)return e}return null}function yt(e){let t=I(e);if(t){let{code:e,isSSLError:n}=t;if(e===`ETIMEDOUT`)return`Request timed out. Check your internet connection and proxy settings`;if(n)switch(e){case`UNABLE_TO_VERIFY_LEAF_SIGNATURE`:case`UNABLE_TO_GET_ISSUER_CERT`:case`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`:return`Unable to connect to API: SSL certificate verification failed. Check your proxy or corporate SSL certificates`;case`CERT_HAS_EXPIRED`:return`Unable to connect to API: SSL certificate has expired`;case`CERT_REVOKED`:return`Unable to connect to API: SSL certificate has been revoked`;case`DEPTH_ZERO_SELF_SIGNED_CERT`:case`SELF_SIGNED_CERT_IN_CHAIN`:return`Unable to connect to API: Self-signed certificate detected. Check your proxy or corporate SSL certificates`;case`ERR_TLS_CERT_ALTNAME_INVALID`:case`HOSTNAME_MISMATCH`:return`Unable to connect to API: SSL certificate hostname mismatch`;case`CERT_NOT_YET_VALID`:return`Unable to connect to API: SSL certificate is not yet valid`;default:return`Unable to connect to API: SSL error (${e})`}}if(e.message===`Connection error.`)return t?.code?`Unable to connect to API (${t.code})`:`Unable to connect to API. Check your internet connection`;if(!e.message)return vt(e)??`API error (status ${e.status??`unknown`})`;let n=gt(e);return n!==e.message&&n.length>0?n:e.message}var bt,xt=e((()=>{bt=new Set([`UNABLE_TO_VERIFY_LEAF_SIGNATURE`,`UNABLE_TO_GET_ISSUER_CERT`,`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`,`CERT_SIGNATURE_FAILURE`,`CERT_NOT_YET_VALID`,`CERT_HAS_EXPIRED`,`CERT_REVOKED`,`CERT_REJECTED`,`CERT_UNTRUSTED`,`DEPTH_ZERO_SELF_SIGNED_CERT`,`SELF_SIGNED_CERT_IN_CHAIN`,`CERT_CHAIN_TOO_LONG`,`PATH_LENGTH_EXCEEDED`,`ERR_TLS_CERT_ALTNAME_INVALID`,`HOSTNAME_MISMATCH`,`ERR_TLS_HANDSHAKE_TIMEOUT`,`ERR_SSL_WRONG_VERSION_NUMBER`,`ERR_SSL_DECRYPTION_FAILED_OR_BAD_RECORD_MAC`])}));function St(e,t,n){let r=[],i=Ct(t);i&&r.push({role:`system`,content:i});for(let t of e)switch(t.type){case`user`:r.push(...wt(t));break;case`assistant`:r.push(...Et(t));break;default:break}return r}function Ct(e){return!e||e.length===0?``:e.filter(Boolean).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dr as e,Xr as t,br as n}from"./loadAgentsDir-C96o6gCj.js";n();export{e as linkSessionToPR,t as recordTranscript};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n}from"./envUtils-DcaKZlRU.js";import{i as r,l as i,n as a}from"./esm-lWlUmoUA.js";import{et as o,ft as s,rt as c,ut as l}from"./esm-BCUC71kt.js";import{R as u,Ut as d,ft as f,k as p,ot as m}from"./state-D5D6QpTX.js";import{C as h,R as ee,S as g,c as te,i as ne,x as re}from"./debug-D58GQBDG.js";import{d as ie,h as ae}from"./config-DUTgj3js.js";import{i as oe,t as se}from"./hash-Tu-My5Vp.js";import{Pt as ce,Tt as le}from"./model-BaMclMXn.js";import"path";import"fs";import{createHash as ue}from"crypto";import"fs/promises";import{AsyncLocalStorage as de}from"async_hooks";function fe(e){let t=BigInt(58),n=Array(v).fill(_[0]),r=v-1,i=e;for(;i>0n;){let e=Number(i%t);n[r]=_[e],i/=t,r--}return n.join(``)}function pe(e){let t=e.replace(/-/g,``);if(t.length!==32)throw Error(`Invalid UUID hex length: ${t.length}`);return BigInt(`0x${t}`)}function me(e,t){let n=pe(t);return`${e}_${he}${fe(n)}`}var _,he,v,ge=e((()=>{_=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,he=`01`,v=22}));function y(e){let n=_e[e],r=process.env[e];return r===void 0?n:t(r)}function b(){let e=ie(),t=f(),n={"user.id":e};y(`OTEL_METRICS_INCLUDE_SESSION_ID`)&&(n[`session.id`]=t),y(`OTEL_METRICS_INCLUDE_VERSION`)&&(n[`app.version`]=`0.0.21`);let r=le();if(r){let e=r.organizationUuid,t=r.emailAddress,i=r.accountUuid;e&&(n[`organization.id`]=e),t&&(n[`user.email`]=t),i&&y(`OTEL_METRICS_INCLUDE_ACCOUNT_UUID`)&&(n[`user.account_uuid`]=i,n[`user.account_id`]=process.env.CLAUDE_CODE_ACCOUNT_TAGGED_ID||me(`user`,i))}return l.terminal&&(n[`terminal.type`]=l.terminal),n}var _e,x=e((()=>{d(),ce(),ae(),s(),n(),ge(),_e={OTEL_METRICS_INCLUDE_SESSION_ID:!0,OTEL_METRICS_INCLUDE_VERSION:!1,OTEL_METRICS_INCLUDE_ACCOUNT_UUID:!0}}));function ve(){return t(process.env.OTEL_LOG_USER_PROMPTS)}function ye(e){return ve()?e:`<REDACTED>`}async function S(e,t={}){let n=p();if(!n){C||(C=!0,te(`[3P telemetry] Event dropped (no event logger initialized): ${e}`,{level:`warn`}));return}let r={...b(),"event.name":e,"event.timestamp":new Date().toISOString(),"event.sequence":be++},i=m();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 be,C,xe=e((()=>{d(),ne(),n(),x(),be=0,C=!1}));function Se(){O.clear(),k.clear()}function w(){return t(process.env.ENABLE_BETA_TRACING_DETAILED)&&process.env.BETA_TRACING_ENDPOINT&&u()||!1}function T(e,t=je){return e.length<=t?{content:e,truncated:!1}:{content:e.slice(0,t)+`
|
|
2
|
+
|
|
3
|
+
[TRUNCATED - Content exceeds 60KB limit]`,truncated:!0}}function E(e){return ue(`sha256`).update(e).digest(`hex`).slice(0,12)}function Ce(e){return`sp_${E(e)}`}function we(e){return`msg_${E(h(e.message.content))}`}function D(e){let t=e.trim().match(Me);return t?.[1]?t[1].trim():null}function Te(e){let t=[],n=[];for(let r of e){let e=r.message.content;if(typeof e==`string`){let r=D(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=D(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:h(r.content),i=D(e);i?n.push(i):t.push(`[TOOL RESULT: ${r.tool_use_id}]\n${e}`)}}}return{contextParts:t,systemReminders:n}}function Ee(e,t){if(!w())return;let{content:n,truncated:r}=T(`[USER PROMPT]\n${t}`);e.setAttributes({new_context:n,...r&&{new_context_truncated:!0,new_context_original_length:t.length}})}function De(e,t,n){if(w()){if(t?.systemPrompt){let n=Ce(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),!O.has(n)){O.add(n);let{content:e,truncated:r}=T(t.systemPrompt);S(`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=g(t.tools).map(e=>{let t=h(e),n=E(t);return{name:typeof e.name==`string`?e.name:`unknown`,hash:n,json:t}});e.setAttribute(`tools`,h(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(!O.has(`tool_${t}`)){O.add(`tool_${t}`);let{content:n,truncated:i}=T(r);S(`tool`,{tool_name:c(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=k.get(r),a=0;if(i)for(let e=0;e<n.length;e++){let t=n[e];if(t&&we(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}=Te(o);if(t.length>0){let n=t.join(`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`),{content:r,truncated:i}=T(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}=T(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&&k.set(r,we(a))}}}}function Oe(e,t){if(!(!w()||!t)&&t.modelOutput!==void 0){let{content:n,truncated:r}=T(t.modelOutput);e[`response.model_output`]=n,r&&(e[`response.model_output_truncated`]=!0,e[`response.model_output_original_length`]=t.modelOutput.length)}}function ke(e,t,n){if(!w())return;let{content:r,truncated:i}=T(`[TOOL INPUT: ${t}]\n${n}`);e.setAttributes({tool_input:r,...i&&{tool_input_truncated:!0,tool_input_original_length:n.length}})}function Ae(e,t,n){if(!w())return;let{content:r,truncated:i}=T(`[TOOL RESULT: ${t}]\n${n}`);e.new_context=r,i&&(e.new_context_truncated=!0,e.new_context_original_length=n.length)}var O,k,je,Me,Ne=e((()=>{d(),o(),n(),re(),xe(),O=new Set,k=new Map,je=60*1024,Me=/^<system-reminder>\n?([\s\S]*?)\n?<\/system-reminder>$/}));function A(e){return Math.abs(se(e))||1}function Pe(e){let t=H.get(e);return t===void 0?(V++,H.set(e,V),V):t}function j(){let e=f(),t=`main`,n=z.get(e);if(n)return n;let r={agentId:e,agentName:t,parentAgentId:void 0,processId:1,threadId:A(t)};return z.set(e,r),B++,r}function M(){return(Date.now()-qe)*1e3}function N(){return`span_${++Je}`}function Fe(){let e=process.env.CLAUDE_CODE_PERFETTO_TRACE;te(`[Perfetto] initializePerfettoTracing called, env value: ${e}`)}function Ie(e){F&&(I.push({name:`process_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{name:e.agentName}}),I.push({name:`thread_name`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:e.threadId,args:{name:e.agentName}}),e.parentAgentId&&I.push({name:`parent_agent`,cat:`__metadata`,ph:`M`,ts:0,pid:e.processId,tid:0,args:{parent_agent_id:e.parentAgentId}}))}function P(){return F}function Le(e,t,n){if(!F)return;let r={agentId:e,agentName:t,parentAgentId:n,processId:Pe(e),threadId:A(t)};z.set(e,r),B++,Ie(r)}function Re(e){F&&(z.delete(e),H.delete(e))}function ze(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`API Call`,category:`api`,startTime:M(),agentInfo:n,args:{model:e.model,prompt_tokens:e.promptTokens,message_id:e.messageId,is_speculative:e.isSpeculative??!1,query_source:e.querySource}}),L.push({name:`API Call`,cat:`api`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Be(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),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,ee={...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},g=m!==void 0&&m>0?m*1e3:0;if(g>0){let e=n.startTime+g;if(L.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;L.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}}),L.push({name:`Attempt ${t+1} (retry)`,cat:`api,retry`,ph:`E`,ts:i,pid:n.agentInfo.processId,tid:n.agentInfo.threadId})}}L.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+g,t=e+o*1e3;L.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}}),L.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-g/1e3;r!==void 0&&r>0&&(L.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}}),L.push({name:`Sampling`,cat:`api,sampling`,ph:`E`,ts:t+r*1e3,pid:n.agentInfo.processId,tid:n.agentInfo.threadId}))}L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:ee}),R.delete(e)}function Ve(e,t){if(!F)return``;let n=N(),r=j();return R.set(n,{name:`Tool: ${e}`,category:`tool`,startTime:M(),agentInfo:r,args:{tool_name:e,...t}}),L.push({name:`Tool: ${e}`,cat:`tool`,ph:`B`,ts:R.get(n).startTime,pid:r.processId,tid:r.threadId,args:R.get(n).args}),n}function He(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,success:t?.success??!0,error:t?.error,result_tokens:t?.resultTokens,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Ue(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Waiting for User Input`,category:`user_input`,startTime:M(),agentInfo:n,args:{context:e}}),L.push({name:`Waiting for User Input`,cat:`user_input`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function We(e,t){if(!F||!e)return;let n=R.get(e);if(!n)return;let r=M(),i=r-n.startTime,a={...n.args,decision:t?.decision,source:t?.source,duration_ms:i/1e3};L.push({name:n.name,cat:n.category,ph:`E`,ts:r,pid:n.agentInfo.processId,tid:n.agentInfo.threadId,args:a}),R.delete(e)}function Ge(e){if(!F)return``;let t=N(),n=j();return R.set(t,{name:`Interaction`,category:`interaction`,startTime:M(),agentInfo:n,args:{user_prompt_length:e?.length}}),L.push({name:`Interaction`,cat:`interaction`,ph:`B`,ts:R.get(t).startTime,pid:n.processId,tid:n.threadId,args:R.get(t).args}),t}function Ke(e){if(!F||!e)return;let t=R.get(e);if(!t)return;let n=M(),r=n-t.startTime;L.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}}),R.delete(e)}var F,I,L,R,z,B,qe,Je,V,H,Ye=e((()=>{d(),ne(),n(),ee(),oe(),re(),F=!1,I=[],L=[],R=new Map,z=new Map,B=0,qe=0,Je=0,V=1,H=new Map}));function U(e){return e.spanContext().spanId||``}function Xe(){if($)return;$=!0;let e=setInterval(()=>{let e=Date.now()-dt;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 W(){return!1}function G(){return W()||w()}function K(){return r.getTracer(`com.anthropic.claude_code.tracing`,`1.0.0`)}function q(e,t={}){return{...b(),"span.type":e,...t}}function Ze(e){Xe();let n=P()?Ge(e):void 0;if(!G()){if(n){let e=r.getActiveSpan()||K().startSpan(`dummy`),t=U(e),i={span:e,startTime:Date.now(),attributes:{},perfettoSpanId:n};return X.set(t,new WeakRef(i)),J.enterWith(i),e}return r.getActiveSpan()||K().startSpan(`dummy`)}let i=K(),a=t(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=i.startSpan(`claude_code.interaction`,{attributes:o});Ee(s,e);let c=U(s),l={span:s,startTime:Date.now(),attributes:o,perfettoSpanId:n};return X.set(c,new WeakRef(l)),J.enterWith(l),s}function Qe(){let e=J.getStore();if(!e||e.ended)return;if(e.perfettoSpanId&&Ke(e.perfettoSpanId),!G()){e.ended=!0,X.delete(U(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(U(e.span)),J.enterWith(void 0)}function $e(e,t,n,a){let o=P()?ze({model:e,querySource:t?.querySource,messageId:void 0}):void 0;if(!G()){if(o){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{model:e},perfettoSpanId:o};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let s=K(),c=J.getStore(),l=q(`llm_request`,{model:e,"llm_request.context":c?`interaction`:`standalone`,speed:a?`fast`:`normal`}),u=c?r.setSpan(i.active(),c.span):i.active(),d=s.startSpan(`claude_code.llm_request`,{attributes:l},u);t?.querySource&&d.setAttribute(`query_source`,t.querySource),De(d,t,n);let f=U(d),p={span:d,startTime:Date.now(),attributes:l,perfettoSpanId:o};return X.set(f,new WeakRef(p)),Z.set(f,p),d}function et(e,t){let n;if(e){let t=U(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&&Be(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=U(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),Oe(i,t)),n.span.setAttributes(i),n.span.end();let a=U(n.span);X.delete(a),Z.delete(a)}function tt(e,t,n){let a=P()?Ve(e,t):void 0;if(!G()){if(a){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool`,tool_name:e},perfettoSpanId:a};return X.set(n,new WeakRef(i)),Y.enterWith(i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let o=K(),s=J.getStore(),c=q(`tool`,{tool_name:e,...t}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.tool`,{attributes:c},l);n&&ke(u,e,n);let d=U(u),f={span:u,startTime:Date.now(),attributes:c,perfettoSpanId:a};return X.set(d,new WeakRef(f)),Y.enterWith(f),u}function nt(){let e=P()?Ue(`tool_permission`):void 0;if(!G()){if(e){let t=r.getActiveSpan()||K().startSpan(`dummy`),n=U(t),i={span:t,startTime:Date.now(),attributes:{"span.type":`tool.blocked_on_user`},perfettoSpanId:e};return X.set(n,new WeakRef(i)),Z.set(n,i),t}return r.getActiveSpan()||K().startSpan(`dummy`)}let t=K(),n=Y.getStore(),a=q(`tool.blocked_on_user`),o=n?r.setSpan(i.active(),n.span):i.active(),s=t.startSpan(`claude_code.tool.blocked_on_user`,{attributes:a},o),c=U(s),l={span:s,startTime:Date.now(),attributes:a,perfettoSpanId:e};return X.set(c,new WeakRef(l)),Z.set(c,l),s}function rt(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&&We(n.perfettoSpanId,{decision:e,source:t}),!G()){let e=U(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=U(n.span);X.delete(i),Z.delete(i)}function it(){if(!G())return r.getActiveSpan()||K().startSpan(`dummy`);let e=K(),t=Y.getStore(),n=q(`tool.execution`),a=t?r.setSpan(i.active(),t.span):i.active(),o=e.startSpan(`claude_code.tool.execution`,{attributes:n},a),s=U(o),c={span:o,startTime:Date.now(),attributes:n};return X.set(s,new WeakRef(c)),Z.set(s,c),o}function at(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=U(t.span);X.delete(r),Z.delete(r)}function ot(e,t){let n=Y.getStore();if(!n)return;if(n.perfettoSpanId&&He(n.perfettoSpanId,{success:!0,resultTokens:t}),!G()){let e=U(n.span);X.delete(e),Y.enterWith(void 0);return}let r={duration_ms:Date.now()-n.startTime};e&&Ae(r,n.attributes.tool_name||`unknown`,e),t!==void 0&&(r.result_tokens=t),n.span.setAttributes(r),n.span.end();let i=U(n.span);X.delete(i),Y.enterWith(void 0)}function st(){return t(process.env.OTEL_LOG_TOOL_CONTENT)}function ct(e,t){if(!G()||!st())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}=T(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 lt(e,t,n,a){if(!w())return r.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:a}),l=s?r.setSpan(i.active(),s.span):i.active(),u=o.startSpan(`claude_code.hook`,{attributes:c},l),d=U(u),f={span:u,startTime:Date.now(),attributes:c};return X.set(d,new WeakRef(f)),Z.set(d,f),u}function ut(e,t){if(!w())return;let n=U(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,$,dt,ft=e((()=>{a(),n(),x(),Ne(),Ye(),J=new de,Y=new de,X=new Map,Z=new Map,Q=0,$=!1,dt=1800*1e3}));export{w as C,b as D,ye as E,x as O,Ne as S,S as T,Fe as _,rt as a,Re as b,ft as c,Ze as d,$e as f,Ye as g,tt as h,et as i,W as l,it as m,ut as n,at as o,nt as p,Qe as r,ot as s,ct as t,lt as u,P as v,xe as w,Se as x,Le as y};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n,n as r,r as i,s as a,t as o}from"./isObject-C6qM3WEW.js";import{d as s,f as c,g as ee,h as l,l as te,n as u,t as d,u as f}from"./memoize-BK3gG5ob.js";import{i as p,l as m,o as ne}from"./envUtils-DcaKZlRU.js";import{n as re,t as ie}from"./defineProperty-C-QyHrDq.js";import{i as ae,r as oe}from"./isSymbol-BO6cdPI7.js";import{A as se,C as h,D as g,E as _,F as ce,M as le,N as v,P as y,S as ue,U as de,_ as b,f as x,g as S,i as fe,j as C,k as pe,l as me,m as he,n as w,r as T,t as E,u as ge,y as _e}from"./lazySchema-DULtBUCI.js";import{$ as ve,$r as ye,Cr as be,Ei as xe,Gr as Se,It as Ce,Jr as we,Kr as Te,M as Ee,Mi as De,Qr as Oe,Ti as ke,Ut as Ae,Xr as je,Yr as Me,Zr as Ne,_r as Pe,ai as Fe,bi as Ie,br as Le,ci as Re,dr as ze,ei as Be,fr as Ve,gr as He,hr as Ue,j as We,ji as Ge,li as Ke,mr as qe,oi as Je,pr as Ye,qr as Xe,si as Ze,ui as Qe,v as $e,vr as et,wr as tt,yi as nt}from"./state-D5D6QpTX.js";import{n as rt,t as it}from"./cwd-Nh5IZNKO.js";import{B as at,C as ot,F as st,R as ct,S as lt,V as ut,b as dt,c as D,f as O,g as ft,i as pt,u as k,x as mt}from"./debug-D58GQBDG.js";import{O as ht,k as gt,m as _t,t as vt}from"./git-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n,n as r,r as i,s as a,t as o}from"./isObject-C6qM3WEW.js";import{d as s,f as c,g as ee,h as l,l as te,n as u,t as d,u as f}from"./memoize-BK3gG5ob.js";import{i as p,l as m,o as ne}from"./envUtils-DcaKZlRU.js";import{n as re,t as ie}from"./defineProperty-C-QyHrDq.js";import{i as ae,r as oe}from"./isSymbol-BO6cdPI7.js";import{A as se,C as h,D as g,E as _,F as ce,M as le,N as v,P as y,S as ue,U as de,_ as b,f as x,g as S,i as fe,j as C,k as pe,l as me,m as he,n as w,r as T,t as E,u as ge,y as _e}from"./lazySchema-DULtBUCI.js";import{$ as ve,$r as ye,Cr as be,Ei as xe,Gr as Se,It as Ce,Jr as we,Kr as Te,M as Ee,Mi as De,Qr as Oe,Ti as ke,Ut as Ae,Xr as je,Yr as Me,Zr as Ne,_r as Pe,ai as Fe,bi as Ie,br as Le,ci as Re,dr as ze,ei as Be,fr as Ve,gr as He,hr as Ue,j as We,ji as Ge,li as Ke,mr as qe,oi as Je,pr as Ye,qr as Xe,si as Ze,ui as Qe,v as $e,vr as et,wr as tt,yi as nt}from"./state-D5D6QpTX.js";import{n as rt,t as it}from"./cwd-Nh5IZNKO.js";import{B as at,C as ot,F as st,R as ct,S as lt,V as ut,b as dt,c as D,f as O,g as ft,i as pt,u as k,x as mt}from"./debug-D58GQBDG.js";import{O as ht,k as gt,m as _t,t as vt}from"./git-Wid-XppW.js";import{i as yt,n as bt}from"./execFileNoThrow-B_KRY4cT.js";import{o as xt,s as A}from"./log-CZ7ploQm.js";import{n as St,t as Ct}from"./which-B8rchd8P.js";import{i as j,o as wt}from"./platform-DMQxcm4K.js";import{a as Tt,i as Et}from"./windowsPaths-BdhjMYTm.js";import{l as Dt}from"./sessionStoragePortable-x0Yn02-G.js";import{a as Ot,f as kt,p as At,r as jt,s as Mt,u as M}from"./types-APu4OCXJ.js";import{n as Nt,r as Pt}from"./analytics-DJobLaWP.js";import{n as Ft,r as It}from"./startupProfiler-B90b5vuq.js";import{c as Lt,u as Rt}from"./oauth-D38aRTUb.js";import{r as zt,t as Bt}from"./bundledMode--fG1S62b.js";import{f as Vt,l as Ht,n as Ut,o as Wt,p as Gt}from"./stringUtils-D7oJIyY2.js";import{homedir as Kt,userInfo as qt}from"os";import{basename as Jt,dirname as N,extname as Yt,isAbsolute as Xt,join as P,normalize as Zt,posix as Qt,relative as $t,resolve as F,sep as en}from"path";import{chmodSync as tn,existsSync as nn,writeFileSync as rn}from"fs";import{appendFile as an,mkdir as on,readFile as sn,realpath as cn,stat as ln,writeFile as un}from"fs/promises";import{execFile as dn}from"child_process";var I,fn=e((()=>{c(),I=function(){try{var e=s(Object,`defineProperty`);return e({},``,{}),e}catch{}}()}));function pn(e,t,n){t==`__proto__`&&I?I(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var mn=e((()=>{fn()}));function hn(e,t,n){var r=e[t];(!(gn.call(e,t)&&te(r,n))||n===void 0&&!(t in e))&&pn(e,t,n)}var gn,_n=e((()=>{mn(),f(),gn=Object.prototype.hasOwnProperty}));function vn(e,t,n,r){var i=!n;n||(n={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?pn(n,s,c):hn(n,s,c)}return n}var yn=e((()=>{_n(),mn()}));function bn(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xn=e((()=>{}));function Sn(e){if(!r(e))return bn(e);var t=je(e),n=[];for(var i in e)i==`constructor`&&(t||!Cn.call(e,i))||n.push(i);return n}var Cn,wn=e((()=>{o(),Me(),xn(),Cn=Object.prototype.hasOwnProperty}));function Tn(e){return Te(e)?Ne(e,!0):Sn(e)}var En=e((()=>{Oe(),wn(),Se()}));function Dn(e,t){if(t)return e.slice();var n=e.length,r=jn?jn(n):new e.constructor(n);return e.copy(r),r}var On,kn,An,jn,Mn=e((()=>{a(),On=typeof exports==`object`&&exports&&!exports.nodeType&&exports,kn=On&&typeof module==`object`&&module&&!module.nodeType&&module,An=kn&&kn.exports===On?t.Buffer:void 0,jn=An?An.allocUnsafe:void 0}));function Nn(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Pn=e((()=>{})),Fn,In=e((()=>{Xe(),Fn=we(Object.getPrototypeOf,Object)}));function Ln(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}var Rn=e((()=>{xe()}));function zn(e,t){var n=t?Ln(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Bn=e((()=>{Rn()})),Vn,Hn,Un=e((()=>{o(),Vn=Object.create,Hn=function(){function e(){}return function(t){if(!r(t))return{};if(Vn)return Vn(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}()}));function Wn(e){return typeof e.constructor==`function`&&!je(e)?Hn(Fn(e)):{}}var Gn=e((()=>{Un(),In(),Me()}));function Kn(e,t){let n=t??it()??k().cwd();if(typeof e!=`string`)throw TypeError(`Path must be a string, received ${typeof e}`);if(typeof n!=`string`)throw TypeError(`Base directory must be a string, received ${typeof n}`);if(e.includes(`\0`)||n.includes(`\0`))throw Error(`Path contains null bytes`);let r=e=>e.includes(`/`)&&!e.includes(`\\`)&&!/^[A-Za-z]:/.test(e),i=e.trim();if(!i)return j()===`windows`&&r(n)?Qt.normalize(n).normalize(`NFC`):Zt(n).normalize(`NFC`);if(i===`~`)return Kt().normalize(`NFC`);if(i.startsWith(`~/`))return P(Kt(),i.slice(2)).normalize(`NFC`);let a=i;if(j()===`windows`&&i.match(/^\/[a-z]\//i))try{a=Tt(i)}catch{a=i}return Xt(a)?j()===`windows`&&r(a)?Qt.normalize(a).normalize(`NFC`):Zt(a).normalize(`NFC`):j()===`windows`&&r(n)&&!/^[A-Za-z]:/.test(a)&&!a.startsWith(`\\\\`)?Qt.resolve(n,a).normalize(`NFC`):F(n,a).normalize(`NFC`)}function qn(e){let t=$t(it(),e);return t.startsWith(`..`)?e:t}function Jn(e){let t=Kn(e);if(t.startsWith(`\\\\`)||t.startsWith(`//`))return N(t);try{if(k().statSync(t).isDirectory())return t}catch{}return N(t)}function Yn(e){return/(?:^|[\\/])\.\.(?:[\\/]|$)/.test(e)}function Xn(e){return Zt(e).replace(/\\/g,`/`)}var Zn=e((()=>{rt(),O(),wt(),Et(),Dt()}));function Qn(e,t,n){(n!==void 0&&!te(e[t],n)||n===void 0&&!(t in e))&&pn(e,t,n)}var $n=e((()=>{mn(),f()}));function er(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var tr=e((()=>{})),nr,rr=e((()=>{tr(),nr=er()}));function ir(e){return ae(e)&&Te(e)}var ar=e((()=>{Se(),oe()}));function or(e){if(!ae(e)||i(e)!=sr)return!1;var t=Fn(e);if(t===null)return!0;var n=dr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&ur.call(n)==fr}var sr,cr,lr,ur,dr,fr,pr=e((()=>{n(),In(),oe(),sr=`[object Object]`,cr=Function.prototype,lr=Object.prototype,ur=cr.toString,dr=lr.hasOwnProperty,fr=ur.call(Object)}));function mr(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var hr=e((()=>{}));function gr(e){return vn(e,Tn(e))}var _r=e((()=>{yn(),En()}));function vr(e,t,n,i,a,o,s){var c=mr(e,n),l=mr(t,n),te=s.get(l);if(te){Qn(e,n,te);return}var u=o?o(c,l,n+``,e,t,s):void 0,d=u===void 0;if(d){var f=Ie(l),p=!f&&Re(l),m=!f&&!p&&Be(l);u=l,f||p||m?Ie(c)?u=c:ir(c)?u=Nn(c):p?(d=!1,u=Dn(l,!0)):m?(d=!1,u=zn(l,!0)):u=[]:or(l)||Qe(l)?(u=c,Qe(c)?u=gr(c):(!r(c)||ee(c))&&(u=Wn(l))):d=!1}d&&(s.set(l,u),a(u,l,i,o,s),s.delete(l)),Qn(e,n,u)}var yr=e((()=>{$n(),Mn(),Bn(),Pn(),Gn(),Ke(),nt(),ar(),Ze(),l(),o(),pr(),ye(),hr(),_r()}));function br(e,t,n,i,a){e!==t&&nr(t,function(o,s){if(a||(a=new Ge),r(o))vr(e,t,s,n,br,i,a);else{var c=i?i(mr(e,s),o,s+``,e,t,a):void 0;c===void 0&&(c=o),Qn(e,s,c)}},Tn)}var xr=e((()=>{De(),$n(),rr(),yr(),o(),En(),hr()}));function Sr(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Cr=e((()=>{}));function wr(e,t,n){return t=Tr(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Tr(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Sr(e,this,s)}}var Tr,Er=e((()=>{Cr(),Tr=Math.max}));function Dr(e){return function(){return e}}var Or=e((()=>{})),kr,Ar=e((()=>{Or(),fn(),tt(),kr=I?function(e,t){return I(e,`toString`,{configurable:!0,enumerable:!1,value:Dr(t),writable:!0})}:be}));function jr(e){var t=0,n=0;return function(){var r=Pr(),i=Nr-(r-n);if(n=r,i>0){if(++t>=Mr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Mr,Nr,Pr,Fr=e((()=>{Mr=800,Nr=16,Pr=Date.now})),Ir,Lr=e((()=>{Ar(),Fr(),Ir=jr(kr)}));function Rr(e,t){return Ir(wr(e,t,be),e+``)}var zr=e((()=>{tt(),Er(),Lr()}));function Br(e,t,n){if(!r(n))return!1;var i=typeof t;return(i==`number`?Te(n)&&Je(t,n.length):i==`string`&&t in n)?te(n[t],e):!1}var Vr=e((()=>{f(),Se(),Fe(),o()}));function Hr(e){return Rr(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Br(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var Ur=e((()=>{zr(),Vr()})),L,Wr=e((()=>{xr(),Ur(),L=Hr(function(e,t,n,r){br(e,t,n,r)})}));function Gr(e){let{buffer:t,bytesRead:n}=k().readSync(e,{length:4096});return n===0?`utf8`:n>=2&&t[0]===255&&t[1]===254?`utf16le`:(n>=3&&t[0]===239&&t[1]===187&&t[2],`utf8`)}function Kr(e){let t=0,n=0;for(let r=0;r<e.length;r++)e[r]===`
|
|
2
2
|
`&&(r>0&&e[r-1]===`\r`?t++:n++);return t>n?`CRLF`:`LF`}function qr(e){let t=k(),{resolvedPath:n,isSymlink:r}=ft(t,e);r&&D(`Reading through symlink: ${e} -> ${n}`);let i=Gr(n),a=t.readFileSync(n,{encoding:i}),o=Kr(a.slice(0,4096));return{content:a.replaceAll(`\r
|
|
3
3
|
`,`
|
|
4
4
|
`),encoding:i,lineEndings:o}}function R(e){return qr(e).content}var Jr=e((()=>{pt(),O()}));function Yr(e){z=e}function Xr(){z=null,ni=void 0}function Zr(e){return ni=e,e}function Qr(){return P(p(),ti)}function $r(){try{let e=lt(At(R(Qr())));return!e||typeof e!=`object`||Array.isArray(e)?null:e}catch{return null}}function ei(){if(ni!==!0)return null;if(z)return z;let e=$r();return e?(z=e,He(),e):null}var ti,z,ni,ri=e((()=>{ne(),Jr(),kt(),Ue(),mt(),ti=`remote-settings.json`,z=null}));function ii(e,t){return e.flatMap((e,n)=>n?[t(n),e]:[e])}function ai(e,t){let n=0;for(let r of e)n+=+!!t(r);return n}function oi(e){return[...new Set(e)]}var si=e((()=>{})),ci,li,ui=e((()=>{Pi(),O(),re(),ci=class{constructor(){ie(this,`cache`,new Map),ie(this,`maxCacheSize`,1e3)}readFile(e){let t=k(),n;try{n=t.statSync(e)}catch(t){throw this.cache.delete(e),t}let r=e,i=this.cache.get(r);if(i&&i.mtime===n.mtimeMs)return{content:i.content,encoding:i.encoding};let a=gi(e),o=t.readFileSync(e,{encoding:a}).replaceAll(`\r
|
|
@@ -9,7 +9,7 @@ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n,n as r,r
|
|
|
9
9
|
`).join(`\r
|
|
10
10
|
`)),Oi(e,i,{encoding:n})}function gi(e){try{let{resolvedPath:t}=ft(k(),e);return Gr(t)}catch(e){return ut(e)?D(`detectFileEncoding failed for expected reason: ${e.code}`,{level:`debug`}):A(e),`utf8`}}function _i(e,t=`utf8`){try{let n=k(),{resolvedPath:r}=ft(n,e),{buffer:i,bytesRead:a}=n.readSync(r,{length:4096});return Kr(i.toString(t,0,a))}catch(e){return A(e),`LF`}}function vi(e){return e.includes(` `)?e.replace(/^\t+/gm,e=>` `.repeat(e.length)):e}function yi(e){let t=e?Kn(e):void 0;return{absolutePath:t,relativePath:t?$t(it(),t):void 0}}function bi(e){let{relativePath:t}=yi(e);if(t&&!t.startsWith(`..`))return t;let n=Kt();return e.startsWith(n+en)?`~${e.slice(n.length)}`:e}function xi(e){let t=k();try{let n=N(e),r=Jt(e,Yt(e)),i=t.readdirSync(n).filter(t=>Jt(t.name,Yt(t.name))===r&&P(n,t.name)!==e)[0];return i?i.name:void 0}catch(e){at(e)||A(e);return}}async function Si(e){let t=it(),n=N(t),r=e;try{r=P(await cn(N(e)),Jt(e))}catch{}let i=n===en?en:n+en;if(!r.startsWith(i)||r.startsWith(t+en)||r===t)return;let a=P(t,$t(n,r));try{return await ln(a),a}catch{return}}function Ci(){return!0}function wi({content:e,startLine:t}){if(!e)return``;let n=e.split(/\r?\n/);return Ci()?n.map((e,n)=>`${n+t}\t${e}`).join(`
|
|
11
11
|
`):n.map((e,n)=>{let r=String(n+t);return r.length>=6?`${r}→${e}`:`${r.padStart(6,` `)}→${e}`}).join(`
|
|
12
|
-
`)}function Ti(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function Ei(e){try{return k().isDirEmptySync(e)}catch(e){return at(e)}}function Di(e){let{content:t}=li.readFile(e);return t}function Oi(e,t,n={encoding:`utf-8`}){let r=k(),i=e;try{let t=r.readlinkSync(e);i=Xt(t)?t:F(N(e),t),D(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,o,s=!1;try{o=r.statSync(i).mode,s=!0,D(`Preserving file permissions: ${o.toString(8)}`)}catch(e){if(!at(e))throw e;n.mode!==void 0&&(o=n.mode,D(`Setting permissions for new file: ${o.toString(8)}`))}try{D(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),rn(a,t,e),D(`Temp file written successfully, size: ${t.length} bytes`),s&&o!==void 0&&(tn(a,o),D(`Applied original permissions to temp file`)),D(`Renaming ${a} to ${i}`),r.renameSync(a,i),D(`File ${i} written atomically`)}catch(e){D(`Failed to write file atomically: ${e}`,{level:`error`}),Pt(`tengu_atomic_write_error`,{});try{D(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){D(`Failed to clean up temp file: ${e}`)}D(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),rn(i,t,e),D(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw D(`Non-atomic write also failed: ${e}`),e}}}function ki(e,t=Mi){try{return k().statSync(e).size<=t}catch{return!1}}function Ai(e){let t=Zt(e);return t=t.replace(/\\/g,`/`),j()===`windows`&&(t=t.toLowerCase()),t}function ji(e,t){return Ai(e)===Ai(t)}var Mi,Ni,Pi=e((()=>{Nt(),rt(),pt(),ct(),Jr(),ui(),O(),xt(),Zn(),wt(),Mi=.25*1024*1024,Ni=`Note: your current working directory is`}));async function Fi(e,t){let{code:n}=await yt(`git`,[`check-ignore`,e],{preserveOutputOnError:!1,cwd:t});return n===0}function Ii(){return P(Kt(),`.config`,`git`,`ignore`)}async function Li(e,t=it()){try{if(!await vt(t))return;let n=`**/${e}`;if(await Fi(e.endsWith(`/`)?`${e}sample-file.txt`:e,t))return;let r=Ii();await on(N(r),{recursive:!0});try{if((await sn(r,{encoding:`utf-8`})).includes(n))return;await an(r,`\n${n}\n`)}catch(e){if(st(e)===`ENOENT`)await un(r,`${n}\n`,`utf-8`);else throw e}}catch(e){A(e)}}var Ri=e((()=>{rt(),ct(),bt(),_t(),xt()}));function zi(e){switch(e){case`userSettings`:return`user`;case`projectSettings`:return`project`;case`localSettings`:return`project, gitignored`;case`flagSettings`:return`cli flag`;case`policySettings`:return`managed`}}function Bi(e){switch(e){case`userSettings`:return`User`;case`projectSettings`:return`Project`;case`localSettings`:return`Local`;case`flagSettings`:return`Flag`;case`policySettings`:return`Managed`;case`plugin`:return`Plugin`;case`built-in`:return`Built-in`}}function Vi(e){switch(e){case`userSettings`:return`user settings`;case`projectSettings`:return`shared project settings`;case`localSettings`:return`project local settings`;case`flagSettings`:return`command line arguments`;case`policySettings`:return`enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`command configuration`;case`session`:return`current session`}}function Hi(e){switch(e){case`userSettings`:return`User settings`;case`projectSettings`:return`Shared project settings`;case`localSettings`:return`Project local settings`;case`flagSettings`:return`Command line arguments`;case`policySettings`:return`Enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`Command configuration`;case`session`:return`Current session`}}function Ui(e){if(e===``)return[];let t=e.split(`,`).map(e=>e.trim()),n=[];for(let e of t)switch(e){case`user`:n.push(`userSettings`);break;case`project`:n.push(`projectSettings`);break;case`local`:n.push(`localSettings`);break;default:throw Error(`Invalid setting source: ${e}. Valid options are: user, project, local`)}return n}function Wi(){let e=$e(),t=new Set(e);return t.add(`policySettings`),t.add(`flagSettings`),Array.from(t)}function Gi(e){return Wi().includes(e)}var Ki,qi,Ji,Yi=e((()=>{Ae(),Ki=[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],qi=[`localSettings`,`projectSettings`,`userSettings`],Ji=`https://json.schemastore.org/claude-code-settings.json`}));function Xi(e){$i.set(e,Date.now())}function Zi(e,t){let n=$i.get(e);return n!==void 0&&Date.now()-n<t?($i.delete(e),!0):!1}function Qi(){$i.clear()}var $i,ea=e((()=>{$i=new Map})),ta,na,ra=e((()=>{d(),wt(),ta=u(()=>{switch(j()){case`macos`:return`/Library/Application Support/ClaudeCode`;case`windows`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/workmate`}}),na=u(()=>P(ta(),`managed-settings.d`))})),ia,aa,oa,sa=e((()=>{T(),E(),ia=w(()=>g({allowedDomains:S(v()).optional(),allowManagedDomainsOnly:b().optional().describe(`When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources.`),allowUnixSockets:S(v()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:b().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:b().optional(),httpProxyPort:_().optional(),socksProxyPort:_().optional()}).optional()),aa=w(()=>g({allowWrite:S(v()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:S(v()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:S(v()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:S(v()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:b().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),oa=w(()=>g({enabled:b().optional(),failIfUnavailable:b().optional().describe(`Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate.`),autoAllowBashIfSandboxed:b().optional(),allowUnsandboxedCommands:b().optional().describe(`Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true.`),network:ia(),filesystem:aa(),ignoreViolations:C(v(),S(v())).optional(),enableWeakerNestedSandbox:b().optional(),enableWeakerNetworkIsolation:b().optional().describe(`macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false`),excludedCommands:S(v()).optional(),ripgrep:g({command:v(),args:S(v()).optional()}).optional().describe(`Custom ripgrep configuration for bundled ripgrep support`)}).passthrough())}));async function B(e){try{return!!await St(e)}catch{return!1}}function ca(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function la(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of va)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(ua())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function ua(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function da(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:V.platform}var fa,pa,ma,ha,ga,_a,va,ya,V,ba=e((()=>{d(),Rt(),Bt(),ne(),Gt(),O(),Ct(),fa=u(()=>{if(k().existsSync(P(p(),`.config.json`)))return P(p(),`.config.json`);let e=`.workmate${Lt()}.json`;return P(process.env.WORKMATE_CONFIG_DIR||Kt(),e)}),pa=u(async()=>{try{let{default:e}=await import(`./axios-BHBm_hhU.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),ma=u(async()=>{let e=[];return await B(`npm`)&&e.push(`npm`),await B(`yarn`)&&e.push(`yarn`),await B(`pnpm`)&&e.push(`pnpm`),e}),ha=u(async()=>{let e=[];return await B(`bun`)&&e.push(`bun`),await B(`deno`)&&e.push(`deno`),await B(`node`)&&e.push(`node`),e}),ga=u(()=>{try{return k().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),_a=u(()=>{try{if(!ga())return!1;let{cmd:e}=Vt(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),va=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],ya=u(()=>{if(m(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(m(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(m(process.env.RENDER))return`render`;if(m(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(m(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(k().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(m(process.env.GITHUB_ACTIONS))return`github-actions`;if(m(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(m(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(k().existsSync(`/.dockerenv`))return`docker`}catch{}return V.platform===`darwin`?`unknown-darwin`:V.platform===`linux`?`unknown-linux`:V.platform===`win32`?`unknown-win32`:`unknown`}),V={hasInternetAccess:pa,isCI:m(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:la(),isSSH:ua,getPackageManagers:ma,getRuntimes:ha,isRunningWithBun:u(zt),isWslEnvironment:ga,isNpmFromWindowsPath:_a,isConductor:ca,detectDeploymentEnvironment:ya}})),xa,Sa,Ca=e((()=>{ba(),xa=V.platform===`darwin`?`⏺`:`●`,Sa=`·✔︎·`})),wa,Ta,Ea,Da=e((()=>{wa=[`acceptEdits`,`bypassPermissions`,`default`,`dontAsk`,`plan`],Ta=[...wa,`auto`],Ea=Ta}));function Oa(e){return!0}function ka(e){return Ra[e]??Ra.default}function Aa(e){return ka(e).external}function ja(e){return Ea.includes(e)?e:`default`}function Ma(e){return ka(e).title}function Na(e){return e==="default"||e===void 0}function Pa(e){return ka(e).shortTitle}function Fa(e){return ka(e).symbol}function Ia(e){return ka(e).color}var La,Ra,za=e((()=>{T(),Ca(),Da(),E(),w(()=>fe.enum(Ea)),La=w(()=>fe.enum(wa)),Ra={default:{title:`Default`,shortTitle:`Default`,symbol:``,color:`text`,external:`default`},plan:{title:`Plan Mode`,shortTitle:`Plan`,symbol:`⏸`,color:`planMode`,external:`plan`},acceptEdits:{title:`Accept edits`,shortTitle:`Accept`,symbol:`⏵⏵`,color:`autoAccept`,external:`acceptEdits`},bypassPermissions:{title:`Bypass`,shortTitle:`Bypass`,symbol:`⏵⏵`,color:`error`,external:`bypassPermissions`},dontAsk:{title:`Don't Ask`,shortTitle:`DontAsk`,symbol:`⏵⏵`,color:`error`,external:`dontAsk`},auto:{title:`Auto`,shortTitle:`Auto`,symbol:`⏵⏵`,color:`warning`,external:`default`}}})),Ba=e((()=>{})),Va,Ha=e((()=>{Ba(),Va=`PreToolUse.PostToolUse.PostToolUseFailure.Notification.UserPromptSubmit.SessionStart.SessionEnd.Stop.StopFailure.SubagentStart.SubagentStop.PreCompact.PostCompact.PermissionRequest.PermissionDenied.Setup.TeammateIdle.TaskCreated.TaskCompleted.Elicitation.ElicitationResult.ConfigChange.WorktreeCreate.WorktreeRemove.InstructionsLoaded.CwdChanged.FileChanged`.split(`.`)})),Ua=e((()=>{})),Wa=e((()=>{})),Ga=e((()=>{Ha(),Ua(),Wa()})),Ka,qa,Ja=e((()=>{Ka=[`bash`,`powershell`],qa=`bash`}));function Ya(){return{BashCommandHookSchema:g({type:h(`command`).describe(`Shell command hook type`),command:v().describe(`Shell command to execute`),if:Xa(),shell:x(Ka).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:_().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`),async:b().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:b().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:g({type:h(`prompt`).describe(`LLM prompt hook type`),prompt:v().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:v().optional().describe(`Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:g({type:h(`http`).describe(`HTTP hook type`),url:v().url().describe(`URL to POST the hook input JSON to`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for this specific request`),headers:C(v(),v()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:S(v()).optional().describe(`Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:g({type:h(`agent`).describe(`Agentic verifier hook type`),prompt:v().describe(`Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:v().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)})}}var Xa,Za,Qa,H,$a=e((()=>{Ga(),T(),E(),Ja(),Xa=w(()=>v().optional().describe(`Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.`)),Za=w(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=Ya();return _e(`type`,[e,t,n,r])}),Qa=w(()=>g({matcher:v().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:S(Za()).describe(`List of hooks to execute when the matcher matches`)})),H=w(()=>pe(x(Va),S(Qa())))}));function eo(e,t){let n=e.toLowerCase();return t.autoUpdate??(U.has(n)&&!ao.has(n))}function to(e){return U.has(e.toLowerCase())?!1:so.test(e)?!0:oo.test(e)}function no(e,t){let n=e.toLowerCase();if(!U.has(n))return null;if(t.source===`github`)return(t.repo||``).toLowerCase().startsWith(`anthropics/`)?null:`The name '${e}' is reserved for official marketplaces. Only repositories from 'github.com/${co}/' can use this name.`;if(t.source===`git`&&t.url){let n=t.url.toLowerCase(),r=n.includes(`github.com/anthropics/`),i=n.includes(`git@github.com:anthropics/`);return r||i?null:`The name '${e}' is reserved for official marketplaces. Only repositories from 'github.com/${co}/' can use this name.`}return`The name '${e}' is reserved for official marketplaces and can only be used with GitHub sources from the '${co}' organization.`}function ro(e){return typeof e==`string`&&e.startsWith(`./`)}function io(e){return e.source===`file`||e.source===`directory`}var U,ao,oo,so,co,W,G,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,K,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo=e((()=>{T(),$a(),Ot(),E(),U=new Set([`claude-code-marketplace`,`claude-code-plugins`,`claude-plugins-official`,`anthropic-marketplace`,`anthropic-plugins`,`agent-skills`,`life-sciences`,`knowledge-work-plugins`]),ao=new Set([`knowledge-work-plugins`]),oo=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,so=/[^\u0020-\u007E]/,co=`anthropics`,W=w(()=>v().startsWith(`./`)),G=w(()=>W().endsWith(`.json`)),lo=w(()=>y([W().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB file path must end with .mcpb or .dxt`}).describe(`Path to MCPB file relative to plugin root`),v().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),uo=w(()=>W().endsWith(`.md`)),fo=w(()=>y([uo(),W()])),po=w(()=>v().min(1,`Marketplace must have a name`).refine(e=>!e.includes(` `),{message:`Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")`}).refine(e=>!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`..`)&&e!==`.`,{message:`Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."`}).refine(e=>!to(e),{message:`Marketplace name impersonates an official marketplace`}).refine(e=>e.toLowerCase()!==`inline`,{message:`Marketplace name "inline" is reserved for --plugin-dir session plugins`}).refine(e=>e.toLowerCase()!==`builtin`,{message:`Marketplace name "builtin" is reserved for built-in plugins`})),mo=w(()=>g({name:v().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:v().optional().describe(`Contact email for support or feedback`),url:v().optional().describe(`Website, GitHub profile, or organization URL`)})),ho=w(()=>g({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier for the plugin, used for namespacing (prefer kebab-case)`),version:v().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:v().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:mo().optional().describe(`Information about the plugin creator or maintainer`),homepage:v().url().optional().describe(`Plugin homepage or documentation URL`),repository:v().optional().describe(`Source code repository URL`),license:v().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:S(v()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:S(Vo()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),go=w(()=>g({description:v().optional().describe(`Brief, user-facing explanation of what these hooks provide`),hooks:ue(()=>H()).describe(`The hooks provided by the plugin, in the same format as the one used for settings`)})),_o=w(()=>g({hooks:y([G().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),ue(()=>H()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`),S(y([G().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),ue(()=>H()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`)]))])})),vo=w(()=>g({source:fo().optional().describe(`Path to command markdown file, relative to plugin root`),content:v().optional().describe(`Inline markdown content for the command`),description:v().optional().describe(`Command description override`),argumentHint:v().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:v().optional().describe(`Default model for this command`),allowedTools:S(v()).optional().describe(`Tools allowed when command runs`)}).refine(e=>e.source&&!e.content||!e.source&&e.content,{message:`Command must have either "source" (file path) or "content" (inline markdown), but not both`})),yo=w(()=>g({commands:y([fo().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`),S(fo().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional command files or skill directories`),C(v(),vo()).describe(`Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")`)])})),bo=w(()=>g({agents:y([uo().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),S(uo().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional agent files`)])})),xo=w(()=>g({skills:y([W().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),S(W().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional skill directories`)])})),So=w(()=>g({outputStyles:y([W().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`),S(W().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional output styles directories or files`)])})),Co=w(()=>v().min(1)),wo=w(()=>v().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),To=w(()=>g({mcpServers:y([G().describe(`MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)`),lo().describe(`Path or URL to MCPB file containing MCP server configuration`),C(v(),jt()).describe(`MCP server configurations keyed by server name`),S(y([G().describe(`Path to MCP servers configuration file`),lo().describe(`Path or URL to MCPB file`),C(v(),jt()).describe(`Inline MCP server configurations`)])).describe(`Array of MCP server configurations (paths, MCPB files, or inline definitions)`)])})),Eo=w(()=>g({type:x([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:v().describe(`Human-readable label shown in the config dialog`),description:v().describe(`Help text shown beneath the field in the config dialog`),required:b().optional().describe(`If true, validation fails when this field is empty`),default:y([v(),_(),b(),S(v())]).optional().describe(`Default value used when the user provides nothing`),multiple:b().optional().describe(`For string type: allow an array of strings`),sensitive:b().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:_().optional().describe(`Minimum value (number type only)`),max:_().optional().describe(`Maximum value (number type only)`)}).strict()),Do=w(()=>g({userConfig:C(v().regex(/^[A-Za-z_]\w*$/,`Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks`),Eo()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Note: sensitive values share a single keychain entry with OAuth tokens — keep secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),Oo=w(()=>g({channels:S(g({server:v().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:v().optional().describe(`Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.`),userConfig:C(v(),Eo()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe(`Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.`)})),ko=w(()=>le({command:v().min(1).refine(e=>!(e.includes(` `)&&!e.startsWith(`/`)),{message:`Command should not contain spaces. Use args array for arguments.`}).describe(`Command to execute the LSP server (e.g., "typescript-language-server")`),args:S(Co()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:C(wo(),Co()).refine(e=>Object.keys(e).length>0,{message:`extensionToLanguage must have at least one mapping`}).describe(`Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping.`),transport:x([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:C(v(),v()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:ce().optional().describe(`Initialization options passed to the server during initialization`),settings:ce().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:v().optional().describe(`Workspace folder path to use for the server`),startupTimeout:_().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:_().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:b().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:_().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),Ao=w(()=>g({lspServers:y([G().describe(`Path to .lsp.json configuration file relative to plugin root`),C(v(),ko()).describe(`LSP server configurations keyed by server name`),S(y([G().describe(`Path to LSP configuration file`),C(v(),ko()).describe(`Inline LSP server configurations`)])).describe(`Array of LSP server configurations (paths or inline definitions)`)])})),jo=w(()=>v().refine(e=>!e.includes(`..`)&&!e.includes(`//`),`Package name cannot contain path traversal patterns`).refine(e=>/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/.test(e)||/^[a-z0-9][a-z0-9-._]*$/.test(e),`Invalid npm package name format`)),Mo=w(()=>g({settings:C(v(),ce()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),No=w(()=>g({...ho().shape,..._o().partial().shape,...yo().partial().shape,...bo().partial().shape,...xo().partial().shape,...So().partial().shape,...Oo().partial().shape,...To().partial().shape,...Ao().partial().shape,...Mo().partial().shape,...Do().partial().shape})),Po=w(()=>_e(`source`,[g({source:h(`url`),url:v().url().describe(`Direct URL to marketplace.json file`),headers:C(v(),v()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),g({source:h(`github`),repo:v().describe(`GitHub repository in owner/repo format`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:v().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(v()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),g({source:h(`git`),url:v().describe(`Full git repository URL`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:v().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(v()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),g({source:h(`npm`),package:jo().describe(`NPM package containing marketplace.json`)}),g({source:h(`file`),path:v().describe(`Local file path to marketplace.json`)}),g({source:h(`directory`),path:v().describe(`Local directory containing .claude-plugin/marketplace.json`)}),g({source:h(`hostPattern`),hostPattern:v().describe(`Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").`)}),g({source:h(`pathPattern`),pathPattern:v().describe(`Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.`)}),g({source:h(`settings`),name:po().refine(e=>!U.has(e.toLowerCase()),{message:`Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false.`}).describe(`Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.`),plugins:S(Lo()).describe(`Plugin entries declared inline in settings.json`),owner:mo().optional()}).describe(`Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).`)])),Fo=w(()=>v().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Io=w(()=>y([W().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),g({source:h(`npm`),package:jo().or(v()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:v().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:v().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),g({source:h(`pip`),package:v().describe(`Python package name as it appears on PyPI`),version:v().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:v().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),g({source:h(`url`),url:v().describe(`Full git repository URL (https:// or git@)`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}),g({source:h(`github`),repo:v().describe(`GitHub repository in owner/repo format`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}),g({source:h(`git-subdir`),url:v().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:v().min(1).describe(`Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}).describe(`Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.`)])),Lo=w(()=>g({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Plugin name as it appears in the target repository`),source:Io().describe(`Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.`),description:v().optional(),version:v().optional(),strict:b().optional()}).refine(e=>typeof e.source!=`string`,{message:`Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.`})),Ro=w(()=>No().partial().extend({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier matching the plugin name`),source:Io().describe(`Where to fetch the plugin from`),category:v().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:S(v()).optional().describe(`Tags for searchability and discovery`),strict:b().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),zo=w(()=>g({name:po(),owner:mo().describe(`Marketplace maintainer or curator information`),plugins:S(Ro()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:b().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:g({pluginRoot:v().optional().describe(`Base path for relative plugin sources`),version:v().optional().describe(`Marketplace version`),description:v().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:S(v()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),K=w(()=>v().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,`Plugin ID must be in format: plugin@marketplace`)),Bo=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,Vo=w(()=>y([v().regex(Bo,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),g({name:v().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:v().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),w(()=>y([K(),g({id:K().describe(`Plugin identifier (e.g., "formatter@tools")`),version:v().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:b().optional().describe(`If true, cannot be disabled`),config:C(v(),ce()).optional().describe(`Plugin-specific configuration`)})])),Ho=w(()=>g({version:v().describe(`Currently installed version`),installedAt:v().describe(`ISO 8601 timestamp of installation`),lastUpdated:v().optional().describe(`ISO 8601 timestamp of last update`),installPath:v().describe(`Absolute path to the installed plugin directory`),gitCommitSha:v().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Uo=w(()=>g({version:h(1).describe(`Schema version 1`),plugins:C(K(),Ho()).describe(`Map of plugin IDs to their installation metadata`)})),Wo=w(()=>x([`managed`,`user`,`project`,`local`])),Go=w(()=>g({scope:Wo().describe(`Installation scope`),projectPath:v().optional().describe(`Project path (required for project/local scopes)`),installPath:v().describe(`Absolute path to the versioned plugin directory`),version:v().optional().describe(`Currently installed version`),installedAt:v().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:v().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:v().optional().describe(`Git commit SHA for git-based plugins`)})),Ko=w(()=>g({version:h(2).describe(`Schema version 2`),plugins:C(K(),S(Go())).describe(`Map of plugin IDs to arrays of installation entries`)})),w(()=>y([Uo(),Ko()])),qo=w(()=>g({source:Po().describe(`Where to fetch the marketplace from`),installLocation:v().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:v().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:b().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Jo=w(()=>C(v(),qo()))}));function Xo(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return e.startsWith(Zo)&&(t=t.replace(/_+/g,`_`).replace(/^_|_$/g,``)),t}var Zo,Qo=e((()=>{Zo=`claude.ai `}));function $o(e){let[t,n,...r]=e.split(`__`);return t!==`mcp`||!n?null:{serverName:n,toolName:r.length>0?r.join(`__`):void 0}}function es(e){return`mcp__${Xo(e)}__`}function ts(e,t){return`${es(e)}${Xo(t)}`}function ns(e){return e.mcpInfo?ts(e.mcpInfo.serverName,e.mcpInfo.toolName):e.name}function rs(e,t){let n=`mcp__${Xo(t)}__`;return e.replace(n,``)}function is(e){let t=e.replace(/\s*\(MCP\)\s*$/,``);t=t.trim();let n=t.indexOf(` - `);return n===-1?t:t.substring(n+3).trim()}var as=e((()=>{Qo()})),os,ss,cs,ls,us=e((()=>{os=`Agent`,ss=`Task`,cs=`verification`,ls=new Set([`Explore`,`Plan`])})),ds,fs=e((()=>{ds=`TaskOutput`})),ps,ms,hs=e((()=>{ps=`TaskStop`,ms=`
|
|
12
|
+
`)}function Ti(e){return e.match(/^\s*\d+[\u2192\t](.*)$/)?.[1]??e}function Ei(e){try{return k().isDirEmptySync(e)}catch(e){return at(e)}}function Di(e){let{content:t}=li.readFile(e);return t}function Oi(e,t,n={encoding:`utf-8`}){let r=k(),i=e;try{let t=r.readlinkSync(e);i=Xt(t)?t:F(N(e),t),D(`Writing through symlink: ${e} -> ${i}`)}catch{}let a=`${i}.tmp.${process.pid}.${Date.now()}`,o,s=!1;try{o=r.statSync(i).mode,s=!0,D(`Preserving file permissions: ${o.toString(8)}`)}catch(e){if(!at(e))throw e;n.mode!==void 0&&(o=n.mode,D(`Setting permissions for new file: ${o.toString(8)}`))}try{D(`Writing to temp file: ${a}`);let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),rn(a,t,e),D(`Temp file written successfully, size: ${t.length} bytes`),s&&o!==void 0&&(tn(a,o),D(`Applied original permissions to temp file`)),D(`Renaming ${a} to ${i}`),r.renameSync(a,i),D(`File ${i} written atomically`)}catch(e){D(`Failed to write file atomically: ${e}`,{level:`error`}),Pt(`tengu_atomic_write_error`,{});try{D(`Cleaning up temp file: ${a}`),r.unlinkSync(a)}catch(e){D(`Failed to clean up temp file: ${e}`)}D(`Falling back to non-atomic write for ${i}`);try{let e={encoding:n.encoding,flush:!0};!s&&n.mode!==void 0&&(e.mode=n.mode),rn(i,t,e),D(`File ${i} written successfully with non-atomic fallback`)}catch(e){throw D(`Non-atomic write also failed: ${e}`),e}}}function ki(e,t=Mi){try{return k().statSync(e).size<=t}catch{return!1}}function Ai(e){let t=Zt(e);return t=t.replace(/\\/g,`/`),j()===`windows`&&(t=t.toLowerCase()),t}function ji(e,t){return Ai(e)===Ai(t)}var Mi,Ni,Pi=e((()=>{Nt(),rt(),pt(),ct(),Jr(),ui(),O(),xt(),Zn(),wt(),Mi=.25*1024*1024,Ni=`Note: your current working directory is`}));async function Fi(e,t){let{code:n}=await bt(`git`,[`check-ignore`,e],{preserveOutputOnError:!1,cwd:t});return n===0}function Ii(){return P(Kt(),`.config`,`git`,`ignore`)}async function Li(e,t=it()){try{if(!await vt(t))return;let n=`**/${e}`;if(await Fi(e.endsWith(`/`)?`${e}sample-file.txt`:e,t))return;let r=Ii();await on(N(r),{recursive:!0});try{if((await sn(r,{encoding:`utf-8`})).includes(n))return;await an(r,`\n${n}\n`)}catch(e){if(st(e)===`ENOENT`)await un(r,`${n}\n`,`utf-8`);else throw e}}catch(e){A(e)}}var Ri=e((()=>{rt(),ct(),yt(),_t(),xt()}));function zi(e){switch(e){case`userSettings`:return`user`;case`projectSettings`:return`project`;case`localSettings`:return`project, gitignored`;case`flagSettings`:return`cli flag`;case`policySettings`:return`managed`}}function Bi(e){switch(e){case`userSettings`:return`User`;case`projectSettings`:return`Project`;case`localSettings`:return`Local`;case`flagSettings`:return`Flag`;case`policySettings`:return`Managed`;case`plugin`:return`Plugin`;case`built-in`:return`Built-in`}}function Vi(e){switch(e){case`userSettings`:return`user settings`;case`projectSettings`:return`shared project settings`;case`localSettings`:return`project local settings`;case`flagSettings`:return`command line arguments`;case`policySettings`:return`enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`command configuration`;case`session`:return`current session`}}function Hi(e){switch(e){case`userSettings`:return`User settings`;case`projectSettings`:return`Shared project settings`;case`localSettings`:return`Project local settings`;case`flagSettings`:return`Command line arguments`;case`policySettings`:return`Enterprise managed settings`;case`cliArg`:return`CLI argument`;case`command`:return`Command configuration`;case`session`:return`Current session`}}function Ui(e){if(e===``)return[];let t=e.split(`,`).map(e=>e.trim()),n=[];for(let e of t)switch(e){case`user`:n.push(`userSettings`);break;case`project`:n.push(`projectSettings`);break;case`local`:n.push(`localSettings`);break;default:throw Error(`Invalid setting source: ${e}. Valid options are: user, project, local`)}return n}function Wi(){let e=$e(),t=new Set(e);return t.add(`policySettings`),t.add(`flagSettings`),Array.from(t)}function Gi(e){return Wi().includes(e)}var Ki,qi,Ji,Yi=e((()=>{Ae(),Ki=[`userSettings`,`projectSettings`,`localSettings`,`flagSettings`,`policySettings`],qi=[`localSettings`,`projectSettings`,`userSettings`],Ji=`https://json.schemastore.org/claude-code-settings.json`}));function Xi(e){$i.set(e,Date.now())}function Zi(e,t){let n=$i.get(e);return n!==void 0&&Date.now()-n<t?($i.delete(e),!0):!1}function Qi(){$i.clear()}var $i,ea=e((()=>{$i=new Map})),ta,na,ra=e((()=>{d(),wt(),ta=u(()=>{switch(j()){case`macos`:return`/Library/Application Support/ClaudeCode`;case`windows`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/workmate`}}),na=u(()=>P(ta(),`managed-settings.d`))})),ia,aa,oa,sa=e((()=>{T(),E(),ia=w(()=>g({allowedDomains:S(v()).optional(),allowManagedDomainsOnly:b().optional().describe(`When true (and set in managed settings), only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources.`),allowUnixSockets:S(v()).optional().describe(`macOS only: Unix socket paths to allow. Ignored on Linux (seccomp cannot filter by path).`),allowAllUnixSockets:b().optional().describe(`If true, allow all Unix sockets (disables blocking on both platforms).`),allowLocalBinding:b().optional(),httpProxyPort:_().optional(),socksProxyPort:_().optional()}).optional()),aa=w(()=>g({allowWrite:S(v()).optional().describe(`Additional paths to allow writing within the sandbox. Merged with paths from Edit(...) allow permission rules.`),denyWrite:S(v()).optional().describe(`Additional paths to deny writing within the sandbox. Merged with paths from Edit(...) deny permission rules.`),denyRead:S(v()).optional().describe(`Additional paths to deny reading within the sandbox. Merged with paths from Read(...) deny permission rules.`),allowRead:S(v()).optional().describe(`Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths.`),allowManagedReadPathsOnly:b().optional().describe(`When true (set in managed settings), only allowRead paths from policySettings are used.`)}).optional()),oa=w(()=>g({enabled:b().optional(),failIfUnavailable:b().optional().describe(`Exit with an error at startup if sandbox.enabled is true but the sandbox cannot start (missing dependencies, unsupported platform, or platform not in enabledPlatforms). When false (default), a warning is shown and commands run unsandboxed. Intended for managed-settings deployments that require sandboxing as a hard gate.`),autoAllowBashIfSandboxed:b().optional(),allowUnsandboxedCommands:b().optional().describe(`Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true.`),network:ia(),filesystem:aa(),ignoreViolations:C(v(),S(v())).optional(),enableWeakerNestedSandbox:b().optional(),enableWeakerNetworkIsolation:b().optional().describe(`macOS only: Allow access to com.apple.trustd.agent in the sandbox. Needed for Go-based CLI tools (gh, gcloud, terraform, etc.) to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. **Reduces security** — opens a potential data exfiltration vector through the trustd service. Default: false`),excludedCommands:S(v()).optional(),ripgrep:g({command:v(),args:S(v()).optional()}).optional().describe(`Custom ripgrep configuration for bundled ripgrep support`)}).passthrough())}));async function B(e){try{return!!await St(e)}catch{return!1}}function ca(){return process.env.__CFBundleIdentifier===`com.conductor.app`}function la(){if(process.env.CURSOR_TRACE_ID||process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`cursor`))return`cursor`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`windsurf`))return`windsurf`;if(process.env.VSCODE_GIT_ASKPASS_MAIN?.includes(`antigravity`))return`antigravity`;let e=process.env.__CFBundleIdentifier?.toLowerCase();if(e?.includes(`vscodium`))return`codium`;if(e?.includes(`windsurf`))return`windsurf`;if(e?.includes(`com.google.android.studio`))return`androidstudio`;if(e){for(let t of va)if(e.includes(t))return t}if(process.env.VisualStudioVersion)return`visualstudio`;if(process.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`)return process.platform,`pycharm`;if(process.env.TERM===`xterm-ghostty`)return`ghostty`;if(process.env.TERM?.includes(`kitty`))return`kitty`;if(process.env.TERM_PROGRAM)return process.env.TERM_PROGRAM;if(process.env.TMUX)return`tmux`;if(process.env.STY)return`screen`;if(process.env.KONSOLE_VERSION)return`konsole`;if(process.env.GNOME_TERMINAL_SERVICE)return`gnome-terminal`;if(process.env.XTERM_VERSION)return`xterm`;if(process.env.VTE_VERSION)return`vte-based`;if(process.env.TERMINATOR_UUID)return`terminator`;if(process.env.KITTY_WINDOW_ID)return`kitty`;if(process.env.ALACRITTY_LOG)return`alacritty`;if(process.env.TILIX_ID)return`tilix`;if(process.env.WT_SESSION)return`windows-terminal`;if(process.env.SESSIONNAME&&process.env.TERM===`cygwin`)return`cygwin`;if(process.env.MSYSTEM)return process.env.MSYSTEM.toLowerCase();if(process.env.ConEmuANSI||process.env.ConEmuPID||process.env.ConEmuTask)return`conemu`;if(process.env.WSL_DISTRO_NAME)return`wsl-${process.env.WSL_DISTRO_NAME}`;if(ua())return`ssh-session`;if(process.env.TERM){let e=process.env.TERM;return e.includes(`alacritty`)?`alacritty`:e.includes(`rxvt`)?`rxvt`:e.includes(`termite`)?`termite`:process.env.TERM}return process.stdout.isTTY?null:`non-interactive`}function ua(){return!!(process.env.SSH_CONNECTION||process.env.SSH_CLIENT||process.env.SSH_TTY)}function da(){let e=process.env.CLAUDE_CODE_HOST_PLATFORM;return e===`win32`||e===`darwin`||e===`linux`?e:V.platform}var fa,pa,ma,ha,ga,_a,va,ya,V,ba=e((()=>{d(),Rt(),Bt(),ne(),Gt(),O(),Ct(),fa=u(()=>{if(k().existsSync(P(p(),`.config.json`)))return P(p(),`.config.json`);let e=`.workmate${Lt()}.json`;return P(process.env.WORKMATE_CONFIG_DIR||Kt(),e)}),pa=u(async()=>{try{let{default:e}=await import(`./axios-BHBm_hhU.js`);return await e.head(`http://1.1.1.1`,{signal:AbortSignal.timeout(1e3)}),!0}catch{return!1}}),ma=u(async()=>{let e=[];return await B(`npm`)&&e.push(`npm`),await B(`yarn`)&&e.push(`yarn`),await B(`pnpm`)&&e.push(`pnpm`),e}),ha=u(async()=>{let e=[];return await B(`bun`)&&e.push(`bun`),await B(`deno`)&&e.push(`deno`),await B(`node`)&&e.push(`node`),e}),ga=u(()=>{try{return k().existsSync(`/proc/sys/fs/binfmt_misc/WSLInterop`)}catch{return!1}}),_a=u(()=>{try{if(!ga())return!1;let{cmd:e}=Vt(`npm`,[]);return e.startsWith(`/mnt/c/`)}catch{return!1}}),va=[`pycharm`,`intellij`,`webstorm`,`phpstorm`,`rubymine`,`clion`,`goland`,`rider`,`datagrip`,`appcode`,`dataspell`,`aqua`,`gateway`,`fleet`,`jetbrains`,`androidstudio`],ya=u(()=>{if(m(process.env.CODESPACES))return`codespaces`;if(process.env.GITPOD_WORKSPACE_ID)return`gitpod`;if(process.env.REPL_ID||process.env.REPL_SLUG)return`replit`;if(process.env.PROJECT_DOMAIN)return`glitch`;if(m(process.env.VERCEL))return`vercel`;if(process.env.RAILWAY_ENVIRONMENT_NAME||process.env.RAILWAY_SERVICE_NAME)return`railway`;if(m(process.env.RENDER))return`render`;if(m(process.env.NETLIFY))return`netlify`;if(process.env.DYNO)return`heroku`;if(process.env.FLY_APP_NAME||process.env.FLY_MACHINE_ID)return`fly.io`;if(m(process.env.CF_PAGES))return`cloudflare-pages`;if(process.env.DENO_DEPLOYMENT_ID)return`deno-deploy`;if(process.env.AWS_LAMBDA_FUNCTION_NAME)return`aws-lambda`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_FARGATE`)return`aws-fargate`;if(process.env.AWS_EXECUTION_ENV===`AWS_ECS_EC2`)return`aws-ecs`;try{if(k().readFileSync(`/sys/hypervisor/uuid`,{encoding:`utf8`}).trim().toLowerCase().startsWith(`ec2`))return`aws-ec2`}catch{}if(process.env.K_SERVICE)return`gcp-cloud-run`;if(process.env.GOOGLE_CLOUD_PROJECT)return`gcp`;if(process.env.WEBSITE_SITE_NAME||process.env.WEBSITE_SKU)return`azure-app-service`;if(process.env.AZURE_FUNCTIONS_ENVIRONMENT)return`azure-functions`;if(process.env.APP_URL?.includes(`ondigitalocean.app`))return`digitalocean-app-platform`;if(process.env.SPACE_CREATOR_USER_ID)return`huggingface-spaces`;if(m(process.env.GITHUB_ACTIONS))return`github-actions`;if(m(process.env.GITLAB_CI))return`gitlab-ci`;if(process.env.CIRCLECI)return`circleci`;if(process.env.BUILDKITE)return`buildkite`;if(m(process.env.CI))return`ci`;if(process.env.KUBERNETES_SERVICE_HOST)return`kubernetes`;try{if(k().existsSync(`/.dockerenv`))return`docker`}catch{}return V.platform===`darwin`?`unknown-darwin`:V.platform===`linux`?`unknown-linux`:V.platform===`win32`?`unknown-win32`:`unknown`}),V={hasInternetAccess:pa,isCI:m(process.env.CI),platform:[`win32`,`darwin`].includes(process.platform)?process.platform:`linux`,arch:process.arch,nodeVersion:process.version,terminal:la(),isSSH:ua,getPackageManagers:ma,getRuntimes:ha,isRunningWithBun:u(zt),isWslEnvironment:ga,isNpmFromWindowsPath:_a,isConductor:ca,detectDeploymentEnvironment:ya}})),xa,Sa,Ca=e((()=>{ba(),xa=V.platform===`darwin`?`⏺`:`●`,Sa=`·✔︎·`})),wa,Ta,Ea,Da=e((()=>{wa=[`acceptEdits`,`bypassPermissions`,`default`,`dontAsk`,`plan`],Ta=[...wa,`auto`],Ea=Ta}));function Oa(e){return!0}function ka(e){return Ra[e]??Ra.default}function Aa(e){return ka(e).external}function ja(e){return Ea.includes(e)?e:`default`}function Ma(e){return ka(e).title}function Na(e){return e==="default"||e===void 0}function Pa(e){return ka(e).shortTitle}function Fa(e){return ka(e).symbol}function Ia(e){return ka(e).color}var La,Ra,za=e((()=>{T(),Ca(),Da(),E(),w(()=>fe.enum(Ea)),La=w(()=>fe.enum(wa)),Ra={default:{title:`Default`,shortTitle:`Default`,symbol:``,color:`text`,external:`default`},plan:{title:`Plan Mode`,shortTitle:`Plan`,symbol:`⏸`,color:`planMode`,external:`plan`},acceptEdits:{title:`Accept edits`,shortTitle:`Accept`,symbol:`⏵⏵`,color:`autoAccept`,external:`acceptEdits`},bypassPermissions:{title:`Bypass`,shortTitle:`Bypass`,symbol:`⏵⏵`,color:`error`,external:`bypassPermissions`},dontAsk:{title:`Don't Ask`,shortTitle:`DontAsk`,symbol:`⏵⏵`,color:`error`,external:`dontAsk`},auto:{title:`Auto`,shortTitle:`Auto`,symbol:`⏵⏵`,color:`warning`,external:`default`}}})),Ba=e((()=>{})),Va,Ha=e((()=>{Ba(),Va=`PreToolUse.PostToolUse.PostToolUseFailure.Notification.UserPromptSubmit.SessionStart.SessionEnd.Stop.StopFailure.SubagentStart.SubagentStop.PreCompact.PostCompact.PermissionRequest.PermissionDenied.Setup.TeammateIdle.TaskCreated.TaskCompleted.Elicitation.ElicitationResult.ConfigChange.WorktreeCreate.WorktreeRemove.InstructionsLoaded.CwdChanged.FileChanged`.split(`.`)})),Ua=e((()=>{})),Wa=e((()=>{})),Ga=e((()=>{Ha(),Ua(),Wa()})),Ka,qa,Ja=e((()=>{Ka=[`bash`,`powershell`],qa=`bash`}));function Ya(){return{BashCommandHookSchema:g({type:h(`command`).describe(`Shell command hook type`),command:v().describe(`Shell command to execute`),if:Xa(),shell:x(Ka).optional().describe(`Shell interpreter. 'bash' uses your $SHELL (bash/zsh/sh); 'powershell' uses pwsh. Defaults to bash.`),timeout:_().positive().optional().describe(`Timeout in seconds for this specific command`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`),async:b().optional().describe(`If true, hook runs in background without blocking`),asyncRewake:b().optional().describe(`If true, hook runs in background and wakes the model on exit code 2 (blocking error). Implies async.`)}),PromptHookSchema:g({type:h(`prompt`).describe(`LLM prompt hook type`),prompt:v().describe(`Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for this specific prompt evaluation`),model:v().optional().describe(`Model to use for this prompt hook (e.g., "claude-sonnet-4-6"). If not specified, uses the default small fast model.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)}),HttpHookSchema:g({type:h(`http`).describe(`HTTP hook type`),url:v().url().describe(`URL to POST the hook input JSON to`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for this specific request`),headers:C(v(),v()).optional().describe('Additional headers to include in the request. Values may reference environment variables using $VAR_NAME or ${VAR_NAME} syntax (e.g., "Authorization": "Bearer $MY_TOKEN"). Only variables listed in allowedEnvVars will be interpolated.'),allowedEnvVars:S(v()).optional().describe(`Explicit list of environment variable names that may be interpolated in header values. Only variables listed here will be resolved; all other $VAR references are left as empty strings. Required for env var interpolation to work.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)}),AgentHookSchema:g({type:h(`agent`).describe(`Agentic verifier hook type`),prompt:v().describe(`Prompt describing what to verify (e.g. "Verify that unit tests ran and passed."). Use $ARGUMENTS placeholder for hook input JSON.`),if:Xa(),timeout:_().positive().optional().describe(`Timeout in seconds for agent execution (default 60)`),model:v().optional().describe(`Model to use for this agent hook (e.g., "claude-sonnet-4-6"). If not specified, uses Haiku.`),statusMessage:v().optional().describe(`Custom status message to display in spinner while hook runs`),once:b().optional().describe(`If true, hook runs once and is removed after execution`)})}}var Xa,Za,Qa,H,$a=e((()=>{Ga(),T(),E(),Ja(),Xa=w(()=>v().optional().describe(`Permission rule syntax to filter when this hook runs (e.g., "Bash(git *)"). Only runs if the tool call matches the pattern. Avoids spawning hooks for non-matching commands.`)),Za=w(()=>{let{BashCommandHookSchema:e,PromptHookSchema:t,AgentHookSchema:n,HttpHookSchema:r}=Ya();return _e(`type`,[e,t,n,r])}),Qa=w(()=>g({matcher:v().optional().describe(`String pattern to match (e.g. tool names like "Write")`),hooks:S(Za()).describe(`List of hooks to execute when the matcher matches`)})),H=w(()=>pe(x(Va),S(Qa())))}));function eo(e,t){let n=e.toLowerCase();return t.autoUpdate??(U.has(n)&&!ao.has(n))}function to(e){return U.has(e.toLowerCase())?!1:so.test(e)?!0:oo.test(e)}function no(e,t){let n=e.toLowerCase();if(!U.has(n))return null;if(t.source===`github`)return(t.repo||``).toLowerCase().startsWith(`anthropics/`)?null:`The name '${e}' is reserved for official marketplaces. Only repositories from 'github.com/${co}/' can use this name.`;if(t.source===`git`&&t.url){let n=t.url.toLowerCase(),r=n.includes(`github.com/anthropics/`),i=n.includes(`git@github.com:anthropics/`);return r||i?null:`The name '${e}' is reserved for official marketplaces. Only repositories from 'github.com/${co}/' can use this name.`}return`The name '${e}' is reserved for official marketplaces and can only be used with GitHub sources from the '${co}' organization.`}function ro(e){return typeof e==`string`&&e.startsWith(`./`)}function io(e){return e.source===`file`||e.source===`directory`}var U,ao,oo,so,co,W,G,lo,uo,fo,po,mo,ho,go,_o,vo,yo,bo,xo,So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro,zo,K,Bo,Vo,Ho,Uo,Wo,Go,Ko,qo,Jo,Yo=e((()=>{T(),$a(),Ot(),E(),U=new Set([`claude-code-marketplace`,`claude-code-plugins`,`claude-plugins-official`,`anthropic-marketplace`,`anthropic-plugins`,`agent-skills`,`life-sciences`,`knowledge-work-plugins`]),ao=new Set([`knowledge-work-plugins`]),oo=/(?:official[^a-z0-9]*(anthropic|claude)|(?:anthropic|claude)[^a-z0-9]*official|^(?:anthropic|claude)[^a-z0-9]*(marketplace|plugins|official))/i,so=/[^\u0020-\u007E]/,co=`anthropics`,W=w(()=>v().startsWith(`./`)),G=w(()=>W().endsWith(`.json`)),lo=w(()=>y([W().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB file path must end with .mcpb or .dxt`}).describe(`Path to MCPB file relative to plugin root`),v().url().refine(e=>e.endsWith(`.mcpb`)||e.endsWith(`.dxt`),{message:`MCPB URL must end with .mcpb or .dxt`}).describe(`URL to MCPB file`)])),uo=w(()=>W().endsWith(`.md`)),fo=w(()=>y([uo(),W()])),po=w(()=>v().min(1,`Marketplace must have a name`).refine(e=>!e.includes(` `),{message:`Marketplace name cannot contain spaces. Use kebab-case (e.g., "my-marketplace")`}).refine(e=>!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`..`)&&e!==`.`,{message:`Marketplace name cannot contain path separators (/ or \\), ".." sequences, or be "."`}).refine(e=>!to(e),{message:`Marketplace name impersonates an official marketplace`}).refine(e=>e.toLowerCase()!==`inline`,{message:`Marketplace name "inline" is reserved for --plugin-dir session plugins`}).refine(e=>e.toLowerCase()!==`builtin`,{message:`Marketplace name "builtin" is reserved for built-in plugins`})),mo=w(()=>g({name:v().min(1,`Author name cannot be empty`).describe(`Display name of the plugin author or organization`),email:v().optional().describe(`Contact email for support or feedback`),url:v().optional().describe(`Website, GitHub profile, or organization URL`)})),ho=w(()=>g({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier for the plugin, used for namespacing (prefer kebab-case)`),version:v().optional().describe(`Semantic version (e.g., 1.2.3) following semver.org specification`),description:v().optional().describe(`Brief, user-facing explanation of what the plugin provides`),author:mo().optional().describe(`Information about the plugin creator or maintainer`),homepage:v().url().optional().describe(`Plugin homepage or documentation URL`),repository:v().optional().describe(`Source code repository URL`),license:v().optional().describe(`SPDX license identifier (e.g., MIT, Apache-2.0)`),keywords:S(v()).optional().describe(`Tags for plugin discovery and categorization`),dependencies:S(Vo()).optional().describe(`Plugins that must be enabled for this plugin to function. Bare names (no "@marketplace") are resolved against the declaring plugin's own marketplace.`)})),go=w(()=>g({description:v().optional().describe(`Brief, user-facing explanation of what these hooks provide`),hooks:ue(()=>H()).describe(`The hooks provided by the plugin, in the same format as the one used for settings`)})),_o=w(()=>g({hooks:y([G().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),ue(()=>H()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`),S(y([G().describe(`Path to file with additional hooks (in addition to those in hooks/hooks.json, if it exists), relative to the plugin root`),ue(()=>H()).describe(`Additional hooks (in addition to those in hooks/hooks.json, if it exists)`)]))])})),vo=w(()=>g({source:fo().optional().describe(`Path to command markdown file, relative to plugin root`),content:v().optional().describe(`Inline markdown content for the command`),description:v().optional().describe(`Command description override`),argumentHint:v().optional().describe(`Hint for command arguments (e.g., "[file]")`),model:v().optional().describe(`Default model for this command`),allowedTools:S(v()).optional().describe(`Tools allowed when command runs`)}).refine(e=>e.source&&!e.content||!e.source&&e.content,{message:`Command must have either "source" (file path) or "content" (inline markdown), but not both`})),yo=w(()=>g({commands:y([fo().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`),S(fo().describe(`Path to additional command file or skill directory (in addition to those in the commands/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional command files or skill directories`),C(v(),vo()).describe(`Object mapping of command names to their metadata and source files. Command name becomes the slash command name (e.g., "about" → "/plugin:about")`)])})),bo=w(()=>g({agents:y([uo().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`),S(uo().describe(`Path to additional agent file (in addition to those in the agents/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional agent files`)])})),xo=w(()=>g({skills:y([W().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`),S(W().describe(`Path to additional skill directory (in addition to those in the skills/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional skill directories`)])})),So=w(()=>g({outputStyles:y([W().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`),S(W().describe(`Path to additional output styles directory or file (in addition to those in the output-styles/ directory, if it exists), relative to the plugin root`)).describe(`List of paths to additional output styles directories or files`)])})),Co=w(()=>v().min(1)),wo=w(()=>v().min(2).refine(e=>e.startsWith(`.`),{message:`File extensions must start with dot (e.g., ".ts", not "ts")`})),To=w(()=>g({mcpServers:y([G().describe(`MCP servers to include in the plugin (in addition to those in the .mcp.json file, if it exists)`),lo().describe(`Path or URL to MCPB file containing MCP server configuration`),C(v(),jt()).describe(`MCP server configurations keyed by server name`),S(y([G().describe(`Path to MCP servers configuration file`),lo().describe(`Path or URL to MCPB file`),C(v(),jt()).describe(`Inline MCP server configurations`)])).describe(`Array of MCP server configurations (paths, MCPB files, or inline definitions)`)])})),Eo=w(()=>g({type:x([`string`,`number`,`boolean`,`directory`,`file`]).describe(`Type of the configuration value`),title:v().describe(`Human-readable label shown in the config dialog`),description:v().describe(`Help text shown beneath the field in the config dialog`),required:b().optional().describe(`If true, validation fails when this field is empty`),default:y([v(),_(),b(),S(v())]).optional().describe(`Default value used when the user provides nothing`),multiple:b().optional().describe(`For string type: allow an array of strings`),sensitive:b().optional().describe(`If true, masks dialog input and stores value in secure storage (keychain/credentials file) instead of settings.json`),min:_().optional().describe(`Minimum value (number type only)`),max:_().optional().describe(`Maximum value (number type only)`)}).strict()),Do=w(()=>g({userConfig:C(v().regex(/^[A-Za-z_]\w*$/,`Option keys must be valid identifiers (letters, digits, underscore; no leading digit) — they become CLAUDE_PLUGIN_OPTION_<KEY> env vars in hooks`),Eo()).optional().describe("User-configurable values this plugin needs. Prompted at enable time. Non-sensitive values saved to settings.json; sensitive values to secure storage (macOS keychain or .credentials.json). Available as ${user_config.KEY} in MCP/LSP server config, hook commands, and (non-sensitive only) skill/agent content. Note: sensitive values share a single keychain entry with OAuth tokens — keep secret counts small to stay under the ~2KB stdin-safe limit (see INC-3028).")})),Oo=w(()=>g({channels:S(g({server:v().min(1).describe(`Name of the MCP server this channel binds to. Must match a key in this plugin's mcpServers.`),displayName:v().optional().describe(`Human-readable name shown in the config dialog title (e.g., "Telegram"). Defaults to the server name.`),userConfig:C(v(),Eo()).optional().describe("Fields to prompt the user for when enabling this plugin in assistant mode. Saved values are substituted into ${user_config.KEY} references in the mcpServers env.")}).strict()).describe(`Channels this plugin provides. Each entry declares an MCP server as a message channel and optionally specifies user configuration to prompt for at enable time.`)})),ko=w(()=>le({command:v().min(1).refine(e=>!(e.includes(` `)&&!e.startsWith(`/`)),{message:`Command should not contain spaces. Use args array for arguments.`}).describe(`Command to execute the LSP server (e.g., "typescript-language-server")`),args:S(Co()).optional().describe(`Command-line arguments to pass to the server`),extensionToLanguage:C(wo(),Co()).refine(e=>Object.keys(e).length>0,{message:`extensionToLanguage must have at least one mapping`}).describe(`Mapping from file extension to LSP language ID. File extensions and languages are derived from this mapping.`),transport:x([`stdio`,`socket`]).default(`stdio`).describe(`Communication transport mechanism`),env:C(v(),v()).optional().describe(`Environment variables to set when starting the server`),initializationOptions:ce().optional().describe(`Initialization options passed to the server during initialization`),settings:ce().optional().describe(`Settings passed to the server via workspace/didChangeConfiguration`),workspaceFolder:v().optional().describe(`Workspace folder path to use for the server`),startupTimeout:_().int().positive().optional().describe(`Maximum time to wait for server startup (milliseconds)`),shutdownTimeout:_().int().positive().optional().describe(`Maximum time to wait for graceful shutdown (milliseconds)`),restartOnCrash:b().optional().describe(`Whether to restart the server if it crashes`),maxRestarts:_().int().nonnegative().optional().describe(`Maximum number of restart attempts before giving up`)})),Ao=w(()=>g({lspServers:y([G().describe(`Path to .lsp.json configuration file relative to plugin root`),C(v(),ko()).describe(`LSP server configurations keyed by server name`),S(y([G().describe(`Path to LSP configuration file`),C(v(),ko()).describe(`Inline LSP server configurations`)])).describe(`Array of LSP server configurations (paths or inline definitions)`)])})),jo=w(()=>v().refine(e=>!e.includes(`..`)&&!e.includes(`//`),`Package name cannot contain path traversal patterns`).refine(e=>/^@[a-z0-9][a-z0-9-._]*\/[a-z0-9][a-z0-9-._]*$/.test(e)||/^[a-z0-9][a-z0-9-._]*$/.test(e),`Invalid npm package name format`)),Mo=w(()=>g({settings:C(v(),ce()).optional().describe(`Settings to merge when plugin is enabled. Only allowlisted keys are kept (currently: agent)`)})),No=w(()=>g({...ho().shape,..._o().partial().shape,...yo().partial().shape,...bo().partial().shape,...xo().partial().shape,...So().partial().shape,...Oo().partial().shape,...To().partial().shape,...Ao().partial().shape,...Mo().partial().shape,...Do().partial().shape})),Po=w(()=>_e(`source`,[g({source:h(`url`),url:v().url().describe(`Direct URL to marketplace.json file`),headers:C(v(),v()).optional().describe(`Custom HTTP headers (e.g., for authentication)`)}),g({source:h(`github`),repo:v().describe(`GitHub repository in owner/repo format`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:v().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(v()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),g({source:h(`git`),url:v().describe(`Full git repository URL`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),path:v().optional().describe(`Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)`),sparsePaths:S(v()).optional().describe(`Directories to include via git sparse-checkout (cone mode). Use for monorepos where the marketplace lives in a subdirectory. Example: [".claude-plugin", "plugins"]. If omitted, the full repository is cloned.`)}),g({source:h(`npm`),package:jo().describe(`NPM package containing marketplace.json`)}),g({source:h(`file`),path:v().describe(`Local file path to marketplace.json`)}),g({source:h(`directory`),path:v().describe(`Local directory containing .claude-plugin/marketplace.json`)}),g({source:h(`hostPattern`),hostPattern:v().describe(`Regex pattern to match the host/domain extracted from any marketplace source type. For github sources, matches against "github.com". For git sources (SSH or HTTPS), extracts the hostname from the URL. Use in strictKnownMarketplaces to allow all marketplaces from a specific host (e.g., "^github\\.mycompany\\.com$").`)}),g({source:h(`pathPattern`),pathPattern:v().describe(`Regex pattern matched against the .path field of file and directory sources. Use in strictKnownMarketplaces to allow filesystem-based marketplaces alongside hostPattern restrictions for network sources. Use ".*" to allow all filesystem paths, or a narrower pattern (e.g., "^/opt/approved/") to restrict to specific directories.`)}),g({source:h(`settings`),name:po().refine(e=>!U.has(e.toLowerCase()),{message:`Reserved official marketplace names cannot be used with settings sources. validateOfficialNameSource only accepts github/git sources from anthropics/* for these names; a settings source would be rejected after loadAndCacheMarketplace has already written to disk with cleanupNeeded=false.`}).describe(`Marketplace name. Must match the extraKnownMarketplaces key (enforced); the synthetic manifest is written under this name. Same validation as PluginMarketplaceSchema plus reserved-name rejection — validateOfficialNameSource runs after the disk write, too late to clean up.`),plugins:S(Lo()).describe(`Plugin entries declared inline in settings.json`),owner:mo().optional()}).describe(`Inline marketplace manifest defined directly in settings.json. The reconciler writes a synthetic marketplace.json to the cache; diffMarketplaces detects edits via isEqual on the stored source (the plugins array is inside this object, so edits surface as sourceChanged).`)])),Fo=w(()=>v().length(40).regex(/^[a-f0-9]{40}$/,`Must be a full 40-character lowercase git commit SHA`)),Io=w(()=>y([W().describe(`Path to the plugin root, relative to the marketplace root (the directory containing .claude-plugin/, not .claude-plugin/ itself)`),g({source:h(`npm`),package:jo().or(v()).describe("Package name (or url, or local path, or anything else that can be passed to `npm` as a package)"),version:v().optional().describe(`Specific version or version range (e.g., ^1.0.0, ~2.1.0)`),registry:v().url().optional().describe(`Custom NPM registry URL (defaults to using system default, likely npmjs.org)`)}).describe(`NPM package as plugin source`),g({source:h(`pip`),package:v().describe(`Python package name as it appears on PyPI`),version:v().optional().describe(`Version specifier (e.g., ==1.0.0, >=2.0.0, <3.0.0)`),registry:v().url().optional().describe(`Custom PyPI registry URL (defaults to using system default, likely pypi.org)`)}).describe(`Python package as plugin source`),g({source:h(`url`),url:v().describe(`Full git repository URL (https:// or git@)`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}),g({source:h(`github`),repo:v().describe(`GitHub repository in owner/repo format`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}),g({source:h(`git-subdir`),url:v().describe(`Git repository: GitHub owner/repo shorthand, https://, or git@ URL`),path:v().min(1).describe(`Subdirectory within the repo containing the plugin (e.g., "tools/claude-plugin"). Cloned sparsely using partial clone (--filter=tree:0) to minimize bandwidth for monorepos.`),ref:v().optional().describe(`Git branch or tag to use (e.g., "main", "v1.0.0"). Defaults to repository default branch.`),sha:Fo().optional().describe(`Specific commit SHA to use`)}).describe(`Plugin located in a subdirectory of a larger repository (monorepo). Only the specified subdirectory is materialized; the rest of the repo is not downloaded.`)])),Lo=w(()=>g({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Plugin name as it appears in the target repository`),source:Io().describe(`Where to fetch the plugin from. Must be a remote source — relative paths have no marketplace repository to resolve against.`),description:v().optional(),version:v().optional(),strict:b().optional()}).refine(e=>typeof e.source!=`string`,{message:`Plugins in a settings-sourced marketplace must use remote sources (github, git-subdir, npm, url, pip). Relative-path sources like "./foo" have no marketplace repository to resolve against.`})),Ro=w(()=>No().partial().extend({name:v().min(1,`Plugin name cannot be empty`).refine(e=>!e.includes(` `),{message:`Plugin name cannot contain spaces. Use kebab-case (e.g., "my-plugin")`}).describe(`Unique identifier matching the plugin name`),source:Io().describe(`Where to fetch the plugin from`),category:v().optional().describe(`Category for organizing plugins (e.g., "productivity", "development")`),tags:S(v()).optional().describe(`Tags for searchability and discovery`),strict:b().optional().default(!0).describe(`Require the plugin manifest to be present in the plugin folder. If false, the marketplace entry provides the manifest.`)})),zo=w(()=>g({name:po(),owner:mo().describe(`Marketplace maintainer or curator information`),plugins:S(Ro()).describe(`Collection of available plugins in this marketplace`),forceRemoveDeletedPlugins:b().optional().describe(`When true, plugins removed from this marketplace will be automatically uninstalled and flagged for users`),metadata:g({pluginRoot:v().optional().describe(`Base path for relative plugin sources`),version:v().optional().describe(`Marketplace version`),description:v().optional().describe(`Marketplace description`)}).optional().describe(`Optional marketplace metadata`),allowCrossMarketplaceDependenciesOn:S(v()).optional().describe(`Marketplace names whose plugins may be auto-installed as dependencies. Only the root marketplace's allowlist applies — no transitive trust.`)})),K=w(()=>v().regex(/^[a-z0-9][-a-z0-9._]*@[a-z0-9][-a-z0-9._]*$/i,`Plugin ID must be in format: plugin@marketplace`)),Bo=/^[a-z0-9][-a-z0-9._]*(@[a-z0-9][-a-z0-9._]*)?(@\^[^@]*)?$/i,Vo=w(()=>y([v().regex(Bo,`Dependency must be a plugin name, optionally qualified with @marketplace`).transform(e=>e.replace(/@\^[^@]*$/,``)),g({name:v().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i),marketplace:v().min(1).regex(/^[a-z0-9][-a-z0-9._]*$/i).optional()}).loose().transform(e=>e.marketplace?`${e.name}@${e.marketplace}`:e.name)])),w(()=>y([K(),g({id:K().describe(`Plugin identifier (e.g., "formatter@tools")`),version:v().optional().describe(`Version constraint (e.g., "^2.0.0")`),required:b().optional().describe(`If true, cannot be disabled`),config:C(v(),ce()).optional().describe(`Plugin-specific configuration`)})])),Ho=w(()=>g({version:v().describe(`Currently installed version`),installedAt:v().describe(`ISO 8601 timestamp of installation`),lastUpdated:v().optional().describe(`ISO 8601 timestamp of last update`),installPath:v().describe(`Absolute path to the installed plugin directory`),gitCommitSha:v().optional().describe(`Git commit SHA for git-based plugins (for version tracking)`)})),Uo=w(()=>g({version:h(1).describe(`Schema version 1`),plugins:C(K(),Ho()).describe(`Map of plugin IDs to their installation metadata`)})),Wo=w(()=>x([`managed`,`user`,`project`,`local`])),Go=w(()=>g({scope:Wo().describe(`Installation scope`),projectPath:v().optional().describe(`Project path (required for project/local scopes)`),installPath:v().describe(`Absolute path to the versioned plugin directory`),version:v().optional().describe(`Currently installed version`),installedAt:v().optional().describe(`ISO 8601 timestamp of installation`),lastUpdated:v().optional().describe(`ISO 8601 timestamp of last update`),gitCommitSha:v().optional().describe(`Git commit SHA for git-based plugins`)})),Ko=w(()=>g({version:h(2).describe(`Schema version 2`),plugins:C(K(),S(Go())).describe(`Map of plugin IDs to arrays of installation entries`)})),w(()=>y([Uo(),Ko()])),qo=w(()=>g({source:Po().describe(`Where to fetch the marketplace from`),installLocation:v().describe(`Local cache path where marketplace manifest is stored`),lastUpdated:v().describe(`ISO 8601 timestamp of last marketplace refresh`),autoUpdate:b().optional().describe(`Whether to automatically update this marketplace and its installed plugins on startup`)})),Jo=w(()=>C(v(),qo()))}));function Xo(e){let t=e.replace(/[^a-zA-Z0-9_-]/g,`_`);return e.startsWith(Zo)&&(t=t.replace(/_+/g,`_`).replace(/^_|_$/g,``)),t}var Zo,Qo=e((()=>{Zo=`claude.ai `}));function $o(e){let[t,n,...r]=e.split(`__`);return t!==`mcp`||!n?null:{serverName:n,toolName:r.length>0?r.join(`__`):void 0}}function es(e){return`mcp__${Xo(e)}__`}function ts(e,t){return`${es(e)}${Xo(t)}`}function ns(e){return e.mcpInfo?ts(e.mcpInfo.serverName,e.mcpInfo.toolName):e.name}function rs(e,t){let n=`mcp__${Xo(t)}__`;return e.replace(n,``)}function is(e){let t=e.replace(/\s*\(MCP\)\s*$/,``);t=t.trim();let n=t.indexOf(` - `);return n===-1?t:t.substring(n+3).trim()}var as=e((()=>{Qo()})),os,ss,cs,ls,us=e((()=>{os=`Agent`,ss=`Task`,cs=`verification`,ls=new Set([`Explore`,`Plan`])})),ds,fs=e((()=>{ds=`TaskOutput`})),ps,ms,hs=e((()=>{ps=`TaskStop`,ms=`
|
|
13
13
|
- Stops a running background task by its ID
|
|
14
14
|
- Takes a task_id parameter identifying the task to stop
|
|
15
15
|
- Returns a success or failure status
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,h as t,s as n}from"./settings-BowI3jp-.js";t();export{n as getSettingsForSource,e as updateSettingsForSource};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ov as t,xy as n}from"./loadAgentsDir-C96o6gCj.js";import{D as r,E as i,N as a,j as o,n as s,r as c,t as l}from"./lazySchema-DULtBUCI.js";import{Ut as u}from"./state-D5D6QpTX.js";import{R as d}from"./debug-D58GQBDG.js";import{h as f}from"./settings-BowI3jp-.js";import{h as p}from"./config-DUTgj3js.js";import{O as m,m as h}from"./git-Wid-XppW.js";import{u as g}from"./oauth-D38aRTUb.js";import{Pt as _,ti as v}from"./model-BaMclMXn.js";import"path";import"fs/promises";var y,b=e((()=>{c(),l(),y=s(()=>r({entries:o(a(),a())})),s(()=>r({userId:a(),version:i(),lastModified:a(),checksum:a(),content:y()}))})),x=e((()=>{u(),g(),_(),n(),p(),m(),d(),h(),v(),f(),t(),b()}));export{x as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,t}from"./memoize-BK3gG5ob.js";import{l as n,o as r,s as i}from"./envUtils-DcaKZlRU.js";import{ft as a,ut as o}from"./esm-BCUC71kt.js";import{At as s,B_ as c,Bs as l,CS as u,Fs as d,G_ as f,H_ as p,I_ as m,J_ as h,K_ as ee,L_ as te,Li as ne,Lp as re,Mi as ie,Mn as ae,Nn as oe,Nw as se,Ps as ce,R_ as g,Rp as _,Rs as le,Sa as v,St as ue,U_ as de,V_ as fe,W_ as pe,Yv as me,aC as y,br as b,cC as x,cm as S,dC as C,dg as w,di as T,ea as E,fC as D,fg as O,gt as k,gy as A,hn as j,ht as M,iC as N,iv as P,jn as F,lC as I,mn as L,nm as R,nv as z,om as he,ot as ge,pC as _e,q_ as ve,rE as ye,sm as be,tE as xe,tm as Se,tv as Ce,vt as B,wS as we,w_ as Te,xy as Ee,z_ as De}from"./loadAgentsDir-C96o6gCj.js";import{di as V,fi as Oe}from"./src-DL3w8VPk.js";import{R as H,Ut as U,Vn as ke,ar as Ae,ft as je,rt as Me,z as Ne,zn as Pe}from"./state-D5D6QpTX.js";import{n as Fe,t as W}from"./cwd-Nh5IZNKO.js";import{F as Ie,P as G,R as K,f as Le,u as Re}from"./debug-D58GQBDG.js";import{Gt as ze,In as Be,Jt as Ve,Ln as He}from"./settings-BowI3jp-.js";import{h as Ue,o as We}from"./config-DUTgj3js.js";import{O as Ge,k as q,l as Ke,m as qe,n as Je,r as Ye}from"./git-Wid-XppW.js";import{o as Xe,s as Ze}from"./log-CZ7ploQm.js";import{n as J,r as Y}from"./analytics-DJobLaWP.js";import{n as Qe,r as X}from"./startupProfiler-B90b5vuq.js";import{Jr as $e,Pt as et,Yr as tt,Zt as nt}from"./model-BaMclMXn.js";import{pn as rt,un as Z}from"./prompt-BNNE5tsG.js";import{h as it,l as at,p as ot,u as st}from"./terminalSetup-a7-BNS4T.js";import{c as ct,t as lt}from"./nativeInstaller-CfZ5uNTh.js";import{l as ut,s as dt}from"./logoUtils-Cg_6QV1Z.js";import{i as ft,r as pt}from"./runtimeObserver-CsZw5XBt.js";import{t as mt}from"./sinks-mGBiINp8.js";import{writeFile as Q}from"fs/promises";r(),Oe(),Fe(),Ge(),Xe(),qe(),Ve(),Ue(),et(),ye(),D(),x(),N(),O(),ne(),b(),j(),t(),U(),ge(),Te(),rt(),we(),He(),le(),Le(),re(),E(),oe(),$e(),me(),z(),J(),Se(),be(),fe(),K();function ht(){return!1}function gt(){return{}}var $;function _t(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+=Be(e,e=>e.type===`tool_use`))}}return n}function vt(e){let t=P(e);if(!p()){if(!De(t))return!1;f()}let n=c(t),r=_t(e,$)>=g(),i=v(e);if(n&&r||n&&!i){let t=e[e.length-1];return t?.uuid&&($=t.uuid),!0}return!1}async function yt(e){let t=Re(),n=F();await t.mkdir(n,{mode:448});let r=ae();try{await Q(r,``,{encoding:`utf-8`,mode:384,flag:`wx`}),await Q(r,await S(),{encoding:`utf-8`,mode:384})}catch(e){if(Ie(e)!==`EEXIST`)throw e}e.readFileState.delete(r);let i=await u.call({file_path:r},e),a=``,o=i.data;return o.type===`text`&&(a=o.file.content),Y(`tengu_session_memory_file_read`,{content_length:a.length}),{memoryPath:r,currentMemory:a}}var bt=e(()=>{let e=gt();h({minimumMessageTokensToInit:e.minimumMessageTokensToInit&&e.minimumMessageTokensToInit>0?e.minimumMessageTokensToInit:m.minimumMessageTokensToInit,minimumTokensBetweenUpdate:e.minimumTokensBetweenUpdate&&e.minimumTokensBetweenUpdate>0?e.minimumTokensBetweenUpdate:m.minimumTokensBetweenUpdate,toolCallsBetweenUpdates:e.toolCallsBetweenUpdates&&e.toolCallsBetweenUpdates>0?e.toolCallsBetweenUpdates:m.toolCallsBetweenUpdates})}),xt=tt(async e=>{let{messages:t,toolUseContext:n,querySource:r}=e;if(r!==`repl_main_thread`||!ht()||(bt(),!vt(t)))return;pe();let i=d(n),{memoryPath:a,currentMemory:o}=await yt(i);await l({promptMessages:[se({content:await he(o,a)})],cacheSafeParams:ce(e),canUseTool:Ct(a),querySource:`session_memory`,forkLabel:`session_memory`,overrides:{readFileState:i.readFileState}});let s=t[t.length-1],c=s?Ce(s):void 0,u=te();Y(`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:u.minimumMessageTokensToInit,config_min_tokens_between_update:u.minimumTokensBetweenUpdate,config_tool_calls_between_updates:u.toolCallsBetweenUpdates}),ee(P(t)),wt(t),de()});function St(){Ne()||R()&&_(xt)}function Ct(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 ${Z} on ${e} is allowed`,decisionReason:{type:`other`,reason:`only ${Z} on ${e} is allowed`}}}}function wt(e){if(!v(e)){let t=e[e.length-1];t?.uuid&&ve(t.uuid)}}J(),U(),ft(),st(),Ee(),a(),K(),ut(),lt(),ot(),Qe(),ue();async function Tt(e,t,r,a,c,l,u,d){q(`info`,`setup_started`);let f=process.version.match(/^v(\d+)\./)?.[1];if((!f||parseInt(f,10)<18)&&(console.error(V.bold.red(`Error: Work Mate requires Node.js version 18 or higher.`)),process.exit(1)),u&&Ae(w(u)),!H())try{let e=await at();e.status===`restored`?console.log(V.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(V.red(`Failed to restore Terminal.app settings. Please manually restore your original settings with: defaults import com.apple.Terminal ${e.backupPath}.`))}catch(e){Ze(e)}y(e);let p=Date.now();if(C(),q(`info`,`setup_hooks_captured`,{duration_ms:Date.now()-p}),I(e),a){let t=L(),n=await Ke();!t&&!n&&(process.stderr.write(V.red(`Error: Can only use --worktree in a git repository, but ${V.bold(e)} is not a git repository. Configure a WorktreeCreate hook in settings.json to use --worktree with other VCS systems.\n`)),process.exit(1));let r=d?`pr-${d}`:c??xe(),i;if(n){let e=Je(W());e||(process.stderr.write(V.red(`Error: Could not determine the main git repository root.
|
|
2
|
+
`)),process.exit(1)),e!==(Ye(W())??W())&&(q(`info`,`worktree_resolved_to_main_repo`),process.chdir(e),y(e)),i=l?B(e,s(r)):void 0}else i=l?B(W(),s(r)):void 0;let a;try{a=await k(je(),r,i,d?{prNumber:d}:void 0)}catch(e){process.stderr.write(V.red(`Error creating worktree: ${G(e)}\n`)),process.exit(1)}if(Y(`tengu_worktree_created`,{tmux_enabled:l}),l&&i){let e=await M(i,a.worktreePath);e.created?console.log(V.green(`Created tmux session: ${V.bold(i)}\nTo attach: ${V.bold(`tmux attach -t ${i}`)}`)):console.error(V.yellow(`Warning: Failed to create tmux session: ${e.error}`))}process.chdir(a.worktreePath),y(a.worktreePath),Pe(W()),ke(W()),T(a),A(),_e()}q(`info`,`setup_background_jobs_starting`),i()||(St(),pt()),ct(),q(`info`,`setup_background_jobs_launched`),X(`setup_before_prefetch`),q(`info`,`setup_prefetch_starting`);let m=H()&&n(process.env.CLAUDE_CODE_SYNC_PLUGIN_INSTALL)||i();if(m||ie(Me()),import(`./loadPluginHooks-0nGlugZ4.js`).then(e=>{m||(e.loadPluginHooks(),e.setupPluginHookHotReload())}),i()||import(`./sessionFileAccessHooks-DV22q9JO.js`).then(e=>e.registerSessionFileAccessHooks()),mt(),Y(`tengu_started`,{}),nt(H()),X(`setup_after_prefetch`),!i()&&it()&&await dt(),t===`bypassPermissions`||r){if(process.platform!==`win32`&&typeof process.getuid==`function`&&process.getuid()===0&&process.env.IS_SANDBOX!==`1`&&!n(process.env.CLAUDE_CODE_BUBBLEWRAP))if(process.stdin.isTTY){console.error(V.bold.red(`WARNING: Running as root/sudo with bypass permissions mode is dangerous.`)),console.error(V.yellow(`Bypass mode skips ALL permission checks. Combined with root, any command (rm -rf /, chmod, dd) executes without review.`));let e=(await import(`readline`)).createInterface({input:process.stdin,output:process.stdout}),t=await new Promise(t=>{e.question(`
|
|
3
|
+
I understand the risks. Continue? [y/N] `,t)});e.close(),t.trim().toLowerCase()!==`y`&&(console.error(`Aborted.`),process.exit(1))}else console.error(`--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons`),process.exit(1);if(process.env.CLAUDE_CODE_ENTRYPOINT!==`local-agent`&&process.env.CLAUDE_CODE_ENTRYPOINT!==`claude-desktop`){let[e,t]=await Promise.all([o.getIsDocker(),ze.hasInternetAccess()]),n=o.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 h=We();h.lastCost!==void 0&&h.lastDuration!==void 0&&Y(`tengu_exit`,{last_session_cost:h.lastCost,last_session_api_duration:h.lastAPIDuration,last_session_tool_duration:h.lastToolDuration,last_session_duration:h.lastDuration,last_session_lines_added:h.lastLinesAdded,last_session_lines_removed:h.lastLinesRemoved,last_session_total_input_tokens:h.lastTotalInputTokens,last_session_total_output_tokens:h.lastTotalOutputTokens,last_session_total_cache_creation_input_tokens:h.lastTotalCacheCreationInputTokens,last_session_total_cache_read_input_tokens:h.lastTotalCacheReadInputTokens,last_session_fps_average:h.lastFpsAverage,last_session_fps_low_1_pct:h.lastFpsLow1Pct,last_session_id:h.lastSessionId,...h.lastSessionMetrics})}export{Tt as setup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,L as n,R as r,V as i,z as a}from"./loadAgentsDir-C96o6gCj.js";import{in as o}from"./prompt-BNNE5tsG.js";function s(e){return e===`projectSettings`||e===`policySettings`||e===`command`}function c(e){return t(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,t){let i=[],o=n(e),s=r(e),f=a(e);for(let e of o){let n=d(e,f);if(n.shadowed){let t=c(n.shadowedBy.source);i.push({rule:e,reason:`Blocked by "${n.shadowedBy.ruleValue.toolName}" deny rule (from ${t})`,shadowedBy:n.shadowedBy,shadowType:`deny`,fix:l(`deny`,n.shadowedBy,e)});continue}let r=u(e,s,t);if(r.shadowed){let t=c(r.shadowedBy.source);i.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 i}var p=e((()=>{o(),i()}));export{p as n,f as t};
|