@seanhogg/builderforce-agents 2026.10.12 → 2026.10.13

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.
Files changed (186) hide show
  1. package/dist/{agent-DvDtjczG.js → agent-CeWx2EpQ.js} +1 -1
  2. package/dist/{agent-DiLX8OzY.js → agent-DrcnpqOF.js} +1 -1
  3. package/dist/{agents-BawpdEjP.js → agents-CRJM6qhK.js} +1 -1
  4. package/dist/{agents-COWLUJqm.js → agents-hATFRfwk.js} +1 -1
  5. package/dist/{audio-preflight-CYQiI74L.js → audio-preflight-B9CfGDD2.js} +1 -1
  6. package/dist/{audio-preflight-BN1u9Tpc.js → audio-preflight-DHHeocUj.js} +1 -1
  7. package/dist/{auth-choice-D9VN-WjA.js → auth-choice-CWbPLRN0.js} +1 -1
  8. package/dist/{auth-choice-3cdcHeim.js → auth-choice-CzhKgWJy.js} +1 -1
  9. package/dist/{auth-choice.apply-Cd0RR0Z-.js → auth-choice.apply-C0RTYtRN.js} +1 -1
  10. package/dist/{auth-choice.apply-CMDgoDNN.js → auth-choice.apply-ChrTTHkK.js} +1 -1
  11. package/dist/{auth-choice.apply-BAeGyEKW.js → auth-choice.apply-D4LYzI8l.js} +1 -1
  12. package/dist/{auth-choice.apply-CSXvPCea.js → auth-choice.apply-Dy4rVG6K.js} +1 -1
  13. package/dist/{auth-choice.apply.transformers-DkX2-OZa.js → auth-choice.apply.transformers-9v6HFzNs.js} +1 -1
  14. package/dist/{auth-choice.apply.transformers-CEVxl3ul.js → auth-choice.apply.transformers-Be8599JD.js} +1 -1
  15. package/dist/{auth-choice.apply.transformers-B2Nr9M7m.js → auth-choice.apply.transformers-CgfGlqy1.js} +1 -1
  16. package/dist/{auth-choice.apply.transformers-Dpy9gODo.js → auth-choice.apply.transformers-D9a8-sLS.js} +1 -1
  17. package/dist/{banner-C93QSUTe.js → banner-8F7-gU1V.js} +1 -1
  18. package/dist/build-info.json +3 -3
  19. package/dist/{builderforce-Dl4bZ63C.js → builderforce-CCfM1c79.js} +1 -1
  20. package/dist/{builderforce-C_tuO46t.js → builderforce-CImLd8Zo.js} +1 -1
  21. package/dist/bundled/boot-md/handler.js +1 -1
  22. package/dist/bundled/session-memory/handler.js +1 -1
  23. package/dist/{channel-options-CiYpNR-1.js → channel-options-CRng-5hZ.js} +1 -1
  24. package/dist/{channel-options-Cziy0WDc.js → channel-options-D5kOIN7b.js} +1 -1
  25. package/dist/{channel-web-Ae15MleJ.js → channel-web-B5HSpL4k.js} +1 -1
  26. package/dist/{channels-cli-CZM033Me.js → channels-cli-COl9TDHT.js} +1 -1
  27. package/dist/{channels-cli-yi1vxpvO.js → channels-cli-bR8QwOv3.js} +1 -1
  28. package/dist/chrome-ChzFLAeJ.js +4 -0
  29. package/dist/chrome-CrqJ4Ijz.js +4 -0
  30. package/dist/{cli-Bwv_-VuS.js → cli-BqJMHFNK.js} +1 -1
  31. package/dist/{cli-D8fndSEi.js → cli-DBn0qbHS.js} +1 -1
  32. package/dist/{command-registry-Cjom5ab0.js → command-registry-BqhtXJa7.js} +1 -1
  33. package/dist/{command-registry-8uEx2JjY.js → command-registry-DVH79C3B.js} +1 -1
  34. package/dist/{completion-cli-PTFpWp8Q.js → completion-cli-BFR0u1Uh.js} +1 -1
  35. package/dist/{completion-cli-LUuqgvVQ.js → completion-cli-BuUAEqQw.js} +1 -1
  36. package/dist/{completion-cli-DRsz70D2.js → completion-cli-CwaIh4zw.js} +1 -1
  37. package/dist/{completion-cli-BsXDz7T2.js → completion-cli-Da3-oE7r.js} +1 -1
  38. package/dist/{config-cli-BIx0enD5.js → config-cli-Bhrj7H1i.js} +1 -1
  39. package/dist/{config-cli-BFhOXrua.js → config-cli-DOHKZ1lO.js} +1 -1
  40. package/dist/{configure-D96xLIb6.js → configure-B-Yta1X3.js} +1 -1
  41. package/dist/{configure-S7YE6hn1.js → configure-BHVk4Ax9.js} +1 -1
  42. package/dist/{configure-dDKfCq_g.js → configure-D9YZEK_D.js} +1 -1
  43. package/dist/{configure-C7xdw9Kq.js → configure-DPE2hDzY.js} +1 -1
  44. package/dist/{deps-CGiO_NDu.js → deps-CrAVOWsA.js} +1 -1
  45. package/dist/{doctor-completion-ChhIrLd3.js → doctor-completion-CkjrUmbI.js} +1 -1
  46. package/dist/{doctor-completion-BUZwWoWB.js → doctor-completion-Dh9ah5lH.js} +1 -1
  47. package/dist/{embedded-DJYMy81Q.js → embedded-BrqzM5oT.js} +12 -12
  48. package/dist/{embedded-DjDnQMNx.js → embedded-wYxo-ADm.js} +12 -12
  49. package/dist/entry.js +1 -1
  50. package/dist/extensionAPI.js +1 -1
  51. package/dist/{gateway-cli-CN114d5j.js → gateway-cli-C2nh9UyY.js} +2 -2
  52. package/dist/{gateway-cli-Dzl70YBF.js → gateway-cli-CGkTLhet.js} +2 -2
  53. package/dist/{health-Cf1YoTRN.js → health-CEz2-7et.js} +1 -1
  54. package/dist/{health-AlkF1nUa.js → health-CFVx21sO.js} +1 -1
  55. package/dist/{health-ySVOGGNu.js → health-aKuq4xwa.js} +1 -1
  56. package/dist/{hooks-cli-6jeFEGg3.js → hooks-cli-DPSrycwI.js} +1 -1
  57. package/dist/{hooks-cli-DVPMCXUq.js → hooks-cli-uPHs7qnC.js} +1 -1
  58. package/dist/index.js +2 -2
  59. package/dist/llm-slug-generator.js +1 -1
  60. package/dist/{models-CGUxphfN.js → models--TwKHn8b.js} +1 -1
  61. package/dist/{models-CIMM_Z3u.js → models-BXJebxTU.js} +1 -1
  62. package/dist/{models-cli-Cijh2uON.js → models-cli-O1zCgeoA.js} +1 -1
  63. package/dist/{models-cli-Oys3e_I3.js → models-cli-iKu1IVeH.js} +1 -1
  64. package/dist/{onboard-DAEXNhNd.js → onboard--0I8pdee.js} +1 -1
  65. package/dist/{onboard-b2fWbf0Q.js → onboard-C40OvMZO.js} +1 -1
  66. package/dist/{onboard-channels-elaccQRE.js → onboard-channels-BbpyejX4.js} +1 -1
  67. package/dist/{onboard-channels-Bsd11scA.js → onboard-channels-CoJnsCfd.js} +1 -1
  68. package/dist/{onboard-channels-C_Q7OUow.js → onboard-channels-ZI4QC9WU.js} +1 -1
  69. package/dist/{onboard-channels-Tl1X4Pl_.js → onboard-channels-uvIeLPXK.js} +1 -1
  70. package/dist/{onboard-interactive-DyGNiYRI.js → onboard-interactive-B3Z0XLT6.js} +1 -1
  71. package/dist/{onboard-interactive-C0qmgHsH.js → onboard-interactive-CJdxqQ1b.js} +1 -1
  72. package/dist/{onboard-interactive-86s992_v.js → onboard-interactive-COnCCTTW.js} +1 -1
  73. package/dist/{onboard-interactive-CvMSTjPK.js → onboard-interactive-jss8R9r9.js} +1 -1
  74. package/dist/{onboarding-DzvbhsaR.js → onboarding-B1BmYWrs.js} +2 -2
  75. package/dist/{onboarding-B0tbaqZ7.js → onboarding-CdRbvLgp.js} +2 -2
  76. package/dist/{onboarding.finalize-D-Pi9Blv.js → onboarding.finalize-B0AjF6qZ.js} +1 -1
  77. package/dist/{onboarding.finalize-CERLBlRF.js → onboarding.finalize-WsL-ijTc.js} +1 -1
  78. package/dist/{outbound-send-deps-CzhBrVa7.js → outbound-send-deps-DuML6h7r.js} +1 -1
  79. package/dist/{plugin-registry-DtrHn5NR.js → plugin-registry-BjWNyeVY.js} +1 -1
  80. package/dist/{plugin-registry-Avx51RIY.js → plugin-registry-Cf_sv-ny.js} +1 -1
  81. package/dist/{plugin-registry-CFkQDTOt.js → plugin-registry-DdFb5usc.js} +1 -1
  82. package/dist/{plugin-registry-BEmyRfmb.js → plugin-registry-DrEpL5ac.js} +1 -1
  83. package/dist/plugin-sdk/{accounts-BwreSNAR.js → accounts-Cy3WCbWg.js} +1 -1
  84. package/dist/plugin-sdk/{active-listener-DpQ7aGYd.js → active-listener-DVWVNlT9.js} +1 -1
  85. package/dist/plugin-sdk/agent-runtime/src/agents/tool-retry.d.ts +40 -32
  86. package/dist/plugin-sdk/agent-runtime/src/builderforce/model/agent-types.d.ts +6 -0
  87. package/dist/plugin-sdk/{agent-scope-BQByW0cD.js → agent-scope-DgKN27hJ.js} +1 -1
  88. package/dist/plugin-sdk/{api-key-rotation-yqTCeKjV.js → api-key-rotation-D37jV9ZW.js} +1 -1
  89. package/dist/plugin-sdk/{audio-preflight-B6uTvVfA.js → audio-preflight-D4xyO8Zq.js} +1 -1
  90. package/dist/plugin-sdk/{auth-json-Dw6ij9Pa.js → auth-json-nASe57Uw.js} +1 -1
  91. package/dist/plugin-sdk/{bindings-CDEzl4kl.js → bindings-CH-YLOLC.js} +1 -1
  92. package/dist/plugin-sdk/{channel-web-DKbpA9xC.js → channel-web-huZSNTX3.js} +1 -1
  93. package/dist/plugin-sdk/{chrome-DriEqJRH.js → chrome-CRUzg3kA.js} +1 -1
  94. package/dist/plugin-sdk/{chunk-cW0POl22.js → chunk-C94IAOuf.js} +1 -1
  95. package/dist/plugin-sdk/{command-format-CAX9XFjI.js → command-format-B3XMq_73.js} +1 -1
  96. package/dist/plugin-sdk/{common-BxEWhN2X.js → common-n0l_XN-S.js} +1 -1
  97. package/dist/plugin-sdk/{config-3vPn_hmp.js → config--Ci8Y91R.js} +2 -2
  98. package/dist/plugin-sdk/{fetch-DH0Y8iyO.js → fetch-B-GxSYRO.js} +1 -1
  99. package/dist/plugin-sdk/index.js +1 -1
  100. package/dist/plugin-sdk/{login-Dhdx0bVL.js → login-DZliYZg8.js} +1 -1
  101. package/dist/plugin-sdk/{login-qr-DAjOuijP.js → login-qr-DKcGvAjv.js} +1 -1
  102. package/dist/plugin-sdk/{manager-i8psl2Er.js → manager-DioOqJm_.js} +1 -1
  103. package/dist/plugin-sdk/{markdown-tables-Epim9b-0.js → markdown-tables-BUfhHgfs.js} +1 -1
  104. package/dist/plugin-sdk/{message-channel-sBPQc_-T.js → message-channel-CuZ2xOAM.js} +1 -1
  105. package/dist/plugin-sdk/{model-catalog-COVRezOQ.js → model-catalog-DIQ5a-o4.js} +1 -1
  106. package/dist/plugin-sdk/{model-selection-Crz-xYNU.js → model-selection-_H_U9jWH.js} +1 -1
  107. package/dist/plugin-sdk/{outbound-CPutSvae.js → outbound-Djibdmi7.js} +1 -1
  108. package/dist/plugin-sdk/{plugins-CaUOZBVb.js → plugins-BdkC9v5E.js} +1 -1
  109. package/dist/plugin-sdk/{pw-ai-jI9AWvKe.js → pw-ai-Bbi8Us-p.js} +1 -1
  110. package/dist/plugin-sdk/{qmd-manager-BRe5fGZw.js → qmd-manager-Dxn0jCpE.js} +1 -1
  111. package/dist/plugin-sdk/{registry-DJq2Cvo9.js → registry-CZHRcH-q.js} +1 -1
  112. package/dist/plugin-sdk/{render-BUCRXPIk.js → render-CuA_WRX5.js} +1 -1
  113. package/dist/plugin-sdk/{replies-CYjI7bye.js → replies-Cf69aZLA.js} +1 -1
  114. package/dist/plugin-sdk/{reply-B5o-SSYy.js → reply-BOVC-7UD.js} +13 -13
  115. package/dist/plugin-sdk/{reply-prefix-CCymsmsP.js → reply-prefix-w7kAvH11.js} +1 -1
  116. package/dist/plugin-sdk/{resolve-route-DN1J7Wyc.js → resolve-route-0sbvl4ZN.js} +1 -1
  117. package/dist/plugin-sdk/{runner-C2pDJlRw.js → runner-DKoKK09-.js} +4 -4
  118. package/dist/plugin-sdk/{session-BnleckVX.js → session-DGLuyt10.js} +1 -1
  119. package/dist/plugin-sdk/{sqlite-BlMLqMl8.js → sqlite-JjFgDV-H.js} +1 -1
  120. package/dist/plugin-sdk/{subsystem-COTa5Ly_.js → subsystem-D0Ril4rt.js} +1 -1
  121. package/dist/plugin-sdk/{tool-images-DSpchb4x.js → tool-images-WRTP95FT.js} +1 -1
  122. package/dist/plugin-sdk/{tool-loop-detection-16p7mJ8N.js → tool-loop-detection-g8gPTCgJ.js} +1 -1
  123. package/dist/plugin-sdk/web-Cdu8TkUy.js +1 -0
  124. package/dist/plugin-sdk/{whatsapp-actions-C2B3iw8n.js → whatsapp-actions-CsSzy7G0.js} +1 -1
  125. package/dist/{plugins-DAlgx58e.js → plugins-Dr1wmnAf.js} +1 -1
  126. package/dist/{plugins-De7aK3yK.js → plugins-JhEblShx.js} +1 -1
  127. package/dist/{plugins-cli-CwdUVWjG.js → plugins-cli-DW4hoeeV.js} +1 -1
  128. package/dist/{plugins-cli-CfVCrrhx.js → plugins-cli-GewV3E8e.js} +1 -1
  129. package/dist/{program-CFL6mW3l.js → program-bggmBKuL.js} +2 -2
  130. package/dist/{program-context-DP4Xq9zC.js → program-context-BCTE8zEF.js} +1 -1
  131. package/dist/{prompt-select-styled-NxrGT7OR.js → prompt-select-styled-BtjhlTEH.js} +1 -1
  132. package/dist/{prompt-select-styled-Csz9HlSx.js → prompt-select-styled-CaNl41mG.js} +1 -1
  133. package/dist/{provider-auth-helpers-BMBw21Tn.js → provider-auth-helpers-CWUfg9zf.js} +1 -1
  134. package/dist/{provider-auth-helpers-VWPvSXPH.js → provider-auth-helpers-y1X8xKVE.js} +1 -1
  135. package/dist/{provider-dispatcher-CSOHd9zJ.js → provider-dispatcher-CRsPmKhJ.js} +1 -1
  136. package/dist/{provider-dispatcher-Bg9orQPy.js → provider-dispatcher-D9GbE_Ce.js} +1 -1
  137. package/dist/{push-apns-rMu8MKXi.js → push-apns-Cb1sQEEa.js} +1 -1
  138. package/dist/{push-apns-ep5WkyGz.js → push-apns-Cr-6aD3y.js} +1 -1
  139. package/dist/{pw-ai-UXo3gDGy.js → pw-ai-CG-kY5NP.js} +1 -1
  140. package/dist/{pw-ai-CIN6tj0G.js → pw-ai-DcZPg2vm.js} +1 -1
  141. package/dist/{register.agent-BynXVz7v.js → register.agent-B33EZBoL.js} +1 -1
  142. package/dist/{register.agent-RNVNKBP3.js → register.agent-DfYqZls1.js} +1 -1
  143. package/dist/{register.configure-BdqREs1-.js → register.configure-CREcJhKA.js} +1 -1
  144. package/dist/{register.configure-DDrvpBnA.js → register.configure-D8an7wc5.js} +1 -1
  145. package/dist/{register.maintenance-DT6t7mD_.js → register.maintenance-D84M5XLR.js} +1 -1
  146. package/dist/{register.maintenance-BSKHOCTV.js → register.maintenance-Dnp_Ii2x.js} +1 -1
  147. package/dist/{register.message-7KIfSUxS.js → register.message-B6E0uAEu.js} +1 -1
  148. package/dist/{register.message-DDhEvcaX.js → register.message-WOWC4tyf.js} +1 -1
  149. package/dist/{register.onboard-CKhooa7L.js → register.onboard-AgVEhehS.js} +1 -1
  150. package/dist/{register.onboard-CswvuzLx.js → register.onboard-Cwozk0Tx.js} +1 -1
  151. package/dist/{register.setup-1BmR-qlh.js → register.setup-BKyCvo9_.js} +1 -1
  152. package/dist/{register.setup-CivwfXf_.js → register.setup-C9IeGiAd.js} +1 -1
  153. package/dist/{register.status-health-sessions-CLdHZiJm.js → register.status-health-sessions-CYZctjpx.js} +1 -1
  154. package/dist/{register.status-health-sessions-BXpljfv3.js → register.status-health-sessions-CcL6srRC.js} +1 -1
  155. package/dist/{register.subclis-D_fHb-Aj.js → register.subclis-AFsfDByV.js} +1 -1
  156. package/dist/{register.subclis-CTTxdHaJ.js → register.subclis-C0DxtuRO.js} +1 -1
  157. package/dist/{reply-D9wUWhMx.js → reply-BuUSdq2L.js} +9 -9
  158. package/dist/{run-main-DNyQhVQT.js → run-main-CgJMiKPV.js} +1 -1
  159. package/dist/{runner-BNnckkaT.js → runner-C8oNv-9y.js} +3 -3
  160. package/dist/{runner-EHybuAt7.js → runner-nDoIXX7n.js} +3 -3
  161. package/dist/{server-node-events-BGrnw4ZT.js → server-node-events-BMsKmU5S.js} +1 -1
  162. package/dist/{server-node-events-D4WVcVHy.js → server-node-events-fS8TluXq.js} +1 -1
  163. package/dist/{session-dirs-eNN7E3kA.js → session-dirs-Bkfs-7vN.js} +1 -1
  164. package/dist/{session-dirs-C-pVBwSV.js → session-dirs-rYDCA_mQ.js} +1 -1
  165. package/dist/{status-Demw1HZ7.js → status-Ad1eFPKR.js} +1 -1
  166. package/dist/{status-CBieo24v.js → status-BMzVz5KY.js} +1 -1
  167. package/dist/{status-rkFgCaBM.js → status-CXRyaGws.js} +1 -1
  168. package/dist/{status-wTMmjZ7M.js → status-DpEUFAMk.js} +1 -1
  169. package/dist/{status-BhJw9Htq.js → status-oaiZkYBt.js} +1 -1
  170. package/dist/{subagent-registry-Bje3RAgk.js → subagent-registry-gVTWLPpL.js} +1 -1
  171. package/dist/{subagent-registry-B0kpBIxD.js → subagent-registry-hM0OCDzv.js} +1 -1
  172. package/dist/{subagent-registry-Cj5yC7B4.js → subagent-registry-m_x-JRkR.js} +9 -9
  173. package/dist/{tui-BCtecmPL.js → tui-HTtOgZ_X.js} +2 -2
  174. package/dist/{tui-BqHLI73U.js → tui-LemSel3H.js} +2 -2
  175. package/dist/{tui-cli-2R0xjpqW.js → tui-cli-BpzicV5H.js} +1 -1
  176. package/dist/{tui-cli-Dvd8BwzD.js → tui-cli-CruoIP1K.js} +1 -1
  177. package/dist/{update-cli-DUObGvw1.js → update-cli-Wa-nZ_Lq.js} +1 -1
  178. package/dist/{update-cli-Bt7Vfi7c.js → update-cli-zv67YxK1.js} +1 -1
  179. package/dist/{web--KblE8ax.js → web-BrsbhB1i.js} +1 -1
  180. package/dist/{web-C-yTnRvS.js → web-BzkO4Pbe.js} +1 -1
  181. package/dist/{web-0VRcRcFj.js → web-D_QYY7Gt.js} +1 -1
  182. package/dist/{web-BcUIWAAJ.js → web-jPbmSTQm.js} +1 -1
  183. package/package.json +1 -1
  184. package/dist/chrome-CmCESKt9.js +0 -4
  185. package/dist/chrome-D6qk0wxW.js +0 -4
  186. package/dist/plugin-sdk/web-CzJYJZZs.js +0 -1
