@fased/fased 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/{active-listener-B_AAz_Nv.js → active-listener-CILIY2ox.js} +1 -1
- package/dist/{agent-scope-Cb1u7HE7.js → agent-scope-DwKyukUg.js} +124 -124
- package/dist/{agents-BwDWbvDH.js → agents-J1fRpMRy.js} +8 -8
- package/dist/{attachment-normalize-C9F-gS4-.js → attachment-normalize-CJWQWDbC.js} +1 -1
- package/dist/{attachment-normalize-C9w24bkb.js → attachment-normalize-Din9M1Y4.js} +1 -1
- package/dist/{audio-preflight-DGoGnRdo.js → audio-preflight-CiHBO6op.js} +31 -31
- package/dist/{audio-preflight-Dg10mePo.js → audio-preflight-D3I9e121.js} +2 -2
- package/dist/{audio-preflight-QMOvUkXH.js → audio-preflight-Dpmj_mYE.js} +1 -1
- package/dist/{audio-preflight-DnHScDmF.js → audio-preflight-fOBO0I4S.js} +2 -2
- package/dist/{audio-preflight-CTs9Ta27.js → audio-preflight-tHKngO6z.js} +1 -1
- package/dist/{audit-DJOyIBeV.js → audit-BGrhx_IL.js} +1 -1
- package/dist/{audit-DmYUk4AC.js → audit-DQyLAEfl.js} +1 -1
- package/dist/{auth-7Dkf1_CI.js → auth-C4Rs_Ca4.js} +5 -5
- package/dist/{auth-choice-D9LWnNpF.js → auth-choice-BTahePAl.js} +1 -1
- package/dist/{auth-choice-DbTYwdGn.js → auth-choice-ioJ3htvR.js} +1 -1
- package/dist/{auth-choice-prompt-D5YuCYf7.js → auth-choice-prompt-Cigxs_6f.js} +1 -1
- package/dist/{auth-choice-prompt-DFyVEU7J.js → auth-choice-prompt-Db0yW_LH.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +31 -31
- package/dist/bundled/bootstrap-extra-files/handler.js +3 -3
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +31 -31
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-DY_GHJwO.js → channel-activity-D17GYsMz.js} +1 -1
- package/dist/{channel-web-CAJ_OiB2.js → channel-web-CclBHrhb.js} +1 -1
- package/dist/{channel-web-X3OJcLB2.js → channel-web-DIRVjokt.js} +1 -1
- package/dist/{channels-D9Oj681h.js → channels-A880gMB8.js} +6 -6
- package/dist/{channels-BqOjEy1R.js → channels-DWuoO75L.js} +6 -6
- package/dist/{channels-cli-DKRuJbjY.js → channels-cli-54FnZFBp.js} +5 -5
- package/dist/{channels-cli-D5hZAzoE.js → channels-cli-HVr7lRa7.js} +5 -5
- package/dist/{chunk-Cj87uJLo.js → chunk-DfA5CGzI.js} +1 -1
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-ClS8EuDK.js → cli-C8OGL6Ju.js} +2 -2
- package/dist/{cli-Dm0682Gu.js → cli-cnJ-Fwbu.js} +2 -2
- package/dist/{command-registry-C2wqEo64.js → command-registry-BHCwSxmh.js} +9 -9
- package/dist/{commands-registry-Du1VUNqv.js → commands-registry-ShBrc7Zz.js} +1 -1
- package/dist/{completion-cli-B9mW_que.js → completion-cli-BsgojaxZ.js} +2 -2
- package/dist/{completion-cli-DCvm9Xp-.js → completion-cli-DuqDB42S.js} +1 -1
- package/dist/{config-cli-680jTQ3-.js → config-cli-B62owpbq.js} +1 -1
- package/dist/{config-cli-1SYvQdhO.js → config-cli-nRzwa31Y.js} +1 -1
- package/dist/{config-eval-BVvNsPGB.js → config-eval-B5XXAbrm.js} +3 -3
- package/dist/{configure-BfhVLgNf.js → configure-ByLqSsRA.js} +12 -12
- package/dist/{configure-DQLQp2nb.js → configure-CbMYLFUm.js} +12 -12
- package/dist/control-ui/assets/app-DXYMrRJ9.js.map +1 -1
- package/dist/{cron-cli-C4hgRvYJ.js → cron-cli-CLNLFdxi.js} +2 -2
- package/dist/{cron-cli-DQjdHktC.js → cron-cli-CM9CM1GR.js} +2 -2
- package/dist/{daemon-cli-DWhAXx5H.js → daemon-cli-9ids8mMV.js} +1 -1
- package/dist/{daemon-cli-B3OUkSy6.js → daemon-cli-w15TQchq.js} +1 -1
- package/dist/daemon-cli.js +1 -1
- package/dist/{deps-RXAe1X5s.js → deps-BVNeN6gT.js} +1 -1
- package/dist/{deps-DdP-Hmxc.js → deps-Uo5boHSY.js} +1 -1
- package/dist/{diagnostic-D6XQAXl4.js → diagnostic-B4NKiC20.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{fetch-BKzFOgku.js → fetch-BH7uURYM.js} +1 -1
- package/dist/{fetch-guard-B3bzvmt4.js → fetch-guard-DqpQMLwE.js} +1 -1
- package/dist/{filesystem-manager-CrDoOIOx.js → filesystem-manager-DKU5F0fA.js} +4 -4
- package/dist/{fs-safe-DcQcXS6I.js → fs-safe-CwUdejUJ.js} +2 -2
- package/dist/{gateway-cli-Y450jJFF.js → gateway-cli-C9Os2Z5s.js} +27 -27
- package/dist/{gateway-cli-CHukRtBG.js → gateway-cli-CLFeYf4s.js} +27 -27
- package/dist/{github-copilot-token-DYrFvncE.js → github-copilot-token-eyrRGmGp.js} +8 -8
- package/dist/{health-Db548DTY.js → health-CghndVpq.js} +2 -2
- package/dist/{health-C-AsEUPg.js → health-GSYUFoyr.js} +2 -2
- package/dist/{heartbeat-runner-CE9O7xVk.js → heartbeat-runner-1b23y_3_.js} +1 -1
- package/dist/{heartbeat-runner-DAPP5ojq.js → heartbeat-runner-DPtasJ9O.js} +1 -1
- package/dist/{hooks-cli-DpllVSSB.js → hooks-cli-BXZ0yiOV.js} +3 -3
- package/dist/{hooks-cli-ApL31lTH.js → hooks-cli-_VHugcqb.js} +3 -3
- package/dist/index.js +7 -7
- package/dist/{internal-B3yITtDC.js → internal-CU3wrcPl.js} +3 -3
- package/dist/{ipv4-Bh1H98-c.js → ipv4-Cb1Ofo1o.js} +2 -2
- package/dist/{ipv4-D88X6kcK.js → ipv4-h9TrAq_w.js} +2 -2
- package/dist/{lifecycle-D2VlrxY8.js → lifecycle-CBewhyXk.js} +1 -1
- package/dist/{lifecycle-C5O_poBp.js → lifecycle-CV1zHjpj.js} +1 -1
- package/dist/{list.auth-overview-DQUc2B2l.js → list.auth-overview-C8izvpBJ.js} +1 -1
- package/dist/{list.auth-overview-N9tbnvNE.js → list.auth-overview-CvPcpBIP.js} +1 -1
- package/dist/llm-slug-generator.js +31 -31
- package/dist/{login-BPi6GEMh.js → login-DmSOJJZh.js} +2 -2
- package/dist/{login-qr-BaJ9M5z6.js → login-qr-gY230e9k.js} +3 -3
- package/dist/{manager-C05ypUW3.js → manager-Cxjfnksb.js} +8 -8
- package/dist/{markdown-tables-CBLut_ie.js → markdown-tables-DFtTedxN.js} +1 -1
- package/dist/{media-DUBmlR9u.js → media-DZj8v0oe.js} +5 -5
- package/dist/{memory-search-tdsFhtIi.js → memory-search-BxRjHrXP.js} +2 -2
- package/dist/{model-catalog-BQ5G4eK6.js → model-catalog-Iu_LUOVA.js} +6 -6
- package/dist/{models-BObC-MWx.js → models-DqMgO-Ak.js} +4 -4
- package/dist/{models-cli-Bcjaf4CI.js → models-cli-C7WASQac.js} +4 -4
- package/dist/{models-cli-r2llwGBO.js → models-cli-D6H_Kt3i.js} +5 -5
- package/dist/{node-cli-B5TpzQ6U.js → node-cli-B8DI8VK2.js} +2 -2
- package/dist/{node-cli-B8V8ar0H.js → node-cli-CGwktXpe.js} +2 -2
- package/dist/{onboard-C6Z7OaQ8.js → onboard-BR6vBv2I.js} +6 -6
- package/dist/{onboard-D8EOxPOn.js → onboard-C-fjU4uC.js} +6 -6
- package/dist/{onboard-channels-C4gBvkYQ.js → onboard-channels-B3tCPpRS.js} +2 -2
- package/dist/{onboard-channels-CDr6F5Rc.js → onboard-channels-C1UyGFfb.js} +2 -2
- package/dist/{onboard-search-BzpbxIgm.js → onboard-search-CjU6w3Sm.js} +5 -5
- package/dist/{onboard-search-BDLus6nY.js → onboard-search-Ds5KeCF_.js} +5 -5
- package/dist/{onboarding-CIjqOjDq.js → onboarding-BL3becPO.js} +181 -35
- package/dist/{onboarding-DjXH2-ro.js → onboarding-DGAQeYgr.js} +181 -35
- package/dist/{openresponses-http-C9x0SEG6.js → openresponses-http-Bcy1YyQY.js} +2 -2
- package/dist/{openresponses-http-eMouHu_v.js → openresponses-http-DIR_t4i1.js} +31 -31
- package/dist/{openresponses-http-DU9S_V_8.js → openresponses-http-DxsL0uBk.js} +1 -1
- package/dist/{openresponses-http-NFMdHWOs.js → openresponses-http-IVnQ_wz0.js} +2 -2
- package/dist/{openresponses-http-BA2nkk7t.js → openresponses-http-Qb_KOtcX.js} +1 -1
- package/dist/{outbound-BF3W1nJQ.js → outbound-BtgGTj4E.js} +6 -6
- package/dist/{outbound-attachment-CZV6JZkx.js → outbound-attachment-NKTzAe-U.js} +2 -2
- package/dist/{parent-default-help-zu6kW9Un.js → parent-default-help-BJGqN88G.js} +1 -1
- package/dist/{parent-default-help-k4GD2-UF.js → parent-default-help-XXsayZks.js} +1 -1
- package/dist/{path-alias-guards--dquYHnR.js → path-alias-guards-BgsM3Cb3.js} +1 -1
- package/dist/{paths-BGX-IMoI.js → paths-57KGLbK2.js} +22 -22
- package/dist/{pi-embedded-DPElH0OZ.js → pi-embedded-CZAiurHo.js} +5 -5
- package/dist/{pi-embedded-Pkm2p81t.js → pi-embedded-qk5CdQmR.js} +239 -239
- package/dist/{pi-model-discovery-DYwyxntg.js → pi-model-discovery-CfcnLOyX.js} +7 -7
- package/dist/pi-model-discovery-runtime-D85aZCOu.js +5 -0
- package/dist/{plugin-registry-DEewJtHt.js → plugin-registry-Bw0a_OGC.js} +1 -1
- package/dist/{plugin-registry-DfO1RfZv.js → plugin-registry-Dqk6vxYj.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-a_1hr0Eg.js → audio-preflight-BO8XDtTk.js} +1 -1
- package/dist/plugin-sdk/{audio-preflight-L8bE2tgB.js → audio-preflight-DK-6iXZY.js} +1 -1
- package/dist/plugin-sdk/channel-plugin-common.js +1 -1
- package/dist/plugin-sdk/{channel-web-BNlpZrWA.js → channel-web-DgXfvJo-.js} +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/{openresponses-http-DuRGQn_a.js → openresponses-http-DBFqruTK.js} +1 -1
- package/dist/plugin-sdk/{openresponses-http-BBdkt744.js → openresponses-http-RBdNxv8F.js} +1 -1
- package/dist/plugin-sdk/{pi-model-discovery-runtime-FgSYY3zE.js → pi-model-discovery-runtime-BWcaNxzp.js} +1 -1
- package/dist/plugin-sdk/{registry-DyRgZdL8.js → registry-DXXOSq_V.js} +8 -8
- package/dist/plugin-sdk/{reply-DclM907b.js → reply-Bb9pzXn4.js} +5 -5
- package/dist/plugin-sdk/src/brand.d.ts +2 -2
- package/dist/plugin-sdk/{status-EnvYKAtO.js → status-CHo58oXD.js} +5 -5
- package/dist/plugin-sdk/{web-C0nKlODk.js → web-B-fwFsth.js} +1 -1
- package/dist/plugin-sdk/{web-BrtGwPHN.js → web-BIIifta2.js} +2 -2
- package/dist/{plugins-cli-BU7lm9mm.js → plugins-cli-BKlKaixI.js} +5 -5
- package/dist/{plugins-cli-Be4GLYdI.js → plugins-cli-dvRFoJCC.js} +5 -5
- package/dist/{program-B78oSJVp.js → program-P-9mYfYw.js} +7 -7
- package/dist/{program-context-DpABaPXE.js → program-context-DZ2qDI4u.js} +24 -24
- package/dist/{prompt-select-styled-DI5ODziX.js → prompt-select-styled-CdVuqLJH.js} +4 -4
- package/dist/{prompt-select-styled-DmcQ0_hv.js → prompt-select-styled-DHjjwvXl.js} +4 -4
- package/dist/{pw-ai-42y3optV.js → pw-ai-CmgZwdpF.js} +5 -5
- package/dist/{qmd-manager-BPz-XVY5.js → qmd-manager-B4jAaAzx.js} +5 -5
- package/dist/{qmd-scope-D2okAldm.js → qmd-scope-BdblEj4C.js} +1 -1
- package/dist/{query-expansion-f4DE13gJ.js → query-expansion-JhTilyB1.js} +2 -2
- package/dist/{register.agent-FC9A__Az.js → register.agent-Be3pMMEj.js} +8 -8
- package/dist/{register.agent-DOychJ9q.js → register.agent-rgc26ryI.js} +9 -9
- package/dist/{register.configure-ybGicOMR.js → register.configure-BKYZzj-a.js} +12 -12
- package/dist/{register.configure-i3gbc5Cc.js → register.configure-DUgwZXRG.js} +12 -12
- package/dist/{register.maintenance-CYX_k6x1.js → register.maintenance-CEB2_x4K.js} +8 -8
- package/dist/{register.maintenance-MPPzwTam.js → register.maintenance-OE1jM64G.js} +9 -9
- package/dist/{register.message-D6NFTigk.js → register.message-CUE4ZFjr.js} +3 -3
- package/dist/{register.message-C_Q6o32_.js → register.message-vxrokTGv.js} +3 -3
- package/dist/{register.onboard-DqR_m0_p.js → register.onboard-Cyymwvc3.js} +14 -14
- package/dist/{register.onboard-PbsAD-eY.js → register.onboard-Dg3786vL.js} +14 -14
- package/dist/{register.setup-COidGsw2.js → register.setup-B6uH9Fkv.js} +14 -14
- package/dist/{register.setup-DMqotP6N.js → register.setup-BNk3o4bu.js} +14 -14
- package/dist/{register.status-health-sessions-CeY5Pzgk.js → register.status-health-sessions-DXgm8jTd.js} +6 -6
- package/dist/{register.status-health-sessions-CPBz-3k7.js → register.status-health-sessions-n5YTxXMt.js} +6 -6
- package/dist/{register.subclis-Dxe0Sco3.js → register.subclis-h2rwp41b.js} +16 -16
- package/dist/{replies-Bn06Bh1x.js → replies-afs2sQ1G.js} +2 -2
- package/dist/{reply-701mJB_S.js → reply-C6zXCUnw.js} +6 -6
- package/dist/{reply-prefix-DwrVxkMY.js → reply-prefix-CG0zciBg.js} +1 -1
- package/dist/{resolve-route-B4dOoe-E.js → resolve-route-DZkIcri6.js} +1 -1
- package/dist/{run-main-BvouUOJB.js → run-main-BW1xk67k.js} +14 -14
- package/dist/{runtime-helper-grants-CjDNw01t.js → runtime-helper-grants-BotyKHoQ.js} +1 -1
- package/dist/{runtime-helper-grants-B5q5llgE.js → runtime-helper-grants-DlthXnch.js} +1 -1
- package/dist/{sandbox-cli-MNviI01s.js → sandbox-cli-B74LKmmu.js} +2 -2
- package/dist/{sandbox-cli-DKUHq66f.js → sandbox-cli-DVrOgz6X.js} +2 -2
- package/dist/{security-cli-C4J7sHdd.js → security-cli-B_v3gSPc.js} +3 -3
- package/dist/{security-cli-D2jFeCER.js → security-cli-DUh-3-R1.js} +3 -3
- package/dist/{send-vR6HwT94.js → send-CABrQiXU.js} +4 -4
- package/dist/{send-BQMxv218.js → send-CUYy-rA3.js} +7 -7
- package/dist/{send-kLcLFjb8.js → send-DE1no-h6.js} +5 -5
- package/dist/{send-BsajjIj8.js → send-iIy3frXq.js} +5 -5
- package/dist/{send-Da1hCe1A.js → send-lQXOUIaW.js} +18 -18
- package/dist/{server-CvQUqV31.js → server-BWmtB5RG.js} +2 -2
- package/dist/{server-BRsV4GHd.js → server-CVXoSpqC.js} +2 -2
- package/dist/{server-cron-BV2pPZ-O.js → server-cron-D0oLzDes.js} +2 -2
- package/dist/{server-cron-C-3djfm_.js → server-cron-DBSvrOWz.js} +2 -2
- package/dist/{server-node-events-Ce-RXuis.js → server-node-events-BGkUHSkq.js} +3 -3
- package/dist/{server-node-events-Bi8FQeYu.js → server-node-events-TmYB-LGW.js} +3 -3
- package/dist/{session-ZMAktQw4.js → session-TK9Idt8g.js} +5 -5
- package/dist/{skill-commands-BP6zVlmg.js → skill-commands-CCjZMCdx.js} +24 -24
- package/dist/{status-DoLjTnlQ.js → status-C1qehkux.js} +1 -1
- package/dist/{status-CIb_4gfm.js → status-CGYle9wh.js} +4 -4
- package/dist/{status-D9As1GK-.js → status-DVTZ42Xi.js} +1 -1
- package/dist/{status-BiHSisy7.js → status-hNS_-DU5.js} +4 -4
- package/dist/{tables-DMwrn7NN.js → tables-H4kq3TrS.js} +1 -1
- package/dist/{target-errors-CR_hozUt.js → target-errors-9BsSMzQY.js} +2 -2
- package/dist/{tool-loop-detection-DZ-oTJiQ.js → tool-loop-detection-D4MYRJWP.js} +2 -2
- package/dist/{tui-BpbyDMEE.js → tui-ARPlmctm.js} +1 -1
- package/dist/{tui-D9armVLc.js → tui-D6_aw9hu.js} +1 -1
- package/dist/{tui-cli-lN5CL6pA.js → tui-cli-CDBUp2y3.js} +3 -3
- package/dist/{tui-cli-A_j8l8a3.js → tui-cli-CYkhnUmj.js} +3 -3
- package/dist/{update-cli-DRefGXK8.js → update-cli-CVPEyzw1.js} +10 -10
- package/dist/{update-cli-B8_evObo.js → update-cli-ChNYv3li.js} +9 -9
- package/dist/{update-runner-DnLLf66O.js → update-runner-CMe4a4QF.js} +1 -1
- package/dist/{update-runner-Bd7n68kz.js → update-runner-dCQywbJs.js} +1 -1
- package/dist/{web-D-SMykKz.js → web-BIREWy8I.js} +35 -35
- package/dist/{web-778GrijN.js → web-Bly-ch0b.js} +1 -1
- package/dist/{web-CPKh7bSP.js → web-BvK9MRcp.js} +1 -1
- package/dist/{web-DEuBtNld.js → web-CCLojlog.js} +3 -3
- package/dist/{web-Z5JZl5Nc.js → web-CvJzsQ59.js} +3 -3
- package/dist/{web-search-providers.runtime-AAOfSU2b.js → web-search-providers.runtime-BCjJQLBJ.js} +1 -1
- package/dist/{web-search-providers.runtime-DcgcyEiV.js → web-search-providers.runtime-DCy32Tl0.js} +1 -1
- package/dist/{whatsapp-actions-favixTth.js → whatsapp-actions-C0w9GEJM.js} +12 -12
- package/docs/install/index.md +8 -1
- package/docs/install/installer.md +9 -6
- package/docs/install/vps.md +9 -2
- package/docs/start/wizard.md +9 -2
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/feishu/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +12 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +12 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +12 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +12 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +12 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +12 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +12 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +1 -1
- package/dist/pi-model-discovery-runtime-BhaI9PU2.js +0 -5
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { $ as loadSessionStore, $i as resolveOwnerDisplaySetting, $o as matchPluginCommand, $r as discoverFasedAgentPlugins, $t as normalizeTelegramCommandName, A as getChatChannelMeta, Aa as createTelegramActionGate, Ai as extractErrorCode, An as analyzeShellCommand, Ao as resolveMessageChannel, Ar as normalizeModelCatalogModelId, As as isRich, At as DEFAULT_RESET_TRIGGERS, B as loadCombinedSessionStoreForGateway, Ba as resolveSlackAppToken, Bi as logDebug, Bn as isShellWrapperExecutable, Bo as resolveEffectiveEnableState, Br as resolveApiKeyForProfile, Bs as resolveAgentModelFallbackValues, Bt as canonicalizeMainSessionAlias, C as ensureAgentWorkspace, Ca as createNonExitingRuntime, Cn as unsetConfigValueAtPath, Co as isDeliverableMessageChannel, Cr as resolveModelAuthMode, Ct as resolveSessionLockMaxHoldFromTimeout, Da as unregisterActiveProgressLine, Dn as listWritableExplicitTrustedSafeBinDirs, Do as listDeliverableMessageChannels, Dr as retryAsync, Dt as resolveSessionResetPolicy, E as loadWorkspaceBootstrapFiles, Ea as registerActiveProgressLine, En as isTrustedSafeBinPath, Eo as isMarkdownCapableMessageChannel, Es as shouldLogVerbose, Et as resolveChannelResetConfig, F as getActivePluginRegistryKey, Fa as buildChannelAccountBindings, Fi as redactToolDetail, Fn as matchAllowlist, Fo as normalizeHyphenSlug, Fr as getSoonestCooldownExpiry, Fs as resolvePreferredFasedAgentTmpDir, Ft as resolveSessionFilePath, G as extractDeliveryInfo, Ga as createDiscordActionGate, Gn as normalizeSafeBinProfileFixtures, Go as ADMIN_SCOPE, Gr as markAuthProfileGood, Gt as loadConfig, H as resolveContextTokensForModel, Ha as listEnabledSignalAccounts, Hi as logInfo, Hn as unwrapKnownShellMultiplexerInvocation, Ho as CHANNEL_IDS, Hr as dedupeProfileIds, Hs as toAgentModelListLike, Ht as resolveExplicitAgentSessionKey, I as requireActivePluginRegistry, Ii as compileSafeRegex, In as resolveAllowlistCandidatePath, Io as normalizeStringEntries, Ir as isProfileInCooldown, Is as createInternalHookEvent, It as resolveSessionFilePathOptions, J as resolveMirroredTranscriptText, Ja as normalizeDiscordToken, Ji as resolveShellEnvFallbackTimeoutMs, Jn as isSafeExecutableValue, Jo as normalizePluginHttpPath, Jr as resolveFasedAgentAgentDir, Jt as readConfigFileSnapshotForWrite, K as parseSessionThreadInfo, Ka as listEnabledDiscordAccounts, Kn as resolveSafeBinProfiles, Ko as CLI_DEFAULT_OPERATOR_SCOPES, Kr as ensureAuthProfileStore, Kt as parseConfigJson5, L as setActivePluginRegistry, La as isTruthyEnvValue, Li as runCommandWithTimeout, Ln as resolveCommandResolutionFromArgv, Lo as normalizeStringEntriesLower, Lr as markAuthProfileFailure, Lt as resolveSessionTranscriptPath, M as normalizeAnyChannelId, Ma as listTelegramAccountIds, Mi as formatUncaughtError, Mn as isWindowsPlatform, Mo as GATEWAY_CLIENT_MODES, Mr as normalizeProviderCatalogRows, Ms as getChildLogger, Mt as resolveFreshSessionTotalTokens, N as normalizeChannelId$2, Na as resolveTelegramAccount, Nn as splitCommandChain, No as GATEWAY_CLIENT_NAMES, Nt as setSessionRuntimeModel, Oa as formatCliCommand, On as normalizeTrustedSafeBinDirs, Oo as normalizeMessageChannel, Or as buildModelCatalogMergeKey, Os as warn, Ot as resolveSessionResetType, P as getActivePluginRegistry, Pa as resolveTelegramToken, Pi as redactSensitiveText, Pn as DEFAULT_SAFE_BINS, Po as normalizeAtHashSlug, Pr as resolveAuthProfileOrder, Ps as normalizeLogLevel, Pt as resolveDefaultSessionStorePath, Qa as DEFAULT_AGENT_ID, Qi as sanitizeHostExecEnv, Qn as resolveSlackStreamingMode, Qo as listPluginCommands, Qr as loadPluginManifestRegistry, Qt as TELEGRAM_COMMAND_NAME_PATTERN, R as createPluginRegistry, Ra as parseBooleanValue$1, Ri as runExec, Rn as extractShellWrapperInlineCommand, Ro as applyTestPluginDefaults, Rr as markAuthProfileUsed, Rt as resolveSessionTranscriptsDirForAgent, S as DEFAULT_USER_FILENAME, Sa as webAuthExists, Si as getPackageManifestMetadata, Sn as setConfigValueAtPath, So as INTERNAL_MESSAGE_CHANNEL, Sr as resolveEnvApiKey, Ss as danger, St as acquireSessionWriteLock, Ta as clearActiveProgressLine, Ti as openBoundaryFileSync, Tn as getTrustedSafeBinDirs, To as isInternalMessageChannel, Tr as listCurrentModelCatalogRows, Ts as setVerbose, Tt as evaluateSessionFreshness, U as ensureFasedAgentModelsJson, Ua as resolveSignalAccount, Ui as logWarn, Un as splitShellArgs, Uo as CHAT_CHANNEL_ORDER, Ur as listProfilesForProvider, Ut as resolveMainSessionKey, V as lookupContextTokens, Va as resolveSlackBotToken, Vi as logError, Vn as unwrapKnownDispatchWrapperInvocation, Vo as resolveMemorySlotDecision, Vr as runTasksWithConcurrency, Vs as resolveAgentModelPrimaryValue, Vt as resolveAgentMainSessionKey, Wa as resolveIMessageAccount, Wn as SAFE_BIN_PROFILES, Wo as normalizeChatChannelId, Wr as listProvidersWithStoredCredentials, Wt as createConfigIO, X as resolveAndPersistSessionFile, Xa as resolveChannelGroupRequireMention, Xn as resolveDiscordPreviewStreamMode, Xo as executePluginCommand, Xr as findNormalizedProviderValue$1, Xt as writeConfigFile, Y as resolveSessionTranscriptFile, Ya as resolveChannelGroupPolicy, Yi as isDangerousHostEnvOverrideVarName, Yn as mapStreamingModeToSlackLegacyDraftStreamMode, Yo as clearPluginCommands, Yr as withFileLock, Yt as resolveConfigSnapshotHash, Z as emitSessionTranscriptUpdate, Za as resolveChannelGroupToolsPolicy, Zi as isDangerousHostInheritedEnvVarName, Zn as resolveSlackNativeStreaming, Zo as getPluginCommandSpecs, Zr as normalizeProviderId$2, Zt as validateConfigObjectWithPlugins, _ as DEFAULT_BOOTSTRAP_FILENAME, _i as supportsXHighThinking, _n as resetConfigOverrides, _o as isSubagentSessionKey, _r as normalizeGoogleModelId, _s as sleep$1, _t as parseInlineDirectives$1, a as resolveAgentDir, aa as listChannelDocks, ai as isPrivateNetworkBaseUrl, an as resolveIMessageRemoteAttachmentRoots, ao as normalizeMainKey, ar as findNormalizedProviderValue, as as escapeRegExp, at as isCacheEnabled, b as DEFAULT_SOUL_FILENAME, bi as DEFAULT_PROVIDER, bn as getConfigValueAtPath, bo as resolveAccountEntry, br as requireApiKey, bs as truncateUtf16Safe, bt as hasInterSessionUserProvenance, c as resolveAgentSkillsFilter, ca as normalizeSignalMessagingTarget, ci as coerceSecretRef, cn as getBlockedNetworkModeReason, co as sanitizeAgentId, cr as normalizeModelRef$2, ct as deliveryContextKey, d as resolveEffectiveModelFallbacks, di as lookupProviderManifestModelCapability, dn as isAvatarDataUrl, do as normalizeOptionalAccountId, dr as resolveConfiguredModelRef, dt as normalizeSessionDeliveryFields, ea as deriveSessionMetaPatch, ei as isPathInside, en as resolveTelegramCustomCommands, eo as buildAgentMainSessionKey, er as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, es as CONFIG_DIR, et as readSessionUpdatedAt, f as resolveRunModelFallbacksOverride, fa as getWebAuthAgeMs, fi as formatThinkingLevels, fn as isAvatarHttpUrl, fo as isBlockedObjectKey, fr as resolveDefaultModelForAgent, ft as normalizeAccountId$3, g as DEFAULT_AGENT_WORKSPACE_DIR, gi as resolveModelThinkingCapability, gn as getConfigOverrides, go as isCronSessionKey, gr as resolveThinkingDefault, gs as shortenHomePath, gt as extractToolCallNames, h as DEFAULT_AGENTS_FILENAME, hi as normalizeThinkLevel, hn as validateJsonSchemaValue, ho as isAcpSessionKey, hr as resolveSubagentSpawnModelSelection, hs as shortenHomeInString, ht as countToolResults, i as resolveAgentConfig, ia as getChannelDock, ii as resolveAuthProfileDisplayLabel, in as resolveIMessageAttachmentRoots, io as normalizeAgentId, ir as buildModelAliasIndex, is as ensureDir$3, it as updateSessionStoreEntry, j as listChatChannels, ja as listEnabledTelegramAccounts, ji as formatErrorMessage, jn as buildEnforcedShellCommand, jo as GATEWAY_CLIENT_IDS, jr as normalizeModelCatalogProviderId, js as theme, jt as mergeSessionEntry, k as createSubsystemLogger, ka as resolveCliName, ki as resolvePathViaExistingAncestorSync, kn as validateSafeBinArgv, ko as resolveGatewayMessageChannel, kr as mergeModelCatalogRowsByAuthority, ks as colorize, kt as resolveThreadFlag, l as resolveAgentWorkspaceDir, la as hasAnyWhatsAppAuth, li as splitTrailingAuthProfile, ln as parseDurationMs, lo as DEFAULT_ACCOUNT_ID, lr as normalizeProviderId$1, lt as mergeDeliveryContext, m as resolveSessionAgentIds, ma as logoutWeb, mn as isSupportedLocalAvatarExtension, mo as getSubagentDepth, mr as resolveReasoningDefault, mt as capArrayByJsonBytes, n as listAgentEntries, na as listChannelPlugins, ni as resolveFasedAgentPackageRoot, nn as isInboundPathAllowed, nr as buildAllowedModelSet, ns as clampInt, nt as updateLastRoute, oa as isWhatsAppGroupJid, oi as normalizeSecretInput, on as normalizeScpRemoteHost, oo as resolveAgentIdFromSessionKey, or as isCliProvider, os as formatTerminalLink, ot as resolveCacheTtlMs$1, p as resolveSessionAgentId, pa as logWebSelfId, pi as formatXHighModelHint, pn as isPathWithinRoot, po as deriveSessionChatType, pr as resolveModelRefFromString, ps as resolveUserPath, pt as archiveSessionTranscripts, q as appendAssistantMessageToSessionTranscript, qa as resolveDiscordAccount, qi as getShellPathFromLoginShell, qn as applyMergePatch, qo as resolveLeastPrivilegeOperatorScopesForMethod, qr as resolveAuthStorePathForDisplay, qt as readConfigFileSnapshot, r as listAgentIds, ra as normalizeChannelId$1, ri as resolveFasedAgentPackageRootSync, rn as mergeInboundPathRoots, ro as classifySessionKeyShape, rr as buildConfiguredAllowlistKeys, rt as updateSessionStore, s as resolveAgentModelFallbacksOverride, sa as normalizeWhatsAppTarget, si as assertSecretInputResolved, sn as MODEL_APIS, so as resolveThreadSessionKeys, sr as modelKey, ss as isRecord$3, st as deliveryContextFromSession, t as hasConfiguredModelFallbacks, ta as getChannelPlugin, ti as safeStatSync, tn as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, tr as resolveAgentMaxConcurrent, tt as recordSessionMetaFromInbound, u as resolveDefaultAgentId, ua as resolveWhatsAppAccount, ui as isOpenAISignInRuntimeModelSupported, un as AVATAR_MAX_BYTES, uo as normalizeAccountId$2, us as normalizeE164, ut as normalizeDeliveryContext, v as DEFAULT_HEARTBEAT_FILENAME, va as readWebSelfId, vi as DEFAULT_CONTEXT_TOKENS, vn as setConfigOverride, vo as parseAgentSessionKey, vr as getApiKeyForModel, vs as sliceUtf16Safe, vt as INPUT_PROVENANCE_KIND_VALUES, w as filterBootstrapFilesForSession, wa as defaultRuntime, wi as openBoundaryFile, wn as ensurePluginAllowlisted, wo as isGatewayMessageChannel, wr as CURRENT_MODEL_PROVIDER_CATALOG, ws as logVerbose, wt as resolveSessionKey$1, x as DEFAULT_TOOLS_FILENAME, xi as VERSION, xn as parseConfigPath, xo as resolveGroupSessionKey, xr as resolveApiKeyForProvider, xs as isPlainObject, xt as normalizeInputProvenance, y as DEFAULT_IDENTITY_FILENAME, yi as DEFAULT_MODEL, yn as unsetConfigOverride, yo as resolveThreadParentSessionKey, yr as getCustomProviderApiKey, yt as applyInputProvenanceToUserMessage, z as createRuntimeHelpers, za as resolveSlackAccount, zi as spawnWithFallback, zn as isDispatchWrapperExecutable, zo as normalizePluginsConfig, zr as resolveProfilesUnavailableReason, zs as triggerInternalHook, zt as resolveStorePath } from "./agent-scope-Cb1u7HE7.js";
|
|
3
|
-
import { a as saveJsonFile, f as resolveStateDir, h as resolveRequiredHomeDir, i as loadJsonFile, l as resolveGatewayPort, o as STATE_DIR, p as expandHomePrefix, s as resolveConfigPath } from "./github-copilot-token-
|
|
2
|
+
import { $ as loadSessionStore, $i as resolveOwnerDisplaySetting, $o as matchPluginCommand, $r as discoverFasedAgentPlugins, $t as normalizeTelegramCommandName, A as getChatChannelMeta, Aa as createTelegramActionGate, Ai as extractErrorCode, An as analyzeShellCommand, Ao as resolveMessageChannel, Ar as normalizeModelCatalogModelId, As as isRich, At as DEFAULT_RESET_TRIGGERS, B as loadCombinedSessionStoreForGateway, Ba as resolveSlackAppToken, Bi as logDebug, Bn as isShellWrapperExecutable, Bo as resolveEffectiveEnableState, Br as resolveApiKeyForProfile, Bs as resolveAgentModelFallbackValues, Bt as canonicalizeMainSessionAlias, C as ensureAgentWorkspace, Ca as createNonExitingRuntime, Cn as unsetConfigValueAtPath, Co as isDeliverableMessageChannel, Cr as resolveModelAuthMode, Ct as resolveSessionLockMaxHoldFromTimeout, Da as unregisterActiveProgressLine, Dn as listWritableExplicitTrustedSafeBinDirs, Do as listDeliverableMessageChannels, Dr as retryAsync, Dt as resolveSessionResetPolicy, E as loadWorkspaceBootstrapFiles, Ea as registerActiveProgressLine, En as isTrustedSafeBinPath, Eo as isMarkdownCapableMessageChannel, Es as shouldLogVerbose, Et as resolveChannelResetConfig, F as getActivePluginRegistryKey, Fa as buildChannelAccountBindings, Fi as redactToolDetail, Fn as matchAllowlist, Fo as normalizeHyphenSlug, Fr as getSoonestCooldownExpiry, Fs as resolvePreferredFasedAgentTmpDir, Ft as resolveSessionFilePath, G as extractDeliveryInfo, Ga as createDiscordActionGate, Gn as normalizeSafeBinProfileFixtures, Go as ADMIN_SCOPE, Gr as markAuthProfileGood, Gt as loadConfig, H as resolveContextTokensForModel, Ha as listEnabledSignalAccounts, Hi as logInfo, Hn as unwrapKnownShellMultiplexerInvocation, Ho as CHANNEL_IDS, Hr as dedupeProfileIds, Hs as toAgentModelListLike, Ht as resolveExplicitAgentSessionKey, I as requireActivePluginRegistry, Ii as compileSafeRegex, In as resolveAllowlistCandidatePath, Io as normalizeStringEntries, Ir as isProfileInCooldown, Is as createInternalHookEvent, It as resolveSessionFilePathOptions, J as resolveMirroredTranscriptText, Ja as normalizeDiscordToken, Ji as resolveShellEnvFallbackTimeoutMs, Jn as isSafeExecutableValue, Jo as normalizePluginHttpPath, Jr as resolveFasedAgentAgentDir, Jt as readConfigFileSnapshotForWrite, K as parseSessionThreadInfo, Ka as listEnabledDiscordAccounts, Kn as resolveSafeBinProfiles, Ko as CLI_DEFAULT_OPERATOR_SCOPES, Kr as ensureAuthProfileStore, Kt as parseConfigJson5, L as setActivePluginRegistry, La as isTruthyEnvValue, Li as runCommandWithTimeout, Ln as resolveCommandResolutionFromArgv, Lo as normalizeStringEntriesLower, Lr as markAuthProfileFailure, Lt as resolveSessionTranscriptPath, M as normalizeAnyChannelId, Ma as listTelegramAccountIds, Mi as formatUncaughtError, Mn as isWindowsPlatform, Mo as GATEWAY_CLIENT_MODES, Mr as normalizeProviderCatalogRows, Ms as getChildLogger, Mt as resolveFreshSessionTotalTokens, N as normalizeChannelId$2, Na as resolveTelegramAccount, Nn as splitCommandChain, No as GATEWAY_CLIENT_NAMES, Nt as setSessionRuntimeModel, Oa as formatCliCommand, On as normalizeTrustedSafeBinDirs, Oo as normalizeMessageChannel, Or as buildModelCatalogMergeKey, Os as warn, Ot as resolveSessionResetType, P as getActivePluginRegistry, Pa as resolveTelegramToken, Pi as redactSensitiveText, Pn as DEFAULT_SAFE_BINS, Po as normalizeAtHashSlug, Pr as resolveAuthProfileOrder, Ps as normalizeLogLevel, Pt as resolveDefaultSessionStorePath, Qa as DEFAULT_AGENT_ID, Qi as sanitizeHostExecEnv, Qn as resolveSlackStreamingMode, Qo as listPluginCommands, Qr as loadPluginManifestRegistry, Qt as TELEGRAM_COMMAND_NAME_PATTERN, R as createPluginRegistry, Ra as parseBooleanValue$1, Ri as runExec, Rn as extractShellWrapperInlineCommand, Ro as applyTestPluginDefaults, Rr as markAuthProfileUsed, Rt as resolveSessionTranscriptsDirForAgent, S as DEFAULT_USER_FILENAME, Sa as webAuthExists, Si as getPackageManifestMetadata, Sn as setConfigValueAtPath, So as INTERNAL_MESSAGE_CHANNEL, Sr as resolveEnvApiKey, Ss as danger, St as acquireSessionWriteLock, Ta as clearActiveProgressLine, Ti as openBoundaryFileSync, Tn as getTrustedSafeBinDirs, To as isInternalMessageChannel, Tr as listCurrentModelCatalogRows, Ts as setVerbose, Tt as evaluateSessionFreshness, U as ensureFasedAgentModelsJson, Ua as resolveSignalAccount, Ui as logWarn, Un as splitShellArgs, Uo as CHAT_CHANNEL_ORDER, Ur as listProfilesForProvider, Ut as resolveMainSessionKey, V as lookupContextTokens, Va as resolveSlackBotToken, Vi as logError, Vn as unwrapKnownDispatchWrapperInvocation, Vo as resolveMemorySlotDecision, Vr as runTasksWithConcurrency, Vs as resolveAgentModelPrimaryValue, Vt as resolveAgentMainSessionKey, Wa as resolveIMessageAccount, Wn as SAFE_BIN_PROFILES, Wo as normalizeChatChannelId, Wr as listProvidersWithStoredCredentials, Wt as createConfigIO, X as resolveAndPersistSessionFile, Xa as resolveChannelGroupRequireMention, Xn as resolveDiscordPreviewStreamMode, Xo as executePluginCommand, Xr as findNormalizedProviderValue$1, Xt as writeConfigFile, Y as resolveSessionTranscriptFile, Ya as resolveChannelGroupPolicy, Yi as isDangerousHostEnvOverrideVarName, Yn as mapStreamingModeToSlackLegacyDraftStreamMode, Yo as clearPluginCommands, Yr as withFileLock, Yt as resolveConfigSnapshotHash, Z as emitSessionTranscriptUpdate, Za as resolveChannelGroupToolsPolicy, Zi as isDangerousHostInheritedEnvVarName, Zn as resolveSlackNativeStreaming, Zo as getPluginCommandSpecs, Zr as normalizeProviderId$2, Zt as validateConfigObjectWithPlugins, _ as DEFAULT_BOOTSTRAP_FILENAME, _i as supportsXHighThinking, _n as resetConfigOverrides, _o as isSubagentSessionKey, _r as normalizeGoogleModelId, _s as sleep$1, _t as parseInlineDirectives$1, a as resolveAgentDir, aa as listChannelDocks, ai as isPrivateNetworkBaseUrl, an as resolveIMessageRemoteAttachmentRoots, ao as normalizeMainKey, ar as findNormalizedProviderValue, as as escapeRegExp, at as isCacheEnabled, b as DEFAULT_SOUL_FILENAME, bi as DEFAULT_PROVIDER, bn as getConfigValueAtPath, bo as resolveAccountEntry, br as requireApiKey, bs as truncateUtf16Safe, bt as hasInterSessionUserProvenance, c as resolveAgentSkillsFilter, ca as normalizeSignalMessagingTarget, ci as coerceSecretRef, cn as getBlockedNetworkModeReason, co as sanitizeAgentId, cr as normalizeModelRef$2, ct as deliveryContextKey, d as resolveEffectiveModelFallbacks, di as lookupProviderManifestModelCapability, dn as isAvatarDataUrl, do as normalizeOptionalAccountId, dr as resolveConfiguredModelRef, dt as normalizeSessionDeliveryFields, ea as deriveSessionMetaPatch, ei as isPathInside, en as resolveTelegramCustomCommands, eo as buildAgentMainSessionKey, er as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, es as CONFIG_DIR, et as readSessionUpdatedAt, f as resolveRunModelFallbacksOverride, fa as getWebAuthAgeMs, fi as formatThinkingLevels, fn as isAvatarHttpUrl, fo as isBlockedObjectKey, fr as resolveDefaultModelForAgent, ft as normalizeAccountId$3, g as DEFAULT_AGENT_WORKSPACE_DIR, gi as resolveModelThinkingCapability, gn as getConfigOverrides, go as isCronSessionKey, gr as resolveThinkingDefault, gs as shortenHomePath, gt as extractToolCallNames, h as DEFAULT_AGENTS_FILENAME, hi as normalizeThinkLevel, hn as validateJsonSchemaValue, ho as isAcpSessionKey, hr as resolveSubagentSpawnModelSelection, hs as shortenHomeInString, ht as countToolResults, i as resolveAgentConfig, ia as getChannelDock, ii as resolveAuthProfileDisplayLabel, in as resolveIMessageAttachmentRoots, io as normalizeAgentId, ir as buildModelAliasIndex, is as ensureDir$3, it as updateSessionStoreEntry, j as listChatChannels, ja as listEnabledTelegramAccounts, ji as formatErrorMessage, jn as buildEnforcedShellCommand, jo as GATEWAY_CLIENT_IDS, jr as normalizeModelCatalogProviderId, js as theme, jt as mergeSessionEntry, k as createSubsystemLogger, ka as resolveCliName, ki as resolvePathViaExistingAncestorSync, kn as validateSafeBinArgv, ko as resolveGatewayMessageChannel, kr as mergeModelCatalogRowsByAuthority, ks as colorize, kt as resolveThreadFlag, l as resolveAgentWorkspaceDir, la as hasAnyWhatsAppAuth, li as splitTrailingAuthProfile, ln as parseDurationMs, lo as DEFAULT_ACCOUNT_ID, lr as normalizeProviderId$1, lt as mergeDeliveryContext, m as resolveSessionAgentIds, ma as logoutWeb, mn as isSupportedLocalAvatarExtension, mo as getSubagentDepth, mr as resolveReasoningDefault, mt as capArrayByJsonBytes, n as listAgentEntries, na as listChannelPlugins, ni as resolveFasedAgentPackageRoot, nn as isInboundPathAllowed, nr as buildAllowedModelSet, ns as clampInt, nt as updateLastRoute, oa as isWhatsAppGroupJid, oi as normalizeSecretInput, on as normalizeScpRemoteHost, oo as resolveAgentIdFromSessionKey, or as isCliProvider, os as formatTerminalLink, ot as resolveCacheTtlMs$1, p as resolveSessionAgentId, pa as logWebSelfId, pi as formatXHighModelHint, pn as isPathWithinRoot, po as deriveSessionChatType, pr as resolveModelRefFromString, ps as resolveUserPath, pt as archiveSessionTranscripts, q as appendAssistantMessageToSessionTranscript, qa as resolveDiscordAccount, qi as getShellPathFromLoginShell, qn as applyMergePatch, qo as resolveLeastPrivilegeOperatorScopesForMethod, qr as resolveAuthStorePathForDisplay, qt as readConfigFileSnapshot, r as listAgentIds, ra as normalizeChannelId$1, ri as resolveFasedAgentPackageRootSync, rn as mergeInboundPathRoots, ro as classifySessionKeyShape, rr as buildConfiguredAllowlistKeys, rt as updateSessionStore, s as resolveAgentModelFallbacksOverride, sa as normalizeWhatsAppTarget, si as assertSecretInputResolved, sn as MODEL_APIS, so as resolveThreadSessionKeys, sr as modelKey, ss as isRecord$3, st as deliveryContextFromSession, t as hasConfiguredModelFallbacks, ta as getChannelPlugin, ti as safeStatSync, tn as DEFAULT_IMESSAGE_ATTACHMENT_ROOTS, tr as resolveAgentMaxConcurrent, tt as recordSessionMetaFromInbound, u as resolveDefaultAgentId, ua as resolveWhatsAppAccount, ui as isOpenAISignInRuntimeModelSupported, un as AVATAR_MAX_BYTES, uo as normalizeAccountId$2, us as normalizeE164, ut as normalizeDeliveryContext, v as DEFAULT_HEARTBEAT_FILENAME, va as readWebSelfId, vi as DEFAULT_CONTEXT_TOKENS, vn as setConfigOverride, vo as parseAgentSessionKey, vr as getApiKeyForModel, vs as sliceUtf16Safe, vt as INPUT_PROVENANCE_KIND_VALUES, w as filterBootstrapFilesForSession, wa as defaultRuntime, wi as openBoundaryFile, wn as ensurePluginAllowlisted, wo as isGatewayMessageChannel, wr as CURRENT_MODEL_PROVIDER_CATALOG, ws as logVerbose, wt as resolveSessionKey$1, x as DEFAULT_TOOLS_FILENAME, xi as VERSION, xn as parseConfigPath, xo as resolveGroupSessionKey, xr as resolveApiKeyForProvider, xs as isPlainObject, xt as normalizeInputProvenance, y as DEFAULT_IDENTITY_FILENAME, yi as DEFAULT_MODEL, yn as unsetConfigOverride, yo as resolveThreadParentSessionKey, yr as getCustomProviderApiKey, yt as applyInputProvenanceToUserMessage, z as createRuntimeHelpers, za as resolveSlackAccount, zi as spawnWithFallback, zn as isDispatchWrapperExecutable, zo as normalizePluginsConfig, zr as resolveProfilesUnavailableReason, zs as triggerInternalHook, zt as resolveStorePath } from "./agent-scope-DwKyukUg.js";
|
|
3
|
+
import { a as saveJsonFile, f as resolveStateDir, h as resolveRequiredHomeDir, i as loadJsonFile, l as resolveGatewayPort, o as STATE_DIR, p as expandHomePrefix, s as resolveConfigPath } from "./github-copilot-token-eyrRGmGp.js";
|
|
4
4
|
import { n as resolveConversationLabel, r as normalizeChatType } from "./conversation-label-BNq0hhpR.js";
|
|
5
|
-
import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, d as isSilentReplyPrefixText, f as isSilentReplyText, i as createSlackWebClient, l as HEARTBEAT_TOKEN, m as resolveSlackChannelId, o as parseSlackBlocksInput, p as parseSlackTarget, s as validateSlackBlocksArray, t as sendMessageSlack, u as SILENT_REPLY_TOKEN } from "./send-
|
|
6
|
-
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-
|
|
5
|
+
import { a as resolveSlackWebClientOptions, c as buildSlackBlocksFallbackText, d as isSilentReplyPrefixText, f as isSilentReplyText, i as createSlackWebClient, l as HEARTBEAT_TOKEN, m as resolveSlackChannelId, o as parseSlackBlocksInput, p as parseSlackTarget, s as validateSlackBlocksArray, t as sendMessageSlack, u as SILENT_REPLY_TOKEN } from "./send-CABrQiXU.js";
|
|
6
|
+
import { $ as fetchChannelPermissionsDiscord, A as unpinMessageDiscord, B as listScheduledEventsDiscord, C as editMessageDiscord, Ct as resolveTimestampMs, D as pinMessageDiscord, Dt as normalizeChannelSlug, E as listThreadsDiscord, Et as buildChannelKeyCandidates, F as fetchMemberInfoDiscord, G as uploadStickerDiscord, H as timeoutMemberDiscord, I as fetchRoleInfoDiscord, J as editChannelDiscord, K as createChannelDiscord, L as fetchVoiceStatusDiscord, M as banMemberDiscord, N as createScheduledEventDiscord, O as readMessagesDiscord, Ot as resolveChannelEntryMatchWithFallback, P as fetchChannelInfoDiscord, Q as stripUndefinedFields, R as kickMemberDiscord, S as deleteMessageDiscord, St as resolveDiscordSystemLocation, T as listPinsDiscord, Tt as applyChannelMatchMeta, U as listGuildEmojisDiscord, V as removeRoleDiscord, W as uploadEmojiDiscord, X as removeChannelPermissionDiscord, Y as moveChannelDiscord, Z as setChannelPermissionDiscord, _ as sendPollDiscord, _t as resolveDiscordShouldRequireMention, a as removeReactionDiscord, at as resolveDiscordChannelId, b as sendWebhookMessageDiscord, bt as formatDiscordReactionEmoji, c as formatDiscordComponentEventText, ct as allowListMatches$1, d as parseDiscordModalCustomId, dt as normalizeDiscordSlug, et as hasAnyGuildPermissionDiscord, f as parseDiscordModalCustomIdForCarbon, ft as resolveDiscordAllowListMatch, g as sendMessageDiscord, gt as resolveDiscordOwnerAllowFrom, h as resolveDiscordModalEntry, ht as resolveDiscordMemberAccessState, i as removeOwnReactionsDiscord, it as parseDiscordTarget, j as addRoleDiscord, k as searchMessagesDiscord, l as parseDiscordComponentCustomId, lt as isDiscordGroupAllowedByPolicy, m as resolveDiscordComponentEntry, mt as resolveDiscordGuildEntry, n as fetchReactionsDiscord, nt as createDiscordClient, o as sendDiscordComponentMessage, ot as listDiscordDirectoryGroupsLive, p as readDiscordComponentSpec, pt as resolveDiscordChannelConfigWithFallback, q as deleteChannelDiscord, r as reactMessageDiscord, rt as createDiscordRestClient, s as createDiscordFormModal, st as listDiscordDirectoryPeersLive, tt as chunkDiscordTextWithMode, u as parseDiscordComponentCustomIdForCarbon, ut as normalizeDiscordAllowList, v as sendStickerDiscord, vt as resolveGroupDmAllow, w as fetchMessageDiscord, wt as fetchDiscord, x as createThreadDiscord, xt as formatDiscordUserTag, y as sendVoiceMessageDiscord, yt as shouldEmitDiscordReactionNotification, z as listGuildChannelsDiscord } from "./send-CUYy-rA3.js";
|
|
7
7
|
import { n as generateSecureUuid, t as generateSecureToken } from "./secure-random-CSsVRTTy.js";
|
|
8
|
-
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-
|
|
8
|
+
import { a as logMessageProcessed, c as logWebhookError, d as startDiagnosticHeartbeat, f as stopDiagnosticHeartbeat, i as logLaneEnqueue, l as logWebhookProcessed, m as isDiagnosticsEnabled, o as logMessageQueued, p as emitDiagnosticEvent, r as logLaneDequeue, s as logSessionStateChange, t as diag, u as logWebhookReceived } from "./diagnostic-B4NKiC20.js";
|
|
9
9
|
import { r as getDiagnosticSessionState } from "./diagnostic-session-state-CexmAKza.js";
|
|
10
10
|
import { t as redactIdentifier } from "./redact-identifier-Cy6Tnhkn.js";
|
|
11
|
-
import { $ as readChannelAllowFromStore, A as extractTelegramLocation, B as normalizeAllowFrom$2, C as buildTelegramGroupFrom, D as buildTypingThreadParams, E as buildTelegramThreadParams, F as resolveTelegramMediaPlaceholder, G as mergeDmAllowFromSources, H as resolveSenderAllowMatch, I as resolveTelegramReplyId, J as toLocationContext, K as resolveGroupAllowFromSources, L as resolveTelegramStreamMode, M as normalizeForwardedContext, N as resolveTelegramForumThreadId, O as describeReplyTarget, P as resolveTelegramGroupAllowFromContext, Q as addChannelAllowFromStoreEntry, R as resolveTelegramThreadSpec, S as buildSenderName, T as buildTelegramParentPeer, U as firstDefined$2, V as normalizeDmAllowFromWithStore$1, W as isSenderIdAllowed, X as resolveCronStorePath, Y as loadCronStore, Z as saveCronStore, _ as resolveTelegramFetch, a as reactMessageTelegram, at as listPairingChannels, b as buildGroupLabel, c as sendStickerTelegram, ct as resolveTelegramTargetChatType, d as wasSentByBot, et as removeChannelAllowFromStoreEntry, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, it as getPairingAdapter, j as hasBotMention, k as expandTextLinks, m as markdownToTelegramHtml, n as createForumTopicTelegram, nt as readJsonFileWithFallback, o as sendMessageTelegram, ot as isVoiceCompatibleAudio, p as markdownToTelegramChunks, q as formatLocationText, r as deleteMessageTelegram, rt as writeJsonFileAtomically, s as sendPollTelegram, st as parseTelegramTarget, t as buildInlineKeyboard, tt as upsertChannelPairingRequest, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramGroupPeerId, x as buildSenderLabel, y as withTelegramApiErrorLogging, z as isSenderAllowed$1 } from "./send-
|
|
12
|
-
import { E as mediaKindFromMime, S as kindFromMime, _ as extensionForMime, a as buildImageResizeSideGrid, b as isAudioFileName, c as MediaFetchError, g as detectMime, h as getDefaultMediaLocalRoots, i as IMAGE_REDUCE_QUALITY_STEPS, l as fetchRemoteMedia, m as getAgentScopedMediaLocalRoots, n as loadWebMedia, o as getImageMetadata, s as resizeToJpeg, t as getDefaultLocalRoots, u as readResponseWithLimit, v as getFileExtension, w as MAX_IMAGE_BYTES, x as isGifMedia, y as imageMimeFromFormat } from "./media-
|
|
13
|
-
import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-
|
|
14
|
-
import { B as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, C as assertBrowserNavigationAllowed, D as fetchJson$1, E as appendCdpPath, F as isLoopbackHost, G as DEFAULT_FASED_BROWSER_COLOR, H as DEFAULT_AI_SNAPSHOT_MAX_CHARS, I as isSecureWebSocketUrl, K as DEFAULT_FASED_BROWSER_ENABLED, L as isTrustedProxyAddress, M as stopChromeExtensionRelayServer, N as rawDataToString, O as fetchOk, P as isLoopbackAddress, R as resolveClientIp, S as InvalidBrowserNavigationUrlError, T as withBrowserNavigationPolicy, U as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, W as DEFAULT_BROWSER_EVALUATE_ENABLED, _ as captureScreenshot, b as normalizeCdpWsUrl, c as normalizeBrowserFormField, d as isChromeReachable, f as launchFasedAgentChrome, g as resolveLsofCommandSync, h as resolveBrowserExecutableForPlatform, i as resolveExistingPathsWithinRoot, j as ensureChromeExtensionRelayServer, m as stopFasedAgentChrome, n as DEFAULT_TRACE_DIR, o as resolveWritablePathWithinRoot, p as resolveFasedAgentUserDataDir, q as DEFAULT_FASED_BROWSER_PROFILE_NAME, r as DEFAULT_UPLOAD_DIR, t as DEFAULT_DOWNLOAD_DIR, u as isChromeCdpReady, v as createTargetViaCdp, w as assertBrowserNavigationResultAllowed, x as snapshotAria, z as resolveForwardedClientIp } from "./paths-
|
|
11
|
+
import { $ as readChannelAllowFromStore, A as extractTelegramLocation, B as normalizeAllowFrom$2, C as buildTelegramGroupFrom, D as buildTypingThreadParams, E as buildTelegramThreadParams, F as resolveTelegramMediaPlaceholder, G as mergeDmAllowFromSources, H as resolveSenderAllowMatch, I as resolveTelegramReplyId, J as toLocationContext, K as resolveGroupAllowFromSources, L as resolveTelegramStreamMode, M as normalizeForwardedContext, N as resolveTelegramForumThreadId, O as describeReplyTarget, P as resolveTelegramGroupAllowFromContext, Q as addChannelAllowFromStoreEntry, R as resolveTelegramThreadSpec, S as buildSenderName, T as buildTelegramParentPeer, U as firstDefined$2, V as normalizeDmAllowFromWithStore$1, W as isSenderIdAllowed, X as resolveCronStorePath, Y as loadCronStore, Z as saveCronStore, _ as resolveTelegramFetch, a as reactMessageTelegram, at as listPairingChannels, b as buildGroupLabel, c as sendStickerTelegram, ct as resolveTelegramTargetChatType, d as wasSentByBot, et as removeChannelAllowFromStoreEntry, f as isRecoverableTelegramNetworkError, g as wrapFileReferencesInHtml, h as renderTelegramHtmlText, i as editMessageTelegram, it as getPairingAdapter, j as hasBotMention, k as expandTextLinks, m as markdownToTelegramHtml, n as createForumTopicTelegram, nt as readJsonFileWithFallback, o as sendMessageTelegram, ot as isVoiceCompatibleAudio, p as markdownToTelegramChunks, q as formatLocationText, r as deleteMessageTelegram, rt as writeJsonFileAtomically, s as sendPollTelegram, st as parseTelegramTarget, t as buildInlineKeyboard, tt as upsertChannelPairingRequest, u as resolveTelegramVoiceSend, v as splitTelegramCaption, w as buildTelegramGroupPeerId, x as buildSenderLabel, y as withTelegramApiErrorLogging, z as isSenderAllowed$1 } from "./send-lQXOUIaW.js";
|
|
12
|
+
import { E as mediaKindFromMime, S as kindFromMime, _ as extensionForMime, a as buildImageResizeSideGrid, b as isAudioFileName, c as MediaFetchError, g as detectMime, h as getDefaultMediaLocalRoots, i as IMAGE_REDUCE_QUALITY_STEPS, l as fetchRemoteMedia, m as getAgentScopedMediaLocalRoots, n as loadWebMedia, o as getImageMetadata, s as resizeToJpeg, t as getDefaultLocalRoots, u as readResponseWithLimit, v as getFileExtension, w as MAX_IMAGE_BYTES, x as isGifMedia, y as imageMimeFromFormat } from "./media-DZj8v0oe.js";
|
|
13
|
+
import { i as discoverModels, r as discoverAuthStorage } from "./pi-model-discovery-CfcnLOyX.js";
|
|
14
|
+
import { B as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, C as assertBrowserNavigationAllowed, D as fetchJson$1, E as appendCdpPath, F as isLoopbackHost, G as DEFAULT_FASED_BROWSER_COLOR, H as DEFAULT_AI_SNAPSHOT_MAX_CHARS, I as isSecureWebSocketUrl, K as DEFAULT_FASED_BROWSER_ENABLED, L as isTrustedProxyAddress, M as stopChromeExtensionRelayServer, N as rawDataToString, O as fetchOk, P as isLoopbackAddress, R as resolveClientIp, S as InvalidBrowserNavigationUrlError, T as withBrowserNavigationPolicy, U as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, W as DEFAULT_BROWSER_EVALUATE_ENABLED, _ as captureScreenshot, b as normalizeCdpWsUrl, c as normalizeBrowserFormField, d as isChromeReachable, f as launchFasedAgentChrome, g as resolveLsofCommandSync, h as resolveBrowserExecutableForPlatform, i as resolveExistingPathsWithinRoot, j as ensureChromeExtensionRelayServer, m as stopFasedAgentChrome, n as DEFAULT_TRACE_DIR, o as resolveWritablePathWithinRoot, p as resolveFasedAgentUserDataDir, q as DEFAULT_FASED_BROWSER_PROFILE_NAME, r as DEFAULT_UPLOAD_DIR, t as DEFAULT_DOWNLOAD_DIR, u as isChromeCdpReady, v as createTargetViaCdp, w as assertBrowserNavigationResultAllowed, x as snapshotAria, z as resolveForwardedClientIp } from "./paths-57KGLbK2.js";
|
|
15
15
|
import { i as isBlockedHostnameOrIp, o as normalizeHostname, t as SsrFBlockedError } from "./ssrf-DYsl9qoS.js";
|
|
16
16
|
import { n as redactSensitiveUrlLikeString, t as redactSensitiveUrl } from "./redact-sensitive-url-Dp_gOi-q.js";
|
|
17
|
-
import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-
|
|
18
|
-
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards
|
|
19
|
-
import { a as writeFileWithinRoot, n as openFileWithinRoot, r as readFileWithinRoot, t as SafeOpenError } from "./fs-safe-
|
|
20
|
-
import { C as createAsyncLock, S as resolvePairingPaths, T as writeJsonAtomic, _ as assertSandboxPath, b as resolveSandboxedMediaSource, c as getSkillsSnapshotVersion, d as resolveSkillsPromptForRun, f as syncSkillsToWorkspace, g as assertMediaNotDataUrl, h as sanitizeEnvVars, i as resolveSkillCommandInvocation, l as buildWorkspaceSkillSnapshot, m as applySkillEnvOverridesFromSnapshot, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as applySkillEnvOverrides, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as loadWorkspaceSkillEntries, v as resolveSandboxInputPath, w as readJsonFile$1, x as pruneExpiredPending, y as resolveSandboxPath } from "./skill-commands-
|
|
21
|
-
import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, n as chunkByParagraph, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-
|
|
22
|
-
import { n as resolveMarkdownTableMode } from "./markdown-tables-
|
|
23
|
-
import { a as resolveSignalRpcContext, c as streamSignalEvents, l as markdownToSignalTextChunks, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-
|
|
17
|
+
import { a as resolveAgentIdentity, i as resolveAckReaction, o as resolveEffectiveMessagesConfig, r as resolveResponsePrefixTemplate, s as resolveHumanDelayConfig, t as createReplyPrefixOptions } from "./reply-prefix-CG0zciBg.js";
|
|
18
|
+
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-BgsM3Cb3.js";
|
|
19
|
+
import { a as writeFileWithinRoot, n as openFileWithinRoot, r as readFileWithinRoot, t as SafeOpenError } from "./fs-safe-CwUdejUJ.js";
|
|
20
|
+
import { C as createAsyncLock, S as resolvePairingPaths, T as writeJsonAtomic, _ as assertSandboxPath, b as resolveSandboxedMediaSource, c as getSkillsSnapshotVersion, d as resolveSkillsPromptForRun, f as syncSkillsToWorkspace, g as assertMediaNotDataUrl, h as sanitizeEnvVars, i as resolveSkillCommandInvocation, l as buildWorkspaceSkillSnapshot, m as applySkillEnvOverridesFromSnapshot, n as listSkillCommandsForAgents, o as getRemoteSkillEligibility, p as applySkillEnvOverrides, r as listSkillCommandsForWorkspace, s as ensureSkillsWatcher, t as listReservedChatSlashCommandNames, u as loadWorkspaceSkillEntries, v as resolveSandboxInputPath, w as readJsonFile$1, x as pruneExpiredPending, y as resolveSandboxPath } from "./skill-commands-CCjZMCdx.js";
|
|
21
|
+
import { a as chunkText, c as resolveChunkMode, d as isSafeFenceBreak, f as parseFenceSpans, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit, n as chunkByParagraph, o as chunkTextWithMode, r as chunkMarkdownText, t as chunkByNewline, u as findFenceSpanAt } from "./chunk-DfA5CGzI.js";
|
|
22
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DFtTedxN.js";
|
|
23
|
+
import { a as resolveSignalRpcContext, c as streamSignalEvents, l as markdownToSignalTextChunks, n as sendReadReceiptSignal, o as signalCheck, r as sendTypingSignal, s as signalRpcRequest, t as sendMessageSignal } from "./send-iIy3frXq.js";
|
|
24
24
|
import { n as fetchWithTimeout, t as bindAbortRelay } from "./fetch-timeout-ByUoGUeM.js";
|
|
25
|
-
import { t as fetchWithSsrFGuard } from "./fetch-guard-
|
|
26
|
-
import { i as saveMediaBuffer, n as ensureMediaDir, r as getMediaDir } from "./outbound-attachment-
|
|
27
|
-
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-
|
|
28
|
-
import { t as resolveMemorySearchConfig } from "./memory-search-
|
|
29
|
-
import { i as executeWithApiKeyRotation, n as parseGeminiAuth, r as collectProviderApiKeysForExecution } from "./manager-
|
|
30
|
-
import { c as normalizeExtraMemoryPaths, s as listMemoryFiles } from "./internal-
|
|
31
|
-
import { i as resolveQmdScopeDenial } from "./qmd-scope-
|
|
32
|
-
import { _ as sanitizeToolResultImages, a as createActionGate, b as estimateBase64DecodedBytes, c as jsonResult, d as readReactionParams, f as readStringArrayParam, g as sanitizeImageBlocks, h as sanitizeContentBlocksImages, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam, v as resolveImageSanitizationLimits, y as canonicalizeBase64 } from "./target-errors-
|
|
33
|
-
import { C as isRestartEnabled, S as isNativeCommandsExplicitlyDisabled, T as resolveNativeSkillsEnabled, _ as normalizeReasoningLevel, a as listChatCommands, b as resolveResponseUsageMode, c as listNativeCommandSpecsForConfig, d as parseCommandArgs, f as resolveCommandArgChoices, g as normalizeElevatedLevel, h as shouldHandleTextCommands, i as isCommandEnabled, l as maybeResolveTextAlias, m as serializeCommandArgs, o as listChatCommandsForConfig, p as resolveCommandArgMenu, r as findCommandByNativeName, s as listNativeCommandSpecs, t as buildCommandTextFromArgs, u as normalizeCommandBody, v as normalizeUsageDisplay, w as resolveNativeCommandsEnabled, x as isCommandFlagEnabled, y as normalizeVerboseLevel } from "./commands-registry-
|
|
25
|
+
import { t as fetchWithSsrFGuard } from "./fetch-guard-DqpQMLwE.js";
|
|
26
|
+
import { i as saveMediaBuffer, n as ensureMediaDir, r as getMediaDir } from "./outbound-attachment-NKTzAe-U.js";
|
|
27
|
+
import { n as wrapFetchWithAbortSignal, t as resolveFetch } from "./fetch-BH7uURYM.js";
|
|
28
|
+
import { t as resolveMemorySearchConfig } from "./memory-search-BxRjHrXP.js";
|
|
29
|
+
import { i as executeWithApiKeyRotation, n as parseGeminiAuth, r as collectProviderApiKeysForExecution } from "./manager-Cxjfnksb.js";
|
|
30
|
+
import { c as normalizeExtraMemoryPaths, s as listMemoryFiles } from "./internal-CU3wrcPl.js";
|
|
31
|
+
import { i as resolveQmdScopeDenial } from "./qmd-scope-BdblEj4C.js";
|
|
32
|
+
import { _ as sanitizeToolResultImages, a as createActionGate, b as estimateBase64DecodedBytes, c as jsonResult, d as readReactionParams, f as readStringArrayParam, g as sanitizeImageBlocks, h as sanitizeContentBlocksImages, l as parseAvailableTags, m as readStringParam, n as missingTargetError, o as imageResult, p as readStringOrNumberParam, r as unknownTargetError, s as imageResultFromFile, t as ambiguousTargetError, u as readNumberParam, v as resolveImageSanitizationLimits, y as canonicalizeBase64 } from "./target-errors-9BsSMzQY.js";
|
|
33
|
+
import { C as isRestartEnabled, S as isNativeCommandsExplicitlyDisabled, T as resolveNativeSkillsEnabled, _ as normalizeReasoningLevel, a as listChatCommands, b as resolveResponseUsageMode, c as listNativeCommandSpecsForConfig, d as parseCommandArgs, f as resolveCommandArgChoices, g as normalizeElevatedLevel, h as shouldHandleTextCommands, i as isCommandEnabled, l as maybeResolveTextAlias, m as serializeCommandArgs, o as listChatCommandsForConfig, p as resolveCommandArgMenu, r as findCommandByNativeName, s as listNativeCommandSpecs, t as buildCommandTextFromArgs, u as normalizeCommandBody, v as normalizeUsageDisplay, w as resolveNativeCommandsEnabled, x as isCommandFlagEnabled, y as normalizeVerboseLevel } from "./commands-registry-ShBrc7Zz.js";
|
|
34
34
|
import { r as normalizeInboundTextNewlines, t as finalizeInboundContext } from "./inbound-context-B0OuvpCZ.js";
|
|
35
35
|
import { n as normalizePollInput } from "./polls-CYTwXmA1.js";
|
|
36
36
|
import { n as recordCommandPoll, r as resetCommandPollCount } from "./command-poll-backoff-BvR7Vq1g.js";
|
|
37
|
-
import { a as formatIMessageChatTarget, c as normalizeIMessageHandle, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, l as parseIMessageTarget, o as formatIMessageTargetForLog, r as createIMessageRpcClient, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-
|
|
38
|
-
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-
|
|
39
|
-
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-
|
|
40
|
-
import { t as convertMarkdownTables } from "./tables-
|
|
37
|
+
import { a as formatIMessageChatTarget, c as normalizeIMessageHandle, i as DEFAULT_IMESSAGE_PROBE_TIMEOUT_MS, l as parseIMessageTarget, o as formatIMessageTargetForLog, r as createIMessageRpcClient, s as isAllowedIMessageSender, t as sendMessageIMessage } from "./send-DE1no-h6.js";
|
|
38
|
+
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-DZkIcri6.js";
|
|
39
|
+
import { n as recordChannelActivity, r as createDiscordRetryRunner, t as getChannelActivity } from "./channel-activity-D17GYsMz.js";
|
|
40
|
+
import { t as convertMarkdownTables } from "./tables-H4kq3TrS.js";
|
|
41
41
|
import { t as makeProxyFetch } from "./proxy-DkRPPIHD.js";
|
|
42
42
|
import { t as resolveHookConfig } from "./config-CtKjZZ4x.js";
|
|
43
|
-
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
44
|
-
import { t as getActiveWebListener } from "./active-listener-
|
|
43
|
+
import { a as createReplyReferencePlanner, i as resolveSlackThreadTs, n as deliverReplies$3, t as createSlackReplyDeliveryPlan } from "./replies-afs2sQ1G.js";
|
|
44
|
+
import { t as getActiveWebListener } from "./active-listener-CILIY2ox.js";
|
|
45
45
|
import { createRequire } from "node:module";
|
|
46
|
-
import * as fs$
|
|
46
|
+
import * as fs$1 from "node:fs/promises";
|
|
47
47
|
import fs, { appendFile, mkdir } from "node:fs/promises";
|
|
48
48
|
import os, { homedir } from "node:os";
|
|
49
49
|
import * as path$1 from "node:path";
|
|
50
50
|
import path, { isAbsolute, posix } from "node:path";
|
|
51
|
-
import
|
|
51
|
+
import syncFs, { constants, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
52
52
|
import JSON5 from "json5";
|
|
53
53
|
import { inspect, isDeepStrictEqual, promisify } from "node:util";
|
|
54
54
|
import crypto, { X509Certificate, createDecipheriv, createHash, createHmac, randomBytes, randomUUID, scryptSync, timingSafeEqual } from "node:crypto";
|
|
@@ -65,7 +65,7 @@ import { AddressLookupTableAccount, PublicKey, VersionedTransaction } from "@sol
|
|
|
65
65
|
import { Type } from "@sinclair/typebox";
|
|
66
66
|
import { Value } from "@sinclair/typebox/value";
|
|
67
67
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
68
|
-
import WebSocket, { WebSocket
|
|
68
|
+
import WebSocket$1, { WebSocket } from "ws";
|
|
69
69
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
70
70
|
import { ProxyAgent, fetch as fetch$1 } from "undici";
|
|
71
71
|
import "@fedify/fedify";
|
|
@@ -4872,7 +4872,7 @@ function resolveSatRuntimeDefaultsFile(env = process.env) {
|
|
|
4872
4872
|
path.resolve(import.meta.dirname, "..", "..", "config", "sat-runtime.env"),
|
|
4873
4873
|
path.resolve(import.meta.dirname, "..", "..", "..", "config", "sat-runtime.env")
|
|
4874
4874
|
];
|
|
4875
|
-
for (const candidate of candidates) if (candidate &&
|
|
4875
|
+
for (const candidate of candidates) if (candidate && syncFs.existsSync(candidate)) return candidate;
|
|
4876
4876
|
return null;
|
|
4877
4877
|
}
|
|
4878
4878
|
function loadSatRuntimeDefaults(env = process.env) {
|
|
@@ -4880,7 +4880,7 @@ function loadSatRuntimeDefaults(env = process.env) {
|
|
|
4880
4880
|
if (explicit) return explicit;
|
|
4881
4881
|
const file = resolveSatRuntimeDefaultsFile(env);
|
|
4882
4882
|
if (!file) return null;
|
|
4883
|
-
const parsed = parseEnvFile(
|
|
4883
|
+
const parsed = parseEnvFile(syncFs.readFileSync(file, "utf8"));
|
|
4884
4884
|
if (!parsed.programId || !parsed.bondProgramId || !parsed.mintAddress || !parsed.mintProgramId) return null;
|
|
4885
4885
|
return {
|
|
4886
4886
|
programId: parsed.programId,
|
|
@@ -4987,12 +4987,12 @@ function resolveWalletStatePaths(env = process.env) {
|
|
|
4987
4987
|
}
|
|
4988
4988
|
function ensureWalletStateDir(env = process.env) {
|
|
4989
4989
|
const paths = resolveWalletStatePaths(env);
|
|
4990
|
-
|
|
4990
|
+
syncFs.mkdirSync(paths.rootDir, {
|
|
4991
4991
|
recursive: true,
|
|
4992
4992
|
mode: 448
|
|
4993
4993
|
});
|
|
4994
4994
|
try {
|
|
4995
|
-
|
|
4995
|
+
syncFs.chmodSync(paths.rootDir, 448);
|
|
4996
4996
|
} catch {}
|
|
4997
4997
|
return paths;
|
|
4998
4998
|
}
|
|
@@ -5288,9 +5288,9 @@ function normalizeRegistry(raw) {
|
|
|
5288
5288
|
}
|
|
5289
5289
|
function readWalletProviderRegistry(env = process.env) {
|
|
5290
5290
|
const file = registryPath(env);
|
|
5291
|
-
if (!
|
|
5291
|
+
if (!syncFs.existsSync(file)) return makeDefaultRegistry();
|
|
5292
5292
|
try {
|
|
5293
|
-
const normalized = normalizeRegistry(JSON.parse(
|
|
5293
|
+
const normalized = normalizeRegistry(JSON.parse(syncFs.readFileSync(file, "utf8")));
|
|
5294
5294
|
if (normalized.changed) writeWalletProviderRegistry(normalized.registry, env);
|
|
5295
5295
|
return normalized.registry;
|
|
5296
5296
|
} catch {
|
|
@@ -5304,12 +5304,12 @@ function writeWalletProviderRegistry(registry, env = process.env) {
|
|
|
5304
5304
|
version: 1,
|
|
5305
5305
|
updatedAt: nowIso$2()
|
|
5306
5306
|
};
|
|
5307
|
-
|
|
5307
|
+
syncFs.writeFileSync(file, `${JSON.stringify(payload, null, 2)}\n`, {
|
|
5308
5308
|
encoding: "utf8",
|
|
5309
5309
|
mode: REGISTRY_FILE_MODE
|
|
5310
5310
|
});
|
|
5311
5311
|
try {
|
|
5312
|
-
|
|
5312
|
+
syncFs.chmodSync(file, REGISTRY_FILE_MODE);
|
|
5313
5313
|
} catch {}
|
|
5314
5314
|
}
|
|
5315
5315
|
function resolveWalletSelectionForAgent(params) {
|
|
@@ -6313,7 +6313,7 @@ var EmbeddedKeystoreAdapter = class {
|
|
|
6313
6313
|
checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
6314
6314
|
details: "missing embedded keystore config (FASED_WALLET_KEYSTORE_PATH, FASED_WALLET_PASSPHRASE, FASED_WALLET_[EMBEDDED_KEYSTORE_]RPC_URL)"
|
|
6315
6315
|
};
|
|
6316
|
-
if (!
|
|
6316
|
+
if (!syncFs.existsSync(this.keystorePath)) return {
|
|
6317
6317
|
ok: false,
|
|
6318
6318
|
provider: this.id,
|
|
6319
6319
|
configured: true,
|
|
@@ -6321,7 +6321,7 @@ var EmbeddedKeystoreAdapter = class {
|
|
|
6321
6321
|
details: `keystore file not found: ${this.keystorePath}`
|
|
6322
6322
|
};
|
|
6323
6323
|
try {
|
|
6324
|
-
if (detectKeystoreType(await
|
|
6324
|
+
if (detectKeystoreType(await syncFs.promises.readFile(this.keystorePath, "utf8")) !== "solana-envelope") throw new Error("keystore file is not a Solana keystore envelope");
|
|
6325
6325
|
const [address, lamports] = await Promise.all([this.getSolanaAddress(), this.getSolanaBalanceLamports()]);
|
|
6326
6326
|
return {
|
|
6327
6327
|
ok: true,
|
|
@@ -6353,7 +6353,7 @@ var EmbeddedKeystoreAdapter = class {
|
|
|
6353
6353
|
return result;
|
|
6354
6354
|
}
|
|
6355
6355
|
try {
|
|
6356
|
-
if (detectKeystoreType(await
|
|
6356
|
+
if (detectKeystoreType(await syncFs.promises.readFile(this.keystorePath, "utf8")) === "solana-envelope") {
|
|
6357
6357
|
if (this.supportsChain("solana")) result.solana = await this.getSolanaAddress();
|
|
6358
6358
|
}
|
|
6359
6359
|
return result;
|
|
@@ -6538,7 +6538,7 @@ var EmbeddedKeystoreAdapter = class {
|
|
|
6538
6538
|
message: "embedded-keystore missing keystore path or passphrase"
|
|
6539
6539
|
});
|
|
6540
6540
|
this.solanaKeypairPromise ??= (async () => {
|
|
6541
|
-
const envelope = parseSolanaKeystoreEnvelope(await
|
|
6541
|
+
const envelope = parseSolanaKeystoreEnvelope(await syncFs.promises.readFile(this.keystorePath, "utf8"));
|
|
6542
6542
|
if (!envelope) throw new WalletProviderError({
|
|
6543
6543
|
code: "wallet_provider_invalid_config",
|
|
6544
6544
|
message: "embedded-keystore file is not a Solana keystore envelope"
|
|
@@ -6763,7 +6763,7 @@ function signerTimeoutFor(payload) {
|
|
|
6763
6763
|
function assertSecureLocalSignerSocket(socketPath) {
|
|
6764
6764
|
let stat;
|
|
6765
6765
|
try {
|
|
6766
|
-
stat =
|
|
6766
|
+
stat = syncFs.lstatSync(socketPath);
|
|
6767
6767
|
} catch (err) {
|
|
6768
6768
|
throw new WalletProviderError({
|
|
6769
6769
|
code: "wallet_provider_unavailable",
|
|
@@ -7187,12 +7187,12 @@ const MASTER_KEY_BYTES = 32;
|
|
|
7187
7187
|
const MASTER_KEY_FILENAME = "master.key";
|
|
7188
7188
|
function ensureSecretsDir(env = process.env) {
|
|
7189
7189
|
const dir = path.join(resolveStateDir(env), "secrets");
|
|
7190
|
-
|
|
7190
|
+
syncFs.mkdirSync(dir, {
|
|
7191
7191
|
recursive: true,
|
|
7192
7192
|
mode: SECRETS_DIR_MODE
|
|
7193
7193
|
});
|
|
7194
7194
|
try {
|
|
7195
|
-
|
|
7195
|
+
syncFs.chmodSync(dir, SECRETS_DIR_MODE);
|
|
7196
7196
|
} catch {}
|
|
7197
7197
|
return dir;
|
|
7198
7198
|
}
|
|
@@ -7205,18 +7205,18 @@ function resolveWalletProviderSecretPath(providerId, env = process.env) {
|
|
|
7205
7205
|
}
|
|
7206
7206
|
function readOrCreateMasterKey(env = process.env) {
|
|
7207
7207
|
const keyPath = resolveMasterKeyPath(env);
|
|
7208
|
-
if (
|
|
7209
|
-
const raw =
|
|
7208
|
+
if (syncFs.existsSync(keyPath)) {
|
|
7209
|
+
const raw = syncFs.readFileSync(keyPath, "utf8").trim();
|
|
7210
7210
|
const parsed = Buffer.from(raw, "hex");
|
|
7211
7211
|
if (parsed.length === MASTER_KEY_BYTES) return parsed;
|
|
7212
7212
|
}
|
|
7213
7213
|
const key = randomBytes(MASTER_KEY_BYTES);
|
|
7214
|
-
|
|
7214
|
+
syncFs.writeFileSync(keyPath, `${key.toString("hex")}\n`, {
|
|
7215
7215
|
mode: SECRET_FILE_MODE,
|
|
7216
7216
|
encoding: "utf8"
|
|
7217
7217
|
});
|
|
7218
7218
|
try {
|
|
7219
|
-
|
|
7219
|
+
syncFs.chmodSync(keyPath, SECRET_FILE_MODE);
|
|
7220
7220
|
} catch {}
|
|
7221
7221
|
return key;
|
|
7222
7222
|
}
|
|
@@ -7266,9 +7266,9 @@ function decryptProviderPayload(encrypted, env = process.env) {
|
|
|
7266
7266
|
}
|
|
7267
7267
|
function loadWalletProviderSecret(providerId, env = process.env) {
|
|
7268
7268
|
const secretPath = resolveWalletProviderSecretPath(providerId, env);
|
|
7269
|
-
if (!
|
|
7269
|
+
if (!syncFs.existsSync(secretPath)) return null;
|
|
7270
7270
|
try {
|
|
7271
|
-
const value = decryptProviderPayload(JSON.parse(
|
|
7271
|
+
const value = decryptProviderPayload(JSON.parse(syncFs.readFileSync(secretPath, "utf8")), env);
|
|
7272
7272
|
if (!value || value.providerId !== providerId) return null;
|
|
7273
7273
|
return value;
|
|
7274
7274
|
} catch {
|
|
@@ -7602,14 +7602,14 @@ function normalizeState(input) {
|
|
|
7602
7602
|
}
|
|
7603
7603
|
function loadState$2(env = process.env) {
|
|
7604
7604
|
const statePath = resolveStatePath(env);
|
|
7605
|
-
if (!
|
|
7605
|
+
if (!syncFs.existsSync(statePath)) return {
|
|
7606
7606
|
version: 2,
|
|
7607
7607
|
passkeys: [],
|
|
7608
7608
|
challenges: [],
|
|
7609
7609
|
grants: []
|
|
7610
7610
|
};
|
|
7611
7611
|
try {
|
|
7612
|
-
const raw =
|
|
7612
|
+
const raw = syncFs.readFileSync(statePath, "utf8");
|
|
7613
7613
|
return normalizeState(JSON.parse(raw));
|
|
7614
7614
|
} catch {
|
|
7615
7615
|
return {
|
|
@@ -7622,12 +7622,12 @@ function loadState$2(env = process.env) {
|
|
|
7622
7622
|
}
|
|
7623
7623
|
function saveState$1(state, env = process.env) {
|
|
7624
7624
|
const statePath = resolveStatePath(env);
|
|
7625
|
-
|
|
7625
|
+
syncFs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, {
|
|
7626
7626
|
encoding: "utf8",
|
|
7627
7627
|
mode: 384
|
|
7628
7628
|
});
|
|
7629
7629
|
try {
|
|
7630
|
-
|
|
7630
|
+
syncFs.chmodSync(statePath, 384);
|
|
7631
7631
|
} catch {}
|
|
7632
7632
|
}
|
|
7633
7633
|
function pruneState$1(state) {
|
|
@@ -7769,9 +7769,9 @@ function normalizeWalletUsageBucket(raw) {
|
|
|
7769
7769
|
}
|
|
7770
7770
|
function loadLedger(paths) {
|
|
7771
7771
|
const fallback = defaultWalletUsageLedger();
|
|
7772
|
-
if (!
|
|
7772
|
+
if (!syncFs.existsSync(paths.dailyUsagePath)) return fallback;
|
|
7773
7773
|
try {
|
|
7774
|
-
const raw =
|
|
7774
|
+
const raw = syncFs.readFileSync(paths.dailyUsagePath, "utf8");
|
|
7775
7775
|
const parsed = JSON.parse(raw);
|
|
7776
7776
|
if (parsed && parsed.version === 2 && typeof parsed.date === "string") {
|
|
7777
7777
|
const walletsRaw = parsed.wallets && typeof parsed.wallets === "object" && !Array.isArray(parsed.wallets) ? parsed.wallets : {};
|
|
@@ -7799,9 +7799,9 @@ function loadLedger(paths) {
|
|
|
7799
7799
|
return fallback;
|
|
7800
7800
|
}
|
|
7801
7801
|
function writeLedger(paths, ledger) {
|
|
7802
|
-
|
|
7802
|
+
syncFs.writeFileSync(paths.dailyUsagePath, `${JSON.stringify(ledger, null, 2)}\n`, { mode: 384 });
|
|
7803
7803
|
try {
|
|
7804
|
-
|
|
7804
|
+
syncFs.chmodSync(paths.dailyUsagePath, 384);
|
|
7805
7805
|
} catch {}
|
|
7806
7806
|
}
|
|
7807
7807
|
function resolveWalletUsageBucket(ledger, walletId) {
|
|
@@ -8007,9 +8007,9 @@ function readWalletPolicyState(env = process.env) {
|
|
|
8007
8007
|
updatedAt: nowIso$1(),
|
|
8008
8008
|
wallets: {}
|
|
8009
8009
|
};
|
|
8010
|
-
if (!
|
|
8010
|
+
if (!syncFs.existsSync(statePath)) return fallback;
|
|
8011
8011
|
try {
|
|
8012
|
-
const raw =
|
|
8012
|
+
const raw = syncFs.readFileSync(statePath, "utf8");
|
|
8013
8013
|
const parsed = JSON.parse(raw);
|
|
8014
8014
|
if (parsed.version !== 1) return fallback;
|
|
8015
8015
|
const walletsRaw = parsed.wallets && typeof parsed.wallets === "object" && !Array.isArray(parsed.wallets) ? parsed.wallets : {};
|
|
@@ -8030,9 +8030,9 @@ function readWalletPolicyState(env = process.env) {
|
|
|
8030
8030
|
}
|
|
8031
8031
|
function writeWalletPolicyState(state, env = process.env) {
|
|
8032
8032
|
const statePath = resolveWalletPolicyStatePath(ensureWalletStateDir(env));
|
|
8033
|
-
|
|
8033
|
+
syncFs.writeFileSync(statePath, `${JSON.stringify(state, null, 2)}\n`, { mode: 384 });
|
|
8034
8034
|
try {
|
|
8035
|
-
|
|
8035
|
+
syncFs.chmodSync(statePath, 384);
|
|
8036
8036
|
} catch {}
|
|
8037
8037
|
}
|
|
8038
8038
|
function buildResolvedPolicyFromDefaults(defaults) {
|
|
@@ -8645,25 +8645,25 @@ function resolveCustodyShareStatePath(walletId, env = process.env) {
|
|
|
8645
8645
|
}
|
|
8646
8646
|
function locateCustodyStatePath(walletId, env = process.env) {
|
|
8647
8647
|
const scopedPath = resolveCustodyStatePath(walletId, env);
|
|
8648
|
-
if (
|
|
8648
|
+
if (syncFs.existsSync(scopedPath)) return scopedPath;
|
|
8649
8649
|
const legacyPath = resolveLegacyCustodyStatePath(env);
|
|
8650
|
-
return
|
|
8650
|
+
return syncFs.existsSync(legacyPath) ? legacyPath : scopedPath;
|
|
8651
8651
|
}
|
|
8652
8652
|
function locateCustodyShareStatePath(walletId, env = process.env) {
|
|
8653
8653
|
const scopedPath = resolveCustodyShareStatePath(walletId, env);
|
|
8654
|
-
if (
|
|
8654
|
+
if (syncFs.existsSync(scopedPath)) return scopedPath;
|
|
8655
8655
|
const legacyPath = resolveLegacyCustodyShareStatePath(env);
|
|
8656
|
-
return
|
|
8656
|
+
return syncFs.existsSync(legacyPath) ? legacyPath : scopedPath;
|
|
8657
8657
|
}
|
|
8658
8658
|
function listCustodyStateTargets(env = process.env) {
|
|
8659
8659
|
const walletPaths = ensureWalletStateDir(env);
|
|
8660
8660
|
const custodyRoot = path.join(walletPaths.rootDir, "custody");
|
|
8661
8661
|
const targets = /* @__PURE__ */ new Set();
|
|
8662
|
-
if (
|
|
8663
|
-
for (const entry of
|
|
8662
|
+
if (syncFs.existsSync(custodyRoot)) {
|
|
8663
|
+
for (const entry of syncFs.readdirSync(custodyRoot, { withFileTypes: true })) if (entry.isDirectory() && entry.name.trim()) targets.add(entry.name.trim());
|
|
8664
8664
|
}
|
|
8665
8665
|
const out = [...targets];
|
|
8666
|
-
if (
|
|
8666
|
+
if (syncFs.existsSync(resolveLegacyCustodyStatePath(env)) || out.length === 0) out.push(void 0);
|
|
8667
8667
|
return out;
|
|
8668
8668
|
}
|
|
8669
8669
|
function readUnlockTtlSeconds(env = process.env, requestedTtlSeconds) {
|
|
@@ -8885,9 +8885,9 @@ function resolveWalletCustodyScope(params) {
|
|
|
8885
8885
|
}
|
|
8886
8886
|
function loadShareState(walletId, env = process.env) {
|
|
8887
8887
|
const filePath = locateCustodyShareStatePath(walletId, env);
|
|
8888
|
-
if (!
|
|
8888
|
+
if (!syncFs.existsSync(filePath)) return null;
|
|
8889
8889
|
try {
|
|
8890
|
-
const parsed = JSON.parse(
|
|
8890
|
+
const parsed = JSON.parse(syncFs.readFileSync(filePath, "utf8"));
|
|
8891
8891
|
if (parsed.version === 1 && parsed.scheme === "xor-3of3-v1" && typeof parsed.secretBytes === "number" && parsed.secretBytes > 0 && typeof parsed.hotShare === "string" && typeof parsed.coldShare === "string" && typeof parsed.deviceShareHash === "string" && typeof parsed.secretChecksum === "string" && typeof parsed.createdAt === "string" && typeof parsed.updatedAt === "string") {
|
|
8892
8892
|
const hot = decodeBase64Share(parsed.hotShare);
|
|
8893
8893
|
const cold = decodeBase64Share(parsed.coldShare);
|
|
@@ -8948,12 +8948,12 @@ function loadShareState(walletId, env = process.env) {
|
|
|
8948
8948
|
}
|
|
8949
8949
|
function loadState$1(walletId, env = process.env) {
|
|
8950
8950
|
const filePath = locateCustodyStatePath(walletId, env);
|
|
8951
|
-
if (!
|
|
8951
|
+
if (!syncFs.existsSync(filePath)) return {
|
|
8952
8952
|
version: 1,
|
|
8953
8953
|
unlockSessions: []
|
|
8954
8954
|
};
|
|
8955
8955
|
try {
|
|
8956
|
-
const parsed = JSON.parse(
|
|
8956
|
+
const parsed = JSON.parse(syncFs.readFileSync(filePath, "utf8"));
|
|
8957
8957
|
if (parsed.version !== 1 || !Array.isArray(parsed.unlockSessions)) return {
|
|
8958
8958
|
version: 1,
|
|
8959
8959
|
unlockSessions: []
|
|
@@ -8990,16 +8990,16 @@ function loadState$1(walletId, env = process.env) {
|
|
|
8990
8990
|
}
|
|
8991
8991
|
function saveState(state, walletId, env = process.env) {
|
|
8992
8992
|
const filePath = resolveCustodyStatePath(walletId, env);
|
|
8993
|
-
|
|
8993
|
+
syncFs.mkdirSync(path.dirname(filePath), {
|
|
8994
8994
|
recursive: true,
|
|
8995
8995
|
mode: 448
|
|
8996
8996
|
});
|
|
8997
|
-
|
|
8997
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(state, null, 2)}\n`, {
|
|
8998
8998
|
encoding: "utf8",
|
|
8999
8999
|
mode: 384
|
|
9000
9000
|
});
|
|
9001
9001
|
try {
|
|
9002
|
-
|
|
9002
|
+
syncFs.chmodSync(filePath, 384);
|
|
9003
9003
|
} catch {}
|
|
9004
9004
|
}
|
|
9005
9005
|
function pruneState(state) {
|
|
@@ -9530,7 +9530,7 @@ function identityHasValues(identity) {
|
|
|
9530
9530
|
}
|
|
9531
9531
|
function loadIdentityFromFile(identityPath) {
|
|
9532
9532
|
try {
|
|
9533
|
-
const parsed = parseIdentityMarkdown(
|
|
9533
|
+
const parsed = parseIdentityMarkdown(syncFs.readFileSync(identityPath, "utf-8"));
|
|
9534
9534
|
if (!identityHasValues(parsed)) return null;
|
|
9535
9535
|
return parsed;
|
|
9536
9536
|
} catch {
|
|
@@ -9558,7 +9558,7 @@ function resolveAvatarSource(cfg, agentId, opts) {
|
|
|
9558
9558
|
}
|
|
9559
9559
|
function resolveExistingPath(value) {
|
|
9560
9560
|
try {
|
|
9561
|
-
return
|
|
9561
|
+
return syncFs.realpathSync(value);
|
|
9562
9562
|
} catch {
|
|
9563
9563
|
return path.resolve(value);
|
|
9564
9564
|
}
|
|
@@ -9576,7 +9576,7 @@ function resolveLocalAvatarPath(params) {
|
|
|
9576
9576
|
reason: "unsupported_extension"
|
|
9577
9577
|
};
|
|
9578
9578
|
try {
|
|
9579
|
-
const stat =
|
|
9579
|
+
const stat = syncFs.statSync(realPath);
|
|
9580
9580
|
if (!stat.isFile()) return {
|
|
9581
9581
|
ok: false,
|
|
9582
9582
|
reason: "missing"
|
|
@@ -9650,12 +9650,12 @@ function appendWalletAuditEntry(params) {
|
|
|
9650
9650
|
actor: params.actor?.trim() || "system",
|
|
9651
9651
|
details: params.details ?? {}
|
|
9652
9652
|
};
|
|
9653
|
-
|
|
9653
|
+
syncFs.appendFileSync(paths.auditLogPath, `${JSON.stringify(entry)}\n`, {
|
|
9654
9654
|
encoding: "utf8",
|
|
9655
9655
|
mode: 384
|
|
9656
9656
|
});
|
|
9657
9657
|
try {
|
|
9658
|
-
|
|
9658
|
+
syncFs.chmodSync(paths.auditLogPath, 384);
|
|
9659
9659
|
} catch {}
|
|
9660
9660
|
return entry;
|
|
9661
9661
|
}
|
|
@@ -9799,7 +9799,7 @@ function resolveDefaultIdentityPath() {
|
|
|
9799
9799
|
return path.join(resolveStateDir(), "identity", "device.json");
|
|
9800
9800
|
}
|
|
9801
9801
|
function ensureDir$2(filePath) {
|
|
9802
|
-
|
|
9802
|
+
syncFs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
9803
9803
|
}
|
|
9804
9804
|
const ED25519_SPKI_PREFIX$1 = Buffer.from("302a300506032b6570032100", "hex");
|
|
9805
9805
|
function base64UrlEncode(buf) {
|
|
@@ -9835,8 +9835,8 @@ function generateIdentity() {
|
|
|
9835
9835
|
}
|
|
9836
9836
|
function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
9837
9837
|
try {
|
|
9838
|
-
if (
|
|
9839
|
-
const raw =
|
|
9838
|
+
if (syncFs.existsSync(filePath)) {
|
|
9839
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
9840
9840
|
const parsed = JSON.parse(raw);
|
|
9841
9841
|
if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
|
|
9842
9842
|
const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
|
|
@@ -9845,9 +9845,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
9845
9845
|
...parsed,
|
|
9846
9846
|
deviceId: derivedId
|
|
9847
9847
|
};
|
|
9848
|
-
|
|
9848
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
|
|
9849
9849
|
try {
|
|
9850
|
-
|
|
9850
|
+
syncFs.chmodSync(filePath, 384);
|
|
9851
9851
|
} catch {}
|
|
9852
9852
|
return {
|
|
9853
9853
|
deviceId: derivedId,
|
|
@@ -9872,9 +9872,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
9872
9872
|
privateKeyPem: identity.privateKeyPem,
|
|
9873
9873
|
createdAtMs: Date.now()
|
|
9874
9874
|
};
|
|
9875
|
-
|
|
9875
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
|
|
9876
9876
|
try {
|
|
9877
|
-
|
|
9877
|
+
syncFs.chmodSync(filePath, 384);
|
|
9878
9878
|
} catch {}
|
|
9879
9879
|
return identity;
|
|
9880
9880
|
}
|
|
@@ -10581,12 +10581,12 @@ function linksFilePath(env = process.env) {
|
|
|
10581
10581
|
}
|
|
10582
10582
|
function loadFile$1(env = process.env) {
|
|
10583
10583
|
const filePath = linksFilePath(env);
|
|
10584
|
-
if (!
|
|
10584
|
+
if (!syncFs.existsSync(filePath)) return {
|
|
10585
10585
|
version: 1,
|
|
10586
10586
|
links: []
|
|
10587
10587
|
};
|
|
10588
10588
|
try {
|
|
10589
|
-
const parsed = JSON.parse(
|
|
10589
|
+
const parsed = JSON.parse(syncFs.readFileSync(filePath, "utf8"));
|
|
10590
10590
|
if (parsed?.version === 1 && Array.isArray(parsed.links)) return {
|
|
10591
10591
|
version: 1,
|
|
10592
10592
|
links: parsed.links
|
|
@@ -10599,12 +10599,12 @@ function loadFile$1(env = process.env) {
|
|
|
10599
10599
|
}
|
|
10600
10600
|
function saveFile$1(file, env = process.env) {
|
|
10601
10601
|
const filePath = linksFilePath(env);
|
|
10602
|
-
|
|
10602
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, {
|
|
10603
10603
|
encoding: "utf8",
|
|
10604
10604
|
mode: 384
|
|
10605
10605
|
});
|
|
10606
10606
|
try {
|
|
10607
|
-
|
|
10607
|
+
syncFs.chmodSync(filePath, 384);
|
|
10608
10608
|
} catch {}
|
|
10609
10609
|
}
|
|
10610
10610
|
function upsertWalletSettlementLink(params) {
|
|
@@ -10706,7 +10706,7 @@ function sanitizeStore(raw) {
|
|
|
10706
10706
|
function loadStore(filePath = resolveTaskRegistryPath()) {
|
|
10707
10707
|
if (cachedStore && loadedPath === filePath) return cachedStore;
|
|
10708
10708
|
try {
|
|
10709
|
-
const raw =
|
|
10709
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
10710
10710
|
cachedStore = sanitizeStore(JSON.parse(raw));
|
|
10711
10711
|
} catch {
|
|
10712
10712
|
cachedStore = defaultStore();
|
|
@@ -10715,10 +10715,10 @@ function loadStore(filePath = resolveTaskRegistryPath()) {
|
|
|
10715
10715
|
return cachedStore;
|
|
10716
10716
|
}
|
|
10717
10717
|
function saveStore(store, filePath = resolveTaskRegistryPath()) {
|
|
10718
|
-
|
|
10718
|
+
syncFs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
10719
10719
|
const tmpPath = `${filePath}.${process.pid}.${Date.now()}.tmp`;
|
|
10720
|
-
|
|
10721
|
-
|
|
10720
|
+
syncFs.writeFileSync(tmpPath, `${JSON.stringify(store, null, 2)}\n`, "utf8");
|
|
10721
|
+
syncFs.renameSync(tmpPath, filePath);
|
|
10722
10722
|
cachedStore = store;
|
|
10723
10723
|
loadedPath = filePath;
|
|
10724
10724
|
}
|
|
@@ -11312,12 +11312,12 @@ async function executeWalletSendWithRetry(params) {
|
|
|
11312
11312
|
}
|
|
11313
11313
|
function loadFile(env = process.env) {
|
|
11314
11314
|
const paths = ensureWalletStateDir(env);
|
|
11315
|
-
if (!
|
|
11315
|
+
if (!syncFs.existsSync(paths.sendApprovalsPath)) return {
|
|
11316
11316
|
version: 1,
|
|
11317
11317
|
requests: []
|
|
11318
11318
|
};
|
|
11319
11319
|
try {
|
|
11320
|
-
const parsed = JSON.parse(
|
|
11320
|
+
const parsed = JSON.parse(syncFs.readFileSync(paths.sendApprovalsPath, "utf8"));
|
|
11321
11321
|
if (parsed?.version === 1 && Array.isArray(parsed.requests)) return {
|
|
11322
11322
|
version: 1,
|
|
11323
11323
|
requests: parsed.requests
|
|
@@ -11330,12 +11330,12 @@ function loadFile(env = process.env) {
|
|
|
11330
11330
|
}
|
|
11331
11331
|
function saveFile(file, env = process.env) {
|
|
11332
11332
|
const paths = ensureWalletStateDir(env);
|
|
11333
|
-
|
|
11333
|
+
syncFs.writeFileSync(paths.sendApprovalsPath, `${JSON.stringify(file, null, 2)}\n`, {
|
|
11334
11334
|
encoding: "utf8",
|
|
11335
11335
|
mode: 384
|
|
11336
11336
|
});
|
|
11337
11337
|
try {
|
|
11338
|
-
|
|
11338
|
+
syncFs.chmodSync(paths.sendApprovalsPath, 384);
|
|
11339
11339
|
} catch {}
|
|
11340
11340
|
}
|
|
11341
11341
|
function markExpired(file) {
|
|
@@ -11749,7 +11749,7 @@ function walkUpFrom(startDir, opts, resolveAtDir) {
|
|
|
11749
11749
|
function hasGitMarker(repoRoot) {
|
|
11750
11750
|
const gitPath = path.join(repoRoot, ".git");
|
|
11751
11751
|
try {
|
|
11752
|
-
const stat =
|
|
11752
|
+
const stat = syncFs.statSync(gitPath);
|
|
11753
11753
|
return stat.isDirectory() || stat.isFile();
|
|
11754
11754
|
} catch {
|
|
11755
11755
|
return false;
|
|
@@ -11761,10 +11761,10 @@ function findGitRoot(startDir, opts = {}) {
|
|
|
11761
11761
|
function resolveGitDirFromMarker(repoRoot) {
|
|
11762
11762
|
const gitPath = path.join(repoRoot, ".git");
|
|
11763
11763
|
try {
|
|
11764
|
-
const stat =
|
|
11764
|
+
const stat = syncFs.statSync(gitPath);
|
|
11765
11765
|
if (stat.isDirectory()) return gitPath;
|
|
11766
11766
|
if (!stat.isFile()) return null;
|
|
11767
|
-
const match =
|
|
11767
|
+
const match = syncFs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
11768
11768
|
if (!match?.[1]) return null;
|
|
11769
11769
|
return path.resolve(repoRoot, match[1].trim());
|
|
11770
11770
|
} catch {
|
|
@@ -11813,7 +11813,7 @@ function isMissingPathError$2(error) {
|
|
|
11813
11813
|
function resolveGitRefsBase(headPath) {
|
|
11814
11814
|
const gitDir = path.dirname(headPath);
|
|
11815
11815
|
try {
|
|
11816
|
-
const commonDirRaw =
|
|
11816
|
+
const commonDirRaw = syncFs.readFileSync(path.join(gitDir, "commondir"), "utf-8").trim();
|
|
11817
11817
|
if (!commonDirRaw) return gitDir;
|
|
11818
11818
|
return path.resolve(gitDir, commonDirRaw);
|
|
11819
11819
|
} catch (error) {
|
|
@@ -11832,7 +11832,7 @@ function resolveRefPath(refsBase, ref) {
|
|
|
11832
11832
|
}
|
|
11833
11833
|
function readCommitFromPackedRefs(refsBase, ref) {
|
|
11834
11834
|
try {
|
|
11835
|
-
const packedRefs =
|
|
11835
|
+
const packedRefs = syncFs.readFileSync(path.join(refsBase, "packed-refs"), "utf-8");
|
|
11836
11836
|
for (const line of packedRefs.split("\n")) {
|
|
11837
11837
|
if (!line || line.startsWith("#") || line.startsWith("^")) continue;
|
|
11838
11838
|
const [commit, packedRef] = line.trim().split(/\s+/, 2);
|
|
@@ -11868,7 +11868,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
11868
11868
|
cachedCommit = null;
|
|
11869
11869
|
return cachedCommit;
|
|
11870
11870
|
}
|
|
11871
|
-
const head =
|
|
11871
|
+
const head = syncFs.readFileSync(headPath, "utf-8").trim();
|
|
11872
11872
|
if (!head) {
|
|
11873
11873
|
cachedCommit = null;
|
|
11874
11874
|
return cachedCommit;
|
|
@@ -11882,7 +11882,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
11882
11882
|
return cachedCommit;
|
|
11883
11883
|
}
|
|
11884
11884
|
try {
|
|
11885
|
-
cachedCommit = formatCommit(
|
|
11885
|
+
cachedCommit = formatCommit(syncFs.readFileSync(refPath, "utf-8").trim());
|
|
11886
11886
|
return cachedCommit;
|
|
11887
11887
|
} catch (error) {
|
|
11888
11888
|
if (!isMissingPathError$2(error)) throw error;
|
|
@@ -12093,9 +12093,9 @@ function sanitizeBucket(input) {
|
|
|
12093
12093
|
}
|
|
12094
12094
|
function readSnapshot(env) {
|
|
12095
12095
|
const file = observabilityPath(env);
|
|
12096
|
-
if (!
|
|
12096
|
+
if (!syncFs.existsSync(file)) return makeDefaultSnapshot();
|
|
12097
12097
|
try {
|
|
12098
|
-
const parsed = JSON.parse(
|
|
12098
|
+
const parsed = JSON.parse(syncFs.readFileSync(file, "utf8"));
|
|
12099
12099
|
if (parsed?.version !== 1) return makeDefaultSnapshot();
|
|
12100
12100
|
return {
|
|
12101
12101
|
version: 1,
|
|
@@ -12112,12 +12112,12 @@ function readSnapshot(env) {
|
|
|
12112
12112
|
}
|
|
12113
12113
|
function writeSnapshot(env, snapshot) {
|
|
12114
12114
|
const file = observabilityPath(env);
|
|
12115
|
-
|
|
12115
|
+
syncFs.writeFileSync(file, `${JSON.stringify(snapshot, null, 2)}\n`, {
|
|
12116
12116
|
mode: 384,
|
|
12117
12117
|
encoding: "utf8"
|
|
12118
12118
|
});
|
|
12119
12119
|
try {
|
|
12120
|
-
|
|
12120
|
+
syncFs.chmodSync(file, 384);
|
|
12121
12121
|
} catch {}
|
|
12122
12122
|
}
|
|
12123
12123
|
function incrementWalletObservabilityCounter(params) {
|
|
@@ -13326,8 +13326,8 @@ function resolveDeviceAuthPath(env = process.env) {
|
|
|
13326
13326
|
}
|
|
13327
13327
|
function readStore(filePath) {
|
|
13328
13328
|
try {
|
|
13329
|
-
if (!
|
|
13330
|
-
const raw =
|
|
13329
|
+
if (!syncFs.existsSync(filePath)) return null;
|
|
13330
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
13331
13331
|
const parsed = JSON.parse(raw);
|
|
13332
13332
|
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
13333
13333
|
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
@@ -13337,10 +13337,10 @@ function readStore(filePath) {
|
|
|
13337
13337
|
}
|
|
13338
13338
|
}
|
|
13339
13339
|
function writeStore(filePath, store) {
|
|
13340
|
-
|
|
13341
|
-
|
|
13340
|
+
syncFs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
13341
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
13342
13342
|
try {
|
|
13343
|
-
|
|
13343
|
+
syncFs.chmodSync(filePath, 384);
|
|
13344
13344
|
} catch {}
|
|
13345
13345
|
}
|
|
13346
13346
|
function loadDeviceAuthToken(params) {
|
|
@@ -16318,7 +16318,7 @@ var GatewayClient = class {
|
|
|
16318
16318
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
16319
16319
|
});
|
|
16320
16320
|
}
|
|
16321
|
-
this.ws = new WebSocket
|
|
16321
|
+
this.ws = new WebSocket(url, wsOptions);
|
|
16322
16322
|
this.ws.on("open", () => {
|
|
16323
16323
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
16324
16324
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -16514,7 +16514,7 @@ var GatewayClient = class {
|
|
|
16514
16514
|
const connectChallengeTimeoutMs = typeof rawConnectDelayMs === "number" && Number.isFinite(rawConnectDelayMs) ? Math.max(250, Math.min(1e4, rawConnectDelayMs)) : 2e3;
|
|
16515
16515
|
if (this.connectTimer) clearTimeout(this.connectTimer);
|
|
16516
16516
|
this.connectTimer = setTimeout(() => {
|
|
16517
|
-
if (this.connectSent || this.ws?.readyState !== WebSocket
|
|
16517
|
+
if (this.connectSent || this.ws?.readyState !== WebSocket.OPEN) return;
|
|
16518
16518
|
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge timeout"));
|
|
16519
16519
|
this.ws?.close(1008, "connect challenge timeout");
|
|
16520
16520
|
}, connectChallengeTimeoutMs);
|
|
@@ -16556,7 +16556,7 @@ var GatewayClient = class {
|
|
|
16556
16556
|
return null;
|
|
16557
16557
|
}
|
|
16558
16558
|
async request(method, params, opts) {
|
|
16559
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
16559
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
16560
16560
|
const id = randomUUID();
|
|
16561
16561
|
const frame = {
|
|
16562
16562
|
type: "req",
|
|
@@ -17896,11 +17896,11 @@ function resolveFailedDir(stateDir) {
|
|
|
17896
17896
|
/** Ensure the queue directory (and failed/ subdirectory) exist. */
|
|
17897
17897
|
async function ensureQueueDir(stateDir) {
|
|
17898
17898
|
const queueDir = resolveQueueDir(stateDir);
|
|
17899
|
-
await
|
|
17899
|
+
await syncFs.promises.mkdir(queueDir, {
|
|
17900
17900
|
recursive: true,
|
|
17901
17901
|
mode: 448
|
|
17902
17902
|
});
|
|
17903
|
-
await
|
|
17903
|
+
await syncFs.promises.mkdir(resolveFailedDir(stateDir), {
|
|
17904
17904
|
recursive: true,
|
|
17905
17905
|
mode: 448
|
|
17906
17906
|
});
|
|
@@ -17927,18 +17927,18 @@ async function enqueueDelivery(params, stateDir) {
|
|
|
17927
17927
|
const filePath = path.join(queueDir, `${id}.json`);
|
|
17928
17928
|
const tmp = `${filePath}.${process.pid}.tmp`;
|
|
17929
17929
|
const json = JSON.stringify(entry, null, 2);
|
|
17930
|
-
await
|
|
17930
|
+
await syncFs.promises.writeFile(tmp, json, {
|
|
17931
17931
|
encoding: "utf-8",
|
|
17932
17932
|
mode: 384
|
|
17933
17933
|
});
|
|
17934
|
-
await
|
|
17934
|
+
await syncFs.promises.rename(tmp, filePath);
|
|
17935
17935
|
return id;
|
|
17936
17936
|
}
|
|
17937
17937
|
/** Remove a successfully delivered entry from the queue. */
|
|
17938
17938
|
async function ackDelivery(id, stateDir) {
|
|
17939
17939
|
const filePath = path.join(resolveQueueDir(stateDir), `${id}.json`);
|
|
17940
17940
|
try {
|
|
17941
|
-
await
|
|
17941
|
+
await syncFs.promises.unlink(filePath);
|
|
17942
17942
|
} catch (err) {
|
|
17943
17943
|
if ((err && typeof err === "object" && "code" in err ? String(err.code) : null) !== "ENOENT") throw err;
|
|
17944
17944
|
}
|
|
@@ -17946,17 +17946,17 @@ async function ackDelivery(id, stateDir) {
|
|
|
17946
17946
|
/** Update a queue entry after a failed delivery attempt. */
|
|
17947
17947
|
async function failDelivery(id, error, stateDir) {
|
|
17948
17948
|
const filePath = path.join(resolveQueueDir(stateDir), `${id}.json`);
|
|
17949
|
-
const raw = await
|
|
17949
|
+
const raw = await syncFs.promises.readFile(filePath, "utf-8");
|
|
17950
17950
|
const entry = JSON.parse(raw);
|
|
17951
17951
|
entry.retryCount += 1;
|
|
17952
17952
|
entry.lastAttemptAt = Date.now();
|
|
17953
17953
|
entry.lastError = error;
|
|
17954
17954
|
const tmp = `${filePath}.${process.pid}.tmp`;
|
|
17955
|
-
await
|
|
17955
|
+
await syncFs.promises.writeFile(tmp, JSON.stringify(entry, null, 2), {
|
|
17956
17956
|
encoding: "utf-8",
|
|
17957
17957
|
mode: 384
|
|
17958
17958
|
});
|
|
17959
|
-
await
|
|
17959
|
+
await syncFs.promises.rename(tmp, filePath);
|
|
17960
17960
|
}
|
|
17961
17961
|
|
|
17962
17962
|
//#endregion
|
|
@@ -19122,27 +19122,27 @@ function createOutboundSendDepsFromCliSource(deps) {
|
|
|
19122
19122
|
function createDefaultDeps() {
|
|
19123
19123
|
return {
|
|
19124
19124
|
sendMessageWhatsApp: async (...args) => {
|
|
19125
|
-
const { sendMessageWhatsApp } = await import("./web-
|
|
19125
|
+
const { sendMessageWhatsApp } = await import("./web-BIREWy8I.js");
|
|
19126
19126
|
return await sendMessageWhatsApp(...args);
|
|
19127
19127
|
},
|
|
19128
19128
|
sendMessageTelegram: async (...args) => {
|
|
19129
|
-
const { sendMessageTelegram } = await import("./send-
|
|
19129
|
+
const { sendMessageTelegram } = await import("./send-lQXOUIaW.js").then((n) => n.l);
|
|
19130
19130
|
return await sendMessageTelegram(...args);
|
|
19131
19131
|
},
|
|
19132
19132
|
sendMessageDiscord: async (...args) => {
|
|
19133
|
-
const { sendMessageDiscord } = await import("./send-
|
|
19133
|
+
const { sendMessageDiscord } = await import("./send-CUYy-rA3.js").then((n) => n.t);
|
|
19134
19134
|
return await sendMessageDiscord(...args);
|
|
19135
19135
|
},
|
|
19136
19136
|
sendMessageSlack: async (...args) => {
|
|
19137
|
-
const { sendMessageSlack } = await import("./send-
|
|
19137
|
+
const { sendMessageSlack } = await import("./send-CABrQiXU.js").then((n) => n.n);
|
|
19138
19138
|
return await sendMessageSlack(...args);
|
|
19139
19139
|
},
|
|
19140
19140
|
sendMessageSignal: async (...args) => {
|
|
19141
|
-
const { sendMessageSignal } = await import("./send-
|
|
19141
|
+
const { sendMessageSignal } = await import("./send-iIy3frXq.js").then((n) => n.i);
|
|
19142
19142
|
return await sendMessageSignal(...args);
|
|
19143
19143
|
},
|
|
19144
19144
|
sendMessageIMessage: async (...args) => {
|
|
19145
|
-
const { sendMessageIMessage } = await import("./send-
|
|
19145
|
+
const { sendMessageIMessage } = await import("./send-DE1no-h6.js").then((n) => n.n);
|
|
19146
19146
|
return await sendMessageIMessage(...args);
|
|
19147
19147
|
}
|
|
19148
19148
|
};
|
|
@@ -21293,7 +21293,7 @@ async function getMemorySearchManager(params) {
|
|
|
21293
21293
|
if (cached) return { manager: cached };
|
|
21294
21294
|
}
|
|
21295
21295
|
try {
|
|
21296
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
21296
|
+
const { QmdMemoryManager } = await import("./qmd-manager-B4jAaAzx.js");
|
|
21297
21297
|
const primary = await QmdMemoryManager.create({
|
|
21298
21298
|
cfg: params.cfg,
|
|
21299
21299
|
agentId: params.agentId,
|
|
@@ -21305,7 +21305,7 @@ async function getMemorySearchManager(params) {
|
|
|
21305
21305
|
const wrapper = new FallbackMemoryManager({
|
|
21306
21306
|
primary,
|
|
21307
21307
|
fallbackFactory: async () => {
|
|
21308
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
21308
|
+
const { MemoryIndexManager } = await import("./manager-Cxjfnksb.js").then((n) => n.t);
|
|
21309
21309
|
return await MemoryIndexManager.get(params);
|
|
21310
21310
|
}
|
|
21311
21311
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -21318,12 +21318,12 @@ async function getMemorySearchManager(params) {
|
|
|
21318
21318
|
}
|
|
21319
21319
|
}
|
|
21320
21320
|
try {
|
|
21321
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
21321
|
+
const { MemoryIndexManager } = await import("./manager-Cxjfnksb.js").then((n) => n.t);
|
|
21322
21322
|
return { manager: await MemoryIndexManager.get(params) };
|
|
21323
21323
|
} catch (err) {
|
|
21324
21324
|
const message = err instanceof Error ? err.message : String(err);
|
|
21325
21325
|
if (isNodeSqliteUnavailable(message)) {
|
|
21326
|
-
const { FilesystemMemorySearchManager } = await import("./filesystem-manager-
|
|
21326
|
+
const { FilesystemMemorySearchManager } = await import("./filesystem-manager-DKU5F0fA.js");
|
|
21327
21327
|
const manager = await FilesystemMemorySearchManager.create({
|
|
21328
21328
|
cfg: params.cfg,
|
|
21329
21329
|
agentId: params.agentId,
|
|
@@ -26996,7 +26996,7 @@ function normalizeSessionKey(value) {
|
|
|
26996
26996
|
}
|
|
26997
26997
|
function readSessionStore(storePath) {
|
|
26998
26998
|
try {
|
|
26999
|
-
const raw =
|
|
26999
|
+
const raw = syncFs.readFileSync(storePath, "utf-8");
|
|
27000
27000
|
const parsed = JSON5.parse(raw);
|
|
27001
27001
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
27002
27002
|
} catch {}
|
|
@@ -41230,7 +41230,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
41230
41230
|
}
|
|
41231
41231
|
function ensureDir$1(filePath) {
|
|
41232
41232
|
const dir = path.dirname(filePath);
|
|
41233
|
-
|
|
41233
|
+
syncFs.mkdirSync(dir, { recursive: true });
|
|
41234
41234
|
}
|
|
41235
41235
|
function coerceAllowlistEntries(allowlist) {
|
|
41236
41236
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -41300,11 +41300,11 @@ function generateToken() {
|
|
|
41300
41300
|
function loadExecApprovals() {
|
|
41301
41301
|
const filePath = resolveExecApprovalsPath();
|
|
41302
41302
|
try {
|
|
41303
|
-
if (!
|
|
41303
|
+
if (!syncFs.existsSync(filePath)) return normalizeExecApprovals({
|
|
41304
41304
|
version: 1,
|
|
41305
41305
|
agents: {}
|
|
41306
41306
|
});
|
|
41307
|
-
const raw =
|
|
41307
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
41308
41308
|
const parsed = JSON.parse(raw);
|
|
41309
41309
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
41310
41310
|
version: 1,
|
|
@@ -41321,9 +41321,9 @@ function loadExecApprovals() {
|
|
|
41321
41321
|
function saveExecApprovals(file) {
|
|
41322
41322
|
const filePath = resolveExecApprovalsPath();
|
|
41323
41323
|
ensureDir$1(filePath);
|
|
41324
|
-
|
|
41324
|
+
syncFs.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
41325
41325
|
try {
|
|
41326
|
-
|
|
41326
|
+
syncFs.chmodSync(filePath, 384);
|
|
41327
41327
|
} catch {}
|
|
41328
41328
|
}
|
|
41329
41329
|
function ensureExecApprovals() {
|
|
@@ -41912,18 +41912,18 @@ function drainSystemEventEntries(sessionKey) {
|
|
|
41912
41912
|
function resolvePowerShellPath() {
|
|
41913
41913
|
const programFiles = process.env.ProgramFiles || process.env.PROGRAMFILES || "C:\\Program Files";
|
|
41914
41914
|
const pwsh7 = path.join(programFiles, "PowerShell", "7", "pwsh.exe");
|
|
41915
|
-
if (
|
|
41915
|
+
if (syncFs.existsSync(pwsh7)) return pwsh7;
|
|
41916
41916
|
const programW6432 = process.env.ProgramW6432;
|
|
41917
41917
|
if (programW6432 && programW6432 !== programFiles) {
|
|
41918
41918
|
const pwsh7Alt = path.join(programW6432, "PowerShell", "7", "pwsh.exe");
|
|
41919
|
-
if (
|
|
41919
|
+
if (syncFs.existsSync(pwsh7Alt)) return pwsh7Alt;
|
|
41920
41920
|
}
|
|
41921
41921
|
const pwshInPath = resolveShellFromPath("pwsh");
|
|
41922
41922
|
if (pwshInPath) return pwshInPath;
|
|
41923
41923
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
41924
41924
|
if (systemRoot) {
|
|
41925
41925
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
41926
|
-
if (
|
|
41926
|
+
if (syncFs.existsSync(candidate)) return candidate;
|
|
41927
41927
|
}
|
|
41928
41928
|
return "powershell.exe";
|
|
41929
41929
|
}
|
|
@@ -41961,7 +41961,7 @@ function resolveShellFromPath(name) {
|
|
|
41961
41961
|
for (const entry of entries) {
|
|
41962
41962
|
const candidate = path.join(entry, name);
|
|
41963
41963
|
try {
|
|
41964
|
-
|
|
41964
|
+
syncFs.accessSync(candidate, syncFs.constants.X_OK);
|
|
41965
41965
|
return candidate;
|
|
41966
41966
|
} catch {}
|
|
41967
41967
|
}
|
|
@@ -43420,9 +43420,9 @@ function loadExternalCatalogEntries(options) {
|
|
|
43420
43420
|
function loadCatalogEntriesFromPaths(paths) {
|
|
43421
43421
|
const entries = [];
|
|
43422
43422
|
for (const resolved of paths) {
|
|
43423
|
-
if (!
|
|
43423
|
+
if (!syncFs.existsSync(resolved)) continue;
|
|
43424
43424
|
try {
|
|
43425
|
-
const payload = JSON.parse(
|
|
43425
|
+
const payload = JSON.parse(syncFs.readFileSync(resolved, "utf-8"));
|
|
43426
43426
|
entries.push(...parseCatalogEntries(payload));
|
|
43427
43427
|
} catch {}
|
|
43428
43428
|
}
|
|
@@ -46483,17 +46483,17 @@ const readUsageFromSessionLog = (sessionId, sessionEntry, agentId, sessionKey, s
|
|
|
46483
46483
|
} catch {
|
|
46484
46484
|
return;
|
|
46485
46485
|
}
|
|
46486
|
-
if (!
|
|
46486
|
+
if (!syncFs.existsSync(logPath)) return;
|
|
46487
46487
|
try {
|
|
46488
46488
|
const TAIL_BYTES = 8192;
|
|
46489
|
-
const stat =
|
|
46489
|
+
const stat = syncFs.statSync(logPath);
|
|
46490
46490
|
const offset = Math.max(0, stat.size - TAIL_BYTES);
|
|
46491
46491
|
const buf = Buffer.alloc(Math.min(TAIL_BYTES, stat.size));
|
|
46492
|
-
const fd =
|
|
46492
|
+
const fd = syncFs.openSync(logPath, "r");
|
|
46493
46493
|
try {
|
|
46494
|
-
|
|
46494
|
+
syncFs.readSync(fd, buf, 0, buf.length, offset);
|
|
46495
46495
|
} finally {
|
|
46496
|
-
|
|
46496
|
+
syncFs.closeSync(fd);
|
|
46497
46497
|
}
|
|
46498
46498
|
const tail = buf.toString("utf-8");
|
|
46499
46499
|
const lines = (offset > 0 ? tail.slice(tail.indexOf("\n") + 1) : tail).split(/\n+/);
|
|
@@ -52931,9 +52931,9 @@ function resolvePatchFileOps(options) {
|
|
|
52931
52931
|
});
|
|
52932
52932
|
assertBoundaryRead(opened, filePath);
|
|
52933
52933
|
try {
|
|
52934
|
-
return
|
|
52934
|
+
return syncFs.readFileSync(opened.fd, "utf8");
|
|
52935
52935
|
} finally {
|
|
52936
|
-
|
|
52936
|
+
syncFs.closeSync(opened.fd);
|
|
52937
52937
|
}
|
|
52938
52938
|
},
|
|
52939
52939
|
writeFile: async (filePath, content) => {
|
|
@@ -53590,7 +53590,7 @@ function isModuleNotFoundError(err) {
|
|
|
53590
53590
|
}
|
|
53591
53591
|
async function loadPwAiModule(mode) {
|
|
53592
53592
|
try {
|
|
53593
|
-
return await import("./pw-ai-
|
|
53593
|
+
return await import("./pw-ai-CmgZwdpF.js");
|
|
53594
53594
|
} catch (err) {
|
|
53595
53595
|
if (mode === "soft") return null;
|
|
53596
53596
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -53681,11 +53681,11 @@ async function movePathToTrash(targetPath) {
|
|
|
53681
53681
|
return targetPath;
|
|
53682
53682
|
} catch {
|
|
53683
53683
|
const trashDir = path.join(os.homedir(), ".Trash");
|
|
53684
|
-
|
|
53684
|
+
syncFs.mkdirSync(trashDir, { recursive: true });
|
|
53685
53685
|
const base = path.basename(targetPath);
|
|
53686
53686
|
let dest = path.join(trashDir, `${base}-${Date.now()}`);
|
|
53687
|
-
if (
|
|
53688
|
-
|
|
53687
|
+
if (syncFs.existsSync(dest)) dest = path.join(trashDir, `${base}-${Date.now()}-${generateSecureToken(6)}`);
|
|
53688
|
+
syncFs.renameSync(targetPath, dest);
|
|
53689
53689
|
return dest;
|
|
53690
53690
|
}
|
|
53691
53691
|
}
|
|
@@ -53984,13 +53984,13 @@ function createProfileContext(opts, profile) {
|
|
|
53984
53984
|
const userDataDir = resolveFasedAgentUserDataDir(profile.name);
|
|
53985
53985
|
const profileState = getProfileState();
|
|
53986
53986
|
if (await isHttpReachable(300) && !profileState.running) try {
|
|
53987
|
-
await (await import("./pw-ai-
|
|
53987
|
+
await (await import("./pw-ai-CmgZwdpF.js")).closePlaywrightBrowserConnection();
|
|
53988
53988
|
} catch {}
|
|
53989
53989
|
if (profileState.running) await stopRunningBrowser();
|
|
53990
53990
|
try {
|
|
53991
|
-
await (await import("./pw-ai-
|
|
53991
|
+
await (await import("./pw-ai-CmgZwdpF.js")).closePlaywrightBrowserConnection();
|
|
53992
53992
|
} catch {}
|
|
53993
|
-
if (!
|
|
53993
|
+
if (!syncFs.existsSync(userDataDir)) return {
|
|
53994
53994
|
moved: false,
|
|
53995
53995
|
from: userDataDir
|
|
53996
53996
|
};
|
|
@@ -55695,7 +55695,7 @@ function createBrowserProfilesService(ctx) {
|
|
|
55695
55695
|
} catch {}
|
|
55696
55696
|
const userDataDir = resolveFasedAgentUserDataDir(name);
|
|
55697
55697
|
const profileDir = path.dirname(userDataDir);
|
|
55698
|
-
if (
|
|
55698
|
+
if (syncFs.existsSync(profileDir)) {
|
|
55699
55699
|
await movePathToTrash(profileDir);
|
|
55700
55700
|
deleted = true;
|
|
55701
55701
|
}
|
|
@@ -57344,7 +57344,7 @@ function asBoolean(value) {
|
|
|
57344
57344
|
}
|
|
57345
57345
|
function resolveTempPathParts(opts) {
|
|
57346
57346
|
const tmpDir = opts.tmpDir ?? resolvePreferredFasedAgentTmpDir();
|
|
57347
|
-
if (!opts.tmpDir)
|
|
57347
|
+
if (!opts.tmpDir) syncFs.mkdirSync(tmpDir, {
|
|
57348
57348
|
recursive: true,
|
|
57349
57349
|
mode: 448
|
|
57350
57350
|
});
|
|
@@ -57410,7 +57410,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
57410
57410
|
if (typeof contentLength === "number" && Number.isFinite(contentLength) && contentLength > MAX_CAMERA_URL_DOWNLOAD_BYTES) throw new Error(`writeUrlToFile: content-length ${contentLength} exceeds max ${MAX_CAMERA_URL_DOWNLOAD_BYTES}`);
|
|
57411
57411
|
const body = res.body;
|
|
57412
57412
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
57413
|
-
const fileHandle = await fs$
|
|
57413
|
+
const fileHandle = await fs$1.open(filePath, "w");
|
|
57414
57414
|
let bytes = 0;
|
|
57415
57415
|
let thrown;
|
|
57416
57416
|
try {
|
|
@@ -57429,7 +57429,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
57429
57429
|
await fileHandle.close();
|
|
57430
57430
|
}
|
|
57431
57431
|
if (thrown) {
|
|
57432
|
-
await fs$
|
|
57432
|
+
await fs$1.unlink(filePath).catch(() => {});
|
|
57433
57433
|
throw thrown;
|
|
57434
57434
|
}
|
|
57435
57435
|
return {
|
|
@@ -57439,7 +57439,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
57439
57439
|
}
|
|
57440
57440
|
async function writeBase64ToFile(filePath, base64) {
|
|
57441
57441
|
const buf = Buffer.from(base64, "base64");
|
|
57442
|
-
await fs$
|
|
57442
|
+
await fs$1.writeFile(filePath, buf);
|
|
57443
57443
|
return {
|
|
57444
57444
|
path: filePath,
|
|
57445
57445
|
bytes: buf.length
|
|
@@ -63439,8 +63439,8 @@ function resolveZaiApiKey() {
|
|
|
63439
63439
|
}
|
|
63440
63440
|
try {
|
|
63441
63441
|
const authPath = path.join(resolveRequiredHomeDir(process.env, os.homedir), ".pi", "agent", "auth.json");
|
|
63442
|
-
if (!
|
|
63443
|
-
const data = JSON.parse(
|
|
63442
|
+
if (!syncFs.existsSync(authPath)) return;
|
|
63443
|
+
const data = JSON.parse(syncFs.readFileSync(authPath, "utf-8"));
|
|
63444
63444
|
return data["z-ai"]?.access || data.zai?.access;
|
|
63445
63445
|
} catch {
|
|
63446
63446
|
return;
|
|
@@ -70039,7 +70039,7 @@ async function recordLoopOutcome(args) {
|
|
|
70039
70039
|
if (!args.ctx?.sessionKey) return;
|
|
70040
70040
|
try {
|
|
70041
70041
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-CexmAKza.js").then((n) => n.n);
|
|
70042
|
-
const { recordToolCallOutcome } = await import("./tool-loop-detection-
|
|
70042
|
+
const { recordToolCallOutcome } = await import("./tool-loop-detection-D4MYRJWP.js");
|
|
70043
70043
|
recordToolCallOutcome(getDiagnosticSessionState({
|
|
70044
70044
|
sessionKey: args.ctx.sessionKey,
|
|
70045
70045
|
sessionId: args.ctx?.agentId
|
|
@@ -70060,8 +70060,8 @@ async function runBeforeToolCallHook(args) {
|
|
|
70060
70060
|
const params = args.params;
|
|
70061
70061
|
if (args.ctx?.sessionKey) {
|
|
70062
70062
|
const { getDiagnosticSessionState } = await import("./diagnostic-session-state-CexmAKza.js").then((n) => n.n);
|
|
70063
|
-
const { logToolLoopAction } = await import("./diagnostic-
|
|
70064
|
-
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-
|
|
70063
|
+
const { logToolLoopAction } = await import("./diagnostic-B4NKiC20.js").then((n) => n.n);
|
|
70064
|
+
const { detectToolCallLoop, recordToolCall } = await import("./tool-loop-detection-D4MYRJWP.js");
|
|
70065
70065
|
const sessionState = getDiagnosticSessionState({
|
|
70066
70066
|
sessionKey: args.ctx.sessionKey,
|
|
70067
70067
|
sessionId: args.ctx?.agentId
|
|
@@ -71853,7 +71853,7 @@ function resolveRepoRoot(params) {
|
|
|
71853
71853
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
71854
71854
|
if (configured) try {
|
|
71855
71855
|
const resolved = path.resolve(configured);
|
|
71856
|
-
if (
|
|
71856
|
+
if (syncFs.statSync(resolved).isDirectory()) return resolved;
|
|
71857
71857
|
} catch {}
|
|
71858
71858
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
71859
71859
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -72711,7 +72711,7 @@ async function buildContextReply(params) {
|
|
|
72711
72711
|
//#region src/auto-reply/reply/commands-export-session.ts
|
|
72712
72712
|
const EXPORT_HTML_DIR = path.join(path.dirname(fileURLToPath(import.meta.url)), "export-html");
|
|
72713
72713
|
function loadTemplate(fileName) {
|
|
72714
|
-
return
|
|
72714
|
+
return syncFs.readFileSync(path.join(EXPORT_HTML_DIR, fileName), "utf-8");
|
|
72715
72715
|
}
|
|
72716
72716
|
function generateHtml(sessionData) {
|
|
72717
72717
|
const template = loadTemplate("template.html");
|
|
@@ -72782,7 +72782,7 @@ function writeNewDefaultExportFile(filePath, html) {
|
|
|
72782
72782
|
for (let suffix = 1; suffix <= 100; suffix++) {
|
|
72783
72783
|
const candidate = suffix === 1 ? filePath : addCollisionSuffix(filePath, suffix);
|
|
72784
72784
|
try {
|
|
72785
|
-
|
|
72785
|
+
syncFs.writeFileSync(candidate, html, {
|
|
72786
72786
|
encoding: "utf-8",
|
|
72787
72787
|
flag: "wx"
|
|
72788
72788
|
});
|
|
@@ -72809,7 +72809,7 @@ async function buildExportSessionReply(params) {
|
|
|
72809
72809
|
} catch (err) {
|
|
72810
72810
|
return { text: `❌ Failed to resolve session file: ${err instanceof Error ? err.message : String(err)}` };
|
|
72811
72811
|
}
|
|
72812
|
-
if (!
|
|
72812
|
+
if (!syncFs.existsSync(sessionFile)) return { text: `❌ Session file not found: ${sessionFile}` };
|
|
72813
72813
|
const sessionManager = SessionManager.open(sessionFile);
|
|
72814
72814
|
const entries = sessionManager.getEntries();
|
|
72815
72815
|
const header = sessionManager.getHeader();
|
|
@@ -72830,8 +72830,8 @@ async function buildExportSessionReply(params) {
|
|
|
72830
72830
|
const defaultFileName = `fased-session-${entry.sessionId.slice(0, 8)}-${timestamp}.html`;
|
|
72831
72831
|
let outputPath = args.outputPath ? path.resolve(args.outputPath.startsWith("~") ? args.outputPath.replace("~", process.env.HOME ?? "") : args.outputPath) : path.join(params.workspaceDir, defaultFileName);
|
|
72832
72832
|
const outputDir = path.dirname(outputPath);
|
|
72833
|
-
if (!
|
|
72834
|
-
if (args.outputPath)
|
|
72833
|
+
if (!syncFs.existsSync(outputDir)) syncFs.mkdirSync(outputDir, { recursive: true });
|
|
72834
|
+
if (args.outputPath) syncFs.writeFileSync(outputPath, html, "utf-8");
|
|
72835
72835
|
else outputPath = writeNewDefaultExportFile(outputPath, html);
|
|
72836
72836
|
const relativePath = path.relative(params.workspaceDir, outputPath);
|
|
72837
72837
|
return { text: [
|
|
@@ -73825,7 +73825,7 @@ function shouldPersistAnyBindingState() {
|
|
|
73825
73825
|
}
|
|
73826
73826
|
function shouldPersistBindingMutations() {
|
|
73827
73827
|
if (shouldPersistAnyBindingState()) return true;
|
|
73828
|
-
return
|
|
73828
|
+
return syncFs.existsSync(resolveThreadBindingsPath());
|
|
73829
73829
|
}
|
|
73830
73830
|
function saveBindingsToDisk(params = {}) {
|
|
73831
73831
|
if (!params.force && !shouldPersistAnyBindingState()) return;
|
|
@@ -74694,7 +74694,7 @@ const applyCostTotal = (totals, costTotal) => {
|
|
|
74694
74694
|
totals.totalCost += costTotal;
|
|
74695
74695
|
};
|
|
74696
74696
|
async function* readJsonlRecords(filePath) {
|
|
74697
|
-
const fileStream =
|
|
74697
|
+
const fileStream = syncFs.createReadStream(filePath, { encoding: "utf-8" });
|
|
74698
74698
|
const rl = readline.createInterface({
|
|
74699
74699
|
input: fileStream,
|
|
74700
74700
|
crlfDelay: Infinity
|
|
@@ -74766,10 +74766,10 @@ async function loadCostUsageSummary(params) {
|
|
|
74766
74766
|
const dailyMap = /* @__PURE__ */ new Map();
|
|
74767
74767
|
const totals = emptyTotals();
|
|
74768
74768
|
const sessionsDir = resolveSessionTranscriptsDirForAgent(params?.agentId);
|
|
74769
|
-
const entries = await
|
|
74769
|
+
const entries = await syncFs.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
|
|
74770
74770
|
const files = (await Promise.all(entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map(async (entry) => {
|
|
74771
74771
|
const filePath = path.join(sessionsDir, entry.name);
|
|
74772
|
-
const stats = await
|
|
74772
|
+
const stats = await syncFs.promises.stat(filePath).catch(() => null);
|
|
74773
74773
|
if (!stats) return null;
|
|
74774
74774
|
if (stats.mtimeMs < sinceTime) return null;
|
|
74775
74775
|
return filePath;
|
|
@@ -74802,7 +74802,7 @@ async function loadCostUsageSummary(params) {
|
|
|
74802
74802
|
}
|
|
74803
74803
|
async function loadSessionCostSummary(params) {
|
|
74804
74804
|
const sessionFile = params.sessionFile ?? (params.sessionId ? resolveSessionFilePath(params.sessionId, params.sessionEntry, { agentId: params.agentId }) : void 0);
|
|
74805
|
-
if (!sessionFile || !
|
|
74805
|
+
if (!sessionFile || !syncFs.existsSync(sessionFile)) return null;
|
|
74806
74806
|
const totals = emptyTotals();
|
|
74807
74807
|
let firstActivity;
|
|
74808
74808
|
let lastActivity;
|
|
@@ -76574,7 +76574,7 @@ async function createModelSelectionState(params) {
|
|
|
76574
76574
|
}
|
|
76575
76575
|
}
|
|
76576
76576
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
76577
|
-
const { ensureAuthProfileStore } = await import("./agent-scope-
|
|
76577
|
+
const { ensureAuthProfileStore } = await import("./agent-scope-DwKyukUg.js").then((n) => n.Nr);
|
|
76578
76578
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
76579
76579
|
const providerKey = normalizeProviderId$1(provider);
|
|
76580
76580
|
if (!profile || normalizeProviderId$1(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -79412,7 +79412,7 @@ async function resolveFasedAgentDocsPath(params) {
|
|
|
79412
79412
|
const workspaceDir = params.workspaceDir?.trim();
|
|
79413
79413
|
if (workspaceDir) {
|
|
79414
79414
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
79415
|
-
if (
|
|
79415
|
+
if (syncFs.existsSync(workspaceDocs)) return workspaceDocs;
|
|
79416
79416
|
}
|
|
79417
79417
|
const packageRoot = await resolveFasedAgentPackageRoot({
|
|
79418
79418
|
cwd: params.cwd,
|
|
@@ -79421,7 +79421,7 @@ async function resolveFasedAgentDocsPath(params) {
|
|
|
79421
79421
|
});
|
|
79422
79422
|
if (!packageRoot) return null;
|
|
79423
79423
|
const packageDocs = path.join(packageRoot, "docs");
|
|
79424
|
-
return
|
|
79424
|
+
return syncFs.existsSync(packageDocs) ? packageDocs : null;
|
|
79425
79425
|
}
|
|
79426
79426
|
|
|
79427
79427
|
//#endregion
|
|
@@ -80608,7 +80608,7 @@ async function runAgentTurnWithFallback(params) {
|
|
|
80608
80608
|
if (corruptedSessionId) {
|
|
80609
80609
|
const transcriptPath = resolveSessionTranscriptPath(corruptedSessionId);
|
|
80610
80610
|
try {
|
|
80611
|
-
|
|
80611
|
+
syncFs.unlinkSync(transcriptPath);
|
|
80612
80612
|
} catch {}
|
|
80613
80613
|
}
|
|
80614
80614
|
delete params.activeSessionStore[sessionKey];
|
|
@@ -81386,9 +81386,9 @@ function auditPostCompactionReads(readFilePaths, workspaceDir, requiredReads = D
|
|
|
81386
81386
|
* Returns messages from the last N lines (default 100).
|
|
81387
81387
|
*/
|
|
81388
81388
|
function readSessionMessages(sessionFile, maxLines = 100) {
|
|
81389
|
-
if (!
|
|
81389
|
+
if (!syncFs.existsSync(sessionFile)) return [];
|
|
81390
81390
|
try {
|
|
81391
|
-
const recentLines =
|
|
81391
|
+
const recentLines = syncFs.readFileSync(sessionFile, "utf-8").trim().split("\n").slice(-maxLines);
|
|
81392
81392
|
const messages = [];
|
|
81393
81393
|
for (const line of recentLines) try {
|
|
81394
81394
|
const entry = JSON.parse(line);
|
|
@@ -81429,8 +81429,8 @@ const MAX_CONTEXT_CHARS = 3e3;
|
|
|
81429
81429
|
async function readPostCompactionContext(workspaceDir) {
|
|
81430
81430
|
const agentsPath = path.join(workspaceDir, "AGENTS.md");
|
|
81431
81431
|
try {
|
|
81432
|
-
if (!
|
|
81433
|
-
const sections = extractSections(await
|
|
81432
|
+
if (!syncFs.existsSync(agentsPath)) return null;
|
|
81433
|
+
const sections = extractSections(await syncFs.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
|
|
81434
81434
|
if (sections.length === 0) return null;
|
|
81435
81435
|
const combined = sections.join("\n\n");
|
|
81436
81436
|
return "[Post-compaction context refresh]\n\nSession was just compacted. The conversation summary above is a hint, NOT a substitute for your startup sequence. Execute your Session Startup sequence now — read the required files before responding to the user.\n\nCritical rules from AGENTS.md:\n\n" + (combined.length > MAX_CONTEXT_CHARS ? combined.slice(0, MAX_CONTEXT_CHARS) + "\n...[truncated]..." : combined);
|
|
@@ -81736,7 +81736,7 @@ async function runReplyAgent(params) {
|
|
|
81736
81736
|
if (resolved) transcriptCandidates.add(resolved);
|
|
81737
81737
|
transcriptCandidates.add(resolveSessionTranscriptPath(prevSessionId, agentId));
|
|
81738
81738
|
for (const candidate of transcriptCandidates) try {
|
|
81739
|
-
|
|
81739
|
+
syncFs.unlinkSync(candidate);
|
|
81740
81740
|
} catch {}
|
|
81741
81741
|
}
|
|
81742
81742
|
return true;
|
|
@@ -82819,7 +82819,7 @@ function forkSessionFromParent(params) {
|
|
|
82819
82819
|
agentId: params.agentId,
|
|
82820
82820
|
sessionsDir: params.sessionsDir
|
|
82821
82821
|
});
|
|
82822
|
-
if (!parentSessionFile || !
|
|
82822
|
+
if (!parentSessionFile || !syncFs.existsSync(parentSessionFile)) return null;
|
|
82823
82823
|
try {
|
|
82824
82824
|
const manager = SessionManager.open(parentSessionFile);
|
|
82825
82825
|
const leafId = manager.getLeafId();
|
|
@@ -82843,7 +82843,7 @@ function forkSessionFromParent(params) {
|
|
|
82843
82843
|
cwd: manager.getCwd(),
|
|
82844
82844
|
parentSession: parentSessionFile
|
|
82845
82845
|
};
|
|
82846
|
-
|
|
82846
|
+
syncFs.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
|
|
82847
82847
|
return {
|
|
82848
82848
|
sessionId,
|
|
82849
82849
|
sessionFile
|
|
@@ -87901,7 +87901,7 @@ function createWhatsAppLoginTool() {
|
|
|
87901
87901
|
force: Type.Optional(Type.Boolean())
|
|
87902
87902
|
}),
|
|
87903
87903
|
execute: async (_toolCallId, args) => {
|
|
87904
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
87904
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-gY230e9k.js");
|
|
87905
87905
|
if ((args?.action ?? "start") === "wait") {
|
|
87906
87906
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
87907
87907
|
return {
|
|
@@ -88963,7 +88963,7 @@ function kindFromStats(stat) {
|
|
|
88963
88963
|
async function backupTarget(entry) {
|
|
88964
88964
|
const beforeState = await inspectPath(entry.targetPath);
|
|
88965
88965
|
if (beforeState.kind === "file") {
|
|
88966
|
-
await fs.copyFile(entry.targetPath, entry.snapshotPath,
|
|
88966
|
+
await fs.copyFile(entry.targetPath, entry.snapshotPath, syncFs.constants.COPYFILE_EXCL);
|
|
88967
88967
|
return {
|
|
88968
88968
|
proposalId: entry.proposalId,
|
|
88969
88969
|
action: entry.action,
|
|
@@ -89374,7 +89374,7 @@ async function withMemoryManagerForAgent(params) {
|
|
|
89374
89374
|
}
|
|
89375
89375
|
async function checkReadableFile(pathname) {
|
|
89376
89376
|
try {
|
|
89377
|
-
await fs.access(pathname,
|
|
89377
|
+
await fs.access(pathname, syncFs.constants.R_OK);
|
|
89378
89378
|
return { exists: true };
|
|
89379
89379
|
} catch (err) {
|
|
89380
89380
|
const code = err.code;
|
|
@@ -89433,7 +89433,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
89433
89433
|
}
|
|
89434
89434
|
let dirReadable = null;
|
|
89435
89435
|
try {
|
|
89436
|
-
await fs.access(memoryDir,
|
|
89436
|
+
await fs.access(memoryDir, syncFs.constants.R_OK);
|
|
89437
89437
|
dirReadable = true;
|
|
89438
89438
|
} catch (err) {
|
|
89439
89439
|
const code = err.code;
|
|
@@ -91758,7 +91758,7 @@ async function preflightDiscordMessage(params) {
|
|
|
91758
91758
|
let preflightTranscript;
|
|
91759
91759
|
const hasAudioAttachment = message.attachments?.some((att) => att.contentType?.startsWith("audio/"));
|
|
91760
91760
|
if (!isDirectMessage && shouldRequireMention && hasAudioAttachment && !baseText && mentionRegexes.length > 0) try {
|
|
91761
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
91761
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-CiHBO6op.js");
|
|
91762
91762
|
const audioPaths = message.attachments?.filter((att) => att.contentType?.startsWith("audio/")).map((att) => att.url) ?? [];
|
|
91763
91763
|
if (audioPaths.length > 0) preflightTranscript = await transcribeFirstAudio({
|
|
91764
91764
|
ctx: {
|
|
@@ -97848,7 +97848,7 @@ function createDiscordGatewayPlugin(params) {
|
|
|
97848
97848
|
return super.registerClient(client);
|
|
97849
97849
|
}
|
|
97850
97850
|
createWebSocket(url) {
|
|
97851
|
-
return new WebSocket(url, { agent: wsAgent });
|
|
97851
|
+
return new WebSocket$1(url, { agent: wsAgent });
|
|
97852
97852
|
}
|
|
97853
97853
|
}
|
|
97854
97854
|
return new ProxyGatewayPlugin();
|
|
@@ -99055,7 +99055,7 @@ async function waitForTransportReady(params) {
|
|
|
99055
99055
|
|
|
99056
99056
|
//#endregion
|
|
99057
99057
|
//#region src/brand.ts
|
|
99058
|
-
const FASED_PRODUCT_VERSION = "0.1.
|
|
99058
|
+
const FASED_PRODUCT_VERSION = "0.1.23";
|
|
99059
99059
|
const FASED_DISPLAY_VERSION = `v${FASED_PRODUCT_VERSION}`;
|
|
99060
99060
|
|
|
99061
99061
|
//#endregion
|
|
@@ -100021,7 +100021,7 @@ async function monitorIMessageProvider(opts = {}) {
|
|
|
100021
100021
|
function readFileIfExists(filePath) {
|
|
100022
100022
|
if (!filePath) return;
|
|
100023
100023
|
try {
|
|
100024
|
-
return
|
|
100024
|
+
return syncFs.readFileSync(filePath, "utf-8").trim();
|
|
100025
100025
|
} catch {
|
|
100026
100026
|
return;
|
|
100027
100027
|
}
|
|
@@ -100613,7 +100613,7 @@ async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 *
|
|
|
100613
100613
|
prefix: "line-media",
|
|
100614
100614
|
extension: getExtensionForContentType(contentType)
|
|
100615
100615
|
});
|
|
100616
|
-
await
|
|
100616
|
+
await syncFs.promises.writeFile(filePath, buffer);
|
|
100617
100617
|
logVerbose(`line: downloaded media ${formatLineIdForLog(messageId)} to ${filePath} (${buffer.length} bytes)`);
|
|
100618
100618
|
return {
|
|
100619
100619
|
path: filePath,
|
|
@@ -105757,7 +105757,7 @@ function readSlackExternalArgMenuToken(raw) {
|
|
|
105757
105757
|
}
|
|
105758
105758
|
let commandsRegistry;
|
|
105759
105759
|
async function getCommandsRegistry() {
|
|
105760
|
-
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-
|
|
105760
|
+
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-ShBrc7Zz.js").then((n) => n.n);
|
|
105761
105761
|
return commandsRegistry;
|
|
105762
105762
|
}
|
|
105763
105763
|
function encodeSlackCommandArgValue(parts) {
|
|
@@ -106081,14 +106081,14 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
106081
106081
|
const channelName = channelInfo?.name;
|
|
106082
106082
|
const roomLabel = channelName ? `#${channelName}` : `#${command.channel_id}`;
|
|
106083
106083
|
const [{ resolveAgentRoute }, { finalizeInboundContext }, { dispatchReplyWithDispatcher }] = await Promise.all([
|
|
106084
|
-
import("./resolve-route-
|
|
106084
|
+
import("./resolve-route-DZkIcri6.js").then((n) => n.r),
|
|
106085
106085
|
import("./inbound-context-B0OuvpCZ.js").then((n) => n.n),
|
|
106086
106086
|
Promise.resolve().then(() => provider_dispatcher_exports)
|
|
106087
106087
|
]);
|
|
106088
106088
|
const [{ resolveConversationLabel }, { createReplyPrefixOptions }, { recordSessionMetaFromInbound, resolveStorePath }] = await Promise.all([
|
|
106089
106089
|
import("./conversation-label-BNq0hhpR.js").then((n) => n.t),
|
|
106090
|
-
import("./reply-prefix-
|
|
106091
|
-
import("./agent-scope-
|
|
106090
|
+
import("./reply-prefix-CG0zciBg.js").then((n) => n.n),
|
|
106091
|
+
import("./agent-scope-DwKyukUg.js").then((n) => n.W)
|
|
106092
106092
|
]);
|
|
106093
106093
|
const route = resolveAgentRoute({
|
|
106094
106094
|
cfg,
|
|
@@ -106156,9 +106156,9 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
106156
106156
|
});
|
|
106157
106157
|
const deliverSlashPayloads = async (replies) => {
|
|
106158
106158
|
const [{ deliverSlackSlashReplies }, { resolveChunkMode }, { resolveMarkdownTableMode }] = await Promise.all([
|
|
106159
|
-
import("./replies-
|
|
106160
|
-
import("./chunk-
|
|
106161
|
-
import("./markdown-tables-
|
|
106159
|
+
import("./replies-afs2sQ1G.js").then((n) => n.r),
|
|
106160
|
+
import("./chunk-DfA5CGzI.js").then((n) => n.s),
|
|
106161
|
+
import("./markdown-tables-DFtTedxN.js").then((n) => n.t)
|
|
106162
106162
|
]);
|
|
106163
106163
|
await deliverSlackSlashReplies({
|
|
106164
106164
|
replies,
|
|
@@ -106211,7 +106211,7 @@ async function registerSlackMonitorSlashCommands(params) {
|
|
|
106211
106211
|
let nativeCommands = [];
|
|
106212
106212
|
if (nativeEnabled) {
|
|
106213
106213
|
reg = await getCommandsRegistry();
|
|
106214
|
-
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-
|
|
106214
|
+
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-CCjZMCdx.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
|
|
106215
106215
|
nativeCommands = reg.listNativeCommandSpecsForConfig(cfg, {
|
|
106216
106216
|
skillCommands,
|
|
106217
106217
|
provider: "slack"
|
|
@@ -108678,7 +108678,7 @@ const buildTelegramMessageContext = async ({ primaryCtx, allMedia, replyMedia =
|
|
|
108678
108678
|
const hasAudio = allMedia.some((media) => media.contentType?.startsWith("audio/"));
|
|
108679
108679
|
let preflightTranscript;
|
|
108680
108680
|
if (isGroup && requireMention && hasAudio && !hasUserText && mentionRegexes.length > 0) try {
|
|
108681
|
-
const { transcribeFirstAudio } = await import("./audio-preflight-
|
|
108681
|
+
const { transcribeFirstAudio } = await import("./audio-preflight-CiHBO6op.js");
|
|
108682
108682
|
preflightTranscript = await transcribeFirstAudio({
|
|
108683
108683
|
ctx: {
|
|
108684
108684
|
MediaPaths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
@@ -111292,23 +111292,23 @@ let webLoginQrPromise = null;
|
|
|
111292
111292
|
let webChannelPromise = null;
|
|
111293
111293
|
let whatsappActionsPromise = null;
|
|
111294
111294
|
function loadWebOutbound() {
|
|
111295
|
-
webOutboundPromise ??= import("./outbound-
|
|
111295
|
+
webOutboundPromise ??= import("./outbound-BtgGTj4E.js").then((n) => n.t);
|
|
111296
111296
|
return webOutboundPromise;
|
|
111297
111297
|
}
|
|
111298
111298
|
function loadWebLogin() {
|
|
111299
|
-
webLoginPromise ??= import("./login-
|
|
111299
|
+
webLoginPromise ??= import("./login-DmSOJJZh.js").then((n) => n.n);
|
|
111300
111300
|
return webLoginPromise;
|
|
111301
111301
|
}
|
|
111302
111302
|
function loadWebLoginQr() {
|
|
111303
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
111303
|
+
webLoginQrPromise ??= import("./login-qr-gY230e9k.js");
|
|
111304
111304
|
return webLoginQrPromise;
|
|
111305
111305
|
}
|
|
111306
111306
|
function loadWebChannel() {
|
|
111307
|
-
webChannelPromise ??= import("./web-
|
|
111307
|
+
webChannelPromise ??= import("./web-BIREWy8I.js");
|
|
111308
111308
|
return webChannelPromise;
|
|
111309
111309
|
}
|
|
111310
111310
|
function loadWhatsAppActions() {
|
|
111311
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
111311
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-C0w9GEJM.js");
|
|
111312
111312
|
return whatsappActionsPromise;
|
|
111313
111313
|
}
|
|
111314
111314
|
function createPluginRuntime(options = {}) {
|
|
@@ -111539,7 +111539,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
111539
111539
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
111540
111540
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
111541
111541
|
const orderedCandidates = isDistRuntime ? [distCandidate, srcCandidate] : isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
111542
|
-
for (const candidate of orderedCandidates) if (
|
|
111542
|
+
for (const candidate of orderedCandidates) if (syncFs.existsSync(candidate)) return candidate;
|
|
111543
111543
|
const parent = path.dirname(cursor);
|
|
111544
111544
|
if (parent === cursor) break;
|
|
111545
111545
|
cursor = parent;
|
|
@@ -111931,7 +111931,7 @@ function loadFasedAgentPlugins(options = {}) {
|
|
|
111931
111931
|
continue;
|
|
111932
111932
|
}
|
|
111933
111933
|
const safeSource = opened.path;
|
|
111934
|
-
|
|
111934
|
+
syncFs.closeSync(opened.fd);
|
|
111935
111935
|
let mod = null;
|
|
111936
111936
|
try {
|
|
111937
111937
|
mod = getJiti()(safeSource);
|
|
@@ -112068,7 +112068,7 @@ function loadFasedAgentPlugins(options = {}) {
|
|
|
112068
112068
|
}
|
|
112069
112069
|
function safeRealpathOrResolve(value) {
|
|
112070
112070
|
try {
|
|
112071
|
-
return
|
|
112071
|
+
return syncFs.realpathSync(value);
|
|
112072
112072
|
} catch {
|
|
112073
112073
|
return path.resolve(value);
|
|
112074
112074
|
}
|
|
@@ -113227,7 +113227,7 @@ const log$7 = createSubsystemLogger("model-catalog");
|
|
|
113227
113227
|
let modelCatalogPromise = null;
|
|
113228
113228
|
let hasLoggedModelCatalogError = false;
|
|
113229
113229
|
let hasLoggedProviderCatalogError = false;
|
|
113230
|
-
const defaultImportPiSdk = () => import("./pi-model-discovery-
|
|
113230
|
+
const defaultImportPiSdk = () => import("./pi-model-discovery-CfcnLOyX.js").then((n) => n.a);
|
|
113231
113231
|
let importPiSdk = defaultImportPiSdk;
|
|
113232
113232
|
const CODEX_PROVIDER = "openai-codex";
|
|
113233
113233
|
const OPENAI_PROVIDER = "openai";
|
|
@@ -116492,7 +116492,7 @@ var SandboxFsBridgeImpl = class {
|
|
|
116492
116492
|
});
|
|
116493
116493
|
if (!guarded.ok) {
|
|
116494
116494
|
if (guarded.reason !== "path" || options.allowMissingTarget === false) throw guarded.error instanceof Error ? guarded.error : /* @__PURE__ */ new Error(`Sandbox boundary checks failed; cannot ${options.action}: ${target.containerPath}`);
|
|
116495
|
-
} else
|
|
116495
|
+
} else syncFs.closeSync(guarded.fd);
|
|
116496
116496
|
const canonicalContainerPath = await this.resolveCanonicalContainerPath({
|
|
116497
116497
|
containerPath: target.containerPath,
|
|
116498
116498
|
allowFinalSymlinkForUnlink: options.aliasPolicy?.allowFinalSymlinkForUnlink === true
|
|
@@ -118031,7 +118031,7 @@ function buildEmbeddedPiSettingsSnapshot(params) {
|
|
|
118031
118031
|
}
|
|
118032
118032
|
function readJsonFile(filePath) {
|
|
118033
118033
|
try {
|
|
118034
|
-
const raw =
|
|
118034
|
+
const raw = syncFs.readFileSync(filePath, "utf8");
|
|
118035
118035
|
const parsed = JSON.parse(raw);
|
|
118036
118036
|
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
|
|
118037
118037
|
} catch {
|
|
@@ -118049,7 +118049,7 @@ function loadEnabledBundlePiSettingsSnapshot(params) {
|
|
|
118049
118049
|
const servers = mcp.mcpServers && typeof mcp.mcpServers === "object" && !Array.isArray(mcp.mcpServers) ? mcp.mcpServers : void 0;
|
|
118050
118050
|
if (servers) {
|
|
118051
118051
|
const resolvedServers = {};
|
|
118052
|
-
const resolvedRoot =
|
|
118052
|
+
const resolvedRoot = syncFs.realpathSync.native?.(pluginRoot) ?? syncFs.realpathSync(pluginRoot);
|
|
118053
118053
|
for (const [name, server] of Object.entries(servers)) {
|
|
118054
118054
|
if (!server || typeof server !== "object" || Array.isArray(server)) {
|
|
118055
118055
|
resolvedServers[name] = server;
|
|
@@ -119430,8 +119430,8 @@ async function readWorkspaceContextForSummary() {
|
|
|
119430
119430
|
const workspaceDir = process.cwd();
|
|
119431
119431
|
const agentsPath = path.join(workspaceDir, "AGENTS.md");
|
|
119432
119432
|
try {
|
|
119433
|
-
if (!
|
|
119434
|
-
const sections = extractSections(await
|
|
119433
|
+
if (!syncFs.existsSync(agentsPath)) return "";
|
|
119434
|
+
const sections = extractSections(await syncFs.promises.readFile(agentsPath, "utf-8"), ["Session Startup", "Red Lines"]);
|
|
119435
119435
|
if (sections.length === 0) return "";
|
|
119436
119436
|
const combined = sections.join("\n\n");
|
|
119437
119437
|
return `\n\n<workspace-critical-rules>\n${combined.length > MAX_SUMMARY_CONTEXT_CHARS ? combined.slice(0, MAX_SUMMARY_CONTEXT_CHARS) + "\n...[truncated]..." : combined}\n</workspace-critical-rules>`;
|
|
@@ -120807,7 +120807,7 @@ async function compactEmbeddedPiSessionDirect(params) {
|
|
|
120807
120807
|
});
|
|
120808
120808
|
if (!apiKeyInfo.apiKey) throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
120809
120809
|
else if (model.provider === "github-copilot") {
|
|
120810
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
120810
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-eyrRGmGp.js").then((n) => n.n);
|
|
120811
120811
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
120812
120812
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
120813
120813
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|
|
@@ -122151,8 +122151,8 @@ function readBundleMcpFile(params) {
|
|
|
122151
122151
|
const filePath = path.resolve(rootDir, params.fileName);
|
|
122152
122152
|
const relative = path.relative(rootDir, filePath);
|
|
122153
122153
|
if (relative.startsWith("..") || path.isAbsolute(relative)) return {};
|
|
122154
|
-
if (!
|
|
122155
|
-
const servers = extractMcpServerMap(JSON.parse(
|
|
122154
|
+
if (!syncFs.existsSync(filePath)) return {};
|
|
122155
|
+
const servers = extractMcpServerMap(JSON.parse(syncFs.readFileSync(filePath, "utf-8")));
|
|
122156
122156
|
const baseDir = path.dirname(filePath);
|
|
122157
122157
|
return Object.fromEntries(Object.entries(servers).map(([serverName, server]) => [serverName, absolutizeBundleMcpServer({
|
|
122158
122158
|
rootDir,
|
|
@@ -122179,7 +122179,7 @@ function loadEnabledBundleMcpConfig(params) {
|
|
|
122179
122179
|
cfg: params.cfg,
|
|
122180
122180
|
pluginId
|
|
122181
122181
|
})) {
|
|
122182
|
-
if (!
|
|
122182
|
+
if (!syncFs.existsSync(rootDir)) continue;
|
|
122183
122183
|
for (const fileName of BUNDLE_MCP_FILENAMES) try {
|
|
122184
122184
|
Object.assign(mcpServers, readBundleMcpFile({
|
|
122185
122185
|
rootDir,
|
|
@@ -123184,11 +123184,11 @@ function appendRawStream(payload) {
|
|
|
123184
123184
|
if (!rawStreamReady) {
|
|
123185
123185
|
rawStreamReady = true;
|
|
123186
123186
|
try {
|
|
123187
|
-
|
|
123187
|
+
syncFs.mkdirSync(path.dirname(RAW_STREAM_PATH), { recursive: true });
|
|
123188
123188
|
} catch {}
|
|
123189
123189
|
}
|
|
123190
123190
|
try {
|
|
123191
|
-
|
|
123191
|
+
syncFs.promises.appendFile(RAW_STREAM_PATH, `${JSON.stringify(payload)}\n`);
|
|
123192
123192
|
} catch {}
|
|
123193
123193
|
}
|
|
123194
123194
|
|
|
@@ -126654,7 +126654,7 @@ async function runEmbeddedPiAgent(params) {
|
|
|
126654
126654
|
apiKeyInfo = await resolveApiKeyForCandidate(candidate);
|
|
126655
126655
|
if (!apiKeyInfo.apiKey) throw new Error(`No API key resolved for provider "${model.provider}" (auth mode: ${apiKeyInfo.mode}).`);
|
|
126656
126656
|
if (model.provider === "github-copilot") {
|
|
126657
|
-
const { resolveCopilotApiToken } = await import("./github-copilot-token-
|
|
126657
|
+
const { resolveCopilotApiToken } = await import("./github-copilot-token-eyrRGmGp.js").then((n) => n.n);
|
|
126658
126658
|
const copilotToken = await resolveCopilotApiToken({ githubToken: apiKeyInfo.apiKey });
|
|
126659
126659
|
authStorage.setRuntimeApiKey(model.provider, copilotToken.token);
|
|
126660
126660
|
} else authStorage.setRuntimeApiKey(model.provider, apiKeyInfo.apiKey);
|