claude-code-best 2.8.1 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chunks/{AddWorkspaceDirectory-CNyPaerF.js → AddWorkspaceDirectory-CM5PYqoF.js} +1 -1
- package/dist/chunks/{App-hiKxO6UA.js → App-BLLQEMkd.js} +1 -1
- package/dist/chunks/ApproveApiKey-AMXQPmfE.js +1 -0
- package/dist/chunks/{ApproveApiKey-Cd43j9Wa.js → ApproveApiKey-DrflOSA-.js} +1 -1
- package/dist/chunks/{AssistantSessionChooser-C8OxwSGM.js → AssistantSessionChooser-SlRne98s.js} +1 -1
- package/dist/chunks/BackgroundTasksDialog-Cciww_FF.js +2 -0
- package/dist/chunks/{BypassPermissionsModeDialog-Ddjzluka.js → BypassPermissionsModeDialog-HaciDdx0.js} +1 -1
- package/dist/chunks/{ClaudeInChromeOnboarding-BhvrEJlm.js → ClaudeInChromeOnboarding-EA3k_q2M.js} +1 -1
- package/dist/chunks/ClaudeMdExternalIncludesDialog-C-T8G8O7.js +1 -0
- package/dist/chunks/{ClaudeMdExternalIncludesDialog-DoNd72PS.js → ClaudeMdExternalIncludesDialog-xBclyqKk.js} +1 -1
- package/dist/chunks/ConsoleOAuthFlow-BTN62PKj.js +1 -0
- package/dist/chunks/{DesktopHandoff-DVUOZjb0.js → DesktopHandoff-BhY_F3Ob.js} +1 -1
- package/dist/chunks/{DevChannelsDialog-DJbRHAIy.js → DevChannelsDialog-DU5komVT.js} +1 -1
- package/dist/chunks/DiffDialog-D_-znREV.js +3 -0
- package/dist/chunks/Doctor-BhrEYzPO.js +3 -0
- package/dist/chunks/Doctor-CjnUU1CY.js +1 -0
- package/dist/chunks/{ExitFlow-BPbtGcEg.js → ExitFlow-cRfxceuS.js} +2 -2
- package/dist/chunks/{Feedback-BSagYjmf.js → Feedback-BMv8Kt05.js} +2 -2
- package/dist/chunks/Grove-CRAZGlvf.js +1 -0
- package/dist/chunks/{Grove-BrP9JNpK.js → Grove-CjfR7Acp.js} +1 -1
- package/dist/chunks/{HybridTransport-DLaxmXCR.js → HybridTransport-D32dn9xc.js} +1 -1
- package/dist/chunks/{ITermBackend-tXN55G2D.js → ITermBackend-BxjzkptA.js} +1 -1
- package/dist/chunks/{InvalidConfigDialog-BzFQdfwu.js → InvalidConfigDialog-CnCOCqMT.js} +1 -1
- package/dist/chunks/{InvalidSettingsDialog-KFg61s41.js → InvalidSettingsDialog-CLOgpfR2.js} +1 -1
- package/dist/chunks/MCPConnectionManager-BhbT4Sah.js +1 -0
- package/dist/chunks/{McpParsingWarnings-DsHSSgsx.js → McpParsingWarnings-B5X5HVnQ.js} +1 -1
- package/dist/chunks/MessageSelector-DLofsxam.js +3 -0
- package/dist/chunks/Messages-D1-i4MMT.js +11 -0
- package/dist/chunks/{Onboarding-DBJX6Cnf.js → Onboarding-Co5P3gZs.js} +1 -1
- package/dist/chunks/{OverageCreditUpsell-B4beCEX2.js → OverageCreditUpsell-DjgcfVt2.js} +1 -1
- package/dist/chunks/PluginSettings-NB-Wod-9.js +17 -0
- package/dist/chunks/{PromptInputHelpMenu-Bjjr3tYl.js → PromptInputHelpMenu-BDI5IF1s.js} +1 -1
- package/dist/chunks/QueryEngine-B217mLel.js +1 -0
- package/dist/chunks/REPL-BfprHNDt.js +1 -0
- package/dist/chunks/{REPL-CXcCBQuz.js → REPL-DCm_BFr_.js} +36 -36
- package/dist/chunks/{RemoteCallout-CuxqarhC.js → RemoteCallout-dGnKRIDB.js} +1 -1
- package/dist/chunks/{RemoteSessionManager-BhPF41Wn.js → RemoteSessionManager-BidAIOqZ.js} +2 -2
- package/dist/chunks/ResumeConversation-SDRT6hO3.js +1 -0
- package/dist/chunks/{SSETransport-8yaTbdSK.js → SSETransport-BM2xz03M.js} +1 -1
- package/dist/chunks/SearchExtraToolsTool-DCSReOsq.js +1 -0
- package/dist/chunks/{SentryErrorBoundary-ydwbrVTx.js → SentryErrorBoundary-D5niZGEU.js} +1 -1
- package/dist/chunks/SentryErrorBoundary-DzwCuftg.js +1 -0
- package/dist/chunks/Settings-D3ds_WCz.js +2 -0
- package/dist/chunks/{TeleportProgress-CNcl_DxR.js → TeleportProgress-Dg6HcEO9.js} +1 -1
- package/dist/chunks/{TeleportRepoMismatchDialog-DJc8_mjE.js → TeleportRepoMismatchDialog-BUKNU2jx.js} +1 -1
- package/dist/chunks/{TeleportResumeWrapper-Cw438s-J.js → TeleportResumeWrapper-5FTzA9R_.js} +1 -1
- package/dist/chunks/{ThemePicker-8X6yAwuQ.js → ThemePicker-Bdm12PmJ.js} +1 -1
- package/dist/chunks/{TmuxBackend-CqAnVFoI.js → TmuxBackend-CYx3Hdf1.js} +2 -2
- package/dist/chunks/{TrustDialog-Ch1FJzxi.js → TrustDialog-DGKf4iwh.js} +1 -1
- package/dist/chunks/{ValidationErrorsList-sgfvJPWZ.js → ValidationErrorsList-BP7vG1uX.js} +1 -1
- package/dist/chunks/{WelcomeV2-Bu8l3w90.js → WelcomeV2-k_969SnB.js} +1 -1
- package/dist/chunks/{WindowsTerminalBackend-Bvq7nHOp.js → WindowsTerminalBackend-K_zVZBSP.js} +2 -2
- package/dist/chunks/{add-dir-DqrRNnxe.js → add-dir-DnfUkb1n.js} +1 -1
- package/dist/chunks/{agentDisplay-DcxzWi1v.js → agentDisplay-DT04Kqdm.js} +1 -1
- package/dist/chunks/{agents-Do1ynqiW.js → agents-ELZyUElQ.js} +7 -7
- package/dist/chunks/{agents-QqLm1wcM.js → agents-hh7Zcqm6.js} +1 -1
- package/dist/chunks/{ant-D5gD6O-r.js → ant-CuQC6xHS.js} +1 -1
- package/dist/chunks/api-BY3NFL4L.js +1 -0
- package/dist/chunks/{api-hcsOinLV.js → api-C-KY7A3r.js} +1 -1
- package/dist/chunks/asciicast-BeEmDIKr.js +1 -0
- package/dist/chunks/{asciicast-C_1Pi99k.js → asciicast-C0fPsv7_.js} +1 -1
- package/dist/chunks/assistant-C669PK45.js +1 -0
- package/dist/chunks/{assistant-CemNvrYr.js → assistant-DbtrknMt.js} +1 -1
- package/dist/chunks/{assistant-DkECAILU.js → assistant-Z-xFHPiY.js} +1 -1
- package/dist/chunks/{auth-Dm8aWPRh.js → auth-Bo_eeRO9.js} +1 -1
- package/dist/chunks/auth-C-rD91K7.js +1 -0
- package/dist/chunks/{autoMode-dygqoN_C.js → autoMode-BhsFtU8_.js} +6 -6
- package/dist/chunks/{autonomy-BdxnxJnk.js → autonomy-B-d3Xamr.js} +1 -1
- package/dist/chunks/{autonomy-DPeEmb00.js → autonomy-C5wE-5B8.js} +12 -12
- package/dist/chunks/{autonomyPanel-Bocl2taZ.js → autonomyPanel-CMy4Zs1a.js} +1 -1
- package/dist/chunks/backgroundHousekeeping-YAOGWoo4.js +17 -0
- package/dist/chunks/backgroundHousekeeping-xFmPDL7y.js +1 -0
- package/dist/chunks/{branch-DwdVgun5.js → branch-DoV3sEJf.js} +2 -2
- package/dist/chunks/{bridge-DkkMogD_.js → bridge-8RYx23zW.js} +2 -2
- package/dist/chunks/{bridgeConfig-l6Ldi_hk.js → bridgeConfig-C8tQXEsd.js} +1 -1
- package/dist/chunks/bridgeConfig-D5awYlvd.js +1 -0
- package/dist/chunks/bridgeEnabled-0tZw2TlM.js +1 -0
- package/dist/chunks/{bridgeEnabled-DYclTb9d.js → bridgeEnabled-B3KTIVe4.js} +1 -1
- package/dist/chunks/bridgeMain-DKkE8RYG.js +1 -0
- package/dist/chunks/bridgeMain-Ssp8HRcV.js +68 -0
- package/dist/chunks/{bridgeMessaging-CYe1Cixl.js → bridgeMessaging-DGTm_wDk.js} +1 -1
- package/dist/chunks/{btw-CyOlY5R-.js → btw-Du0mHeiD.js} +1 -1
- package/dist/chunks/{buddy-q-utA1_5.js → buddy-D04AYSW6.js} +1 -1
- package/dist/chunks/{bypassPermissionsKillswitch-CTrRxzdz.js → bypassPermissionsKillswitch-CRYkShwu.js} +1 -1
- package/dist/chunks/caches-Byd8SjTZ.js +1 -0
- package/dist/chunks/{caches-Bz4yVQyE.js → caches-DYf69-N9.js} +2 -2
- package/dist/chunks/{ccrClient-DXiEw9xU.js → ccrClient-CDrBxSox.js} +1 -1
- package/dist/chunks/changeDetector-CGzGs92S.js +1 -0
- package/dist/chunks/{channelNotification-CLPdvxGZ.js → channelNotification-CtA9HHFW.js} +1 -1
- package/dist/chunks/channelNotification-DOvTvOGt.js +1 -0
- package/dist/chunks/{chrome-DxbhLWDW.js → chrome-BHbT4cc4.js} +1 -1
- package/dist/chunks/clear-BGLxPs_B.js +1 -0
- package/dist/chunks/client-CtOmoNuQ.js +1 -0
- package/dist/chunks/color-MOZYZ1cM.js +1 -0
- package/dist/chunks/commands-B3XpQmEm.js +1 -0
- package/dist/chunks/{commitAttribution-CJXF8wMs.js → commitAttribution-BTtCTr8c.js} +1 -1
- package/dist/chunks/commitAttribution-CXNK79GW.js +1 -0
- package/dist/chunks/compact-CMqxm2yG.js +3 -0
- package/dist/chunks/{companion-rXSt0nmz.js → companion-ChxkOPHB.js} +1 -1
- package/dist/chunks/{config-BE3jrcr-.js → config-cRyRIPI7.js} +1 -1
- package/dist/chunks/{config-CzC08IjE.js → config-wvQYYbwU.js} +1 -1
- package/dist/chunks/{context-BHE99SMA.js → context-7ds9guuJ.js} +1 -1
- package/dist/chunks/{context-noninteractive-BZQIUH_y.js → context-noninteractive-CISZymIU.js} +2 -2
- package/dist/chunks/context-noninteractive-CwJBBF8h.js +1 -0
- package/dist/chunks/conversation-Bgsdn99n.js +1 -0
- package/dist/chunks/conversation-D30CU_jS.js +1 -0
- package/dist/chunks/{copy-TgphIVzy.js → copy-Dvz2Mge4.js} +2 -2
- package/dist/chunks/{createSSHSession-CSKEZ4ic.js → createSSHSession-Befx8LiM.js} +1 -1
- package/dist/chunks/createSession-Cp0KTjPL.js +1 -0
- package/dist/chunks/{createSession-Ce218tQj.js → createSession-CsZGoika.js} +1 -1
- package/dist/chunks/{cronJitterConfig-CnKed5Gi.js → cronJitterConfig-Dfl7iZqE.js} +3 -3
- package/dist/chunks/{crossProjectResume-BFlsTYOq.js → crossProjectResume-DK8nt_cn.js} +3 -3
- package/dist/chunks/{datadog-D5jSRybW.js → datadog-2vPhbh6g.js} +1 -1
- package/dist/chunks/datadog-DLTYg-S2.js +1 -0
- package/dist/chunks/{desktop-cjA0tGOa.js → desktop-DY9Nw2Fi.js} +1 -1
- package/dist/chunks/{diff-DMd61IjE.js → diff-Ci6rs6S6.js} +1 -1
- package/dist/chunks/{directoryCompletion-DqtWZsoW.js → directoryCompletion-DLxCFk_m.js} +1 -1
- package/dist/chunks/{doctor-ueUYyjyL.js → doctor-DBYGgS-y.js} +1 -1
- package/dist/chunks/{effort-B9IvAstG.js → effort-Bi_t4J_o.js} +2 -2
- package/dist/chunks/{entry-Bq_KRMWs.js → entry-p_5l64_p.js} +5 -5
- package/dist/chunks/{envLessBridgeConfig-CpjlwmvF.js → envLessBridgeConfig-C_sqoGX6.js} +1 -1
- package/dist/chunks/envLessBridgeConfig-Cfbqwjew.js +1 -0
- package/dist/chunks/exit-Bc8L5oQT.js +1 -0
- package/dist/chunks/{export-CP638-TO.js → export-kvnEu9Iw.js} +1 -1
- package/dist/chunks/{exportRenderer-B5emJDvn.js → exportRenderer-DmpMgUiv.js} +1 -1
- package/dist/chunks/extra-usage-BnO6knuC.js +1 -0
- package/dist/chunks/{extra-usage-DIm8nrKj.js → extra-usage-CmP6V7HX.js} +1 -1
- package/dist/chunks/{extra-usage-core-DERKSEe1.js → extra-usage-core-BqJClmf4.js} +1 -1
- package/dist/chunks/{extra-usage-noninteractive-Dq5dog_-.js → extra-usage-noninteractive-BWyPFx53.js} +1 -1
- package/dist/chunks/extraUsage-DgMspmL4.js +1 -0
- package/dist/chunks/extractMemories-uQJS_i6E.js +1 -0
- package/dist/chunks/fast-Bunl4ivM.js +1 -0
- package/dist/chunks/{fast-BP2t1xDM.js → fast-Dd2jZVF-.js} +1 -1
- package/dist/chunks/{feedback-C-mR6zJr.js → feedback-8UeDx3Yc.js} +1 -1
- package/dist/chunks/{firstPartyEventLogger-sMmHdYjg.js → firstPartyEventLogger-cKEuzfyR.js} +1 -1
- package/dist/chunks/{flushGate-C18XwNsa.js → flushGate-B3upNVdV.js} +1 -1
- package/dist/chunks/{gates-Be5r2kKS.js → gates-lWoKqpJ1.js} +1 -1
- package/dist/chunks/gates-uo2owWkc.js +1 -0
- package/dist/chunks/{gemini-BberPcp1.js → gemini-DDSP4ArG.js} +1 -1
- package/dist/chunks/{generateRecap-B76UcVUS.js → generateRecap-DCBzHqag.js} +1 -1
- package/dist/chunks/{generateSessionName-BwtXd8TC.js → generateSessionName-Db5pZ3cL.js} +1 -1
- package/dist/chunks/{githubRepoPathMapping-5IlVgR2l.js → githubRepoPathMapping-v_U9b0Fe.js} +1 -1
- package/dist/chunks/{goal-DQ0jNcLO.js → goal-EZCOCHZa.js} +3 -3
- package/dist/chunks/{grok-Dh_thT2_.js → grok-H8K_fDKF.js} +1 -1
- package/dist/chunks/{growthbook-4ADV3CAt.js → growthbook-mMD0jkbu.js} +1 -1
- package/dist/chunks/{heapdump-Dwqmh4SX.js → heapdump-CbVvtQuH.js} +1 -1
- package/dist/chunks/{help-Bznaywoi.js → help-Bq4jxCSJ.js} +1 -1
- package/dist/chunks/hooks-CVlFJfV0.js +1 -0
- package/dist/chunks/{hooks-F-82cg6M.js → hooks-DbKUS0fN.js} +2 -2
- package/dist/chunks/{hostAdapter-DpfLr3hX.js → hostAdapter-BhVpIn1Y.js} +1 -1
- package/dist/chunks/{ide-BfAKWufQ.js → ide-DZJheXyl.js} +2 -2
- package/dist/chunks/{inboundAttachments-CFV_eqMu.js → inboundAttachments-B9NxWIDx.js} +1 -1
- package/dist/chunks/inboundAttachments-_vhgWPEL.js +1 -0
- package/dist/chunks/initReplBridge-BCIaWf78.js +1 -0
- package/dist/chunks/{insights-BNsCwNYa.js → insights-D1BFvhw_.js} +68 -68
- package/dist/chunks/{install-Bszzs98N.js → install-D_xm-9s1.js} +1 -1
- package/dist/chunks/{install-github-app-DVxGR2rp.js → install-github-app-CUEACXdr.js} +2 -2
- package/dist/chunks/{install-slack-app-CjlRL19o.js → install-slack-app-DGV6l9wy.js} +1 -1
- package/dist/chunks/{instrumentation-BOYPOtyu.js → instrumentation-CEfWNakt.js} +3 -3
- package/dist/chunks/{job-BvD5_lGz.js → job-BeeAFieV.js} +1 -1
- package/dist/chunks/{keybindings-RPmPPGhp.js → keybindings-CeYhuE5G.js} +2 -2
- package/dist/chunks/{lang-9VNaOJMz.js → lang-BmwAsgo1.js} +1 -1
- package/dist/chunks/{language-Ct5Nkqm6.js → language-BcWiv2lr.js} +1 -1
- package/dist/chunks/language-BnQye2Mx.js +1 -0
- package/dist/chunks/{launchAgentsPlatform-CnoxFIXV.js → launchAgentsPlatform-DqQzwcqV.js} +1 -1
- package/dist/chunks/{launchAutofixPr-ChaDUtvx.js → launchAutofixPr-XltBpICW.js} +3 -3
- package/dist/chunks/{launchLocalMemory-MwZfEJxz.js → launchLocalMemory-CHSU4_or.js} +2 -2
- package/dist/chunks/{launchLocalVault-B6Ib5WXx.js → launchLocalVault-CnvCdQ1M.js} +3 -3
- package/dist/chunks/{launchMemoryStores-D6xyGwQ1.js → launchMemoryStores-DD2duIDU.js} +1 -1
- package/dist/chunks/{launchOnboarding-BtdAOO3p.js → launchOnboarding-JTKef_jU.js} +1 -1
- package/dist/chunks/{launchSchedule-XVljzNKg.js → launchSchedule-BVtfNQtS.js} +1 -1
- package/dist/chunks/{launchSkillStore-QT8Qcc5N.js → launchSkillStore-TisTmZ3O.js} +1 -1
- package/dist/chunks/{launchTeleport-DwxPesKQ.js → launchTeleport-BO_V6ggj.js} +3 -3
- package/dist/chunks/{launchVault-Dbti6pph.js → launchVault-Civro2KB.js} +1 -1
- package/dist/chunks/{loadAgentsDir-BYWykYwn.js → loadAgentsDir-BfEZacjM.js} +740 -690
- package/dist/chunks/loadAgentsDir-rYxb2igq.js +1 -0
- package/dist/chunks/loadPluginHooks-Cniyh-tZ.js +1 -0
- package/dist/chunks/localSearch-C0J7ETJQ.js +1 -0
- package/dist/chunks/{localSearch-eWjZxMc8.js → localSearch-COJcqOWl.js} +1 -1
- package/dist/chunks/login-B4wjtpEU.js +1 -0
- package/dist/chunks/{login-D1aQCqp0.js → login-SuUxFLIY.js} +1 -1
- package/dist/chunks/{logoV2Utils-CPNvLtol.js → logoV2Utils-DvjpZkyF.js} +1 -1
- package/dist/chunks/logout-o16yNWNB.js +1 -0
- package/dist/chunks/{magicDocs-DAvjAbAJ.js → magicDocs-BZBrH9zB.js} +2 -2
- package/dist/chunks/{main-BKlQiSuc.js → main-p9Tke3lb.js} +90 -63
- package/dist/chunks/mappers-BcXg_fI3.js +1 -0
- package/dist/chunks/mcp-BFxLEf3X.js +1 -0
- package/dist/chunks/{mcp-ya96irNP.js → mcp-CIJL0PTq.js} +2 -2
- package/dist/chunks/mcp-DfuQ1MJu.js +6 -0
- package/dist/chunks/{mcpServer-B1q9blAc.js → mcpServer-D2kI_m2H.js} +1 -1
- package/dist/chunks/{mcpServer-BJB5g6j2.js → mcpServer-DPk-oJOU.js} +1 -1
- package/dist/chunks/{memory-CxiukAGg.js → memory-CJOtY_Uv.js} +1 -1
- package/dist/chunks/{mode-DqAJ2y6R.js → mode-DkpKiyTE.js} +1 -1
- package/dist/chunks/{model-C8TW-qjl.js → model-DZyzd39E.js} +1 -1
- package/dist/chunks/model-De0AGQ3F.js +1 -0
- package/dist/chunks/{onChangeAppState-BG1pF7ht.js → onChangeAppState-CvtxqUDG.js} +1 -1
- package/dist/chunks/{openai-CHoRhRtf.js → openai-B888nVou.js} +3 -3
- package/dist/chunks/{overageCreditGrant-DYMg1lV4.js → overageCreditGrant-BOSyVk3U.js} +1 -1
- package/dist/chunks/{panelCall-SYrmrKt9.js → panelCall-BVdu8oii.js} +1 -1
- package/dist/chunks/{passes-CSV-SZJc.js → passes-DeSsjipz.js} +1 -1
- package/dist/chunks/{path-BE28AJwZ.js → path-Cit7LKW-.js} +1 -1
- package/dist/chunks/{paths-BZjPDxMm.js → paths-nIHVpTn2.js} +3 -3
- package/dist/chunks/permissions-DGdr-wOj.js +3 -0
- package/dist/chunks/{pipeTransport-uK7GxbSG.js → pipeTransport-ClZYq1sd.js} +1 -1
- package/dist/chunks/{plan-DEbo-Adi.js → plan-D9bnkDwv.js} +1 -1
- package/dist/chunks/{plugin-Cops24hg.js → plugin-BE0r1g1g.js} +1 -1
- package/dist/chunks/{pluginAutoupdate-Bg7JMOHN.js → pluginAutoupdate-xyXksEJv.js} +1 -1
- package/dist/chunks/pluginBlocklist-Dd7XBe8U.js +1 -0
- package/dist/chunks/{pluginCliCommands-DyYEg7Cv.js → pluginCliCommands-8MJCk1nq.js} +1 -1
- package/dist/chunks/{pluginFlagging-DwChUZMJ.js → pluginFlagging-7zuXXBD5.js} +1 -1
- package/dist/chunks/pluginOperations-DFzbASMD.js +2 -0
- package/dist/chunks/{pluginStartupCheck-DCxJJkYs.js → pluginStartupCheck-BC5npqdw.js} +1 -1
- package/dist/chunks/pluginStartupCheck-C6IH0haF.js +1 -0
- package/dist/chunks/plugins-Bhc2pbAj.js +4 -0
- package/dist/chunks/policyLimits-CfrU0rIR.js +1 -0
- package/dist/chunks/{pollConfig-DBNHhvHf.js → pollConfig-B3hNYQ_n.js} +1 -1
- package/dist/chunks/{poor-aPQce502.js → poor-BjTGCuqc.js} +1 -1
- package/dist/chunks/{poorMode-CFRuV-nB.js → poorMode-CGVMMLlz.js} +1 -1
- package/dist/chunks/poorMode-DWLhTldO.js +1 -0
- package/dist/chunks/{print-Cf2tY__0.js → print-BJkyuCzw.js} +11 -11
- package/dist/chunks/{privacy-settings-CYkM3Aem.js → privacy-settings-BDVjqVcX.js} +1 -1
- package/dist/chunks/processBashCommand-DnzyTwtS.js +1 -0
- package/dist/chunks/processSlashCommand-BGBRvSCA.js +6 -0
- package/dist/chunks/prompt-BXrvaHyx.js +1 -0
- package/dist/chunks/prompt-DgIuTC6Q.js +227 -0
- package/dist/chunks/prompt-Fax-fxAf.js +1 -0
- package/dist/chunks/{promptEditor-U03qQWbq.js → promptEditor-BkHY_Vzb.js} +2 -2
- package/dist/chunks/{protocolHandler-3yBj9w5N.js → protocolHandler-CrXWRkxh.js} +1 -1
- package/dist/chunks/rate-limit-options-skMSi19l.js +1 -0
- package/dist/chunks/{rcDebugLog-ClX1msJX.js → rcDebugLog-Bv_x5w_B.js} +1 -1
- package/dist/chunks/{referral-qe-yqXJE.js → referral-DfKWr4Jf.js} +1 -1
- package/dist/chunks/refresh-zosTlttX.js +1 -0
- package/dist/chunks/{registerProtocol-CClQph00.js → registerProtocol-De6y1iOi.js} +1 -1
- package/dist/chunks/registry-C8JbYbJI.js +1 -0
- package/dist/chunks/{release-notes-CyZHxWTF.js → release-notes-Su1UPyE4.js} +1 -1
- package/dist/chunks/{releaseNotes-BtxL5R5Q.js → releaseNotes-C7-JnhrH.js} +2 -2
- package/dist/chunks/{reload-plugins-B0eR8JHH.js → reload-plugins-C8lWCq8M.js} +1 -1
- package/dist/chunks/{remote-env-B_sIjY87.js → remote-env-tQuvJmrt.js} +1 -1
- package/dist/chunks/{remoteBridgeCore-C3WRaLpU.js → remoteBridgeCore-CwOTDmNP.js} +1 -1
- package/dist/chunks/{remoteControlServer-BOj9qmgH.js → remoteControlServer-DIKi-0lr.js} +2 -2
- package/dist/chunks/rename-Trg9EHjT.js +1 -0
- package/dist/chunks/{resume-CpivBr9S.js → resume-Nt_EbjKh.js} +2 -2
- package/dist/chunks/{runtimeObserver-sOnfVR7t.js → runtimeObserver-CyWhTJpz.js} +4 -4
- package/dist/chunks/{runtimeObserver-C2_7Vsnd.js → runtimeObserver-T9QERJ_O.js} +1 -1
- package/dist/chunks/sandbox-adapter-BDGhDrPl.js +1 -0
- package/dist/chunks/{sandbox-toggle-Bv68-Ca7.js → sandbox-toggle-C6v31S7-.js} +1 -1
- package/dist/chunks/searchExtraTools-C8ehknh0.js +1 -0
- package/dist/chunks/{sentry-BBCn6RGP.js → sentry-CK_GHX79.js} +1 -1
- package/dist/chunks/{session-DfvxYP8o.js → session-Ys3KvmQ0.js} +1 -1
- package/dist/chunks/{sessionDiscovery-CyuRBTAm.js → sessionDiscovery-Cg3X2fKe.js} +1 -1
- package/dist/chunks/sessionFileAccessHooks-vthxapHk.js +1 -0
- package/dist/chunks/sessionMemory-ek1SfYG_.js +1 -0
- package/dist/chunks/sessionMemory-l-S0jpuk.js +1 -0
- package/dist/chunks/sessionMemoryUtils-BGJeJyKn.js +1 -0
- package/dist/chunks/sessionObserver-COTvvM3Z.js +1 -0
- package/dist/chunks/{sessionObserver-CTkIYplM.js → sessionObserver-DvAdG6vQ.js} +2 -2
- package/dist/chunks/sessionStorage-GKe4ALVr.js +1 -0
- package/dist/chunks/{sessionTitle-ePQRpeV2.js → sessionTitle-DJMmUKBJ.js} +2 -2
- package/dist/chunks/{sessionTracing-81-RIJBo.js → sessionTracing-DuQ3kbq6.js} +1 -1
- package/dist/chunks/{settingsSync-DEFWnE1o.js → settingsSync-1mhDakFG.js} +1 -1
- package/dist/chunks/{setup-CTfYsKsz.js → setup-CAy0HkI3.js} +1 -1
- package/dist/chunks/setup-CGxUKG8x.js +3 -0
- package/dist/chunks/{setup-2611vmGJ.js → setup-D5ioKRsS.js} +1 -1
- package/dist/chunks/{shadowedRuleDetection-CGD7Nx03.js → shadowedRuleDetection-Cq0y9pLR.js} +1 -1
- package/dist/chunks/{sideQuestion-BcP9Mm-5.js → sideQuestion-ZII6LMSM.js} +3 -3
- package/dist/chunks/{sink-D_t1TIt9.js → sink-Cd5g6Qqh.js} +1 -1
- package/dist/chunks/sink-Df9tds-b.js +1 -0
- package/dist/chunks/sinks-C4DwU8Xs.js +1 -0
- package/dist/chunks/{sinks-DXsozhmS.js → sinks-DZlIEjLZ.js} +2 -2
- package/dist/chunks/{skill-learning-CZm2iMik.js → skill-learning-DO21PjpF.js} +1 -1
- package/dist/chunks/skillChangeDetector-B6tL2yC9.js +1 -0
- package/dist/chunks/{skillGapStore-DzHv8v-D.js → skillGapStore-B_xv3GUy.js} +1 -1
- package/dist/chunks/{skillGapStore-cWo6Ra90.js → skillGapStore-CTD8MYTx.js} +2 -2
- package/dist/chunks/{skillGenerator-D_W1IeP3.js → skillGenerator-CO9r-gft.js} +2 -2
- package/dist/chunks/skillLearning-BJS4lsNk.js +1 -0
- package/dist/chunks/skillLearning-C2NmdcYQ.js +1 -0
- package/dist/chunks/{skillPanel-ChmOZu4F.js → skillPanel-DSumFGKN.js} +3 -3
- package/dist/chunks/{skillSearchPanel-CVx2b4Pr.js → skillSearchPanel-SqkfYBjV.js} +4 -4
- package/dist/chunks/{skills-CWX1SydA.js → skills-Bj3g5apl.js} +1 -1
- package/dist/chunks/{sprites-BuvEFwW6.js → sprites-CxMz3tIE.js} +1 -1
- package/dist/chunks/{stats-wjMQA-CA.js → stats-D1wYx84O.js} +1 -1
- package/dist/chunks/{status-CyU7IQhO.js → status-BWCqbeJ3.js} +1 -1
- package/dist/chunks/statusNoticeHelpers-DY0Cblkd.js +1 -0
- package/dist/chunks/{tag-opEEZI5B.js → tag-Hc7nOYm5.js} +2 -2
- package/dist/chunks/{tasks-CCtnU5u1.js → tasks-BSqecqVm.js} +1 -1
- package/dist/chunks/{teamHelpers-BJJs8taN.js → teamHelpers-BOmVFTLS.js} +1 -1
- package/dist/chunks/teamHelpers-BueGmQcw.js +1 -0
- package/dist/chunks/{teammateModeSnapshot-CLiiOCkO.js → teammateModeSnapshot-DhXjREuo.js} +1 -1
- package/dist/chunks/teammateModeSnapshot-_MCm6NGJ.js +1 -0
- package/dist/chunks/teleport-W2iPwivh.js +1 -0
- package/dist/chunks/{templateJobs-C6D7GC-Q.js → templateJobs-1oMC9yLQ.js} +1 -1
- package/dist/chunks/{terminalSetup-2ioFcRAA.js → terminalSetup-Bkml3uSP.js} +1 -1
- package/dist/chunks/{terminalSetup-B3bN4Cj8.js → terminalSetup-DJX1hqKs.js} +1 -1
- package/dist/chunks/{theme-Dgq_Og2P.js → theme-ia4cIc4d.js} +1 -1
- package/dist/chunks/thinkback-1NYskewu.js +1 -0
- package/dist/chunks/{thinkback-C43WBHis.js → thinkback-DWLUXUQC.js} +1 -1
- package/dist/chunks/thinkback-play-DZmXMRtq.js +1 -0
- package/dist/chunks/{toolEventObserver-B7EA-nNa.js → toolEventObserver-Ci0BECRu.js} +1 -1
- package/dist/chunks/{toolEventObserver-BG_3sGCL.js → toolEventObserver-nPwMQ5Vf.js} +1 -1
- package/dist/chunks/toolPool-ByCdlOak.js +1 -0
- package/dist/chunks/toolPool-IkNWjuk2.js +1 -0
- package/dist/chunks/{trustedDevice-S34i6Jc9.js → trustedDevice-BynTLVs4.js} +1 -1
- package/dist/chunks/{trustedDevice-DeNxe6bl.js → trustedDevice-CtL2IGDX.js} +1 -1
- package/dist/chunks/{ultrareviewCommand-C45bmZqN.js → ultrareviewCommand-DN-QhQ-f.js} +2 -2
- package/dist/chunks/undercover-CqJzV_Ar.js +1 -0
- package/dist/chunks/{undercover-DoUSM8d6.js → undercover-DLr5xI3K.js} +1 -1
- package/dist/chunks/{updateCCB-BuAm25MX.js → updateCCB-C6Ov8SNx.js} +4 -4
- package/dist/chunks/{upgrade-BDKg286g.js → upgrade-CVM1ffhq.js} +1 -1
- package/dist/chunks/upgrade-d40dVpDc.js +1 -0
- package/dist/chunks/{upload-CMptZXZs.js → upload-DSNwGLNd.js} +1 -1
- package/dist/chunks/{usage-Bw_LK9YI.js → usage-BRv8mBDf.js} +1 -1
- package/dist/chunks/{usage-DEWsKPXj.js → usage-GMw8NiO_.js} +1 -1
- package/dist/chunks/{useMainLoopModel-D0PmGDuy.js → useMainLoopModel-CEM_50a0.js} +1 -1
- package/dist/chunks/{useManagePlugins-B-ejJsXy.js → useManagePlugins-hCqb5F5n.js} +1 -1
- package/dist/chunks/{useMergedTools-B6x9qtfj.js → useMergedTools-DxvRmxVF.js} +1 -1
- package/dist/chunks/{useSearchInput-BpMLsxaS.js → useSearchInput-BCErnYur.js} +1 -1
- package/dist/chunks/useSettingsErrors-BwNeCSA6.js +1 -0
- package/dist/chunks/{useVoice-C3ryR2HE.js → useVoice-Cu39ifSa.js} +1 -1
- package/dist/chunks/{util-DWl5gjmI.js → util-DYuasrIE.js} +1 -1
- package/dist/chunks/utils-DSGFJaZ_.js +1 -0
- package/dist/chunks/{validatePlugin-8EMSASvV.js → validatePlugin-b1ec7M7n.js} +1 -1
- package/dist/chunks/{vim-CaZ20SrQ.js → vim-CrAzv4cM.js} +1 -1
- package/dist/chunks/{voice-BrnKguEV.js → voice-DKG3SYqi.js} +2 -2
- package/dist/chunks/{voiceModeEnabled-3eg8vSqy.js → voiceModeEnabled-By2qa3A2.js} +1 -1
- package/dist/chunks/voiceModeEnabled-DwYcj-FH.js +1 -0
- package/dist/chunks/voiceStreamSTT-DD8ulbg1.js +1 -0
- package/dist/chunks/{voiceStreamSTT-D7jWIYwz.js → voiceStreamSTT-DEV82xnN.js} +1 -1
- package/dist/chunks/{web-tools-BT3TbzG5.js → web-tools-8QRyE7va.js} +1 -1
- package/dist/chunks/windowsPaths-CRq9Bt5c.js +1 -0
- package/dist/chunks/windowsPaths-jbJ-skB_.js +1 -0
- package/dist/chunks/{workerRegistry-C_i5wwjL.js → workerRegistry-S7pO5khK.js} +1 -1
- package/dist/chunks/worktree-CfXrXsQ2.js +1 -0
- package/dist/chunks/{xml-DOXio8vw.js → xml-CPJXOUFt.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/ApproveApiKey-DUoUTxFp.js +0 -1
- package/dist/chunks/BackgroundTasksDialog-VKhuyQLe.js +0 -2
- package/dist/chunks/ClaudeMdExternalIncludesDialog-COO2W0ij.js +0 -1
- package/dist/chunks/ConsoleOAuthFlow-CPWq7O57.js +0 -1
- package/dist/chunks/DiffDialog-D0RK4t-9.js +0 -3
- package/dist/chunks/Doctor-0Nv3L1Oy.js +0 -3
- package/dist/chunks/Doctor-Ba9zhV0V.js +0 -1
- package/dist/chunks/Grove-DyvIToPa.js +0 -1
- package/dist/chunks/MCPConnectionManager-N-oJu3qn.js +0 -1
- package/dist/chunks/MessageSelector-D10JMnsc.js +0 -3
- package/dist/chunks/Messages-CQdQJ2AA.js +0 -11
- package/dist/chunks/PluginSettings-BBrFCSpQ.js +0 -17
- package/dist/chunks/QueryEngine-BSk8-8vB.js +0 -1
- package/dist/chunks/REPL-D-akKdFc.js +0 -1
- package/dist/chunks/ResumeConversation-hmIOkZ2U.js +0 -1
- package/dist/chunks/SearchExtraToolsTool-wDSdfnRo.js +0 -1
- package/dist/chunks/SentryErrorBoundary-Duyg6HeT.js +0 -1
- package/dist/chunks/Settings-BSbzT25q.js +0 -2
- package/dist/chunks/api-VMfJpk1G.js +0 -1
- package/dist/chunks/asciicast-DA6TudSH.js +0 -1
- package/dist/chunks/assistant-D7D1sqTB.js +0 -1
- package/dist/chunks/auth-CGdLe3rq.js +0 -1
- package/dist/chunks/backgroundHousekeeping-4H6yTjsj.js +0 -1
- package/dist/chunks/backgroundHousekeeping-zf-tDimg.js +0 -17
- package/dist/chunks/bridgeConfig-CTJBoASk.js +0 -1
- package/dist/chunks/bridgeEnabled-SMuWz3Is.js +0 -1
- package/dist/chunks/bridgeMain-Ct5oDosG.js +0 -68
- package/dist/chunks/bridgeMain-UqwOi37W.js +0 -1
- package/dist/chunks/caches-DKMoKTAZ.js +0 -1
- package/dist/chunks/changeDetector--KPj2maX.js +0 -1
- package/dist/chunks/channelNotification-fJgjqRMx.js +0 -1
- package/dist/chunks/clear-CYVCwiwu.js +0 -1
- package/dist/chunks/client-DvWRsIpi.js +0 -1
- package/dist/chunks/color-DiLtK8_L.js +0 -1
- package/dist/chunks/commands-BT2_ICaW.js +0 -1
- package/dist/chunks/commitAttribution-Bpbro1a4.js +0 -1
- package/dist/chunks/compact-C6xm1N5a.js +0 -3
- package/dist/chunks/context-noninteractive-BQDOgVUW.js +0 -1
- package/dist/chunks/conversation-Bt6QdGd-.js +0 -1
- package/dist/chunks/conversation-CBPRFDod.js +0 -1
- package/dist/chunks/createSession-BaHXBnfG.js +0 -1
- package/dist/chunks/datadog-DgYqUGa-.js +0 -1
- package/dist/chunks/envLessBridgeConfig-D_GCqhTu.js +0 -1
- package/dist/chunks/exit-DtjFIrvJ.js +0 -1
- package/dist/chunks/extra-usage-C4dUWLhg.js +0 -1
- package/dist/chunks/extraUsage-BMvDY0Sk.js +0 -1
- package/dist/chunks/extractMemories-DS7XXeEo.js +0 -1
- package/dist/chunks/fast-D1xIHYaN.js +0 -1
- package/dist/chunks/gates-CUAwAhPL.js +0 -1
- package/dist/chunks/hooks-DynUngv2.js +0 -1
- package/dist/chunks/inboundAttachments-Cug-8Xdy.js +0 -1
- package/dist/chunks/initReplBridge-DV9KhSic.js +0 -1
- package/dist/chunks/language-CjFs6_la.js +0 -1
- package/dist/chunks/loadAgentsDir-tPgCg0WD.js +0 -1
- package/dist/chunks/loadPluginHooks-2U3UO__Q.js +0 -1
- package/dist/chunks/localSearch-CxwxzM8W.js +0 -1
- package/dist/chunks/login-CVVFklZw.js +0 -1
- package/dist/chunks/logout-BYsszpXx.js +0 -1
- package/dist/chunks/mappers-BBkM1aA5.js +0 -1
- package/dist/chunks/mcp-C3jlClk0.js +0 -6
- package/dist/chunks/mcp-Cmw8ecKk.js +0 -1
- package/dist/chunks/model-VB4ItNVB.js +0 -1
- package/dist/chunks/permissions-DBddT2NP.js +0 -3
- package/dist/chunks/pluginBlocklist-DEM_RWc2.js +0 -1
- package/dist/chunks/pluginOperations-COyT4tHs.js +0 -2
- package/dist/chunks/pluginStartupCheck-DjfIaOch.js +0 -1
- package/dist/chunks/plugins-BanQjHmw.js +0 -4
- package/dist/chunks/policyLimits-D-Y_soHx.js +0 -1
- package/dist/chunks/poorMode-DQagHYWe.js +0 -1
- package/dist/chunks/processBashCommand-BLSC8o8M.js +0 -1
- package/dist/chunks/processSlashCommand-Ch9B-6nh.js +0 -6
- package/dist/chunks/prompt-BGNhFY1n.js +0 -227
- package/dist/chunks/prompt-CrNwH5kr.js +0 -1
- package/dist/chunks/prompt-dH0MMivt.js +0 -1
- package/dist/chunks/rate-limit-options-D-xl_9PO.js +0 -1
- package/dist/chunks/refresh-CO_P3WKA.js +0 -1
- package/dist/chunks/registry-C0zdU2Hb.js +0 -1
- package/dist/chunks/rename-BFAC3WLD.js +0 -1
- package/dist/chunks/sandbox-adapter-jX_WzvnK.js +0 -1
- package/dist/chunks/searchExtraTools-xPuOKDpi.js +0 -1
- package/dist/chunks/sessionFileAccessHooks-DiKsr7H7.js +0 -1
- package/dist/chunks/sessionMemory-C34-eFnJ.js +0 -1
- package/dist/chunks/sessionMemory-kYQnpcyG.js +0 -1
- package/dist/chunks/sessionMemoryUtils-CcJcgftx.js +0 -1
- package/dist/chunks/sessionObserver-B73s6yu8.js +0 -1
- package/dist/chunks/sessionStorage-BHi7PKs-.js +0 -1
- package/dist/chunks/setup-BJSk1czd.js +0 -3
- package/dist/chunks/sink-i8NmYch9.js +0 -1
- package/dist/chunks/sinks-3w0mLszx.js +0 -1
- package/dist/chunks/skillChangeDetector-1aFn40GC.js +0 -1
- package/dist/chunks/skillLearning-Bddmbx8E.js +0 -1
- package/dist/chunks/skillLearning-C-uI_jZB.js +0 -1
- package/dist/chunks/statusNoticeHelpers-JNibsI_v.js +0 -1
- package/dist/chunks/teamHelpers-D41zdxpl.js +0 -1
- package/dist/chunks/teammateModeSnapshot-q-bARbLL.js +0 -1
- package/dist/chunks/teleport-ClxQigSQ.js +0 -1
- package/dist/chunks/thinkback-BE8NNmAo.js +0 -1
- package/dist/chunks/thinkback-play-D2_n_aoQ.js +0 -1
- package/dist/chunks/toolPool-BLshLuvo.js +0 -1
- package/dist/chunks/toolPool-HYKCHxDA.js +0 -1
- package/dist/chunks/undercover-B4sdXe12.js +0 -1
- package/dist/chunks/upgrade-BiWGhm2d.js +0 -1
- package/dist/chunks/useSettingsErrors-DUe4k_RK.js +0 -1
- package/dist/chunks/utils-DP3EtI6F.js +0 -1
- package/dist/chunks/voiceModeEnabled-B1ARFTcz.js +0 -1
- package/dist/chunks/voiceStreamSTT-CONK4g-B.js +0 -1
- package/dist/chunks/windowsPaths-BeDSnJ23.js +0 -2
- package/dist/chunks/windowsPaths-ttHiMKpR.js +0 -1
- package/dist/chunks/worktree-CFNQKVGn.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{l as d,u as f}from"./oauth-CdZEzMww.js";import{i as p,n as m,r as h}from"./cron-DwR6OJuW.js";import{a as g,l as _,o as v}from"./api-hcsOinLV.js";import{r as y,t as b}from"./hostGuard-DSOEyH-P.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e,t;try{let n=await _();e=n.accessToken,t=n.orgUUID}catch(e){throw new F(`Not authenticated: ${e instanceof Error?e.message:String(e)}. Run /login to re-authenticate.`,401)}return b(C()),{...g(e),"anthropic-beta":N,"x-organization-uuid":t}}function C(){return`${d().BASE_API_URL}/v1/code/triggers`}function w(e){if(n.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new F(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new F(`Subscription required. Scheduled triggers require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new F(`Trigger not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new F(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new F((e.response?.data)?.error?.message??e.message,t)}return e instanceof F?e:new F(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let t;for(let r=0;r<P;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){t=i,r<P-1&&await x(T(n.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw t??new F(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await n.get(C(),{headers:e})).data.data??[]})}async function O(e){return E(async()=>{let t=await S();return(await n.get(`${C()}/${e}`,{headers:t})).data})}async function k(e){return E(async()=>{let t=await S();return(await n.post(C(),e,{headers:t})).data})}async function A(e,t){return E(async()=>{let r=await S();return(await n.post(`${C()}/${e}`,t,{headers:r})).data})}async function j(e){return E(async()=>{let t=await S();await n.delete(`${C()}/${e}`,{headers:t})})}async function M(e){return E(async()=>{let t=await S();return(await n.post(`${C()}/${e}/run`,{},{headers:t})).data})}var N,P,F,I=e((()=>{r(),f(),y(),v(),N=`ccr-triggers-2026-01-30`,P=3,F=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`TriggersApiError`}}}));function L({trigger:e}){let t=m(e.cron_expression,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`,r=e.enabled?`enabled`:`disabled`;return(0,z.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsxs)(s,{children:[(0,z.jsx)(a,{bold:!0,children:e.trigger_id}),(0,z.jsx)(a,{dimColor:!0,children:` · `}),(0,z.jsx)(a,{color:e.enabled?`success`:`warning`,children:r}),e.agent_id?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(a,{dimColor:!0,children:` · agent: `}),(0,z.jsx)(a,{children:e.agent_id})]}):null]}),(0,z.jsxs)(a,{children:[`Schedule: `,t]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Next run: `,n]})]})}function R(e){if(e.mode===`list`)return e.triggers.length===0?(0,z.jsx)(s,{children:(0,z.jsx)(a,{dimColor:!0,children:`No scheduled triggers. Use /schedule create <cron> <prompt> to create one.`})}):(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{marginBottom:1,children:(0,z.jsxs)(a,{bold:!0,children:[`Scheduled Triggers (`,e.triggers.length,`)`]})}),e.triggers.map(e=>(0,z.jsx)(L,{trigger:e},e.trigger_id))]});if(e.mode===`detail`){let{trigger:t}=e,n=m(t.cron_expression,{utc:!0}),r=t.next_run?new Date(t.next_run).toLocaleString():`—`,i=t.last_run?new Date(t.last_run).toLocaleString():`—`;return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{marginBottom:1,children:(0,z.jsxs)(a,{bold:!0,children:[`Trigger: `,t.trigger_id]})}),(0,z.jsxs)(a,{children:[`Status:`,` `,(0,z.jsx)(a,{color:t.enabled?`success`:`warning`,children:t.enabled?`enabled`:`disabled`})]}),(0,z.jsxs)(a,{children:[`Schedule: `,n]}),t.agent_id?(0,z.jsxs)(a,{children:[`Agent: `,t.agent_id]}):null,(0,z.jsxs)(a,{children:[`Next run: `,r]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Last run: `,i]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Prompt: `,t.prompt]}),t.created_at?(0,z.jsxs)(a,{dimColor:!0,children:[`Created: `,new Date(t.created_at).toLocaleString()]}):null]})}if(e.mode===`created`){let{trigger:t}=e,n=m(t.cron_expression,{utc:!0});return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsx)(a,{bold:!0,color:`success`,children:`Trigger created`})}),(0,z.jsxs)(a,{children:[`ID: `,t.trigger_id]}),(0,z.jsxs)(a,{children:[`Schedule: `,n]}),(0,z.jsxs)(a,{children:[`Prompt: `,t.prompt]}),t.agent_id?(0,z.jsxs)(a,{children:[`Agent: `,t.agent_id]}):null,(0,z.jsxs)(a,{dimColor:!0,children:[`Status: `,t.enabled?`enabled`:`disabled`]})]})}if(e.mode===`updated`){let{trigger:t}=e;return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsx)(a,{bold:!0,color:`success`,children:`Trigger updated`})}),(0,z.jsxs)(a,{children:[`ID: `,t.trigger_id]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Status: `,t.enabled?`enabled`:`disabled`]})]})}return e.mode===`deleted`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` deleted.`]})}):e.mode===`ran`?(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` fired.`]})}),(0,z.jsxs)(a,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):e.mode===`enabled`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` enabled.`]})}):e.mode===`disabled`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`warning`,children:[`Trigger `,e.id,` disabled.`]})}):(0,z.jsx)(s,{children:(0,z.jsx)(a,{color:`error`,children:e.message})})}var z,B=e((()=>{i(),o(),h(),z=c()}));function V(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function H(e){return e.trim().split(/\s+/).length===5}function U(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a trigger id`}}if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run weekly standup`};let e=V(i);if(!e)return{action:`invalid`,reason:`create requires 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run weekly standup`};let{cron:t,prompt:n}=e;return H(t)?n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}:{action:`invalid`,reason:`Invalid cron expression: "${t}". Expected 5 fields (minute hour day month weekday).`}}if(r===`update`){let e=i.split(/\s+/);if(e.length<3||!e[0])return{action:`invalid`,reason:`update requires an id, field, and value, e.g. update trg_123 enabled false`};let t=e[0],n=e[1]??``,r=e.slice(2).join(` `);return n?r?{action:`update`,id:t,field:n,value:r}:{action:`invalid`,reason:`update requires a value`}:{action:`invalid`,reason:`update requires a field name`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires a trigger id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires a trigger id`}}if(r===`enable`||r===`disable`){if(!i)return{action:`invalid`,reason:`${r} requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:r,id:e}:{action:`invalid`,reason:`${r} requires a trigger id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${W}`}}var W,G=e((()=>{W=`Usage: /schedule list | get ID | create CRON PROMPT | update ID FIELD VALUE | delete ID | run ID | enable ID | disable ID`})),K,q;e((()=>{K=t(i(),1),l(),h(),I(),B(),G(),q=async(e,t,n)=>{u(`tengu_schedule_started`,{args:n??``});let r=U(n??``);if(r.action===`invalid`)return u(`tengu_schedule_failed`,{reason:r.reason}),e(`Usage: /schedule list | get ID | create CRON PROMPT | update ID FIELD VALUE | delete ID | run ID | enable ID | disable ID\n${r.reason}`,{display:`system`}),null;if(r.action===`list`){u(`tengu_schedule_list`,{});try{let t=await D();return e(t.length===0?`No scheduled triggers found.`:`${t.length} scheduled trigger(s).`,{display:`system`}),K.createElement(R,{mode:`list`,triggers:t})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to list triggers: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}if(r.action===`get`){let{id:t}=r;u(`tengu_schedule_get`,{id:t});try{let n=await O(t);return e(`Trigger ${t} fetched.`,{display:`system`}),K.createElement(R,{mode:`detail`,trigger:n})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to get trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`create`){let{cron:t,prompt:n}=r;if(!p(t)){let n=`Invalid cron expression: "${t}". Expected 5 fields (minute hour day month weekday).`;return u(`tengu_schedule_failed`,{reason:n}),e(n,{display:`system`}),null}u(`tengu_schedule_create`,{cron:t});try{let r=await k({cron_expression:t,prompt:n});return e(`Trigger created: ${r.trigger_id}`,{display:`system`}),K.createElement(R,{mode:`created`,trigger:r})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to create trigger: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}if(r.action===`update`){let{id:t,field:n,value:i}=r;u(`tengu_schedule_update`,{id:t,field:n});let a={};if(n===`enabled`)a={enabled:i===`true`||i===`1`};else if(n===`cron_expression`||n===`cron`)a={cron_expression:i};else if(n===`prompt`)a={prompt:i};else if(n===`agent_id`)a={agent_id:i};else{let t=`Unknown field "${n}". Valid fields: enabled, cron_expression, prompt, agent_id`;return u(`tengu_schedule_failed`,{reason:t}),e(t,{display:`system`}),K.createElement(R,{mode:`error`,message:t})}try{let n=await A(t,a);return e(`Trigger ${t} updated.`,{display:`system`}),K.createElement(R,{mode:`updated`,trigger:n})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to update trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`delete`){let{id:t}=r;u(`tengu_schedule_delete`,{id:t});try{return await j(t),e(`Trigger ${t} deleted.`,{display:`system`}),K.createElement(R,{mode:`deleted`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to delete trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`run`){let{id:t}=r;u(`tengu_schedule_run`,{id:t});try{let n=await M(t);return e(`Trigger ${t} fired. Run ID: ${n.run_id}`,{display:`system`}),K.createElement(R,{mode:`ran`,id:t,runId:n.run_id})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to run trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`enable`){let{id:t}=r;u(`tengu_schedule_enable`,{id:t});try{return await A(t,{enabled:!0}),e(`Trigger ${t} enabled.`,{display:`system`}),K.createElement(R,{mode:`enabled`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to enable trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}let{id:i}=r;u(`tengu_schedule_disable`,{id:i});try{return await A(i,{enabled:!1}),e(`Trigger ${i} disabled.`,{display:`system`}),K.createElement(R,{mode:`disabled`,id:i})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to disable trigger ${i}: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}}))();export{q as callSchedule};
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{l as d,u as f}from"./oauth-CdZEzMww.js";import{i as p,n as m,r as h}from"./cron-DwR6OJuW.js";import{a as g,l as _,o as v}from"./api-C-KY7A3r.js";import{r as y,t as b}from"./hostGuard-DSOEyH-P.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e,t;try{let n=await _();e=n.accessToken,t=n.orgUUID}catch(e){throw new F(`Not authenticated: ${e instanceof Error?e.message:String(e)}. Run /login to re-authenticate.`,401)}return b(C()),{...g(e),"anthropic-beta":N,"x-organization-uuid":t}}function C(){return`${d().BASE_API_URL}/v1/code/triggers`}function w(e){if(n.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new F(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new F(`Subscription required. Scheduled triggers require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new F(`Trigger not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new F(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new F((e.response?.data)?.error?.message??e.message,t)}return e instanceof F?e:new F(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let t;for(let r=0;r<P;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){t=i,r<P-1&&await x(T(n.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw t??new F(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await n.get(C(),{headers:e})).data.data??[]})}async function O(e){return E(async()=>{let t=await S();return(await n.get(`${C()}/${e}`,{headers:t})).data})}async function k(e){return E(async()=>{let t=await S();return(await n.post(C(),e,{headers:t})).data})}async function A(e,t){return E(async()=>{let r=await S();return(await n.post(`${C()}/${e}`,t,{headers:r})).data})}async function j(e){return E(async()=>{let t=await S();await n.delete(`${C()}/${e}`,{headers:t})})}async function M(e){return E(async()=>{let t=await S();return(await n.post(`${C()}/${e}/run`,{},{headers:t})).data})}var N,P,F,I=e((()=>{r(),f(),y(),v(),N=`ccr-triggers-2026-01-30`,P=3,F=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`TriggersApiError`}}}));function L({trigger:e}){let t=m(e.cron_expression,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`,r=e.enabled?`enabled`:`disabled`;return(0,z.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsxs)(s,{children:[(0,z.jsx)(a,{bold:!0,children:e.trigger_id}),(0,z.jsx)(a,{dimColor:!0,children:` · `}),(0,z.jsx)(a,{color:e.enabled?`success`:`warning`,children:r}),e.agent_id?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(a,{dimColor:!0,children:` · agent: `}),(0,z.jsx)(a,{children:e.agent_id})]}):null]}),(0,z.jsxs)(a,{children:[`Schedule: `,t]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Next run: `,n]})]})}function R(e){if(e.mode===`list`)return e.triggers.length===0?(0,z.jsx)(s,{children:(0,z.jsx)(a,{dimColor:!0,children:`No scheduled triggers. Use /schedule create <cron> <prompt> to create one.`})}):(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{marginBottom:1,children:(0,z.jsxs)(a,{bold:!0,children:[`Scheduled Triggers (`,e.triggers.length,`)`]})}),e.triggers.map(e=>(0,z.jsx)(L,{trigger:e},e.trigger_id))]});if(e.mode===`detail`){let{trigger:t}=e,n=m(t.cron_expression,{utc:!0}),r=t.next_run?new Date(t.next_run).toLocaleString():`—`,i=t.last_run?new Date(t.last_run).toLocaleString():`—`;return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{marginBottom:1,children:(0,z.jsxs)(a,{bold:!0,children:[`Trigger: `,t.trigger_id]})}),(0,z.jsxs)(a,{children:[`Status:`,` `,(0,z.jsx)(a,{color:t.enabled?`success`:`warning`,children:t.enabled?`enabled`:`disabled`})]}),(0,z.jsxs)(a,{children:[`Schedule: `,n]}),t.agent_id?(0,z.jsxs)(a,{children:[`Agent: `,t.agent_id]}):null,(0,z.jsxs)(a,{children:[`Next run: `,r]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Last run: `,i]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Prompt: `,t.prompt]}),t.created_at?(0,z.jsxs)(a,{dimColor:!0,children:[`Created: `,new Date(t.created_at).toLocaleString()]}):null]})}if(e.mode===`created`){let{trigger:t}=e,n=m(t.cron_expression,{utc:!0});return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsx)(a,{bold:!0,color:`success`,children:`Trigger created`})}),(0,z.jsxs)(a,{children:[`ID: `,t.trigger_id]}),(0,z.jsxs)(a,{children:[`Schedule: `,n]}),(0,z.jsxs)(a,{children:[`Prompt: `,t.prompt]}),t.agent_id?(0,z.jsxs)(a,{children:[`Agent: `,t.agent_id]}):null,(0,z.jsxs)(a,{dimColor:!0,children:[`Status: `,t.enabled?`enabled`:`disabled`]})]})}if(e.mode===`updated`){let{trigger:t}=e;return(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsx)(a,{bold:!0,color:`success`,children:`Trigger updated`})}),(0,z.jsxs)(a,{children:[`ID: `,t.trigger_id]}),(0,z.jsxs)(a,{dimColor:!0,children:[`Status: `,t.enabled?`enabled`:`disabled`]})]})}return e.mode===`deleted`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` deleted.`]})}):e.mode===`ran`?(0,z.jsxs)(s,{flexDirection:`column`,children:[(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` fired.`]})}),(0,z.jsxs)(a,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):e.mode===`enabled`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`success`,children:[`Trigger `,e.id,` enabled.`]})}):e.mode===`disabled`?(0,z.jsx)(s,{children:(0,z.jsxs)(a,{color:`warning`,children:[`Trigger `,e.id,` disabled.`]})}):(0,z.jsx)(s,{children:(0,z.jsx)(a,{color:`error`,children:e.message})})}var z,B=e((()=>{i(),o(),h(),z=c()}));function V(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function H(e){return e.trim().split(/\s+/).length===5}function U(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a trigger id`}}if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run weekly standup`};let e=V(i);if(!e)return{action:`invalid`,reason:`create requires 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run weekly standup`};let{cron:t,prompt:n}=e;return H(t)?n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}:{action:`invalid`,reason:`Invalid cron expression: "${t}". Expected 5 fields (minute hour day month weekday).`}}if(r===`update`){let e=i.split(/\s+/);if(e.length<3||!e[0])return{action:`invalid`,reason:`update requires an id, field, and value, e.g. update trg_123 enabled false`};let t=e[0],n=e[1]??``,r=e.slice(2).join(` `);return n?r?{action:`update`,id:t,field:n,value:r}:{action:`invalid`,reason:`update requires a value`}:{action:`invalid`,reason:`update requires a field name`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires a trigger id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires a trigger id`}}if(r===`enable`||r===`disable`){if(!i)return{action:`invalid`,reason:`${r} requires a trigger id`};let e=i.split(/\s+/)[0];return e?{action:r,id:e}:{action:`invalid`,reason:`${r} requires a trigger id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${W}`}}var W,G=e((()=>{W=`Usage: /schedule list | get ID | create CRON PROMPT | update ID FIELD VALUE | delete ID | run ID | enable ID | disable ID`})),K,q;e((()=>{K=t(i(),1),l(),h(),I(),B(),G(),q=async(e,t,n)=>{u(`tengu_schedule_started`,{args:n??``});let r=U(n??``);if(r.action===`invalid`)return u(`tengu_schedule_failed`,{reason:r.reason}),e(`Usage: /schedule list | get ID | create CRON PROMPT | update ID FIELD VALUE | delete ID | run ID | enable ID | disable ID\n${r.reason}`,{display:`system`}),null;if(r.action===`list`){u(`tengu_schedule_list`,{});try{let t=await D();return e(t.length===0?`No scheduled triggers found.`:`${t.length} scheduled trigger(s).`,{display:`system`}),K.createElement(R,{mode:`list`,triggers:t})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to list triggers: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}if(r.action===`get`){let{id:t}=r;u(`tengu_schedule_get`,{id:t});try{let n=await O(t);return e(`Trigger ${t} fetched.`,{display:`system`}),K.createElement(R,{mode:`detail`,trigger:n})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to get trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`create`){let{cron:t,prompt:n}=r;if(!p(t)){let n=`Invalid cron expression: "${t}". Expected 5 fields (minute hour day month weekday).`;return u(`tengu_schedule_failed`,{reason:n}),e(n,{display:`system`}),null}u(`tengu_schedule_create`,{cron:t});try{let r=await k({cron_expression:t,prompt:n});return e(`Trigger created: ${r.trigger_id}`,{display:`system`}),K.createElement(R,{mode:`created`,trigger:r})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to create trigger: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}if(r.action===`update`){let{id:t,field:n,value:i}=r;u(`tengu_schedule_update`,{id:t,field:n});let a={};if(n===`enabled`)a={enabled:i===`true`||i===`1`};else if(n===`cron_expression`||n===`cron`)a={cron_expression:i};else if(n===`prompt`)a={prompt:i};else if(n===`agent_id`)a={agent_id:i};else{let t=`Unknown field "${n}". Valid fields: enabled, cron_expression, prompt, agent_id`;return u(`tengu_schedule_failed`,{reason:t}),e(t,{display:`system`}),K.createElement(R,{mode:`error`,message:t})}try{let n=await A(t,a);return e(`Trigger ${t} updated.`,{display:`system`}),K.createElement(R,{mode:`updated`,trigger:n})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to update trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`delete`){let{id:t}=r;u(`tengu_schedule_delete`,{id:t});try{return await j(t),e(`Trigger ${t} deleted.`,{display:`system`}),K.createElement(R,{mode:`deleted`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to delete trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`run`){let{id:t}=r;u(`tengu_schedule_run`,{id:t});try{let n=await M(t);return e(`Trigger ${t} fired. Run ID: ${n.run_id}`,{display:`system`}),K.createElement(R,{mode:`ran`,id:t,runId:n.run_id})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to run trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}if(r.action===`enable`){let{id:t}=r;u(`tengu_schedule_enable`,{id:t});try{return await A(t,{enabled:!0}),e(`Trigger ${t} enabled.`,{display:`system`}),K.createElement(R,{mode:`enabled`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return u(`tengu_schedule_failed`,{reason:r}),e(`Failed to enable trigger ${t}: ${r}`,{display:`system`}),K.createElement(R,{mode:`error`,message:r})}}let{id:i}=r;u(`tengu_schedule_disable`,{id:i});try{return await A(i,{enabled:!1}),e(`Trigger ${i} disabled.`,{display:`system`}),K.createElement(R,{mode:`disabled`,id:i})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_schedule_failed`,{reason:n}),e(`Failed to disable trigger ${i}: ${n}`,{display:`system`}),K.createElement(R,{mode:`error`,message:n})}}}))();export{q as callSchedule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{Rn as o,b as s,t as c,x as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{l as p,u as m}from"./oauth-CdZEzMww.js";import{o as h,u as g}from"./api-hcsOinLV.js";import{n as _,r as v}from"./hostGuard-DSOEyH-P.js";import{join as y}from"node:path";import{mkdir as b,writeFile as x}from"node:fs/promises";function S(e){return new Promise(t=>setTimeout(t,e))}async function C(){let e;try{e=(await g()).apiKey}catch(e){throw new R(e instanceof Error?e.message:String(e),501)}return _(w()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"content-type":`application/json`}}function w(){return`${p().BASE_API_URL}/v1/skills?beta=true`}function T(e){return`${p().BASE_API_URL}/v1/skills/${e}?beta=true`}function E(e){return`${p().BASE_API_URL}/v1/skills/${e}/versions?beta=true`}function D(e,t){return`${p().BASE_API_URL}/v1/skills/${e}/versions/${t}?beta=true`}function O(e){if(i.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new R(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new R(`Subscription required. Skill store requires a Claude Pro/Max/Team subscription.`,403);if(t===404)return new R(`Skill or version not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new R(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new R((e.response?.data)?.error?.message??e.message,t)}return e instanceof R?e:new R(e instanceof Error?e.message:String(e),0)}function k(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function A(e){let t;for(let n=0;n<L;n++)try{return await e()}catch(e){let r=O(e);if(r.statusCode>=500){t=r,n<L-1&&await S(k(i.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**n);continue}throw r}throw t??new R(`Request failed after retries`,0)}async function j(){return A(async()=>{let e=await C();return(await i.get(w(),{headers:e})).data.data??[]})}async function M(e){return A(async()=>{let t=await C();return(await i.get(T(e),{headers:t})).data})}async function N(e){return A(async()=>{let t=await C();return(await i.get(E(e),{headers:t})).data.data??[]})}async function P(e,t){return A(async()=>{let n=await C();return(await i.get(D(e,t),{headers:n})).data})}async function F(e,t){return A(async()=>{let n=await C(),r={name:e,body:t};return(await i.post(w(),r,{headers:n})).data})}async function I(e){return A(async()=>{let t=await C();await i.delete(T(e),{headers:t})})}var L,R,z=e((()=>{a(),m(),v(),h(),L=3,R=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`SkillsApiError`}}}));function B({skill:e}){let t=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,H.jsxs)(l,{children:[(0,H.jsx)(s,{bold:!0,children:e.skill_id}),(0,H.jsx)(s,{dimColor:!0,children:` · `}),(0,H.jsx)(s,{children:e.name}),e.deprecated?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(s,{dimColor:!0,children:` · `}),(0,H.jsx)(s,{color:`warning`,children:`deprecated`})]}):null]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Owner: `,e.owner,e.owner_symbol?` (${e.owner_symbol})`:``]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,t]})]})}function V(e){if(e.mode===`list`)return e.skills.length===0?(0,H.jsx)(l,{children:(0,H.jsx)(s,{dimColor:!0,children:`No skills found. Use /skill-store create <name> <markdown> to publish one.`})}):(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Skills (`,e.skills.length,`)`]})}),e.skills.map(e=>(0,H.jsx)(B,{skill:e},e.skill_id))]});if(e.mode===`detail`){let{skill:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Skill: `,t.skill_id]})}),(0,H.jsxs)(s,{children:[`Name: `,t.name]}),(0,H.jsxs)(s,{children:[`Owner: `,t.owner,t.owner_symbol?` (${t.owner_symbol})`:``]}),(0,H.jsxs)(s,{children:[`Status:`,` `,(0,H.jsx)(s,{color:t.deprecated?`warning`:`success`,children:t.deprecated?`deprecated`:`active`})]}),t.allowed_tools&&t.allowed_tools.length>0?(0,H.jsxs)(s,{children:[`Allowed tools: `,t.allowed_tools.join(`, `)]}):null,(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,n]})]})}if(e.mode===`versions`){let{id:t,versions:n}=e;return n.length===0?(0,H.jsx)(l,{children:(0,H.jsxs)(s,{dimColor:!0,children:[`No versions found for skill `,t,`.`]})}):(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Versions for `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,H.jsx)(s,{bold:!0,children:e.version}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,t]}),(0,H.jsx)(s,{dimColor:!0,children:e.body.length>80?`${e.body.slice(0,80)}…`:e.body})]},e.version)})]})}if(e.mode===`version-detail`){let{version:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Version: `,t.version,` (skill: `,t.skill_id,`)`]})}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,n]}),(0,H.jsx)(l,{marginTop:1,children:(0,H.jsx)(s,{children:t.body})})]})}if(e.mode===`created`){let{skill:t}=e;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{children:(0,H.jsx)(s,{bold:!0,color:`success`,children:`Skill created`})}),(0,H.jsxs)(s,{children:[`ID: `,t.skill_id]}),(0,H.jsxs)(s,{children:[`Name: `,t.name]})]})}return e.mode===`deleted`?(0,H.jsx)(l,{children:(0,H.jsxs)(s,{color:`success`,children:[`Skill `,e.id,` deleted.`]})}):e.mode===`installed`?(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{children:(0,H.jsx)(s,{bold:!0,color:`success`,children:`Skill installed`})}),(0,H.jsxs)(s,{children:[`Name: `,e.skillName]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Path: `,e.path]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Load with: /skills (bundled skills are not auto-loaded; place in `,e.path,`)`]})]}):(0,H.jsx)(l,{children:(0,H.jsx)(s,{color:`error`,children:e.message})})}var H,U=e((()=>{o(),c(),H=u()}));function W(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a skill id`}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,id:e}:{action:`invalid`,reason:`versions requires a skill id`}}if(r===`version`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`version requires a skill id and version, e.g. version sk_123 v1`}:{action:`version`,id:e[0],version:e[1]}}if(r===`create`){let e=i.indexOf(` `);if(!i||e===-1)return{action:`invalid`,reason:`create requires a skill name and markdown body, e.g. create my-skill "# My Skill\\nContent"`};let t=i.slice(0,e).trim(),n=i.slice(e+1).trim();return t?n?{action:`create`,name:t,markdown:n}:{action:`invalid`,reason:`create requires a non-empty markdown body`}:{action:`invalid`,reason:`create requires a non-empty skill name`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires a skill id`}}if(r===`install`){if(!i)return{action:`invalid`,reason:`install requires a skill id (optionally with @version), e.g. install sk_123 or install sk_123@v2`};let e=i.split(/\s+/)[0];if(!e)return{action:`invalid`,reason:`install requires a skill id`};let t=e.indexOf(`@`);if(t===-1)return{action:`install`,id:e,version:void 0};let n=e.slice(0,t),r=e.slice(t+1);return n?r?{action:`install`,id:n,version:r}:{action:`invalid`,reason:`install requires a non-empty version after @`}:{action:`invalid`,reason:`install requires a non-empty skill id before @`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${G}`}}var G,K=e((()=>{G=`Usage: /skill-store list | get ID | versions ID | version ID VER | create NAME MARKDOWN | delete ID | install ID[@VERSION]`})),q,J,Y;e((()=>{q=t(o(),1),d(),r(),z(),U(),K(),J=`Usage: /skill-store list | get ID | versions ID | version ID VER | create NAME MARKDOWN | delete ID | install ID[@VERSION]`,Y=async(e,t,r)=>{f(`tengu_skill_store_started`,{args:r??``});let i=W(r??``);if(i.action===`invalid`)return f(`tengu_skill_store_failed`,{reason:i.reason}),e(`${J}\n${i.reason}`,{display:`system`}),null;if(i.action===`list`){f(`tengu_skill_store_list`,{});try{let t=await j();return e(t.length===0?`No skills found in the marketplace.`:`${t.length} skill(s) available.`,{display:`system`}),q.createElement(V,{mode:`list`,skills:t})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to list skills: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}if(i.action===`get`){let{id:t}=i;f(`tengu_skill_store_get`,{id:t});try{let n=await M(t);return e(`Skill ${t} fetched.`,{display:`system`}),q.createElement(V,{mode:`detail`,skill:n})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to get skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}if(i.action===`versions`){let{id:t}=i;f(`tengu_skill_store_versions`,{id:t});try{let n=await N(t);return e(n.length===0?`No versions found for skill ${t}.`:`${n.length} version(s) for skill ${t}.`,{display:`system`}),q.createElement(V,{mode:`versions`,id:t,versions:n})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to list versions for skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}if(i.action===`version`){let{id:t,version:n}=i;f(`tengu_skill_store_version`,{id:t});try{let r=await P(t,n);return e(`Skill ${t}@${n} fetched.`,{display:`system`}),q.createElement(V,{mode:`version-detail`,version:r})}catch(r){let i=r instanceof Error?r.message:String(r);return f(`tengu_skill_store_failed`,{reason:i}),e(`Failed to get version ${n} for skill ${t}: ${i}`,{display:`system`}),q.createElement(V,{mode:`error`,message:i})}}if(i.action===`create`){let{name:t,markdown:n}=i;f(`tengu_skill_store_create`,{name:t});try{let r=await F(t,n);return e(`Skill created: ${r.skill_id}`,{display:`system`}),q.createElement(V,{mode:`created`,skill:r})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to create skill: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}if(i.action===`delete`){let{id:t}=i;f(`tengu_skill_store_delete`,{id:t});try{return await I(t),e(`Skill ${t} deleted.`,{display:`system`}),q.createElement(V,{mode:`deleted`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to delete skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}let{id:a,version:o}=i;f(`tengu_skill_store_install`,{id:a});try{let t,r;if(o!==void 0){let e=await P(a,o);r=e.body,t=e.skill_id}else{let n=await M(a),i=await N(a);if(i.length===0)return e(`Skill ${a} has no published versions to install.`,{display:`system`}),q.createElement(V,{mode:`error`,message:`Skill ${a} has no published versions to install.`});let o=[...i].sort((e,t)=>{let n=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-n})[0];if(!o)return e(`Skill ${a} has no published versions to install.`,{display:`system`}),q.createElement(V,{mode:`error`,message:`Skill ${a} has no published versions to install.`});r=o.body,t=n.name}let i=t.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||a,s=y(n(),`skills`,i),c=y(s,`SKILL.md`);return await b(s,{recursive:!0}),await x(c,r,`utf-8`),e(`Skill installed to ${c}`,{display:`system`}),q.createElement(V,{mode:`installed`,skillName:i,path:c})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to install skill ${a}: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}}))();export{Y as callSkillStore};
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,s as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{Rn as o,b as s,t as c,x as l}from"./src-Di342QoJ.js";import{t as u}from"./jsx-runtime-D-D469L8.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{l as p,u as m}from"./oauth-CdZEzMww.js";import{o as h,u as g}from"./api-C-KY7A3r.js";import{n as _,r as v}from"./hostGuard-DSOEyH-P.js";import{join as y}from"node:path";import{mkdir as b,writeFile as x}from"node:fs/promises";function S(e){return new Promise(t=>setTimeout(t,e))}async function C(){let e;try{e=(await g()).apiKey}catch(e){throw new R(e instanceof Error?e.message:String(e),501)}return _(w()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"content-type":`application/json`}}function w(){return`${p().BASE_API_URL}/v1/skills?beta=true`}function T(e){return`${p().BASE_API_URL}/v1/skills/${e}?beta=true`}function E(e){return`${p().BASE_API_URL}/v1/skills/${e}/versions?beta=true`}function D(e,t){return`${p().BASE_API_URL}/v1/skills/${e}/versions/${t}?beta=true`}function O(e){if(i.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new R(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new R(`Subscription required. Skill store requires a Claude Pro/Max/Team subscription.`,403);if(t===404)return new R(`Skill or version not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new R(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new R((e.response?.data)?.error?.message??e.message,t)}return e instanceof R?e:new R(e instanceof Error?e.message:String(e),0)}function k(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function A(e){let t;for(let n=0;n<L;n++)try{return await e()}catch(e){let r=O(e);if(r.statusCode>=500){t=r,n<L-1&&await S(k(i.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**n);continue}throw r}throw t??new R(`Request failed after retries`,0)}async function j(){return A(async()=>{let e=await C();return(await i.get(w(),{headers:e})).data.data??[]})}async function M(e){return A(async()=>{let t=await C();return(await i.get(T(e),{headers:t})).data})}async function N(e){return A(async()=>{let t=await C();return(await i.get(E(e),{headers:t})).data.data??[]})}async function P(e,t){return A(async()=>{let n=await C();return(await i.get(D(e,t),{headers:n})).data})}async function F(e,t){return A(async()=>{let n=await C(),r={name:e,body:t};return(await i.post(w(),r,{headers:n})).data})}async function I(e){return A(async()=>{let t=await C();await i.delete(T(e),{headers:t})})}var L,R,z=e((()=>{a(),m(),v(),h(),L=3,R=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`SkillsApiError`}}}));function B({skill:e}){let t=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,H.jsxs)(l,{children:[(0,H.jsx)(s,{bold:!0,children:e.skill_id}),(0,H.jsx)(s,{dimColor:!0,children:` · `}),(0,H.jsx)(s,{children:e.name}),e.deprecated?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(s,{dimColor:!0,children:` · `}),(0,H.jsx)(s,{color:`warning`,children:`deprecated`})]}):null]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Owner: `,e.owner,e.owner_symbol?` (${e.owner_symbol})`:``]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,t]})]})}function V(e){if(e.mode===`list`)return e.skills.length===0?(0,H.jsx)(l,{children:(0,H.jsx)(s,{dimColor:!0,children:`No skills found. Use /skill-store create <name> <markdown> to publish one.`})}):(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Skills (`,e.skills.length,`)`]})}),e.skills.map(e=>(0,H.jsx)(B,{skill:e},e.skill_id))]});if(e.mode===`detail`){let{skill:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Skill: `,t.skill_id]})}),(0,H.jsxs)(s,{children:[`Name: `,t.name]}),(0,H.jsxs)(s,{children:[`Owner: `,t.owner,t.owner_symbol?` (${t.owner_symbol})`:``]}),(0,H.jsxs)(s,{children:[`Status:`,` `,(0,H.jsx)(s,{color:t.deprecated?`warning`:`success`,children:t.deprecated?`deprecated`:`active`})]}),t.allowed_tools&&t.allowed_tools.length>0?(0,H.jsxs)(s,{children:[`Allowed tools: `,t.allowed_tools.join(`, `)]}):null,(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,n]})]})}if(e.mode===`versions`){let{id:t,versions:n}=e;return n.length===0?(0,H.jsx)(l,{children:(0,H.jsxs)(s,{dimColor:!0,children:[`No versions found for skill `,t,`.`]})}):(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Versions for `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,marginBottom:1,children:[(0,H.jsx)(s,{bold:!0,children:e.version}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,t]}),(0,H.jsx)(s,{dimColor:!0,children:e.body.length>80?`${e.body.slice(0,80)}…`:e.body})]},e.version)})]})}if(e.mode===`version-detail`){let{version:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{marginBottom:1,children:(0,H.jsxs)(s,{bold:!0,children:[`Version: `,t.version,` (skill: `,t.skill_id,`)`]})}),(0,H.jsxs)(s,{dimColor:!0,children:[`Created: `,n]}),(0,H.jsx)(l,{marginTop:1,children:(0,H.jsx)(s,{children:t.body})})]})}if(e.mode===`created`){let{skill:t}=e;return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{children:(0,H.jsx)(s,{bold:!0,color:`success`,children:`Skill created`})}),(0,H.jsxs)(s,{children:[`ID: `,t.skill_id]}),(0,H.jsxs)(s,{children:[`Name: `,t.name]})]})}return e.mode===`deleted`?(0,H.jsx)(l,{children:(0,H.jsxs)(s,{color:`success`,children:[`Skill `,e.id,` deleted.`]})}):e.mode===`installed`?(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsx)(l,{children:(0,H.jsx)(s,{bold:!0,color:`success`,children:`Skill installed`})}),(0,H.jsxs)(s,{children:[`Name: `,e.skillName]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Path: `,e.path]}),(0,H.jsxs)(s,{dimColor:!0,children:[`Load with: /skills (bundled skills are not auto-loaded; place in `,e.path,`)`]})]}):(0,H.jsx)(l,{children:(0,H.jsx)(s,{color:`error`,children:e.message})})}var H,U=e((()=>{o(),c(),H=u()}));function W(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a skill id`}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,id:e}:{action:`invalid`,reason:`versions requires a skill id`}}if(r===`version`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`version requires a skill id and version, e.g. version sk_123 v1`}:{action:`version`,id:e[0],version:e[1]}}if(r===`create`){let e=i.indexOf(` `);if(!i||e===-1)return{action:`invalid`,reason:`create requires a skill name and markdown body, e.g. create my-skill "# My Skill\\nContent"`};let t=i.slice(0,e).trim(),n=i.slice(e+1).trim();return t?n?{action:`create`,name:t,markdown:n}:{action:`invalid`,reason:`create requires a non-empty markdown body`}:{action:`invalid`,reason:`create requires a non-empty skill name`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires a skill id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires a skill id`}}if(r===`install`){if(!i)return{action:`invalid`,reason:`install requires a skill id (optionally with @version), e.g. install sk_123 or install sk_123@v2`};let e=i.split(/\s+/)[0];if(!e)return{action:`invalid`,reason:`install requires a skill id`};let t=e.indexOf(`@`);if(t===-1)return{action:`install`,id:e,version:void 0};let n=e.slice(0,t),r=e.slice(t+1);return n?r?{action:`install`,id:n,version:r}:{action:`invalid`,reason:`install requires a non-empty version after @`}:{action:`invalid`,reason:`install requires a non-empty skill id before @`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${G}`}}var G,K=e((()=>{G=`Usage: /skill-store list | get ID | versions ID | version ID VER | create NAME MARKDOWN | delete ID | install ID[@VERSION]`})),q,J,Y;e((()=>{q=t(o(),1),d(),r(),z(),U(),K(),J=`Usage: /skill-store list | get ID | versions ID | version ID VER | create NAME MARKDOWN | delete ID | install ID[@VERSION]`,Y=async(e,t,r)=>{f(`tengu_skill_store_started`,{args:r??``});let i=W(r??``);if(i.action===`invalid`)return f(`tengu_skill_store_failed`,{reason:i.reason}),e(`${J}\n${i.reason}`,{display:`system`}),null;if(i.action===`list`){f(`tengu_skill_store_list`,{});try{let t=await j();return e(t.length===0?`No skills found in the marketplace.`:`${t.length} skill(s) available.`,{display:`system`}),q.createElement(V,{mode:`list`,skills:t})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to list skills: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}if(i.action===`get`){let{id:t}=i;f(`tengu_skill_store_get`,{id:t});try{let n=await M(t);return e(`Skill ${t} fetched.`,{display:`system`}),q.createElement(V,{mode:`detail`,skill:n})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to get skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}if(i.action===`versions`){let{id:t}=i;f(`tengu_skill_store_versions`,{id:t});try{let n=await N(t);return e(n.length===0?`No versions found for skill ${t}.`:`${n.length} version(s) for skill ${t}.`,{display:`system`}),q.createElement(V,{mode:`versions`,id:t,versions:n})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to list versions for skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}if(i.action===`version`){let{id:t,version:n}=i;f(`tengu_skill_store_version`,{id:t});try{let r=await P(t,n);return e(`Skill ${t}@${n} fetched.`,{display:`system`}),q.createElement(V,{mode:`version-detail`,version:r})}catch(r){let i=r instanceof Error?r.message:String(r);return f(`tengu_skill_store_failed`,{reason:i}),e(`Failed to get version ${n} for skill ${t}: ${i}`,{display:`system`}),q.createElement(V,{mode:`error`,message:i})}}if(i.action===`create`){let{name:t,markdown:n}=i;f(`tengu_skill_store_create`,{name:t});try{let r=await F(t,n);return e(`Skill created: ${r.skill_id}`,{display:`system`}),q.createElement(V,{mode:`created`,skill:r})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to create skill: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}if(i.action===`delete`){let{id:t}=i;f(`tengu_skill_store_delete`,{id:t});try{return await I(t),e(`Skill ${t} deleted.`,{display:`system`}),q.createElement(V,{mode:`deleted`,id:t})}catch(n){let r=n instanceof Error?n.message:String(n);return f(`tengu_skill_store_failed`,{reason:r}),e(`Failed to delete skill ${t}: ${r}`,{display:`system`}),q.createElement(V,{mode:`error`,message:r})}}let{id:a,version:o}=i;f(`tengu_skill_store_install`,{id:a});try{let t,r;if(o!==void 0){let e=await P(a,o);r=e.body,t=e.skill_id}else{let n=await M(a),i=await N(a);if(i.length===0)return e(`Skill ${a} has no published versions to install.`,{display:`system`}),q.createElement(V,{mode:`error`,message:`Skill ${a} has no published versions to install.`});let o=[...i].sort((e,t)=>{let n=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-n})[0];if(!o)return e(`Skill ${a} has no published versions to install.`,{display:`system`}),q.createElement(V,{mode:`error`,message:`Skill ${a} has no published versions to install.`});r=o.body,t=n.name}let i=t.replace(/[^a-zA-Z0-9_-]/g,`-`).replace(/^-+|-+$/g,``)||a,s=y(n(),`skills`,i),c=y(s,`SKILL.md`);return await b(s,{recursive:!0}),await x(c,r,`utf-8`),e(`Skill installed to ${c}`,{display:`system`}),q.createElement(V,{mode:`installed`,skillName:i,path:c})}catch(t){let n=t instanceof Error?t.message:String(t);return f(`tengu_skill_store_failed`,{reason:n}),e(`Failed to install skill ${a}: ${n}`,{display:`system`}),q.createElement(V,{mode:`error`,message:n})}}}))();export{Y as callSkillStore};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./analytics-DqMQntaB.js";import{
|
|
2
|
-
`)}var f,p,m;e((()=>{t(),
|
|
3
|
-
Start a new session at https://claude.ai/code`,{display:`system`}),null):(t.length>=p&&n(`tengu_teleport_page_cap`,{count:u(String(t.length))}),e(d(t),{display:`system`}),null)}if(m.length<f||!/^[0-9a-f-]{8,}$/i.test(m))return n(`tengu_teleport_error_bad_status`,{error:u(`invalid_session_id: ${m.slice(0,40)}`)}),e(`Invalid session id "${m}". Expected a UUID-like string (e.g. 12345678-abcd-...).`,{display:`system`}),null;n(`tengu_teleport_source_decision`,{source:u(`explicit_id`)});let h=[],g=e=>{h.push(e)};g(`validate`);try{await
|
|
1
|
+
import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./analytics-DqMQntaB.js";import{Fv as r,Hv as i,Lr as a,Sr as o,zv as s}from"./loadAgentsDir-BfEZacjM.js";import{n as c,o as l}from"./api-C-KY7A3r.js";function u(e){return e}function d(e){return[`## Available sessions (most recent first)`,``,...e.slice(0,p).map((e,t)=>` ${String(t+1).padStart(2)}. ${e.title.slice(0,50).padEnd(50)} ${e.status.padEnd(14)} ${e.created_at.slice(0,10)} id=${e.id}`),``,"Run `/teleport <session-id>` to resume a session."].join(`
|
|
2
|
+
`)}var f,p,m;e((()=>{t(),a(),r(),l(),f=8,p=20,m=async(e,t,r)=>{let a=r.trim(),l=a===`--print`||a.startsWith(`--print `),m=l?a.replace(/^--print\s*/,``).trim():a;if(n(`tengu_teleport_started`,{has_session_id:u(m?`true`:`false`)}),!m){n(`tengu_teleport_source_decision`,{source:u(`sessions_api`)});let t;try{t=(await c()).map(e=>({id:e.id,title:e.title??`Untitled`,status:e.status??`unknown`,created_at:e.created_at??``}))}catch(t){let r=t instanceof Error?t.message:String(t);return/forbidden|401|403/i.test(r)?(n(`tengu_teleport_events_fetch_forbidden`,{error:u(r.slice(0,200))}),e("Teleport: permission denied fetching sessions. Check your OAuth token (`claude auth status`).",{display:`system`}),null):/not found|404/i.test(r)?(n(`tengu_teleport_events_fetch_not_found`,{error:u(r.slice(0,200))}),e(`Teleport: sessions endpoint returned 404. The Sessions API may not be available for your account.`,{display:`system`}),null):/token|unauthorized/i.test(r)?(n(`tengu_teleport_error_bad_token`,{error:u(r.slice(0,200))}),e(`Teleport: authentication error — ${r}. Try \`claude auth login\`.`,{display:`system`}),null):(n(`tengu_teleport_events_fetch_fail`,{error:u(r.slice(0,200))}),e(`Teleport: failed to fetch sessions — ${r}.\nUsage: /teleport SESSION_ID`,{display:`system`}),null)}return t.length===0?(n(`tengu_teleport_null`,{}),e(`No active sessions found on claude.ai/code.
|
|
3
|
+
Start a new session at https://claude.ai/code`,{display:`system`}),null):(t.length>=p&&n(`tengu_teleport_page_cap`,{count:u(String(t.length))}),e(d(t),{display:`system`}),null)}if(m.length<f||!/^[0-9a-f-]{8,}$/i.test(m))return n(`tengu_teleport_error_bad_status`,{error:u(`invalid_session_id: ${m.slice(0,40)}`)}),e(`Invalid session id "${m}". Expected a UUID-like string (e.g. 12345678-abcd-...).`,{display:`system`}),null;n(`tengu_teleport_source_decision`,{source:u(`explicit_id`)});let h=[],g=e=>{h.push(e)};g(`validate`);try{await i()}catch(t){let r=t instanceof Error?t.message:String(t);return n(`tengu_teleport_errors_detected`,{error:u(r.slice(0,200))}),e(`Cannot teleport: ${r}`,{display:`system`}),null}g(`resume`);try{let r=``;if(await s(m,e=>{r=String(e)}),n(`tengu_teleport_resume_session`,{stage:u(r)}),g(`ready`),!t.resume)return n(`tengu_teleport_null`,{}),l?(e(`Session ${m} fetched successfully.`,{display:`system`}),null):(e(`Teleport resume succeeded for ${m}, but the REPL did not provide a resume callback.`,{display:`system`}),null);g(`fetch`);let i=await o(m);return i?(n(`tengu_teleport_errors_resolved`,{}),await t.resume(m,i,`slash_command_session_id`),n(`tengu_teleport_first_message_success`,{}),null):(n(`tengu_teleport_errors_detected`,{error:u(`log_not_found_after_resume`)}),e(`Teleport fetched session ${m} but the local log was not found. Try /resume ${m} manually.`,{display:`system`}),null)}catch(t){let r=t instanceof Error?t.message:String(t),i=`tengu_teleport_failed`;return/not found/i.test(r)?i=`tengu_teleport_error_session_not_found_`:/repo.*mismatch/i.test(r)?i=`tengu_teleport_error_repo_mismatch_sessions_api`:/not in.*git|git.*dir/i.test(r)?i=`tengu_teleport_error_repo_not_in_git_dir_sessions_api`:/cancelled|aborted/i.test(r)?i=`tengu_teleport_cancelled`:/token|unauthorized|401/i.test(r)?i=`tengu_teleport_error_bad_token`:/status|4\d\d|5\d\d/i.test(r)&&(i=`tengu_teleport_error_bad_status`),n(i,{error:u(r.slice(0,200))}),n(`tengu_teleport_first_message_error`,{error:u(r.slice(0,200))}),e(`Teleport failed: ${r}`,{display:`system`}),null}}}))();export{m as callTeleport};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{l,u}from"./oauth-CdZEzMww.js";import{o as d,u as f}from"./api-
|
|
1
|
+
import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{l,u}from"./oauth-CdZEzMww.js";import{o as d,u as f}from"./api-C-KY7A3r.js";import{n as p,r as m}from"./hostGuard-DSOEyH-P.js";import{n as h,t as g}from"./launchCommand-9eYsPG7W.js";function _(e){return e.length<=8?e:`${e.slice(0,8)}…`}var v=e((()=>{}));function y(e){return new Promise(t=>setTimeout(t,e))}async function b(){let e;try{e=(await f()).apiKey}catch(e){throw new N(e instanceof Error?e.message:String(e),501)}return p(x()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":j,"content-type":`application/json`}}function x(){return`${l().BASE_API_URL}/v1/vaults`}function S(e,t){let r=t?` (${_(t)})`:``;if(n.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new N(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new N(`Subscription required. Vault management requires a Claude Pro/Max/Team subscription.`,403);if(t===404)return new N(`Vault or credential not found${r}.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new N(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new N((e.response?.data)?.error?.message??e.message,t)}return e instanceof N?e:new N(e instanceof Error?e.message:String(e),0)}function C(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function w(e,t){let r;for(let i=0;i<M;i++)try{return await e()}catch(e){let a=S(e,t);if(a.statusCode>=500){r=a,i<M-1&&await y(C(n.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**i);continue}throw a}throw r??new N(`Request failed after retries`,0)}async function T(){return w(async()=>{let e=await b();return(await n.get(x(),{headers:e})).data.data??[]})}async function E(e){return w(async()=>{let t=await b(),r={name:e};return(await n.post(x(),r,{headers:t})).data})}async function D(e){return w(async()=>{let t=await b();return(await n.get(`${x()}/${e}`,{headers:t})).data},e)}async function O(e){return w(async()=>{let t=await b();return(await n.post(`${x()}/${e}/archive`,{},{headers:t})).data},e)}async function k(e,t,r){return w(async()=>{let i=await b(),a={key:t,secret:r};return(await n.post(`${x()}/${e}/credentials`,a,{headers:i})).data},e)}async function A(e,t){return w(async()=>{let r=await b();return(await n.post(`${x()}/${e}/credentials/${t}/archive`,{},{headers:r})).data},e)}var j,M,N,P=e((()=>{r(),u(),m(),d(),v(),j=`managed-agents-2026-04-01`,M=3,N=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`VaultsApiError`}}}));function F({vault:e}){let t=!!e.archived_at,n=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,L.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(s,{children:[(0,L.jsx)(a,{bold:!0,children:e.vault_id}),(0,L.jsx)(a,{dimColor:!0,children:` · `}),(0,L.jsx)(a,{color:t?`warning`:`success`,children:t?`archived`:`active`})]}),(0,L.jsxs)(a,{children:[`Name: `,e.name]}),(0,L.jsxs)(a,{dimColor:!0,children:[`Created: `,n]})]})}function I(e){if(e.mode===`list`)return e.vaults.length===0?(0,L.jsx)(s,{children:(0,L.jsx)(a,{dimColor:!0,children:`No vaults found. Use /vault create <name> to create one.`})}):(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{marginBottom:1,children:(0,L.jsxs)(a,{bold:!0,children:[`Vaults (`,e.vaults.length,`)`]})}),e.vaults.map(e=>(0,L.jsx)(F,{vault:e},e.vault_id))]});if(e.mode===`detail`){let{vault:t}=e,n=!!t.archived_at,r=t.created_at?new Date(t.created_at).toLocaleString():`—`,i=t.archived_at?new Date(t.archived_at).toLocaleString():null;return(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{marginBottom:1,children:(0,L.jsxs)(a,{bold:!0,children:[`Vault: `,t.vault_id]})}),(0,L.jsxs)(a,{children:[`Name: `,t.name]}),(0,L.jsxs)(a,{children:[`Status:`,` `,(0,L.jsx)(a,{color:n?`warning`:`success`,children:n?`archived`:`active`})]}),(0,L.jsxs)(a,{dimColor:!0,children:[`Created: `,r]}),i?(0,L.jsxs)(a,{dimColor:!0,children:[`Archived: `,i]}):null]})}if(e.mode===`created`){let{vault:t}=e;return(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{children:(0,L.jsx)(a,{bold:!0,color:`success`,children:`Vault created`})}),(0,L.jsxs)(a,{children:[`ID: `,t.vault_id]}),(0,L.jsxs)(a,{children:[`Name: `,t.name]})]})}if(e.mode===`archived`){let{vault:t}=e,n=t.archived_at?new Date(t.archived_at).toLocaleString():`—`;return(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{children:(0,L.jsx)(a,{bold:!0,color:`warning`,children:`Vault archived`})}),(0,L.jsxs)(a,{children:[`ID: `,t.vault_id]}),(0,L.jsxs)(a,{dimColor:!0,children:[`Archived at: `,n]})]})}if(e.mode===`credential-list`){let{vaultId:t,credentials:n}=e;return n.length===0?(0,L.jsx)(s,{children:(0,L.jsxs)(a,{dimColor:!0,children:[`No credentials in vault `,t,`. Use /vault add-credential `,t,` <key> <value> to add one.`]})}):(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{marginBottom:1,children:(0,L.jsxs)(a,{bold:!0,children:[`Credentials in `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=!!e.archived_at;return(0,L.jsxs)(s,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(s,{children:[(0,L.jsx)(a,{bold:!0,children:e.credential_id}),(0,L.jsx)(a,{dimColor:!0,children:` · `}),e.kind?(0,L.jsx)(a,{dimColor:!0,children:e.kind}):null,t?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(a,{dimColor:!0,children:` · `}),(0,L.jsx)(a,{color:`warning`,children:`archived`})]}):null]}),(0,L.jsx)(a,{dimColor:!0,children:`Value: ***mask***`})]},e.credential_id)})]})}if(e.mode===`credential-added`){let{vaultId:t,credentialId:n}=e;return(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{children:(0,L.jsx)(a,{bold:!0,color:`success`,children:`Credential added`})}),(0,L.jsxs)(a,{children:[`ID: `,n]}),(0,L.jsxs)(a,{children:[`Vault: `,t]}),(0,L.jsx)(a,{dimColor:!0,children:`Value: ***mask***`})]})}if(e.mode===`credential-archived`){let{vaultId:t,credentialId:n}=e;return(0,L.jsxs)(s,{flexDirection:`column`,children:[(0,L.jsx)(s,{children:(0,L.jsx)(a,{bold:!0,color:`warning`,children:`Credential archived`})}),(0,L.jsxs)(a,{children:[`ID: `,n]}),(0,L.jsxs)(a,{children:[`Vault: `,t]})]})}return(0,L.jsx)(s,{children:(0,L.jsx)(a,{color:`error`,children:e.message})})}var L,R=e((()=>{i(),o(),L=c()}));function z(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`)return i?{action:`create`,name:i}:{action:`invalid`,reason:`create requires a vault name, e.g. create "My Work Vault"`};if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a vault id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a vault id`}}if(r===`archive`){if(!i)return{action:`invalid`,reason:`archive requires a vault id`};let e=i.split(/\s+/)[0];return e?{action:`archive`,id:e}:{action:`invalid`,reason:`archive requires a vault id`}}if(r===`add-credential`){let e=i.split(/\s+/);if(e.length<2||!e[0]||!e[1])return{action:`invalid`,reason:`add-credential requires vault_id, key, and value, e.g. add-credential vault_123 MY_API_KEY <value>`};let t=e[0],n=e[1],r=e.slice(2).join(` `);return r.trim()?{action:`add-credential`,vaultId:t,key:n,secret:r.trim()}:{action:`invalid`,reason:`add-credential requires a non-empty credential value`}}if(r===`archive-credential`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`archive-credential requires vault_id and credential_id, e.g. archive-credential vault_123 cred_456`}:{action:`archive-credential`,vaultId:e[0],credentialId:e[1]}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${B}`}}var B,V=e((()=>{B=`Usage: /vault list | create NAME | get ID | archive ID | add-credential VAULT_ID KEY VALUE | archive-credential VAULT_ID CRED_ID`}));async function H(e,t){if(e.action===`list`){let e=await T();return t(e.length===0?`No vaults found.`:`${e.length} vault(s).`,{display:`system`}),{mode:`list`,vaults:e}}if(e.action===`create`){let{name:n}=e,r=await E(n);return t(`Vault created: ${r.vault_id}`,{display:`system`}),{mode:`created`,vault:r}}if(e.action===`get`){let{id:n}=e,r=await D(n);return t(`Vault fetched.`,{display:`system`}),{mode:`detail`,vault:r}}if(e.action===`archive`){let{id:n}=e,r=await O(n);return t(`Vault archived.`,{display:`system`}),{mode:`archived`,vault:r}}if(e.action===`add-credential`){let{vaultId:n,key:r,secret:i}=e,a=await k(n,r,i);return t(`Credential added: ${a.credential_id}`,{display:`system`}),{mode:`credential-added`,vaultId:n,credentialId:a.credential_id}}if(e.action===`archive-credential`){let{vaultId:n,credentialId:r}=e;return await A(n,r),t(`Credential ${r} archived.`,{display:`system`}),{mode:`credential-archived`,vaultId:n,credentialId:r}}let n=await T();return t(n.length===0?`No vaults found.`:`${n.length} vault(s).`,{display:`system`}),{mode:`list`,vaults:n}}var U,W,G;e((()=>{U=t(i(),1),P(),R(),V(),g(),W=`Usage: /vault list | create NAME | get ID | archive ID | add-credential VAULT_ID KEY VALUE | archive-credential VAULT_ID CRED_ID`,G=h({commandName:`vault`,parseArgs:e=>{let t=z(e);return t.action===`invalid`?{action:`invalid`,reason:`${W}\n${t.reason}`}:t},dispatch:H,View:I,errorView:e=>U.createElement(I,{mode:`error`,message:e})})}))();export{G as callVault};
|