@readmagic/workmate 0.0.20 → 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-DCpchgp5.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-Dd6rjs5P.js → Grove-Bbh8PpH0.js} +1 -1
- package/dist/chunks/{HybridTransport-CJVkWa2u.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-BfsOv4K6.js → RemoteSessionManager-BPESC6Wu.js} +2 -2
- package/dist/chunks/ResumeConversation-DG1sLryB.js +1 -0
- package/dist/chunks/{SSETransport-B3K6eH9I.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-BM4QG_RX.js → agentDisplay-1Y-N-gqz.js} +1 -1
- package/dist/chunks/{agents-BbDBN5l9.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-DyUWfg3a.js → api-DTyrmy1O.js} +1 -1
- package/dist/chunks/api-DumFOErN.js +1 -0
- package/dist/chunks/{auth-0rn1U4Eq.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-CQ38cx5n.js → branch-K8X6jx0i.js} +1 -1
- package/dist/chunks/{break-cache-CcwOjTKt.js → break-cache-BZ_UMtEL.js} +1 -1
- package/dist/chunks/{bridgeConfig-C5L-7KaP.js → bridgeConfig-C-bI-slm.js} +1 -1
- package/dist/chunks/bridgeConfig-_xpxhGB5.js +1 -0
- package/dist/chunks/{bridgeMessaging-DVC3qj-C.js → bridgeMessaging-DSJlYarJ.js} +1 -1
- package/dist/chunks/{bridgeStatusUtil-Cex6VowM.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-DO563xlf.js → ccrClient-JnhF5b3z.js} +1 -1
- package/dist/chunks/{clear-DmqQBNKg.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-BzDVMnWC.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-LVGVXHXL.js → createSSHSession-BQ83MMtr.js} +1 -1
- package/dist/chunks/createSession-CqHnHhCR.js +1 -0
- package/dist/chunks/{createSession-Dgwxk1WA.js → createSession-DqTtBycR.js} +1 -1
- package/dist/chunks/crossProjectResume-DIXtiODF.js +40 -0
- package/dist/chunks/{datadog-Bc6wkPne.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-DIg66U_d.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-B-Y-AYeK.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-Dy-x4h3G.js → fetchModelList-fQDsmR3E.js} +1 -1
- package/dist/chunks/fetchModelList-woVzIVde.js +1 -0
- package/dist/chunks/{fileSuggestions-CFkJktgc.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-BjKW7PFC.js → flushGate-BA8dSr0i.js} +1 -1
- package/dist/chunks/fpsMetrics-wxj9GAsd.js +1 -0
- package/dist/chunks/{gemini-NnmxBoEp.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-BxZ4vTDw.js → grok-CjeCecsZ.js} +1 -1
- package/dist/chunks/{grove-CYE1Cfcz.js → grove-DqTnK9nn.js} +2 -2
- package/dist/chunks/help-Bb6LdzXK.js +1 -0
- package/dist/chunks/{hooks-7iyENdDG.js → hooks-BDgToO1Z.js} +2 -2
- package/dist/chunks/hooks-BX2s7aoL.js +1 -0
- package/dist/chunks/{initReplBridge-BEZW5PEY.js → initReplBridge-D7cuY_os.js} +1 -1
- package/dist/chunks/install-eCA8UACi.js +1 -0
- package/dist/chunks/{instrumentation-2HH15DPu.js → instrumentation-BaRKojJh.js} +6 -6
- package/dist/chunks/{job-CXz7SLZp.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-DaNpxaO-.js → loadAgentsDir-C96o6gCj.js} +576 -576
- package/dist/chunks/loadPluginHooks-0nGlugZ4.js +1 -0
- package/dist/chunks/{localSearch-C2SZ9bGW.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-CrTwULyJ.js → magicDocs-DmPNMnNY.js} +2 -2
- package/dist/chunks/{main-Blm02_Js.js → main-7ssnA9Yb.js} +2 -2
- package/dist/chunks/{main-bJXadFi0.js → main-BEv6MqMX.js} +34 -34
- package/dist/chunks/{managedEnv-CUsdYhAI.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-B3nis9cC.js → modelOptions-Cw1ThINb.js} +1 -1
- package/dist/chunks/nativeInstaller-CfZ5uNTh.js +1 -0
- package/dist/chunks/omit-B7eQ9q0x.js +1 -0
- package/dist/chunks/{onChangeAppState-vKml_lit.js → onChangeAppState-kEAt8nxV.js} +1 -1
- package/dist/chunks/{openai-DdupGVdC.js → openai-wh8AX5iz.js} +3 -3
- package/dist/chunks/panel-Cm23FDVt.js +1 -0
- package/dist/chunks/{partition-BivH9MBJ.js → partition-CENvOfiS.js} +1 -1
- package/dist/chunks/permissions-ChuIx-d4.js +3 -0
- package/dist/chunks/{pidLock-DiKz5Tza.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-C2xTKLR_.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-DRA0m76J.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-BF1N4Lih.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-8u06WVES.js → prompt-BNNE5tsG.js} +1 -1
- package/dist/chunks/promptEditor-DT6egmcb.js +4 -0
- package/dist/chunks/{protocolHandler-DzHVaPl3.js → protocolHandler-DukQ6b4Q.js} +1 -1
- package/dist/chunks/{reconciler-RIKmaPg7.js → reconciler-D3zyJCnV.js} +1 -1
- package/dist/chunks/refresh-BSG0t4cf.js +1 -0
- package/dist/chunks/{registerProtocol-C0IlPEoa.js → registerProtocol-BOEYaX-X.js} +1 -1
- package/dist/chunks/{reload-plugins-DC-tbXVv.js → reload-plugins-BFMRhbv8.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-NGTnhQgw.js → remoteBridgeCore-D5OwvmAz.js} +1 -1
- package/dist/chunks/{remoteManagedSettings-BoOYHzYP.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-L6041elO.js → runtimeObserver-CsZw5XBt.js} +2 -2
- package/dist/chunks/{runtimeObserver-DzesbvgI.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/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-0D8xFoRK.js → sessionObserver-N7fORFdL.js} +2 -2
- package/dist/chunks/{sessionState-CQhbGfmh.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-Cy9tsuKc.js → shadowedRuleDetection-DEo1hvGi.js} +1 -1
- package/dist/chunks/{sideQuestion-Ds7Elgs4.js → sideQuestion-C11KgNGL.js} +3 -3
- package/dist/chunks/sinks-DnLqRPEC.js +1 -0
- package/dist/chunks/{sinks-BXX72cbf.js → sinks-mGBiINp8.js} +1 -1
- package/dist/chunks/skillChangeDetector-Dc6YZXJE.js +1 -0
- package/dist/chunks/{skillGapStore-BxCxKPev.js → skillGapStore-H4MkUFUY.js} +2 -2
- package/dist/chunks/{skillLifecycle-CfyNC3sW.js → skillLifecycle-ADUTDK7D.js} +2 -2
- package/dist/chunks/{skillSearchPanel-CMNJFIEC.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-CZoOse-_.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-DQF5ZNal.js → switcher-DWfKi17X.js} +1 -1
- package/dist/chunks/{syncCache-qWJ_VfBo.js → syncCache-DUhciJLz.js} +1 -1
- package/dist/chunks/{tasks-C8pb6ftc.js → tasks-BwSsj2vI.js} +1 -1
- package/dist/chunks/teleport-DwZMevmQ.js +1 -0
- package/dist/chunks/{templateJobs-DJ4dcfcL.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-D2nk8ZbW.js → toolEventObserver-Cq_ZV7x9.js} +1 -1
- package/dist/chunks/toolPool-mdsxlKWR.js +1 -0
- package/dist/chunks/{trustedDevice-CB6rNzl-.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-i-oGzf40.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-BjxoZ12l.js → workerRegistry-BBgquE8F.js} +2 -2
- package/dist/chunks/worktree-C28I8mFB.js +1 -0
- package/dist/cli.js +1 -1
- package/package.json +3 -21
- package/dist/chunks/AddWorkspaceDirectory-BYNvxNrD.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-BSSz86ER.js +0 -1
- package/dist/chunks/AgentsMdExternalIncludesDialog-CMEGV4Md.js +0 -1
- package/dist/chunks/App-W_9d1DjK.js +0 -1
- package/dist/chunks/ApproveApiKey-Bf1Rb8Ql.js +0 -1
- package/dist/chunks/ApproveApiKey-wpdvXpFr.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-lGn1Wj1k.js +0 -2
- package/dist/chunks/BypassPermissionsModeDialog-CjVjyNf8.js +0 -1
- package/dist/chunks/Doctor-6SjW91rd.js +0 -1
- package/dist/chunks/Doctor-FPYTivHw.js +0 -3
- package/dist/chunks/ExitFlow-Dy8_1D8J.js +0 -2
- package/dist/chunks/InvalidConfigDialog-Bisj9ic_.js +0 -1
- package/dist/chunks/InvalidSettingsDialog-DyTPNRQR.js +0 -1
- package/dist/chunks/MCPConnectionManager-DfyoZaiu.js +0 -1
- package/dist/chunks/MCPToolListView-Dioupv8F.js +0 -1
- package/dist/chunks/McpParsingWarnings-BUlgpZAF.js +0 -1
- package/dist/chunks/MessageSelector-D8fylxPg.js +0 -3
- package/dist/chunks/Messages-BZDFMYBT.js +0 -10
- package/dist/chunks/Onboarding-BKLomZYo.js +0 -1
- package/dist/chunks/PermissionDialog-BPhvs5xH.js +0 -1
- package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +0 -1
- package/dist/chunks/PromptInputFooterSuggestions-DCum89fF.js +0 -1
- package/dist/chunks/PromptInputHelpMenu-DG2lRqis.js +0 -1
- package/dist/chunks/QueryEngine-CyGHpX7M.js +0 -1
- package/dist/chunks/REPL-BDsz8KIx.js +0 -1
- package/dist/chunks/REPL-CCBNfZfs.js +0 -128
- package/dist/chunks/ResumeConversation-pC8NLq0F.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-DYoxHo9T.js +0 -1
- package/dist/chunks/Settings-CKaGmKg2.js +0 -2
- package/dist/chunks/TeleportProgress-CkgSp1cs.js +0 -1
- package/dist/chunks/TeleportRepoMismatchDialog-DdO_rECq.js +0 -1
- package/dist/chunks/TeleportResumeWrapper-BeG4N-2z.js +0 -1
- package/dist/chunks/ThemePicker-iD9ufy99.js +0 -1
- package/dist/chunks/TrustDialog-qO5OdQt8.js +0 -1
- package/dist/chunks/add-dir-C4eSVlZ6.js +0 -1
- package/dist/chunks/agents-D3APE_8d.js +0 -101
- package/dist/chunks/allErrors-BkgB7JNK.js +0 -1
- package/dist/chunks/api-BHBK9axp.js +0 -1
- package/dist/chunks/auth-BEoTPSgC.js +0 -1
- package/dist/chunks/auth-BPug7U_u.js +0 -1
- package/dist/chunks/backgroundHousekeeping-D7xAhUaE.js +0 -1
- package/dist/chunks/backgroundHousekeeping-km82qEh0.js +0 -17
- package/dist/chunks/bridgeConfig-CJMjDoaP.js +0 -1
- package/dist/chunks/btw-_P96ffHR.js +0 -1
- package/dist/chunks/caches-DH-q8Fjf.js +0 -1
- package/dist/chunks/caches-Dq0pJFDP.js +0 -1
- package/dist/chunks/client-C19cqYQS.js +0 -1
- package/dist/chunks/commands-BkpqHY9F.js +0 -1
- package/dist/chunks/compact-DuVIvqMu.js +0 -2
- package/dist/chunks/config-DMP6-Ccr.js +0 -1
- package/dist/chunks/context-DjgMzIfe.js +0 -1
- package/dist/chunks/context-noninteractive-DV7bIJCm.js +0 -1
- package/dist/chunks/conversation-BBOE_EoE.js +0 -1
- package/dist/chunks/conversation-WxH5pb2z.js +0 -1
- package/dist/chunks/createSession-BUzna9-E.js +0 -1
- package/dist/chunks/crossProjectResume-6B2NYy8a.js +0 -40
- package/dist/chunks/detectRepository-Cv9-k6dg.js +0 -1
- package/dist/chunks/doctor-BhUmhHQU.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-CvHtYRrr.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-CW2eqUrR.js +0 -1
- package/dist/chunks/extraUsage-CkTon7ib.js +0 -1
- package/dist/chunks/extractMemories-CfmbvayQ.js +0 -1
- package/dist/chunks/fast-ByahC7Gw.js +0 -1
- package/dist/chunks/fast-xtIP4u4y.js +0 -1
- package/dist/chunks/fetchModelList-D9aePIPW.js +0 -1
- package/dist/chunks/firstPartyEventLogger-Bt9iG9xk.js +0 -1
- package/dist/chunks/firstPartyEventLogger-DqGSujCz.js +0 -3
- package/dist/chunks/fpsMetrics-Dk_pnSHJ.js +0 -1
- package/dist/chunks/generateSessionName-EpqGW-T2.js +0 -1
- package/dist/chunks/git-zJCasBa6.js +0 -1
- package/dist/chunks/goal-DbS8yJfB.js +0 -3
- package/dist/chunks/help-DatnwM25.js +0 -1
- package/dist/chunks/hooks-DjbqtbUV.js +0 -1
- package/dist/chunks/install-DJukI-kL.js +0 -1
- package/dist/chunks/keybindings-C9l5il16.js +0 -1
- package/dist/chunks/launchLocalMemory-BfGenqj1.js +0 -3
- package/dist/chunks/launchOnboarding-DjMmXeQE.js +0 -8
- package/dist/chunks/loadAgentsDir-DcI-8FQF.js +0 -1
- package/dist/chunks/loadPluginHooks-CGgpcyEC.js +0 -1
- package/dist/chunks/localSearch-CTTwYTU1.js +0 -1
- package/dist/chunks/logoUtils-CbIqOFrX.js +0 -1
- package/dist/chunks/managedEnv-DXeaUDSK.js +0 -1
- package/dist/chunks/mappers-_B-s9fNz.js +0 -1
- package/dist/chunks/mcp-BbbYzWpy.js +0 -6
- package/dist/chunks/mcp-D91sH9a8.js +0 -1
- package/dist/chunks/mcp-Dx-zgUgu.js +0 -2
- package/dist/chunks/memory-BeL7ui9m.js +0 -1
- package/dist/chunks/modalContext-wY9CeN4G.js +0 -1
- package/dist/chunks/mode-D695kgLI.js +0 -2
- package/dist/chunks/model-DX0TtzqX.js +0 -1
- package/dist/chunks/model-Do0f476p.js +0 -1
- package/dist/chunks/model-DpcM8dz5.js +0 -1
- package/dist/chunks/nativeInstaller-CymO8TNe.js +0 -1
- package/dist/chunks/omit-DO61BHZu.js +0 -1
- package/dist/chunks/panel-CVd1dzYl.js +0 -1
- package/dist/chunks/permissions-C9iqR4_N.js +0 -3
- package/dist/chunks/plan-KDN5IGWY.js +0 -1
- package/dist/chunks/plugin-D0rzUb8E.js +0 -17
- package/dist/chunks/pluginBlocklist-xdiUmUpt.js +0 -1
- package/dist/chunks/pluginCliCommands-CIDDvVN7.js +0 -1
- package/dist/chunks/pluginOperations-BEYsarAn.js +0 -2
- package/dist/chunks/pluginStartupCheck-DVkI4pqo.js +0 -1
- package/dist/chunks/plugins-CWWU4BKs.js +0 -4
- package/dist/chunks/poorMode-BTIe8W_H.js +0 -1
- package/dist/chunks/print-B5H2xbBS.js +0 -14
- package/dist/chunks/processBashCommand-EQ9EWaRV.js +0 -1
- package/dist/chunks/processSlashCommand-C4PKNyFT.js +0 -5
- package/dist/chunks/prompt-B9sDzLPK.js +0 -1
- package/dist/chunks/prompt-WsoTRhoh.js +0 -1
- package/dist/chunks/promptEditor-Cr4w-4Bz.js +0 -4
- package/dist/chunks/refresh-CCSCAjgz.js +0 -1
- package/dist/chunks/rename-DS1AmW-F.js +0 -1
- package/dist/chunks/resume-Cf5PSoPw.js +0 -2
- package/dist/chunks/ripgrep-CBUbn6Po.js +0 -1
- package/dist/chunks/sandbox-adapter-Z4Phj31K.js +0 -1
- package/dist/chunks/sandbox-toggle-COZE8Lo4.js +0 -1
- package/dist/chunks/searchExtraTools-CvkRbL2m.js +0 -1
- package/dist/chunks/session-BvA99K4j.js +0 -2
- package/dist/chunks/sessionFileAccessHooks-6XfAf6ke.js +0 -1
- package/dist/chunks/sessionObserver-CRWUBJEY.js +0 -1
- package/dist/chunks/sessionStorage-DqEuxDlb.js +0 -1
- package/dist/chunks/sessionTracing-BoOZsXU2.js +0 -11
- package/dist/chunks/settings-Crx1cI1u.js +0 -1
- package/dist/chunks/settingsSync-rkWmClKS.js +0 -1
- package/dist/chunks/setup-D8L275fT.js +0 -3
- package/dist/chunks/sinks-DMp6uEzM.js +0 -1
- package/dist/chunks/skillChangeDetector-CtithJ4a.js +0 -1
- package/dist/chunks/skills-DXMk-498.js +0 -1
- package/dist/chunks/src-D3yIF9I42.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-CFrLuGbf.js +0 -2
- package/dist/chunks/status-D5OCkMZG.js +0 -1
- package/dist/chunks/switcher-AiMcRzoi.js +0 -1
- package/dist/chunks/teleport-Bi_1VFIZ.js +0 -1
- package/dist/chunks/theme-CEKOCSLw.js +0 -1
- package/dist/chunks/toolPool-Df5iUqJ-.js +0 -1
- package/dist/chunks/trustedDevice-DXGePUAC.js +0 -1
- package/dist/chunks/useExitOnCtrlCDWithKeybindings-Bw0mlTT9.js +0 -1
- package/dist/chunks/useMainLoopModel-CIG2cjS2.js +0 -1
- package/dist/chunks/useManagePlugins-MSHw-qHx.js +0 -1
- package/dist/chunks/useMergedTools-Bb-INJa2.js +0 -1
- package/dist/chunks/useSearchInput-QL_VtdJD.js +0 -1
- package/dist/chunks/useSettingsErrors-Dvi6zLCr.js +0 -1
- package/dist/chunks/util-CLQvtXuD.js +0 -1
- package/dist/chunks/validatePlugin-1mTZ3TJR.js +0 -1
- package/dist/chunks/which-BxQ1hpjp.js +0 -1
- package/dist/chunks/worktree-DpksgxdF.js +0 -1
- /package/dist/chunks/{src-DL3w8VPk2.js → src-DL3w8VPk.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Bs as t,Nw as n,Rs as r,ea as i,hw as a}from"./loadAgentsDir-C96o6gCj.js";import{P as o,T as s}from"./sessionState-8jutEorw.js";function c(e){let t=[],n=e.matchAll(d);for(let e of n)e.index!==void 0&&t.push({word:e[0],start:e.index,end:e.index+e[0].length});return t}async function l({question:e,cacheSafeParams:r}){let i=await t({promptMessages:[n({content:`<system-reminder>This is a side question from the user. You must answer this question directly in a single response.
|
|
2
2
|
|
|
3
3
|
IMPORTANT CONTEXT:
|
|
4
4
|
- You are a separate, lightweight agent spawned to answer this one question
|
|
@@ -15,6 +15,6 @@ CRITICAL CONSTRAINTS:
|
|
|
15
15
|
|
|
16
16
|
Simply answer the question with the information you have.</system-reminder>
|
|
17
17
|
|
|
18
|
-
${e}`})],cacheSafeParams:
|
|
18
|
+
${e}`})],cacheSafeParams:r,canUseTool:async()=>({behavior:`deny`,message:`Side questions cannot use tools`,decisionReason:{type:`other`,reason:`side_question`}}),querySource:`side_question`,forkLabel:`side_question`,maxTurns:1,skipCacheWrite:!0});return{response:u(i.messages),usage:i.totalUsage}}function u(e){let t=e.flatMap(e=>e.type===`assistant`?e.message.content:[]);if(t.length>0){let e=a(t,`
|
|
19
19
|
|
|
20
|
-
`).trim();if(e)return e;let n=t.find(e=>e.type===`tool_use`);if(n)return`(The model tried to call ${`name`in n?n.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let n=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return n?`(API error: ${o(n.error)})`:null}var d,f=e((()=>{s(),
|
|
20
|
+
`).trim();if(e)return e;let n=t.find(e=>e.type===`tool_use`);if(n)return`(The model tried to call ${`name`in n?n.name:`a tool`} instead of answering directly. Try rephrasing or ask in the main conversation.)`}let n=e.find(e=>e.type===`system`&&`subtype`in e&&e.subtype===`api_error`);return n?`(API error: ${o(n.error)})`:null}var d,f=e((()=>{s(),r(),i(),d=/^\/btw\b/gi}));export{f as n,l as r,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./sinks-mGBiINp8.js";export{e as initSinks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./axios-DaWTGg7G.js";import{Ut as n,ft as r}from"./state-D5D6QpTX.js";import{C as i,at as a,c as o,f as s,i as c,it as l,nt as u,tt as d,u as f,x as p}from"./debug-D58GQBDG.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-CZ7ploQm.js";import{i as y,n as b,t as x}from"./analytics-DJobLaWP.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-
|
|
1
|
+
import{n as e,t}from"./axios-DaWTGg7G.js";import{Ut as n,ft as r}from"./state-D5D6QpTX.js";import{C as i,at as a,c as o,f as s,i as c,it as l,nt as u,tt as d,u as f,x as p}from"./debug-D58GQBDG.js";import{o as m,r as h,t as g,v as _,y as v}from"./log-CZ7ploQm.js";import{i as y,n as b,t as x}from"./analytics-DJobLaWP.js";import{a as S,n as C,o as w}from"./firstPartyEventLogger-B261Wksn.js";import{r as T,t as E}from"./datadog-BuElf2EQ.js";import{dirname as D,join as O}from"path";t(),n(),a(),v(),d(),c(),s(),m(),p();var k=h(new Date);function A(){return O(_.errors(),`${k}.jsonl`)}function j(e){return O(_.mcpLogs(e),`${k}.jsonl`)}function M(e){let t=l(e);return{write(e){t.write(`${i(e)}\n`)},flush:t.flush,dispose:t.dispose}}var N=new Map;function P(e){let t=N.get(e);if(!t){let n=D(e);t=M({writeFn:t=>{try{f().appendFileSync(e,t)}catch{f().mkdirSync(n),f().appendFileSync(e,t)}},flushIntervalMs:1e3,maxBufferSize:50}),N.set(e,t),u(async()=>t?.dispose())}return t}function F(e,t){let n={timestamp:new Date().toISOString(),...t,cwd:f().cwd(),userType:process.env.USER_TYPE,sessionId:r(),version:`0.0.21`};P(e).write(n)}function I(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e;if(typeof t.message==`string`)return t.message;if(typeof t.error==`object`&&t.error&&`message`in t.error&&typeof t.error.message==`string`)return t.error.message}}function L(t){let n=t.stack||t.message,r=``;if(e.isAxiosError(t)&&t.config?.url){let e=[`url=${t.config.url}`];t.response?.status!==void 0&&e.push(`status=${t.response.status}`);let n=I(t.response?.data);n&&e.push(`body=${n}`),r=`[${e.join(`,`)}] `}o(`${t.name}: ${r}${n}`,{level:`error`}),F(A(),{error:`${r}${n}`})}function R(e,t){o(`MCP server "${e}" ${t}`,{level:`error`});let n=j(e),i={error:t instanceof Error?t.stack||t.message:String(t),timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function z(e,t){o(`MCP server "${e}": ${t}`);let n=j(e),i={debug:t,timestamp:new Date().toISOString(),sessionId:r(),cwd:f().cwd()};P(n).write(i)}function B(){g({logError:L,logMCPError:R,logMCPDebug:z,getErrorsPath:A,getMCPLogsPath:j}),o(`Error log sink initialized`)}E(),C(),b();function V(){return!1}function H(e,t){let n=w(e);if(n===0)return;let r=n===null?t:{...t,sample_rate:n};V()&&T(e,y(r)),S(e,r)}function U(e,t){return H(e,t),Promise.resolve()}function W(){x({logEvent:H,logEventAsync:U})}function G(){B(),W()}export{G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Am as e,Di as t,Ei as n,JT as r,Li as i,Ng as a,Nt as o,Ot as s,Pg as ee,Rn as te,SS as ne,St as re,Wr as ie,Ws as ae,Xi as oe,YT as c,Yh as se,Yi as l,Ys as ce,Zi as le,aC as u,br as ue,ci as d,cy as de,dg as fe,di as f,eh as p,fg as m,fn as pe,gy as h,hn as me,iC as he,km as ge,ly as _e,nE as g,ni as ve,ns as ye,qh as _,qi as v,rE as y,rs as b,ti as x,xS as S,xy as C,yt as w}from"./loadAgentsDir-C96o6gCj.js";import{Mn as T,Ut as E,ar as D,cr as O,ft as k,h as A,jn as j,lr as M,q as N,zn as P}from"./state-D5D6QpTX.js";import{n as be,t as F}from"./cwd-Nh5IZNKO.js";import{c as I,f as xe,i as L,nt as R,tt as Se,u as Ce}from"./debug-D58GQBDG.js";import{n as we,r as Te}from"./analytics-DJobLaWP.js";import{C as Ee,_ as De}from"./model-BaMclMXn.js";import{Gt as Oe}from"./prompt-BNNE5tsG.js";import*as z from"path";import{dirname as ke}from"path";E(),ee(),de(),Oe(),m(),C(),p(),ae(),be(),L(),se(),De(),y(),he(),ue(),S(),e(),re();function Ae(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.type!==`assistant`)continue;let r=n.message.content.find(e=>e.type===`tool_use`&&e.name===`TodoWrite`);if(r?.type!==`tool_use`)continue;let i=r.input;if(typeof i!=`object`||!i)return[];let a=ge().safeParse(i.todos);return a.success?a.data:[]}return[]}function je(e,t){if(e.fileHistorySnapshots&&e.fileHistorySnapshots.length>0&&_(e.fileHistorySnapshots,e=>{t(t=>({...t,fileHistory:e}))}),!ne()&&e.messages&&e.messages.length>0){let n=Ae(e.messages);if(n.length>0){let e=k();t(t=>({...t,todos:{...t.todos,[e]:n}}))}}}function B(e,t){if(!(!e&&!t))return{name:e??``,color:t==="default"?void 0:t}}function V(e,t,n){if(t)return{agentDefinition:t,agentType:void 0};if(!e)return T(void 0),{agentDefinition:void 0,agentType:void 0};let r=n.activeAgents.find(t=>t.agentType===e);return r?(T(r.agentType),!N()&&r.model&&r.model!==`inherit`&&j(Ee(r.model)),{agentDefinition:r,agentType:r.agentType}):(I(`Resumed session had agent "${e}" but it is no longer available. Using default behavior.`),T(void 0),{agentDefinition:void 0,agentType:void 0})}function H(e){let t=w();if(t){f(t);return}if(e){try{process.chdir(e.worktreePath)}catch{f(null);return}u(e.worktreePath),P(F()),s(e),h(),a(),g.cache.clear?.()}}function Me(){let e=w();if(e){s(null),h(),a(),g.cache.clear?.();try{process.chdir(e.originalCwd)}catch{return}u(e.originalCwd),P(F())}}async function Ne(e,t,n){if(t.forkSession)e.contentReplacements?.length&&await ie(e.contentReplacements);else{let n=t.sessionIdOverride??e.sessionId;n&&(D(fe(n),t.transcriptPath?ke(t.transcriptPath):null),await x(),_e(n))}ve(t.forkSession?{...e,worktreeSession:void 0}:e),t.forkSession||(H(e.worktreeSession),te());let{agentDefinition:r,agentType:i}=V(e.agentSetting,n.mainThreadAgentDefinition,n.agentDefinitions);d(`normal`),t.includeAttribution;let a=B(e.agentName,e.agentColor);ce(e.agentName);let o=n.agentDefinitions;return{messages:e.messages,fileHistorySnapshots:e.fileHistorySnapshots,contentReplacements:e.contentReplacements,agentName:e.agentName,agentColor:e.agentColor==="default"?void 0:e.agentColor,restoredAgentDef:r,initialState:{...n.initialState,...i&&{agent:i},...a&&{standaloneAgentContext:a},agentDefinitions:o}}}c(),E(),i(),we(),oe(),ye(),Se(),L(),xe(),me(),M();var Pe=1e3,Fe=500,Ie=300,Le=2e3,Re=typeof Bun<`u`,U=null,W=null,G=new Set,K=!1,q=!1,J=!1,Y=null,X=O(),Z=null;async function ze(){if(K||q)return;K=!0,J||(J=!0,le(()=>{n(),X.emit()}));let e=await Ve();e.length!==0&&(I(`Watching for changes in skill/command directories: ${e.join(`, `)}...`),U=r.watch(e,{persistent:!0,ignoreInitial:!0,depth:2,awaitWriteFinish:{stabilityThreshold:Z?.stabilityThreshold??Pe,pollInterval:Z?.pollInterval??Fe},ignored:(e,t)=>t&&!t.isFile()&&!t.isDirectory()?!0:e.split(z.sep).some(e=>e===`.git`),ignorePermissionErrors:!0,usePolling:Re,interval:Z?.chokidarInterval??Le,atomic:!0}),U.on(`add`,$),U.on(`change`,$),U.on(`unlink`,$),Y=R(async()=>{await Q()}))}function Q(){q=!0,Y&&(Y(),Y=null);let e=Promise.resolve();return U&&(e=U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),e}var Be=X.subscribe;async function Ve(){let e=Ce(),t=[],n=l(`userSettings`,`skills`);if(n)try{await e.stat(n),t.push(n)}catch{}let r=l(`userSettings`,`commands`);if(r)try{await e.stat(r),t.push(r)}catch{}let i=l(`projectSettings`,`skills`);if(i)try{let n=z.resolve(i);await e.stat(n),t.push(n)}catch{}let a=l(`projectSettings`,`commands`);if(a)try{let n=z.resolve(a);await e.stat(n),t.push(n)}catch{}for(let n of A()){let r=z.join(n,`.workmate`,`skills`);try{await e.stat(r),t.push(r)}catch{}}return t}function $(e){I(`Detected skill change: ${e}`),Te(`tengu_skill_file_changed`,{source:`chokidar`}),He(e)}function He(e){G.add(e),W&&clearTimeout(W),W=setTimeout(async()=>{W=null;let e=[...G];if(G.clear(),pe(await o(`skills`,e[0]))){I(`ConfigChange hook blocked skill reload (${e.length} paths)`);return}v(),t(),b(),X.emit()},Z?.reloadDebounce??Ie)}async function Ue(e){U&&(await U.close(),U=null),W&&(clearTimeout(W),W=null),G.clear(),X.clear(),K=!1,q=!1,Z=e??null}var We={initialize:ze,dispose:Q,subscribe:Be,resetForTesting:Ue};export{V as a,Ne as i,B as n,je as o,Me as r,H as s,We as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BN2ZWzOG.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,n,s as r}from"./projectContext-BN2ZWzOG.js";import{i,r as a}from"./instinctParser-Dt-lqnDe.js";import{c as o,o as s,s as c}from"./skillLifecycle-ADUTDK7D.js";import{dirname as l,join as u}from"node:path";import{existsSync as d}from"node:fs";import{createHash as f}from"node:crypto";import{mkdir as p,readFile as m,rename as h,writeFile as g}from"node:fs/promises";async function _(e){let t=e.prompt.trim();if(!t)throw Error(`Cannot record an empty skill gap`);let n=e.project??r(e.cwd),i=await A(n,e.rootDir),a=F(t),o=new Date().toISOString(),s=i.gaps[a],c={key:a,prompt:t,count:(s?.count??0)+1,draftHits:s?.draftHits??0,draftHitSessions:s?.draftHitSessions??[],status:s?.status??`pending`,sessionId:e.sessionId??`unknown-session`,cwd:e.cwd??n.cwd,projectId:n.projectId,projectName:n.projectName,recommendations:(e.recommendations??[]).slice(0,5).map(e=>({name:e.name,description:e.description,score:e.score})),createdAt:s?.createdAt??o,updatedAt:o,draft:s?.draft,active:s?.active};return c.status===`rejected`?(i.gaps[a]=c,await N(n,i,e.rootDir),c):(!c.draft&&C(c)&&(c.draft=await T(c,n),c.status=`draft`,await z()),c.draft&&!c.active&&w(c)&&(c.active=await E(c,n),c.status=`active`,await z()),i.gaps[a]=c,await N(n,i,e.rootDir),c)}async function v(e=r(),t){let n=await A(e,t);return Object.values(n.gaps).sort((e,t)=>e.key.localeCompare(t.key))}async function y(e,t=r(),n){let i=await A(t,n);for(let t of Object.values(i.gaps))if(t.draft?.skillPath===e)return t.key}async function b(e,t=r(),n,i=`unknown-session`){let a=await A(t,n),o=a.gaps[e];if(!o?.draft||o.active)return o;let s=o.draftHitSessions??[];if(s.includes(i))return o;let c=new Date().toISOString(),l={...o,draftHits:o.draftHits+1,draftHitSessions:[...s,i],updatedAt:c};return w(l)&&(l.active=await E(l,t),l.status=`active`,await z()),a.gaps[e]=l,await N(t,a,n),l}async function x(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;if(a.status===`rejected`||a.draft)return a;let o={...a,draft:await T(a,t),status:`draft`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),await z(),o}async function S(e,t=r(),n){let i=await A(t,n),a=i.gaps[e];if(!a)return;let o={...a,status:`rejected`,updatedAt:new Date().toISOString()};return i.gaps[e]=o,await N(t,i,n),o}function C(e){return e.count>=B}function w(e){return e.draft?e.count>=V||e.draftHits>=H:!1}async function T(e,t){let n=D(e,`pending`),r=u(t.projectRoot??t.cwd,`.workmate`,`skills`,`.drafts`),i=s([n],{cwd:t.projectRoot??t.cwd,outputRoot:r,scope:`project`,name:`draft-${I(e.prompt)}`,description:`Draft learned skill candidate. Promote after repeated evidence or explicit user correction.`}),a=u(i.outputPath,`SKILL.md`);return d(a)||await o({...i,content:i.content+`
|
|
2
2
|
## Promotion Rule
|
|
3
3
|
|
|
4
4
|
Do not move this draft into active skills until the same gap repeats or the user explicitly confirms this should become reusable.
|
|
5
|
-
`}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-
|
|
5
|
+
`}),{type:`draft`,name:i.name,skillPath:a}}async function E(e,t){let n=s([D(e,`active`)],{cwd:t.projectRoot??t.cwd,scope:`project`,name:I(e.prompt),description:O(e.prompt)}),r=u(n.outputPath,`SKILL.md`);return d(r)||await o(n),{type:`active`,name:n.name,skillPath:r}}function D(e,t){return a({trigger:`When the user asks for ${L(e.prompt,120)}`,action:O(e.prompt),confidence:t===`active`?.82:.55,domain:k(e.prompt),source:`session-observation`,scope:`project`,projectId:e.projectId,projectName:e.projectName,evidence:[`Skill gap prompt: ${L(e.prompt,180)}`,`No high-confidence active skill was auto-loaded.`,`Observed ${e.count} time(s).`],status:t})}function O(e){return/feature\s*\(|feature flag|flag_name|stub|no-op|noop|最小实现/i.test(e)?`Audit feature flags by scanning feature() call sites, excluding generated/dependency noise, classifying each candidate as stub, shell, MVP, or thin-toggle, and writing an evidence-backed document.`:/skill|技能|学习|进化|evolve|learning/i.test(e)?`Run skill discovery first; auto-load only high-confidence matching skills; record a skill gap when none match; promote repeated or corrected gaps into learned skills.`:/test|测试|stub|调用链|参数/i.test(e)?`Infer tests from existing files, parameters, exports, and call chains before simplifying mocks or inventing behavior.`:`Reuse the workflow learned from this prompt: ${L(e,180)}.`}function k(e){let t=e.toLowerCase();return/test|测试|stub|fixture|断言/.test(t)?`testing`:/error|bug|fix|失败|错误|修复|debug/.test(t)?`debugging`:/security|安全|漏洞|secret|token/.test(t)?`security`:/git|commit|branch|pr\b/.test(t)?`git`:/style|lint|format|命名|规范/.test(t)?`code-style`:`workflow`}async function A(e,t){let n=P(e,t),r;try{r=await m(n,`utf8`)}catch(e){if(e.code===`ENOENT`)return{version:1,gaps:{}};throw e}try{return j(JSON.parse(r))}catch{let e=`${n}.corrupt-${Date.now()}`;try{await g(e,r,`utf8`)}catch{}return{version:1,gaps:{}}}}function j(e){let t={};for(let[n,r]of Object.entries(e.gaps??{})){let e=r,i=typeof e.draftHits==`number`&&Number.isFinite(e.draftHits)?e.draftHits:0,a=typeof e.count==`number`?e.count:1,o=M(e.status),s=!!e.draft,c=!!e.active,l=o;l===`draft`&&a<B&&!s&&(l=`pending`),l===`active`&&!c&&(l=s?`draft`:`pending`);let u=Array.isArray(e.draftHitSessions)?e.draftHitSessions.filter(e=>typeof e==`string`):[];t[n]={...r,count:a,draftHits:i,draftHitSessions:u,status:l}}return{version:1,gaps:t}}function M(e){return e===`pending`||e===`draft`||e===`active`||e===`rejected`?e:`pending`}async function N(e,t,n){let r=P(e,n);await p(l(r),{recursive:!0});let i=`${r}.tmp-${process.pid}-${Date.now()}`;await g(i,`${JSON.stringify(t,null,2)}\n`,`utf8`),await h(i,r)}function P(e,t){return u(t?e.projectId===`global`?u(t,`global`):u(t,`projects`,e.projectId):n(e.projectId),`skill-gaps.json`)}function F(e){return`${I(e)}-${R(e).slice(0,8)}`}function I(e){let t=e.replaceAll(`技能`,` skill `).replaceAll(`学习`,` learning `).replaceAll(`进化`,` evolution `).replaceAll(`测试`,` testing `).replaceAll(`最小实现`,` minimal implementation `).toLowerCase(),n=new Set([`the`,`and`,`for`,`with`,`this`,`that`,`user`,`about`,`feature`,`flag`,`name`]);return((t.match(/[a-z0-9][a-z0-9_-]{2,}/g)??[]).filter(e=>!n.has(e)).slice(0,5).join(`-`)||`learned-gap`).slice(0,54).replace(/-+$/g,``)}function L(e,t){return e.replace(/\s+/g,` `).trim().slice(0,t)}function R(e){return f(`sha1`).update(e).digest(`hex`)}async function z(){try{let{clearCommandsCache:e}=await import(`./commands-C_rYjyQZ.js`);e()}catch{}}var B,V,H;e((()=>{i(),t(),c(),B=2,V=4,H=2}))();export{y as findGapKeyByDraftPath,x as promoteGapToDraft,v as readSkillGaps,b as recordDraftHit,_ as recordSkillGap,S as rejectSkillGap,w as shouldPromoteToActive,C as shouldPromoteToDraft};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{o as r,t as i}from"./localSearch-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{o as r,t as i}from"./localSearch-DLz5IGGu.js";import{l as a,u as o}from"./instinctParser-Dt-lqnDe.js";import{basename as s,dirname as c,join as l}from"node:path";import{existsSync as u}from"node:fs";import{mkdir as d,readFile as f,readdir as p,rename as m,rm as ee,writeFile as h}from"node:fs/promises";function g(e){return e.length!==0&&e.reduce((e,t)=>e+t.confidence,0)/e.length>=a().minConfidence}function te(e){let t=e[0]?.domain??`project`,n=b[t],r=new Set;for(let t of e){for(let e of`${t.trigger} ${t.action}`.toLowerCase().split(/[^a-z0-9]+/))if(y(e)&&r.add(e),r.size>=5)break;if(r.size>=5)break}let i=_([n,...r].join(`-`));return v(i)?`${n}-learned-pattern`:i}function _(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,64).replace(/-$/g,``)||`learned-skill`}function v(e){return x.has(e)}function y(e){return e.length>2&&![`when`,`with`,`this`,`that`,`user`,`project`,`prefer`,`avoid`,`use`,`using`,`the`,`and`,`for`].includes(e)}var b,x,S=e((()=>{o(),b={workflow:`workflow`,testing:`testing`,debugging:`debugging`,"code-style":`style`,security:`security`,git:`git`,project:`project`},x=new Set([`learned-skill`,`better-skill`,`new-skill`,`project-skill`,`workflow-skill`])}));function C(e,t){if(e.length===0)throw Error(`Cannot generate a skill draft without instincts`);let n=t?.scope??e[0]?.scope??`project`,r=t?.name?_(t.name):E(e),i=e.reduce((e,t)=>e+t.confidence,0)/e.length,a=t?.description??D(e),o=re(r,n,t),s=O({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 w(e,t,n){let r=C(e,t),i=await P(`skill`,r,n);for(let t of i){let n=ie(r,t);if(n>=.8)return{action:`append-evidence`,target:t,overlap:n,appendedPath:await ne(t,e)}}return{action:`create`,draft:r}}async function ne(e,t){let n=await f(e.path,`utf8`).catch(()=>e.content);if(Buffer.byteLength(n,`utf8`)>=M)return e.path;let r=t.flatMap(e=>e.evidence.map(e=>`- ${e}`)),a=r.slice(0,A);a.length<r.length&&a.push(`- [... ${r.length-a.length} more evidence entries omitted]`);let o=[``,`## Learned evidence (${new Date().toISOString()})`,``,...a,``].join(`
|
|
2
2
|
`),s=n.endsWith(`
|
|
3
|
-
`)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-
|
|
3
|
+
`)?n+o:`${n}\n${o}`,c=Buffer.byteLength(s,`utf8`)>M?s.slice(0,M):s;return await h(e.path,c,`utf8`),i(),e.path}async function T(e){await d(e.outputPath,{recursive:!0});let t=l(e.outputPath,`SKILL.md`);await h(t,e.content,`utf8`),i();try{let{clearCommandsCache:e}=await import(`./commands-C_rYjyQZ.js`);e()}catch{}return t}function re(e,n,r){return r?.outputRoot?l(r.outputRoot,e):n===`project`?l(r?.cwd??process.cwd(),`.workmate`,`skills`,e):l(r?.globalSkillsDir??l(t(),`skills`),e)}function E(e){return te(e)}function D(e){let t=(e[0]?.action??`Apply a learned project pattern`).replace(/\s+/g,` `).slice(0,120);return t.length>0?t:`Apply learned project patterns`}function O(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(`, `)}]`,`---`,``,`# ${k(t)}`,``,`## Trigger`,``,i.map(e=>`- ${e.trigger}`).join(`
|
|
4
4
|
`),``,`## Action`,``,i.map(e=>`- ${e.action}`).join(`
|
|
5
5
|
`),``,`## Evidence`,``,i.flatMap(e=>e.evidence.map(e=>`- ${e}`)).slice(0,j).join(`
|
|
6
6
|
`),``].join(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{
|
|
2
|
-
`)}async function m(){if(n()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{FT as n,PT as r,Pu as i,ju as a}from"./loadAgentsDir-C96o6gCj.js";import{I as o,P as s,ai as c,hn as l,t as u,y as d}from"./src-DL3w8VPk.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";function p(){return[`Skill Search (自动技能匹配)`,`Status: ${n()?`enabled`:`disabled`}`,``,`When enabled, relevant skills are automatically matched and`,`injected into conversation context each turn.`].join(`
|
|
2
|
+
`)}async function m(){if(n()&&process.env.SKILL_SEARCH_ENABLED!==`0`)return`Skill Search: already enabled`;process.env.SKILL_SEARCH_ENABLED=`1`;let e=[`Skill Search: enabled (SKILL_SEARCH_ENABLED=1)`];try{let{clearSkillIndexCache:t}=await import(`./localSearch-dodgnjGn.js`);t(),e.push(`Skill index cache: cleared (will rebuild on next search)`)}catch{e.push(`Skill index cache: clear skipped`)}return e.join(`
|
|
3
3
|
`)}async function h(){return n()?(process.env.SKILL_SEARCH_ENABLED=`0`,`Skill Search: disabled (SKILL_SEARCH_ENABLED=0)`):`Skill Search: already disabled`}function g({onDone:e}){i(`skill-search-panel`);let[t,n]=(0,v.useState)(0),r=(0,v.useMemo)(()=>[{label:`Status`,description:`显示自动 skill 匹配是否已启用`,run:()=>Promise.resolve(p())},{label:`Start`,description:`为本次会话启用自动 skill 匹配`,run:m},{label:`Stop`,description:`为本次会话禁用自动 skill 匹配`,run:h},{label:`About`,description:`自动 skill 匹配的工作原理`,run:()=>Promise.resolve(x)}],[]),a=()=>{let n=r[t];n&&n.run().then(t=>{e(t,{display:`system`})})};return l((e,t)=>{if(t.upArrow){n(e=>Math.max(0,e-1));return}if(t.downArrow){n(e=>Math.min(r.length-1,e+1));return}t.return&&a()}),(0,y.jsx)(d,{title:`Skill Search`,subtitle:`${r.length} actions`,onCancel:()=>e(`Skill search panel dismissed`,{display:`system`}),color:`background`,hideInputGuide:!0,children:(0,y.jsxs)(o,{flexDirection:`column`,children:[r.map((e,n)=>(0,y.jsxs)(o,{flexDirection:`row`,children:[(0,y.jsx)(s,{children:`${n===t?`›`:` `} ${e.label}`.padEnd(b)}),(0,y.jsx)(s,{dimColor:!0,children:e.description})]},e.label)),(0,y.jsx)(o,{marginTop:1,children:(0,y.jsx)(s,{dimColor:!0,children:`↑/↓ select · Enter run · Esc close`})})]})})}async function _(e,t,n){let r=n?.trim()??``;return r===`start`?(e(await m(),{display:`system`}),null):r===`stop`?(e(await h(),{display:`system`}),null):r===`about`?(e(x,{display:`system`}),null):r===`status`?(e(p(),{display:`system`}),null):(0,y.jsx)(g,{onDone:e})}var v,y,b,x;e((()=>{v=t(c(),1),u(),a(),r(),y=f(),b=28,x=`# Skill Search (自动技能匹配)
|
|
4
4
|
|
|
5
5
|
Skill Search 控制对话中的自动技能匹配功能。
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Ji as n,Li as r,Xi as i,np as a,rp as o,zi as s}from"./loadAgentsDir-C96o6gCj.js";import{I as c,P as l,ai as u,h as d,t as f,y as p}from"./src-DL3w8VPk.js";import{t as m}from"./jsx-runtime-Bb4Xn-E0.js";import{cn as h,on as g}from"./settings-BowI3jp-.js";import{_,v}from"./startupProfiler-B90b5vuq.js";import{l as y,o as b}from"./stringUtils-D7oJIyY2.js";function x(e,t){let n=t.trim();if(n===``)return e.slice();let r=n.toLowerCase().split(/\s+/);return e.filter(e=>{let t=`${e.name} ${e.description}`.toLowerCase();return r.every(e=>t.includes(e))})}var S=e((()=>{}));function C(e){return e===`plugin`?`plugin`:e===`mcp`?`mcp`:g(e)}function w({onExit:e,commands:t}){let[r,i]=(0,T.useState)(``),o=(0,T.useMemo)(()=>t.filter(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`commands_DEPRECATED`||e.loadedFrom===`plugin`||e.loadedFrom===`mcp`)),[t]),u=(0,T.useMemo)(()=>x(o.map(e=>({...e,name:s(e),description:e.description??``})),r),[o,r]),f=(0,T.useMemo)(()=>{let e={policySettings:[],userSettings:[],projectSettings:[],localSettings:[],flagSettings:[],plugin:[],mcp:[]};for(let t of u){let n=t.source;n in e&&e[n].push(t)}for(let t of Object.values(e))t.sort((e,t)=>s(e).localeCompare(s(t)));return e},[u]),m=()=>{e(`Skills dialog dismissed`,{display:`system`})};if(o.length===0)return(0,E.jsxs)(p,{title:`Skills`,subtitle:`No skills found`,onCancel:m,hideInputGuide:!0,children:[(0,E.jsx)(l,{dimColor:!0,children:`Create skills in .workmate/skills/ or ~/.workmate/skills/`}),(0,E.jsx)(l,{dimColor:!0,italic:!0,children:(0,E.jsx)(a,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`close`})})]});let h=e=>{switch(e){case`projectSettings`:case`localSettings`:return{label:`local`,color:`yellow`};case`userSettings`:return{label:`global`,color:`cyan`};case`policySettings`:return{label:`managed`,color:`magenta`};default:return}},g=(e,t)=>{let r=`~${_(n(e))}`,i=e.source===`plugin`?e.pluginInfo?.pluginManifest.name:void 0,a=h(e.source);return(0,E.jsxs)(c,{children:[(0,E.jsx)(l,{color:t?`suggestion`:void 0,children:s(e)}),a&&(0,E.jsxs)(l,{color:a.color,children:[` [`,a.label,`]`]}),(0,E.jsxs)(l,{dimColor:!0,children:[i?` · ${i}`:``,` · `,C(e.source),` · `,r,` tokens`]})]})};return(0,E.jsx)(d,{title:`Skills`,placeholder:`Type to filter skills…`,items:(0,T.useMemo)(()=>D.flatMap(e=>f[e]),[f]),getKey:e=>`${e.name}-${e.source}`,visibleCount:12,direction:`down`,onQueryChange:i,onSelect:t=>{e(`/${s(t)}`,{display:`user`})},onCancel:m,emptyMessage:e=>e.trim()?`No skills matching "${e.trim()}"`:`No skills found`,matchLabel:r.trim()===``?`${o.length} ${y(o.length,`skill`)}`:`${u.length}/${o.length} ${y(o.length,`skill`)}`,selectAction:`invoke skill`,renderItem:(e,t)=>g(e,t)})}var T,E,D,O=e((()=>{T=t(u(),1),r(),f(),i(),v(),h(),b(),o(),S(),E=m(),D=[`projectSettings`,`localSettings`,`userSettings`,`flagSettings`,`policySettings`,`plugin`,`mcp`]}));async function k(e,t){return(0,A.jsx)(w,{onExit:e,commands:t.options.commands})}var A;e((()=>{O(),A=m()}))();export{k as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$r as e,$t as t,An as n,B as r,Bt as i,C as a,Cn as o,Cr as s,Ct as c,D as l,Dr as u,Dt as d,En as f,Er as p,Ft as m,G as h,Gn as g,Gr as _,Gt as v,H as y,I as b,In as x,Jr as S,Jt as C,Kt as w,Lt as T,Mn as E,Mr as D,N as O,On as k,P as A,Pn as j,Pr as M,Pt as N,Q as P,Qn as F,Qr as I,R as L,Rn as R,Sn as z,T as B,Tn as V,Tt as H,U,Un as W,V as G,Vn as K,Vt as q,Wt as J,Xn as Y,Xr as X,Xt as Z,Y as Q,Yt as $,Z as ee,Zn as te,Zt as ne,_ as re,_n as ie,_r as ae,a as oe,an as se,ar as ce,br as le,ci as ue,cn as de,cr as fe,ct as pe,d as me,dr as he,dt as ge,en as _e,er as ve,et as ye,fn as be,fr as xe,ft as Se,gr as Ce,gt as we,h as Te,hn as Ee,hr as De,ir as Oe,it as ke,j as Ae,jt as je,k as Me,kn as Ne,kr as Pe,kt as Fe,l as Ie,ln as Le,lr as Re,lt as ze,mr as Be,mt as Ve,n as He,nn as Ue,nt as We,o as Ge,oi as Ke,on as qe,or as Je,ot as Ye,p as Xe,pn as Ze,pr as Qe,q as $e,qn as et,r as tt,ri as nt,rn as rt,rr as it,s as at,si as ot,sn as st,sr as ct,t as lt,ti as ut,tn as dt,tr as ft,un as pt,vr as mt,vt as ht,x as gt,xn as _t,xr as vt,xt as yt,y as bt,yr as xt,yt as St,zn as Ct}from"./src-DL3w8VPk.js";lt();export{St as AlternateScreen,m as Ansi,et as BaseBox,g as BaseText,b as Box,je as Button,B as Byline,Je as CLEAR_ITERM2_PROGRESS,ct as CLEAR_TAB_STATUS,fe as CLEAR_TERMINAL_TITLE,Ct as ClickEvent,Be as DBP,De as DFE,I as DISABLE_KITTY_KEYBOARD,e as DISABLE_MODIFY_OTHER_KEYS,Ce as DISABLE_MOUSE_TRACKING,P as DOUBLE_PRESS_TIMEOUT_MS,bt as Dialog,a as Divider,ae as ENABLE_MOUSE_TRACKING,mt as ENTER_ALT_SCREEN,xt as EXIT_ALT_SCREEN,nt as Event,ut as EventEmitter,Pe as FocusEvent,u as FocusManager,Te as FuzzyPicker,le as HIDE_CURSOR,n as Ink,X as InputEvent,w as KeybindingProvider,q as KeybindingSetup,K as KeyboardEvent,l as KeyboardShortcutHint,T as Link,re as ListItem,Xe as LoadingState,Fe as Newline,H as NoSelect,gt as Pane,me as ProgressBar,Ie as Ratchet,c as RawAnsi,vt as SHOW_CURSOR,yt as ScrollBox,Me as SearchBox,d as Spacer,at as StatusIcon,_t as THEME_NAMES,z as THEME_SETTINGS,He as Tab,tt as Tabs,S as TerminalFocusEvent,W as TerminalSizeContext,E as TerminalWriteProvider,A as Text,O as TextHoverColorContext,L as ThemeProvider,Ke as applyColor,ot as applyTextStyles,Ue as chordToDisplayString,rt as chordToString,s as clamp,Ae as color,ue as colorize,f as createRoot,ne as getBindingDisplayText,Re as getClipboardPath,pt as getKeyName,te as getTerminalFocusState,F as getTerminalFocused,o as getTheme,ft as hasCursorUpViewportYankBug,R as instances,it as isSynchronizedOutputSupported,Oe as isXtermJs,se as keystrokeToDisplayString,qe as keystrokeToString,t as keystrokesEqual,be as matchesBinding,Ze as matchesKeystroke,N as measureElement,st as parseBindings,de as parseChord,Le as parseKeystroke,x as renderBorder,k as renderSync,_e as resolveKey,dt as resolveKeyWithChordState,he as setClipboard,r as setThemeConfigCallbacks,_ as stringWidth,p as styles,ve as subscribeTerminalFocus,i as supportsHyperlinks,xe as supportsTabStatus,V as themeColorToAnsi,Ve as useAnimationFrame,ge as useAnimationTimer,ht as useApp,h as useDeclaredCursor,ye as useDoublePress,pe as useHasSelection,Ee as useInput,Se as useInterval,J as useKeybinding,C as useKeybindingContext,v as useKeybindings,We as useMinDisplayTime,$ as useOptionalKeybindingContext,G as usePreviewTheme,Z as useRegisterKeybindingContext,$e as useSearchHighlight,ze as useSelection,ie as useStdin,oe as useTabHeaderFocus,ee as useTabStatus,Ge as useTabsWidth,Y as useTerminalFocus,j as useTerminalNotification,Ye as useTerminalSize,Q as useTerminalTitle,we as useTerminalViewport,y as useTheme,U as useThemeSetting,ke as useTimeout,M as wrapAnsi,Qe as wrapForMultiplexer,D as wrapText,Ne as wrappedRender,ce as writeDiffToTerminal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,i as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{n as a,t as o}from"./esm-lWlUmoUA.js";import{
|
|
2
|
-
`;return t}_serializeMetricData(e,t){let r=x(_(e.descriptor.name));this._prefix&&(r=`${this._prefix}${r}`);let i=e.dataPointType;r=S(r,e);let a=`# HELP ${r} ${_(e.descriptor.description||`description missing`)}`,o=e.descriptor.unit?`\n# UNIT ${r} ${_(e.descriptor.unit)}`:``,s=`# TYPE ${r} ${w(e)}`,c;if(this._withoutScopeInfo)c=this._additionalAttributes;else{let e={[h.ATTR_OTEL_SCOPE_NAME]:t.name};t.schemaUrl&&(e[g]=t.schemaUrl),t.version&&(e[h.ATTR_OTEL_SCOPE_VERSION]=t.version),c=Object.assign(e,this._additionalAttributes)}let l=``;switch(i){case p.DataPointType.SUM:case p.DataPointType.GAUGE:l=e.dataPoints.map(t=>this._serializeSingularDataPoint(r,e,t,c)).join(``);break;case p.DataPointType.HISTOGRAM:l=e.dataPoints.map(t=>this._serializeHistogramDataPoint(r,e,t,c)).join(``);break;default:n.diag.error(`Unrecognizable DataPointType: ${i} for metric "${r}"`)}return`${a}${o}\n${s}\n${l}`.trim()}_serializeSingularDataPoint(e,t,n,r){let i=``;e=S(e,t);let{value:a,attributes:o}=n,s=(0,m.hrTimeToMilliseconds)(n.endTime);return i+=T(e,o,a,this._appendTimestamp?s:void 0,r),i}_serializeHistogramDataPoint(e,t,n,r){let i=``;e=S(e,t);let a=n.attributes,o=n.value,s=(0,m.hrTimeToMilliseconds)(n.endTime);for(let t of[`count`,`sum`]){let n=o[t];n!=null&&(i+=T(e+`_`+t,a,n,this._appendTimestamp?s:void 0,r))}let c=0,l=o.buckets.counts.entries(),u=!1;for(let[t,n]of l){c+=n;let l=o.buckets.boundaries[t];if(l===void 0&&u)break;l===1/0&&(u=!0),i+=T(e+`_bucket`,a,c,this._appendTimestamp?s:void 0,Object.assign({},r,{le:l===void 0||l===1/0?`+Inf`:String(l)}))}return i}_serializeResource(e){if(this._withoutTargetInfo===!0)return``;let t=`target_info`;return`${`# HELP ${t} Target metadata`}\n${`# TYPE ${t} gauge`}\n${T(t,e.attributes,1).trim()}\n`}}})),m=n((n=>{r(),Object.defineProperty(n,"__esModule",{value:!0}),n.PrometheusExporter=void 0;var
|
|
1
|
+
import{a as e,i as t,t as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{n as a,t as o}from"./esm-lWlUmoUA.js";import{_ as s,n as c,t as l,v as u}from"./esm-BbMeEYcz.js";import{n as d,t as f}from"./esm-0CwQE5CJ.js";var p=n((t=>{r(),Object.defineProperty(t,"__esModule",{value:!0}),t.PrometheusSerializer=void 0;var n=(a(),e(o)),p=(d(),e(f)),m=(c(),e(l)),h=(u(),e(s)),g=`otel.scope.schema_url`;function _(e){return e.replace(/\\/g,`\\\\`).replace(/\n/g,`\\n`)}function v(e=``){return typeof e!=`string`&&(e=JSON.stringify(e)),_(e).replace(/"/g,`\\"`)}var y=/[^a-z0-9_]/gi,b=/_{2,}/g;function x(e){return e.replace(y,`_`).replace(b,`_`)}function S(e,t){return!e.endsWith(`_total`)&&t.dataPointType===p.DataPointType.SUM&&t.isMonotonic&&(e+=`_total`),e}function C(e){return e===1/0?`+Inf`:e===-1/0?`-Inf`:`${e}`}function w(e){switch(e.dataPointType){case p.DataPointType.SUM:return e.isMonotonic?`counter`:`gauge`;case p.DataPointType.GAUGE:return`gauge`;case p.DataPointType.HISTOGRAM:return`histogram`;default:return`untyped`}}function T(e,t,n,r,i){let a=!1,o=``;for(let[e,n]of Object.entries(t)){let t=x(e);a=!0,o+=`${o.length>0?`,`:``}${t}="${v(n)}"`}if(i)for(let[e,t]of Object.entries(i)){let n=x(e);a=!0,o+=`${o.length>0?`,`:``}${n}="${v(t)}"`}return a&&(e+=`{${o}}`),`${e} ${C(n)}${r===void 0?``:` `+String(r)}\n`}var E=`# no registered metrics`;t.PrometheusSerializer=class{constructor(e,t=!1,n,r,a){i(this,`_prefix`,void 0),i(this,`_appendTimestamp`,void 0),i(this,`_additionalAttributes`,void 0),i(this,`_withResourceConstantLabels`,void 0),i(this,`_withoutScopeInfo`,void 0),i(this,`_withoutTargetInfo`,void 0),e&&(this._prefix=e+`_`),this._appendTimestamp=t,this._withResourceConstantLabels=n,this._withoutScopeInfo=!!a,this._withoutTargetInfo=!!r}serialize(e){let t=``;this._additionalAttributes=this._filterResourceConstantLabels(e.resource.attributes,this._withResourceConstantLabels);for(let n of e.scopeMetrics)t+=this._serializeScopeMetrics(n);return t===``&&(t+=E),this._serializeResource(e.resource)+t}_filterResourceConstantLabels(e,t){if(t){let n={};for(let[r,i]of Object.entries(e))r.match(t)&&(n[r]=i);return n}}_serializeScopeMetrics(e){let t=``;for(let n of e.metrics)t+=this._serializeMetricData(n,e.scope)+`
|
|
2
|
+
`;return t}_serializeMetricData(e,t){let r=x(_(e.descriptor.name));this._prefix&&(r=`${this._prefix}${r}`);let i=e.dataPointType;r=S(r,e);let a=`# HELP ${r} ${_(e.descriptor.description||`description missing`)}`,o=e.descriptor.unit?`\n# UNIT ${r} ${_(e.descriptor.unit)}`:``,s=`# TYPE ${r} ${w(e)}`,c;if(this._withoutScopeInfo)c=this._additionalAttributes;else{let e={[h.ATTR_OTEL_SCOPE_NAME]:t.name};t.schemaUrl&&(e[g]=t.schemaUrl),t.version&&(e[h.ATTR_OTEL_SCOPE_VERSION]=t.version),c=Object.assign(e,this._additionalAttributes)}let l=``;switch(i){case p.DataPointType.SUM:case p.DataPointType.GAUGE:l=e.dataPoints.map(t=>this._serializeSingularDataPoint(r,e,t,c)).join(``);break;case p.DataPointType.HISTOGRAM:l=e.dataPoints.map(t=>this._serializeHistogramDataPoint(r,e,t,c)).join(``);break;default:n.diag.error(`Unrecognizable DataPointType: ${i} for metric "${r}"`)}return`${a}${o}\n${s}\n${l}`.trim()}_serializeSingularDataPoint(e,t,n,r){let i=``;e=S(e,t);let{value:a,attributes:o}=n,s=(0,m.hrTimeToMilliseconds)(n.endTime);return i+=T(e,o,a,this._appendTimestamp?s:void 0,r),i}_serializeHistogramDataPoint(e,t,n,r){let i=``;e=S(e,t);let a=n.attributes,o=n.value,s=(0,m.hrTimeToMilliseconds)(n.endTime);for(let t of[`count`,`sum`]){let n=o[t];n!=null&&(i+=T(e+`_`+t,a,n,this._appendTimestamp?s:void 0,r))}let c=0,l=o.buckets.counts.entries(),u=!1;for(let[t,n]of l){c+=n;let l=o.buckets.boundaries[t];if(l===void 0&&u)break;l===1/0&&(u=!0),i+=T(e+`_bucket`,a,c,this._appendTimestamp?s:void 0,Object.assign({},r,{le:l===void 0||l===1/0?`+Inf`:String(l)}))}return i}_serializeResource(e){if(this._withoutTargetInfo===!0)return``;let t=`target_info`;return`${`# HELP ${t} Target metadata`}\n${`# TYPE ${t} gauge`}\n${T(t,e.attributes,1).trim()}\n`}}})),m=n((n=>{r(),Object.defineProperty(n,"__esModule",{value:!0}),n.PrometheusExporter=void 0;var s=(a(),e(o)),u=(c(),e(l)),m=(d(),e(f)),h=t(`http`),g=p(),_=t(`url`),v=class e extends m.MetricReader{constructor(t={},n=()=>{}){super({aggregationSelector:e=>({type:m.AggregationType.DEFAULT}),aggregationTemporalitySelector:e=>m.AggregationTemporality.CUMULATIVE,metricProducers:t.metricProducers}),i(this,`_host`,void 0),i(this,`_port`,void 0),i(this,`_baseUrl`,void 0),i(this,`_endpoint`,void 0),i(this,`_server`,void 0),i(this,`_prefix`,void 0),i(this,`_appendTimestamp`,void 0),i(this,`_serializer`,void 0),i(this,`_startServerPromise`,void 0),i(this,`_requestHandler`,(e,t)=>{e.url!=null&&new _.URL(e.url,this._baseUrl).pathname===this._endpoint?this._exportMetrics(t):this._notFound(t)}),i(this,`_exportMetrics`,e=>{e.statusCode=200,e.setHeader(`content-type`,`text/plain`),this.collect().then(t=>{let{resourceMetrics:n,errors:r}=t;r.length&&s.diag.error(`PrometheusExporter: metrics collection errors`,...r),e.end(this._serializer.serialize(n))},t=>{e.end(`# failed to export metrics: ${t}`)})}),i(this,`_notFound`,e=>{e.statusCode=404,e.end()}),this._host=t.host||process.env.OTEL_EXPORTER_PROMETHEUS_HOST||e.DEFAULT_OPTIONS.host,this._port=t.port||Number(process.env.OTEL_EXPORTER_PROMETHEUS_PORT)||e.DEFAULT_OPTIONS.port,this._prefix=t.prefix||e.DEFAULT_OPTIONS.prefix,this._appendTimestamp=typeof t.appendTimestamp==`boolean`?t.appendTimestamp:e.DEFAULT_OPTIONS.appendTimestamp;let r=t.withResourceConstantLabels||e.DEFAULT_OPTIONS.withResourceConstantLabels,a=t.withoutScopeInfo||e.DEFAULT_OPTIONS.withoutScopeInfo,o=t.withoutTargetInfo||e.DEFAULT_OPTIONS.withoutTargetInfo;this._server=(0,h.createServer)(this._requestHandler).unref(),this._serializer=new g.PrometheusSerializer(this._prefix,this._appendTimestamp,r,o,a),this._baseUrl=`http://${this._host}:${this._port}/`,this._endpoint=(t.endpoint||e.DEFAULT_OPTIONS.endpoint).replace(/^([^/])/,`/$1`),t.preventServerStart===!0?n&&queueMicrotask(n):this.startServer().then(n,e=>{s.diag.error(e),n(e)})}async onForceFlush(){}onShutdown(){return this.stopServer()}stopServer(){return this._server?new Promise(e=>{this._server.close(t=>{t?t.code!==`ERR_SERVER_NOT_RUNNING`&&(0,u.globalErrorHandler)(t):s.diag.debug(`Prometheus exporter was stopped`),e()})}):(s.diag.debug(`Prometheus stopServer() was called but server was never started.`),Promise.resolve())}startServer(){return this._startServerPromise??(this._startServerPromise=new Promise((e,t)=>{this._server.once(`error`,t),this._server.listen({port:this._port,host:this._host},()=>{s.diag.debug(`Prometheus exporter server started: ${this._host}:${this._port}/${this._endpoint}`),e()})})),this._startServerPromise}getMetricsRequestHandler(e,t){this._exportMetrics(t)}};i(v,`DEFAULT_OPTIONS`,{host:void 0,port:9464,endpoint:`/metrics`,prefix:``,appendTimestamp:!1,withResourceConstantLabels:void 0,withoutScopeInfo:!1,withoutTargetInfo:!1}),n.PrometheusExporter=v})),h=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PrometheusSerializer=e.PrometheusExporter=void 0;var t=m();Object.defineProperty(e,"PrometheusExporter",{enumerable:!0,get:function(){return t.PrometheusExporter}});var n=p();Object.defineProperty(e,"PrometheusSerializer",{enumerable:!0,get:function(){return n.PrometheusSerializer}})}));export default h();export{};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Gr as o,t as s}from"./src-DL3w8VPk.js";import{Ut as ee,ft as te}from"./state-D5D6QpTX.js";import{T as c,c as l,f as u,i as d,u as ne,x as f}from"./debug-D58GQBDG.js";import{n as p,r as m}from"./analytics-DJobLaWP.js";import{i as h,n as g,o as _,r as v}from"./intl-D2kgJmX7.js";import{dirname as re,join as ie}from"path";function y(e,t){if(o(e)<=t)return e;if(t<=0)return`…`;if(t<5)return b(e,t);let n=e.lastIndexOf(`/`),r=n>=0?e.slice(n):e,i=n>=0?e.slice(0,n):``,a=o(r);if(a>=t-1)return x(e,t);let s=t-1-a;return s<=0?x(r,t):`${S(i,s)}…${r}`}function b(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t-1)break;r+=i,n+=e}return`${r}…`}function x(e,t){if(o(e)<=t)return e;if(t<=1)return`…`;let n=[...g().segment(e)],r=0,i=n.length;for(let e=n.length-1;e>=0;e--){let a=o(n[e].segment);if(r+a>t-1)break;r+=a,i=e}return`…`+n.slice(i).map(e=>e.segment).join(``)}function S(e,t){if(o(e)<=t)return e;if(t<=0)return``;let n=0,r=``;for(let{segment:i}of g().segment(e)){let e=o(i);if(n+e>t)break;r+=i,n+=e}return r}function C(e,t,n=!1){if(e==null)return``;let r=e;if(n){let n=e.indexOf(`
|
|
2
2
|
`);if(n!==-1)return r=e.substring(0,n),o(r)+1>t?b(r,t):`${r}…`}return o(r)<=t?r:b(r,t)}var w=e((()=>{s(),_()}));function T(e){let t=e/1024;if(t<1)return`${e} bytes`;if(t<1024)return`${t.toFixed(1).replace(/\.0$/,``)}KB`;let n=t/1024;return n<1024?`${n.toFixed(1).replace(/\.0$/,``)}MB`:`${(n/1024).toFixed(1).replace(/\.0$/,``)}GB`}function E(e){return`${(e/1e3).toFixed(1)}s`}function D(e,t){if(e<6e4)return e===0?`0s`:e<1?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/1e3).toString()}s`;let n=Math.floor(e/864e5),r=Math.floor(e%864e5/36e5),i=Math.floor(e%36e5/6e4),a=Math.round(e%6e4/1e3);a===60&&(a=0,i++),i===60&&(i=0,r++),r===24&&(r=0,n++);let o=t?.hideTrailingZeros;return t?.mostSignificantOnly?n>0?`${n}d`:r>0?`${r}h`:i>0?`${i}m`:`${a}s`:n>0?o&&r===0&&i===0?`${n}d`:o&&i===0?`${n}d ${r}h`:`${n}d ${r}h ${i}m`:r>0?o&&i===0&&a===0?`${r}h`:o&&a===0?`${r}h ${i}m`:`${r}h ${i}m ${a}s`:i>0?o&&a===0?`${i}m`:`${i}m ${a}s`:`${a}s`}function O(e){return F(e>=1e3).format(e).toLowerCase()}function k(e){return O(e).replace(`.0`,``)}function A(e,t={}){let{style:n=`narrow`,numeric:r=`always`,now:i=new Date}=t,a=e.getTime()-i.getTime(),o=Math.trunc(a/1e3);for(let{unit:e,seconds:t,shortUnit:i}of[{unit:`year`,seconds:31536e3,shortUnit:`y`},{unit:`month`,seconds:2592e3,shortUnit:`mo`},{unit:`week`,seconds:604800,shortUnit:`w`},{unit:`day`,seconds:86400,shortUnit:`d`},{unit:`hour`,seconds:3600,shortUnit:`h`},{unit:`minute`,seconds:60,shortUnit:`m`},{unit:`second`,seconds:1,shortUnit:`s`}])if(Math.abs(o)>=t){let a=Math.trunc(o/t);return n===`narrow`?o<0?`${Math.abs(a)}${i} ago`:`in ${a}${i}`:v(`long`,r).format(a,e)}return n===`narrow`?o<=0?`0s ago`:`in 0s`:v(n,r).format(0,`second`)}function j(e,t={}){let{now:n=new Date,...r}=t;return e>n?A(e,{...r,now:n}):A(e,{...r,numeric:`always`,now:n})}function M(e){let t=e.fileSize===void 0?`${e.messageCount} messages`:T(e.fileSize),n=[j(e.modified,{style:`short`}),...e.gitBranch?[e.gitBranch]:[],t];return e.tag&&n.push(`#${e.tag}`),e.agentSetting&&n.push(`@${e.agentSetting}`),e.prNumber&&n.push(e.prRepository?`${e.prRepository}#${e.prNumber}`:`#${e.prNumber}`),n.join(` · `)}function ae(e,t=!1,n=!0){if(!e)return;let r=new Date(e*1e3),i=new Date,a=r.getMinutes();if((r.getTime()-i.getTime())/(1e3*60*60)>24){let e={month:`short`,day:`numeric`,hour:n?`numeric`:void 0,minute:!n||a===0?void 0:`2-digit`,hour12:n?!0:void 0};return r.getFullYear()!==i.getFullYear()&&(e.year=`numeric`),r.toLocaleString(`en-US`,e).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}return r.toLocaleTimeString(`en-US`,{hour:`numeric`,minute:a===0?void 0:`2-digit`,hour12:!0}).replace(/ ([AP]M)/i,(e,t)=>t.toLowerCase())+(t?` (${h()})`:``)}var N,P,F,I=e((()=>{_(),w(),N=null,P=null,F=e=>e?(N||(N=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:1})),N):(P||(P=new Intl.NumberFormat(`en-US`,{notation:`compact`,maximumFractionDigits:1,minimumFractionDigits:0})),P)}));function L(){return V}function R(e){return e.toFixed(3)}function z(e,t,n,r,i,a,o=``){let s=r?` | RSS: ${T(r.rss)}, Heap: ${T(r.heapUsed)}`:``;return`[+${R(e).padStart(i)}ms] (+${R(t).padStart(a)}ms) ${n}${o}${s}`}var B,V,H=e((()=>{I(),i(),B=class{constructor(){a(this,`marks`,new Map),a(this,`_origin`,void 0),this._origin=Number(process.hrtime.bigint()/1000n)/1e3}mark(e){this.marks.set(e,this.now())}getEntriesByType(e){if(e!==`mark`)return[];let t=[];for(let[e,n]of this.marks)t.push({name:e,startTime:n,entryType:`mark`});return t}clearMarks(e){e===void 0?this.marks.clear():this.marks.delete(e)}now(){return Number(process.hrtime.bigint()/1000n)/1e3-this._origin}},V=new B}));function U(e){X&&(L().mark(e),J&&Z.push(process.memoryUsage()))}function W(){if(!J)return`Startup profiling not enabled`;let e=L().getEntriesByType(`mark`);if(e.length===0)return`No profiling checkpoints recorded`;let t=[];t.push(`=`.repeat(80)),t.push(`STARTUP PROFILING REPORT`),t.push(`=`.repeat(80)),t.push(``);let n=0;for(let[r,i]of e.entries())t.push(z(i.startTime,i.startTime-n,i.name,Z[r],8,7)),n=i.startTime;let r=e[e.length-1];return t.push(``),t.push(`Total startup time: ${R(r?.startTime??0)}ms`),t.push(`=`.repeat(80)),t.join(`
|
|
3
3
|
`)}function G(){if(!$){if($=!0,q(),J){let e=K(),t=re(e);ne().mkdirSync(t),c(e,W(),{encoding:`utf8`,flush:!0}),l(`Startup profiling report:`),l(W())}L().clearMarks(),Z.length=0}}function K(){return ie(t(),`startup-perf`,`${te()}.txt`)}function q(){if(!Y)return;let e=L().getEntriesByType(`mark`);if(e.length===0)return;let t=new Map;for(let n of e)t.set(n.name,n.startTime);let n={};for(let[e,[r,i]]of Object.entries(Q)){let a=t.get(r),o=t.get(i);a!==void 0&&o!==void 0&&(n[`${e}_ms`]=Math.round(o-a))}n.checkpoint_count=e.length,m(`tengu_startup_perf`,n)}var J,Y,X,Z,Q,$,oe=e((()=>{ee(),p(),d(),r(),u(),H(),f(),J=n(process.env.CLAUDE_CODE_PROFILE_STARTUP),Y=Math.random()<.005,X=J||Y,Z=[],Q={import_time:[`cli_entry`,`main_tsx_imports_loaded`],init_time:[`init_function_start`,`init_function_end`],settings_time:[`eagerLoadSettings_start`,`eagerLoadSettings_end`],total_time:[`cli_entry`,`main_after_run`]},X&&U(`profiler_initialized`),$=!1}));export{b as C,x as S,k as _,R as a,C as b,H as c,M as d,O as f,E as g,ae as h,G as i,D as l,j as m,oe as n,z as o,A as p,U as r,L as s,K as t,T as u,I as v,S as w,y as x,w as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t}from"./startupProfiler-B90b5vuq.js";e();export{t as profileCheckpoint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Kr as n,ai as r,kn as i,qr as a,t as o,vt as s}from"./src-DL3w8VPk.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{PassThrough as l}from"stream";function u({children:e}){let{exit:t}=s();return(0,m.useLayoutEffect)(()=>{let e=setTimeout(t,0);return()=>clearTimeout(e)},[t]),(0,h.jsx)(h.Fragment,{children:e})}function d(e){let t=e.indexOf(g);if(t===-1)return e;let n=t+8,r=e.indexOf(_,n);return r===-1?e:e.slice(n,r)}async function f(e,t){let n=``,r=new l;return t!==void 0&&(r.columns=t),r.on(`data`,e=>{n+=e.toString()}),await(await i((0,h.jsx)(u,{children:e}),{stdout:r,patchConsole:!1})).waitUntilExit(),d(n)}async function p(e,t){return a(await f(e,t))}var m,h,g,_,v=e((()=>{m=t(r(),1),n(),o(),h=c(),g=`\x1B[?2026h`,_=`\x1B[?2026l`}));export{f as n,p as r,v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{ai as t}from"./src-DL3w8VPk.js";import{t as n}from"./jsx-runtime-Bb4Xn-E0.js";import{h as r,v as i}from"./config-DUTgj3js.js";var a=e(t(),1);r();var o=n();function s(e,t){let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)}var c=1024;function l(){let e=new Map,t=new Map,n=new Map;return{increment(t,n=1){e.set(t,(e.get(t)??0)+n)},set(t,n){e.set(t,n)},observe(e,n){let r=t.get(e);if(r||(r={reservoir:[],count:0,sum:0,min:n,max:n},t.set(e,r)),r.count++,r.sum+=n,n<r.min&&(r.min=n),n>r.max&&(r.max=n),r.reservoir.length<c)r.reservoir.push(n);else{let e=Math.floor(Math.random()*r.count);e<c&&(r.reservoir[e]=n)}},add(e,t){let r=n.get(e);r||(r=new Set,n.set(e,r)),r.add(t)},getAll(){let r=Object.fromEntries(e);for(let[e,n]of t){if(n.count===0)continue;r[`${e}_count`]=n.count,r[`${e}_min`]=n.min,r[`${e}_max`]=n.max,r[`${e}_avg`]=n.sum/n.count;let t=[...n.reservoir].sort((e,t)=>e-t);r[`${e}_p50`]=s(t,50),r[`${e}_p95`]=s(t,95),r[`${e}_p99`]=s(t,99)}for(let[e,t]of n)r[e]=t.size;return r}}}var u=(0,a.createContext)(null);function d({store:e,children:t}){let n=(0,a.useMemo)(()=>l(),[]),r=e??n;return(0,a.useEffect)(()=>{let e=()=>{let e=r.getAll();Object.keys(e).length>0&&i(t=>({...t,lastSessionMetrics:e}))};return process.on(`exit`,e),()=>{process.off(`exit`,e)}},[r]),(0,o.jsx)(u.Provider,{value:r,children:t})}export{l as n,d as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,n,o as r,t as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{Iy as s,Py as c,Ry as l,Vy as ee,hy as u,vy as d,xy as f,yy as p}from"./loadAgentsDir-C96o6gCj.js";import{P as m,di as h,fi as g,j as _,t as v}from"./src-DL3w8VPk.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{Cn as b,bn as x,cn as S,h as C,i as w,in as T,n as E,rn as D,s as O}from"./settings-BowI3jp-.js";import{f as k,v as A}from"./startupProfiler-B90b5vuq.js";import{$r as j,Pt as M,_ as N,i as te,mt as P,ti as F,x as I,zt as L}from"./model-BaMclMXn.js";import{h as R,l as z,o as B,p as V}from"./proxy-BhIc7-mj.js";import{g as H,h as U}from"./pidLock-C1hmh3YQ.js";import{n as W,t as G}from"./nativeInstaller-CfZ5uNTh.js";import{n as K,t as q}from"./allErrors-CT2dbBF3.js";function J(){return[]}function Y(e,t=null,n){let r=e?.find(e=>e.name===`ide`);if(t){let e=ee(t.ideType),i=l(t.ideType)?`plugin`:`extension`;if(t.error)return[{label:`IDE`,value:(0,$.jsxs)(m,{children:[_(`error`,n)(o.cross),` Error installing `,e,` `,i,`:`,` `,t.error,`
|
|
2
|
+
`,`Please restart your IDE and try again.`]})}];if(t.installed)return r&&r.type===`connected`?t.installedVersion===r.serverInfo?.version?[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion}`}]:[{label:`IDE`,value:`Connected to ${e} ${i} version ${t.installedVersion} (server version: ${r.serverInfo?.version})`}]:[{label:`IDE`,value:`Installed ${e} ${i}`}]}else if(r){let e=c(r)??`IDE`;return r.type===`connected`?[{label:`IDE`,value:`Connected to ${e} extension`}]:[{label:`IDE`,value:`${_(`error`,n)(o.cross)} Not connected to ${e}`}]}return[]}function X(e=[],t){let n=e.filter(e=>e.name!==`ide`);if(!n.length)return[];let r={connected:0,pending:0,needsAuth:0,failed:0};for(let e of n)e.type===`connected`?r.connected++:e.type===`pending`?r.pending++:e.type===`needs-auth`?r.needsAuth++:r.failed++;let i=[];return r.connected&&i.push(_(`success`,t)(`${r.connected} connected`)),r.needsAuth&&i.push(_(`warning`,t)(`${r.needsAuth} need auth`)),r.pending&&i.push(_(`inactive`,t)(`${r.pending} pending`)),r.failed&&i.push(_(`error`,t)(`${r.failed} failed`)),[{label:`MCP servers`,value:`${i.join(`, `)} ${_(`inactive`,t)(`· /mcp`)}`}]}async function Z(){let e=d(await p()),t=[];return e.forEach(e=>{let n=x(e.path);t.push(`Large ${n} will impact performance (${k(e.content.length)} chars > ${k(u)})`)}),t}function Q(){return[{label:`Setting sources`,value:D().filter(e=>{let t=O(e);return t!==null&&Object.keys(t).length>0}).map(e=>{if(e===`policySettings`){let e=w();if(e===null)return null;switch(e){case`remote`:return`Enterprise managed settings (remote)`;case`plist`:return`Enterprise managed settings (plist)`;case`hklm`:return`Enterprise managed settings (HKLM)`;case`file`:{let{hasBase:e,hasDropIns:t}=E();return e&&t?`Enterprise managed settings (file + drop-ins)`:t?`Enterprise managed settings (drop-ins)`:`Enterprise managed settings (file)`}case`hkcu`:return`Enterprise managed settings (HKCU)`}}return T(e)}).filter(e=>e!==null)}]}async function ne(){return(await W()).map(e=>e.message)}async function re(){let e=await U(),t=[],{errors:n}=q();if(n.length>0){let e=Array.from(new Set(n.map(e=>e.file))).join(`, `);t.push(`Found invalid settings files: ${e}. They will be ignored.`)}return e.warnings.forEach(e=>{t.push(e.issue)}),e.hasUpdatePermissions===!1&&t.push(`No write permissions for auto-updates (requires sudo)`),t}function ie(){let e=P();if(!e)return[];let t=[];return e.subscription&&t.push({label:`Login method`,value:`${e.subscription} Account`}),e.tokenSource&&t.push({label:`Auth token`,value:e.tokenSource}),e.apiKeySource&&t.push({label:`API key`,value:e.apiKeySource}),e.organization&&!process.env.IS_DEMO&&t.push({label:`Organization`,value:e.organization}),e.email&&!process.env.IS_DEMO&&t.push({label:`Email`,value:e.email}),t}function ae(){let e=j(),r=[];if(e!==`firstParty`){let t={bedrock:`AWS Bedrock`,vertex:`Google Vertex AI`,foundry:`Microsoft Foundry`,gemini:`Gemini API`,grok:`Grok API`,openai:`OpenAI API`}[e];r.push({label:`API provider`,value:t})}if(e===`firstParty`){let e=process.env.ANTHROPIC_BASE_URL;e&&r.push({label:`API base URL`,value:e})}else if(e===`bedrock`){let e=process.env.BEDROCK_BASE_URL;e&&r.push({label:`Bedrock base URL`,value:e}),r.push({label:`AWS region`,value:i()}),t(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)&&r.push({value:`AWS auth skipped`})}else if(e===`vertex`){let e=process.env.VERTEX_BASE_URL;e&&r.push({label:`Vertex base URL`,value:e});let i=process.env.ANTHROPIC_VERTEX_PROJECT_ID;i&&r.push({label:`GCP project`,value:i}),r.push({label:`Default region`,value:n()}),t(process.env.CLAUDE_CODE_SKIP_VERTEX_AUTH)&&r.push({value:`GCP auth skipped`})}else if(e===`foundry`){let e=process.env.ANTHROPIC_FOUNDRY_BASE_URL;e&&r.push({label:`Microsoft Foundry base URL`,value:e});let n=process.env.ANTHROPIC_FOUNDRY_RESOURCE;n&&r.push({label:`Microsoft Foundry resource`,value:n}),t(process.env.CLAUDE_CODE_SKIP_FOUNDRY_AUTH)&&r.push({value:`Microsoft Foundry auth skipped`})}else if(e===`gemini`){let e=process.env.GEMINI_BASE_URL||`https://generativelanguage.googleapis.com/v1beta`;r.push({label:`Gemini base URL`,value:e})}else if(e===`grok`){let e=process.env.GROK_BASE_URL;r.push({label:`Grok base URL`,value:e})}else if(e===`openai`){let e=process.env.OPENAI_BASE_URL;r.push({label:`OpenAI base URL`,value:e})}let a=B();a&&r.push({label:`Proxy`,value:a});let o=V();return process.env.NODE_EXTRA_CA_CERTS&&r.push({label:`Additional CA cert(s)`,value:process.env.NODE_EXTRA_CA_CERTS}),o&&(o.cert&&process.env.CLAUDE_CODE_CLIENT_CERT&&r.push({label:`mTLS client cert`,value:process.env.CLAUDE_CODE_CLIENT_CERT}),o.key&&process.env.CLAUDE_CODE_CLIENT_KEY&&r.push({label:`mTLS client key`,value:process.env.CLAUDE_CODE_CLIENT_KEY})),r}function oe(e){let t=I(e);if(e===null&&L()){let e=te();t=`${h.bold(`Default`)} ${e}`}return t}var $,se=e((()=>{g(),a(),v(),M(),f(),H(),r(),b(),A(),s(),N(),F(),R(),G(),z(),K(),S(),C(),$=y()}));export{re as a,J as c,se as d,ne as i,Q as l,ie as n,X as o,Y as r,Z as s,ae as t,oe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./Settings-B7n_dfP-.js";async function i(e,t){return(0,a.jsx)(r,{onClose:e,context:t,defaultTab:`Status`})}var a;e((()=>{n(),a=t()}))();export{i as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Qi as n}from"./loadAgentsDir-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$i as t,Qi as n}from"./loadAgentsDir-C96o6gCj.js";function r(e){return e?e.activeAgents.filter(e=>e.source!==`built-in`).reduce((e,n)=>e+t(`${n.agentType}: ${n.whenToUse}`),0):0}var i,a=e((()=>{n(),i=15e3}));export{r as n,a as r,i as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{r,t as i}from"./which-B8rchd8P.js";function a(e,t){return{cmd:r(e)??e,args:t}}var o=e((()=>{i()}));function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function l(e,t,n=`${t}s`){return e===1?t:n}function u(e){let t=e.indexOf(`
|
|
2
2
|
`);return t===-1?e:e.slice(0,t)}function d(e,t,n=0){let r=0,i=e.indexOf(t,n);for(;i!==-1;)r++,i=e.indexOf(t,i+1);return r}function f(e){return e.replace(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function p(e){return e.replace(/\u3000/g,` `)}function m(e,t=`,`,n=g){let r=`...[truncated]`,i=``;for(let a of e){let e=i?t:``,o=e+a;if(i.length+o.length<=n)i+=o;else{let t=n-i.length-e.length-14;return t>0?i+=e+a.slice(0,t)+r:i+=r,i}}return i}function h(e,t){let n=e.split(`
|
|
3
3
|
`);return n.length<=t?e:`${n.slice(0,t).join(`
|
|
4
4
|
`)}…`}var g,_,v=e((()=>{t(),g=2**21,_=class{constructor(e=g){n(this,`maxSize`,void 0),n(this,`content`,``),n(this,`isTruncated`,!1),n(this,`totalBytesReceived`,0),this.maxSize=e}append(e){let t=typeof e==`string`?e:e.toString();if(this.totalBytesReceived+=t.length,!(this.isTruncated&&this.content.length>=this.maxSize))if(this.content.length+t.length>this.maxSize){let e=this.maxSize-this.content.length;e>0&&(this.content+=t.slice(0,e)),this.isTruncated=!0}else this.content+=t}toString(){if(!this.isTruncated)return this.content;let e=this.totalBytesReceived-this.maxSize,t=Math.round(e/1024);return`${this.content}\n... [output truncated - ${t}KB removed]`}clear(){this.content=``,this.isTruncated=!1,this.totalBytesReceived=0}get length(){return this.content.length}get truncated(){return this.isTruncated}get totalBytes(){return this.totalBytesReceived}}}));export{u as a,p as c,h as d,a as f,s as i,l,c as n,v as o,o as p,d as r,f as s,_ as t,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./switcher-DWfKi17X.js";t();export{e as restoreActiveProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{h as t,s as n}from"./settings-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{h as t,s as n}from"./settings-BowI3jp-.js";import{i as r,n as i,r as a,t as o}from"./loader-C33o_5kS.js";function s(e=a()){let t=n(`userSettings`)?.activeProviderId;if(t&&e.some(e=>e.id===t))return t;let r=process.env.OPENAI_BASE_URL,i=process.env.ANTHROPIC_BASE_URL;for(let t of e)if(t.kind===`anthropic-compat`&&i===t.baseUrl||t.kind===`openai-compat`&&r===t.baseUrl)return t.id}function c(e){if(e.apiKey)return e.apiKey;if(e.apiKeyEnv)return process.env[e.apiKeyEnv]}function l(e,t){let n=t??a(),r=o(e,n);if(!r){let t=n.map(e=>e.id).join(`, `);throw Error(`switchProvider: provider "${e}" not found. Available: ${t}`)}let i=r.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:r.baseUrl,ANTHROPIC_MODEL:r.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:r.baseUrl,OPENAI_MODEL:r.defaultModel},s=[];if(r.kind===`openai-compat`){let e=process.env.CLAUDE_CODE_USE_OPENAI===`1`||!!process.env.OPENAI_API_KEY,t=!!process.env.ANTHROPIC_API_KEY;e&&t&&s.push(`Both ANTHROPIC_API_KEY and OpenAI-compat mode are set. ANTHROPIC_API_KEY is for workspace endpoints (/v1/agents, /v1/vaults). OpenAI-compat mode routes /v1/messages to a third-party provider. These are separate planes — verify this is intentional.`)}return!r.apiKey&&!r.apiKeyEnv?s.push(`Provider "${r.id}" has neither apiKey nor apiKeyEnv configured. Edit ~/.workmate/providers.json to add one.`):!r.apiKey&&r.apiKeyEnv&&!process.env[r.apiKeyEnv]&&s.push(`${r.apiKeyEnv} is not set in the current environment. Set it before starting Work Mate: export ${r.apiKeyEnv}=<your-api-key>`),{env:i,warnings:s,provider:r}}function u(e){return e.kind===`anthropic-compat`?`ANTHROPIC_API_KEY`:`OPENAI_API_KEY`}async function d(e,t){delete process.env.CLAUDE_CODE_USE_BEDROCK,delete process.env.CLAUDE_CODE_USE_VERTEX,delete process.env.CLAUDE_CODE_USE_FOUNDRY,delete process.env.CLAUDE_CODE_USE_GEMINI,delete process.env.CLAUDE_CODE_USE_GROK,e.kind===`anthropic-compat`?(delete process.env.CLAUDE_CODE_USE_OPENAI,delete process.env.OPENAI_BASE_URL,delete process.env.OPENAI_API_KEY,delete process.env.OPENAI_MODEL):(delete process.env.ANTHROPIC_BASE_URL,delete process.env.ANTHROPIC_API_KEY,delete process.env.ANTHROPIC_MODEL);let n=e.kind===`anthropic-compat`?{ANTHROPIC_BASE_URL:e.baseUrl,ANTHROPIC_API_KEY:t??``,ANTHROPIC_MODEL:e.defaultModel}:{CLAUDE_CODE_USE_OPENAI:`1`,OPENAI_BASE_URL:e.baseUrl,OPENAI_API_KEY:t??``,OPENAI_MODEL:e.defaultModel},{clearOpenAIClientCache:r}=await import(`./client-BVal_QII.js`);r();let{fetchAvailableModels:i}=await import(`./fetchModelList-woVzIVde.js`);i.cache.clear();let{applyConfigEnvironmentVariables:a}=await import(`./managedEnv-CbjOQmEe.js`);a(),Object.assign(process.env,n)}async function f(e,t){let{provider:n,warnings:r}=l(e,t),i=c(n),a=u(n);i||r.push(`No API key available for provider "${n.id}" — ${a} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`),await d(n,i);let{updateSettingsForSource:o}=await import(`./settings-CHn0gJCG.js`);return o(`userSettings`,{activeProviderId:n.id,modelType:n.kind===`anthropic-compat`?`anthropic`:`openai`}),{provider:n,warnings:r}}async function p(e){let{getSettingsForSource:t}=await import(`./settings-CHn0gJCG.js`),n=t(`userSettings`)?.activeProviderId;if(!n)return{kind:`no-active-provider`};let i=a(),s=o(n,i);if(!s)return{kind:`provider-not-found`,id:n};if(s.defaultModel===e)return{kind:`unchanged`,providerId:n,model:e};let c=s.defaultModel;return r(i.map(t=>t.id===n?{...t,defaultModel:e}:t)),{kind:`updated`,providerId:n,previousModel:c,newModel:e}}async function m(){let{getSettingsForSource:e}=await import(`./settings-CHn0gJCG.js`),t=e(`userSettings`)?.activeProviderId;if(!t)return null;let n=o(t);if(!n)return null;let r=[],i=c(n);if(!i){let e=u(n);r.push(`No API key available for provider "${n.id}" — ${e} will be empty. Set ${n.apiKeyEnv??`an env var`} or add an apiKey field in ~/.workmate/providers.json.`)}return await d(n,i),{provider:n,warnings:r}}var h=e((()=>{t(),i()}));export{m as a,p as i,s as n,l as o,h as r,f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hn as t,Un as n,Wn as r}from"./settings-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hn as t,Un as n,Wn as r}from"./settings-BowI3jp-.js";import{u as i}from"./oauth-D38aRTUb.js";import{$r as a,Pt as o,St as s,gt as c,ni as l,ti as u}from"./model-BaMclMXn.js";function d(){p=void 0,n()}function f(){if(p!==void 0)return p;if(a()!==`firstParty`||!l()||process.env.CLAUDE_CODE_ENTRYPOINT===`local-agent`)return p=r(!1);let e=s();if(e?.accessToken&&e.subscriptionType===null||e?.accessToken&&e.scopes?.includes(`user:inference`)&&(e.subscriptionType===`enterprise`||e.subscriptionType===`team`))return p=r(!0);try{let{key:e}=c({skipRetrievingKeyFromApiKeyHelper:!0});if(e)return p=r(!0)}catch{}return p=r(!1)}var p,m=e((()=>{i(),o(),u(),t()}));export{f as n,d as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{t}from"./jsx-runtime-Bb4Xn-E0.js";import{n,t as r}from"./BackgroundTasksDialog-DxagIOOw.js";async function i(e,t){return(0,a.jsx)(r,{toolUseContext:t,onDone:e})}var a;e((()=>{n(),a=t()}))();export{i as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bl as e,Gl as t,Hl as n,Ll as r,Rl as i}from"./loadAgentsDir-C96o6gCj.js";i();export{r as checkOutTeleportedSessionBranch,e as processMessagesForTeleportResume,n as teleportResumeCodeSession,t as validateGitState};
|
|
@@ -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{
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{g as r,gE as i,h as a,hE as o,m as s}from"./loadAgentsDir-C96o6gCj.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=a(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let r;try{r=p(n)}catch{continue}for(let a of r){if(!a.endsWith(`.md`))continue;let r=c(a,`.md`);if(t.has(r))continue;t.add(r);let o=l(n,a);try{let{frontmatter:t,content:n}=i(f(o,`utf-8`),o),a=(typeof t.description==`string`?t.description:``)||s(n,`No description`);e.push({name:r,description:a,filePath:o,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{o(),n(),r()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,`${a}\n`,`utf-8`)}catch{m(i,`${a}\n`,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
|
|
2
2
|
Template Job Commands:
|
|
3
3
|
|
|
4
4
|
claude job list List available templates
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-
|
|
1
|
+
import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-a7-BNS4T.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,fi as a,j as o,t as s}from"./src-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{Bt as r,di as i,fi as a,j as o,t as s}from"./src-DL3w8VPk.js";import{n as c,t as l}from"./cwd-Nh5IZNKO.js";import{C as u,R as d,S as f,V as p,f as ee,u as te,x as ne}from"./debug-D58GQBDG.js";import{Cn as m,Gt as h,Jt as g,Tn as re}from"./settings-BowI3jp-.js";import{c as _,h as v,o as y,v as b,y as x}from"./config-DUTgj3js.js";import{i as S,t as C}from"./execFileNoThrow-B_KRY4cT.js";import{o as w,s as T}from"./log-CZ7ploQm.js";import{i as ie,o as ae}from"./platform-DMQxcm4K.js";import{d as oe,o as se,s as E}from"./types-APu4OCXJ.js";import{homedir as D,platform as O}from"os";import{dirname as ce,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as le}from"url";function I(){let e=te().existsSync(k(l(),`AGENTS.md`)),t=re(l());return[{key:`workspace`,text:`Ask Work Mate to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`agentsmd`,text:`Run /init to create a AGENTS.md file with instructions for Work Mate`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){y().hasCompletedProjectOnboarding||L()&&b(e=>({...e,hasCompletedProjectOnboarding:!0}))}function ue(){b(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),v(),c(),m(),ee(),z=t(()=>{let e=y();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function V(e){x(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){x(e=>({...e,appleTerminalSetupInProgress:!1}))}function de(){let e=_();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(D(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function fe(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),V(t),t}catch(e){return T(e),null}}async function W(){let{inProgress:e,backupPath:t}=de();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return T(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{v(),S(),w()}));function pe(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function me(){return!h.terminal||!(h.terminal in $)?null:$[h.terminal]??null}function K(e){return r()?`\x1b]8;;${le(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return O()===`darwin`&&h.terminal===`Apple_Terminal`||h.terminal===`vscode`||h.terminal===`cursor`||h.terminal===`windsurf`||h.terminal===`alacritty`||h.terminal===`zed`}async function J(e){let t=``;switch(h.terminal){case`Apple_Terminal`:t=await ye(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await be(e);break;case`zed`:t=await xe(e);break;case null:break}return x(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(h.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:h.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),t}function he(){return _().shiftEnterKeyBindingInstalled===!0}function ge(){return _().hasUsedBackslashReturn===!0}function _e(){_().hasUsedBackslashReturn||x(e=>({...e,hasUsedBackslashReturn:!0}))}async function ve(e,t,n){if(h.terminal&&h.terminal in $)return e(`Shift+Enter is natively supported in ${$[h.terminal]}.
|
|
2
2
|
|
|
3
3
|
No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!q()){let t=h.terminal||`your current terminal`,n=ie(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
|
|
4
4
|
`:n===`windows`&&(r=` • Windows: Windows Terminal
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{H as t,t as n,x as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{n as a,t as o}from"./ThemePicker-CIFKZza0.js";function s({onDone:e}){let[,n]=t();return(0,c.jsx)(r,{color:`permission`,children:(0,c.jsx)(o,{onThemeSelect:t=>{n(t),e(`Theme set to ${t}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var c,l;e((()=>{n(),a(),c=i(),l=async(e,t)=>(0,c.jsx)(s,{onDone:e})}))();export{l as call};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{
|
|
1
|
+
import{n as e,t}from"./defineProperty-C-QyHrDq.js";import{i as n,t as r}from"./execFileNoThrow-B_KRY4cT.js";import{i,t as a}from"./cliLaunch-DDtwAolw.js";import{spawnSync as o}from"child_process";n(),e();var s=class{constructor(){t(this,`name`,`tmux`),t(this,`supportsInteractiveInput`,!0)}async available(){let{code:e}=await r(`tmux`,[`-V`],{useCwd:!1});return e===0}async start(e){let t=a(e.args,{env:{...e.env,CLAUDE_CODE_SESSION_KIND:`bg`,CLAUDE_CODE_SESSION_NAME:e.sessionName,CLAUDE_CODE_SESSION_LOG:e.logPath,CLAUDE_CODE_TMUX_SESSION:e.sessionName}}),n=i(t);if(o(`tmux`,[`new-session`,`-d`,`-s`,e.sessionName,n],{stdio:`inherit`,env:t.env}).status!==0)throw Error(`Failed to create tmux session.`);return{pid:0,sessionName:e.sessionName,logPath:e.logPath,engineUsed:`tmux`}}async attach(e){if(!e.tmuxSessionName)throw Error(`Session ${e.sessionId} has no tmux session name.`);if(o(`tmux`,[`attach-session`,`-t`,e.tmuxSessionName],{stdio:`inherit`}).status!==0)throw Error(`Failed to attach to tmux session '${e.tmuxSessionName}'.`)}};export{s as TmuxEngine};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-D58GQBDG.js";import{o as r,s as i}from"./log-CZ7ploQm.js";import{r as a,t as o}from"./observationStore-D0rm3GhP.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-Bw3o5BrN.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,i as n}from"./debug-D58GQBDG.js";import{o as r,s as i}from"./log-CZ7ploQm.js";import{r as a,t as o}from"./observationStore-D0rm3GhP.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-Bw3o5BrN.js`),import(`./featureCheck-JOur3pHb.js`),import(`./runtimeObserver-DS1PK6We.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E;e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}))();export{u as hasToolHookObservationsForTurn,c as pruneEmittedTurns,_ as recordToolComplete,v as recordToolError,g as recordToolStart,y as recordUserCorrection,d as resetToolHookBookkeeping,m as resetToolHookDepsCache,h as runToolCallWithSkillLearningHooks};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Jb as t,qb as n,vT as r,yT as i}from"./loadAgentsDir-C96o6gCj.js";import{n as a,t as o}from"./partition-CENvOfiS.js";function s(e,n,r){let[o,s]=a(i([...e,...n],`name`),t),c=(e,t)=>e.name.localeCompare(t.name);return[...s.sort(c),...o.sort(c)]}var c=e((()=>{o(),r(),n()}));export{s as n,c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,c,i as l,x as u}from"./debug-D58GQBDG.js";import{d,f}from"./log-CZ7ploQm.js";import{l as p,u as m}from"./oauth-D38aRTUb.js";import{Pt as h,_n as g,gn as _,ot as v}from"./model-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{C as a,P as o,R as s,c,i as l,x as u}from"./debug-D58GQBDG.js";import{d,f}from"./log-CZ7ploQm.js";import{l as p,u as m}from"./oauth-D38aRTUb.js";import{Pt as h,_n as g,gn as _,ot as v}from"./model-BaMclMXn.js";import{hostname as y}from"os";i(),n(),m(),l(),s(),d(),g(),u();var b=`tengu_sessions_elevated_auth_enforcement`;function x(){return!1}var S=t(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||_().read()?.trustedDeviceToken);function C(){if(x())return S()}function w(){S.cache?.clear?.()}function T(){if(!x())return;let e=_();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}S.cache?.clear?.()}async function E(){try{if(!await!1){c(`[trusted-device] Gate ${b} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){c(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(h(),e(v)),n=t()?.accessToken;if(!n){c(`[trusted-device] No OAuth token, skipping enrollment`);return}let i=_();if(f()){c(`[trusted-device] Essential traffic only, skipping enrollment`);return}let s=p().BASE_API_URL,l;try{l=await r.post(`${s}/api/auth/trusted_devices`,{display_name:`Work Mate on ${y()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){c(`[trusted-device] Enrollment request failed: ${o(e)}`);return}if(l.status!==200&&l.status!==201){c(`[trusted-device] Enrollment failed ${l.status}: ${a(l.data).slice(0,200)}`);return}let u=l.data?.device_token;if(!u||typeof u!=`string`){c(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=i.read();if(!e){c(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=u;let t=i.update(e);if(!t.success){c(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}S.cache?.clear?.(),c(`[trusted-device] Enrolled device_id=${l.data.device_id??`unknown`}`)}catch(e){c(`[trusted-device] Storage write failed: ${o(e)}`)}}catch(e){c(`[trusted-device] Enrollment error: ${o(e)}`)}}export{C as i,w as n,E as r,T as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./trustedDevice-C1m--Yjw.js";export{t as clearTrustedDeviceToken,e as enrollTrustedDevice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{P as r,R as i,S as a,V as o,c as s,i as c,x as l}from"./debug-D58GQBDG.js";import{o as u}from"./log-CZ7ploQm.js";import{a as d,i as f}from"./genericProcessUtils-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{i as t,o as n}from"./envUtils-DcaKZlRU.js";import{P as r,R as i,S as a,V as o,c as s,i as c,x as l}from"./debug-D58GQBDG.js";import{o as u}from"./log-CZ7ploQm.js";import{a as d,i as f}from"./genericProcessUtils-Cnyun_Wr.js";import"os";import{join as p}from"path";import"crypto";import{readFile as m,readdir as h}from"fs/promises";import"net";import"node:string_decoder";var g=e((()=>{i(),l()})),_=e((()=>{c(),i(),n(),g(),u(),l()}));function v(){return p(t(),`sessions`)}async function y(){let e=v(),t;try{t=await h(e)}catch(e){return o(e)||s(`[udsClient] readdir failed: ${r(e)}`),[]}let n=[];for(let r of t){if(!/^\d+\.json$/.test(r))continue;let t=parseInt(r.slice(0,-5),10);if(d(t))try{let i=a(await m(p(e,r),`utf8`));n.push({pid:t,sessionId:i.sessionId,cwd:i.cwd,startedAt:i.startedAt,kind:i.kind,name:i.name,messagingSocketPath:i.messagingSocketPath,entrypoint:i.entrypoint,bridgeSessionId:i.bridgeSessionId,alive:!0})}catch{}}return n}e((()=>{n(),c(),i(),f(),l(),_(),g()}))();export{y as listAllLiveSessions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gu as n,zS as r}from"./loadAgentsDir-C96o6gCj.js";import{Gt as i,ai as a,et as o,t as s,vt as c}from"./src-DL3w8VPk.js";function l(e,t,n,r=!0){let{exit:i}=c(),[a,s]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>n??i,[n,i]),d=o(e=>s({pending:e,keyName:`Ctrl-C`}),l),f=o(e=>s({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:r}),a}var u,d=e((()=>{u=t(a(),1),s(),n()}));function f(e,t,n){return l(i,t,e,n)}var p=e((()=>{r(),d()}));export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Eh as t,Th as n}from"./loadAgentsDir-C96o6gCj.js";import{C as r,_ as i,s as a}from"./model-BaMclMXn.js";function o(){let e=t(e=>e.mainLoopModel);return r(t(e=>e.mainLoopModelForSession)??e??a())}var s=e((()=>{n(),i()}));export{o as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Eh as t,Jm as n,Km as r,Ko as i,La as a,Oh as o,Qo as s,Ra as c,Td as l,Th as u,Wm as d,Xg as f,Yg as p,Ym as m,Zo as h,_x as g,qo as _,vx as v,wd as y}from"./loadAgentsDir-C96o6gCj.js";import{ai as b}from"./src-DL3w8VPk.js";import{R as x,U as S,c as C,i as w}from"./debug-D58GQBDG.js";import{In as T,Ln as E}from"./settings-BowI3jp-.js";import{O as D,k as O}from"./git-Wid-XppW.js";import{o as k,s as A}from"./log-CZ7ploQm.js";import{n as j,r as M}from"./analytics-DJobLaWP.js";import{n as N,r as P}from"./pluginFlagging-BSLuTk3M.js";import{t as F}from"./pluginBlocklist-BprCv0En.js";var I=e(b(),1);y(),j(),d(),u(),E(),w(),D(),x(),k(),h(),_(),p(),n(),g(),P(),a();function L({enabled:e=!0}={}){let n=o(),a=t(e=>e.plugins.needsRefresh),{addNotification:u}=l(),d=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:t,errors:a}=await c();await F();let o=N();Object.keys(o).length>0&&u({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let l=[],d=[];try{l=await i()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{d=await s()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await f()}catch(e){let t=e instanceof Error?e.message:String(e);a.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let p=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await v(e,a);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),h=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await m(e,a);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);r(),n(n=>{let r=n.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),i=new Set(a.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...r.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!i.has(t)}),...a];return{...n,plugins:{...n.plugins,enabled:e,disabled:t,commands:l,errors:o}}}),C(`Loaded plugins - Enabled: ${e.length}, Disabled: ${t.length}, Commands: ${l.length}, Agents: ${d.length}, Errors: ${a.length}`);let g=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:t.length,inline_count:T(e,e=>e.source.endsWith(`@inline`)),marketplace_count:T(e,e=>!e.source.endsWith(`@inline`)),error_count:a.length,skill_count:l.length,agent_count:d.length,hook_count:g,mcp_count:p,lsp_count:h}}catch(e){let t=S(e);return A(t),C(`Error loading plugins: ${e}`),n(e=>{let n=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),r={type:`generic-error`,source:`plugin-system`,error:t.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...n,r]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[n,u]);(0,I.useEffect)(()=>{e&&d().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};M(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),O(`info`,`tengu_plugins_loaded`,r)})},[d,e]),(0,I.useEffect)(()=>{!e||!a||u({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,a,u])}export{L as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Sc as n,vc as r}from"./loadAgentsDir-C96o6gCj.js";import{ai as i}from"./src-DL3w8VPk.js";import{n as a,t as o}from"./toolPool-mdsxlKWR.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(i(),1),n(),o()}));export{s as n,l as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{$u as n,GS as r,Ju as i,Ku as a,Qu as o,ed as s,nd as c,qu as l,rd as u,td as d}from"./loadAgentsDir-C96o6gCj.js";import{Vn as f,ai as p,hn as m,ot as h,t as g}from"./src-DL3w8VPk.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:i,columns:p,passthroughCtrlKeys:g=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=h(),w=p??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=f=>{if(!e)return;let p=a.fromText(T,w,D);if(!(f.ctrl&&g.includes(f.key.toLowerCase()))){if(_(f)||s(),v(f)||d(),f.key===`return`||f.key===`down`){f.preventDefault(),t();return}if(f.key===`up`){f.preventDefault(),i&&i();return}if(f.key===`escape`){f.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(f.key===`backspace`){if(f.preventDefault(),f.meta){let{cursor:e,killed:t}=p.deleteWordBefore();o(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}if(f.key===`delete`){f.preventDefault();let e=p.del();E(e.text),O(e.offset);return}if(f.key===`left`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.prevWord();O(e.offset);return}if(f.key===`right`&&(f.ctrl||f.meta||f.fn)){f.preventDefault();let e=p.nextWord();O(e.offset);return}if(f.key===`left`){f.preventDefault();let e=p.left();O(e.offset);return}if(f.key===`right`){f.preventDefault();let e=p.right();O(e.offset);return}if(f.key===`home`){f.preventDefault(),O(0);return}if(f.key===`end`){f.preventDefault(),O(T.length);return}if(f.ctrl){switch(f.preventDefault(),f.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(p.left().offset);return;case`f`:O(p.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=p.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=p.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=p.deleteToLineEnd();o(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=p.deleteToLineStart();o(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=p.deleteWordBefore();o(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=l();if(e.length>0){let t=p.offset,r=p.insert(e);n(t,e.length),E(r.text),O(r.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(f.meta){switch(f.preventDefault(),f.key.toLowerCase()){case`b`:O(p.prevWord().offset);return;case`f`:O(p.nextWord().offset);return;case`d`:{let e=p.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=u();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;c(t.length),E(o),O(s)}return}}return}if(f.key!==`tab`&&f.key.length>=1&&!x.has(f.key)){f.preventDefault();let e=p.insert(f.key);E(e.text),O(e.offset)}}};return m((e,t,n)=>{A(new f(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(p(),1),g(),i(),r(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Mh as n,Td as r,jh as i,wd as a}from"./loadAgentsDir-C96o6gCj.js";import{ai as o}from"./src-DL3w8VPk.js";import{Ut as s,z as c}from"./state-D5D6QpTX.js";import{n as l,t as u}from"./allErrors-CT2dbBF3.js";function d(){let{addNotification:e,removeNotification:t}=r(),[i,a]=(0,f.useState)(()=>{let{errors:e}=u();return e});return n((0,f.useCallback)(()=>{let{errors:e}=u();a(e)},[])),(0,f.useEffect)(()=>{if(!c())if(i.length>0){let t=`Found ${i.length} settings ${i.length===1?`issue`:`issues`} · /doctor for details`;e({key:p,text:t,color:`warning`,priority:`high`,timeoutMs:6e4})}else t(p)},[i,e,t]),i}var f,p,m=e((()=>{f=t(o(),1),a(),s(),l(),i(),p=`settings-errors`}));export{d as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return`workmate/0.0.
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";function t(){return`workmate/0.0.21`}var n=e((()=>{}));export{n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Th as t,iu as n,ru as r,wh as i}from"./loadAgentsDir-C96o6gCj.js";import{ai as a}from"./src-DL3w8VPk.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{n as s,r as c}from"./analytics-DJobLaWP.js";import{t as l}from"./useManagePlugins-CAXp5CfH.js";import{n as u,t as d}from"./MCPConnectionManager-CoId-C__.js";import{cwd as f}from"process";var p=e(a(),1);n(),s(),u(),t();var m=o(),h=p.lazy(()=>import(`./Doctor-Bk9P37mU.js`).then(e=>({default:e.Doctor})));function g({onDone:e}){return l(),(0,m.jsx)(p.Suspense,{fallback:null,children:(0,m.jsx)(h,{onDone:e})})}async function _(e){c(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,m.jsx)(i,{children:(0,m.jsx)(r,{children:(0,m.jsx)(d,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,m.jsx)(g,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function v(e,t){let{setup:n}=await import(`./setup-UiEO9i7F.js`);await n(f(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-eCA8UACi.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{_ as doctorHandler,v as installHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{HC as r,JC as i,UC as a,XC as o,YC as s,_E as c,hE as l,mE as ee,vE as u}from"./loadAgentsDir-C96o6gCj.js";import{g as d,r as te}from"./lazySchema-DULtBUCI.js";import{B as f,C as p,F as m,P as h,R as g,S as _,c as v,f as y,i as b,u as x,x as S}from"./debug-D58GQBDG.js";import{_t as C,ft as ne,gt as w,ht as re,mt as ie}from"./settings-BowI3jp-.js";import{o as ae,s as T}from"./log-CZ7ploQm.js";import{homedir as oe}from"os";import*as E from"path";import{join as se,resolve as D}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return se(r(),H)}async function I(){let e=F();try{let t=_(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return v(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return v(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return v(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(v(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>W?(v(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(v(`Install counts cache has malformed entries`),null)}catch(e){return m(e)!==`ENOENT`&&v(`Failed to load install counts cache: ${h(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let i=r();await x().mkdir(i),await P(n,p(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),v(`Install counts cache saved successfully`)}catch(e){T(e);try{await N(n)}catch{}}}async function R(){v(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return o(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw o(`install_counts`,U,`failure`,performance.now()-e,i(t)),t}}async function z(){let e=await I();if(e){v(`Using cached install counts`),o(`install_counts`,U,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await R();await L({version:V,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return T(e),v(`Failed to fetch install counts: ${h(e)}`),null}}function B(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var V,H,U,W,G=e((()=>{n(),b(),g(),y(),ae(),S(),s(),a(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=x(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=D(t.startsWith(`~`)?t.replace(/^~/,oe()):t),r;try{r=await n.stat(e)}catch(t){let n=m(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{g(),y()}));function le(e){let t=E.basename(e),n=E.basename(E.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=E.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=m(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${h(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=_(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=ie().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],r=E.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=m(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${h(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`marketplace`}}let a;try{a=_(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(e)}`}],warnings:[],filePath:r,fileType:`marketplace`}}if(a&&typeof a==`object`){let e=a;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let o=w().extend({plugins:d(re().strict())}).strict().safeParse(a);if(o.success||t.push(...q(o.error)),o.success){let e=o.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let i=E.dirname(r),a=E.basename(i)===`.claude-plugin`?E.dirname(i):i;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=E.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=_(await k(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],a=t.match(ee);if(!a)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let o=a[1]||``,s;try{s=u(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${h(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Work Mate understand when to use this ${n}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let d=c.shell;if(d!=null)if(typeof d!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof d}.`});else{let e=d.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${d}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await k(e,{encoding:`utf-8`})}catch(t){return m(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${h(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=_(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${h(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=ne().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await A(e,{withFileTypes:!0})}catch(e){let t=m(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>E.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=E.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,E.join(e,`skills`)],[`agent`,E.join(e,`agents`)],[`command`,E.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await k(r,{encoding:`utf-8`})}catch(n){if(f(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${h(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(E.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=E.resolve(e),n=null;try{n=await M(t)}catch(e){if(!f(e))throw e}if(n?.isDirectory()){let e=await X(E.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(E.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=_(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(m(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{te(),g(),l(),S(),c(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,h as n,y as r}from"./config-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{c as t,h as n,y as r}from"./config-DUTgj3js.js";import{n as i,r as a}from"./analytics-DJobLaWP.js";var o;e((()=>{i(),n(),o=async()=>{let e=t().editorMode||`normal`;e===`emacs`&&(e=`normal`);let n=e===`normal`?`vim`:`normal`;return r(e=>({...e,editorMode:n})),a(`tengu_editor_mode_changed`,{mode:n,source:`command`}),{type:`text`,value:`Editor mode set to ${n}. ${n===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{a as t,s as n}from"./execFileNoThrow-B_KRY4cT.js";import{n as r,t as i}from"./execSyncWrapper-C3ZFV9od.js";async function a(e){if(process.platform===`win32`){let n=await t(`where.exe ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return n.exitCode!==0||!n.stdout?null:n.stdout.trim().split(/\r?\n/)[0]||null}let n=await t(`which ${e}`,{shell:!0,stderr:`ignore`,reject:!1});return n.exitCode!==0||!n.stdout?null:n.stdout.trim()}function o(e){if(process.platform===`win32`)try{return i(`where.exe ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim().split(/\r?\n/)[0]||null}catch{return null}try{return i(`which ${e}`,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim()||null}catch{return null}}var s,c,l,u=e((()=>{n(),r(),s=typeof Bun<`u`&&typeof Bun.which==`function`?Bun.which:null,c=s?async e=>s(e):a,l=s??o}));export{c as n,l as r,u as t};
|