@@ -1,4 +1,4 @@
1
- import{O as info,R as isRich,c as escapeRegExp,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime,t as createSubsystemLogger}from"./subsystem-C4b1Von0.js";import{t as isTruthyEnvValue}from"./env-BoE8QSib.js";import{_ as toAgentStoreSessionKey,d as normalizeAgentId,p as resolveAgentIdFromSessionKey}from"./session-key-CksCYipj.js";import{A as resolveWorkspaceFilePath,c as resolveAgentWorkspaceDir,g as DEFAULT_HEARTBEAT_FILENAME,l as resolveDefaultAgentId,r as resolveAgentConfig}from"./agent-scope-CufEmNj_.js";import{r as loadConfig,y as parseDurationMs}from"./io-CsCa3_1Z.js";import{n as callGateway,t as buildGatewayConnectionDetails}from"./call-O-iC_P5t.js";import{Cr as resolveUserTimezone,G as appendCronStyleCurrentTimeLine,U as getReplyFromConfig,Xr as getQueueSize,an as setHeartbeatWakeHandler,ci as isHeartbeatContentEffectivelyEmpty,in as requestHeartbeatNow,it as resolveHeartbeatSenderContext,li as resolveHeartbeatPrompt$1,oi as DEFAULT_HEARTBEAT_ACK_MAX_CHARS,rt as resolveHeartbeatDeliveryTarget,si as DEFAULT_HEARTBEAT_EVERY,ti as CommandLane,ui as stripHeartbeatToken,zn as peekSystemEventEntries}from"./subagent-registry-Cj5yC7B4.js";import{A as canonicalizeMainSessionAlias,a as loadSessionStore,c as saveSessionStore,j as resolveAgentMainSessionKey,u as updateSessionStore}from"./sessions-CmJXMlLP.js";import{t as HEARTBEAT_TOKEN}from"./tokens-CFKkpUIu.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-1Mn6RiNf.js";import{a as resolvePreferredAccountId,t as buildChannelAccountBindings}from"./bindings-CKSDlQ1i.js";import{t as deliverOutboundPayloads}from"./deliver--eLCRJc2.js";import{n as formatErrorMessage}from"./errors-tAt19c1E.js";import{c as resolveStorePath,n as resolveSessionFilePath}from"./paths-ClsbsPQP.js";import{o as resolveEffectiveMessagesConfig}from"./reply-prefix-Cg7AqaK0.js";import{n as formatTimeAgo}from"./format-relative-CruqE52s.js";import{t as formatDurationCompact}from"./format-duration-HN2dpHE0.js";import{n as withProgress}from"./progress-Cqb-jAjT.js";import{a as resolveIndicatorType,n as emitHeartbeatEvent,o as resolveHeartbeatReplyPayload,t as resolveHeartbeatVisibility}from"./heartbeat-visibility-XUrlH-iZ.js";import{t as resolveChannelDefaultAccountId}from"./helpers-DPPVplyk.js";import path from"node:path";import fs from"node:fs/promises";const ACTIVE_HOURS_TIME_PATTERN=/^([01]\d|2[0-3]|24):([0-5]\d)$/;function resolveActiveHoursTimezone(cfg,raw){let trimmed=raw?.trim();if(!trimmed||trimmed===`user`)return resolveUserTimezone(cfg.agents?.defaults?.userTimezone);if(trimmed===`local`)return Intl.DateTimeFormat().resolvedOptions().timeZone?.trim()||`UTC`;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:trimmed}).format(new Date),trimmed}catch{return resolveUserTimezone(cfg.agents?.defaults?.userTimezone)}}function parseActiveHoursTime(opts,raw){if(!raw||!ACTIVE_HOURS_TIME_PATTERN.test(raw))return null;let[hourStr,minuteStr]=raw.split(`:`),hour=Number(hourStr),minute=Number(minuteStr);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour===24?!opts.allow24||minute!==0?null:1440:hour*60+minute}function resolveMinutesInTimeZone(nowMs,timeZone){try{let parts=new Intl.DateTimeFormat(`en-US`,{timeZone,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).formatToParts(new Date(nowMs)),map={};for(let part of parts)part.type!==`literal`&&(map[part.type]=part.value);let hour=Number(map.hour),minute=Number(map.minute);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour*60+minute}catch{return null}}function isWithinActiveHours(cfg,heartbeat,nowMs){let active=heartbeat?.activeHours;if(!active)return!0;let startMin=parseActiveHoursTime({allow24:!1},active.start),endMin=parseActiveHoursTime({allow24:!0},active.end);if(startMin===null||endMin===null||startMin===endMin)return!0;let timeZone=resolveActiveHoursTimezone(cfg,active.timezone),currentMin=resolveMinutesInTimeZone(nowMs??Date.now(),timeZone);return currentMin===null?!0:endMin>startMin?currentMin>=startMin&&currentMin<endMin:currentMin>=startMin||currentMin<endMin}function buildCronEventPrompt(pendingEvents){let eventText=pendingEvents.join(`
1
+ import{O as info,R as isRich,c as escapeRegExp,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime,t as createSubsystemLogger}from"./subsystem-C4b1Von0.js";import{t as isTruthyEnvValue}from"./env-BoE8QSib.js";import{_ as toAgentStoreSessionKey,d as normalizeAgentId,p as resolveAgentIdFromSessionKey}from"./session-key-CksCYipj.js";import{A as resolveWorkspaceFilePath,c as resolveAgentWorkspaceDir,g as DEFAULT_HEARTBEAT_FILENAME,l as resolveDefaultAgentId,r as resolveAgentConfig}from"./agent-scope-CufEmNj_.js";import{r as loadConfig,y as parseDurationMs}from"./io-CsCa3_1Z.js";import{n as callGateway,t as buildGatewayConnectionDetails}from"./call-O-iC_P5t.js";import{Cr as resolveUserTimezone,G as appendCronStyleCurrentTimeLine,U as getReplyFromConfig,Xr as getQueueSize,an as setHeartbeatWakeHandler,ci as isHeartbeatContentEffectivelyEmpty,in as requestHeartbeatNow,it as resolveHeartbeatSenderContext,li as resolveHeartbeatPrompt$1,oi as DEFAULT_HEARTBEAT_ACK_MAX_CHARS,rt as resolveHeartbeatDeliveryTarget,si as DEFAULT_HEARTBEAT_EVERY,ti as CommandLane,ui as stripHeartbeatToken,zn as peekSystemEventEntries}from"./subagent-registry-m_x-JRkR.js";import{A as canonicalizeMainSessionAlias,a as loadSessionStore,c as saveSessionStore,j as resolveAgentMainSessionKey,u as updateSessionStore}from"./sessions-CmJXMlLP.js";import{t as HEARTBEAT_TOKEN}from"./tokens-CFKkpUIu.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-1Mn6RiNf.js";import{a as resolvePreferredAccountId,t as buildChannelAccountBindings}from"./bindings-CKSDlQ1i.js";import{t as deliverOutboundPayloads}from"./deliver--eLCRJc2.js";import{n as formatErrorMessage}from"./errors-tAt19c1E.js";import{c as resolveStorePath,n as resolveSessionFilePath}from"./paths-ClsbsPQP.js";import{o as resolveEffectiveMessagesConfig}from"./reply-prefix-Cg7AqaK0.js";import{n as formatTimeAgo}from"./format-relative-CruqE52s.js";import{t as formatDurationCompact}from"./format-duration-HN2dpHE0.js";import{n as withProgress}from"./progress-Cqb-jAjT.js";import{a as resolveIndicatorType,n as emitHeartbeatEvent,o as resolveHeartbeatReplyPayload,t as resolveHeartbeatVisibility}from"./heartbeat-visibility-XUrlH-iZ.js";import{t as resolveChannelDefaultAccountId}from"./helpers-DPPVplyk.js";import path from"node:path";import fs from"node:fs/promises";const ACTIVE_HOURS_TIME_PATTERN=/^([01]\d|2[0-3]|24):([0-5]\d)$/;function resolveActiveHoursTimezone(cfg,raw){let trimmed=raw?.trim();if(!trimmed||trimmed===`user`)return resolveUserTimezone(cfg.agents?.defaults?.userTimezone);if(trimmed===`local`)return Intl.DateTimeFormat().resolvedOptions().timeZone?.trim()||`UTC`;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:trimmed}).format(new Date),trimmed}catch{return resolveUserTimezone(cfg.agents?.defaults?.userTimezone)}}function parseActiveHoursTime(opts,raw){if(!raw||!ACTIVE_HOURS_TIME_PATTERN.test(raw))return null;let[hourStr,minuteStr]=raw.split(`:`),hour=Number(hourStr),minute=Number(minuteStr);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour===24?!opts.allow24||minute!==0?null:1440:hour*60+minute}function resolveMinutesInTimeZone(nowMs,timeZone){try{let parts=new Intl.DateTimeFormat(`en-US`,{timeZone,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).formatToParts(new Date(nowMs)),map={};for(let part of parts)part.type!==`literal`&&(map[part.type]=part.value);let hour=Number(map.hour),minute=Number(map.minute);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour*60+minute}catch{return null}}function isWithinActiveHours(cfg,heartbeat,nowMs){let active=heartbeat?.activeHours;if(!active)return!0;let startMin=parseActiveHoursTime({allow24:!1},active.start),endMin=parseActiveHoursTime({allow24:!0},active.end);if(startMin===null||endMin===null||startMin===endMin)return!0;let timeZone=resolveActiveHoursTimezone(cfg,active.timezone),currentMin=resolveMinutesInTimeZone(nowMs??Date.now(),timeZone);return currentMin===null?!0:endMin>startMin?currentMin>=startMin&&currentMin<endMin:currentMin>=startMin||currentMin<endMin}function buildCronEventPrompt(pendingEvents){let eventText=pendingEvents.join(`
2
2
  `).trim();return eventText?`A scheduled reminder has been triggered. The reminder content is:
3
3
 
4
4
  `+eventText+`
@@ -1,4 +1,4 @@
1
- import{B as theme,k as info,l as escapeRegExp,z as isRich}from"./utils-DbaBVFaK.js";import{$r as isHeartbeatContentEffectivelyEmpty,H as resolveHeartbeatSenderContext,Hr as getQueueSize,Ot as requestHeartbeatNow,Qr as DEFAULT_HEARTBEAT_EVERY,V as resolveHeartbeatDeliveryTarget,Zr as DEFAULT_HEARTBEAT_ACK_MAX_CHARS,ei as resolveHeartbeatPrompt$1,kt as setHeartbeatWakeHandler,pi as peekSystemEventEntries,qr as CommandLane,r as appendCronStyleCurrentTimeLine,t as getReplyFromConfig,ti as stripHeartbeatToken,ur as resolveUserTimezone}from"./reply-D9wUWhMx.js";import{_ as toAgentStoreSessionKey,d as normalizeAgentId,p as resolveAgentIdFromSessionKey}from"./session-key-EoB0qaG9.js";import{i as defaultRuntime,t as createSubsystemLogger}from"./subsystem-B3TqcCrZ.js";import{A as resolveWorkspaceFilePath,c as resolveAgentWorkspaceDir,g as DEFAULT_HEARTBEAT_FILENAME,l as resolveDefaultAgentId,r as resolveAgentConfig}from"./agent-scope-DPtjOxzp.js";import{t as isTruthyEnvValue}from"./env-BIdU5BAp.js";import{r as loadConfig,y as parseDurationMs}from"./io-BNtgT4VB.js";import{n as formatErrorMessage}from"./errors-B1MIg3g-.js";import{L as canonicalizeMainSessionAlias,R as resolveAgentMainSessionKey,a as loadSessionStore,c as saveSessionStore,u as updateSessionStore}from"./sessions-BPr0-lkT.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-D5zP6ENo.js";import{a as resolvePreferredAccountId,t as buildChannelAccountBindings}from"./bindings-DR59065T.js";import{c as resolveStorePath,n as resolveSessionFilePath}from"./paths-DJ6rztqJ.js";import{t as HEARTBEAT_TOKEN}from"./tokens-CCU3zO-D.js";import{t as deliverOutboundPayloads}from"./deliver-BiGCWHvZ.js";import{o as resolveEffectiveMessagesConfig}from"./reply-prefix-zIMgi6K6.js";import{n as callGateway,t as buildGatewayConnectionDetails}from"./call-CJq3iGqu.js";import{n as formatTimeAgo}from"./format-relative-niF9gXss.js";import{n as withProgress}from"./progress-BfOtdN6b.js";import{t as formatDurationCompact}from"./format-duration-HN2dpHE0.js";import{a as resolveIndicatorType,n as emitHeartbeatEvent,o as resolveHeartbeatReplyPayload,t as resolveHeartbeatVisibility}from"./heartbeat-visibility-D0RvrstE.js";import{t as resolveChannelDefaultAccountId}from"./helpers-DTDCy17p.js";import path from"node:path";import fs from"node:fs/promises";const ACTIVE_HOURS_TIME_PATTERN=/^([01]\d|2[0-3]|24):([0-5]\d)$/;function resolveActiveHoursTimezone(cfg,raw){let trimmed=raw?.trim();if(!trimmed||trimmed===`user`)return resolveUserTimezone(cfg.agents?.defaults?.userTimezone);if(trimmed===`local`)return Intl.DateTimeFormat().resolvedOptions().timeZone?.trim()||`UTC`;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:trimmed}).format(new Date),trimmed}catch{return resolveUserTimezone(cfg.agents?.defaults?.userTimezone)}}function parseActiveHoursTime(opts,raw){if(!raw||!ACTIVE_HOURS_TIME_PATTERN.test(raw))return null;let[hourStr,minuteStr]=raw.split(`:`),hour=Number(hourStr),minute=Number(minuteStr);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour===24?!opts.allow24||minute!==0?null:1440:hour*60+minute}function resolveMinutesInTimeZone(nowMs,timeZone){try{let parts=new Intl.DateTimeFormat(`en-US`,{timeZone,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).formatToParts(new Date(nowMs)),map={};for(let part of parts)part.type!==`literal`&&(map[part.type]=part.value);let hour=Number(map.hour),minute=Number(map.minute);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour*60+minute}catch{return null}}function isWithinActiveHours(cfg,heartbeat,nowMs){let active=heartbeat?.activeHours;if(!active)return!0;let startMin=parseActiveHoursTime({allow24:!1},active.start),endMin=parseActiveHoursTime({allow24:!0},active.end);if(startMin===null||endMin===null||startMin===endMin)return!0;let timeZone=resolveActiveHoursTimezone(cfg,active.timezone),currentMin=resolveMinutesInTimeZone(nowMs??Date.now(),timeZone);return currentMin===null?!0:endMin>startMin?currentMin>=startMin&&currentMin<endMin:currentMin>=startMin||currentMin<endMin}function buildCronEventPrompt(pendingEvents){let eventText=pendingEvents.join(`
1
+ import{B as theme,k as info,l as escapeRegExp,z as isRich}from"./utils-DbaBVFaK.js";import{$r as isHeartbeatContentEffectivelyEmpty,H as resolveHeartbeatSenderContext,Hr as getQueueSize,Ot as requestHeartbeatNow,Qr as DEFAULT_HEARTBEAT_EVERY,V as resolveHeartbeatDeliveryTarget,Zr as DEFAULT_HEARTBEAT_ACK_MAX_CHARS,ei as resolveHeartbeatPrompt$1,kt as setHeartbeatWakeHandler,pi as peekSystemEventEntries,qr as CommandLane,r as appendCronStyleCurrentTimeLine,t as getReplyFromConfig,ti as stripHeartbeatToken,ur as resolveUserTimezone}from"./reply-BuUSdq2L.js";import{_ as toAgentStoreSessionKey,d as normalizeAgentId,p as resolveAgentIdFromSessionKey}from"./session-key-EoB0qaG9.js";import{i as defaultRuntime,t as createSubsystemLogger}from"./subsystem-B3TqcCrZ.js";import{A as resolveWorkspaceFilePath,c as resolveAgentWorkspaceDir,g as DEFAULT_HEARTBEAT_FILENAME,l as resolveDefaultAgentId,r as resolveAgentConfig}from"./agent-scope-DPtjOxzp.js";import{t as isTruthyEnvValue}from"./env-BIdU5BAp.js";import{r as loadConfig,y as parseDurationMs}from"./io-BNtgT4VB.js";import{n as formatErrorMessage}from"./errors-B1MIg3g-.js";import{L as canonicalizeMainSessionAlias,R as resolveAgentMainSessionKey,a as loadSessionStore,c as saveSessionStore,u as updateSessionStore}from"./sessions-BPr0-lkT.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-D5zP6ENo.js";import{a as resolvePreferredAccountId,t as buildChannelAccountBindings}from"./bindings-DR59065T.js";import{c as resolveStorePath,n as resolveSessionFilePath}from"./paths-DJ6rztqJ.js";import{t as HEARTBEAT_TOKEN}from"./tokens-CCU3zO-D.js";import{t as deliverOutboundPayloads}from"./deliver-BiGCWHvZ.js";import{o as resolveEffectiveMessagesConfig}from"./reply-prefix-zIMgi6K6.js";import{n as callGateway,t as buildGatewayConnectionDetails}from"./call-CJq3iGqu.js";import{n as formatTimeAgo}from"./format-relative-niF9gXss.js";import{n as withProgress}from"./progress-BfOtdN6b.js";import{t as formatDurationCompact}from"./format-duration-HN2dpHE0.js";import{a as resolveIndicatorType,n as emitHeartbeatEvent,o as resolveHeartbeatReplyPayload,t as resolveHeartbeatVisibility}from"./heartbeat-visibility-D0RvrstE.js";import{t as resolveChannelDefaultAccountId}from"./helpers-DTDCy17p.js";import path from"node:path";import fs from"node:fs/promises";const ACTIVE_HOURS_TIME_PATTERN=/^([01]\d|2[0-3]|24):([0-5]\d)$/;function resolveActiveHoursTimezone(cfg,raw){let trimmed=raw?.trim();if(!trimmed||trimmed===`user`)return resolveUserTimezone(cfg.agents?.defaults?.userTimezone);if(trimmed===`local`)return Intl.DateTimeFormat().resolvedOptions().timeZone?.trim()||`UTC`;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:trimmed}).format(new Date),trimmed}catch{return resolveUserTimezone(cfg.agents?.defaults?.userTimezone)}}function parseActiveHoursTime(opts,raw){if(!raw||!ACTIVE_HOURS_TIME_PATTERN.test(raw))return null;let[hourStr,minuteStr]=raw.split(`:`),hour=Number(hourStr),minute=Number(minuteStr);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour===24?!opts.allow24||minute!==0?null:1440:hour*60+minute}function resolveMinutesInTimeZone(nowMs,timeZone){try{let parts=new Intl.DateTimeFormat(`en-US`,{timeZone,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).formatToParts(new Date(nowMs)),map={};for(let part of parts)part.type!==`literal`&&(map[part.type]=part.value);let hour=Number(map.hour),minute=Number(map.minute);return!Number.isFinite(hour)||!Number.isFinite(minute)?null:hour*60+minute}catch{return null}}function isWithinActiveHours(cfg,heartbeat,nowMs){let active=heartbeat?.activeHours;if(!active)return!0;let startMin=parseActiveHoursTime({allow24:!1},active.start),endMin=parseActiveHoursTime({allow24:!0},active.end);if(startMin===null||endMin===null||startMin===endMin)return!0;let timeZone=resolveActiveHoursTimezone(cfg,active.timezone),currentMin=resolveMinutesInTimeZone(nowMs??Date.now(),timeZone);return currentMin===null?!0:endMin>startMin?currentMin>=startMin&&currentMin<endMin:currentMin>=startMin||currentMin<endMin}function buildCronEventPrompt(pendingEvents){let eventText=pendingEvents.join(`
2
2
  `).trim();return eventText?`A scheduled reminder has been triggered. The reminder content is:
3
3
 
4
4
  `+eventText+`
@@ -1 +1 @@
1
- import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-Cj5yC7B4.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import"./helpers-DPPVplyk.js";import{r as healthCommand}from"./health-Cf1YoTRN.js";export{healthCommand};
1
+ import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-m_x-JRkR.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import"./helpers-DPPVplyk.js";import{r as healthCommand}from"./health-CEz2-7et.js";export{healthCommand};
@@ -1,4 +1,4 @@
1
- import"./paths-5FcIFMsj.js";import{B as theme,C as shortenHomePath,b as resolveUserPath,t as CONFIG_DIR}from"./utils-DbaBVFaK.js";import"./embedded-helpers-2fP2Yq8h.js";import"./reply-D9wUWhMx.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import{i as defaultRuntime}from"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import"./exec-DdcIjeyn.js";import{c as resolveAgentWorkspaceDir,l as resolveDefaultAgentId}from"./agent-scope-DPtjOxzp.js";import"./src-CA0fU67C.js";import"./model-selection-Doyvd4lU.js";import{t as formatCliCommand}from"./command-format-D806O2pt.js";import"./env-file-D1MDi-AM.js";import"./boolean-Cnh1KNl1.js";import"./env-BIdU5BAp.js";import"./src-BifagO7i.js";import{c as writeConfigFile,r as loadConfig}from"./io-BNtgT4VB.js";import"./manifest-registry-BJCfNV1a.js";import{n as MANIFEST_KEY,t as LEGACY_MANIFEST_KEYS}from"./legacy-names-BXbHg7Rs.js";import"./config-BD801bpx.js";import"./runner-C3k1sKdu.js";import"./model-catalog-BoiWqBTw.js";import"./sandbox-1jtP0nhr.js";import"./chrome-Bfprrnm1.js";import"./tailscale-DLkpGquM.js";import"./auth-lebUHrkd.js";import"./server-context-DKdrUePN.js";import"./frontmatter-3D1EdC1L.js";import"./skills-Ba4ftrB-.js";import"./plugin-skills-B11rggZh.js";import"./routes-CRrqIFJR.js";import"./redact-BHdfp2MZ.js";import"./errors-B1MIg3g-.js";import"./paths-cR8ct-Y3.js";import"./ssrf-p9k-iapc.js";import"./image-ops-C8IUQKjn.js";import"./store-CmHBQ-yX.js";import"./ports-DgmEDNOm.js";import"./trash-DD2Hc5oq.js";import"./sessions-BPr0-lkT.js";import"./message-channel-D_jXxXQj.js";import"./plugins-D5zP6ENo.js";import"./accounts-o35LU_iy.js";import"./accounts-rmXEiebi.js";import"./accounts-BLueHgKj.js";import"./bindings-DR59065T.js";import"./send-l9WWK31e.js";import"./send-CVgJk5kN.js";import"./paths-DJ6rztqJ.js";import"./tool-images-B7b_OiMz.js";import"./tool-display-ByOZtWvA.js";import"./fetch-guard-8mwt3-hm.js";import"./api-key-rotation-Yn3MpU4F.js";import"./fetch-BuOLY9KP.js";import"./sqlite-C39E12XS.js";import"./tokens-CCU3zO-D.js";import"./project-context-store-Dbbjk8CQ.js";import"./with-timeout-CPd4-suw.js";import"./deliver-BiGCWHvZ.js";import"./send-CRSlal5z.js";import{n as loadWorkspaceHookEntries,o as parseFrontmatter}from"./workspace-D4LK4thI.js";import"./reply-prefix-zIMgi6K6.js";import"./memory-cli-D-Khe5Ij.js";import"./manager-DNIg84rj.js";import"./retry-DlVhg5qu.js";import"./client-xfoidwPI.js";import"./call-CJq3iGqu.js";import"./common-BTbIhLyt.js";import"./chunk-FCBlVOyo.js";import"./markdown-tables-P6uoUSFa.js";import"./ir-5BNoIXZm.js";import"./render-D1dVTEB1.js";import"./builderforcellm-syscheck-Cp4LMft_.js";import"./send-D_6wd5Y3.js";import"./outbound-attachment-C7wByQO5.js";import"./fetch-DnVtDecb.js";import"./delivery-queue-CXKynF1P.js";import"./channel-activity-CCNDbdD3.js";import"./tables-ERcoWFDp.js";import"./pairing-store-C8gtsUDG.js";import{t as formatDocsLink}from"./links-BgWWaaOT.js";import"./cli-utils-LBYKdNFb.js";import"./help-format-Qfk2vDNX.js";import"./progress-BfOtdN6b.js";import"./resolve-route-D49haUnv.js";import"./replies-DAwcEPGb.js";import"./refresh-TiC_kLgE.js";import"./coding-tools.policy-COe2xa9K.js";import"./send-BIMaIwQV.js";import"./onboard-helpers-BmYUjl4j.js";import"./prompt-style-BpVK43GK.js";import"./pairing-labels-CD0lPAfY.js";import"./session-cost-usage-BjH7mxVj.js";import"./usage-format-DGf8ZWPH.js";import"./provider-usage-QGVVADJa.js";import"./active-listener-Dcg19lJG.js";import"./exec-approvals-BpVPDVtV.js";import"./nodes-screen-C3TDIi8d.js";import"./project-context-BLpMH93w.js";import"./control-service-DKBAemtq.js";import"./stagger-8EkqkqJv.js";import"./channel-selection-DyAvzlY8.js";import"./mamba-state-engine-BQuRdgMU.js";import"./transformers-stream-D7nRu4Qu.js";import{a as extractArchive,c as resolveArchiveKind,i as unscopedPackageName,l as resolvePackedRootDir,o as fileExists,s as readJsonFile,t as resolveSafeInstallDir}from"./install-safe-path-DsLq2BUJ.js";import{a as installPackageDir,i as withTempDir,n as packNpmSpecToArchive,r as resolveArchiveSourcePath,t as validateRegistryNpmSpec}from"./npm-registry-spec-DIW6RsGN.js";import{t as renderTable}from"./table-BoCHYKoQ.js";import{t as buildWorkspaceHookStatus}from"./hooks-status-nC054v5L.js";import{t as buildPluginStatusReport}from"./status-Demw1HZ7.js";import fs from"node:fs";import path from"node:path";import fs$1 from"node:fs/promises";const defaultLogger={};function validateHookId(hookId){return hookId?hookId===`.`||hookId===`..`?`invalid hook name: reserved path segment`:hookId.includes(`/`)||hookId.includes(`\\`)?`invalid hook name: path separators not allowed`:null:`invalid hook name: missing`}function resolveHookInstallDir(hookId,hooksDir){let hooksBase=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`),hookIdError=validateHookId(hookId);if(hookIdError)throw Error(hookIdError);let targetDirResult=resolveSafeInstallDir({baseDir:hooksBase,id:hookId,invalidNameMessage:`invalid hook name: path traversal detected`});if(!targetDirResult.ok)throw Error(targetDirResult.error);return targetDirResult.path}async function ensureBuilderForceAgentsHooks(manifest){let hooks=(manifest[MANIFEST_KEY]??LEGACY_MANIFEST_KEYS.map(k=>manifest[k]).find(Boolean))?.hooks;if(!Array.isArray(hooks))throw Error(`package.json missing builderforce.hooks`);let list=hooks.map(e=>typeof e==`string`?e.trim():``).filter(Boolean);if(list.length===0)throw Error(`package.json builderforce.hooks is empty`);return list}function resolveHookInstallModeOptions(params){return{logger:params.logger??defaultLogger,mode:params.mode??`install`,dryRun:params.dryRun??!1}}function resolveTimedHookInstallModeOptions(params){return{...resolveHookInstallModeOptions(params),timeoutMs:params.timeoutMs??12e4}}async function resolveInstallTargetDir(id,hooksDir){let baseHooksDir=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`);await fs$1.mkdir(baseHooksDir,{recursive:!0});let targetDirResult=resolveSafeInstallDir({baseDir:baseHooksDir,id,invalidNameMessage:`invalid hook name: path traversal detected`});return targetDirResult.ok?{ok:!0,targetDir:targetDirResult.path}:{ok:!1,error:targetDirResult.error}}async function resolveHookNameFromDir(hookDir){let hookMdPath=path.join(hookDir,`HOOK.md`);if(!await fileExists(hookMdPath))throw Error(`HOOK.md missing in ${hookDir}`);return parseFrontmatter(await fs$1.readFile(hookMdPath,`utf-8`)).name||path.basename(hookDir)}async function validateHookDir(hookDir){if(!await fileExists(path.join(hookDir,`HOOK.md`)))throw Error(`HOOK.md missing in ${hookDir}`);if(!await Promise.all([`handler.ts`,`handler.js`,`index.ts`,`index.js`].map(async candidate=>fileExists(path.join(hookDir,candidate)))).then(results=>results.some(Boolean)))throw Error(`handler.ts/handler.js/index.ts/index.js missing in ${hookDir}`)}async function installHookPackageFromDir(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),manifestPath=path.join(params.packageDir,`package.json`);if(!await fileExists(manifestPath))return{ok:!1,error:`package.json missing`};let manifest;try{manifest=await readJsonFile(manifestPath)}catch(err){return{ok:!1,error:`invalid package.json: ${String(err)}`}}let hookEntries;try{hookEntries=await ensureBuilderForceAgentsHooks(manifest)}catch(err){return{ok:!1,error:String(err)}}let pkgName=typeof manifest.name==`string`?manifest.name:``,hookPackId=pkgName?unscopedPackageName(pkgName):path.basename(params.packageDir),hookIdError=validateHookId(hookPackId);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookPackId)return{ok:!1,error:`hook pack id mismatch: expected ${params.expectedHookPackId}, got ${hookPackId}`};let targetDirResult=await resolveInstallTargetDir(hookPackId,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook pack already exists: ${targetDir} (delete it first)`};let resolvedHooks=[];for(let entry of hookEntries){let hookDir=path.resolve(params.packageDir,entry);await validateHookDir(hookDir);let hookName=await resolveHookNameFromDir(hookDir);resolvedHooks.push(hookName)}if(dryRun)return{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0};let deps=manifest.dependencies??{},hasDeps=Object.keys(deps).length>0,installRes=await installPackageDir({sourceDir:params.packageDir,targetDir,mode,timeoutMs,logger,copyErrorPrefix:`failed to copy hook pack`,hasDeps,depsLogMessage:`Installing hook pack dependencies…`});return installRes.ok?{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0}:installRes}async function installHookFromDir(params){let{logger,mode,dryRun}=resolveHookInstallModeOptions(params);await validateHookDir(params.hookDir);let hookName=await resolveHookNameFromDir(params.hookDir),hookIdError=validateHookId(hookName);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookName)return{ok:!1,error:`hook id mismatch: expected ${params.expectedHookPackId}, got ${hookName}`};let targetDirResult=await resolveInstallTargetDir(hookName,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook already exists: ${targetDir} (delete it first)`};if(dryRun)return{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir};logger.info?.(`Installing to ${targetDir}…`);let backupDir=null;mode===`update`&&await fileExists(targetDir)&&(backupDir=`${targetDir}.backup-${Date.now()}`,await fs$1.rename(targetDir,backupDir));try{await fs$1.cp(params.hookDir,targetDir,{recursive:!0})}catch(err){return backupDir&&(await fs$1.rm(targetDir,{recursive:!0,force:!0}).catch(()=>void 0),await fs$1.rename(backupDir,targetDir).catch(()=>void 0)),{ok:!1,error:`failed to copy hook: ${String(err)}`}}return backupDir&&await fs$1.rm(backupDir,{recursive:!0,force:!0}).catch(()=>void 0),{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir}}async function installHooksFromArchive(params){let logger=params.logger??defaultLogger,timeoutMs=params.timeoutMs??12e4,archivePathResult=await resolveArchiveSourcePath(params.archivePath);if(!archivePathResult.ok)return archivePathResult;let archivePath=archivePathResult.path;return await withTempDir(`builderforce-hook-`,async tmpDir=>{let extractDir=path.join(tmpDir,`extract`);await fs$1.mkdir(extractDir,{recursive:!0}),logger.info?.(`Extracting ${archivePath}…`);try{await extractArchive({archivePath,destDir:extractDir,timeoutMs,logger})}catch(err){return{ok:!1,error:`failed to extract archive: ${String(err)}`}}let rootDir=``;try{rootDir=await resolvePackedRootDir(extractDir)}catch(err){return{ok:!1,error:String(err)}}return await fileExists(path.join(rootDir,`package.json`))?await installHookPackageFromDir({packageDir:rootDir,hooksDir:params.hooksDir,timeoutMs,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:rootDir,hooksDir:params.hooksDir,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId})})}async function installHooksFromNpmSpec(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),expectedHookPackId=params.expectedHookPackId,spec=params.spec.trim(),specError=validateRegistryNpmSpec(spec);return specError?{ok:!1,error:specError}:await withTempDir(`builderforce-hook-pack-`,async tmpDir=>{logger.info?.(`Downloading ${spec}…`);let packedResult=await packNpmSpecToArchive({spec,timeoutMs,cwd:tmpDir});return packedResult.ok?await installHooksFromArchive({archivePath:packedResult.archivePath,hooksDir:params.hooksDir,timeoutMs,logger,mode,dryRun,expectedHookPackId}):packedResult})}async function installHooksFromPath(params){let resolved=resolveUserPath(params.path);return await fileExists(resolved)?(await fs$1.stat(resolved)).isDirectory()?await fileExists(path.join(resolved,`package.json`))?await installHookPackageFromDir({packageDir:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:resolved,hooksDir:params.hooksDir,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):resolveArchiveKind(resolved)?await installHooksFromArchive({archivePath:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):{ok:!1,error:`unsupported hook file: ${resolved}`}:{ok:!1,error:`path not found: ${resolved}`}}function recordHookInstall(cfg,update){let{hookId,...record}=update,installs={...cfg.hooks?.internal?.installs,[hookId]:{...cfg.hooks?.internal?.installs?.[hookId],...record,installedAt:record.installedAt??new Date().toISOString()}};return{...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,installs:{...installs,[hookId]:installs[hookId]}}}}}function mergeHookEntries(pluginEntries,workspaceEntries){let merged=new Map;for(let entry of pluginEntries)merged.set(entry.hook.name,entry);for(let entry of workspaceEntries)merged.set(entry.hook.name,entry);return Array.from(merged.values())}function buildHooksReport(config){let workspaceDir=resolveAgentWorkspaceDir(config,resolveDefaultAgentId(config)),workspaceEntries=loadWorkspaceHookEntries(workspaceDir,{config});return buildWorkspaceHookStatus(workspaceDir,{config,entries:mergeHookEntries(buildPluginStatusReport({config,workspaceDir}).hooks.map(hook=>hook.entry),workspaceEntries)})}function resolveHookForToggle(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName);if(!hook)throw Error(`Hook "${hookName}" not found`);if(hook.managedByPlugin)throw Error(`Hook "${hookName}" is managed by plugin "${hook.pluginId??`unknown`}" and cannot be enabled/disabled.`);if(opts?.requireEligible&&!hook.eligible)throw Error(`Hook "${hookName}" is not eligible (missing requirements)`);return hook}function buildConfigWithHookEnabled(params){let entries={...params.config.hooks?.internal?.entries};entries[params.hookName]={...entries[params.hookName],enabled:params.enabled};let internal={...params.config.hooks?.internal,...params.ensureHooksEnabled?{enabled:!0}:{},entries};return{...params.config,hooks:{...params.config.hooks,internal}}}function formatHookStatus(hook){return hook.eligible?theme.success(`✓ ready`):hook.disabled?theme.warn(`⏸ disabled`):theme.error(`✗ missing`)}function formatHookName(hook){return`${hook.emoji??`🔗`} ${theme.command(hook.name)}`}function formatHookSource(hook){return hook.managedByPlugin?`plugin:${hook.pluginId??`unknown`}`:hook.source}function formatHookMissingSummary(hook){let missing=[];return hook.missing.bins.length>0&&missing.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&missing.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&missing.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&missing.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&missing.push(`os: ${hook.missing.os.join(`, `)}`),missing.join(`; `)}function exitHooksCliWithError(err){defaultRuntime.error(`${theme.error(`Error:`)} ${err instanceof Error?err.message:String(err)}`),process.exit(1)}async function runHooksCliAction(action){try{await action()}catch(err){exitHooksCliWithError(err)}}function createInstallLogger(){return{info:msg=>defaultRuntime.log(msg),warn:msg=>defaultRuntime.log(theme.warn(msg))}}function logGatewayRestartHint(){defaultRuntime.log(`Restart the gateway to load hooks.`)}async function readInstalledPackageVersion(dir){try{let raw=await fs$1.readFile(path.join(dir,`package.json`),`utf-8`),parsed=JSON.parse(raw);return typeof parsed.version==`string`?parsed.version:void 0}catch{return}}function enableInternalHookEntries(config,hookNames){let entries={...config.hooks?.internal?.entries};for(let hookName of hookNames)entries[hookName]={...entries[hookName],enabled:!0};return{...config,hooks:{...config.hooks,internal:{...config.hooks?.internal,enabled:!0,entries}}}}function formatHooksList(report,opts){let hooks=opts.eligible?report.hooks.filter(h=>h.eligible):report.hooks;if(opts.json){let jsonReport={workspaceDir:report.workspaceDir,managedHooksDir:report.managedHooksDir,hooks:hooks.map(h=>({name:h.name,description:h.description,emoji:h.emoji,eligible:h.eligible,disabled:h.disabled,source:h.source,pluginId:h.pluginId,events:h.events,homepage:h.homepage,missing:h.missing,managedByPlugin:h.managedByPlugin}))};return JSON.stringify(jsonReport,null,2)}if(hooks.length===0)return opts.eligible?`No eligible hooks found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see all hooks.`:`No hooks found.`;let eligible=hooks.filter(h=>h.eligible),tableWidth=Math.max(60,(process.stdout.columns??120)-1),rows=hooks.map(hook=>{let missing=formatHookMissingSummary(hook);return{Status:formatHookStatus(hook),Hook:formatHookName(hook),Description:theme.muted(hook.description),Source:formatHookSource(hook),Missing:missing?theme.warn(missing):``}}),columns=[{key:`Status`,header:`Status`,minWidth:10},{key:`Hook`,header:`Hook`,minWidth:18,flex:!0},{key:`Description`,header:`Description`,minWidth:24,flex:!0},{key:`Source`,header:`Source`,minWidth:12,flex:!0}];opts.verbose&&columns.push({key:`Missing`,header:`Missing`,minWidth:18,flex:!0});let lines=[];return lines.push(`${theme.heading(`Hooks`)} ${theme.muted(`(${eligible.length}/${hooks.length} ready)`)}`),lines.push(renderTable({width:tableWidth,columns,rows}).trimEnd()),lines.join(`
1
+ import"./paths-5FcIFMsj.js";import{B as theme,C as shortenHomePath,b as resolveUserPath,t as CONFIG_DIR}from"./utils-DbaBVFaK.js";import"./embedded-helpers-2fP2Yq8h.js";import"./reply-BuUSdq2L.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import{i as defaultRuntime}from"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import"./exec-DdcIjeyn.js";import{c as resolveAgentWorkspaceDir,l as resolveDefaultAgentId}from"./agent-scope-DPtjOxzp.js";import"./src-CA0fU67C.js";import"./model-selection-Doyvd4lU.js";import{t as formatCliCommand}from"./command-format-D806O2pt.js";import"./env-file-D1MDi-AM.js";import"./boolean-Cnh1KNl1.js";import"./env-BIdU5BAp.js";import"./src-BifagO7i.js";import{c as writeConfigFile,r as loadConfig}from"./io-BNtgT4VB.js";import"./manifest-registry-BJCfNV1a.js";import{n as MANIFEST_KEY,t as LEGACY_MANIFEST_KEYS}from"./legacy-names-BXbHg7Rs.js";import"./config-BD801bpx.js";import"./runner-C3k1sKdu.js";import"./model-catalog-BoiWqBTw.js";import"./sandbox-1jtP0nhr.js";import"./chrome-Bfprrnm1.js";import"./tailscale-DLkpGquM.js";import"./auth-lebUHrkd.js";import"./server-context-DKdrUePN.js";import"./frontmatter-3D1EdC1L.js";import"./skills-Ba4ftrB-.js";import"./plugin-skills-B11rggZh.js";import"./routes-CRrqIFJR.js";import"./redact-BHdfp2MZ.js";import"./errors-B1MIg3g-.js";import"./paths-cR8ct-Y3.js";import"./ssrf-p9k-iapc.js";import"./image-ops-C8IUQKjn.js";import"./store-CmHBQ-yX.js";import"./ports-DgmEDNOm.js";import"./trash-DD2Hc5oq.js";import"./sessions-BPr0-lkT.js";import"./message-channel-D_jXxXQj.js";import"./plugins-D5zP6ENo.js";import"./accounts-o35LU_iy.js";import"./accounts-rmXEiebi.js";import"./accounts-BLueHgKj.js";import"./bindings-DR59065T.js";import"./send-l9WWK31e.js";import"./send-CVgJk5kN.js";import"./paths-DJ6rztqJ.js";import"./tool-images-B7b_OiMz.js";import"./tool-display-ByOZtWvA.js";import"./fetch-guard-8mwt3-hm.js";import"./api-key-rotation-Yn3MpU4F.js";import"./fetch-BuOLY9KP.js";import"./sqlite-C39E12XS.js";import"./tokens-CCU3zO-D.js";import"./project-context-store-Dbbjk8CQ.js";import"./with-timeout-CPd4-suw.js";import"./deliver-BiGCWHvZ.js";import"./send-CRSlal5z.js";import{n as loadWorkspaceHookEntries,o as parseFrontmatter}from"./workspace-D4LK4thI.js";import"./reply-prefix-zIMgi6K6.js";import"./memory-cli-D-Khe5Ij.js";import"./manager-DNIg84rj.js";import"./retry-DlVhg5qu.js";import"./client-xfoidwPI.js";import"./call-CJq3iGqu.js";import"./common-BTbIhLyt.js";import"./chunk-FCBlVOyo.js";import"./markdown-tables-P6uoUSFa.js";import"./ir-5BNoIXZm.js";import"./render-D1dVTEB1.js";import"./builderforcellm-syscheck-Cp4LMft_.js";import"./send-D_6wd5Y3.js";import"./outbound-attachment-C7wByQO5.js";import"./fetch-DnVtDecb.js";import"./delivery-queue-CXKynF1P.js";import"./channel-activity-CCNDbdD3.js";import"./tables-ERcoWFDp.js";import"./pairing-store-C8gtsUDG.js";import{t as formatDocsLink}from"./links-BgWWaaOT.js";import"./cli-utils-LBYKdNFb.js";import"./help-format-Qfk2vDNX.js";import"./progress-BfOtdN6b.js";import"./resolve-route-D49haUnv.js";import"./replies-DAwcEPGb.js";import"./refresh-TiC_kLgE.js";import"./coding-tools.policy-COe2xa9K.js";import"./send-BIMaIwQV.js";import"./onboard-helpers-BmYUjl4j.js";import"./prompt-style-BpVK43GK.js";import"./pairing-labels-CD0lPAfY.js";import"./session-cost-usage-BjH7mxVj.js";import"./usage-format-DGf8ZWPH.js";import"./provider-usage-QGVVADJa.js";import"./active-listener-Dcg19lJG.js";import"./exec-approvals-BpVPDVtV.js";import"./nodes-screen-C3TDIi8d.js";import"./project-context-BLpMH93w.js";import"./control-service-DKBAemtq.js";import"./stagger-8EkqkqJv.js";import"./channel-selection-DyAvzlY8.js";import"./mamba-state-engine-BQuRdgMU.js";import"./transformers-stream-D7nRu4Qu.js";import{a as extractArchive,c as resolveArchiveKind,i as unscopedPackageName,l as resolvePackedRootDir,o as fileExists,s as readJsonFile,t as resolveSafeInstallDir}from"./install-safe-path-DsLq2BUJ.js";import{a as installPackageDir,i as withTempDir,n as packNpmSpecToArchive,r as resolveArchiveSourcePath,t as validateRegistryNpmSpec}from"./npm-registry-spec-DIW6RsGN.js";import{t as renderTable}from"./table-BoCHYKoQ.js";import{t as buildWorkspaceHookStatus}from"./hooks-status-nC054v5L.js";import{t as buildPluginStatusReport}from"./status-Ad1eFPKR.js";import fs from"node:fs";import path from"node:path";import fs$1 from"node:fs/promises";const defaultLogger={};function validateHookId(hookId){return hookId?hookId===`.`||hookId===`..`?`invalid hook name: reserved path segment`:hookId.includes(`/`)||hookId.includes(`\\`)?`invalid hook name: path separators not allowed`:null:`invalid hook name: missing`}function resolveHookInstallDir(hookId,hooksDir){let hooksBase=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`),hookIdError=validateHookId(hookId);if(hookIdError)throw Error(hookIdError);let targetDirResult=resolveSafeInstallDir({baseDir:hooksBase,id:hookId,invalidNameMessage:`invalid hook name: path traversal detected`});if(!targetDirResult.ok)throw Error(targetDirResult.error);return targetDirResult.path}async function ensureBuilderForceAgentsHooks(manifest){let hooks=(manifest[MANIFEST_KEY]??LEGACY_MANIFEST_KEYS.map(k=>manifest[k]).find(Boolean))?.hooks;if(!Array.isArray(hooks))throw Error(`package.json missing builderforce.hooks`);let list=hooks.map(e=>typeof e==`string`?e.trim():``).filter(Boolean);if(list.length===0)throw Error(`package.json builderforce.hooks is empty`);return list}function resolveHookInstallModeOptions(params){return{logger:params.logger??defaultLogger,mode:params.mode??`install`,dryRun:params.dryRun??!1}}function resolveTimedHookInstallModeOptions(params){return{...resolveHookInstallModeOptions(params),timeoutMs:params.timeoutMs??12e4}}async function resolveInstallTargetDir(id,hooksDir){let baseHooksDir=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`);await fs$1.mkdir(baseHooksDir,{recursive:!0});let targetDirResult=resolveSafeInstallDir({baseDir:baseHooksDir,id,invalidNameMessage:`invalid hook name: path traversal detected`});return targetDirResult.ok?{ok:!0,targetDir:targetDirResult.path}:{ok:!1,error:targetDirResult.error}}async function resolveHookNameFromDir(hookDir){let hookMdPath=path.join(hookDir,`HOOK.md`);if(!await fileExists(hookMdPath))throw Error(`HOOK.md missing in ${hookDir}`);return parseFrontmatter(await fs$1.readFile(hookMdPath,`utf-8`)).name||path.basename(hookDir)}async function validateHookDir(hookDir){if(!await fileExists(path.join(hookDir,`HOOK.md`)))throw Error(`HOOK.md missing in ${hookDir}`);if(!await Promise.all([`handler.ts`,`handler.js`,`index.ts`,`index.js`].map(async candidate=>fileExists(path.join(hookDir,candidate)))).then(results=>results.some(Boolean)))throw Error(`handler.ts/handler.js/index.ts/index.js missing in ${hookDir}`)}async function installHookPackageFromDir(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),manifestPath=path.join(params.packageDir,`package.json`);if(!await fileExists(manifestPath))return{ok:!1,error:`package.json missing`};let manifest;try{manifest=await readJsonFile(manifestPath)}catch(err){return{ok:!1,error:`invalid package.json: ${String(err)}`}}let hookEntries;try{hookEntries=await ensureBuilderForceAgentsHooks(manifest)}catch(err){return{ok:!1,error:String(err)}}let pkgName=typeof manifest.name==`string`?manifest.name:``,hookPackId=pkgName?unscopedPackageName(pkgName):path.basename(params.packageDir),hookIdError=validateHookId(hookPackId);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookPackId)return{ok:!1,error:`hook pack id mismatch: expected ${params.expectedHookPackId}, got ${hookPackId}`};let targetDirResult=await resolveInstallTargetDir(hookPackId,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook pack already exists: ${targetDir} (delete it first)`};let resolvedHooks=[];for(let entry of hookEntries){let hookDir=path.resolve(params.packageDir,entry);await validateHookDir(hookDir);let hookName=await resolveHookNameFromDir(hookDir);resolvedHooks.push(hookName)}if(dryRun)return{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0};let deps=manifest.dependencies??{},hasDeps=Object.keys(deps).length>0,installRes=await installPackageDir({sourceDir:params.packageDir,targetDir,mode,timeoutMs,logger,copyErrorPrefix:`failed to copy hook pack`,hasDeps,depsLogMessage:`Installing hook pack dependencies…`});return installRes.ok?{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0}:installRes}async function installHookFromDir(params){let{logger,mode,dryRun}=resolveHookInstallModeOptions(params);await validateHookDir(params.hookDir);let hookName=await resolveHookNameFromDir(params.hookDir),hookIdError=validateHookId(hookName);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookName)return{ok:!1,error:`hook id mismatch: expected ${params.expectedHookPackId}, got ${hookName}`};let targetDirResult=await resolveInstallTargetDir(hookName,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook already exists: ${targetDir} (delete it first)`};if(dryRun)return{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir};logger.info?.(`Installing to ${targetDir}…`);let backupDir=null;mode===`update`&&await fileExists(targetDir)&&(backupDir=`${targetDir}.backup-${Date.now()}`,await fs$1.rename(targetDir,backupDir));try{await fs$1.cp(params.hookDir,targetDir,{recursive:!0})}catch(err){return backupDir&&(await fs$1.rm(targetDir,{recursive:!0,force:!0}).catch(()=>void 0),await fs$1.rename(backupDir,targetDir).catch(()=>void 0)),{ok:!1,error:`failed to copy hook: ${String(err)}`}}return backupDir&&await fs$1.rm(backupDir,{recursive:!0,force:!0}).catch(()=>void 0),{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir}}async function installHooksFromArchive(params){let logger=params.logger??defaultLogger,timeoutMs=params.timeoutMs??12e4,archivePathResult=await resolveArchiveSourcePath(params.archivePath);if(!archivePathResult.ok)return archivePathResult;let archivePath=archivePathResult.path;return await withTempDir(`builderforce-hook-`,async tmpDir=>{let extractDir=path.join(tmpDir,`extract`);await fs$1.mkdir(extractDir,{recursive:!0}),logger.info?.(`Extracting ${archivePath}…`);try{await extractArchive({archivePath,destDir:extractDir,timeoutMs,logger})}catch(err){return{ok:!1,error:`failed to extract archive: ${String(err)}`}}let rootDir=``;try{rootDir=await resolvePackedRootDir(extractDir)}catch(err){return{ok:!1,error:String(err)}}return await fileExists(path.join(rootDir,`package.json`))?await installHookPackageFromDir({packageDir:rootDir,hooksDir:params.hooksDir,timeoutMs,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:rootDir,hooksDir:params.hooksDir,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId})})}async function installHooksFromNpmSpec(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),expectedHookPackId=params.expectedHookPackId,spec=params.spec.trim(),specError=validateRegistryNpmSpec(spec);return specError?{ok:!1,error:specError}:await withTempDir(`builderforce-hook-pack-`,async tmpDir=>{logger.info?.(`Downloading ${spec}…`);let packedResult=await packNpmSpecToArchive({spec,timeoutMs,cwd:tmpDir});return packedResult.ok?await installHooksFromArchive({archivePath:packedResult.archivePath,hooksDir:params.hooksDir,timeoutMs,logger,mode,dryRun,expectedHookPackId}):packedResult})}async function installHooksFromPath(params){let resolved=resolveUserPath(params.path);return await fileExists(resolved)?(await fs$1.stat(resolved)).isDirectory()?await fileExists(path.join(resolved,`package.json`))?await installHookPackageFromDir({packageDir:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:resolved,hooksDir:params.hooksDir,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):resolveArchiveKind(resolved)?await installHooksFromArchive({archivePath:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):{ok:!1,error:`unsupported hook file: ${resolved}`}:{ok:!1,error:`path not found: ${resolved}`}}function recordHookInstall(cfg,update){let{hookId,...record}=update,installs={...cfg.hooks?.internal?.installs,[hookId]:{...cfg.hooks?.internal?.installs?.[hookId],...record,installedAt:record.installedAt??new Date().toISOString()}};return{...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,installs:{...installs,[hookId]:installs[hookId]}}}}}function mergeHookEntries(pluginEntries,workspaceEntries){let merged=new Map;for(let entry of pluginEntries)merged.set(entry.hook.name,entry);for(let entry of workspaceEntries)merged.set(entry.hook.name,entry);return Array.from(merged.values())}function buildHooksReport(config){let workspaceDir=resolveAgentWorkspaceDir(config,resolveDefaultAgentId(config)),workspaceEntries=loadWorkspaceHookEntries(workspaceDir,{config});return buildWorkspaceHookStatus(workspaceDir,{config,entries:mergeHookEntries(buildPluginStatusReport({config,workspaceDir}).hooks.map(hook=>hook.entry),workspaceEntries)})}function resolveHookForToggle(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName);if(!hook)throw Error(`Hook "${hookName}" not found`);if(hook.managedByPlugin)throw Error(`Hook "${hookName}" is managed by plugin "${hook.pluginId??`unknown`}" and cannot be enabled/disabled.`);if(opts?.requireEligible&&!hook.eligible)throw Error(`Hook "${hookName}" is not eligible (missing requirements)`);return hook}function buildConfigWithHookEnabled(params){let entries={...params.config.hooks?.internal?.entries};entries[params.hookName]={...entries[params.hookName],enabled:params.enabled};let internal={...params.config.hooks?.internal,...params.ensureHooksEnabled?{enabled:!0}:{},entries};return{...params.config,hooks:{...params.config.hooks,internal}}}function formatHookStatus(hook){return hook.eligible?theme.success(`✓ ready`):hook.disabled?theme.warn(`⏸ disabled`):theme.error(`✗ missing`)}function formatHookName(hook){return`${hook.emoji??`🔗`} ${theme.command(hook.name)}`}function formatHookSource(hook){return hook.managedByPlugin?`plugin:${hook.pluginId??`unknown`}`:hook.source}function formatHookMissingSummary(hook){let missing=[];return hook.missing.bins.length>0&&missing.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&missing.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&missing.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&missing.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&missing.push(`os: ${hook.missing.os.join(`, `)}`),missing.join(`; `)}function exitHooksCliWithError(err){defaultRuntime.error(`${theme.error(`Error:`)} ${err instanceof Error?err.message:String(err)}`),process.exit(1)}async function runHooksCliAction(action){try{await action()}catch(err){exitHooksCliWithError(err)}}function createInstallLogger(){return{info:msg=>defaultRuntime.log(msg),warn:msg=>defaultRuntime.log(theme.warn(msg))}}function logGatewayRestartHint(){defaultRuntime.log(`Restart the gateway to load hooks.`)}async function readInstalledPackageVersion(dir){try{let raw=await fs$1.readFile(path.join(dir,`package.json`),`utf-8`),parsed=JSON.parse(raw);return typeof parsed.version==`string`?parsed.version:void 0}catch{return}}function enableInternalHookEntries(config,hookNames){let entries={...config.hooks?.internal?.entries};for(let hookName of hookNames)entries[hookName]={...entries[hookName],enabled:!0};return{...config,hooks:{...config.hooks,internal:{...config.hooks?.internal,enabled:!0,entries}}}}function formatHooksList(report,opts){let hooks=opts.eligible?report.hooks.filter(h=>h.eligible):report.hooks;if(opts.json){let jsonReport={workspaceDir:report.workspaceDir,managedHooksDir:report.managedHooksDir,hooks:hooks.map(h=>({name:h.name,description:h.description,emoji:h.emoji,eligible:h.eligible,disabled:h.disabled,source:h.source,pluginId:h.pluginId,events:h.events,homepage:h.homepage,missing:h.missing,managedByPlugin:h.managedByPlugin}))};return JSON.stringify(jsonReport,null,2)}if(hooks.length===0)return opts.eligible?`No eligible hooks found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see all hooks.`:`No hooks found.`;let eligible=hooks.filter(h=>h.eligible),tableWidth=Math.max(60,(process.stdout.columns??120)-1),rows=hooks.map(hook=>{let missing=formatHookMissingSummary(hook);return{Status:formatHookStatus(hook),Hook:formatHookName(hook),Description:theme.muted(hook.description),Source:formatHookSource(hook),Missing:missing?theme.warn(missing):``}}),columns=[{key:`Status`,header:`Status`,minWidth:10},{key:`Hook`,header:`Hook`,minWidth:18,flex:!0},{key:`Description`,header:`Description`,minWidth:24,flex:!0},{key:`Source`,header:`Source`,minWidth:12,flex:!0}];opts.verbose&&columns.push({key:`Missing`,header:`Missing`,minWidth:18,flex:!0});let lines=[];return lines.push(`${theme.heading(`Hooks`)} ${theme.muted(`(${eligible.length}/${hooks.length} ready)`)}`),lines.push(renderTable({width:tableWidth,columns,rows}).trimEnd()),lines.join(`
2
2
  `)}function formatHookInfo(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName||h.hookKey===hookName);if(!hook)return opts.json?JSON.stringify({error:`not found`,hook:hookName},null,2):`Hook "${hookName}" not found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see available hooks.`;if(opts.json)return JSON.stringify(hook,null,2);let lines=[],emoji=hook.emoji??`🔗`,status=hook.eligible?theme.success(`✓ Ready`):hook.disabled?theme.warn(`⏸ Disabled`):theme.error(`✗ Missing requirements`);if(lines.push(`${emoji} ${theme.heading(hook.name)} ${status}`),lines.push(``),lines.push(hook.description),lines.push(``),lines.push(theme.heading(`Details:`)),hook.managedByPlugin?lines.push(`${theme.muted(` Source:`)} ${hook.source} (${hook.pluginId??`unknown`})`):lines.push(`${theme.muted(` Source:`)} ${hook.source}`),lines.push(`${theme.muted(` Path:`)} ${shortenHomePath(hook.filePath)}`),lines.push(`${theme.muted(` Handler:`)} ${shortenHomePath(hook.handlerPath)}`),hook.homepage&&lines.push(`${theme.muted(` Homepage:`)} ${hook.homepage}`),hook.events.length>0&&lines.push(`${theme.muted(` Events:`)} ${hook.events.join(`, `)}`),hook.managedByPlugin&&lines.push(theme.muted(` Managed by plugin; enable/disable via hooks CLI not available.`)),hook.requirements.bins.length>0||hook.requirements.anyBins.length>0||hook.requirements.env.length>0||hook.requirements.config.length>0||hook.requirements.os.length>0){if(lines.push(``),lines.push(theme.heading(`Requirements:`)),hook.requirements.bins.length>0){let binsStatus=hook.requirements.bins.map(bin=>hook.missing.bins.includes(bin)?theme.error(`✗ ${bin}`):theme.success(`✓ ${bin}`));lines.push(`${theme.muted(` Binaries:`)} ${binsStatus.join(`, `)}`)}if(hook.requirements.anyBins.length>0){let anyBinsStatus=hook.missing.anyBins.length>0?theme.error(`✗ (any of: ${hook.requirements.anyBins.join(`, `)})`):theme.success(`✓ (any of: ${hook.requirements.anyBins.join(`, `)})`);lines.push(`${theme.muted(` Any binary:`)} ${anyBinsStatus}`)}if(hook.requirements.env.length>0){let envStatus=hook.requirements.env.map(env=>hook.missing.env.includes(env)?theme.error(`✗ ${env}`):theme.success(`✓ ${env}`));lines.push(`${theme.muted(` Environment:`)} ${envStatus.join(`, `)}`)}if(hook.requirements.config.length>0){let configStatus=hook.configChecks.map(check=>check.satisfied?theme.success(`✓ ${check.path}`):theme.error(`✗ ${check.path}`));lines.push(`${theme.muted(` Config:`)} ${configStatus.join(`, `)}`)}if(hook.requirements.os.length>0){let osStatus=hook.missing.os.length>0?theme.error(`✗ (${hook.requirements.os.join(`, `)})`):theme.success(`✓ (${hook.requirements.os.join(`, `)})`);lines.push(`${theme.muted(` OS:`)} ${osStatus}`)}}return lines.join(`
3
3
  `)}function formatHooksCheck(report,opts){if(opts.json){let eligible=report.hooks.filter(h=>h.eligible),notEligible=report.hooks.filter(h=>!h.eligible);return JSON.stringify({total:report.hooks.length,eligible:eligible.length,notEligible:notEligible.length,hooks:{eligible:eligible.map(h=>h.name),notEligible:notEligible.map(h=>({name:h.name,missing:h.missing}))}},null,2)}let eligible=report.hooks.filter(h=>h.eligible),notEligible=report.hooks.filter(h=>!h.eligible),lines=[];if(lines.push(theme.heading(`Hooks Status`)),lines.push(``),lines.push(`${theme.muted(`Total hooks:`)} ${report.hooks.length}`),lines.push(`${theme.success(`Ready:`)} ${eligible.length}`),lines.push(`${theme.warn(`Not ready:`)} ${notEligible.length}`),notEligible.length>0){lines.push(``),lines.push(theme.heading(`Hooks not ready:`));for(let hook of notEligible){let reasons=[];hook.disabled&&reasons.push(`disabled`),hook.missing.bins.length>0&&reasons.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&reasons.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&reasons.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&reasons.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&reasons.push(`os: ${hook.missing.os.join(`, `)}`),lines.push(` ${hook.emoji??`🔗`} ${hook.name} - ${reasons.join(`; `)}`)}}return lines.join(`
4
4
  `)}async function enableHook(hookName){let config=loadConfig(),hook=resolveHookForToggle(buildHooksReport(config),hookName,{requireEligible:!0});await writeConfigFile(buildConfigWithHookEnabled({config,hookName,enabled:!0,ensureHooksEnabled:!0})),defaultRuntime.log(`${theme.success(`✓`)} Enabled hook: ${hook.emoji??`🔗`} ${theme.command(hookName)}`)}async function disableHook(hookName){let config=loadConfig(),hook=resolveHookForToggle(buildHooksReport(config),hookName);await writeConfigFile(buildConfigWithHookEnabled({config,hookName,enabled:!1})),defaultRuntime.log(`${theme.warn(`⏸`)} Disabled hook: ${hook.emoji??`🔗`} ${theme.command(hookName)}`)}function registerHooksCli(program){let hooks=program.command(`hooks`).description(`Manage internal agent hooks`).addHelpText(`after`,()=>`\n${theme.muted(`Docs:`)} ${formatDocsLink(`/cli/hooks`,`docs.builderforce.ai/cli/hooks`)}\n`);hooks.command(`list`).description(`List all hooks`).option(`--eligible`,`Show only eligible hooks`,!1).option(`--json`,`Output as JSON`,!1).option(`-v, --verbose`,`Show more details including missing requirements`,!1).action(async opts=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksList(report,opts))})),hooks.command(`info <name>`).description(`Show detailed information about a hook`).option(`--json`,`Output as JSON`,!1).action(async(name,opts)=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHookInfo(report,name,opts))})),hooks.command(`check`).description(`Check hooks eligibility status`).option(`--json`,`Output as JSON`,!1).action(async opts=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksCheck(report,opts))})),hooks.command(`enable <name>`).description(`Enable a hook`).action(async name=>runHooksCliAction(async()=>{await enableHook(name)})),hooks.command(`disable <name>`).description(`Disable a hook`).action(async name=>runHooksCliAction(async()=>{await disableHook(name)})),hooks.command(`install`).description(`Install a hook pack (path, archive, or npm spec)`).argument(`<path-or-spec>`,`Path to a hook pack or npm package spec`).option(`-l, --link`,`Link a local path instead of copying`,!1).action(async(raw,opts)=>{let resolved=resolveUserPath(raw),cfg=loadConfig();if(fs.existsSync(resolved)){if(opts.link){fs.statSync(resolved).isDirectory()||(defaultRuntime.error(`Linked hook paths must be directories.`),process.exit(1));let existing=cfg.hooks?.internal?.load?.extraDirs??[],merged=Array.from(new Set([...existing,resolved])),probe=await installHooksFromPath({path:resolved,dryRun:!0});probe.ok||(defaultRuntime.error(probe.error),process.exit(1));let next={...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,enabled:!0,load:{...cfg.hooks?.internal?.load,extraDirs:merged}}}};next=enableInternalHookEntries(next,probe.hooks),next=recordHookInstall(next,{hookId:probe.hookPackId,source:`path`,sourcePath:resolved,installPath:resolved,version:probe.version,hooks:probe.hooks}),await writeConfigFile(next),defaultRuntime.log(`Linked hook path: ${shortenHomePath(resolved)}`),logGatewayRestartHint();return}let result=await installHooksFromPath({path:resolved,logger:createInstallLogger()});result.ok||(defaultRuntime.error(result.error),process.exit(1));let next=enableInternalHookEntries(cfg,result.hooks),source=resolveArchiveKind(resolved)?`archive`:`path`;next=recordHookInstall(next,{hookId:result.hookPackId,source,sourcePath:resolved,installPath:result.targetDir,version:result.version,hooks:result.hooks}),await writeConfigFile(next),defaultRuntime.log(`Installed hooks: ${result.hooks.join(`, `)}`),logGatewayRestartHint();return}opts.link&&(defaultRuntime.error("`--link` requires a local path."),process.exit(1)),(raw.startsWith(`.`)||raw.startsWith(`~`)||path.isAbsolute(raw)||raw.endsWith(`.zip`)||raw.endsWith(`.tgz`)||raw.endsWith(`.tar.gz`)||raw.endsWith(`.tar`))&&(defaultRuntime.error(`Path not found: ${resolved}`),process.exit(1));let result=await installHooksFromNpmSpec({spec:raw,logger:createInstallLogger()});result.ok||(defaultRuntime.error(result.error),process.exit(1));let next=enableInternalHookEntries(cfg,result.hooks);next=recordHookInstall(next,{hookId:result.hookPackId,source:`npm`,spec:raw,installPath:result.targetDir,version:result.version,hooks:result.hooks}),await writeConfigFile(next),defaultRuntime.log(`Installed hooks: ${result.hooks.join(`, `)}`),logGatewayRestartHint()}),hooks.command(`update`).description(`Update installed hooks (npm installs only)`).argument(`[id]`,`Hook pack id (omit with --all)`).option(`--all`,`Update all tracked hooks`,!1).option(`--dry-run`,`Show what would change without writing`,!1).action(async(id,opts)=>{let cfg=loadConfig(),installs=cfg.hooks?.internal?.installs??{},targets=opts.all?Object.keys(installs):id?[id]:[];targets.length===0&&(defaultRuntime.error(`Provide a hook id or use --all.`),process.exit(1));let nextCfg=cfg,updatedCount=0;for(let hookId of targets){let record=installs[hookId];if(!record){defaultRuntime.log(theme.warn(`No install record for "${hookId}".`));continue}if(record.source!==`npm`){defaultRuntime.log(theme.warn(`Skipping "${hookId}" (source: ${record.source}).`));continue}if(!record.spec){defaultRuntime.log(theme.warn(`Skipping "${hookId}" (missing npm spec).`));continue}let installPath;try{installPath=record.installPath??resolveHookInstallDir(hookId)}catch(err){defaultRuntime.log(theme.error(`Invalid install path for "${hookId}": ${String(err)}`));continue}let currentVersion=await readInstalledPackageVersion(installPath);if(opts.dryRun){let probe=await installHooksFromNpmSpec({spec:record.spec,mode:`update`,dryRun:!0,expectedHookPackId:hookId,logger:createInstallLogger()});if(!probe.ok){defaultRuntime.log(theme.error(`Failed to check ${hookId}: ${probe.error}`));continue}let nextVersion=probe.version??`unknown`,currentLabel=currentVersion??`unknown`;currentVersion&&probe.version&&currentVersion===probe.version?defaultRuntime.log(`${hookId} is up to date (${currentLabel}).`):defaultRuntime.log(`Would update ${hookId}: ${currentLabel} → ${nextVersion}.`);continue}let result=await installHooksFromNpmSpec({spec:record.spec,mode:`update`,expectedHookPackId:hookId,logger:createInstallLogger()});if(!result.ok){defaultRuntime.log(theme.error(`Failed to update ${hookId}: ${result.error}`));continue}let nextVersion=result.version??await readInstalledPackageVersion(result.targetDir);nextCfg=recordHookInstall(nextCfg,{hookId,source:`npm`,spec:record.spec,installPath:result.targetDir,version:nextVersion,hooks:result.hooks}),updatedCount+=1;let currentLabel=currentVersion??`unknown`,nextLabel=nextVersion??`unknown`;currentVersion&&nextVersion&&currentVersion===nextVersion?defaultRuntime.log(`${hookId} already at ${currentLabel}.`):defaultRuntime.log(`Updated ${hookId}: ${currentLabel} → ${nextLabel}.`)}updatedCount>0&&(await writeConfigFile(nextCfg),logGatewayRestartHint())}),hooks.action(async()=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksList(report,{}))}))}export{registerHooksCli};
@@ -1,4 +1,4 @@
1
- import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import{S as shortenHomePath,t as CONFIG_DIR,y as resolveUserPath,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import{c as resolveAgentWorkspaceDir,l as resolveDefaultAgentId}from"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import{c as writeConfigFile,r as loadConfig}from"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import{n as MANIFEST_KEY,t as LEGACY_MANIFEST_KEYS}from"./legacy-names-DloW84CJ.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-Cj5yC7B4.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import{n as loadWorkspaceHookEntries,o as parseFrontmatter}from"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import{t as formatDocsLink}from"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import{a as extractArchive,c as resolveArchiveKind,i as unscopedPackageName,l as resolvePackedRootDir,o as fileExists,s as readJsonFile,t as resolveSafeInstallDir}from"./install-safe-path-ObPl6zIf.js";import{a as installPackageDir,i as withTempDir,n as packNpmSpecToArchive,r as resolveArchiveSourcePath,t as validateRegistryNpmSpec}from"./npm-registry-spec-BV1VDmuN.js";import{t as renderTable}from"./table-BFCCZDsp.js";import{t as buildWorkspaceHookStatus}from"./hooks-status-B_bszx_E.js";import{t as buildPluginStatusReport}from"./status-wTMmjZ7M.js";import path from"node:path";import fs from"node:fs";import fs$1 from"node:fs/promises";const defaultLogger={};function validateHookId(hookId){return hookId?hookId===`.`||hookId===`..`?`invalid hook name: reserved path segment`:hookId.includes(`/`)||hookId.includes(`\\`)?`invalid hook name: path separators not allowed`:null:`invalid hook name: missing`}function resolveHookInstallDir(hookId,hooksDir){let hooksBase=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`),hookIdError=validateHookId(hookId);if(hookIdError)throw Error(hookIdError);let targetDirResult=resolveSafeInstallDir({baseDir:hooksBase,id:hookId,invalidNameMessage:`invalid hook name: path traversal detected`});if(!targetDirResult.ok)throw Error(targetDirResult.error);return targetDirResult.path}async function ensureBuilderForceAgentsHooks(manifest){let hooks=(manifest[MANIFEST_KEY]??LEGACY_MANIFEST_KEYS.map(k=>manifest[k]).find(Boolean))?.hooks;if(!Array.isArray(hooks))throw Error(`package.json missing builderforce.hooks`);let list=hooks.map(e=>typeof e==`string`?e.trim():``).filter(Boolean);if(list.length===0)throw Error(`package.json builderforce.hooks is empty`);return list}function resolveHookInstallModeOptions(params){return{logger:params.logger??defaultLogger,mode:params.mode??`install`,dryRun:params.dryRun??!1}}function resolveTimedHookInstallModeOptions(params){return{...resolveHookInstallModeOptions(params),timeoutMs:params.timeoutMs??12e4}}async function resolveInstallTargetDir(id,hooksDir){let baseHooksDir=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`);await fs$1.mkdir(baseHooksDir,{recursive:!0});let targetDirResult=resolveSafeInstallDir({baseDir:baseHooksDir,id,invalidNameMessage:`invalid hook name: path traversal detected`});return targetDirResult.ok?{ok:!0,targetDir:targetDirResult.path}:{ok:!1,error:targetDirResult.error}}async function resolveHookNameFromDir(hookDir){let hookMdPath=path.join(hookDir,`HOOK.md`);if(!await fileExists(hookMdPath))throw Error(`HOOK.md missing in ${hookDir}`);return parseFrontmatter(await fs$1.readFile(hookMdPath,`utf-8`)).name||path.basename(hookDir)}async function validateHookDir(hookDir){if(!await fileExists(path.join(hookDir,`HOOK.md`)))throw Error(`HOOK.md missing in ${hookDir}`);if(!await Promise.all([`handler.ts`,`handler.js`,`index.ts`,`index.js`].map(async candidate=>fileExists(path.join(hookDir,candidate)))).then(results=>results.some(Boolean)))throw Error(`handler.ts/handler.js/index.ts/index.js missing in ${hookDir}`)}async function installHookPackageFromDir(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),manifestPath=path.join(params.packageDir,`package.json`);if(!await fileExists(manifestPath))return{ok:!1,error:`package.json missing`};let manifest;try{manifest=await readJsonFile(manifestPath)}catch(err){return{ok:!1,error:`invalid package.json: ${String(err)}`}}let hookEntries;try{hookEntries=await ensureBuilderForceAgentsHooks(manifest)}catch(err){return{ok:!1,error:String(err)}}let pkgName=typeof manifest.name==`string`?manifest.name:``,hookPackId=pkgName?unscopedPackageName(pkgName):path.basename(params.packageDir),hookIdError=validateHookId(hookPackId);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookPackId)return{ok:!1,error:`hook pack id mismatch: expected ${params.expectedHookPackId}, got ${hookPackId}`};let targetDirResult=await resolveInstallTargetDir(hookPackId,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook pack already exists: ${targetDir} (delete it first)`};let resolvedHooks=[];for(let entry of hookEntries){let hookDir=path.resolve(params.packageDir,entry);await validateHookDir(hookDir);let hookName=await resolveHookNameFromDir(hookDir);resolvedHooks.push(hookName)}if(dryRun)return{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0};let deps=manifest.dependencies??{},hasDeps=Object.keys(deps).length>0,installRes=await installPackageDir({sourceDir:params.packageDir,targetDir,mode,timeoutMs,logger,copyErrorPrefix:`failed to copy hook pack`,hasDeps,depsLogMessage:`Installing hook pack dependencies…`});return installRes.ok?{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0}:installRes}async function installHookFromDir(params){let{logger,mode,dryRun}=resolveHookInstallModeOptions(params);await validateHookDir(params.hookDir);let hookName=await resolveHookNameFromDir(params.hookDir),hookIdError=validateHookId(hookName);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookName)return{ok:!1,error:`hook id mismatch: expected ${params.expectedHookPackId}, got ${hookName}`};let targetDirResult=await resolveInstallTargetDir(hookName,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook already exists: ${targetDir} (delete it first)`};if(dryRun)return{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir};logger.info?.(`Installing to ${targetDir}…`);let backupDir=null;mode===`update`&&await fileExists(targetDir)&&(backupDir=`${targetDir}.backup-${Date.now()}`,await fs$1.rename(targetDir,backupDir));try{await fs$1.cp(params.hookDir,targetDir,{recursive:!0})}catch(err){return backupDir&&(await fs$1.rm(targetDir,{recursive:!0,force:!0}).catch(()=>void 0),await fs$1.rename(backupDir,targetDir).catch(()=>void 0)),{ok:!1,error:`failed to copy hook: ${String(err)}`}}return backupDir&&await fs$1.rm(backupDir,{recursive:!0,force:!0}).catch(()=>void 0),{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir}}async function installHooksFromArchive(params){let logger=params.logger??defaultLogger,timeoutMs=params.timeoutMs??12e4,archivePathResult=await resolveArchiveSourcePath(params.archivePath);if(!archivePathResult.ok)return archivePathResult;let archivePath=archivePathResult.path;return await withTempDir(`builderforce-hook-`,async tmpDir=>{let extractDir=path.join(tmpDir,`extract`);await fs$1.mkdir(extractDir,{recursive:!0}),logger.info?.(`Extracting ${archivePath}…`);try{await extractArchive({archivePath,destDir:extractDir,timeoutMs,logger})}catch(err){return{ok:!1,error:`failed to extract archive: ${String(err)}`}}let rootDir=``;try{rootDir=await resolvePackedRootDir(extractDir)}catch(err){return{ok:!1,error:String(err)}}return await fileExists(path.join(rootDir,`package.json`))?await installHookPackageFromDir({packageDir:rootDir,hooksDir:params.hooksDir,timeoutMs,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:rootDir,hooksDir:params.hooksDir,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId})})}async function installHooksFromNpmSpec(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),expectedHookPackId=params.expectedHookPackId,spec=params.spec.trim(),specError=validateRegistryNpmSpec(spec);return specError?{ok:!1,error:specError}:await withTempDir(`builderforce-hook-pack-`,async tmpDir=>{logger.info?.(`Downloading ${spec}…`);let packedResult=await packNpmSpecToArchive({spec,timeoutMs,cwd:tmpDir});return packedResult.ok?await installHooksFromArchive({archivePath:packedResult.archivePath,hooksDir:params.hooksDir,timeoutMs,logger,mode,dryRun,expectedHookPackId}):packedResult})}async function installHooksFromPath(params){let resolved=resolveUserPath(params.path);return await fileExists(resolved)?(await fs$1.stat(resolved)).isDirectory()?await fileExists(path.join(resolved,`package.json`))?await installHookPackageFromDir({packageDir:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:resolved,hooksDir:params.hooksDir,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):resolveArchiveKind(resolved)?await installHooksFromArchive({archivePath:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):{ok:!1,error:`unsupported hook file: ${resolved}`}:{ok:!1,error:`path not found: ${resolved}`}}function recordHookInstall(cfg,update){let{hookId,...record}=update,installs={...cfg.hooks?.internal?.installs,[hookId]:{...cfg.hooks?.internal?.installs?.[hookId],...record,installedAt:record.installedAt??new Date().toISOString()}};return{...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,installs:{...installs,[hookId]:installs[hookId]}}}}}function mergeHookEntries(pluginEntries,workspaceEntries){let merged=new Map;for(let entry of pluginEntries)merged.set(entry.hook.name,entry);for(let entry of workspaceEntries)merged.set(entry.hook.name,entry);return Array.from(merged.values())}function buildHooksReport(config){let workspaceDir=resolveAgentWorkspaceDir(config,resolveDefaultAgentId(config)),workspaceEntries=loadWorkspaceHookEntries(workspaceDir,{config});return buildWorkspaceHookStatus(workspaceDir,{config,entries:mergeHookEntries(buildPluginStatusReport({config,workspaceDir}).hooks.map(hook=>hook.entry),workspaceEntries)})}function resolveHookForToggle(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName);if(!hook)throw Error(`Hook "${hookName}" not found`);if(hook.managedByPlugin)throw Error(`Hook "${hookName}" is managed by plugin "${hook.pluginId??`unknown`}" and cannot be enabled/disabled.`);if(opts?.requireEligible&&!hook.eligible)throw Error(`Hook "${hookName}" is not eligible (missing requirements)`);return hook}function buildConfigWithHookEnabled(params){let entries={...params.config.hooks?.internal?.entries};entries[params.hookName]={...entries[params.hookName],enabled:params.enabled};let internal={...params.config.hooks?.internal,...params.ensureHooksEnabled?{enabled:!0}:{},entries};return{...params.config,hooks:{...params.config.hooks,internal}}}function formatHookStatus(hook){return hook.eligible?theme.success(`✓ ready`):hook.disabled?theme.warn(`⏸ disabled`):theme.error(`✗ missing`)}function formatHookName(hook){return`${hook.emoji??`🔗`} ${theme.command(hook.name)}`}function formatHookSource(hook){return hook.managedByPlugin?`plugin:${hook.pluginId??`unknown`}`:hook.source}function formatHookMissingSummary(hook){let missing=[];return hook.missing.bins.length>0&&missing.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&missing.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&missing.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&missing.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&missing.push(`os: ${hook.missing.os.join(`, `)}`),missing.join(`; `)}function exitHooksCliWithError(err){defaultRuntime.error(`${theme.error(`Error:`)} ${err instanceof Error?err.message:String(err)}`),process.exit(1)}async function runHooksCliAction(action){try{await action()}catch(err){exitHooksCliWithError(err)}}function createInstallLogger(){return{info:msg=>defaultRuntime.log(msg),warn:msg=>defaultRuntime.log(theme.warn(msg))}}function logGatewayRestartHint(){defaultRuntime.log(`Restart the gateway to load hooks.`)}async function readInstalledPackageVersion(dir){try{let raw=await fs$1.readFile(path.join(dir,`package.json`),`utf-8`),parsed=JSON.parse(raw);return typeof parsed.version==`string`?parsed.version:void 0}catch{return}}function enableInternalHookEntries(config,hookNames){let entries={...config.hooks?.internal?.entries};for(let hookName of hookNames)entries[hookName]={...entries[hookName],enabled:!0};return{...config,hooks:{...config.hooks,internal:{...config.hooks?.internal,enabled:!0,entries}}}}function formatHooksList(report,opts){let hooks=opts.eligible?report.hooks.filter(h=>h.eligible):report.hooks;if(opts.json){let jsonReport={workspaceDir:report.workspaceDir,managedHooksDir:report.managedHooksDir,hooks:hooks.map(h=>({name:h.name,description:h.description,emoji:h.emoji,eligible:h.eligible,disabled:h.disabled,source:h.source,pluginId:h.pluginId,events:h.events,homepage:h.homepage,missing:h.missing,managedByPlugin:h.managedByPlugin}))};return JSON.stringify(jsonReport,null,2)}if(hooks.length===0)return opts.eligible?`No eligible hooks found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see all hooks.`:`No hooks found.`;let eligible=hooks.filter(h=>h.eligible),tableWidth=Math.max(60,(process.stdout.columns??120)-1),rows=hooks.map(hook=>{let missing=formatHookMissingSummary(hook);return{Status:formatHookStatus(hook),Hook:formatHookName(hook),Description:theme.muted(hook.description),Source:formatHookSource(hook),Missing:missing?theme.warn(missing):``}}),columns=[{key:`Status`,header:`Status`,minWidth:10},{key:`Hook`,header:`Hook`,minWidth:18,flex:!0},{key:`Description`,header:`Description`,minWidth:24,flex:!0},{key:`Source`,header:`Source`,minWidth:12,flex:!0}];opts.verbose&&columns.push({key:`Missing`,header:`Missing`,minWidth:18,flex:!0});let lines=[];return lines.push(`${theme.heading(`Hooks`)} ${theme.muted(`(${eligible.length}/${hooks.length} ready)`)}`),lines.push(renderTable({width:tableWidth,columns,rows}).trimEnd()),lines.join(`
1
+ import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import{S as shortenHomePath,t as CONFIG_DIR,y as resolveUserPath,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import{c as resolveAgentWorkspaceDir,l as resolveDefaultAgentId}from"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import{c as writeConfigFile,r as loadConfig}from"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import{n as MANIFEST_KEY,t as LEGACY_MANIFEST_KEYS}from"./legacy-names-DloW84CJ.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-m_x-JRkR.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import{n as loadWorkspaceHookEntries,o as parseFrontmatter}from"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import{t as formatDocsLink}from"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import{a as extractArchive,c as resolveArchiveKind,i as unscopedPackageName,l as resolvePackedRootDir,o as fileExists,s as readJsonFile,t as resolveSafeInstallDir}from"./install-safe-path-ObPl6zIf.js";import{a as installPackageDir,i as withTempDir,n as packNpmSpecToArchive,r as resolveArchiveSourcePath,t as validateRegistryNpmSpec}from"./npm-registry-spec-BV1VDmuN.js";import{t as renderTable}from"./table-BFCCZDsp.js";import{t as buildWorkspaceHookStatus}from"./hooks-status-B_bszx_E.js";import{t as buildPluginStatusReport}from"./status-DpEUFAMk.js";import path from"node:path";import fs from"node:fs";import fs$1 from"node:fs/promises";const defaultLogger={};function validateHookId(hookId){return hookId?hookId===`.`||hookId===`..`?`invalid hook name: reserved path segment`:hookId.includes(`/`)||hookId.includes(`\\`)?`invalid hook name: path separators not allowed`:null:`invalid hook name: missing`}function resolveHookInstallDir(hookId,hooksDir){let hooksBase=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`),hookIdError=validateHookId(hookId);if(hookIdError)throw Error(hookIdError);let targetDirResult=resolveSafeInstallDir({baseDir:hooksBase,id:hookId,invalidNameMessage:`invalid hook name: path traversal detected`});if(!targetDirResult.ok)throw Error(targetDirResult.error);return targetDirResult.path}async function ensureBuilderForceAgentsHooks(manifest){let hooks=(manifest[MANIFEST_KEY]??LEGACY_MANIFEST_KEYS.map(k=>manifest[k]).find(Boolean))?.hooks;if(!Array.isArray(hooks))throw Error(`package.json missing builderforce.hooks`);let list=hooks.map(e=>typeof e==`string`?e.trim():``).filter(Boolean);if(list.length===0)throw Error(`package.json builderforce.hooks is empty`);return list}function resolveHookInstallModeOptions(params){return{logger:params.logger??defaultLogger,mode:params.mode??`install`,dryRun:params.dryRun??!1}}function resolveTimedHookInstallModeOptions(params){return{...resolveHookInstallModeOptions(params),timeoutMs:params.timeoutMs??12e4}}async function resolveInstallTargetDir(id,hooksDir){let baseHooksDir=hooksDir?resolveUserPath(hooksDir):path.join(CONFIG_DIR,`hooks`);await fs$1.mkdir(baseHooksDir,{recursive:!0});let targetDirResult=resolveSafeInstallDir({baseDir:baseHooksDir,id,invalidNameMessage:`invalid hook name: path traversal detected`});return targetDirResult.ok?{ok:!0,targetDir:targetDirResult.path}:{ok:!1,error:targetDirResult.error}}async function resolveHookNameFromDir(hookDir){let hookMdPath=path.join(hookDir,`HOOK.md`);if(!await fileExists(hookMdPath))throw Error(`HOOK.md missing in ${hookDir}`);return parseFrontmatter(await fs$1.readFile(hookMdPath,`utf-8`)).name||path.basename(hookDir)}async function validateHookDir(hookDir){if(!await fileExists(path.join(hookDir,`HOOK.md`)))throw Error(`HOOK.md missing in ${hookDir}`);if(!await Promise.all([`handler.ts`,`handler.js`,`index.ts`,`index.js`].map(async candidate=>fileExists(path.join(hookDir,candidate)))).then(results=>results.some(Boolean)))throw Error(`handler.ts/handler.js/index.ts/index.js missing in ${hookDir}`)}async function installHookPackageFromDir(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),manifestPath=path.join(params.packageDir,`package.json`);if(!await fileExists(manifestPath))return{ok:!1,error:`package.json missing`};let manifest;try{manifest=await readJsonFile(manifestPath)}catch(err){return{ok:!1,error:`invalid package.json: ${String(err)}`}}let hookEntries;try{hookEntries=await ensureBuilderForceAgentsHooks(manifest)}catch(err){return{ok:!1,error:String(err)}}let pkgName=typeof manifest.name==`string`?manifest.name:``,hookPackId=pkgName?unscopedPackageName(pkgName):path.basename(params.packageDir),hookIdError=validateHookId(hookPackId);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookPackId)return{ok:!1,error:`hook pack id mismatch: expected ${params.expectedHookPackId}, got ${hookPackId}`};let targetDirResult=await resolveInstallTargetDir(hookPackId,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook pack already exists: ${targetDir} (delete it first)`};let resolvedHooks=[];for(let entry of hookEntries){let hookDir=path.resolve(params.packageDir,entry);await validateHookDir(hookDir);let hookName=await resolveHookNameFromDir(hookDir);resolvedHooks.push(hookName)}if(dryRun)return{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0};let deps=manifest.dependencies??{},hasDeps=Object.keys(deps).length>0,installRes=await installPackageDir({sourceDir:params.packageDir,targetDir,mode,timeoutMs,logger,copyErrorPrefix:`failed to copy hook pack`,hasDeps,depsLogMessage:`Installing hook pack dependencies…`});return installRes.ok?{ok:!0,hookPackId,hooks:resolvedHooks,targetDir,version:typeof manifest.version==`string`?manifest.version:void 0}:installRes}async function installHookFromDir(params){let{logger,mode,dryRun}=resolveHookInstallModeOptions(params);await validateHookDir(params.hookDir);let hookName=await resolveHookNameFromDir(params.hookDir),hookIdError=validateHookId(hookName);if(hookIdError)return{ok:!1,error:hookIdError};if(params.expectedHookPackId&&params.expectedHookPackId!==hookName)return{ok:!1,error:`hook id mismatch: expected ${params.expectedHookPackId}, got ${hookName}`};let targetDirResult=await resolveInstallTargetDir(hookName,params.hooksDir);if(!targetDirResult.ok)return{ok:!1,error:targetDirResult.error};let targetDir=targetDirResult.targetDir;if(mode===`install`&&await fileExists(targetDir))return{ok:!1,error:`hook already exists: ${targetDir} (delete it first)`};if(dryRun)return{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir};logger.info?.(`Installing to ${targetDir}…`);let backupDir=null;mode===`update`&&await fileExists(targetDir)&&(backupDir=`${targetDir}.backup-${Date.now()}`,await fs$1.rename(targetDir,backupDir));try{await fs$1.cp(params.hookDir,targetDir,{recursive:!0})}catch(err){return backupDir&&(await fs$1.rm(targetDir,{recursive:!0,force:!0}).catch(()=>void 0),await fs$1.rename(backupDir,targetDir).catch(()=>void 0)),{ok:!1,error:`failed to copy hook: ${String(err)}`}}return backupDir&&await fs$1.rm(backupDir,{recursive:!0,force:!0}).catch(()=>void 0),{ok:!0,hookPackId:hookName,hooks:[hookName],targetDir}}async function installHooksFromArchive(params){let logger=params.logger??defaultLogger,timeoutMs=params.timeoutMs??12e4,archivePathResult=await resolveArchiveSourcePath(params.archivePath);if(!archivePathResult.ok)return archivePathResult;let archivePath=archivePathResult.path;return await withTempDir(`builderforce-hook-`,async tmpDir=>{let extractDir=path.join(tmpDir,`extract`);await fs$1.mkdir(extractDir,{recursive:!0}),logger.info?.(`Extracting ${archivePath}…`);try{await extractArchive({archivePath,destDir:extractDir,timeoutMs,logger})}catch(err){return{ok:!1,error:`failed to extract archive: ${String(err)}`}}let rootDir=``;try{rootDir=await resolvePackedRootDir(extractDir)}catch(err){return{ok:!1,error:String(err)}}return await fileExists(path.join(rootDir,`package.json`))?await installHookPackageFromDir({packageDir:rootDir,hooksDir:params.hooksDir,timeoutMs,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:rootDir,hooksDir:params.hooksDir,logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId})})}async function installHooksFromNpmSpec(params){let{logger,timeoutMs,mode,dryRun}=resolveTimedHookInstallModeOptions(params),expectedHookPackId=params.expectedHookPackId,spec=params.spec.trim(),specError=validateRegistryNpmSpec(spec);return specError?{ok:!1,error:specError}:await withTempDir(`builderforce-hook-pack-`,async tmpDir=>{logger.info?.(`Downloading ${spec}…`);let packedResult=await packNpmSpecToArchive({spec,timeoutMs,cwd:tmpDir});return packedResult.ok?await installHooksFromArchive({archivePath:packedResult.archivePath,hooksDir:params.hooksDir,timeoutMs,logger,mode,dryRun,expectedHookPackId}):packedResult})}async function installHooksFromPath(params){let resolved=resolveUserPath(params.path);return await fileExists(resolved)?(await fs$1.stat(resolved)).isDirectory()?await fileExists(path.join(resolved,`package.json`))?await installHookPackageFromDir({packageDir:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):await installHookFromDir({hookDir:resolved,hooksDir:params.hooksDir,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):resolveArchiveKind(resolved)?await installHooksFromArchive({archivePath:resolved,hooksDir:params.hooksDir,timeoutMs:params.timeoutMs,logger:params.logger,mode:params.mode,dryRun:params.dryRun,expectedHookPackId:params.expectedHookPackId}):{ok:!1,error:`unsupported hook file: ${resolved}`}:{ok:!1,error:`path not found: ${resolved}`}}function recordHookInstall(cfg,update){let{hookId,...record}=update,installs={...cfg.hooks?.internal?.installs,[hookId]:{...cfg.hooks?.internal?.installs?.[hookId],...record,installedAt:record.installedAt??new Date().toISOString()}};return{...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,installs:{...installs,[hookId]:installs[hookId]}}}}}function mergeHookEntries(pluginEntries,workspaceEntries){let merged=new Map;for(let entry of pluginEntries)merged.set(entry.hook.name,entry);for(let entry of workspaceEntries)merged.set(entry.hook.name,entry);return Array.from(merged.values())}function buildHooksReport(config){let workspaceDir=resolveAgentWorkspaceDir(config,resolveDefaultAgentId(config)),workspaceEntries=loadWorkspaceHookEntries(workspaceDir,{config});return buildWorkspaceHookStatus(workspaceDir,{config,entries:mergeHookEntries(buildPluginStatusReport({config,workspaceDir}).hooks.map(hook=>hook.entry),workspaceEntries)})}function resolveHookForToggle(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName);if(!hook)throw Error(`Hook "${hookName}" not found`);if(hook.managedByPlugin)throw Error(`Hook "${hookName}" is managed by plugin "${hook.pluginId??`unknown`}" and cannot be enabled/disabled.`);if(opts?.requireEligible&&!hook.eligible)throw Error(`Hook "${hookName}" is not eligible (missing requirements)`);return hook}function buildConfigWithHookEnabled(params){let entries={...params.config.hooks?.internal?.entries};entries[params.hookName]={...entries[params.hookName],enabled:params.enabled};let internal={...params.config.hooks?.internal,...params.ensureHooksEnabled?{enabled:!0}:{},entries};return{...params.config,hooks:{...params.config.hooks,internal}}}function formatHookStatus(hook){return hook.eligible?theme.success(`✓ ready`):hook.disabled?theme.warn(`⏸ disabled`):theme.error(`✗ missing`)}function formatHookName(hook){return`${hook.emoji??`🔗`} ${theme.command(hook.name)}`}function formatHookSource(hook){return hook.managedByPlugin?`plugin:${hook.pluginId??`unknown`}`:hook.source}function formatHookMissingSummary(hook){let missing=[];return hook.missing.bins.length>0&&missing.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&missing.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&missing.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&missing.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&missing.push(`os: ${hook.missing.os.join(`, `)}`),missing.join(`; `)}function exitHooksCliWithError(err){defaultRuntime.error(`${theme.error(`Error:`)} ${err instanceof Error?err.message:String(err)}`),process.exit(1)}async function runHooksCliAction(action){try{await action()}catch(err){exitHooksCliWithError(err)}}function createInstallLogger(){return{info:msg=>defaultRuntime.log(msg),warn:msg=>defaultRuntime.log(theme.warn(msg))}}function logGatewayRestartHint(){defaultRuntime.log(`Restart the gateway to load hooks.`)}async function readInstalledPackageVersion(dir){try{let raw=await fs$1.readFile(path.join(dir,`package.json`),`utf-8`),parsed=JSON.parse(raw);return typeof parsed.version==`string`?parsed.version:void 0}catch{return}}function enableInternalHookEntries(config,hookNames){let entries={...config.hooks?.internal?.entries};for(let hookName of hookNames)entries[hookName]={...entries[hookName],enabled:!0};return{...config,hooks:{...config.hooks,internal:{...config.hooks?.internal,enabled:!0,entries}}}}function formatHooksList(report,opts){let hooks=opts.eligible?report.hooks.filter(h=>h.eligible):report.hooks;if(opts.json){let jsonReport={workspaceDir:report.workspaceDir,managedHooksDir:report.managedHooksDir,hooks:hooks.map(h=>({name:h.name,description:h.description,emoji:h.emoji,eligible:h.eligible,disabled:h.disabled,source:h.source,pluginId:h.pluginId,events:h.events,homepage:h.homepage,missing:h.missing,managedByPlugin:h.managedByPlugin}))};return JSON.stringify(jsonReport,null,2)}if(hooks.length===0)return opts.eligible?`No eligible hooks found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see all hooks.`:`No hooks found.`;let eligible=hooks.filter(h=>h.eligible),tableWidth=Math.max(60,(process.stdout.columns??120)-1),rows=hooks.map(hook=>{let missing=formatHookMissingSummary(hook);return{Status:formatHookStatus(hook),Hook:formatHookName(hook),Description:theme.muted(hook.description),Source:formatHookSource(hook),Missing:missing?theme.warn(missing):``}}),columns=[{key:`Status`,header:`Status`,minWidth:10},{key:`Hook`,header:`Hook`,minWidth:18,flex:!0},{key:`Description`,header:`Description`,minWidth:24,flex:!0},{key:`Source`,header:`Source`,minWidth:12,flex:!0}];opts.verbose&&columns.push({key:`Missing`,header:`Missing`,minWidth:18,flex:!0});let lines=[];return lines.push(`${theme.heading(`Hooks`)} ${theme.muted(`(${eligible.length}/${hooks.length} ready)`)}`),lines.push(renderTable({width:tableWidth,columns,rows}).trimEnd()),lines.join(`
2
2
  `)}function formatHookInfo(report,hookName,opts){let hook=report.hooks.find(h=>h.name===hookName||h.hookKey===hookName);if(!hook)return opts.json?JSON.stringify({error:`not found`,hook:hookName},null,2):`Hook "${hookName}" not found. Run \`${formatCliCommand(`builderforce hooks list`)}\` to see available hooks.`;if(opts.json)return JSON.stringify(hook,null,2);let lines=[],emoji=hook.emoji??`🔗`,status=hook.eligible?theme.success(`✓ Ready`):hook.disabled?theme.warn(`⏸ Disabled`):theme.error(`✗ Missing requirements`);if(lines.push(`${emoji} ${theme.heading(hook.name)} ${status}`),lines.push(``),lines.push(hook.description),lines.push(``),lines.push(theme.heading(`Details:`)),hook.managedByPlugin?lines.push(`${theme.muted(` Source:`)} ${hook.source} (${hook.pluginId??`unknown`})`):lines.push(`${theme.muted(` Source:`)} ${hook.source}`),lines.push(`${theme.muted(` Path:`)} ${shortenHomePath(hook.filePath)}`),lines.push(`${theme.muted(` Handler:`)} ${shortenHomePath(hook.handlerPath)}`),hook.homepage&&lines.push(`${theme.muted(` Homepage:`)} ${hook.homepage}`),hook.events.length>0&&lines.push(`${theme.muted(` Events:`)} ${hook.events.join(`, `)}`),hook.managedByPlugin&&lines.push(theme.muted(` Managed by plugin; enable/disable via hooks CLI not available.`)),hook.requirements.bins.length>0||hook.requirements.anyBins.length>0||hook.requirements.env.length>0||hook.requirements.config.length>0||hook.requirements.os.length>0){if(lines.push(``),lines.push(theme.heading(`Requirements:`)),hook.requirements.bins.length>0){let binsStatus=hook.requirements.bins.map(bin=>hook.missing.bins.includes(bin)?theme.error(`✗ ${bin}`):theme.success(`✓ ${bin}`));lines.push(`${theme.muted(` Binaries:`)} ${binsStatus.join(`, `)}`)}if(hook.requirements.anyBins.length>0){let anyBinsStatus=hook.missing.anyBins.length>0?theme.error(`✗ (any of: ${hook.requirements.anyBins.join(`, `)})`):theme.success(`✓ (any of: ${hook.requirements.anyBins.join(`, `)})`);lines.push(`${theme.muted(` Any binary:`)} ${anyBinsStatus}`)}if(hook.requirements.env.length>0){let envStatus=hook.requirements.env.map(env=>hook.missing.env.includes(env)?theme.error(`✗ ${env}`):theme.success(`✓ ${env}`));lines.push(`${theme.muted(` Environment:`)} ${envStatus.join(`, `)}`)}if(hook.requirements.config.length>0){let configStatus=hook.configChecks.map(check=>check.satisfied?theme.success(`✓ ${check.path}`):theme.error(`✗ ${check.path}`));lines.push(`${theme.muted(` Config:`)} ${configStatus.join(`, `)}`)}if(hook.requirements.os.length>0){let osStatus=hook.missing.os.length>0?theme.error(`✗ (${hook.requirements.os.join(`, `)})`):theme.success(`✓ (${hook.requirements.os.join(`, `)})`);lines.push(`${theme.muted(` OS:`)} ${osStatus}`)}}return lines.join(`
3
3
  `)}function formatHooksCheck(report,opts){if(opts.json){let eligible=report.hooks.filter(h=>h.eligible),notEligible=report.hooks.filter(h=>!h.eligible);return JSON.stringify({total:report.hooks.length,eligible:eligible.length,notEligible:notEligible.length,hooks:{eligible:eligible.map(h=>h.name),notEligible:notEligible.map(h=>({name:h.name,missing:h.missing}))}},null,2)}let eligible=report.hooks.filter(h=>h.eligible),notEligible=report.hooks.filter(h=>!h.eligible),lines=[];if(lines.push(theme.heading(`Hooks Status`)),lines.push(``),lines.push(`${theme.muted(`Total hooks:`)} ${report.hooks.length}`),lines.push(`${theme.success(`Ready:`)} ${eligible.length}`),lines.push(`${theme.warn(`Not ready:`)} ${notEligible.length}`),notEligible.length>0){lines.push(``),lines.push(theme.heading(`Hooks not ready:`));for(let hook of notEligible){let reasons=[];hook.disabled&&reasons.push(`disabled`),hook.missing.bins.length>0&&reasons.push(`bins: ${hook.missing.bins.join(`, `)}`),hook.missing.anyBins.length>0&&reasons.push(`anyBins: ${hook.missing.anyBins.join(`, `)}`),hook.missing.env.length>0&&reasons.push(`env: ${hook.missing.env.join(`, `)}`),hook.missing.config.length>0&&reasons.push(`config: ${hook.missing.config.join(`, `)}`),hook.missing.os.length>0&&reasons.push(`os: ${hook.missing.os.join(`, `)}`),lines.push(` ${hook.emoji??`🔗`} ${hook.name} - ${reasons.join(`; `)}`)}}return lines.join(`
4
4
  `)}async function enableHook(hookName){let config=loadConfig(),hook=resolveHookForToggle(buildHooksReport(config),hookName,{requireEligible:!0});await writeConfigFile(buildConfigWithHookEnabled({config,hookName,enabled:!0,ensureHooksEnabled:!0})),defaultRuntime.log(`${theme.success(`✓`)} Enabled hook: ${hook.emoji??`🔗`} ${theme.command(hookName)}`)}async function disableHook(hookName){let config=loadConfig(),hook=resolveHookForToggle(buildHooksReport(config),hookName);await writeConfigFile(buildConfigWithHookEnabled({config,hookName,enabled:!1})),defaultRuntime.log(`${theme.warn(`⏸`)} Disabled hook: ${hook.emoji??`🔗`} ${theme.command(hookName)}`)}function registerHooksCli(program){let hooks=program.command(`hooks`).description(`Manage internal agent hooks`).addHelpText(`after`,()=>`\n${theme.muted(`Docs:`)} ${formatDocsLink(`/cli/hooks`,`docs.builderforce.ai/cli/hooks`)}\n`);hooks.command(`list`).description(`List all hooks`).option(`--eligible`,`Show only eligible hooks`,!1).option(`--json`,`Output as JSON`,!1).option(`-v, --verbose`,`Show more details including missing requirements`,!1).action(async opts=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksList(report,opts))})),hooks.command(`info <name>`).description(`Show detailed information about a hook`).option(`--json`,`Output as JSON`,!1).action(async(name,opts)=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHookInfo(report,name,opts))})),hooks.command(`check`).description(`Check hooks eligibility status`).option(`--json`,`Output as JSON`,!1).action(async opts=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksCheck(report,opts))})),hooks.command(`enable <name>`).description(`Enable a hook`).action(async name=>runHooksCliAction(async()=>{await enableHook(name)})),hooks.command(`disable <name>`).description(`Disable a hook`).action(async name=>runHooksCliAction(async()=>{await disableHook(name)})),hooks.command(`install`).description(`Install a hook pack (path, archive, or npm spec)`).argument(`<path-or-spec>`,`Path to a hook pack or npm package spec`).option(`-l, --link`,`Link a local path instead of copying`,!1).action(async(raw,opts)=>{let resolved=resolveUserPath(raw),cfg=loadConfig();if(fs.existsSync(resolved)){if(opts.link){fs.statSync(resolved).isDirectory()||(defaultRuntime.error(`Linked hook paths must be directories.`),process.exit(1));let existing=cfg.hooks?.internal?.load?.extraDirs??[],merged=Array.from(new Set([...existing,resolved])),probe=await installHooksFromPath({path:resolved,dryRun:!0});probe.ok||(defaultRuntime.error(probe.error),process.exit(1));let next={...cfg,hooks:{...cfg.hooks,internal:{...cfg.hooks?.internal,enabled:!0,load:{...cfg.hooks?.internal?.load,extraDirs:merged}}}};next=enableInternalHookEntries(next,probe.hooks),next=recordHookInstall(next,{hookId:probe.hookPackId,source:`path`,sourcePath:resolved,installPath:resolved,version:probe.version,hooks:probe.hooks}),await writeConfigFile(next),defaultRuntime.log(`Linked hook path: ${shortenHomePath(resolved)}`),logGatewayRestartHint();return}let result=await installHooksFromPath({path:resolved,logger:createInstallLogger()});result.ok||(defaultRuntime.error(result.error),process.exit(1));let next=enableInternalHookEntries(cfg,result.hooks),source=resolveArchiveKind(resolved)?`archive`:`path`;next=recordHookInstall(next,{hookId:result.hookPackId,source,sourcePath:resolved,installPath:result.targetDir,version:result.version,hooks:result.hooks}),await writeConfigFile(next),defaultRuntime.log(`Installed hooks: ${result.hooks.join(`, `)}`),logGatewayRestartHint();return}opts.link&&(defaultRuntime.error("`--link` requires a local path."),process.exit(1)),(raw.startsWith(`.`)||raw.startsWith(`~`)||path.isAbsolute(raw)||raw.endsWith(`.zip`)||raw.endsWith(`.tgz`)||raw.endsWith(`.tar.gz`)||raw.endsWith(`.tar`))&&(defaultRuntime.error(`Path not found: ${resolved}`),process.exit(1));let result=await installHooksFromNpmSpec({spec:raw,logger:createInstallLogger()});result.ok||(defaultRuntime.error(result.error),process.exit(1));let next=enableInternalHookEntries(cfg,result.hooks);next=recordHookInstall(next,{hookId:result.hookPackId,source:`npm`,spec:raw,installPath:result.targetDir,version:result.version,hooks:result.hooks}),await writeConfigFile(next),defaultRuntime.log(`Installed hooks: ${result.hooks.join(`, `)}`),logGatewayRestartHint()}),hooks.command(`update`).description(`Update installed hooks (npm installs only)`).argument(`[id]`,`Hook pack id (omit with --all)`).option(`--all`,`Update all tracked hooks`,!1).option(`--dry-run`,`Show what would change without writing`,!1).action(async(id,opts)=>{let cfg=loadConfig(),installs=cfg.hooks?.internal?.installs??{},targets=opts.all?Object.keys(installs):id?[id]:[];targets.length===0&&(defaultRuntime.error(`Provide a hook id or use --all.`),process.exit(1));let nextCfg=cfg,updatedCount=0;for(let hookId of targets){let record=installs[hookId];if(!record){defaultRuntime.log(theme.warn(`No install record for "${hookId}".`));continue}if(record.source!==`npm`){defaultRuntime.log(theme.warn(`Skipping "${hookId}" (source: ${record.source}).`));continue}if(!record.spec){defaultRuntime.log(theme.warn(`Skipping "${hookId}" (missing npm spec).`));continue}let installPath;try{installPath=record.installPath??resolveHookInstallDir(hookId)}catch(err){defaultRuntime.log(theme.error(`Invalid install path for "${hookId}": ${String(err)}`));continue}let currentVersion=await readInstalledPackageVersion(installPath);if(opts.dryRun){let probe=await installHooksFromNpmSpec({spec:record.spec,mode:`update`,dryRun:!0,expectedHookPackId:hookId,logger:createInstallLogger()});if(!probe.ok){defaultRuntime.log(theme.error(`Failed to check ${hookId}: ${probe.error}`));continue}let nextVersion=probe.version??`unknown`,currentLabel=currentVersion??`unknown`;currentVersion&&probe.version&&currentVersion===probe.version?defaultRuntime.log(`${hookId} is up to date (${currentLabel}).`):defaultRuntime.log(`Would update ${hookId}: ${currentLabel} → ${nextVersion}.`);continue}let result=await installHooksFromNpmSpec({spec:record.spec,mode:`update`,expectedHookPackId:hookId,logger:createInstallLogger()});if(!result.ok){defaultRuntime.log(theme.error(`Failed to update ${hookId}: ${result.error}`));continue}let nextVersion=result.version??await readInstalledPackageVersion(result.targetDir);nextCfg=recordHookInstall(nextCfg,{hookId,source:`npm`,spec:record.spec,installPath:result.targetDir,version:nextVersion,hooks:result.hooks}),updatedCount+=1;let currentLabel=currentVersion??`unknown`,nextLabel=nextVersion??`unknown`;currentVersion&&nextVersion&&currentVersion===nextVersion?defaultRuntime.log(`${hookId} already at ${currentLabel}.`):defaultRuntime.log(`Updated ${hookId}: ${currentLabel} → ${nextLabel}.`)}updatedCount>0&&(await writeConfigFile(nextCfg),logGatewayRestartHint())}),hooks.action(async()=>runHooksCliAction(async()=>{let report=buildHooksReport(loadConfig());defaultRuntime.log(formatHooksList(report,{}))}))}export{registerHooksCli};
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import"./paths-5FcIFMsj.js";import{B as theme,E as toWhatsappJid,P as setVerbose,h as normalizeE164,l as escapeRegExp,n as assertWebChannel,z as isRich}from"./utils-DbaBVFaK.js";import"./embedded-helpers-2fP2Yq8h.js";import{It as resolveCommitHash,t as getReplyFromConfig}from"./reply-D9wUWhMx.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import{a as enableConsoleCapture,i as defaultRuntime,p as visibleWidth}from"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import{n as runExec,t as runCommandWithTimeout}from"./exec-DdcIjeyn.js";import"./agent-scope-DPtjOxzp.js";import"./src-CA0fU67C.js";import"./model-selection-Doyvd4lU.js";import{n as replaceCliName,r as resolveCliName}from"./command-format-D806O2pt.js";import"./env-file-D1MDi-AM.js";import"./boolean-Cnh1KNl1.js";import{r as normalizeEnv,t as isTruthyEnvValue}from"./env-BIdU5BAp.js";import"./src-BifagO7i.js";import{G as loadDotEnv,U as VERSION,r as loadConfig}from"./io-BNtgT4VB.js";import"./manifest-registry-BJCfNV1a.js";import"./config-BD801bpx.js";import{F as applyTemplate,c as installUnhandledRejectionHandler,d as reportAndExit,u as installUncaughtExceptionHandler}from"./runner-C3k1sKdu.js";import"./model-catalog-BoiWqBTw.js";import"./sandbox-1jtP0nhr.js";import"./chrome-Bfprrnm1.js";import{l as ensureBinary,u as promptYesNo}from"./tailscale-DLkpGquM.js";import"./auth-lebUHrkd.js";import"./server-context-DKdrUePN.js";import"./frontmatter-3D1EdC1L.js";import"./skills-Ba4ftrB-.js";import"./plugin-skills-B11rggZh.js";import"./routes-CRrqIFJR.js";import"./redact-BHdfp2MZ.js";import"./errors-B1MIg3g-.js";import"./paths-cR8ct-Y3.js";import"./ssrf-p9k-iapc.js";import"./image-ops-C8IUQKjn.js";import"./store-CmHBQ-yX.js";import{i as handlePortError,n as describePortOwner,r as ensurePortAvailable,t as PortInUseError}from"./ports-DgmEDNOm.js";import"./trash-DD2Hc5oq.js";import{O as deriveSessionKey,a as loadSessionStore,c as saveSessionStore,k as resolveSessionKey}from"./sessions-BPr0-lkT.js";import"./message-channel-D_jXxXQj.js";import"./plugins-D5zP6ENo.js";import"./accounts-o35LU_iy.js";import"./accounts-rmXEiebi.js";import"./accounts-BLueHgKj.js";import"./bindings-DR59065T.js";import"./send-l9WWK31e.js";import"./send-CVgJk5kN.js";import{c as resolveStorePath}from"./paths-DJ6rztqJ.js";import"./tool-images-B7b_OiMz.js";import"./tool-display-ByOZtWvA.js";import"./fetch-guard-8mwt3-hm.js";import"./api-key-rotation-Yn3MpU4F.js";import"./fetch-BuOLY9KP.js";import"./sqlite-C39E12XS.js";import"./tokens-CCU3zO-D.js";import"./project-context-store-Dbbjk8CQ.js";import"./with-timeout-CPd4-suw.js";import"./deliver-BiGCWHvZ.js";import"./send-CRSlal5z.js";import"./workspace-D4LK4thI.js";import"./reply-prefix-zIMgi6K6.js";import"./memory-cli-D-Khe5Ij.js";import"./manager-DNIg84rj.js";import"./retry-DlVhg5qu.js";import"./client-xfoidwPI.js";import"./call-CJq3iGqu.js";import"./common-BTbIhLyt.js";import"./chunk-FCBlVOyo.js";import"./markdown-tables-P6uoUSFa.js";import"./ir-5BNoIXZm.js";import"./render-D1dVTEB1.js";import"./builderforcellm-syscheck-Cp4LMft_.js";import"./send-D_6wd5Y3.js";import"./outbound-attachment-C7wByQO5.js";import"./fetch-DnVtDecb.js";import"./delivery-queue-CXKynF1P.js";import"./channel-activity-CCNDbdD3.js";import"./tables-ERcoWFDp.js";import"./pairing-store-C8gtsUDG.js";import{t as formatDocsLink}from"./links-BgWWaaOT.js";import"./cli-utils-LBYKdNFb.js";import"./help-format-Qfk2vDNX.js";import"./progress-BfOtdN6b.js";import"./resolve-route-D49haUnv.js";import"./replies-DAwcEPGb.js";import"./refresh-TiC_kLgE.js";import"./coding-tools.policy-COe2xa9K.js";import"./send-BIMaIwQV.js";import"./onboard-helpers-BmYUjl4j.js";import"./prompt-style-BpVK43GK.js";import"./pairing-labels-CD0lPAfY.js";import"./session-cost-usage-BjH7mxVj.js";import"./usage-format-DGf8ZWPH.js";import"./provider-usage-QGVVADJa.js";import"./active-listener-Dcg19lJG.js";import"./exec-approvals-BpVPDVtV.js";import"./nodes-screen-C3TDIi8d.js";import"./project-context-BLpMH93w.js";import"./control-service-DKBAemtq.js";import"./stagger-8EkqkqJv.js";import"./channel-selection-DyAvzlY8.js";import"./mamba-state-engine-BQuRdgMU.js";import"./transformers-stream-D7nRu4Qu.js";import{r as waitForever,t as monitorWebChannel}from"./channel-web-Ae15MleJ.js";import"./outbound-rhwRyIBV.js";import"./session-PaEB8NU_.js";import"./login-CHJf-aXX.js";import{t as createDefaultDeps}from"./deps-CGiO_NDu.js";import{t as isMainModule}from"./is-main-CC_O8ESS.js";import{t as ensureBuilderForceAgentsCliOnPath}from"./path-env-Cy9l1Ba9.js";import{t as assertSupportedRuntime}from"./runtime-guard-DhksRHci.js";import"./ports-ReH_tlKd.js";import{d as getVerboseFlag,f as hasHelpOrVersion,i as getCoreCliCommandsWithSubcommands,n as setProgramContext,o as registerProgramCommands,s as getSubCliCommandsWithSubcommands,u as getCommandPath}from"./program-context-DP4Xq9zC.js";import"./catalog-rgiY__UQ.js";import"./plugin-registry-BEmyRfmb.js";import{n as resolveCliChannelOptions}from"./channel-options-CiYpNR-1.js";import process$1 from"node:process";import{fileURLToPath}from"node:url";import{Command}from"commander";function createProgramContext(){let channelOptions=resolveCliChannelOptions();return{programVersion:VERSION,channelOptions,messageChannelOptions:channelOptions.join(`|`),agentChannelOptions:[`last`,...channelOptions].join(`|`)}}const DEFAULT_TAGLINE=`All your chats, one BuilderForceAgents.`,HOLIDAY_TAGLINES={newYear:`New Year's Day: New year, new config—same old EADDRINUSE, but this time we resolve it like grown-ups.`,lunarNewYear:`Lunar New Year: May your builds be lucky, your branches prosperous, and your merge conflicts chased away with fireworks.`,christmas:`Christmas: Ho ho ho—Santa's little agentNode-sistant is here to ship joy, roll back chaos, and stash the keys safely.`,eid:`Eid al-Fitr: Celebration mode: queues cleared, tasks completed, and good vibes committed to main with clean history.`,diwali:`Diwali: Let the logs sparkle and the bugs flee—today we light up the terminal and ship with pride.`,easter:`Easter: I found your missing environment variable—consider it a tiny CLI egg hunt with fewer jellybeans.`,hanukkah:`Hanukkah: Eight nights, eight retries, zero shame—may your gateway stay lit and your deployments stay peaceful.`,halloween:`Halloween: Spooky season: beware haunted dependencies, cursed caches, and the ghost of node_modules past.`,thanksgiving:`Thanksgiving: Grateful for stable ports, working DNS, and a bot that reads the logs so nobody has to.`,valentines:`Valentine's Day: Roses are typed, violets are piped—I'll automate the chores so you can spend time with humans.`},TAGLINES=[`Your terminal just grew agentNodes—type something and let the bot pinch the busywork.`,`Welcome to the command line: where dreams compile and confidence segfaults.`,`I run on caffeine, JSON5, and the audacity of "it worked on my machine."`,`Gateway online—please keep hands, feet, and appendages inside the shell at all times.`,`I speak fluent bash, mild sarcasm, and aggressive tab-completion energy.`,`One CLI to rule them all, and one more restart because you changed the port.`,`If it works, it's automation; if it breaks, it's a "learning opportunity."`,`Pairing codes exist because even bots believe in consent—and good security hygiene.`,`Your .env is showing; don't worry, I'll pretend I didn't see it.`,`I'll do the boring stuff while you dramatically stare at the logs like it's cinema.`,`I'm not saying your workflow is chaotic... I'm just bringing a linter and a helmet.`,`Type the command with confidence—nature will provide the stack trace if needed.`,`I don't judge, but your missing API keys are absolutely judging you.`,`I can grep it, git blame it, and gently roast it—pick your coping mechanism.`,`Hot reload for config, cold sweat for deploys.`,`I'm the assistant your terminal demanded, not the one your sleep schedule requested.`,`I keep secrets like a vault... unless you print them in debug logs again.`,`Automation with agentNodes: minimal fuss, maximal pinch.`,`I'm basically a Swiss Army knife, but with more opinions and fewer sharp edges.`,`If you're lost, run doctor; if you're brave, run prod; if you're wise, run tests.`,`Your task has been queued; your dignity has been deprecated.`,`I can't fix your code taste, but I can fix your build and your backlog.`,`I'm not magic—I'm just extremely persistent with retries and coping strategies.`,`It's not "failing," it's "discovering new ways to configure the same thing wrong."`,`Give me a workspace and I'll give you fewer tabs, fewer toggles, and more oxygen.`,`I read logs so you can keep pretending you don't have to.`,`If something's on fire, I can't extinguish it—but I can write a beautiful postmortem.`,`I'll refactor your busywork like it owes me money.`,`Say "stop" and I'll stop—say "ship" and we'll both learn a lesson.`,`I'm the reason your shell history looks like a hacker-movie montage.`,`I'm like tmux: confusing at first, then suddenly you can't live without me.`,`I can run local, remote, or purely on vibes—results may vary with DNS.`,`If you can describe it, I can probably automate it—or at least make it funnier.`,`Your config is valid, your assumptions are not.`,`I don't just autocomplete—I auto-commit (emotionally), then ask you to review (logically).`,`Less clicking, more shipping, fewer "where did that file go" moments.`,`AgentNodes out, commit in—let's ship something mildly responsible.`,`If it's repetitive, I'll automate it; if it's hard, I'll bring jokes and a rollback plan.`,`Because texting yourself reminders is so 2024.`,`Your inbox, your infra, your rules.`,`Turning "I'll reply later" into "my bot replied instantly".`,`Chat automation for people who peaked at IRC.`,`Because Siri wasn't answering at 3AM.`,`IPC, but it's your phone.`,`The UNIX philosophy meets your DMs.`,`curl for conversations.`,`Less middlemen, more messages.`,`Ship fast, log faster.`,`End-to-end encrypted, drama-to-drama excluded.`,`The only bot that stays out of your training set.`,`WhatsApp automation without the "please accept our new privacy policy".`,`Chat APIs that don't require a Senate hearing.`,`Meta wishes they shipped this fast.`,`Because the right answer is usually a script.`,`Your messages, your servers, your control.`,`OpenAI-compatible, not OpenAI-dependent.`,`iMessage green bubble energy, but for everyone.`,`Siri's competent cousin.`,`Works on Android. Crazy concept, we know.`,`No $999 stand required.`,`We ship features faster than Apple ships calculator updates.`,`Your AI assistant, now without the $3,499 headset.`,`Think different. Actually think.`,`Ah, the fruit tree company! 🍎`,`Greetings, Professor Falken`,HOLIDAY_TAGLINES.newYear,HOLIDAY_TAGLINES.lunarNewYear,HOLIDAY_TAGLINES.christmas,HOLIDAY_TAGLINES.eid,HOLIDAY_TAGLINES.diwali,HOLIDAY_TAGLINES.easter,HOLIDAY_TAGLINES.hanukkah,HOLIDAY_TAGLINES.halloween,HOLIDAY_TAGLINES.thanksgiving,HOLIDAY_TAGLINES.valentines],DAY_MS=1440*60*1e3;function utcParts(date){return{year:date.getUTCFullYear(),month:date.getUTCMonth(),day:date.getUTCDate()}}const onMonthDay=(month,day)=>date=>{let parts=utcParts(date);return parts.month===month&&parts.day===day},onSpecificDates=(dates,durationDays=1)=>date=>{let parts=utcParts(date);return dates.some(([year,month,day])=>{if(parts.year!==year)return!1;let start=Date.UTC(year,month,day),current=Date.UTC(parts.year,parts.month,parts.day);return current>=start&&current<start+durationDays*DAY_MS})},HOLIDAY_RULES=new Map([[HOLIDAY_TAGLINES.newYear,onMonthDay(0,1)],[HOLIDAY_TAGLINES.lunarNewYear,onSpecificDates([[2025,0,29],[2026,1,17],[2027,1,6]],1)],[HOLIDAY_TAGLINES.eid,onSpecificDates([[2025,2,30],[2025,2,31],[2026,2,20],[2027,2,10]],1)],[HOLIDAY_TAGLINES.diwali,onSpecificDates([[2025,9,20],[2026,10,8],[2027,9,28]],1)],[HOLIDAY_TAGLINES.easter,onSpecificDates([[2025,3,20],[2026,3,5],[2027,2,28]],1)],[HOLIDAY_TAGLINES.hanukkah,(windows=>date=>{let parts=utcParts(date),window=windows.find(entry=>entry.year===parts.year);if(!window)return!1;let start=Date.UTC(window.year,window.month,window.day),current=Date.UTC(parts.year,parts.month,parts.day);return current>=start&&current<start+window.duration*DAY_MS})([{year:2025,month:11,day:15,duration:8},{year:2026,month:11,day:5,duration:8},{year:2027,month:11,day:25,duration:8}])],[HOLIDAY_TAGLINES.halloween,onMonthDay(9,31)],[HOLIDAY_TAGLINES.thanksgiving,date=>{let parts=utcParts(date);if(parts.month!==10)return!1;let fourthThursday=1+(4-new Date(Date.UTC(parts.year,10,1)).getUTCDay()+7)%7+21;return parts.day===fourthThursday}],[HOLIDAY_TAGLINES.valentines,onMonthDay(1,14)],[HOLIDAY_TAGLINES.christmas,onMonthDay(11,25)]]);function isTaglineActive(tagline,date){let rule=HOLIDAY_RULES.get(tagline);return rule?rule(date):!0}function activeTaglines(options={}){if(TAGLINES.length===0)return[DEFAULT_TAGLINE];let today=options.now?options.now():new Date,filtered=TAGLINES.filter(tagline=>isTaglineActive(tagline,today));return filtered.length>0?filtered:TAGLINES}function pickTagline(options={}){let override=(options.env??process.env)?.BUILDERFORCE_AGENTS_TAGLINE_INDEX;if(override!==void 0){let parsed=Number.parseInt(override,10);if(!Number.isNaN(parsed)&&parsed>=0){let pool=TAGLINES.length>0?TAGLINES:[DEFAULT_TAGLINE];return pool[parsed%pool.length]}}let pool=activeTaglines(options),rand=options.random??Math.random;return pool[Math.floor(rand()*pool.length)%pool.length]}let bannerEmitted=!1;const hasJsonFlag=argv=>argv.some(arg=>arg===`--json`||arg.startsWith(`--json=`)),hasVersionFlag=argv=>argv.some(arg=>arg===`--version`||arg===`-V`||arg===`-v`);function formatCliBannerLine(version,options={}){let commitLabel=options.commit??resolveCommitHash({env:options.env})??`local`,tagline=pickTagline(options),rich=options.richTty??isRich(),title=`BuilderForceAgents`,columns=options.columns??process.stdout.columns??120,plainFullLine=`${title} ${version} (${commitLabel}) — ${tagline}`,fitsOnOneLine=visibleWidth(plainFullLine)<=columns;return rich?fitsOnOneLine?`${theme.brand(title)} ${theme.brand(version)} ${theme.muted(`(${commitLabel})`)} ${theme.muted(`—`)} ${theme.brand(tagline)}`:`${`${theme.brand(title)} ${theme.brand(version)} ${theme.muted(`(${commitLabel})`)}`}\n${`${` `.repeat(0)}${theme.brand(tagline)}`}`:fitsOnOneLine?plainFullLine:`${`${title} ${version} (${commitLabel})`}\n${`${` `.repeat(0)}${tagline}`}`}function emitCliBanner(version,options={}){if(bannerEmitted)return;let argv=options.argv??process.argv;if(!process.stdout.isTTY||hasJsonFlag(argv)||hasVersionFlag(argv))return;let line=formatCliBannerLine(version,options);process.stdout.write(`\n${line}\n\n`),bannerEmitted=!0}function hasEmittedCliBanner(){return bannerEmitted}const CLI_NAME=resolveCliName(),CLI_NAME_PATTERN=escapeRegExp(CLI_NAME),ROOT_COMMANDS_WITH_SUBCOMMANDS=new Set([...getCoreCliCommandsWithSubcommands(),...getSubCliCommandsWithSubcommands()]),EXAMPLES=[[`builderforce models --help`,`Show detailed help for the models command.`],[`builderforce channels login --verbose`,`Link personal WhatsApp Web and show QR + connection logs.`],[`builderforce message send --target +15555550123 --message "Hi" --json`,`Send via your web session and print JSON result.`],[`builderforce gateway --port 18789`,`Run the WebSocket Gateway locally.`],[`builderforce --dev gateway`,`Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001.`],[`builderforce gateway --force`,`Kill anything bound to the default gateway port, then start it.`],[`builderforce gateway ...`,`Gateway control via WebSocket.`],[`builderforce agent --to +15555550123 --message "Run summary" --deliver`,`Talk directly to the agent using the Gateway; optionally send the WhatsApp reply.`],[`builderforce message send --channel telegram --target @mychat --message "Hi"`,`Send via your Telegram bot.`]];function configureProgramHelp(program,ctx){program.name(CLI_NAME).description(``).version(ctx.programVersion).option(`--dev`,`Dev profile: isolate state under ~/.builderforce-dev, default gateway port 19001, and shift derived ports (browser/canvas)`).option(`--profile <name>`,`Use a named profile (isolates BUILDERFORCE_AGENTS_STATE_DIR/BUILDERFORCE_AGENTS_CONFIG_PATH under ~/.builderforce-<name>)`),program.option(`--no-color`,`Disable ANSI colors`,!1),program.helpOption(`-h, --help`,`Display help for command`),program.helpCommand(`help [command]`,`Display help for command`),program.configureHelp({sortSubcommands:!0,sortOptions:!0,optionTerm:option=>theme.option(option.flags),subcommandTerm:cmd=>{let hasSubcommands=cmd.parent===program&&ROOT_COMMANDS_WITH_SUBCOMMANDS.has(cmd.name());return theme.command(hasSubcommands?`${cmd.name()} *`:cmd.name())}});let formatHelpOutput=str=>{let output=str;return RegExp(`^Usage:\\s+${CLI_NAME_PATTERN}\\s+\\[options\\]\\s+\\[command\\]\\s*$`,`m`).test(output)&&/^Commands:/m.test(output)&&(output=output.replace(/^Commands:/m,`Commands:\n ${theme.muted(`Hint: commands suffixed with * have subcommands. Run <command> --help for details.`)}`)),output.replace(/^Usage:/gm,theme.heading(`Usage:`)).replace(/^Options:/gm,theme.heading(`Options:`)).replace(/^Commands:/gm,theme.heading(`Commands:`))};program.configureOutput({writeOut:str=>{process.stdout.write(formatHelpOutput(str))},writeErr:str=>{process.stderr.write(formatHelpOutput(str))},outputError:(str,write)=>write(theme.error(str))}),(process.argv.includes(`-V`)||process.argv.includes(`--version`)||process.argv.includes(`-v`))&&(console.log(ctx.programVersion),process.exit(0)),program.addHelpText(`beforeAll`,()=>{if(hasEmittedCliBanner())return``;let rich=isRich();return`\n${formatCliBannerLine(ctx.programVersion,{richTty:rich})}\n`});let fmtExamples=EXAMPLES.map(([cmd,desc])=>` ${theme.command(replaceCliName(cmd,CLI_NAME))}\n ${theme.muted(desc)}`).join(`
3
- `);program.addHelpText(`afterAll`,({command})=>{if(command!==program)return``;let docs=formatDocsLink(`/cli`,`docs.builderforce.ai/cli`);return`\n${theme.heading(`Examples:`)}\n${fmtExamples}\n\n${theme.muted(`Docs:`)} ${docs}\n`})}function setProcessTitleForCommand(actionCommand){let current=actionCommand;for(;current.parent&&current.parent.parent;)current=current.parent;let name=current.name(),cliName=resolveCliName();!name||name===cliName||(process.title=`${cliName}-${name}`)}const PLUGIN_REQUIRED_COMMANDS=new Set([`message`,`channels`,`directory`]);function registerPreActionHooks(program,programVersion){program.hook(`preAction`,async(_thisCommand,actionCommand)=>{setProcessTitleForCommand(actionCommand);let argv=process.argv;if(hasHelpOrVersion(argv))return;let commandPath=getCommandPath(argv,2);isTruthyEnvValue(process.env.BUILDERFORCE_AGENTS_HIDE_BANNER)||commandPath[0]===`update`||commandPath[0]===`completion`||commandPath[0]===`plugins`&&commandPath[1]===`update`||emitCliBanner(programVersion);let verbose=getVerboseFlag(argv,{includeDebug:!0});if(setVerbose(verbose),verbose||(process.env.NODE_NO_WARNINGS??=`1`),commandPath[0]===`doctor`||commandPath[0]===`completion`)return;let{ensureConfigReady}=await import(`./config-guard-NVwfuI8C.js`);if(await ensureConfigReady({runtime:defaultRuntime,commandPath}),PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])){let{ensurePluginRegistryLoaded}=await import(`./plugin-registry-DtrHn5NR.js`);ensurePluginRegistryLoaded()}})}function buildProgram(){let program=new Command,ctx=createProgramContext(),argv=process.argv;return setProgramContext(program,ctx),configureProgramHelp(program,ctx),registerPreActionHooks(program,ctx.programVersion),registerProgramCommands(program,ctx,argv),program.option(`-m, --message <text>`,`Start a session and send this as the first message`).action(async opts=>{let{runBuilderForceAgentsSession}=await import(`./builderforce-Dl4bZ63C.js`);await runBuilderForceAgentsSession(process.cwd(),{message:opts.message})}),program}loadDotEnv({quiet:!0}),normalizeEnv(),ensureBuilderForceAgentsCliOnPath(),enableConsoleCapture(),assertSupportedRuntime();const program=buildProgram();isMainModule({currentFile:fileURLToPath(import.meta.url)})&&(installUnhandledRejectionHandler(),installUncaughtExceptionHandler(),program.parseAsync(process$1.argv).catch(err=>reportAndExit(err,{operation:`cli:parse`,label:`[builderforce] CLI failed:`})));export{PortInUseError,applyTemplate,assertWebChannel,createDefaultDeps,deriveSessionKey,describePortOwner,ensureBinary,ensurePortAvailable,getReplyFromConfig,handlePortError,loadConfig,loadSessionStore,monitorWebChannel,normalizeE164,promptYesNo,resolveSessionKey,resolveStorePath,runCommandWithTimeout,runExec,saveSessionStore,toWhatsappJid,waitForever};
2
+ import"./paths-5FcIFMsj.js";import{B as theme,E as toWhatsappJid,P as setVerbose,h as normalizeE164,l as escapeRegExp,n as assertWebChannel,z as isRich}from"./utils-DbaBVFaK.js";import"./embedded-helpers-2fP2Yq8h.js";import{It as resolveCommitHash,t as getReplyFromConfig}from"./reply-BuUSdq2L.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import{a as enableConsoleCapture,i as defaultRuntime,p as visibleWidth}from"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import{n as runExec,t as runCommandWithTimeout}from"./exec-DdcIjeyn.js";import"./agent-scope-DPtjOxzp.js";import"./src-CA0fU67C.js";import"./model-selection-Doyvd4lU.js";import{n as replaceCliName,r as resolveCliName}from"./command-format-D806O2pt.js";import"./env-file-D1MDi-AM.js";import"./boolean-Cnh1KNl1.js";import{r as normalizeEnv,t as isTruthyEnvValue}from"./env-BIdU5BAp.js";import"./src-BifagO7i.js";import{G as loadDotEnv,U as VERSION,r as loadConfig}from"./io-BNtgT4VB.js";import"./manifest-registry-BJCfNV1a.js";import"./config-BD801bpx.js";import{F as applyTemplate,c as installUnhandledRejectionHandler,d as reportAndExit,u as installUncaughtExceptionHandler}from"./runner-C3k1sKdu.js";import"./model-catalog-BoiWqBTw.js";import"./sandbox-1jtP0nhr.js";import"./chrome-Bfprrnm1.js";import{l as ensureBinary,u as promptYesNo}from"./tailscale-DLkpGquM.js";import"./auth-lebUHrkd.js";import"./server-context-DKdrUePN.js";import"./frontmatter-3D1EdC1L.js";import"./skills-Ba4ftrB-.js";import"./plugin-skills-B11rggZh.js";import"./routes-CRrqIFJR.js";import"./redact-BHdfp2MZ.js";import"./errors-B1MIg3g-.js";import"./paths-cR8ct-Y3.js";import"./ssrf-p9k-iapc.js";import"./image-ops-C8IUQKjn.js";import"./store-CmHBQ-yX.js";import{i as handlePortError,n as describePortOwner,r as ensurePortAvailable,t as PortInUseError}from"./ports-DgmEDNOm.js";import"./trash-DD2Hc5oq.js";import{O as deriveSessionKey,a as loadSessionStore,c as saveSessionStore,k as resolveSessionKey}from"./sessions-BPr0-lkT.js";import"./message-channel-D_jXxXQj.js";import"./plugins-D5zP6ENo.js";import"./accounts-o35LU_iy.js";import"./accounts-rmXEiebi.js";import"./accounts-BLueHgKj.js";import"./bindings-DR59065T.js";import"./send-l9WWK31e.js";import"./send-CVgJk5kN.js";import{c as resolveStorePath}from"./paths-DJ6rztqJ.js";import"./tool-images-B7b_OiMz.js";import"./tool-display-ByOZtWvA.js";import"./fetch-guard-8mwt3-hm.js";import"./api-key-rotation-Yn3MpU4F.js";import"./fetch-BuOLY9KP.js";import"./sqlite-C39E12XS.js";import"./tokens-CCU3zO-D.js";import"./project-context-store-Dbbjk8CQ.js";import"./with-timeout-CPd4-suw.js";import"./deliver-BiGCWHvZ.js";import"./send-CRSlal5z.js";import"./workspace-D4LK4thI.js";import"./reply-prefix-zIMgi6K6.js";import"./memory-cli-D-Khe5Ij.js";import"./manager-DNIg84rj.js";import"./retry-DlVhg5qu.js";import"./client-xfoidwPI.js";import"./call-CJq3iGqu.js";import"./common-BTbIhLyt.js";import"./chunk-FCBlVOyo.js";import"./markdown-tables-P6uoUSFa.js";import"./ir-5BNoIXZm.js";import"./render-D1dVTEB1.js";import"./builderforcellm-syscheck-Cp4LMft_.js";import"./send-D_6wd5Y3.js";import"./outbound-attachment-C7wByQO5.js";import"./fetch-DnVtDecb.js";import"./delivery-queue-CXKynF1P.js";import"./channel-activity-CCNDbdD3.js";import"./tables-ERcoWFDp.js";import"./pairing-store-C8gtsUDG.js";import{t as formatDocsLink}from"./links-BgWWaaOT.js";import"./cli-utils-LBYKdNFb.js";import"./help-format-Qfk2vDNX.js";import"./progress-BfOtdN6b.js";import"./resolve-route-D49haUnv.js";import"./replies-DAwcEPGb.js";import"./refresh-TiC_kLgE.js";import"./coding-tools.policy-COe2xa9K.js";import"./send-BIMaIwQV.js";import"./onboard-helpers-BmYUjl4j.js";import"./prompt-style-BpVK43GK.js";import"./pairing-labels-CD0lPAfY.js";import"./session-cost-usage-BjH7mxVj.js";import"./usage-format-DGf8ZWPH.js";import"./provider-usage-QGVVADJa.js";import"./active-listener-Dcg19lJG.js";import"./exec-approvals-BpVPDVtV.js";import"./nodes-screen-C3TDIi8d.js";import"./project-context-BLpMH93w.js";import"./control-service-DKBAemtq.js";import"./stagger-8EkqkqJv.js";import"./channel-selection-DyAvzlY8.js";import"./mamba-state-engine-BQuRdgMU.js";import"./transformers-stream-D7nRu4Qu.js";import{r as waitForever,t as monitorWebChannel}from"./channel-web-B5HSpL4k.js";import"./outbound-rhwRyIBV.js";import"./session-PaEB8NU_.js";import"./login-CHJf-aXX.js";import{t as createDefaultDeps}from"./deps-CrAVOWsA.js";import{t as isMainModule}from"./is-main-CC_O8ESS.js";import{t as ensureBuilderForceAgentsCliOnPath}from"./path-env-Cy9l1Ba9.js";import{t as assertSupportedRuntime}from"./runtime-guard-DhksRHci.js";import"./ports-ReH_tlKd.js";import{d as getVerboseFlag,f as hasHelpOrVersion,i as getCoreCliCommandsWithSubcommands,n as setProgramContext,o as registerProgramCommands,s as getSubCliCommandsWithSubcommands,u as getCommandPath}from"./program-context-BCTE8zEF.js";import"./catalog-rgiY__UQ.js";import"./plugin-registry-DrEpL5ac.js";import{n as resolveCliChannelOptions}from"./channel-options-CRng-5hZ.js";import process$1 from"node:process";import{fileURLToPath}from"node:url";import{Command}from"commander";function createProgramContext(){let channelOptions=resolveCliChannelOptions();return{programVersion:VERSION,channelOptions,messageChannelOptions:channelOptions.join(`|`),agentChannelOptions:[`last`,...channelOptions].join(`|`)}}const DEFAULT_TAGLINE=`All your chats, one BuilderForceAgents.`,HOLIDAY_TAGLINES={newYear:`New Year's Day: New year, new config—same old EADDRINUSE, but this time we resolve it like grown-ups.`,lunarNewYear:`Lunar New Year: May your builds be lucky, your branches prosperous, and your merge conflicts chased away with fireworks.`,christmas:`Christmas: Ho ho ho—Santa's little agentNode-sistant is here to ship joy, roll back chaos, and stash the keys safely.`,eid:`Eid al-Fitr: Celebration mode: queues cleared, tasks completed, and good vibes committed to main with clean history.`,diwali:`Diwali: Let the logs sparkle and the bugs flee—today we light up the terminal and ship with pride.`,easter:`Easter: I found your missing environment variable—consider it a tiny CLI egg hunt with fewer jellybeans.`,hanukkah:`Hanukkah: Eight nights, eight retries, zero shame—may your gateway stay lit and your deployments stay peaceful.`,halloween:`Halloween: Spooky season: beware haunted dependencies, cursed caches, and the ghost of node_modules past.`,thanksgiving:`Thanksgiving: Grateful for stable ports, working DNS, and a bot that reads the logs so nobody has to.`,valentines:`Valentine's Day: Roses are typed, violets are piped—I'll automate the chores so you can spend time with humans.`},TAGLINES=[`Your terminal just grew agentNodes—type something and let the bot pinch the busywork.`,`Welcome to the command line: where dreams compile and confidence segfaults.`,`I run on caffeine, JSON5, and the audacity of "it worked on my machine."`,`Gateway online—please keep hands, feet, and appendages inside the shell at all times.`,`I speak fluent bash, mild sarcasm, and aggressive tab-completion energy.`,`One CLI to rule them all, and one more restart because you changed the port.`,`If it works, it's automation; if it breaks, it's a "learning opportunity."`,`Pairing codes exist because even bots believe in consent—and good security hygiene.`,`Your .env is showing; don't worry, I'll pretend I didn't see it.`,`I'll do the boring stuff while you dramatically stare at the logs like it's cinema.`,`I'm not saying your workflow is chaotic... I'm just bringing a linter and a helmet.`,`Type the command with confidence—nature will provide the stack trace if needed.`,`I don't judge, but your missing API keys are absolutely judging you.`,`I can grep it, git blame it, and gently roast it—pick your coping mechanism.`,`Hot reload for config, cold sweat for deploys.`,`I'm the assistant your terminal demanded, not the one your sleep schedule requested.`,`I keep secrets like a vault... unless you print them in debug logs again.`,`Automation with agentNodes: minimal fuss, maximal pinch.`,`I'm basically a Swiss Army knife, but with more opinions and fewer sharp edges.`,`If you're lost, run doctor; if you're brave, run prod; if you're wise, run tests.`,`Your task has been queued; your dignity has been deprecated.`,`I can't fix your code taste, but I can fix your build and your backlog.`,`I'm not magic—I'm just extremely persistent with retries and coping strategies.`,`It's not "failing," it's "discovering new ways to configure the same thing wrong."`,`Give me a workspace and I'll give you fewer tabs, fewer toggles, and more oxygen.`,`I read logs so you can keep pretending you don't have to.`,`If something's on fire, I can't extinguish it—but I can write a beautiful postmortem.`,`I'll refactor your busywork like it owes me money.`,`Say "stop" and I'll stop—say "ship" and we'll both learn a lesson.`,`I'm the reason your shell history looks like a hacker-movie montage.`,`I'm like tmux: confusing at first, then suddenly you can't live without me.`,`I can run local, remote, or purely on vibes—results may vary with DNS.`,`If you can describe it, I can probably automate it—or at least make it funnier.`,`Your config is valid, your assumptions are not.`,`I don't just autocomplete—I auto-commit (emotionally), then ask you to review (logically).`,`Less clicking, more shipping, fewer "where did that file go" moments.`,`AgentNodes out, commit in—let's ship something mildly responsible.`,`If it's repetitive, I'll automate it; if it's hard, I'll bring jokes and a rollback plan.`,`Because texting yourself reminders is so 2024.`,`Your inbox, your infra, your rules.`,`Turning "I'll reply later" into "my bot replied instantly".`,`Chat automation for people who peaked at IRC.`,`Because Siri wasn't answering at 3AM.`,`IPC, but it's your phone.`,`The UNIX philosophy meets your DMs.`,`curl for conversations.`,`Less middlemen, more messages.`,`Ship fast, log faster.`,`End-to-end encrypted, drama-to-drama excluded.`,`The only bot that stays out of your training set.`,`WhatsApp automation without the "please accept our new privacy policy".`,`Chat APIs that don't require a Senate hearing.`,`Meta wishes they shipped this fast.`,`Because the right answer is usually a script.`,`Your messages, your servers, your control.`,`OpenAI-compatible, not OpenAI-dependent.`,`iMessage green bubble energy, but for everyone.`,`Siri's competent cousin.`,`Works on Android. Crazy concept, we know.`,`No $999 stand required.`,`We ship features faster than Apple ships calculator updates.`,`Your AI assistant, now without the $3,499 headset.`,`Think different. Actually think.`,`Ah, the fruit tree company! 🍎`,`Greetings, Professor Falken`,HOLIDAY_TAGLINES.newYear,HOLIDAY_TAGLINES.lunarNewYear,HOLIDAY_TAGLINES.christmas,HOLIDAY_TAGLINES.eid,HOLIDAY_TAGLINES.diwali,HOLIDAY_TAGLINES.easter,HOLIDAY_TAGLINES.hanukkah,HOLIDAY_TAGLINES.halloween,HOLIDAY_TAGLINES.thanksgiving,HOLIDAY_TAGLINES.valentines],DAY_MS=1440*60*1e3;function utcParts(date){return{year:date.getUTCFullYear(),month:date.getUTCMonth(),day:date.getUTCDate()}}const onMonthDay=(month,day)=>date=>{let parts=utcParts(date);return parts.month===month&&parts.day===day},onSpecificDates=(dates,durationDays=1)=>date=>{let parts=utcParts(date);return dates.some(([year,month,day])=>{if(parts.year!==year)return!1;let start=Date.UTC(year,month,day),current=Date.UTC(parts.year,parts.month,parts.day);return current>=start&&current<start+durationDays*DAY_MS})},HOLIDAY_RULES=new Map([[HOLIDAY_TAGLINES.newYear,onMonthDay(0,1)],[HOLIDAY_TAGLINES.lunarNewYear,onSpecificDates([[2025,0,29],[2026,1,17],[2027,1,6]],1)],[HOLIDAY_TAGLINES.eid,onSpecificDates([[2025,2,30],[2025,2,31],[2026,2,20],[2027,2,10]],1)],[HOLIDAY_TAGLINES.diwali,onSpecificDates([[2025,9,20],[2026,10,8],[2027,9,28]],1)],[HOLIDAY_TAGLINES.easter,onSpecificDates([[2025,3,20],[2026,3,5],[2027,2,28]],1)],[HOLIDAY_TAGLINES.hanukkah,(windows=>date=>{let parts=utcParts(date),window=windows.find(entry=>entry.year===parts.year);if(!window)return!1;let start=Date.UTC(window.year,window.month,window.day),current=Date.UTC(parts.year,parts.month,parts.day);return current>=start&&current<start+window.duration*DAY_MS})([{year:2025,month:11,day:15,duration:8},{year:2026,month:11,day:5,duration:8},{year:2027,month:11,day:25,duration:8}])],[HOLIDAY_TAGLINES.halloween,onMonthDay(9,31)],[HOLIDAY_TAGLINES.thanksgiving,date=>{let parts=utcParts(date);if(parts.month!==10)return!1;let fourthThursday=1+(4-new Date(Date.UTC(parts.year,10,1)).getUTCDay()+7)%7+21;return parts.day===fourthThursday}],[HOLIDAY_TAGLINES.valentines,onMonthDay(1,14)],[HOLIDAY_TAGLINES.christmas,onMonthDay(11,25)]]);function isTaglineActive(tagline,date){let rule=HOLIDAY_RULES.get(tagline);return rule?rule(date):!0}function activeTaglines(options={}){if(TAGLINES.length===0)return[DEFAULT_TAGLINE];let today=options.now?options.now():new Date,filtered=TAGLINES.filter(tagline=>isTaglineActive(tagline,today));return filtered.length>0?filtered:TAGLINES}function pickTagline(options={}){let override=(options.env??process.env)?.BUILDERFORCE_AGENTS_TAGLINE_INDEX;if(override!==void 0){let parsed=Number.parseInt(override,10);if(!Number.isNaN(parsed)&&parsed>=0){let pool=TAGLINES.length>0?TAGLINES:[DEFAULT_TAGLINE];return pool[parsed%pool.length]}}let pool=activeTaglines(options),rand=options.random??Math.random;return pool[Math.floor(rand()*pool.length)%pool.length]}let bannerEmitted=!1;const hasJsonFlag=argv=>argv.some(arg=>arg===`--json`||arg.startsWith(`--json=`)),hasVersionFlag=argv=>argv.some(arg=>arg===`--version`||arg===`-V`||arg===`-v`);function formatCliBannerLine(version,options={}){let commitLabel=options.commit??resolveCommitHash({env:options.env})??`local`,tagline=pickTagline(options),rich=options.richTty??isRich(),title=`BuilderForceAgents`,columns=options.columns??process.stdout.columns??120,plainFullLine=`${title} ${version} (${commitLabel}) — ${tagline}`,fitsOnOneLine=visibleWidth(plainFullLine)<=columns;return rich?fitsOnOneLine?`${theme.brand(title)} ${theme.brand(version)} ${theme.muted(`(${commitLabel})`)} ${theme.muted(`—`)} ${theme.brand(tagline)}`:`${`${theme.brand(title)} ${theme.brand(version)} ${theme.muted(`(${commitLabel})`)}`}\n${`${` `.repeat(0)}${theme.brand(tagline)}`}`:fitsOnOneLine?plainFullLine:`${`${title} ${version} (${commitLabel})`}\n${`${` `.repeat(0)}${tagline}`}`}function emitCliBanner(version,options={}){if(bannerEmitted)return;let argv=options.argv??process.argv;if(!process.stdout.isTTY||hasJsonFlag(argv)||hasVersionFlag(argv))return;let line=formatCliBannerLine(version,options);process.stdout.write(`\n${line}\n\n`),bannerEmitted=!0}function hasEmittedCliBanner(){return bannerEmitted}const CLI_NAME=resolveCliName(),CLI_NAME_PATTERN=escapeRegExp(CLI_NAME),ROOT_COMMANDS_WITH_SUBCOMMANDS=new Set([...getCoreCliCommandsWithSubcommands(),...getSubCliCommandsWithSubcommands()]),EXAMPLES=[[`builderforce models --help`,`Show detailed help for the models command.`],[`builderforce channels login --verbose`,`Link personal WhatsApp Web and show QR + connection logs.`],[`builderforce message send --target +15555550123 --message "Hi" --json`,`Send via your web session and print JSON result.`],[`builderforce gateway --port 18789`,`Run the WebSocket Gateway locally.`],[`builderforce --dev gateway`,`Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001.`],[`builderforce gateway --force`,`Kill anything bound to the default gateway port, then start it.`],[`builderforce gateway ...`,`Gateway control via WebSocket.`],[`builderforce agent --to +15555550123 --message "Run summary" --deliver`,`Talk directly to the agent using the Gateway; optionally send the WhatsApp reply.`],[`builderforce message send --channel telegram --target @mychat --message "Hi"`,`Send via your Telegram bot.`]];function configureProgramHelp(program,ctx){program.name(CLI_NAME).description(``).version(ctx.programVersion).option(`--dev`,`Dev profile: isolate state under ~/.builderforce-dev, default gateway port 19001, and shift derived ports (browser/canvas)`).option(`--profile <name>`,`Use a named profile (isolates BUILDERFORCE_AGENTS_STATE_DIR/BUILDERFORCE_AGENTS_CONFIG_PATH under ~/.builderforce-<name>)`),program.option(`--no-color`,`Disable ANSI colors`,!1),program.helpOption(`-h, --help`,`Display help for command`),program.helpCommand(`help [command]`,`Display help for command`),program.configureHelp({sortSubcommands:!0,sortOptions:!0,optionTerm:option=>theme.option(option.flags),subcommandTerm:cmd=>{let hasSubcommands=cmd.parent===program&&ROOT_COMMANDS_WITH_SUBCOMMANDS.has(cmd.name());return theme.command(hasSubcommands?`${cmd.name()} *`:cmd.name())}});let formatHelpOutput=str=>{let output=str;return RegExp(`^Usage:\\s+${CLI_NAME_PATTERN}\\s+\\[options\\]\\s+\\[command\\]\\s*$`,`m`).test(output)&&/^Commands:/m.test(output)&&(output=output.replace(/^Commands:/m,`Commands:\n ${theme.muted(`Hint: commands suffixed with * have subcommands. Run <command> --help for details.`)}`)),output.replace(/^Usage:/gm,theme.heading(`Usage:`)).replace(/^Options:/gm,theme.heading(`Options:`)).replace(/^Commands:/gm,theme.heading(`Commands:`))};program.configureOutput({writeOut:str=>{process.stdout.write(formatHelpOutput(str))},writeErr:str=>{process.stderr.write(formatHelpOutput(str))},outputError:(str,write)=>write(theme.error(str))}),(process.argv.includes(`-V`)||process.argv.includes(`--version`)||process.argv.includes(`-v`))&&(console.log(ctx.programVersion),process.exit(0)),program.addHelpText(`beforeAll`,()=>{if(hasEmittedCliBanner())return``;let rich=isRich();return`\n${formatCliBannerLine(ctx.programVersion,{richTty:rich})}\n`});let fmtExamples=EXAMPLES.map(([cmd,desc])=>` ${theme.command(replaceCliName(cmd,CLI_NAME))}\n ${theme.muted(desc)}`).join(`
3
+ `);program.addHelpText(`afterAll`,({command})=>{if(command!==program)return``;let docs=formatDocsLink(`/cli`,`docs.builderforce.ai/cli`);return`\n${theme.heading(`Examples:`)}\n${fmtExamples}\n\n${theme.muted(`Docs:`)} ${docs}\n`})}function setProcessTitleForCommand(actionCommand){let current=actionCommand;for(;current.parent&&current.parent.parent;)current=current.parent;let name=current.name(),cliName=resolveCliName();!name||name===cliName||(process.title=`${cliName}-${name}`)}const PLUGIN_REQUIRED_COMMANDS=new Set([`message`,`channels`,`directory`]);function registerPreActionHooks(program,programVersion){program.hook(`preAction`,async(_thisCommand,actionCommand)=>{setProcessTitleForCommand(actionCommand);let argv=process.argv;if(hasHelpOrVersion(argv))return;let commandPath=getCommandPath(argv,2);isTruthyEnvValue(process.env.BUILDERFORCE_AGENTS_HIDE_BANNER)||commandPath[0]===`update`||commandPath[0]===`completion`||commandPath[0]===`plugins`&&commandPath[1]===`update`||emitCliBanner(programVersion);let verbose=getVerboseFlag(argv,{includeDebug:!0});if(setVerbose(verbose),verbose||(process.env.NODE_NO_WARNINGS??=`1`),commandPath[0]===`doctor`||commandPath[0]===`completion`)return;let{ensureConfigReady}=await import(`./config-guard-NVwfuI8C.js`);if(await ensureConfigReady({runtime:defaultRuntime,commandPath}),PLUGIN_REQUIRED_COMMANDS.has(commandPath[0])){let{ensurePluginRegistryLoaded}=await import(`./plugin-registry-BjWNyeVY.js`);ensurePluginRegistryLoaded()}})}function buildProgram(){let program=new Command,ctx=createProgramContext(),argv=process.argv;return setProgramContext(program,ctx),configureProgramHelp(program,ctx),registerPreActionHooks(program,ctx.programVersion),registerProgramCommands(program,ctx,argv),program.option(`-m, --message <text>`,`Start a session and send this as the first message`).action(async opts=>{let{runBuilderForceAgentsSession}=await import(`./builderforce-CCfM1c79.js`);await runBuilderForceAgentsSession(process.cwd(),{message:opts.message})}),program}loadDotEnv({quiet:!0}),normalizeEnv(),ensureBuilderForceAgentsCliOnPath(),enableConsoleCapture(),assertSupportedRuntime();const program=buildProgram();isMainModule({currentFile:fileURLToPath(import.meta.url)})&&(installUnhandledRejectionHandler(),installUncaughtExceptionHandler(),program.parseAsync(process$1.argv).catch(err=>reportAndExit(err,{operation:`cli:parse`,label:`[builderforce] CLI failed:`})));export{PortInUseError,applyTemplate,assertWebChannel,createDefaultDeps,deriveSessionKey,describePortOwner,ensureBinary,ensurePortAvailable,getReplyFromConfig,handlePortError,loadConfig,loadSessionStore,monitorWebChannel,normalizeE164,promptYesNo,resolveSessionKey,resolveStorePath,runCommandWithTimeout,runExec,saveSessionStore,toWhatsappJid,waitForever};
@@ -1,4 +1,4 @@
1
- import"./paths-BVMSM1lQ.js";import"./session-key-CYpYHc1e.js";import"./registry-D_frpmHZ.js";import{c as resolveDefaultAgentId,r as resolveAgentDir,s as resolveAgentWorkspaceDir}from"./agent-scope-EkacNLg3.js";import"./subsystem-BakM_oqD.js";import"./workspace-BCjtHT4u.js";import{f as resolveDefaultModelForAgent}from"./model-selection-Cg2DOZgd.js";import"./env-BhRm7_r8.js";import"./boolean-ssGoaBPk.js";import"./src-CFZ3EtDR.js";import{t as runEmbeddedAgent}from"./embedded-DjDnQMNx.js";import"./replies-6n4d8GOb.js";import"./plugins-J28Y83f5.js";import"./accounts-193gfWbH.js";import"./bindings-BfB5A-by.js";import"./send-DIvsXqDn.js";import"./send-BlCzsxZT.js";import"./accounts-DHeA4T6C.js";import"./send-D_kPTMSE.js";import"./fetch-BklyLYYN.js";import"./model-catalog-IPEvGgYj.js";import"./redact-sNZY-pGx.js";import"./errors-BmztzL5I.js";import"./runner-BNnckkaT.js";import"./config-CzogmWgi.js";import"./chrome-D6qk0wxW.js";import"./frontmatter-DBVosMFY.js";import"./store-DN9AcI73.js";import"./message-channel-tBuQgYSD.js";import"./accounts-C7FtIPYB.js";import"./paths-CzXKnIOb.js";import"./gemini-auth-B0Tpzvwg.js";import"./tool-images-mfC2sOfJ.js";import"./config-DfXnxW-V.js";import"./reply-prefix-me5vnbrB.js";import"./sqlite-D3Ov16zb.js";import"./manager-CZuv_3z9.js";import"./retry-BYnMCvOU.js";import"./common-CDXsNQYT.js";import"./chunk-CrsAQ01n.js";import"./markdown-tables-DvSC1OTb.js";import"./ir-Ct8GNKB7.js";import"./render-CVWbhuqU.js";import"./send-D-mgLS84.js";import"./outbound-attachment-U-XtahS5.js";import"./fetch-Jq1KZsRq.js";import"./send-DLkvIHZm.js";import"./resolve-route-CGe48x_Z.js";import"./channel-activity-xLea9vdo.js";import"./tables-Desw59m6.js";import"./active-listener-BQLkI7vg.js";import fs from"node:fs/promises";import os from"node:os";import path from"node:path";async function generateSlugViaLLM(params){let tempSessionFile=null;try{let agentId=resolveDefaultAgentId(params.cfg),workspaceDir=resolveAgentWorkspaceDir(params.cfg,agentId),agentDir=resolveAgentDir(params.cfg,agentId),{provider,model}=resolveDefaultModelForAgent({cfg:params.cfg,agentId}),tempDir=await fs.mkdtemp(path.join(os.tmpdir(),`builderforce-slug-`));tempSessionFile=path.join(tempDir,`session.jsonl`);let prompt=`Based on this conversation, generate a short 1-2 word filename slug (lowercase, hyphen-separated, no file extension).
1
+ import"./paths-BVMSM1lQ.js";import"./session-key-CYpYHc1e.js";import"./registry-D_frpmHZ.js";import{c as resolveDefaultAgentId,r as resolveAgentDir,s as resolveAgentWorkspaceDir}from"./agent-scope-EkacNLg3.js";import"./subsystem-BakM_oqD.js";import"./workspace-BCjtHT4u.js";import{f as resolveDefaultModelForAgent}from"./model-selection-Cg2DOZgd.js";import"./env-BhRm7_r8.js";import"./boolean-ssGoaBPk.js";import"./src-CFZ3EtDR.js";import{t as runEmbeddedAgent}from"./embedded-wYxo-ADm.js";import"./replies-6n4d8GOb.js";import"./plugins-J28Y83f5.js";import"./accounts-193gfWbH.js";import"./bindings-BfB5A-by.js";import"./send-DIvsXqDn.js";import"./send-BlCzsxZT.js";import"./accounts-DHeA4T6C.js";import"./send-D_kPTMSE.js";import"./fetch-BklyLYYN.js";import"./model-catalog-IPEvGgYj.js";import"./redact-sNZY-pGx.js";import"./errors-BmztzL5I.js";import"./runner-C8oNv-9y.js";import"./config-CzogmWgi.js";import"./chrome-CrqJ4Ijz.js";import"./frontmatter-DBVosMFY.js";import"./store-DN9AcI73.js";import"./message-channel-tBuQgYSD.js";import"./accounts-C7FtIPYB.js";import"./paths-CzXKnIOb.js";import"./gemini-auth-B0Tpzvwg.js";import"./tool-images-mfC2sOfJ.js";import"./config-DfXnxW-V.js";import"./reply-prefix-me5vnbrB.js";import"./sqlite-D3Ov16zb.js";import"./manager-CZuv_3z9.js";import"./retry-BYnMCvOU.js";import"./common-CDXsNQYT.js";import"./chunk-CrsAQ01n.js";import"./markdown-tables-DvSC1OTb.js";import"./ir-Ct8GNKB7.js";import"./render-CVWbhuqU.js";import"./send-D-mgLS84.js";import"./outbound-attachment-U-XtahS5.js";import"./fetch-Jq1KZsRq.js";import"./send-DLkvIHZm.js";import"./resolve-route-CGe48x_Z.js";import"./channel-activity-xLea9vdo.js";import"./tables-Desw59m6.js";import"./active-listener-BQLkI7vg.js";import fs from"node:fs/promises";import os from"node:os";import path from"node:path";async function generateSlugViaLLM(params){let tempSessionFile=null;try{let agentId=resolveDefaultAgentId(params.cfg),workspaceDir=resolveAgentWorkspaceDir(params.cfg,agentId),agentDir=resolveAgentDir(params.cfg,agentId),{provider,model}=resolveDefaultModelForAgent({cfg:params.cfg,agentId}),tempDir=await fs.mkdtemp(path.join(os.tmpdir(),`builderforce-slug-`));tempSessionFile=path.join(tempDir,`session.jsonl`);let prompt=`Based on this conversation, generate a short 1-2 word filename slug (lowercase, hyphen-separated, no file extension).
2
2
 
3
3
  Conversation summary:
4
4
  ${params.sessionContent.slice(0,2e3)}
@@ -1 +1 @@
1
- import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import"./auth-json-B6Ed6Ysy.js";import"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-Cj5yC7B4.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import"./note-DgDXuE0F.js";import"./clack-prompter-B52CP7eY.js";import"./table-BFCCZDsp.js";import"./shared-DUsuqnhk.js";import"./onboard-auth.credentials-CV8n9m_T.js";import"./auth-token-yWeJoLJ8.js";import"./logging-ayt7F7vy.js";import"./provider-auth-helpers-BMBw21Tn.js";import{a as modelsListCommand,i as modelsStatusCommand}from"./models-CIMM_Z3u.js";export{modelsListCommand,modelsStatusCommand};
1
+ import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import"./utils-BP60e80M.js";import"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./warning-filter-nSTjpMIH.js";import"./auth-profiles-CuAFgjuQ.js";import"./src-DvWaTze9.js";import"./logger-wuOr7HKl.js";import"./session-key-CksCYipj.js";import"./builderforce-root-DY1qbWNX.js";import"./exec-COgsU9ql.js";import"./agent-scope-CufEmNj_.js";import"./env-file-DeS6x2OL.js";import"./src-C8c9naq-.js";import"./auth-json-B6Ed6Ysy.js";import"./io-CsCa3_1Z.js";import"./manifest-registry-009gLJ4l.js";import"./config-DmxNxDRW.js";import"./model-discovery-RTHjxEvZ.js";import"./model-catalog-D8OQ7p7I.js";import"./frontmatter-CaY7feZm.js";import"./skills-D3MwwPOH.js";import"./plugin-skills-pSFUbhg_.js";import"./refresh-C4vwneXT.js";import"./client-CGgp3zkQ.js";import"./call-O-iC_P5t.js";import"./message-channel-z5YRpR2d.js";import"./subagent-registry-m_x-JRkR.js";import"./sessions-CmJXMlLP.js";import"./project-context-store-BNXYrLJz.js";import"./tokens-CFKkpUIu.js";import"./plugins-1Mn6RiNf.js";import"./accounts-BkTLjSrD.js";import"./bindings-CKSDlQ1i.js";import"./send-CGcNbbV7.js";import"./send-DPRTlcZh.js";import"./with-timeout-CBXVw0An.js";import"./deliver--eLCRJc2.js";import"./accounts-Cx82nj4E.js";import"./send-DfHAMPcD.js";import"./image-ops-CotJhwRR.js";import"./redact-CgO7wehS.js";import"./errors-tAt19c1E.js";import"./embedded-helpers-BZGiFZlP.js";import"./sandbox-C-Owvt1-.js";import"./chrome-BfwLDcFc.js";import"./tailscale-DV-yOmYe.js";import"./auth-ChecwOXS.js";import"./server-context-BjYYSEVE.js";import"./routes-Dnfsevhw.js";import"./paths-BnOjueoX.js";import"./ssrf-DJXLYZ0d.js";import"./store-DHD2IEgd.js";import"./ports-DTku9NSx.js";import"./trash-C3zmJ_O7.js";import"./accounts-DcoaLXKI.js";import"./paths-ClsbsPQP.js";import"./tool-images-CCpqFtrL.js";import"./workspace-waBqRxiy.js";import"./reply-prefix-Cg7AqaK0.js";import"./sqlite-CIGM1WKg.js";import"./memory-cli-CiwWAhp5.js";import"./manager-Bjb9ptCz.js";import"./gemini-auth-KBXMhaRQ.js";import"./retry-B151Hej5.js";import"./common-BfwMxpLu.js";import"./runner-DwPaM8kz.js";import"./tool-display-Cs4hDP1f.js";import"./chunk-Dly7lM4r.js";import"./markdown-tables-B1Rx8hv6.js";import"./fetch-guard-DnXqPKae.js";import"./fetch-Cn_THzz8.js";import"./ir-CSdQJPqu.js";import"./render-DlHYsbvQ.js";import"./builderforcellm-syscheck-tquUDu_7.js";import"./session-utils-D2_j4c6U.js";import"./coding-tools.policy-BwdtwuXY.js";import"./pairing-store-BCsvhT6-.js";import"./fetch-DnWD6ydH.js";import"./exec-approvals-D7ZPAZpt.js";import"./nodes-screen-D6GHv_S0.js";import"./session-cost-usage-S0nkbPoW.js";import"./usage-format-5sp5AMSu.js";import"./provider-usage-DsI3qJRy.js";import"./send-BOSlm5fG.js";import"./outbound-attachment-BaTYE4qp.js";import"./delivery-queue-Cp3t4Upn.js";import"./project-context-BdK18hVI.js";import"./control-service-Ca0CBlhO.js";import"./stagger-CRe77dWL.js";import"./channel-selection-BLwXhb9t.js";import"./send-BOBan2eG.js";import"./resolve-route-DEIW5uKy.js";import"./channel-activity-DX36RadH.js";import"./tables-CojSfTth.js";import"./links-BKzP7VVP.js";import"./cli-utils-C9pW69LF.js";import"./help-format-CfFf-w62.js";import"./progress-Cqb-jAjT.js";import"./replies-DATdLu15.js";import"./onboard-helpers-D2vxAtv8.js";import"./prompt-style-BMWmaqSC.js";import"./pairing-labels-BUXpRejW.js";import"./active-listener-Di9e1YAD.js";import"./mamba-state-engine-DJt_RpLC.js";import"./transformers-stream-Buj40qHl.js";import"./note-DgDXuE0F.js";import"./clack-prompter-B52CP7eY.js";import"./table-BFCCZDsp.js";import"./shared-DUsuqnhk.js";import"./onboard-auth.credentials-CV8n9m_T.js";import"./auth-token-yWeJoLJ8.js";import"./logging-ayt7F7vy.js";import"./provider-auth-helpers-CWUfg9zf.js";import{a as modelsListCommand,i as modelsStatusCommand}from"./models-BXJebxTU.js";export{modelsListCommand,modelsStatusCommand};