@seanhogg/builderforce-agents 2026.9.5 → 2026.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-CBRDuLO-.js → agent-59_cdTZl.js} +1 -1
- package/dist/{agent-CCY1r5YW.js → agent-CvMM49lm.js} +1 -1
- package/dist/{agents-DW3hte-y.js → agents-2d7A-Uwz.js} +1 -1
- package/dist/{agents-Ce4bN10e.js → agents-BdOgv61S.js} +1 -1
- package/dist/{audio-preflight-BvzGdNYy.js → audio-preflight-CmX2XJ3N.js} +1 -1
- package/dist/{audio-preflight-BYMboYmW.js → audio-preflight-Dnw3oDJr.js} +1 -1
- package/dist/{audio-preflight-CEOxJosQ.js → audio-preflight-HcRdB0oH.js} +1 -1
- package/dist/{audio-preflight-CswNxppe.js → audio-preflight-Sh649dxR.js} +1 -1
- package/dist/{auth-choice-DSLN0TLU.js → auth-choice-D06_TWBf.js} +1 -1
- package/dist/{auth-choice-BTrUlYmE.js → auth-choice-DyxxR025.js} +1 -1
- package/dist/{auth-choice.apply-BZ7E08Yb.js → auth-choice.apply-CUuLdlQd.js} +1 -1
- package/dist/{auth-choice.apply-D3EY1pZ3.js → auth-choice.apply-CfFhu_Vk.js} +1 -1
- package/dist/{auth-choice.apply-5dpCNO0l.js → auth-choice.apply-D57XA_d9.js} +1 -1
- package/dist/{auth-choice.apply-3tPFL-eH.js → auth-choice.apply-s_rOXFVz.js} +1 -1
- package/dist/{auth-choice.apply.transformers-B_Q6e8Yk.js → auth-choice.apply.transformers-CqQSUnsx.js} +1 -1
- package/dist/{auth-choice.apply.transformers-D1EzC906.js → auth-choice.apply.transformers-DXBWOilg.js} +1 -1
- package/dist/{auth-choice.apply.transformers-BJbpyCWs.js → auth-choice.apply.transformers-DizfkAmz.js} +1 -1
- package/dist/{auth-choice.apply.transformers-vLzCo5ew.js → auth-choice.apply.transformers-vyvtAxcX.js} +1 -1
- package/dist/{banner-DVNoUX5I.js → banner-BXpp_pEd.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/{builderforce-Bs_G8kBN.js → builderforce-BdJAOfvE.js} +2 -2
- package/dist/{builderforce-BN_So1di.js → builderforce-BrFUSx35.js} +2 -2
- package/dist/{builderforce-directory-sync-BCZK4FYJ.js → builderforce-directory-sync-CFiQew6N.js} +1 -1
- package/dist/{builderforce-directory-sync-DHfiUf2g.js → builderforce-directory-sync-DIQQT09l.js} +1 -1
- package/dist/{builderforce-onboarding-Bbjz8F-r.js → builderforce-onboarding-CoGJY95Q.js} +1 -1
- package/dist/{builderforce-onboarding-8lL2bgtL.js → builderforce-onboarding-DyYM_cib.js} +1 -1
- package/dist/{builderforcellm-syscheck-CyZiwcdF.js → builderforcellm-syscheck-CfFrfeV2.js} +1 -1
- package/dist/{builderforcellm-syscheck-DMjMJNFI.js → builderforcellm-syscheck-DGZKIwPC.js} +1 -1
- package/dist/bundled/boot-md/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/{channel-options-Zk5QnNPR.js → channel-options--DZ4jYy9.js} +1 -1
- package/dist/{channel-options-Cbz6vcgo.js → channel-options-xVK4amr4.js} +1 -1
- package/dist/{channel-web-1xD-Ad2T.js → channel-web-9vO41fn2.js} +1 -1
- package/dist/{channels-cli-CiVlP8_q.js → channels-cli-Ch1sZ58k.js} +1 -1
- package/dist/{channels-cli-BOcpgY_W.js → channels-cli-YMSOJUmp.js} +1 -1
- package/dist/chrome-Bi-3xZj-.js +4 -0
- package/dist/chrome-C6oWWmHX.js +4 -0
- package/dist/{cli-6znoaKr2.js → cli-gsxv7DrZ.js} +1 -1
- package/dist/{cli-BPwpRE1j.js → cli-zC5qoRAp.js} +1 -1
- package/dist/{command-registry-BTxAGdlS.js → command-registry-BXLjR3kb.js} +1 -1
- package/dist/{command-registry-BZINHmI9.js → command-registry-I83E6HLw.js} +1 -1
- package/dist/{completion-cli-BwCfUaHz.js → completion-cli-BQCxFDqY.js} +1 -1
- package/dist/{completion-cli-vR4Sx9zB.js → completion-cli-CDy8f_Fg.js} +1 -1
- package/dist/{completion-cli-C8kMJ401.js → completion-cli-DbIxXK1B.js} +1 -1
- package/dist/{completion-cli-D8WkqtSU.js → completion-cli-ydxyAE7J.js} +1 -1
- package/dist/{config-cli-BYFA4Nin.js → config-cli-5ZSrACPR.js} +1 -1
- package/dist/{config-cli-DVpEv0oj.js → config-cli-BvJso6op.js} +1 -1
- package/dist/{configure-COeSbyyP.js → configure-1e4C38zp.js} +1 -1
- package/dist/{configure-CW2bJ91q.js → configure-B_oI_bg-.js} +1 -1
- package/dist/{configure-B_juJzVi.js → configure-Dp71zeJI.js} +1 -1
- package/dist/{configure-CgkUUUpM.js → configure-NxmuXXEd.js} +1 -1
- package/dist/{deliver-qM1Zkf4i.js → deliver-C6HTqnzY.js} +1 -1
- package/dist/{deliver-BNMupwo6.js → deliver-CdwCHH01.js} +1 -1
- package/dist/{deliver-Bs-FVPQ4.js → deliver-DFhj1d_t.js} +1 -1
- package/dist/{deliver-C5lVQcrs.js → deliver-XGIFv80r.js} +1 -1
- package/dist/{deps-DWFMK9Xg.js → deps-C4YVdrEi.js} +1 -1
- package/dist/{doctor-completion-s5vcMc-C.js → doctor-completion-DhIR9uqB.js} +1 -1
- package/dist/{doctor-completion-BdMxCat-.js → doctor-completion-Dpy-8HV9.js} +1 -1
- package/dist/{embedded-CRoX1qTh.js → embedded-Cw4g0mzl.js} +7 -7
- package/dist/{embedded-DpSS2q2a.js → embedded-DG3sEMyg.js} +7 -7
- package/dist/{embedded-helpers-BrfnCpCe.js → embedded-helpers-3FEGD_4b.js} +1 -1
- package/dist/{embedded-helpers-Q5h1lA6D.js → embedded-helpers-DGDYymYx.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{gateway-cli-oSSOT67p.js → gateway-cli-BBu6KI7r.js} +4 -4
- package/dist/{gateway-cli-DzxNTkvL.js → gateway-cli-CSmbpS6n.js} +4 -4
- package/dist/{health-_L8Avf4v.js → health-AOM42u9C.js} +1 -1
- package/dist/{health-hXlukqbf.js → health-CRIXA8je.js} +1 -1
- package/dist/{health-B_qWRpsT.js → health-Cuh0tZl2.js} +1 -1
- package/dist/{hooks-cli-C-vbyL2y.js → hooks-cli-BeqvyPiX.js} +1 -1
- package/dist/{hooks-cli-7gBXRQ81.js → hooks-cli-CYI9ZvNI.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{ink-session-DpO3VOYc.js → ink-session-MNcfJzij.js} +1 -1
- package/dist/{ink-session-CZj35xTR.js → ink-session-VqYNJYzq.js} +1 -1
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{mamba-state-engine-CFwb8DcP.js → mamba-state-engine-BYmUnYwn.js} +1 -1
- package/dist/{mamba-state-engine-Ck2JCfL6.js → mamba-state-engine-BloJzrxU.js} +1 -1
- package/dist/{models-PPv9KRbb.js → models-B6kkCBLd.js} +1 -1
- package/dist/{models-cli-btaamH96.js → models-cli-C7u8eLls.js} +1 -1
- package/dist/{models-cli-BUDSwmIY.js → models-cli-DpbpZwjy.js} +1 -1
- package/dist/{models-DMrs_Zsc.js → models-hEa3avo7.js} +1 -1
- package/dist/{onboard-4JByma4r.js → onboard-BHlI_UVY.js} +2 -2
- package/dist/{onboard-Dq_XQQXY.js → onboard-BW5J0Ym8.js} +2 -2
- package/dist/{onboard-channels-Dzyeem1L.js → onboard-channels-BkrhZ79I.js} +1 -1
- package/dist/{onboard-channels-D4g6xuSC.js → onboard-channels-DXIqdoto.js} +1 -1
- package/dist/{onboard-channels-Dir2EguP.js → onboard-channels-V51s9X-h.js} +1 -1
- package/dist/{onboard-channels-UZOCuxN7.js → onboard-channels-fyGQ1v4S.js} +1 -1
- package/dist/{onboard-interactive-DvNhkCNr.js → onboard-interactive-ClPMlCIl.js} +1 -1
- package/dist/{onboard-interactive-DyyEDd9a.js → onboard-interactive-D6IBBU8m.js} +1 -1
- package/dist/{onboard-interactive-CwNfYxGe.js → onboard-interactive-DEeqmoeW.js} +1 -1
- package/dist/{onboard-interactive-Co2bcd7g.js → onboard-interactive-DSZak3YX.js} +1 -1
- package/dist/{onboarding-DBL-H1Qu.js → onboarding-CYOfGpd5.js} +3 -3
- package/dist/{onboarding-CIxLpuFP.js → onboarding-DIxm_q7P.js} +3 -3
- package/dist/{onboarding.finalize-CGGbkAOL.js → onboarding.finalize-Co5L0rNp.js} +1 -1
- package/dist/{onboarding.finalize-R3TfibWY.js → onboarding.finalize-DAwpQa7n.js} +1 -1
- package/dist/{outbound-send-deps-CsJgGsii.js → outbound-send-deps-Cys_MtmC.js} +1 -1
- package/dist/{plugin-registry-Ty9w94Rd.js → plugin-registry-BM1-sG-e.js} +1 -1
- package/dist/{plugin-registry-BkGhcUDV.js → plugin-registry-CAy3I1K1.js} +1 -1
- package/dist/{plugin-registry-BenvgIsJ.js → plugin-registry-DjmzOS3n.js} +1 -1
- package/dist/{plugin-registry-DZirturB.js → plugin-registry-l2iN7_1l.js} +1 -1
- package/dist/plugin-sdk/agent-runtime/src/builderforce/ports.d.ts +1 -1
- package/dist/plugin-sdk/agent-runtime/src/infra/limbic-system-service.d.ts +2 -3
- package/dist/plugin-sdk/{audio-preflight-lhP946UF.js → audio-preflight-BbtfbLzo.js} +1 -1
- package/dist/plugin-sdk/{channel-web-CzXHQXgb.js → channel-web-BHose9yJ.js} +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/packages/agent-tools/src/index.d.ts +0 -1
- package/dist/plugin-sdk/packages/agent-tools/src/psychometric-dims.d.ts +2 -2
- package/dist/plugin-sdk/packages/agent-tools/src/psychometrics.d.ts +38 -5
- package/dist/plugin-sdk/packages/agent-tools/src/spec.d.ts +3 -1
- package/dist/plugin-sdk/{reply-DkmZ32IH.js → reply-V98uAjNN.js} +5 -5
- package/dist/plugin-sdk/{runner-DeqVi2ay.js → runner-BpFNG45j.js} +1 -1
- package/dist/plugin-sdk/{src-yVjde9hC.js → src-pvdIxmTY.js} +2 -2
- package/dist/plugin-sdk/{tool-loop-detection-AO2R09bJ.js → tool-loop-detection-Bjiit8CZ.js} +1 -1
- package/dist/plugin-sdk/{web-D-h3WpSq.js → web-Bq6nGRsB.js} +1 -1
- package/dist/{plugins-r-hGfiMK.js → plugins-BbovMu2g.js} +1 -1
- package/dist/{plugins-ChYVZuHy.js → plugins-DrkC1ANW.js} +1 -1
- package/dist/{plugins-cli-CKQ2X7tA.js → plugins-cli-CqtTn-Gv.js} +1 -1
- package/dist/{plugins-cli-CB7e9eCK.js → plugins-cli-DWlQnRpV.js} +1 -1
- package/dist/{program-D71K23KC.js → program-DOGUG9Uz.js} +2 -2
- package/dist/{program-context-B9V62ZJg.js → program-context-DBtTOKkf.js} +1 -1
- package/dist/{project-context-Cnqfr64Z.js → project-context-C5KLsMTc.js} +1 -1
- package/dist/{project-context-DXP12xhk.js → project-context-Cg0S9eFT.js} +1 -1
- package/dist/project-context-DbBD_r4v.js +1 -0
- package/dist/project-context-nIzFswHk.js +1 -0
- package/dist/project-context-store-B96x1Lfk.js +1 -0
- package/dist/{project-context-store-C8TROXjr.js → project-context-store-BS994lZX.js} +1 -1
- package/dist/{project-context-store-ClFt-YDL.js → project-context-store-BSIWJD6S.js} +1 -1
- package/dist/project-context-store-BzX1YdMP.js +1 -0
- package/dist/{prompt-select-styled-Cect8vJu.js → prompt-select-styled-2q_0LOx1.js} +1 -1
- package/dist/{prompt-select-styled-CJBJZiX_.js → prompt-select-styled-D31D9EIl.js} +1 -1
- package/dist/{provider-auth-helpers-DItSj71N.js → provider-auth-helpers-9Ut-MHV9.js} +1 -1
- package/dist/{provider-auth-helpers-ByvJdQT3.js → provider-auth-helpers-u1GAP4Bi.js} +1 -1
- package/dist/{provider-dispatcher-E-RjX6WG.js → provider-dispatcher-4KsB_bCw.js} +1 -1
- package/dist/{provider-dispatcher-D6-kUWf8.js → provider-dispatcher-CG7kSp65.js} +1 -1
- package/dist/{push-apns-B6YfFR5s.js → push-apns-CEzi4ars.js} +1 -1
- package/dist/{push-apns-n8P3oclR.js → push-apns-oUAHr48A.js} +1 -1
- package/dist/{pw-ai-BpY-eMJT.js → pw-ai-CfV_5FWo.js} +1 -1
- package/dist/{pw-ai-Bu1w-1rC.js → pw-ai-Dx8XRyPq.js} +1 -1
- package/dist/{register.agent-CAsV5dRf.js → register.agent-C84ud-cS.js} +1 -1
- package/dist/{register.agent-DQ4zQymV.js → register.agent-Db9SzkZg.js} +1 -1
- package/dist/{register.configure-HcPL-Na2.js → register.configure-BfPiEcFk.js} +1 -1
- package/dist/{register.configure-B-xRsB-s.js → register.configure-WYMz_fwM.js} +1 -1
- package/dist/{register.connect-BcZeAJ1s.js → register.connect-CMN7lqC5.js} +1 -1
- package/dist/{register.connect-ChZQOiYF.js → register.connect-Dqhd81kK.js} +1 -1
- package/dist/{register.maintenance-C-7Arpam.js → register.maintenance-BpQE-3eC.js} +1 -1
- package/dist/{register.maintenance-Jdfg2LKA.js → register.maintenance-DjKxt-jl.js} +1 -1
- package/dist/{register.message-D1IU3K0a.js → register.message-C4Gf388m.js} +1 -1
- package/dist/{register.message-C3cFBIXY.js → register.message-D5A7-_wN.js} +1 -1
- package/dist/{register.onboard-DJ2QNnOi.js → register.onboard-BF5tXr7K.js} +1 -1
- package/dist/{register.onboard-DjrhC3jh.js → register.onboard-BO_OtYg9.js} +1 -1
- package/dist/{register.setup-BNUqkiVa.js → register.setup-BzDbYjEw.js} +1 -1
- package/dist/{register.setup-C8XgG5Zt.js → register.setup-CaWt1bhf.js} +1 -1
- package/dist/{register.status-health-sessions-DcqlqAhs.js → register.status-health-sessions-BbYzFw1X.js} +1 -1
- package/dist/{register.status-health-sessions-CBTZZ0Rh.js → register.status-health-sessions-CDD6Eoxf.js} +1 -1
- package/dist/{register.subclis-CqVl0uO4.js → register.subclis-Cfb5FUTI.js} +1 -1
- package/dist/{register.subclis-Meewq2dj.js → register.subclis-yYbEKj9a.js} +1 -1
- package/dist/{reply-BsRbeUhd.js → reply-CpGH-3If.js} +8 -8
- package/dist/{run-main-CFVoPcgN.js → run-main-B82VAQTQ.js} +1 -1
- package/dist/{runner-68-X3KHf.js → runner-BLCTET8O.js} +2 -2
- package/dist/{runner-CfNJMPWu.js → runner-C651oVfk.js} +2 -2
- package/dist/{runner-BgUG2-RV.js → runner-DCn9sBTn.js} +3 -3
- package/dist/{runner-BKHYCYMH.js → runner-xF3_-mDL.js} +3 -3
- package/dist/{server-node-events-DusCxrVm.js → server-node-events-Bam08x5E.js} +1 -1
- package/dist/{server-node-events-BahizW3Z.js → server-node-events-kbTUUaAA.js} +1 -1
- package/dist/{session-dirs-RIA98OsG.js → session-dirs-BBGuanHN.js} +1 -1
- package/dist/{session-dirs-Cutn9srI.js → session-dirs-DV-c-o7M.js} +1 -1
- package/dist/{src-BRo9ywDM.js → src-BM8G-tIl.js} +3 -3
- package/dist/{src-DxNC0IHE.js → src-D2-7sOAX.js} +3 -3
- package/dist/{src-NJhXretA.js → src-D5vOHX9i.js} +2 -2
- package/dist/{src-Enbbh3hH.js → src-Dptpvd0V.js} +2 -2
- package/dist/{status-DPza6sZ1.js → status-BcT4AI8l.js} +1 -1
- package/dist/{status-CMdPdaSM.js → status-C9D1ex2G.js} +1 -1
- package/dist/{status-CFDh5snF.js → status-D_YsiWpP.js} +1 -1
- package/dist/{status-SyaizSN6.js → status-V8zvPBOv.js} +1 -1
- package/dist/{status-C1toWVvJ.js → status-i_sJ6Ikx.js} +1 -1
- package/dist/{subagent-registry-oB_F2U2W.js → subagent-registry-BUKplZi1.js} +8 -8
- package/dist/{subagent-registry-DFzwOGge.js → subagent-registry-BgUoQjBB.js} +1 -1
- package/dist/{subagent-registry-C1opJIrJ.js → subagent-registry-DrrF3JoH.js} +1 -1
- package/dist/{tool-loop-detection-DxqiqYam.js → tool-loop-detection-Bv0aRyd6.js} +1 -1
- package/dist/{tool-loop-detection-3W6bLEza.js → tool-loop-detection-CgUkrbCZ.js} +1 -1
- package/dist/{tool-loop-detection-C3z1wqgV.js → tool-loop-detection-CshVZIOE.js} +1 -1
- package/dist/{tool-loop-detection-DNM8YCNW.js → tool-loop-detection-bpZ-S3A1.js} +1 -1
- package/dist/{tui-Dy1FnApe.js → tui-CdYI5f3k.js} +2 -2
- package/dist/{tui-lng2vIp3.js → tui-DgBGTw2s.js} +2 -2
- package/dist/{tui-cli-BTFEL897.js → tui-cli-BNeRzoEe.js} +1 -1
- package/dist/{tui-cli-D-cDh9DV.js → tui-cli-BZ--mp9s.js} +1 -1
- package/dist/{tui-stream-assembler-B_AQD4Kg.js → tui-stream-assembler-BNJE9PoS.js} +1 -1
- package/dist/{tui-stream-assembler-Bn1WXUGG.js → tui-stream-assembler-xFcJqFJ9.js} +1 -1
- package/dist/{update-cli-BdT4-P_D.js → update-cli-BATUCF7p.js} +1 -1
- package/dist/{update-cli-DMMSWPXh.js → update-cli-BRBoX_97.js} +1 -1
- package/dist/{web-BiSkmACr.js → web-BdYyXjsX.js} +1 -1
- package/dist/{web-CXrAweDC.js → web-C5hfXVCy.js} +1 -1
- package/dist/{web-BS6WUf7c.js → web-CsWqmV_E.js} +1 -1
- package/dist/{web-CfYUd-lX.js → web-fg3nA4Qq.js} +1 -1
- package/dist/{workflow-cli-Du4IfE1A.js → workflow-cli-D-o_-jfU.js} +1 -1
- package/dist/{workflow-cli-BuEKJ4ut.js → workflow-cli-DDWSXyi0.js} +1 -1
- package/package.json +6 -5
- package/dist/chrome-C6fODzE5.js +0 -4
- package/dist/chrome-Cm-kVyuA.js +0 -4
- package/dist/plugin-sdk/agent-runtime/src/builderforce/limbic.d.ts +0 -14
- package/dist/plugin-sdk/packages/agent-tools/src/limbic.d.ts +0 -104
- package/dist/project-context-DS52UwJZ.js +0 -1
- package/dist/project-context-PiiAmwVd.js +0 -1
- package/dist/project-context-store-B2GYSwld.js +0 -1
- package/dist/project-context-store-DNx9ScQ_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import{D as danger,O as info,S as shortenHomePath,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./auth-profiles-BARnVAUE.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import{a as readConfigFileSnapshot,c as writeConfigFile}from"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import{t as formatDocsLink}from"./links-B6LU5cXN.js";import JSON5 from"json5";function isIndexSegment(raw){return/^[0-9]+$/.test(raw)}function parsePath(raw){let trimmed=raw.trim();if(!trimmed)return[];let parts=[],current=``,i=0;for(;i<trimmed.length;){let ch=trimmed[i];if(ch===`\\`){let next=trimmed[i+1];next&&(current+=next),i+=2;continue}if(ch===`.`){current&&parts.push(current),current=``,i+=1;continue}if(ch===`[`){current&&parts.push(current),current=``;let close=trimmed.indexOf(`]`,i);if(close===-1)throw Error(`Invalid path (missing "]"): ${raw}`);let inside=trimmed.slice(i+1,close).trim();if(!inside)throw Error(`Invalid path (empty "[]"): ${raw}`);parts.push(inside),i=close+1;continue}current+=ch,i+=1}return current&&parts.push(current),parts.map(part=>part.trim()).filter(Boolean)}function parseValue(raw,opts){let trimmed=raw.trim();if(opts.json)try{return JSON5.parse(trimmed)}catch(err){throw Error(`Failed to parse JSON5 value: ${String(err)}`,{cause:err})}try{return JSON5.parse(trimmed)}catch{return raw}}function getAtPath(root,path){let current=root;for(let segment of path){if(!current||typeof current!=`object`)return{found:!1};if(Array.isArray(current)){if(!isIndexSegment(segment))return{found:!1};let index=Number.parseInt(segment,10);if(!Number.isFinite(index)||index<0||index>=current.length)return{found:!1};current=current[index];continue}let record=current;if(!(segment in record))return{found:!1};current=record[segment]}return{found:!0,value:current}}function setAtPath(root,path,value){let current=root;for(let i=0;i<path.length-1;i+=1){let segment=path[i],next=path[i+1],nextIsIndex=!!(next&&isIndexSegment(next));if(Array.isArray(current)){if(!isIndexSegment(segment))throw Error(`Expected numeric index for array segment "${segment}"`);let index=Number.parseInt(segment,10),existing=current[index];(!existing||typeof existing!=`object`)&&(current[index]=nextIsIndex?[]:{}),current=current[index];continue}if(!current||typeof current!=`object`)throw Error(`Cannot traverse into "${segment}" (not an object)`);let record=current,existing=record[segment];(!existing||typeof existing!=`object`)&&(record[segment]=nextIsIndex?[]:{}),current=record[segment]}let last=path[path.length-1];if(Array.isArray(current)){if(!isIndexSegment(last))throw Error(`Expected numeric index for array segment "${last}"`);let index=Number.parseInt(last,10);current[index]=value;return}if(!current||typeof current!=`object`)throw Error(`Cannot set "${last}" (parent is not an object)`);current[last]=value}function unsetAtPath(root,path){let current=root;for(let i=0;i<path.length-1;i+=1){let segment=path[i];if(!current||typeof current!=`object`)return!1;if(Array.isArray(current)){if(!isIndexSegment(segment))return!1;let index=Number.parseInt(segment,10);if(!Number.isFinite(index)||index<0||index>=current.length)return!1;current=current[index];continue}let record=current;if(!(segment in record))return!1;current=record[segment]}let last=path[path.length-1];if(Array.isArray(current)){if(!isIndexSegment(last))return!1;let index=Number.parseInt(last,10);return!Number.isFinite(index)||index<0||index>=current.length?!1:(current.splice(index,1),!0)}if(!current||typeof current!=`object`)return!1;let record=current;return last in record?(delete record[last],!0):!1}async function loadValidConfig(runtime=defaultRuntime){let snapshot=await readConfigFileSnapshot();if(snapshot.valid)return snapshot;runtime.error(`Config invalid at ${shortenHomePath(snapshot.path)}.`);for(let issue of snapshot.issues)runtime.error(`- ${issue.path||`<root>`}: ${issue.message}`);return runtime.error(`Run \`${formatCliCommand(`builderforce doctor`)}\` to repair, then retry.`),runtime.exit(1),snapshot}function parseRequiredPath(path){let parsedPath=parsePath(path);if(parsedPath.length===0)throw Error(`Path is empty.`);return parsedPath}async function runConfigGet(opts){let runtime=opts.runtime??defaultRuntime;try{let parsedPath=parseRequiredPath(opts.path),res=getAtPath((await loadValidConfig(runtime)).config,parsedPath);if(!res.found){runtime.error(danger(`Config path not found: ${opts.path}`)),runtime.exit(1);return}if(opts.json){runtime.log(JSON.stringify(res.value??null,null,2));return}if(typeof res.value==`string`||typeof res.value==`number`||typeof res.value==`boolean`){runtime.log(String(res.value));return}runtime.log(JSON.stringify(res.value??null,null,2))}catch(err){runtime.error(danger(String(err))),runtime.exit(1)}}async function runConfigUnset(opts){let runtime=opts.runtime??defaultRuntime;try{let parsedPath=parseRequiredPath(opts.path),snapshot=await loadValidConfig(runtime),next=structuredClone(snapshot.resolved);if(!unsetAtPath(next,parsedPath)){runtime.error(danger(`Config path not found: ${opts.path}`)),runtime.exit(1);return}await writeConfigFile(next),runtime.log(info(`Removed ${opts.path}. Restart the gateway to apply.`))}catch(err){runtime.error(danger(String(err))),runtime.exit(1)}}function registerConfigCli(program){let cmd=program.command(`config`).description(`Non-interactive config helpers (get/set/unset). Run without subcommand for the setup wizard.`).addHelpText(`after`,()=>`\n${theme.muted(`Docs:`)} ${formatDocsLink(`/cli/config`,`docs.builderforce.ai/cli/config`)}\n`).option(`--section <section>`,`Configure wizard sections (repeatable). Use with no subcommand.`,(value,previous)=>[...previous,value],[]).action(async opts=>{let{configureCommandFromSectionsArg}=await import(`./configure-
|
|
1
|
+
import"./paths-BHg-VHB4.js";import"./registry-Cv7CoWAs.js";import{D as danger,O as info,S as shortenHomePath,z as theme}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import"./boolean-ssGoaBPk.js";import"./env-BoE8QSib.js";import"./auth-profiles-BARnVAUE.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import{a as readConfigFileSnapshot,c as writeConfigFile}from"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import{t as formatDocsLink}from"./links-B6LU5cXN.js";import JSON5 from"json5";function isIndexSegment(raw){return/^[0-9]+$/.test(raw)}function parsePath(raw){let trimmed=raw.trim();if(!trimmed)return[];let parts=[],current=``,i=0;for(;i<trimmed.length;){let ch=trimmed[i];if(ch===`\\`){let next=trimmed[i+1];next&&(current+=next),i+=2;continue}if(ch===`.`){current&&parts.push(current),current=``,i+=1;continue}if(ch===`[`){current&&parts.push(current),current=``;let close=trimmed.indexOf(`]`,i);if(close===-1)throw Error(`Invalid path (missing "]"): ${raw}`);let inside=trimmed.slice(i+1,close).trim();if(!inside)throw Error(`Invalid path (empty "[]"): ${raw}`);parts.push(inside),i=close+1;continue}current+=ch,i+=1}return current&&parts.push(current),parts.map(part=>part.trim()).filter(Boolean)}function parseValue(raw,opts){let trimmed=raw.trim();if(opts.json)try{return JSON5.parse(trimmed)}catch(err){throw Error(`Failed to parse JSON5 value: ${String(err)}`,{cause:err})}try{return JSON5.parse(trimmed)}catch{return raw}}function getAtPath(root,path){let current=root;for(let segment of path){if(!current||typeof current!=`object`)return{found:!1};if(Array.isArray(current)){if(!isIndexSegment(segment))return{found:!1};let index=Number.parseInt(segment,10);if(!Number.isFinite(index)||index<0||index>=current.length)return{found:!1};current=current[index];continue}let record=current;if(!(segment in record))return{found:!1};current=record[segment]}return{found:!0,value:current}}function setAtPath(root,path,value){let current=root;for(let i=0;i<path.length-1;i+=1){let segment=path[i],next=path[i+1],nextIsIndex=!!(next&&isIndexSegment(next));if(Array.isArray(current)){if(!isIndexSegment(segment))throw Error(`Expected numeric index for array segment "${segment}"`);let index=Number.parseInt(segment,10),existing=current[index];(!existing||typeof existing!=`object`)&&(current[index]=nextIsIndex?[]:{}),current=current[index];continue}if(!current||typeof current!=`object`)throw Error(`Cannot traverse into "${segment}" (not an object)`);let record=current,existing=record[segment];(!existing||typeof existing!=`object`)&&(record[segment]=nextIsIndex?[]:{}),current=record[segment]}let last=path[path.length-1];if(Array.isArray(current)){if(!isIndexSegment(last))throw Error(`Expected numeric index for array segment "${last}"`);let index=Number.parseInt(last,10);current[index]=value;return}if(!current||typeof current!=`object`)throw Error(`Cannot set "${last}" (parent is not an object)`);current[last]=value}function unsetAtPath(root,path){let current=root;for(let i=0;i<path.length-1;i+=1){let segment=path[i];if(!current||typeof current!=`object`)return!1;if(Array.isArray(current)){if(!isIndexSegment(segment))return!1;let index=Number.parseInt(segment,10);if(!Number.isFinite(index)||index<0||index>=current.length)return!1;current=current[index];continue}let record=current;if(!(segment in record))return!1;current=record[segment]}let last=path[path.length-1];if(Array.isArray(current)){if(!isIndexSegment(last))return!1;let index=Number.parseInt(last,10);return!Number.isFinite(index)||index<0||index>=current.length?!1:(current.splice(index,1),!0)}if(!current||typeof current!=`object`)return!1;let record=current;return last in record?(delete record[last],!0):!1}async function loadValidConfig(runtime=defaultRuntime){let snapshot=await readConfigFileSnapshot();if(snapshot.valid)return snapshot;runtime.error(`Config invalid at ${shortenHomePath(snapshot.path)}.`);for(let issue of snapshot.issues)runtime.error(`- ${issue.path||`<root>`}: ${issue.message}`);return runtime.error(`Run \`${formatCliCommand(`builderforce doctor`)}\` to repair, then retry.`),runtime.exit(1),snapshot}function parseRequiredPath(path){let parsedPath=parsePath(path);if(parsedPath.length===0)throw Error(`Path is empty.`);return parsedPath}async function runConfigGet(opts){let runtime=opts.runtime??defaultRuntime;try{let parsedPath=parseRequiredPath(opts.path),res=getAtPath((await loadValidConfig(runtime)).config,parsedPath);if(!res.found){runtime.error(danger(`Config path not found: ${opts.path}`)),runtime.exit(1);return}if(opts.json){runtime.log(JSON.stringify(res.value??null,null,2));return}if(typeof res.value==`string`||typeof res.value==`number`||typeof res.value==`boolean`){runtime.log(String(res.value));return}runtime.log(JSON.stringify(res.value??null,null,2))}catch(err){runtime.error(danger(String(err))),runtime.exit(1)}}async function runConfigUnset(opts){let runtime=opts.runtime??defaultRuntime;try{let parsedPath=parseRequiredPath(opts.path),snapshot=await loadValidConfig(runtime),next=structuredClone(snapshot.resolved);if(!unsetAtPath(next,parsedPath)){runtime.error(danger(`Config path not found: ${opts.path}`)),runtime.exit(1);return}await writeConfigFile(next),runtime.log(info(`Removed ${opts.path}. Restart the gateway to apply.`))}catch(err){runtime.error(danger(String(err))),runtime.exit(1)}}function registerConfigCli(program){let cmd=program.command(`config`).description(`Non-interactive config helpers (get/set/unset). Run without subcommand for the setup wizard.`).addHelpText(`after`,()=>`\n${theme.muted(`Docs:`)} ${formatDocsLink(`/cli/config`,`docs.builderforce.ai/cli/config`)}\n`).option(`--section <section>`,`Configure wizard sections (repeatable). Use with no subcommand.`,(value,previous)=>[...previous,value],[]).action(async opts=>{let{configureCommandFromSectionsArg}=await import(`./configure-Dp71zeJI.js`);await configureCommandFromSectionsArg(opts.section,defaultRuntime)});cmd.command(`get`).description(`Get a config value by dot path`).argument(`<path>`,`Config path (dot or bracket notation)`).option(`--json`,`Output JSON`,!1).action(async(path,opts)=>{await runConfigGet({path,json:!!opts.json})}),cmd.command(`set`).description(`Set a config value by dot path`).argument(`<path>`,`Config path (dot or bracket notation)`).argument(`<value>`,`Value (JSON5 or raw string)`).option(`--json`,`Parse value as JSON5 (required)`,!1).action(async(path,value,opts)=>{try{let parsedPath=parsePath(path);if(parsedPath.length===0)throw Error(`Path is empty.`);let parsedValue=parseValue(value,opts),snapshot=await loadValidConfig(),next=structuredClone(snapshot.resolved);setAtPath(next,parsedPath,parsedValue),await writeConfigFile(next),defaultRuntime.log(info(`Updated ${path}. Restart the gateway to apply.`))}catch(err){defaultRuntime.error(danger(String(err))),defaultRuntime.exit(1)}}),cmd.command(`unset`).description(`Remove a config value by dot path`).argument(`<path>`,`Config path (dot or bracket notation)`).action(async path=>{await runConfigUnset({path})})}export{registerConfigCli,runConfigGet,runConfigUnset};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as CONFIG_PATH,u as resolveGatewayPort}from"./paths-5FcIFMsj.js";import{C as shortenHomePath,b as resolveUserPath}from"./utils-DbaBVFaK.js";import{i as defaultRuntime}from"./subsystem-B3TqcCrZ.js";import{Gt as ensureAuthProfileStore}from"./model-selection-DX_WOc2P.js";import{t as formatCliCommand}from"./command-format-Dd7BgZsg.js";import{a as readConfigFileSnapshot,c as writeConfigFile,r as loadConfig}from"./io-YzT_09GD.js";import{a as findTailscaleBinary}from"./tailscale-B-VKIlWm.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-COtQnUML.js";import{n as withProgress}from"./progress-OKwbfa23.js";import{a as ensureWorkspaceAndSessions,b as waitForGatewayReachable,f as printWizardHeader,g as resolveControlUiLinks,m as randomToken,n as applyWizardMetadata,p as probeGatewayReachable,s as guardCancel,t as DEFAULT_WORKSPACE,u as normalizeGatewayTokenInput,v as summarizeExistingConfig,y as validateGatewayPasswordInput}from"./onboard-helpers-CPmBeDvt.js";import{n as stylePromptMessage,r as stylePromptTitle,t as stylePromptHint}from"./prompt-style-BwwmGo3-.js";import{t as note$1}from"./note-CvzMolLy.js";import{t as WizardCancelledError}from"./prompts-Yv4eTTSo.js";import{t as createClackPrompter}from"./clack-prompter-6Booc-eg.js";import{n as setupChannels,t as noteChannelStatus}from"./onboard-channels-
|
|
1
|
+
import{t as CONFIG_PATH,u as resolveGatewayPort}from"./paths-5FcIFMsj.js";import{C as shortenHomePath,b as resolveUserPath}from"./utils-DbaBVFaK.js";import{i as defaultRuntime}from"./subsystem-B3TqcCrZ.js";import{Gt as ensureAuthProfileStore}from"./model-selection-DX_WOc2P.js";import{t as formatCliCommand}from"./command-format-Dd7BgZsg.js";import{a as readConfigFileSnapshot,c as writeConfigFile,r as loadConfig}from"./io-YzT_09GD.js";import{a as findTailscaleBinary}from"./tailscale-B-VKIlWm.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-COtQnUML.js";import{n as withProgress}from"./progress-OKwbfa23.js";import{a as ensureWorkspaceAndSessions,b as waitForGatewayReachable,f as printWizardHeader,g as resolveControlUiLinks,m as randomToken,n as applyWizardMetadata,p as probeGatewayReachable,s as guardCancel,t as DEFAULT_WORKSPACE,u as normalizeGatewayTokenInput,v as summarizeExistingConfig,y as validateGatewayPasswordInput}from"./onboard-helpers-CPmBeDvt.js";import{n as stylePromptMessage,r as stylePromptTitle,t as stylePromptHint}from"./prompt-style-BwwmGo3-.js";import{t as note$1}from"./note-CvzMolLy.js";import{t as WizardCancelledError}from"./prompts-Yv4eTTSo.js";import{t as createClackPrompter}from"./clack-prompter-6Booc-eg.js";import{n as setupChannels,t as noteChannelStatus}from"./onboard-channels-DXIqdoto.js";import{a as gatewayInstallErrorHint,i as buildGatewayInstallPlan,n as GATEWAY_DAEMON_RUNTIME_OPTIONS,t as DEFAULT_GATEWAY_DAEMON_RUNTIME}from"./daemon-runtime-CHo7loUb.js";import{t as resolveGatewayService}from"./service-BXrSjb3e.js";import{r as healthCommand}from"./health-Cuh0tZl2.js";import{t as ensureControlUiAssetsBuilt}from"./control-ui-assets-CAmSpVpE.js";import{n as logConfigUpdated}from"./logging-9jbJihk2.js";import{t as promptAuthChoiceGrouped}from"./auth-choice-prompt-D_tSFWQL.js";import{t as applyAuthChoice}from"./auth-choice.apply-s_rOXFVz.js";import{a as promptModelAllowlist,i as promptDefaultModel,n as applyModelFallbacksFromSelection,r as applyPrimaryModel,t as applyModelAllowlist}from"./model-picker-CjrWGzFG.js";import{t as resolvePreferredProviderForAuthChoice}from"./auth-choice-C2dJKM2r.js";import{t as ensureSystemdUserLingerInteractive}from"./systemd-linger-RhNkOjuf.js";import{i as promptCustomApiConfig}from"./onboard-custom-B3GdG4Gx.js";import{i as TAILSCALE_MISSING_BIN_NOTE_LINES,n as TAILSCALE_DOCS_LINES,r as TAILSCALE_EXPOSURE_OPTIONS,t as validateIPv4AddressInput}from"./ipv4-DJDmQRim.js";import{t as formatHealthCheckFailure}from"./health-format-COHxl9I_.js";import{t as promptRemoteGatewayConfig}from"./onboard-remote-BPylJrvo.js";import{t as setupSkills}from"./onboard-skills-CQvyZvdZ.js";import{confirm,intro,outro,select,text}from"@clack/prompts";const CONFIGURE_WIZARD_SECTIONS=[`workspace`,`model`,`web`,`gateway`,`daemon`,`channels`,`skills`,`health`];function parseConfigureWizardSections(raw){let sectionsRaw=Array.isArray(raw)?raw.map(value=>typeof value==`string`?value.trim():``).filter(Boolean):[];if(sectionsRaw.length===0)return{sections:[],invalid:[]};let invalid=sectionsRaw.filter(s=>!CONFIGURE_WIZARD_SECTIONS.includes(s));return{sections:sectionsRaw.filter(s=>CONFIGURE_WIZARD_SECTIONS.includes(s)),invalid}}const CONFIGURE_SECTION_OPTIONS=[{value:`workspace`,label:`Workspace`,hint:`Set workspace + sessions`},{value:`model`,label:`Model`,hint:`Pick provider + credentials`},{value:`web`,label:`Web tools`,hint:`Configure Brave search + fetch`},{value:`gateway`,label:`Gateway`,hint:`Port, bind, auth, tailscale`},{value:`daemon`,label:`Daemon`,hint:`Install/manage the background service`},{value:`channels`,label:`Channels`,hint:`Link WhatsApp/Telegram/etc and defaults`},{value:`skills`,label:`Skills`,hint:`Install/enable workspace skills`},{value:`health`,label:`Health check`,hint:`Run gateway + channel checks`}],intro$1=message=>intro(stylePromptTitle(message)??message),outro$1=message=>outro(stylePromptTitle(message)??message),text$1=params=>text({...params,message:stylePromptMessage(params.message)}),confirm$1=params=>confirm({...params,message:stylePromptMessage(params.message)}),select$1=params=>select({...params,message:stylePromptMessage(params.message),options:params.options.map(opt=>opt.hint===void 0?opt:{...opt,hint:stylePromptHint(opt.hint)})});async function removeChannelConfigWizard(cfg,runtime){let next={...cfg},listConfiguredChannels=()=>listChannelPlugins().map(plugin=>plugin.meta).filter(meta=>next.channels?.[meta.id]!==void 0);for(;;){let configured=listConfiguredChannels();if(configured.length===0)return note$1([`No channel config found in builderforce.json.`,`Tip: \`${formatCliCommand(`builderforce channels status`)}\` shows what is configured and enabled.`].join(`
|
|
2
2
|
`),`Remove channel`),next;let channel=guardCancel(await select$1({message:`Remove which channel config?`,options:[...configured.map(meta=>({value:meta.id,label:meta.label,hint:`Deletes tokens + settings from config (credentials stay on disk)`})),{value:`done`,label:`Done`}]}),runtime);if(channel===`done`)return next;let label=getChannelPlugin(channel)?.meta.label??channel;if(!guardCancel(await confirm$1({message:`Delete ${label} configuration from ${shortenHomePath(CONFIG_PATH)}?`,initialValue:!1}),runtime))continue;let nextChannels={...next.channels};delete nextChannels[channel],next={...next,channels:Object.keys(nextChannels).length?nextChannels:void 0},note$1([`${label} removed from config.`,`Note: credentials/sessions on disk are unchanged.`].join(`
|
|
3
3
|
`),`Channel removed`)}}async function maybeInstallDaemon(params){let service=resolveGatewayService(),loaded=await service.isLoaded({env:process.env}),shouldCheckLinger=!1,shouldInstall=!0,daemonRuntime=params.daemonRuntime??DEFAULT_GATEWAY_DAEMON_RUNTIME;if(loaded){let action=guardCancel(await select$1({message:`Gateway service already installed`,options:[{value:`restart`,label:`Restart`},{value:`reinstall`,label:`Reinstall`},{value:`skip`,label:`Skip`}]}),params.runtime);if(action===`restart`&&(await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Restarting Gateway service…`),await service.restart({env:process.env,stdout:process.stdout}),progress.setLabel(`Gateway service restarted.`)}),shouldCheckLinger=!0,shouldInstall=!1),action===`skip`)return;action===`reinstall`&&await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Uninstalling Gateway service…`),await service.uninstall({env:process.env,stdout:process.stdout}),progress.setLabel(`Gateway service uninstalled.`)})}if(shouldInstall){let installError=null;if(params.daemonRuntime||(daemonRuntime=GATEWAY_DAEMON_RUNTIME_OPTIONS.length===1?GATEWAY_DAEMON_RUNTIME_OPTIONS[0]?.value??DEFAULT_GATEWAY_DAEMON_RUNTIME:guardCancel(await select$1({message:`Gateway service runtime`,options:GATEWAY_DAEMON_RUNTIME_OPTIONS,initialValue:DEFAULT_GATEWAY_DAEMON_RUNTIME}),params.runtime)),await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Preparing Gateway service…`);let cfg=loadConfig(),{programArguments,workingDirectory,environment}=await buildGatewayInstallPlan({env:process.env,port:params.port,token:params.gatewayToken,runtime:daemonRuntime,warn:(message,title)=>note$1(message,title),config:cfg});progress.setLabel(`Installing Gateway service…`);try{await service.install({env:process.env,stdout:process.stdout,programArguments,workingDirectory,environment}),progress.setLabel(`Gateway service installed.`)}catch(err){installError=err instanceof Error?err.message:String(err),progress.setLabel(`Gateway service install failed.`)}}),installError){note$1(`Gateway service install failed: `+installError,`Gateway`),note$1(gatewayInstallErrorHint(),`Gateway`);return}shouldCheckLinger=!0}shouldCheckLinger&&await ensureSystemdUserLingerInteractive({runtime:params.runtime,prompter:{confirm:async p=>guardCancel(await confirm$1(p),params.runtime),note:note$1},reason:`Linux installs use a systemd user service. Without lingering, systemd stops the user session on logout/idle and kills the Gateway.`,requireConfirm:!0})}function sanitizeTokenValue(value){if(typeof value!=`string`)return;let trimmed=value.trim();if(!(!trimmed||trimmed===`undefined`||trimmed===`null`))return trimmed}const ANTHROPIC_OAUTH_MODEL_KEYS=[`anthropic/claude-sonnet-4-6`,`anthropic/claude-opus-4-6`,`anthropic/claude-opus-4-5`,`anthropic/claude-sonnet-4-5`,`anthropic/claude-haiku-4-5`];function buildGatewayAuthConfig(params){let allowTailscale=params.existing?.allowTailscale,base={};if(typeof allowTailscale==`boolean`&&(base.allowTailscale=allowTailscale),params.mode===`token`){let token=sanitizeTokenValue(params.token)??randomToken();return{...base,mode:`token`,token}}if(params.mode===`password`){let password=params.password?.trim();return{...base,mode:`password`,...password&&{password}}}if(params.mode===`trusted-proxy`){if(!params.trustedProxy)throw Error(`trustedProxy config is required when mode is trusted-proxy`);return{...base,mode:`trusted-proxy`,trustedProxy:params.trustedProxy}}return base}async function promptAuthConfig(cfg,runtime,prompter){let authChoice=await promptAuthChoiceGrouped({prompter,store:await ensureAuthProfileStore(void 0,{allowKeychainPrompt:!1}),includeSkip:!0}),next=cfg;if(authChoice===`custom-api-key`)next=(await promptCustomApiConfig({prompter,runtime,config:next})).config;else if(authChoice!==`skip`)next=(await applyAuthChoice({authChoice,config:next,prompter,runtime,setDefaultModel:!0})).config;else{let modelSelection=await promptDefaultModel({config:next,prompter,allowKeep:!0,ignoreAllowlist:!0,preferredProvider:resolvePreferredProviderForAuthChoice(authChoice)});modelSelection.config&&(next=modelSelection.config),modelSelection.model&&(next=applyPrimaryModel(next,modelSelection.model))}let anthropicOAuth=authChoice===`setup-token`||authChoice===`token`||authChoice===`oauth`;if(authChoice!==`custom-api-key`){let allowlistSelection=await promptModelAllowlist({config:next,prompter,allowedKeys:anthropicOAuth?ANTHROPIC_OAUTH_MODEL_KEYS:void 0,initialSelections:anthropicOAuth?[`anthropic/claude-sonnet-4-6`]:void 0,message:anthropicOAuth?`Anthropic OAuth models`:void 0});allowlistSelection.models&&(next=applyModelAllowlist(next,allowlistSelection.models),next=applyModelFallbacksFromSelection(next,allowlistSelection.models))}return next}async function promptGatewayConfig(cfg,runtime){let portRaw=guardCancel(await text$1({message:`Gateway port`,initialValue:String(resolveGatewayPort(cfg)),validate:value=>Number.isFinite(Number(value))?void 0:`Invalid port`}),runtime),port=Number.parseInt(String(portRaw),10),bind=guardCancel(await select$1({message:`Gateway bind mode`,options:[{value:`loopback`,label:`Loopback (Local only)`,hint:`Bind to 127.0.0.1 - secure, local-only access`},{value:`tailnet`,label:`Tailnet (Tailscale IP)`,hint:`Bind to your Tailscale IP only (100.x.x.x)`},{value:`auto`,label:`Auto (Loopback → LAN)`,hint:`Prefer loopback; fall back to all interfaces if unavailable`},{value:`lan`,label:`LAN (All interfaces)`,hint:`Bind to 0.0.0.0 - accessible from anywhere on your network`},{value:`custom`,label:`Custom IP`,hint:`Specify a specific IP address, with 0.0.0.0 fallback if unavailable`}]}),runtime),customBindHost;if(bind===`custom`){let input=guardCancel(await text$1({message:`Custom IP address`,placeholder:`192.168.1.100`,validate:validateIPv4AddressInput}),runtime);customBindHost=typeof input==`string`?input:void 0}let authMode=guardCancel(await select$1({message:`Gateway auth`,options:[{value:`token`,label:`Token`,hint:`Recommended default`},{value:`password`,label:`Password`},{value:`trusted-proxy`,label:`Trusted Proxy`,hint:`Behind reverse proxy (Pomerium, Caddy, Traefik, etc.)`}],initialValue:`token`}),runtime),tailscaleMode=guardCancel(await select$1({message:`Tailscale exposure`,options:[...TAILSCALE_EXPOSURE_OPTIONS]}),runtime);tailscaleMode!==`off`&&(await findTailscaleBinary()||note$1(TAILSCALE_MISSING_BIN_NOTE_LINES.join(`
|
|
4
4
|
`),`Tailscale Warning`));let tailscaleResetOnExit=!1;tailscaleMode!==`off`&&(note$1(TAILSCALE_DOCS_LINES.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-
|
|
1
|
+
import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-3FEGD_4b.js";import"./reply-CpGH-3If.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import"./exec-DdcIjeyn.js";import"./agent-scope-DPtjOxzp.js";import"./model-selection-DX_WOc2P.js";import"./env-file-BI2jpOmF.js";import"./boolean-Cn4K2fc9.js";import"./env-BHP32i7Q.js";import"./io-YzT_09GD.js";import"./manifest-registry-BVDm_CP0.js";import"./config-8x9ZIdfF.js";import"./runner-C651oVfk.js";import"./model-catalog-C7PdRY6w.js";import"./sandbox-DzuXOMNa.js";import"./chrome-Dk-WNIhp.js";import"./tailscale-B-VKIlWm.js";import"./auth-CDcrUXYB.js";import"./server-context-DsuST81W.js";import"./frontmatter-DyJ2unbL.js";import"./skills-B4r9m770.js";import"./plugin-skills-C39wi4uD.js";import"./routes-DoGqdgOP.js";import"./redact-C3oo7_aY.js";import"./errors-CjmtpPBP.js";import"./paths-C1QKdGJX.js";import"./ssrf-4MnoQ7Sz.js";import"./image-ops-CONrkLJK.js";import"./store-BoTKCB2d.js";import"./ports-BNC_iRpw.js";import"./trash-Czxs8cUf.js";import"./sessions-OZNhnSwZ.js";import"./message-channel-DrfCCUg4.js";import"./plugins-COtQnUML.js";import"./accounts-CTKk3xPO.js";import"./accounts-DFqpWzeU.js";import"./accounts-CbQihLRU.js";import"./bindings-DMDv84HS.js";import"./send-Dmzp1gNF.js";import"./send-DEgD1Cfd.js";import"./paths-CkcK939O.js";import"./src-D2-7sOAX.js";import"./tool-images-DsKy1uNN.js";import"./tool-display-TRKLY-yH.js";import"./fetch-guard-BQuCLA1C.js";import"./api-key-rotation-ChHXb1Pq.js";import"./fetch-CDeJQlzN.js";import"./sqlite-DEiKj1vi.js";import"./tokens-Ct4DyfhX.js";import"./project-context-store-BS994lZX.js";import"./with-timeout-YbYylXgf.js";import"./deliver-XGIFv80r.js";import"./send-DlPwTVpG.js";import"./workspace-ChbaDWgp.js";import"./reply-prefix-BwtP84WV.js";import"./memory-cli-DWEtZrJ5.js";import"./manager-VPNjVm0W.js";import"./retry-Jis-ZZfm.js";import"./client-DhlZRznX.js";import"./call-DwWslKWv.js";import"./common-NHQnma5l.js";import"./chunk-h7FZEwW2.js";import"./markdown-tables-DOq8FfUr.js";import"./ir-AM9J0QtO.js";import"./render-CSLaFZoy.js";import"./builderforcellm-syscheck-DGZKIwPC.js";import"./send-DglIOKdS.js";import"./outbound-attachment-TWzrIR9Q.js";import"./fetch-B6_hd7w9.js";import"./delivery-queue-BZWZDdpJ.js";import"./channel-activity-qRD5c3VV.js";import"./tables-DirB1oU7.js";import"./pairing-store-DIpKOfDK.js";import"./links-CYRGsVCu.js";import"./cli-utils-BLNnV_WG.js";import"./help-format-NhTn4dWd.js";import"./progress-OKwbfa23.js";import"./resolve-route-BvfmiLqC.js";import"./replies-BoxyKuBS.js";import"./refresh-DgTiir08.js";import"./coding-tools.policy-BJQuylwM.js";import"./send-BgdpJymE.js";import"./onboard-helpers-CPmBeDvt.js";import"./prompt-style-BwwmGo3-.js";import"./pairing-labels-CELZqNBC.js";import"./session-cost-usage-pgxrRRW4.js";import"./provider-usage-CbH7sm73.js";import"./active-listener-DBdxNyOd.js";import"./exec-approvals-kmxxyvIe.js";import"./nodes-screen-BWDONgPE.js";import"./project-context-Cg0S9eFT.js";import"./control-service-BhSaBRxC.js";import"./stagger-NaB6u1z1.js";import"./channel-selection-CQ5MM7Hi.js";import"./mamba-state-engine-BloJzrxU.js";import"./transformers-stream-QS2dnQob.js";import"./runtime-guard-BiPTd1ED.js";import"./catalog-BsxosmSt.js";import"./skills-status-DPBxzSMt.js";import"./note-CvzMolLy.js";import"./clack-prompter-6Booc-eg.js";import"./helpers-_XD3UAOf.js";import"./plugin-auto-enable-CFshBQKJ.js";import"./install-safe-path-BUT0oL1h.js";import"./npm-registry-spec-BKmYHCba.js";import"./skill-scanner-Bf_eBctK.js";import"./installs-D6Sfl7VX.js";import"./onboard-channels-DXIqdoto.js";import"./daemon-runtime-CHo7loUb.js";import"./systemd-CTHIdkg9.js";import"./service-BXrSjb3e.js";import"./widearea-dns-Dc2di-mD.js";import"./bonjour-discovery-B4vcsJ5w.js";import"./health-Cuh0tZl2.js";import"./control-ui-assets-CAmSpVpE.js";import"./skills-install-CZbHR42n.js";import"./shared-eZqGzEHT.js";import"./onboard-auth.credentials-YrdiGOgn.js";import"./auth-token-CWT7TW8z.js";import"./logging-9jbJihk2.js";import"./provider-auth-helpers-9Ut-MHV9.js";import"./auth-choice.apply-s_rOXFVz.js";import"./openai-model-default-DR3m7RLi.js";import"./model-picker-CjrWGzFG.js";import"./auth-choice.apply.transformers-DXBWOilg.js";import"./auth-choice-C2dJKM2r.js";import{n as configureCommandFromSectionsArg}from"./configure-1e4C38zp.js";import"./systemd-linger-RhNkOjuf.js";import"./onboard-custom-B3GdG4Gx.js";import"./health-format-COHxl9I_.js";import"./onboard-remote-BPylJrvo.js";import"./onboard-skills-CQvyZvdZ.js";export{configureCommandFromSectionsArg};
|
|
@@ -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-BARnVAUE.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import"./model-discovery-DxpimsRF.js";import"./model-catalog-wcISK04b.js";import"./frontmatter-DgRc5y_l.js";import"./skills-W00EPvKR.js";import"./plugin-skills-BSUncenp.js";import"./skills-status-BCwjn1Id.js";import"./refresh-bgGvF0aF.js";import"./client-DeQ0LbP9.js";import"./call-CjC3SRPv.js";import"./message-channel-C-yw5fZm.js";import"./subagent-registry-
|
|
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-BARnVAUE.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import"./model-discovery-DxpimsRF.js";import"./model-catalog-wcISK04b.js";import"./frontmatter-DgRc5y_l.js";import"./skills-W00EPvKR.js";import"./plugin-skills-BSUncenp.js";import"./skills-status-BCwjn1Id.js";import"./refresh-bgGvF0aF.js";import"./client-DeQ0LbP9.js";import"./call-CjC3SRPv.js";import"./message-channel-C-yw5fZm.js";import"./subagent-registry-BUKplZi1.js";import"./sessions-ko0LxxGk.js";import"./src-BM8G-tIl.js";import"./project-context-store-BSIWJD6S.js";import"./tokens-BNwTTeJb.js";import"./plugins-DJGW_fnS.js";import"./accounts-Z5bJpNrG.js";import"./bindings-D0uket3l.js";import"./send-gG3CFJwv.js";import"./send-DqJCViFb.js";import"./with-timeout-By0c7Ur9.js";import"./deliver-DFhj1d_t.js";import"./accounts-DoJYLMfS.js";import"./send-mCN63Hkn.js";import"./image-ops-Bg9yFwjX.js";import"./redact-bWj_-q3j.js";import"./errors-t5wHPcwh.js";import"./embedded-helpers-DGDYymYx.js";import"./sandbox-BcH7kS1y.js";import"./chrome-IJYO1tSE.js";import"./tailscale-CgCG7AVQ.js";import"./auth-B4Kn3eee.js";import"./server-context-D3iiIzvV.js";import"./routes-7QTsp3sA.js";import"./paths-GamzES41.js";import"./ssrf-BiSQzdcA.js";import"./store-C5LmVaEC.js";import"./ports-LqFTyTSK.js";import"./trash-zs6gNxed.js";import"./accounts-BT-NzzBc.js";import"./paths-BQ9W7Bs0.js";import"./tool-images-DV2HMmx4.js";import"./workspace-Cz9mCy0P.js";import"./reply-prefix-9hmbzubX.js";import"./sqlite-BEgCClMz.js";import"./memory-cli-COgt0ROi.js";import"./manager-Cob4Ofzr.js";import"./gemini-auth-BZgBIY0M.js";import"./retry-Cc6xusE8.js";import"./common-BRdxH-uH.js";import"./runner-BLCTET8O.js";import"./tool-display-BIswnHaq.js";import"./chunk-UPhdkZNp.js";import"./markdown-tables-CpqWBduK.js";import"./fetch-guard-CoGEds8D.js";import"./fetch-CUsKv8oj.js";import"./ir-6L-eU4id.js";import"./render-1ABBE2Y6.js";import"./builderforcellm-syscheck-CfFrfeV2.js";import"./session-utils-VCGKYbgW.js";import"./coding-tools.policy-DIeVRurg.js";import"./pairing-store-tegvJa08.js";import"./fetch-CrbOFvsL.js";import"./exec-approvals-Cn0K-HtJ.js";import"./nodes-screen-OI7tHqlU.js";import"./session-cost-usage-BgZfN_WR.js";import"./provider-usage-BLkm6ojE.js";import"./send-BIR1Jhc5.js";import"./outbound-attachment-3GZbMqo1.js";import"./delivery-queue-DQXq7KUU.js";import"./project-context-C5KLsMTc.js";import"./control-service-Cml__v8i.js";import"./stagger-CUH5rlmS.js";import"./channel-selection-DFf_nAm7.js";import"./send-9rUcCK7O.js";import"./resolve-route-D3X-bXU-.js";import"./channel-activity-By7lsk7N.js";import"./tables-DZSV6me6.js";import"./links-B6LU5cXN.js";import"./cli-utils-ByV85M53.js";import"./help-format-DIDk_7gh.js";import"./progress-BQMO_-7I.js";import"./replies-CL0uQgU7.js";import"./onboard-helpers-Di5OXlap.js";import"./prompt-style-CZOeG0sw.js";import"./pairing-labels-DofkNLS2.js";import"./active-listener-BC31MA4v.js";import"./mamba-state-engine-BYmUnYwn.js";import"./transformers-stream-nSL4Xu31.js";import"./catalog-CEJqw4s-.js";import"./note-BvXfFmlu.js";import"./clack-prompter-ZmHdfPGJ.js";import"./helpers-DDS6DSK4.js";import"./plugin-auto-enable-tSxWjjZC.js";import"./install-safe-path-BxCb3BJW.js";import"./npm-registry-spec-DXx5hKYJ.js";import"./skill-scanner-YCbLEfNS.js";import"./installs-BBKikcCJ.js";import"./onboard-channels-V51s9X-h.js";import"./daemon-runtime-Ddsn0FJm.js";import"./runtime-guard-BThrXAmT.js";import"./systemd-DpT8tcbh.js";import"./service-ugwM110q.js";import"./widearea-dns-wtz3t7f_.js";import"./bonjour-discovery-gHRZ7OJJ.js";import"./health-CRIXA8je.js";import"./control-ui-assets-BweA3rDY.js";import"./skills-install-CNueKmie.js";import"./shared-DjBPjC55.js";import"./onboard-auth.credentials-BSSFRvb0.js";import"./auth-token-DGaO7TMn.js";import"./logging-CRzk-5ye.js";import"./provider-auth-helpers-u1GAP4Bi.js";import"./auth-choice.apply-D57XA_d9.js";import"./openai-model-default-DIE-Ey58.js";import"./model-picker-Dl3do2OD.js";import"./auth-choice.apply.transformers-vyvtAxcX.js";import"./auth-choice-Cf4N4Da7.js";import{n as configureCommandFromSectionsArg}from"./configure-NxmuXXEd.js";import"./systemd-linger-CuzOv-tn.js";import"./onboard-custom-BIT8LAFx.js";import"./health-format-CtcXvo40.js";import"./onboard-remote-ClFIcAyi.js";import"./onboard-skills-COZ6KSTI.js";export{configureCommandFromSectionsArg};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as CONFIG_PATH,u as resolveGatewayPort}from"./paths-BHg-VHB4.js";import{S as shortenHomePath,y as resolveUserPath}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import{b as ensureAuthProfileStore}from"./auth-profiles-BARnVAUE.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import{a as readConfigFileSnapshot,c as writeConfigFile,r as loadConfig}from"./io-BySzqKzT.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-DJGW_fnS.js";import{a as findTailscaleBinary}from"./tailscale-CgCG7AVQ.js";import{n as withProgress}from"./progress-BQMO_-7I.js";import{a as ensureWorkspaceAndSessions,b as waitForGatewayReachable,f as printWizardHeader,g as resolveControlUiLinks,m as randomToken,n as applyWizardMetadata,p as probeGatewayReachable,s as guardCancel,t as DEFAULT_WORKSPACE,u as normalizeGatewayTokenInput,v as summarizeExistingConfig,y as validateGatewayPasswordInput}from"./onboard-helpers-Di5OXlap.js";import{n as stylePromptMessage,r as stylePromptTitle,t as stylePromptHint}from"./prompt-style-CZOeG0sw.js";import{t as note$1}from"./note-BvXfFmlu.js";import{t as WizardCancelledError}from"./prompts-BUDxN7ef.js";import{t as createClackPrompter}from"./clack-prompter-ZmHdfPGJ.js";import{n as setupChannels,t as noteChannelStatus}from"./onboard-channels-
|
|
1
|
+
import{t as CONFIG_PATH,u as resolveGatewayPort}from"./paths-BHg-VHB4.js";import{S as shortenHomePath,y as resolveUserPath}from"./utils-BP60e80M.js";import{p as defaultRuntime}from"./subsystem-C4b1Von0.js";import{b as ensureAuthProfileStore}from"./auth-profiles-BARnVAUE.js";import{t as formatCliCommand}from"./command-format-DTMaGKs7.js";import{a as readConfigFileSnapshot,c as writeConfigFile,r as loadConfig}from"./io-BySzqKzT.js";import{n as listChannelPlugins,t as getChannelPlugin}from"./plugins-DJGW_fnS.js";import{a as findTailscaleBinary}from"./tailscale-CgCG7AVQ.js";import{n as withProgress}from"./progress-BQMO_-7I.js";import{a as ensureWorkspaceAndSessions,b as waitForGatewayReachable,f as printWizardHeader,g as resolveControlUiLinks,m as randomToken,n as applyWizardMetadata,p as probeGatewayReachable,s as guardCancel,t as DEFAULT_WORKSPACE,u as normalizeGatewayTokenInput,v as summarizeExistingConfig,y as validateGatewayPasswordInput}from"./onboard-helpers-Di5OXlap.js";import{n as stylePromptMessage,r as stylePromptTitle,t as stylePromptHint}from"./prompt-style-CZOeG0sw.js";import{t as note$1}from"./note-BvXfFmlu.js";import{t as WizardCancelledError}from"./prompts-BUDxN7ef.js";import{t as createClackPrompter}from"./clack-prompter-ZmHdfPGJ.js";import{n as setupChannels,t as noteChannelStatus}from"./onboard-channels-V51s9X-h.js";import{a as gatewayInstallErrorHint,i as buildGatewayInstallPlan,n as GATEWAY_DAEMON_RUNTIME_OPTIONS,t as DEFAULT_GATEWAY_DAEMON_RUNTIME}from"./daemon-runtime-Ddsn0FJm.js";import{t as resolveGatewayService}from"./service-ugwM110q.js";import{r as healthCommand}from"./health-CRIXA8je.js";import{t as ensureControlUiAssetsBuilt}from"./control-ui-assets-BweA3rDY.js";import{n as logConfigUpdated}from"./logging-CRzk-5ye.js";import{t as promptAuthChoiceGrouped}from"./auth-choice-prompt-DvWWxKmC.js";import{t as applyAuthChoice}from"./auth-choice.apply-D57XA_d9.js";import{a as promptModelAllowlist,i as promptDefaultModel,n as applyModelFallbacksFromSelection,r as applyPrimaryModel,t as applyModelAllowlist}from"./model-picker-Dl3do2OD.js";import{t as resolvePreferredProviderForAuthChoice}from"./auth-choice-Cf4N4Da7.js";import{t as ensureSystemdUserLingerInteractive}from"./systemd-linger-CuzOv-tn.js";import{i as promptCustomApiConfig}from"./onboard-custom-BIT8LAFx.js";import{i as TAILSCALE_MISSING_BIN_NOTE_LINES,n as TAILSCALE_DOCS_LINES,r as TAILSCALE_EXPOSURE_OPTIONS,t as validateIPv4AddressInput}from"./ipv4-hAhGHbHe.js";import{t as formatHealthCheckFailure}from"./health-format-CtcXvo40.js";import{t as promptRemoteGatewayConfig}from"./onboard-remote-ClFIcAyi.js";import{t as setupSkills}from"./onboard-skills-COZ6KSTI.js";import{confirm,intro,outro,select,text}from"@clack/prompts";const CONFIGURE_WIZARD_SECTIONS=[`workspace`,`model`,`web`,`gateway`,`daemon`,`channels`,`skills`,`health`];function parseConfigureWizardSections(raw){let sectionsRaw=Array.isArray(raw)?raw.map(value=>typeof value==`string`?value.trim():``).filter(Boolean):[];if(sectionsRaw.length===0)return{sections:[],invalid:[]};let invalid=sectionsRaw.filter(s=>!CONFIGURE_WIZARD_SECTIONS.includes(s));return{sections:sectionsRaw.filter(s=>CONFIGURE_WIZARD_SECTIONS.includes(s)),invalid}}const CONFIGURE_SECTION_OPTIONS=[{value:`workspace`,label:`Workspace`,hint:`Set workspace + sessions`},{value:`model`,label:`Model`,hint:`Pick provider + credentials`},{value:`web`,label:`Web tools`,hint:`Configure Brave search + fetch`},{value:`gateway`,label:`Gateway`,hint:`Port, bind, auth, tailscale`},{value:`daemon`,label:`Daemon`,hint:`Install/manage the background service`},{value:`channels`,label:`Channels`,hint:`Link WhatsApp/Telegram/etc and defaults`},{value:`skills`,label:`Skills`,hint:`Install/enable workspace skills`},{value:`health`,label:`Health check`,hint:`Run gateway + channel checks`}],intro$1=message=>intro(stylePromptTitle(message)??message),outro$1=message=>outro(stylePromptTitle(message)??message),text$1=params=>text({...params,message:stylePromptMessage(params.message)}),confirm$1=params=>confirm({...params,message:stylePromptMessage(params.message)}),select$1=params=>select({...params,message:stylePromptMessage(params.message),options:params.options.map(opt=>opt.hint===void 0?opt:{...opt,hint:stylePromptHint(opt.hint)})});async function removeChannelConfigWizard(cfg,runtime){let next={...cfg},listConfiguredChannels=()=>listChannelPlugins().map(plugin=>plugin.meta).filter(meta=>next.channels?.[meta.id]!==void 0);for(;;){let configured=listConfiguredChannels();if(configured.length===0)return note$1([`No channel config found in builderforce.json.`,`Tip: \`${formatCliCommand(`builderforce channels status`)}\` shows what is configured and enabled.`].join(`
|
|
2
2
|
`),`Remove channel`),next;let channel=guardCancel(await select$1({message:`Remove which channel config?`,options:[...configured.map(meta=>({value:meta.id,label:meta.label,hint:`Deletes tokens + settings from config (credentials stay on disk)`})),{value:`done`,label:`Done`}]}),runtime);if(channel===`done`)return next;let label=getChannelPlugin(channel)?.meta.label??channel;if(!guardCancel(await confirm$1({message:`Delete ${label} configuration from ${shortenHomePath(CONFIG_PATH)}?`,initialValue:!1}),runtime))continue;let nextChannels={...next.channels};delete nextChannels[channel],next={...next,channels:Object.keys(nextChannels).length?nextChannels:void 0},note$1([`${label} removed from config.`,`Note: credentials/sessions on disk are unchanged.`].join(`
|
|
3
3
|
`),`Channel removed`)}}async function maybeInstallDaemon(params){let service=resolveGatewayService(),loaded=await service.isLoaded({env:process.env}),shouldCheckLinger=!1,shouldInstall=!0,daemonRuntime=params.daemonRuntime??DEFAULT_GATEWAY_DAEMON_RUNTIME;if(loaded){let action=guardCancel(await select$1({message:`Gateway service already installed`,options:[{value:`restart`,label:`Restart`},{value:`reinstall`,label:`Reinstall`},{value:`skip`,label:`Skip`}]}),params.runtime);if(action===`restart`&&(await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Restarting Gateway service…`),await service.restart({env:process.env,stdout:process.stdout}),progress.setLabel(`Gateway service restarted.`)}),shouldCheckLinger=!0,shouldInstall=!1),action===`skip`)return;action===`reinstall`&&await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Uninstalling Gateway service…`),await service.uninstall({env:process.env,stdout:process.stdout}),progress.setLabel(`Gateway service uninstalled.`)})}if(shouldInstall){let installError=null;if(params.daemonRuntime||(daemonRuntime=GATEWAY_DAEMON_RUNTIME_OPTIONS.length===1?GATEWAY_DAEMON_RUNTIME_OPTIONS[0]?.value??DEFAULT_GATEWAY_DAEMON_RUNTIME:guardCancel(await select$1({message:`Gateway service runtime`,options:GATEWAY_DAEMON_RUNTIME_OPTIONS,initialValue:DEFAULT_GATEWAY_DAEMON_RUNTIME}),params.runtime)),await withProgress({label:`Gateway service`,indeterminate:!0,delayMs:0},async progress=>{progress.setLabel(`Preparing Gateway service…`);let cfg=loadConfig(),{programArguments,workingDirectory,environment}=await buildGatewayInstallPlan({env:process.env,port:params.port,token:params.gatewayToken,runtime:daemonRuntime,warn:(message,title)=>note$1(message,title),config:cfg});progress.setLabel(`Installing Gateway service…`);try{await service.install({env:process.env,stdout:process.stdout,programArguments,workingDirectory,environment}),progress.setLabel(`Gateway service installed.`)}catch(err){installError=err instanceof Error?err.message:String(err),progress.setLabel(`Gateway service install failed.`)}}),installError){note$1(`Gateway service install failed: `+installError,`Gateway`),note$1(gatewayInstallErrorHint(),`Gateway`);return}shouldCheckLinger=!0}shouldCheckLinger&&await ensureSystemdUserLingerInteractive({runtime:params.runtime,prompter:{confirm:async p=>guardCancel(await confirm$1(p),params.runtime),note:note$1},reason:`Linux installs use a systemd user service. Without lingering, systemd stops the user session on logout/idle and kills the Gateway.`,requireConfirm:!0})}function sanitizeTokenValue(value){if(typeof value!=`string`)return;let trimmed=value.trim();if(!(!trimmed||trimmed===`undefined`||trimmed===`null`))return trimmed}const ANTHROPIC_OAUTH_MODEL_KEYS=[`anthropic/claude-sonnet-4-6`,`anthropic/claude-opus-4-6`,`anthropic/claude-opus-4-5`,`anthropic/claude-sonnet-4-5`,`anthropic/claude-haiku-4-5`];function buildGatewayAuthConfig(params){let allowTailscale=params.existing?.allowTailscale,base={};if(typeof allowTailscale==`boolean`&&(base.allowTailscale=allowTailscale),params.mode===`token`){let token=sanitizeTokenValue(params.token)??randomToken();return{...base,mode:`token`,token}}if(params.mode===`password`){let password=params.password?.trim();return{...base,mode:`password`,...password&&{password}}}if(params.mode===`trusted-proxy`){if(!params.trustedProxy)throw Error(`trustedProxy config is required when mode is trusted-proxy`);return{...base,mode:`trusted-proxy`,trustedProxy:params.trustedProxy}}return base}async function promptAuthConfig(cfg,runtime,prompter){let authChoice=await promptAuthChoiceGrouped({prompter,store:await ensureAuthProfileStore(void 0,{allowKeychainPrompt:!1}),includeSkip:!0}),next=cfg;if(authChoice===`custom-api-key`)next=(await promptCustomApiConfig({prompter,runtime,config:next})).config;else if(authChoice!==`skip`)next=(await applyAuthChoice({authChoice,config:next,prompter,runtime,setDefaultModel:!0})).config;else{let modelSelection=await promptDefaultModel({config:next,prompter,allowKeep:!0,ignoreAllowlist:!0,preferredProvider:resolvePreferredProviderForAuthChoice(authChoice)});modelSelection.config&&(next=modelSelection.config),modelSelection.model&&(next=applyPrimaryModel(next,modelSelection.model))}let anthropicOAuth=authChoice===`setup-token`||authChoice===`token`||authChoice===`oauth`;if(authChoice!==`custom-api-key`){let allowlistSelection=await promptModelAllowlist({config:next,prompter,allowedKeys:anthropicOAuth?ANTHROPIC_OAUTH_MODEL_KEYS:void 0,initialSelections:anthropicOAuth?[`anthropic/claude-sonnet-4-6`]:void 0,message:anthropicOAuth?`Anthropic OAuth models`:void 0});allowlistSelection.models&&(next=applyModelAllowlist(next,allowlistSelection.models),next=applyModelFallbacksFromSelection(next,allowlistSelection.models))}return next}async function promptGatewayConfig(cfg,runtime){let portRaw=guardCancel(await text$1({message:`Gateway port`,initialValue:String(resolveGatewayPort(cfg)),validate:value=>Number.isFinite(Number(value))?void 0:`Invalid port`}),runtime),port=Number.parseInt(String(portRaw),10),bind=guardCancel(await select$1({message:`Gateway bind mode`,options:[{value:`loopback`,label:`Loopback (Local only)`,hint:`Bind to 127.0.0.1 - secure, local-only access`},{value:`tailnet`,label:`Tailnet (Tailscale IP)`,hint:`Bind to your Tailscale IP only (100.x.x.x)`},{value:`auto`,label:`Auto (Loopback → LAN)`,hint:`Prefer loopback; fall back to all interfaces if unavailable`},{value:`lan`,label:`LAN (All interfaces)`,hint:`Bind to 0.0.0.0 - accessible from anywhere on your network`},{value:`custom`,label:`Custom IP`,hint:`Specify a specific IP address, with 0.0.0.0 fallback if unavailable`}]}),runtime),customBindHost;if(bind===`custom`){let input=guardCancel(await text$1({message:`Custom IP address`,placeholder:`192.168.1.100`,validate:validateIPv4AddressInput}),runtime);customBindHost=typeof input==`string`?input:void 0}let authMode=guardCancel(await select$1({message:`Gateway auth`,options:[{value:`token`,label:`Token`,hint:`Recommended default`},{value:`password`,label:`Password`},{value:`trusted-proxy`,label:`Trusted Proxy`,hint:`Behind reverse proxy (Pomerium, Caddy, Traefik, etc.)`}],initialValue:`token`}),runtime),tailscaleMode=guardCancel(await select$1({message:`Tailscale exposure`,options:[...TAILSCALE_EXPOSURE_OPTIONS]}),runtime);tailscaleMode!==`off`&&(await findTailscaleBinary()||note$1(TAILSCALE_MISSING_BIN_NOTE_LINES.join(`
|
|
4
4
|
`),`Tailscale Warning`));let tailscaleResetOnExit=!1;tailscaleMode!==`off`&&(note$1(TAILSCALE_DOCS_LINES.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-
|
|
1
|
+
import"./paths-5FcIFMsj.js";import"./utils-DbaBVFaK.js";import"./embedded-helpers-3FEGD_4b.js";import"./session-key-EoB0qaG9.js";import"./builderforce-root-D64_sXEi.js";import"./subsystem-B3TqcCrZ.js";import"./registry-TdK-aV05.js";import"./logger-Bch0bx9c.js";import"./exec-DdcIjeyn.js";import"./agent-scope-DPtjOxzp.js";import"./model-selection-DX_WOc2P.js";import"./env-file-BI2jpOmF.js";import"./boolean-Cn4K2fc9.js";import"./env-BHP32i7Q.js";import"./io-YzT_09GD.js";import"./manifest-registry-BVDm_CP0.js";import"./config-8x9ZIdfF.js";import"./sandbox-DzuXOMNa.js";import"./chrome-Dk-WNIhp.js";import"./tailscale-B-VKIlWm.js";import"./auth-CDcrUXYB.js";import"./server-context-DsuST81W.js";import"./frontmatter-DyJ2unbL.js";import"./skills-B4r9m770.js";import"./plugin-skills-C39wi4uD.js";import"./routes-DoGqdgOP.js";import"./redact-C3oo7_aY.js";import"./errors-CjmtpPBP.js";import"./paths-C1QKdGJX.js";import"./ssrf-4MnoQ7Sz.js";import"./image-ops-CONrkLJK.js";import"./store-BoTKCB2d.js";import"./ports-BNC_iRpw.js";import"./trash-Czxs8cUf.js";import"./sessions-OZNhnSwZ.js";import"./message-channel-DrfCCUg4.js";import"./plugins-COtQnUML.js";import"./accounts-CTKk3xPO.js";import"./accounts-DFqpWzeU.js";import"./accounts-CbQihLRU.js";import"./bindings-DMDv84HS.js";import"./paths-CkcK939O.js";import"./src-D2-7sOAX.js";import"./tool-images-DsKy1uNN.js";import"./fetch-guard-BQuCLA1C.js";import"./fetch-CDeJQlzN.js";import"./tokens-Ct4DyfhX.js";import{t as deliverOutboundPayloads}from"./deliver-XGIFv80r.js";import"./chunk-h7FZEwW2.js";import"./markdown-tables-DOq8FfUr.js";import"./ir-AM9J0QtO.js";import"./send-DglIOKdS.js";import"./outbound-attachment-TWzrIR9Q.js";import"./fetch-B6_hd7w9.js";import"./delivery-queue-BZWZDdpJ.js";export{deliverOutboundPayloads};
|
|
@@ -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"./auth-profiles-BARnVAUE.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import"./frontmatter-DgRc5y_l.js";import"./skills-W00EPvKR.js";import"./plugin-skills-BSUncenp.js";import"./message-channel-C-yw5fZm.js";import"./sessions-ko0LxxGk.js";import"./src-
|
|
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"./auth-profiles-BARnVAUE.js";import"./logger-AbH8mdkv.js";import"./session-key-D--2AEus.js";import"./builderforce-root-D3-p8W2n.js";import"./exec-CGuYALEs.js";import"./agent-scope-BcoQBOwz.js";import"./env-file-BIKVpYUN.js";import"./io-BySzqKzT.js";import"./manifest-registry-DtqFvEIR.js";import"./config-Bwt58P9r.js";import"./frontmatter-DgRc5y_l.js";import"./skills-W00EPvKR.js";import"./plugin-skills-BSUncenp.js";import"./message-channel-C-yw5fZm.js";import"./sessions-ko0LxxGk.js";import"./src-BM8G-tIl.js";import"./tokens-BNwTTeJb.js";import"./plugins-DJGW_fnS.js";import"./accounts-Z5bJpNrG.js";import"./bindings-D0uket3l.js";import{t as deliverOutboundPayloads}from"./deliver-DFhj1d_t.js";import"./accounts-DoJYLMfS.js";import"./image-ops-Bg9yFwjX.js";import"./redact-bWj_-q3j.js";import"./errors-t5wHPcwh.js";import"./embedded-helpers-DGDYymYx.js";import"./sandbox-BcH7kS1y.js";import"./chrome-IJYO1tSE.js";import"./tailscale-CgCG7AVQ.js";import"./auth-B4Kn3eee.js";import"./server-context-D3iiIzvV.js";import"./routes-7QTsp3sA.js";import"./paths-GamzES41.js";import"./ssrf-BiSQzdcA.js";import"./store-C5LmVaEC.js";import"./ports-LqFTyTSK.js";import"./trash-zs6gNxed.js";import"./accounts-BT-NzzBc.js";import"./paths-BQ9W7Bs0.js";import"./tool-images-DV2HMmx4.js";import"./chunk-UPhdkZNp.js";import"./markdown-tables-CpqWBduK.js";import"./fetch-guard-CoGEds8D.js";import"./fetch-CUsKv8oj.js";import"./ir-6L-eU4id.js";import"./fetch-CrbOFvsL.js";import"./send-BIR1Jhc5.js";import"./outbound-attachment-3GZbMqo1.js";import"./delivery-queue-DQXq7KUU.js";export{deliverOutboundPayloads};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{C as createInternalHookEvent,T as triggerInternalHook,d as getActivePluginRegistry}from"./registry-Cv7CoWAs.js";import{t as createSubsystemLogger}from"./subsystem-C4b1Von0.js";import{u as normalizeAccountId$1}from"./session-key-D--2AEus.js";import{L as getChannelDock,i as resolveMirroredTranscriptText,r as appendAssistantMessageToSessionTranscript}from"./sessions-ko0LxxGk.js";import{n as SILENT_REPLY_TOKEN,r as isSilentReplyText}from"./tokens-BNwTTeJb.js";import{r as normalizeChannelId,t as getChannelPlugin}from"./plugins-DJGW_fnS.js";import{h as isMessagingToolDuplicate}from"./embedded-helpers-
|
|
1
|
+
import{C as createInternalHookEvent,T as triggerInternalHook,d as getActivePluginRegistry}from"./registry-Cv7CoWAs.js";import{t as createSubsystemLogger}from"./subsystem-C4b1Von0.js";import{u as normalizeAccountId$1}from"./session-key-D--2AEus.js";import{L as getChannelDock,i as resolveMirroredTranscriptText,r as appendAssistantMessageToSessionTranscript}from"./sessions-ko0LxxGk.js";import{n as SILENT_REPLY_TOKEN,r as isSilentReplyText}from"./tokens-BNwTTeJb.js";import{r as normalizeChannelId,t as getChannelPlugin}from"./plugins-DJGW_fnS.js";import{h as isMessagingToolDuplicate}from"./embedded-helpers-DGDYymYx.js";import{c as resolveTextChunkLimit,d as parseFenceSpans,i as chunkMarkdownTextWithMode,n as chunkByParagraph,s as resolveChunkMode}from"./chunk-UPhdkZNp.js";import{t as resolveMarkdownTableMode}from"./markdown-tables-CpqWBduK.js";import{s as getAgentScopedMediaLocalRoots}from"./ir-6L-eU4id.js";import{c as markdownToSignalTextChunks,t as sendMessageSignal}from"./send-BIR1Jhc5.js";import{i as enqueueDelivery,n as ackDelivery,o as failDelivery}from"./delivery-queue-DQXq7KUU.js";function getHooksForName(registry,hookName){return registry.typedHooks.filter(h=>h.hookName===hookName).toSorted((a,b)=>(b.priority??0)-(a.priority??0))}function createHookRunner(registry,options={}){let logger=options.logger,catchErrors=options.catchErrors??!0,mergeBeforeModelResolve=(acc,next)=>({modelOverride:acc?.modelOverride??next.modelOverride,providerOverride:acc?.providerOverride??next.providerOverride}),mergeBeforePromptBuild=(acc,next)=>({systemPrompt:next.systemPrompt??acc?.systemPrompt,prependContext:acc?.prependContext&&next.prependContext?`${acc.prependContext}\n\n${next.prependContext}`:next.prependContext??acc?.prependContext});async function runVoidHook(hookName,event,ctx){let hooks=getHooksForName(registry,hookName);if(hooks.length===0)return;logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers)`);let promises=hooks.map(async hook=>{try{await hook.handler(event,ctx)}catch(err){let msg=`[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}});await Promise.all(promises)}async function runModifyingHook(hookName,event,ctx,mergeResults){let hooks=getHooksForName(registry,hookName);if(hooks.length===0)return;logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers, sequential)`);let result;for(let hook of hooks)try{let handlerResult=await hook.handler(event,ctx);handlerResult!=null&&(result=mergeResults&&result!==void 0?mergeResults(result,handlerResult):handlerResult)}catch(err){let msg=`[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}return result}async function runBeforeModelResolve(event,ctx){return runModifyingHook(`before_model_resolve`,event,ctx,mergeBeforeModelResolve)}async function runBeforePromptBuild(event,ctx){return runModifyingHook(`before_prompt_build`,event,ctx,mergeBeforePromptBuild)}async function runBeforeAgentStart(event,ctx){return runModifyingHook(`before_agent_start`,event,ctx,(acc,next)=>({...mergeBeforePromptBuild(acc,next),...mergeBeforeModelResolve(acc,next)}))}async function runAgentEnd(event,ctx){return runVoidHook(`agent_end`,event,ctx)}async function runLlmInput(event,ctx){return runVoidHook(`llm_input`,event,ctx)}async function runLlmOutput(event,ctx){return runVoidHook(`llm_output`,event,ctx)}async function runBeforeCompaction(event,ctx){return runVoidHook(`before_compaction`,event,ctx)}async function runAfterCompaction(event,ctx){return runVoidHook(`after_compaction`,event,ctx)}async function runBeforeReset(event,ctx){return runVoidHook(`before_reset`,event,ctx)}async function runMessageReceived(event,ctx){return runVoidHook(`message_received`,event,ctx)}async function runMessageSending(event,ctx){return runModifyingHook(`message_sending`,event,ctx,(acc,next)=>({content:next.content??acc?.content,cancel:next.cancel??acc?.cancel}))}async function runMessageSent(event,ctx){return runVoidHook(`message_sent`,event,ctx)}async function runBeforeToolCall(event,ctx){return runModifyingHook(`before_tool_call`,event,ctx,(acc,next)=>({params:next.params??acc?.params,block:next.block??acc?.block,blockReason:next.blockReason??acc?.blockReason}))}async function runAfterToolCall(event,ctx){return runVoidHook(`after_tool_call`,event,ctx)}function runToolResultPersist(event,ctx){let hooks=getHooksForName(registry,`tool_result_persist`);if(hooks.length===0)return;let current=event.message;for(let hook of hooks)try{let out=hook.handler({...event,message:current},ctx);if(out&&typeof out.then==`function`){let msg=`[hooks] tool_result_persist handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;if(catchErrors){logger?.warn?.(msg);continue}throw Error(msg)}let next=out?.message;next&&(current=next)}catch(err){let msg=`[hooks] tool_result_persist handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}return{message:current}}function runBeforeMessageWrite(event,ctx){let hooks=getHooksForName(registry,`before_message_write`);if(hooks.length===0)return;let current=event.message;for(let hook of hooks)try{let out=hook.handler({...event,message:current},ctx);if(out&&typeof out.then==`function`){let msg=`[hooks] before_message_write handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;if(catchErrors){logger?.warn?.(msg);continue}throw Error(msg)}let result=out;if(result?.block)return{block:!0};result?.message&&(current=result.message)}catch(err){let msg=`[hooks] before_message_write handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}if(current!==event.message)return{message:current}}async function runSessionStart(event,ctx){return runVoidHook(`session_start`,event,ctx)}async function runSessionEnd(event,ctx){return runVoidHook(`session_end`,event,ctx)}async function runGatewayStart(event,ctx){return runVoidHook(`gateway_start`,event,ctx)}async function runGatewayStop(event,ctx){return runVoidHook(`gateway_stop`,event,ctx)}function hasHooks(hookName){return registry.typedHooks.some(h=>h.hookName===hookName)}function getHookCount(hookName){return registry.typedHooks.filter(h=>h.hookName===hookName).length}return{runBeforeModelResolve,runBeforePromptBuild,runBeforeAgentStart,runLlmInput,runLlmOutput,runAgentEnd,runBeforeCompaction,runAfterCompaction,runBeforeReset,runMessageReceived,runMessageSending,runMessageSent,runBeforeToolCall,runAfterToolCall,runToolResultPersist,runBeforeMessageWrite,runSessionStart,runSessionEnd,runGatewayStart,runGatewayStop,hasHooks,getHookCount}}const log=createSubsystemLogger(`plugins`);let globalHookRunner=null;function initializeGlobalHookRunner(registry){globalHookRunner=createHookRunner(registry,{logger:{debug:msg=>log.debug(msg),warn:msg=>log.warn(msg),error:msg=>log.error(msg)},catchErrors:!0});let hookCount=registry.hooks.length;hookCount>0&&log.info(`hook runner initialized with ${hookCount} registered hooks`)}function getGlobalHookRunner(){return globalHookRunner}async function runGlobalGatewayStopSafely(params){let hookRunner=getGlobalHookRunner();if(hookRunner?.hasHooks(`gateway_stop`))try{await hookRunner.runGatewayStop(params.event,params.ctx)}catch(err){if(params.onError){params.onError(err);return}log.warn(`gateway_stop hook failed: ${String(err)}`)}}const MB=1024*1024;function resolveChannelMediaMaxBytes(params){let accountId=normalizeAccountId$1(params.accountId),channelLimit=params.resolveChannelLimitMb({cfg:params.cfg,accountId});if(channelLimit)return channelLimit*MB;if(params.cfg.agents?.defaults?.mediaMaxMb)return params.cfg.agents.defaults.mediaMaxMb*MB}const cache=new Map;let lastRegistry=null;function ensureCacheForRegistry(registry){registry!==lastRegistry&&(cache.clear(),lastRegistry=registry)}async function loadChannelOutboundAdapter(id){let registry=getActivePluginRegistry();ensureCacheForRegistry(registry);let cached=cache.get(id);if(cached)return cached;let outbound=(registry?.channels.find(entry=>entry.plugin.id===id))?.plugin.outbound;if(outbound)return cache.set(id,outbound),outbound}function stripWhatsAppLeadingBlankLines(text){return text.replace(/^(?:[ \t]*\r?\n)+/,``)}function throwIfAborted(abortSignal){if(abortSignal?.aborted){let err=Error(`Operation aborted`);throw err.name=`AbortError`,err}}const AUDIO_TAG_RE=/\[\[\s*audio_as_voice\s*\]\]/gi,REPLY_TAG_RE=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*([^\]\n]+))\s*\]\]/gi;function normalizeDirectiveWhitespace(text){return text.replace(/[ \t]+/g,` `).replace(/[ \t]*\n[ \t]*/g,`
|
|
2
2
|
`).trim()}function parseInlineDirectives(text,options={}){let{currentMessageId,stripAudioTag=!0,stripReplyTags=!0}=options;if(!text)return{text:``,audioAsVoice:!1,replyToCurrent:!1,hasAudioTag:!1,hasReplyTag:!1};let cleaned=text,audioAsVoice=!1,hasAudioTag=!1,hasReplyTag=!1,sawCurrent=!1,lastExplicitId;cleaned=cleaned.replace(AUDIO_TAG_RE,match=>(audioAsVoice=!0,hasAudioTag=!0,stripAudioTag?` `:match)),cleaned=cleaned.replace(REPLY_TAG_RE,(match,idRaw)=>{if(hasReplyTag=!0,idRaw===void 0)sawCurrent=!0;else{let id=idRaw.trim();id&&(lastExplicitId=id)}return stripReplyTags?` `:match}),cleaned=normalizeDirectiveWhitespace(cleaned);let replyToId=lastExplicitId??(sawCurrent&¤tMessageId?.trim()||void 0);return{text:cleaned,audioAsVoice,replyToId,replyToExplicitId:lastExplicitId,replyToCurrent:sawCurrent,hasAudioTag,hasReplyTag}}function parseAudioTag(text){let result=parseInlineDirectives(text,{stripReplyTags:!1});return{text:result.text,audioAsVoice:result.audioAsVoice,hadTag:result.hasAudioTag}}const MEDIA_TOKEN_RE=/\bMEDIA:\s*`?([^\n]+)`?/gi;function normalizeMediaSource(src){return src.startsWith(`file://`)?src.replace(`file://`,``):src}function cleanCandidate(raw){return raw.replace(/^[`"'[{(]+/,``).replace(/[`"'\\})\],]+$/,``)}const WINDOWS_DRIVE_RE=/^[a-zA-Z]:[\\/]/,SCHEME_RE=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,HAS_FILE_EXT=/\.\w{1,10}$/;function isLikelyLocalPath(candidate){return candidate.startsWith(`/`)||candidate.startsWith(`./`)||candidate.startsWith(`../`)||candidate.startsWith(`~`)||WINDOWS_DRIVE_RE.test(candidate)||candidate.startsWith(`\\\\`)||!SCHEME_RE.test(candidate)&&(candidate.includes(`/`)||candidate.includes(`\\`))}function isValidMedia(candidate,opts){return!candidate||candidate.length>4096||!opts?.allowSpaces&&/\s/.test(candidate)?!1:!!(/^https?:\/\//i.test(candidate)||isLikelyLocalPath(candidate)||opts?.allowBareFilename&&!SCHEME_RE.test(candidate)&&HAS_FILE_EXT.test(candidate))}function unwrapQuoted(value){let trimmed=value.trim();if(trimmed.length<2)return;let first=trimmed[0];if(first===trimmed[trimmed.length-1]&&!(first!==`"`&&first!==`'`&&first!=="`"))return trimmed.slice(1,-1).trim()}function isInsideFence(fenceSpans,offset){return fenceSpans.some(span=>offset>=span.start&&offset<span.end)}function splitMediaFromOutput(raw){let trimmedRaw=raw.trimEnd();if(!trimmedRaw.trim())return{text:``};let media=[],foundMediaToken=!1,fenceSpans=parseFenceSpans(trimmedRaw),lines=trimmedRaw.split(`
|
|
3
3
|
`),keptLines=[],lineOffset=0;for(let line of lines){if(isInsideFence(fenceSpans,lineOffset)){keptLines.push(line),lineOffset+=line.length+1;continue}if(!line.trimStart().startsWith(`MEDIA:`)){keptLines.push(line),lineOffset+=line.length+1;continue}let matches=Array.from(line.matchAll(MEDIA_TOKEN_RE));if(matches.length===0){keptLines.push(line),lineOffset+=line.length+1;continue}let pieces=[],cursor=0;for(let match of matches){let start=match.index??0;pieces.push(line.slice(cursor,start));let payload=match[1],unwrapped=unwrapQuoted(payload),payloadValue=unwrapped??payload,parts=unwrapped?[unwrapped]:payload.split(/\s+/).filter(Boolean),mediaStartIndex=media.length,validCount=0,invalidParts=[],hasValidMedia=!1;for(let part of parts){let candidate=normalizeMediaSource(cleanCandidate(part));isValidMedia(candidate,unwrapped?{allowSpaces:!0}:void 0)?(media.push(candidate),hasValidMedia=!0,foundMediaToken=!0,validCount+=1):invalidParts.push(part)}let trimmedPayload=payloadValue.trim(),looksLikeLocalPath=isLikelyLocalPath(trimmedPayload)||trimmedPayload.startsWith(`file://`);if(!unwrapped&&validCount===1&&invalidParts.length>0&&/\s/.test(payloadValue)&&looksLikeLocalPath){let fallback=normalizeMediaSource(cleanCandidate(payloadValue));isValidMedia(fallback,{allowSpaces:!0})&&(media.splice(mediaStartIndex,media.length-mediaStartIndex,fallback),hasValidMedia=!0,foundMediaToken=!0,validCount=1,invalidParts.length=0)}if(!hasValidMedia){let fallback=normalizeMediaSource(cleanCandidate(payloadValue));isValidMedia(fallback,{allowSpaces:!0,allowBareFilename:!0})&&(media.push(fallback),hasValidMedia=!0,foundMediaToken=!0,invalidParts.length=0)}hasValidMedia?invalidParts.length>0&&pieces.push(invalidParts.join(` `)):looksLikeLocalPath?foundMediaToken=!0:pieces.push(match[0]),cursor=start+match[0].length}pieces.push(line.slice(cursor));let cleanedLine=pieces.join(``).replace(/[ \t]{2,}/g,` `).trim();cleanedLine&&keptLines.push(cleanedLine),lineOffset+=line.length+1}let cleanedText=keptLines.join(`
|
|
4
4
|
`).replace(/[ \t]+\n/g,`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as isMessagingToolDuplicate}from"./embedded-helpers-
|
|
1
|
+
import{i as isMessagingToolDuplicate}from"./embedded-helpers-3FEGD_4b.js";import{u as normalizeAccountId$1}from"./session-key-EoB0qaG9.js";import{t as createSubsystemLogger}from"./subsystem-B3TqcCrZ.js";import{C as createInternalHookEvent,T as triggerInternalHook,d as getActivePluginRegistry}from"./registry-TdK-aV05.js";import{W as getChannelDock,i as resolveMirroredTranscriptText,r as appendAssistantMessageToSessionTranscript}from"./sessions-OZNhnSwZ.js";import{r as normalizeChannelId,t as getChannelPlugin}from"./plugins-COtQnUML.js";import{n as SILENT_REPLY_TOKEN,r as isSilentReplyText}from"./tokens-Ct4DyfhX.js";import{c as resolveTextChunkLimit,d as parseFenceSpans,i as chunkMarkdownTextWithMode,n as chunkByParagraph,s as resolveChunkMode}from"./chunk-h7FZEwW2.js";import{t as resolveMarkdownTableMode}from"./markdown-tables-DOq8FfUr.js";import{s as getAgentScopedMediaLocalRoots}from"./ir-AM9J0QtO.js";import{c as markdownToSignalTextChunks,t as sendMessageSignal}from"./send-DglIOKdS.js";import{i as enqueueDelivery,n as ackDelivery,o as failDelivery}from"./delivery-queue-BZWZDdpJ.js";function getHooksForName(registry,hookName){return registry.typedHooks.filter(h=>h.hookName===hookName).toSorted((a,b)=>(b.priority??0)-(a.priority??0))}function createHookRunner(registry,options={}){let logger=options.logger,catchErrors=options.catchErrors??!0,mergeBeforeModelResolve=(acc,next)=>({modelOverride:acc?.modelOverride??next.modelOverride,providerOverride:acc?.providerOverride??next.providerOverride}),mergeBeforePromptBuild=(acc,next)=>({systemPrompt:next.systemPrompt??acc?.systemPrompt,prependContext:acc?.prependContext&&next.prependContext?`${acc.prependContext}\n\n${next.prependContext}`:next.prependContext??acc?.prependContext});async function runVoidHook(hookName,event,ctx){let hooks=getHooksForName(registry,hookName);if(hooks.length===0)return;logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers)`);let promises=hooks.map(async hook=>{try{await hook.handler(event,ctx)}catch(err){let msg=`[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}});await Promise.all(promises)}async function runModifyingHook(hookName,event,ctx,mergeResults){let hooks=getHooksForName(registry,hookName);if(hooks.length===0)return;logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers, sequential)`);let result;for(let hook of hooks)try{let handlerResult=await hook.handler(event,ctx);handlerResult!=null&&(result=mergeResults&&result!==void 0?mergeResults(result,handlerResult):handlerResult)}catch(err){let msg=`[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}return result}async function runBeforeModelResolve(event,ctx){return runModifyingHook(`before_model_resolve`,event,ctx,mergeBeforeModelResolve)}async function runBeforePromptBuild(event,ctx){return runModifyingHook(`before_prompt_build`,event,ctx,mergeBeforePromptBuild)}async function runBeforeAgentStart(event,ctx){return runModifyingHook(`before_agent_start`,event,ctx,(acc,next)=>({...mergeBeforePromptBuild(acc,next),...mergeBeforeModelResolve(acc,next)}))}async function runAgentEnd(event,ctx){return runVoidHook(`agent_end`,event,ctx)}async function runLlmInput(event,ctx){return runVoidHook(`llm_input`,event,ctx)}async function runLlmOutput(event,ctx){return runVoidHook(`llm_output`,event,ctx)}async function runBeforeCompaction(event,ctx){return runVoidHook(`before_compaction`,event,ctx)}async function runAfterCompaction(event,ctx){return runVoidHook(`after_compaction`,event,ctx)}async function runBeforeReset(event,ctx){return runVoidHook(`before_reset`,event,ctx)}async function runMessageReceived(event,ctx){return runVoidHook(`message_received`,event,ctx)}async function runMessageSending(event,ctx){return runModifyingHook(`message_sending`,event,ctx,(acc,next)=>({content:next.content??acc?.content,cancel:next.cancel??acc?.cancel}))}async function runMessageSent(event,ctx){return runVoidHook(`message_sent`,event,ctx)}async function runBeforeToolCall(event,ctx){return runModifyingHook(`before_tool_call`,event,ctx,(acc,next)=>({params:next.params??acc?.params,block:next.block??acc?.block,blockReason:next.blockReason??acc?.blockReason}))}async function runAfterToolCall(event,ctx){return runVoidHook(`after_tool_call`,event,ctx)}function runToolResultPersist(event,ctx){let hooks=getHooksForName(registry,`tool_result_persist`);if(hooks.length===0)return;let current=event.message;for(let hook of hooks)try{let out=hook.handler({...event,message:current},ctx);if(out&&typeof out.then==`function`){let msg=`[hooks] tool_result_persist handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;if(catchErrors){logger?.warn?.(msg);continue}throw Error(msg)}let next=out?.message;next&&(current=next)}catch(err){let msg=`[hooks] tool_result_persist handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}return{message:current}}function runBeforeMessageWrite(event,ctx){let hooks=getHooksForName(registry,`before_message_write`);if(hooks.length===0)return;let current=event.message;for(let hook of hooks)try{let out=hook.handler({...event,message:current},ctx);if(out&&typeof out.then==`function`){let msg=`[hooks] before_message_write handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;if(catchErrors){logger?.warn?.(msg);continue}throw Error(msg)}let result=out;if(result?.block)return{block:!0};result?.message&&(current=result.message)}catch(err){let msg=`[hooks] before_message_write handler from ${hook.pluginId} failed: ${String(err)}`;if(catchErrors)logger?.error(msg);else throw Error(msg,{cause:err})}if(current!==event.message)return{message:current}}async function runSessionStart(event,ctx){return runVoidHook(`session_start`,event,ctx)}async function runSessionEnd(event,ctx){return runVoidHook(`session_end`,event,ctx)}async function runGatewayStart(event,ctx){return runVoidHook(`gateway_start`,event,ctx)}async function runGatewayStop(event,ctx){return runVoidHook(`gateway_stop`,event,ctx)}function hasHooks(hookName){return registry.typedHooks.some(h=>h.hookName===hookName)}function getHookCount(hookName){return registry.typedHooks.filter(h=>h.hookName===hookName).length}return{runBeforeModelResolve,runBeforePromptBuild,runBeforeAgentStart,runLlmInput,runLlmOutput,runAgentEnd,runBeforeCompaction,runAfterCompaction,runBeforeReset,runMessageReceived,runMessageSending,runMessageSent,runBeforeToolCall,runAfterToolCall,runToolResultPersist,runBeforeMessageWrite,runSessionStart,runSessionEnd,runGatewayStart,runGatewayStop,hasHooks,getHookCount}}const log=createSubsystemLogger(`plugins`);let globalHookRunner=null;function initializeGlobalHookRunner(registry){globalHookRunner=createHookRunner(registry,{logger:{debug:msg=>log.debug(msg),warn:msg=>log.warn(msg),error:msg=>log.error(msg)},catchErrors:!0});let hookCount=registry.hooks.length;hookCount>0&&log.info(`hook runner initialized with ${hookCount} registered hooks`)}function getGlobalHookRunner(){return globalHookRunner}async function runGlobalGatewayStopSafely(params){let hookRunner=getGlobalHookRunner();if(hookRunner?.hasHooks(`gateway_stop`))try{await hookRunner.runGatewayStop(params.event,params.ctx)}catch(err){if(params.onError){params.onError(err);return}log.warn(`gateway_stop hook failed: ${String(err)}`)}}const MB=1024*1024;function resolveChannelMediaMaxBytes(params){let accountId=normalizeAccountId$1(params.accountId),channelLimit=params.resolveChannelLimitMb({cfg:params.cfg,accountId});if(channelLimit)return channelLimit*MB;if(params.cfg.agents?.defaults?.mediaMaxMb)return params.cfg.agents.defaults.mediaMaxMb*MB}const cache=new Map;let lastRegistry=null;function ensureCacheForRegistry(registry){registry!==lastRegistry&&(cache.clear(),lastRegistry=registry)}async function loadChannelOutboundAdapter(id){let registry=getActivePluginRegistry();ensureCacheForRegistry(registry);let cached=cache.get(id);if(cached)return cached;let outbound=(registry?.channels.find(entry=>entry.plugin.id===id))?.plugin.outbound;if(outbound)return cache.set(id,outbound),outbound}function stripWhatsAppLeadingBlankLines(text){return text.replace(/^(?:[ \t]*\r?\n)+/,``)}function throwIfAborted(abortSignal){if(abortSignal?.aborted){let err=Error(`Operation aborted`);throw err.name=`AbortError`,err}}const AUDIO_TAG_RE=/\[\[\s*audio_as_voice\s*\]\]/gi,REPLY_TAG_RE=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*([^\]\n]+))\s*\]\]/gi;function normalizeDirectiveWhitespace(text){return text.replace(/[ \t]+/g,` `).replace(/[ \t]*\n[ \t]*/g,`
|
|
2
2
|
`).trim()}function parseInlineDirectives(text,options={}){let{currentMessageId,stripAudioTag=!0,stripReplyTags=!0}=options;if(!text)return{text:``,audioAsVoice:!1,replyToCurrent:!1,hasAudioTag:!1,hasReplyTag:!1};let cleaned=text,audioAsVoice=!1,hasAudioTag=!1,hasReplyTag=!1,sawCurrent=!1,lastExplicitId;cleaned=cleaned.replace(AUDIO_TAG_RE,match=>(audioAsVoice=!0,hasAudioTag=!0,stripAudioTag?` `:match)),cleaned=cleaned.replace(REPLY_TAG_RE,(match,idRaw)=>{if(hasReplyTag=!0,idRaw===void 0)sawCurrent=!0;else{let id=idRaw.trim();id&&(lastExplicitId=id)}return stripReplyTags?` `:match}),cleaned=normalizeDirectiveWhitespace(cleaned);let replyToId=lastExplicitId??(sawCurrent&¤tMessageId?.trim()||void 0);return{text:cleaned,audioAsVoice,replyToId,replyToExplicitId:lastExplicitId,replyToCurrent:sawCurrent,hasAudioTag,hasReplyTag}}function parseAudioTag(text){let result=parseInlineDirectives(text,{stripReplyTags:!1});return{text:result.text,audioAsVoice:result.audioAsVoice,hadTag:result.hasAudioTag}}const MEDIA_TOKEN_RE=/\bMEDIA:\s*`?([^\n]+)`?/gi;function normalizeMediaSource(src){return src.startsWith(`file://`)?src.replace(`file://`,``):src}function cleanCandidate(raw){return raw.replace(/^[`"'[{(]+/,``).replace(/[`"'\\})\],]+$/,``)}const WINDOWS_DRIVE_RE=/^[a-zA-Z]:[\\/]/,SCHEME_RE=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,HAS_FILE_EXT=/\.\w{1,10}$/;function isLikelyLocalPath(candidate){return candidate.startsWith(`/`)||candidate.startsWith(`./`)||candidate.startsWith(`../`)||candidate.startsWith(`~`)||WINDOWS_DRIVE_RE.test(candidate)||candidate.startsWith(`\\\\`)||!SCHEME_RE.test(candidate)&&(candidate.includes(`/`)||candidate.includes(`\\`))}function isValidMedia(candidate,opts){return!candidate||candidate.length>4096||!opts?.allowSpaces&&/\s/.test(candidate)?!1:!!(/^https?:\/\//i.test(candidate)||isLikelyLocalPath(candidate)||opts?.allowBareFilename&&!SCHEME_RE.test(candidate)&&HAS_FILE_EXT.test(candidate))}function unwrapQuoted(value){let trimmed=value.trim();if(trimmed.length<2)return;let first=trimmed[0];if(first===trimmed[trimmed.length-1]&&!(first!==`"`&&first!==`'`&&first!=="`"))return trimmed.slice(1,-1).trim()}function isInsideFence(fenceSpans,offset){return fenceSpans.some(span=>offset>=span.start&&offset<span.end)}function splitMediaFromOutput(raw){let trimmedRaw=raw.trimEnd();if(!trimmedRaw.trim())return{text:``};let media=[],foundMediaToken=!1,fenceSpans=parseFenceSpans(trimmedRaw),lines=trimmedRaw.split(`
|
|
3
3
|
`),keptLines=[],lineOffset=0;for(let line of lines){if(isInsideFence(fenceSpans,lineOffset)){keptLines.push(line),lineOffset+=line.length+1;continue}if(!line.trimStart().startsWith(`MEDIA:`)){keptLines.push(line),lineOffset+=line.length+1;continue}let matches=Array.from(line.matchAll(MEDIA_TOKEN_RE));if(matches.length===0){keptLines.push(line),lineOffset+=line.length+1;continue}let pieces=[],cursor=0;for(let match of matches){let start=match.index??0;pieces.push(line.slice(cursor,start));let payload=match[1],unwrapped=unwrapQuoted(payload),payloadValue=unwrapped??payload,parts=unwrapped?[unwrapped]:payload.split(/\s+/).filter(Boolean),mediaStartIndex=media.length,validCount=0,invalidParts=[],hasValidMedia=!1;for(let part of parts){let candidate=normalizeMediaSource(cleanCandidate(part));isValidMedia(candidate,unwrapped?{allowSpaces:!0}:void 0)?(media.push(candidate),hasValidMedia=!0,foundMediaToken=!0,validCount+=1):invalidParts.push(part)}let trimmedPayload=payloadValue.trim(),looksLikeLocalPath=isLikelyLocalPath(trimmedPayload)||trimmedPayload.startsWith(`file://`);if(!unwrapped&&validCount===1&&invalidParts.length>0&&/\s/.test(payloadValue)&&looksLikeLocalPath){let fallback=normalizeMediaSource(cleanCandidate(payloadValue));isValidMedia(fallback,{allowSpaces:!0})&&(media.splice(mediaStartIndex,media.length-mediaStartIndex,fallback),hasValidMedia=!0,foundMediaToken=!0,validCount=1,invalidParts.length=0)}if(!hasValidMedia){let fallback=normalizeMediaSource(cleanCandidate(payloadValue));isValidMedia(fallback,{allowSpaces:!0,allowBareFilename:!0})&&(media.push(fallback),hasValidMedia=!0,foundMediaToken=!0,invalidParts.length=0)}hasValidMedia?invalidParts.length>0&&pieces.push(invalidParts.join(` `)):looksLikeLocalPath?foundMediaToken=!0:pieces.push(match[0]),cursor=start+match[0].length}pieces.push(line.slice(cursor));let cleanedLine=pieces.join(``).replace(/[ \t]{2,}/g,` `).trim();cleanedLine&&keptLines.push(cleanedLine),lineOffset+=line.length+1}let cleanedText=keptLines.join(`
|
|
4
4
|
`).replace(/[ \t]+\n/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function createDefaultDeps(){return{sendMessageWhatsApp:async(...args)=>{let{sendMessageWhatsApp}=await import(`./web-
|
|
1
|
+
function createDefaultDeps(){return{sendMessageWhatsApp:async(...args)=>{let{sendMessageWhatsApp}=await import(`./web-BdYyXjsX.js`);return await sendMessageWhatsApp(...args)},sendMessageTelegram:async(...args)=>{let{sendMessageTelegram}=await import(`./send-5WBiq-Gi.js`);return await sendMessageTelegram(...args)},sendMessageDiscord:async(...args)=>{let{sendMessageDiscord}=await import(`./send-B3LpCtKP.js`);return await sendMessageDiscord(...args)},sendMessageSlack:async(...args)=>{let{sendMessageSlack}=await import(`./send-Ds4d0enR.js`);return await sendMessageSlack(...args)},sendMessageSignal:async(...args)=>{let{sendMessageSignal}=await import(`./send-BFt38Us-.js`);return await sendMessageSignal(...args)},sendMessageIMessage:async(...args)=>{let{sendMessageIMessage}=await import(`./send-D4BjHK1u.js`);return await sendMessageIMessage(...args)}}}function createOutboundSendDeps(deps){return{sendWhatsApp:deps.sendMessageWhatsApp,sendTelegram:deps.sendMessageTelegram,sendDiscord:deps.sendMessageDiscord,sendSlack:deps.sendMessageSlack,sendSignal:deps.sendMessageSignal,sendIMessage:deps.sendMessageIMessage}}export{createOutboundSendDeps as n,createDefaultDeps as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as resolveBuilderForceAgentsPackageRoot}from"./builderforce-root-D64_sXEi.js";import{r as resolveCliName}from"./command-format-Dd7BgZsg.js";import{t as note}from"./note-CvzMolLy.js";import{a as resolveCompletionCachePath,n as installCompletion,o as resolveShellFromEnv,r as isCompletionInstalled,s as usesSlowDynamicCompletion,t as completionCacheExists}from"./completion-cli-
|
|
1
|
+
import{t as resolveBuilderForceAgentsPackageRoot}from"./builderforce-root-D64_sXEi.js";import{r as resolveCliName}from"./command-format-Dd7BgZsg.js";import{t as note}from"./note-CvzMolLy.js";import{a as resolveCompletionCachePath,n as installCompletion,o as resolveShellFromEnv,r as isCompletionInstalled,s as usesSlowDynamicCompletion,t as completionCacheExists}from"./completion-cli-ydxyAE7J.js";import path from"node:path";import{spawnSync}from"node:child_process";async function generateCompletionCache(){let root=await resolveBuilderForceAgentsPackageRoot({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()});if(!root)return!1;let binPath=path.join(root,`builderforce.mjs`);return spawnSync(process.execPath,[binPath,`completion`,`--write-state`],{cwd:root,env:process.env,encoding:`utf-8`}).status===0}async function checkShellCompletionStatus(binName=`builderforce`){let shell=resolveShellFromEnv();return{shell,profileInstalled:await isCompletionInstalled(shell,binName),cacheExists:await completionCacheExists(shell,binName),cachePath:resolveCompletionCachePath(shell,binName),usesSlowPattern:await usesSlowDynamicCompletion(shell,binName)}}async function doctorShellCompletion(runtime,prompter,options={}){let cliName=resolveCliName(),status=await checkShellCompletionStatus(cliName);if(status.usesSlowPattern){if(note(`Your ${status.shell} profile uses slow dynamic completion (source <(...)).\nUpgrading to cached completion for faster shell startup...`,`Shell completion`),!status.cacheExists&&!await generateCompletionCache()){note(`Failed to generate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}await installCompletion(status.shell,!0,cliName),note(`Shell completion upgraded. Restart your shell or run: source ~/.${status.shell===`zsh`?`zshrc`:status.shell===`bash`?`bashrc`:`config/fish/config.fish`}`,`Shell completion`);return}if(status.profileInstalled&&!status.cacheExists){note(`Shell completion is configured in your ${status.shell} profile but the cache is missing.\nRegenerating cache...`,`Shell completion`),await generateCompletionCache()?note(`Completion cache regenerated at ${status.cachePath}`,`Shell completion`):note(`Failed to regenerate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}if(!status.profileInstalled){if(options.nonInteractive)return;if(await prompter.confirm({message:`Enable ${status.shell} shell completion for ${cliName}?`,initialValue:!0})){if(!await generateCompletionCache()){note(`Failed to generate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}await installCompletion(status.shell,!0,cliName),note(`Shell completion installed. Restart your shell or run: source ~/.${status.shell===`zsh`?`zshrc`:status.shell===`bash`?`bashrc`:`config/fish/config.fish`}`,`Shell completion`)}}}async function ensureCompletionCacheExists(binName=`builderforce`){return await completionCacheExists(resolveShellFromEnv(),binName)?!0:generateCompletionCache()}export{doctorShellCompletion as n,ensureCompletionCacheExists as r,checkShellCompletionStatus as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as resolveCliName}from"./command-format-DTMaGKs7.js";import{t as resolveBuilderForceAgentsPackageRoot}from"./builderforce-root-D3-p8W2n.js";import{t as note}from"./note-BvXfFmlu.js";import{a as resolveCompletionCachePath,n as installCompletion,o as resolveShellFromEnv,r as isCompletionInstalled,s as usesSlowDynamicCompletion,t as completionCacheExists}from"./completion-cli-
|
|
1
|
+
import{r as resolveCliName}from"./command-format-DTMaGKs7.js";import{t as resolveBuilderForceAgentsPackageRoot}from"./builderforce-root-D3-p8W2n.js";import{t as note}from"./note-BvXfFmlu.js";import{a as resolveCompletionCachePath,n as installCompletion,o as resolveShellFromEnv,r as isCompletionInstalled,s as usesSlowDynamicCompletion,t as completionCacheExists}from"./completion-cli-DbIxXK1B.js";import{spawnSync}from"node:child_process";import path from"node:path";async function generateCompletionCache(){let root=await resolveBuilderForceAgentsPackageRoot({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()});if(!root)return!1;let binPath=path.join(root,`builderforce.mjs`);return spawnSync(process.execPath,[binPath,`completion`,`--write-state`],{cwd:root,env:process.env,encoding:`utf-8`}).status===0}async function checkShellCompletionStatus(binName=`builderforce`){let shell=resolveShellFromEnv();return{shell,profileInstalled:await isCompletionInstalled(shell,binName),cacheExists:await completionCacheExists(shell,binName),cachePath:resolveCompletionCachePath(shell,binName),usesSlowPattern:await usesSlowDynamicCompletion(shell,binName)}}async function doctorShellCompletion(runtime,prompter,options={}){let cliName=resolveCliName(),status=await checkShellCompletionStatus(cliName);if(status.usesSlowPattern){if(note(`Your ${status.shell} profile uses slow dynamic completion (source <(...)).\nUpgrading to cached completion for faster shell startup...`,`Shell completion`),!status.cacheExists&&!await generateCompletionCache()){note(`Failed to generate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}await installCompletion(status.shell,!0,cliName),note(`Shell completion upgraded. Restart your shell or run: source ~/.${status.shell===`zsh`?`zshrc`:status.shell===`bash`?`bashrc`:`config/fish/config.fish`}`,`Shell completion`);return}if(status.profileInstalled&&!status.cacheExists){note(`Shell completion is configured in your ${status.shell} profile but the cache is missing.\nRegenerating cache...`,`Shell completion`),await generateCompletionCache()?note(`Completion cache regenerated at ${status.cachePath}`,`Shell completion`):note(`Failed to regenerate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}if(!status.profileInstalled){if(options.nonInteractive)return;if(await prompter.confirm({message:`Enable ${status.shell} shell completion for ${cliName}?`,initialValue:!0})){if(!await generateCompletionCache()){note(`Failed to generate completion cache. Run \`${cliName} completion --write-state\` manually.`,`Shell completion`);return}await installCompletion(status.shell,!0,cliName),note(`Shell completion installed. Restart your shell or run: source ~/.${status.shell===`zsh`?`zshrc`:status.shell===`bash`?`bashrc`:`config/fish/config.fish`}`,`Shell completion`)}}}async function ensureCompletionCacheExists(binName=`builderforce`){return await completionCacheExists(resolveShellFromEnv(),binName)?!0:generateCompletionCache()}export{doctorShellCompletion as n,ensureCompletionCacheExists as r,checkShellCompletionStatus as t};
|