@noxsoft/anima 5.1.2 → 6.0.0
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/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/dist/{APEv2Parser-DV7AH14P.js → APEv2Parser-Dvsbp_2R.js} +3 -3
- package/dist/{AbstractID3Parser-C3RlCr-Y.js → AbstractID3Parser-IB9gxozg.js} +5 -5
- package/dist/{AiffParser-DaFyNU8n.js → AiffParser-R2IhrBzL.js} +4 -4
- package/dist/{AsfParser-CDCRfCXr.js → AsfParser-DJEueUMg.js} +4 -4
- package/dist/{DsdiffParser-BX31LICZ.js → DsdiffParser-DXLYn9tT.js} +4 -4
- package/dist/{DsfParser-C3JBjE-C.js → DsfParser-D2--NF0i.js} +5 -5
- package/dist/{FlacParser-DY4m-7v1.js → FlacParser-8cDAjrth.js} +5 -5
- package/dist/{ID3v1Parser-DL9AGlNt.js → ID3v1Parser-B494XuP9.js} +3 -3
- package/dist/{ID3v2Parser-Mr8o-5GJ.js → ID3v2Parser-DlxcNqv5.js} +4 -4
- package/dist/{ID3v2Token-DQqGh8AB.js → ID3v2Token-CSLSVrSQ.js} +2 -2
- package/dist/{MP4Parser-DkunlEqI.js → MP4Parser-COql2J-w.js} +6 -6
- package/dist/{MatroskaParser-IKjHx0h7.js → MatroskaParser-bNP5wC2F.js} +3 -3
- package/dist/{MpegParser-EecSeRWJ.js → MpegParser-C1gjfYqq.js} +4 -4
- package/dist/{MusepackParser-CkfsAeuE.js → MusepackParser-DBdYf7kV.js} +5 -5
- package/dist/{OggParser-z3QlSd8U.js → OggParser-CxajqbK3.js} +5 -5
- package/dist/{Util-DDVY6AaC.js → Util-BRZxoY1Q.js} +1 -1
- package/dist/{WavPackParser-PimUUBRx.js → WavPackParser-CtH9QFia.js} +4 -4
- package/dist/{WaveParser-B539YtoQ.js → WaveParser-yufLki1G.js} +5 -5
- package/dist/{accounts-CL0JV_xk.js → accounts-B_2nt5Cd.js} +2 -2
- package/dist/{accounts-CYEa4ttU.js → accounts-COxGcLGB.js} +1 -1
- package/dist/{accounts-Bj5MvaDs.js → accounts-DIES085e.js} +11 -11
- package/dist/{accounts-DZsqyow2.js → accounts-TUsfghIW.js} +38 -38
- package/dist/{acp-cli-ynoZZhYQ.js → acp-cli-CWgqDQQH.js} +6 -6
- package/dist/{acp-cli-BFAoKBvs.js → acp-cli-D0wfP8-l.js} +16 -16
- package/dist/{active-listener-BWPgtTZp.js → active-listener-BKtsWhsb.js} +4 -4
- package/dist/{active-listener-GJR3nLhX.js → active-listener-D2r8IO7g.js} +5 -5
- package/dist/{agent-DUAarfNl.js → agent-CnS0SRpT.js} +93 -236
- package/dist/{agent-CaaEZsXl.js → agent-VRQM14Xp.js} +98 -229
- package/dist/{agent-scope-C9CiVcmh.js → agent-scope-ByIGrCTT.js} +2 -2
- package/dist/{agent-scope-D3HZp64M.js → agent-scope-CXxC8FFX.js} +2 -2
- package/dist/{agent-scope-BZ8hjIt_.js → agent-scope-CxBzAozu.js} +3 -3
- package/dist/{agents-t54YcbvK.js → agents-CvMRplDx.js} +15 -13
- package/dist/{agents.config-J7iEgdW_.js → agents.config-BR5JLtud.js} +1 -1
- package/dist/{anthropic-direct-runner-B12V2Q5H.js → anthropic-direct-runner-BeYCnvZ8.js} +37 -15
- package/dist/{anthropic-direct-runner-CzQb7QkD.js → anthropic-direct-runner-C2Kwju-r.js} +29 -7
- package/dist/{audit-ByHmjh-G.js → audit-B05W5ckN.js} +23 -34
- package/dist/{audit-HJOpXfgY.js → audit-DDz7UOIx.js} +18 -15
- package/dist/{auth-DXrALxdm.js → auth-DsC5pZ_0.js} +2 -2
- package/dist/{prompts-CneQ6SeF.js → auth-choice-DY1saszS.js} +12 -107
- package/dist/{auth-choice-DPWnLV_w.js → auth-choice-Dc5TAJwT.js} +10 -9
- package/dist/{auth-health-DmrnGklu.js → auth-health-Cc8-vy8y.js} +1 -1
- package/dist/auth-health-Dhr8p2SD.js +149 -0
- package/dist/{auth-profiles-BF5x9Ej0.js → auth-profiles-Brxz2ojJ.js} +193 -42
- package/dist/{auth-profiles-DjCH4kWT.js → auth-profiles-C-LuhW6c.js} +195 -44
- package/dist/{auth-profiles-PJVsRqf4.js → auth-profiles-DKu7ZUzl.js} +189 -29
- package/dist/{auth-profiles-eZzmaeR3.js → auth-profiles-DtWUl1-k.js} +198 -38
- package/dist/{auth-store-CnRrUELz.js → auth-store-Bd0GoqEL.js} +13 -13
- package/dist/{auth-store-KnWGteIV.js → auth-store-BpYI9t_y.js} +3 -3
- package/dist/{auth-store-DjcQlyze.js → auth-store-Jvgz2_l1.js} +2 -2
- package/dist/{banner-D9JyV5SF.js → banner-DAMtSjUF.js} +1 -1
- package/dist/{bonjour-discovery-QsoaZ8Pr.js → bonjour-discovery-Co-b97Dz.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +222 -151
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +24 -24
- package/dist/{call-DHZ76BNg.js → call-B4lhqS6H.js} +3 -3
- package/dist/{call-DQjoz63V.js → call-CDPbPDAr.js} +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{catalog-AZNRamJ4.js → catalog-CsXv59Tq.js} +2 -2
- package/dist/{channel-web-CQIbtfme.js → channel-web-B8mzTSaY.js} +15 -15
- package/dist/{channels-status-issues-DdjvFHx9.js → channels-status-issues-WkG3Tmxk.js} +4 -4
- package/dist/{chrome-HTuFjVWW.js → chrome-B8EnYGj1.js} +9 -9
- package/dist/{chrome-BNggURXT.js → chrome-BaU-H9m7.js} +3 -3
- package/dist/{chrome-Cfak4A3i.js → chrome-DLUBPBPz.js} +12 -12
- package/dist/{chunk-CyT-_QsQ.js → chunk-B4Kx-ocg.js} +11 -9
- package/dist/{chunk-Dffz_QIs.js → chunk-CFSle8n5.js} +1 -1
- package/dist/{chunk-D3vyM2EQ.js → chunk-Cy0Bj0F3.js} +1 -1
- package/dist/{chunk-DFqo_u5A.js → chunk-DJXDX69U.js} +11 -9
- package/dist/{clack-prompter-QbDK4ABC.js → clack-prompter-0JW5kry0.js} +3 -3
- package/dist/{clack-prompter-rXuqdPbx.js → clack-prompter-fZSmnHda.js} +5 -5
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-kT9Mb3dT.js → cli-D8exVpuI.js} +30 -29
- package/dist/cli-hcHk5KuP.js +102 -0
- package/dist/{cli-utils-BdkJVXjy.js → cli-utils-D2X_bDLt.js} +9 -1
- package/dist/{cli-utils-DGnL8raH.js → cli-utils-DcDBK4C5.js} +9 -1
- package/dist/{client-D9E5Wwb_.js → client-BWkoTfOH.js} +3 -2
- package/dist/{client-DzIcZx4J.js → client-CfLiulzK.js} +2 -1
- package/dist/{command-registry-vEVxxxzI.js → command-registry-D3VhxpWx.js} +21 -12
- package/dist/{commands-NIY0IDXe.js → commands-DE8FNH0v.js} +92 -20
- package/dist/{commands-eY0Ao0wt.js → commands-Mekaw9WG.js} +92 -20
- package/dist/{common-C2wAYEWA.js → common-BCW6hLGI.js} +2 -2
- package/dist/{common-BzPvZcxT.js → common-Bf_TG87Y.js} +2 -2
- package/dist/{common-6Fcbzr42.js → common-DT_obM-k.js} +2 -2
- package/dist/{completion-cli-BBKG6buM.js → completion-cli-B3BqQJq9.js} +3 -3
- package/dist/{completion-cli-C84I5l8a.js → completion-cli-CepDzeW1.js} +2 -2
- package/dist/{config-Ofh9gKvs.js → config-BrVuTQ8R.js} +14 -2
- package/dist/{config-6FVC8hW0.js → config-CweTwOtr.js} +40 -28
- package/dist/{config-DqwH4y-D.js → config-DaD4FsAn.js} +19 -7
- package/dist/{config-D2kCn7yR.js → config-ZYN8tezd.js} +18 -6
- package/dist/{config-cli-CQzq5yWB.js → config-cli-3CaIxSKo.js} +4 -4
- package/dist/config-cli-B6Np85rk.js +15 -0
- package/dist/{config-guard-B1plY6aQ.js → config-guard-C4b2dksv.js} +2 -2
- package/dist/{config-guard-CYlpjNN7.js → config-guard-CWhoBtB3.js} +20 -20
- package/dist/{config-sync-CYX9Tzyr.js → config-sync-CCVp-tVX.js} +2 -2
- package/dist/{config-sync-CDUhjDom.js → config-sync-CMO_5lyl.js} +2 -2
- package/dist/{configure-G6h2Ppk0.js → configure-D882Bg7c.js} +39 -15
- package/dist/{configure-Bv6mqD0j.js → configure-D88dg6mE.js} +79 -77
- package/dist/{configure-DxQqSUJs.js → configure-xpjwedvJ.js} +50 -49
- package/dist/{configure-B-dfdPKX.js → configure-zXK6UZ51.js} +49 -24
- package/dist/{context-CpsnZLOp.js → context-B5X720Bs.js} +1 -1
- package/dist/{control-service-D1oxSXVg.js → control-service-3CI4vt1h.js} +2 -2
- package/dist/{control-service-CzAfyR4e.js → control-service-5YtMvm7D.js} +5 -5
- package/dist/control-ui/assets/index-C4ejMN5U.js +72 -0
- package/dist/control-ui/assets/index-C4ejMN5U.js.map +1 -0
- package/dist/control-ui/assets/index-CcPNqN3R.css +1 -0
- package/dist/control-ui/assets/index-D7Bf6Say.js +3 -0
- package/dist/control-ui/assets/index-D7Bf6Say.js.map +1 -0
- package/dist/control-ui/assets/index-yhFuaOnc.js +2 -0
- package/dist/control-ui/assets/index-yhFuaOnc.js.map +1 -0
- package/dist/control-ui/assets/observers-V7q9lNYt.js +2 -0
- package/dist/control-ui/assets/observers-V7q9lNYt.js.map +1 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js +138 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js.map +1 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js +129 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/{cron-cli-C4qZZo4e.js → cron-cli-Cht6Itx6.js} +18 -18
- package/dist/{cron-cli-CSivg2i9.js → cron-cli-D9XrF-Gx.js} +8 -8
- package/dist/{daemon-cli-DfxT-pQ4.js → daemon-cli-9zrnYRjh.js} +8 -8
- package/dist/{daemon-cli-KMzjJH_D.js → daemon-cli-CrdPhSxr.js} +15 -15
- package/dist/daemon-cli.js +34 -6
- package/dist/{daemon-runtime-CIE27usH.js → daemon-runtime-BrUj88ZO.js} +2 -2
- package/dist/{daemon-runtime-BfgstLVI.js → daemon-runtime-DCqwraWR.js} +1 -1
- package/dist/{deliver-8r6UbXnC.js → deliver-B-dPbUIs.js} +18 -28
- package/dist/{deliver-ahx1N11n.js → deliver-BKzX3YoN.js} +7 -7
- package/dist/{deliver-DVt8TbK9.js → deliver-C1L5nO0K.js} +3 -3
- package/dist/{deliver-D2hQZ9X0.js → deliver-d-CaN0uL.js} +59 -69
- package/dist/deps-DyT32VfN.js +23 -0
- package/dist/{diagnostics-DXeDqA_-.js → diagnostics-Cu9pZAFn.js} +1 -1
- package/dist/{dispatcher-DpSnqIL0.js → dispatcher-BQQugU-7.js} +1 -1
- package/dist/{dispatcher-DzT6jltc.js → dispatcher-DzwzLQRk.js} +2 -2
- package/dist/{dns-cli-D9ka2fZD.js → dns-cli-C8KIX4P3.js} +12 -12
- package/dist/{dns-cli-D2Orvc8E.js → dns-cli-V2bo6vSt.js} +3 -3
- package/dist/{docs-cli-CKfzGqYM.js → docs-cli-Bt-YV3xs.js} +2 -2
- package/dist/{docs-cli-DWYXJd-j.js → docs-cli-D2cVJxjP.js} +7 -7
- package/dist/{doctor-vXt5qjNJ.js → doctor-DEnSKgHu.js} +21 -21
- package/dist/{doctor-DumyG85t.js → doctor-WpKCNZeO.js} +36 -181
- package/dist/{doctor-completion-lAyxyd7X.js → doctor-completion-CPff9UlF.js} +2 -2
- package/dist/{doctor-completion-C8JSWfqN.js → doctor-completion-CypXc1Uo.js} +2 -2
- package/dist/{doctor-config-flow-DA50eWp5.js → doctor-config-flow-Bgl0Cc20.js} +6 -6
- package/dist/{doctor-config-flow-BjfGQ1Br.js → doctor-config-flow-Dxy7RIm0.js} +4 -4
- package/dist/{engine-BVchKo5_.js → engine-DpbYPop7.js} +9 -9
- package/dist/{engine-CKqNpVwE.js → engine-zmn3SOYa.js} +10 -9
- package/dist/entry.js +19 -28
- package/dist/{env-DVJCc7dM.js → env-DlTia1B4.js} +1 -1
- package/dist/{exec-cazBMA02.js → exec-BylR5qWS.js} +1 -1
- package/dist/{exec-gKbUce2p.js → exec-C6tXfeqA.js} +1 -1
- package/dist/{exec-Bfd4ztFZ.js → exec-DUzVF5_D.js} +7 -7
- package/dist/{exec-approvals-cli-BPwW6GIK.js → exec-approvals-cli-CN2WeH7y.js} +20 -20
- package/dist/{exec-approvals-cli-6HndodnP.js → exec-approvals-cli-DYZVBnqS.js} +8 -8
- package/dist/extensionAPI.js +22 -22
- package/dist/format-BCAtE7cT.js +20 -0
- package/dist/{frontmatter-BP4GSt5L.js → frontmatter-Dsa7N963.js} +2 -2
- package/dist/{gateway-cli-CHhTweWb.js → gateway-cli-B_xsx5Nv.js} +104 -101
- package/dist/{gateway-cli-B60L2z4a.js → gateway-cli-D3VBOA_i.js} +69 -66
- package/dist/{gateway-rpc-CrSglZPE.js → gateway-rpc-Cj_h2sVM.js} +3 -3
- package/dist/{gateway-rpc-BtOX_e53.js → gateway-rpc-CnXMGsxp.js} +3 -3
- package/dist/{gmail-setup-utils-D2uUKNlF.js → gmail-setup-utils-DaJoXV_3.js} +3 -3
- package/dist/{health-BttJ1Qeh.js → health-C8KCBhuo.js} +8 -8
- package/dist/{health-D8fJ6U_k.js → health-CabOEPQ0.js} +13 -13
- package/dist/{health-format-CH6JWH45.js → health-format-D-JJ5_S4.js} +2 -2
- package/dist/{heartbeat-visibility-DcGQOTXe.js → heartbeat-visibility-BjYY-mKG.js} +1 -1
- package/dist/{heartbeat-visibility-B2MDtPTL.js → heartbeat-visibility-ZfNSbFcq.js} +1 -1
- package/dist/{help-format-7YidDC5Z.js → help-format-Dt-I_Mls.js} +1 -1
- package/dist/{hooks-cli-DRUryj5H.js → hooks-cli-Cs7GUa7G.js} +34 -33
- package/dist/{hooks-cli-BMZF6RF3.js → hooks-cli-DOs9WZ3K.js} +56 -55
- package/dist/{hooks-status-VvwKn90L.js → hooks-status-DdweuSIj.js} +4 -4
- package/dist/{image-ops-BUy__GHL.js → image-ops-Ct3GueyT.js} +1 -1
- package/dist/index.js +79 -71
- package/dist/{init-B8PBeUpi.js → init-CFndGgTJ.js} +1 -1
- package/dist/{init-DxkAVKP0.js → init-DkBwXNme.js} +1 -1
- package/dist/{installs-sayrGjx1.js → installs-Bi6UipiE.js} +6 -6
- package/dist/{installs-BcnNDR54.js → installs-a4Vz_J08.js} +3 -3
- package/dist/ipv4-DfMwLQ0d.js +14 -0
- package/dist/{lib-D4dE4_XZ.js → lib-6xd5SQjU.js} +20 -20
- package/dist/{lifecycle-core-BerWWP7p.js → lifecycle-core-B8PI1NZJ.js} +3 -3
- package/dist/{links-OhvsEkVw.js → links-DcilUrqq.js} +1 -1
- package/dist/llm-slug-generator.js +25 -25
- package/dist/{loader-CLNb0v_s.js → loader-Bw2wdN4l.js} +159 -3
- package/dist/{loader-Bww_qb65.js → loader-C87TLS4J.js} +159 -3
- package/dist/{logging-DhXRGHWg.js → logging-Chc1Sj6N.js} +1 -1
- package/dist/{login-BovU8kno.js → login-BHnvW9HA.js} +6 -6
- package/dist/{login-BPtmlRRv.js → login-BTOKtSQN.js} +5 -5
- package/dist/{login-C54B66KM.js → login-CrMpAZ0n.js} +4 -4
- package/dist/{login-C4mptULi.js → login-DKkQ3Czu.js} +5 -5
- package/dist/{login-qr-bim3Nkyu.js → login-qr-BGbHImRb.js} +8 -8
- package/dist/{login-qr-pFbvowe5.js → login-qr-CsAVGp00.js} +12 -12
- package/dist/{login-qr-657mh7cI.js → login-qr-DILcBA_q.js} +6 -6
- package/dist/{login-qr-BxNKHxcf.js → login-qr-OUAGpDsU.js} +10 -10
- package/dist/{logs-cli-CQStwrGd.js → logs-cli-Bc6IOyHA.js} +8 -8
- package/dist/{logs-cli-De79vyiP.js → logs-cli-BiAJbjnq.js} +15 -15
- package/dist/{manager-B043uMPT.js → manager-BYu34CX3.js} +12 -12
- package/dist/{manager-Cvmm95Pf.js → manager-C6L_DH0O.js} +2 -2
- package/dist/{manager-BtrVJ8Ve.js → manager-D8VCuzru.js} +9 -9
- package/dist/{manager-A3pC-CW-.js → manager-b_aZwo00.js} +16 -16
- package/dist/{manifest-registry-D-DOtLzo.js → manifest-registry-qF960vMH.js} +1 -1
- package/dist/{memory-cli-COl5xoIl.js → memory-cli-B0kKl-9T.js} +7 -7
- package/dist/{memory-cli-691NgCXx.js → memory-cli-DLtBA6r5.js} +11 -11
- package/dist/{message-channel-DZYYDt1_.js → message-channel-CMsexA3K.js} +9 -7
- package/dist/{message-channel-DdOBO6Qm.js → message-channel-DIHHKJhk.js} +8 -6
- package/dist/{migrate-DkBWjPPs.js → migrate-DuohB_ur.js} +3 -3
- package/dist/{migrate-BLjwxe9X.js → migrate-bgeTT_GR.js} +3 -3
- package/dist/{model-auth-DKhjNVHc.js → model-auth-CHB3EySM.js} +10 -5
- package/dist/{model-auth-CxAB4iZ0.js → model-auth-KpsOXKDc.js} +3 -3
- package/dist/model-param-b-C1QDqzQp.js +16 -0
- package/dist/{model-selection-BPkpXepz.js → model-selection-CLcoOT3e.js} +25 -7
- package/dist/{model-selection-wCaVeFbb.js → model-selection-CY6r_3wt.js} +25 -7
- package/dist/{model-selection-DFbDH9o2.js → model-selection-DcO3qJOu.js} +24 -6
- package/dist/{model-selection-BI8CKPwQ.js → model-selection-DjsJGv1R.js} +67 -8
- package/dist/models-BM2_NkMu.js +2707 -0
- package/dist/models-cli-BjY8wA-C.js +272 -0
- package/dist/models-cli-BpjeKsUz.js +2946 -0
- package/dist/{node-cli-Ajhng-5p.js → node-cli-BmuVEJ1C.js} +12 -12
- package/dist/{node-cli-t3N6HE9R.js → node-cli-DU_oREff.js} +27 -27
- package/dist/{node-service-4B-0AjmA.js → node-service-qZXF7T7A.js} +1 -1
- package/dist/{note-De2zPKl3.js → note-iMYVGjpA.js} +2 -2
- package/dist/noxsoft-bootstrap-C4dSx7K_.js +77 -0
- package/dist/noxsoft-bootstrap-CrlkSFzd.js +77 -0
- package/dist/{npm-registry-spec-CFp4OEe4.js → npm-registry-spec-Br4B4I_3.js} +2 -2
- package/dist/{npm-registry-spec-DVDcgWxm.js → npm-registry-spec-jf7Mowdn.js} +1 -1
- package/dist/{onboard-xSPFmM29.js → onboard-DM9gULJN.js} +24 -19
- package/dist/{onboard-i4CJtSb9.js → onboard-_-D81kAy.js} +19 -15
- package/dist/{onboard-channels-RsbA6EaD.js → onboard-channels-CtT-RN60.js} +8 -8
- package/dist/{onboard-channels-D6Gt3CsX.js → onboard-channels-UkphAdCy.js} +4 -4
- package/dist/{onboard-helpers-IeOtcIME.js → onboard-helpers-CFudIoX4.js} +3 -3
- package/dist/{onboard-helpers-DPqXrhma.js → onboard-helpers-CJ3HzoUO.js} +7 -7
- package/dist/{onboarding-CZBVMwFn.js → onboarding-BB9PteK8.js} +20 -17
- package/dist/{onboarding-Cao0a_Z1.js → onboarding-Djmm0PEM.js} +27 -23
- package/dist/{orchestrator-COMX8CF2.js → orchestrator-C1nWKIJS.js} +7 -3
- package/dist/{orchestrator-BLXpTTgr.js → orchestrator-C2ypFiPL.js} +6 -3
- package/dist/{outbound-DWfSyfZC.js → outbound-Bmft-5um.js} +4 -4
- package/dist/{outbound-Rs0fFC2g.js → outbound-C577aWZp.js} +1 -1
- package/dist/{outbound-DLCmFGfJ.js → outbound-DW2eod1S.js} +4 -4
- package/dist/{outbound-uxBpmALx.js → outbound-fPqdCDR4.js} +4 -4
- package/dist/outbound-send-deps-DVfWC4E8.js +14 -0
- package/dist/outbound-send-deps-T_FgdfgW.js +36 -0
- package/dist/{parse-timeout-DkOL1T_l.js → parse-timeout-C4WLf3Qy.js} +3 -3
- package/dist/{parse-timeout-DlU4ymhF.js → parse-timeout-D4UO8pY_.js} +1 -1
- package/dist/{path-env-CjpH-KWH.js → path-env-DLQPf9qj.js} +2 -2
- package/dist/{paths-D2eokayo.js → paths-B-AkG5FD.js} +3 -3
- package/dist/{paths-DQMKfv60.js → paths-CAQJvbeZ.js} +2 -2
- package/dist/{paths-Cwszsz1I.js → paths-Q6h5HODL.js} +2 -2
- package/dist/{pi-auth-json-BLdaEAx2.js → pi-auth-json-B_lKNFK6.js} +5 -5
- package/dist/{pi-auth-json-BH7uvkKr.js → pi-auth-json-BmdBnmlZ.js} +8 -9
- package/dist/{pi-auth-json-DjxzPUt3.js → pi-auth-json-DkYqdjrV.js} +2 -2
- package/dist/{pi-auth-json-smxh_Xud.js → pi-auth-json-WTvcP2gz.js} +9 -8
- package/dist/{pi-embedded-D4eEfxIU.js → pi-embedded-BMbtgOzv.js} +825 -319
- package/dist/{pi-embedded-DifnZvKk.js → pi-embedded-DfbM3fAT.js} +888 -382
- package/dist/{pi-embedded-helpers-B6wVA0hU.js → pi-embedded-helpers-BZ9GspxK.js} +1 -1
- package/dist/{pi-tools.policy-CDgjN_3f.js → pi-tools.policy-D2FusuQa.js} +3 -3
- package/dist/{pi-tools.policy-ox141hP6.js → pi-tools.policy-WdTAfqbV.js} +6 -6
- package/dist/{plugin-auto-enable-Mj7AnofW.js → plugin-auto-enable-CtYcdTju.js} +5 -5
- package/dist/{plugin-auto-enable-OqDAK-ap.js → plugin-auto-enable-DhuD30Je.js} +2 -2
- package/dist/{plugin-registry-CpXm8ADp.js → plugin-registry-DePMxn4z.js} +4 -4
- package/dist/{plugin-registry-CkZnT8Fb.js → plugin-registry-QTkplP4s.js} +2 -2
- package/dist/plugin-sdk/agents/cli-backends.d.ts +4 -1
- package/dist/plugin-sdk/agents/cli-credentials.d.ts +0 -10
- package/dist/plugin-sdk/agents/cli-runner.d.ts +2 -0
- package/dist/plugin-sdk/agents/defaults.d.ts +2 -2
- package/dist/plugin-sdk/agents/model-auto.d.ts +43 -0
- package/dist/plugin-sdk/agents/model-fallback.d.ts +5 -0
- package/dist/plugin-sdk/agents/model-preference.d.ts +25 -0
- package/dist/plugin-sdk/agents/noxsoft-runner.d.ts +94 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +6 -3
- package/dist/plugin-sdk/agents/pi-embedded.d.ts +6 -50
- package/dist/plugin-sdk/agents/runner-capabilities.d.ts +2 -0
- package/dist/plugin-sdk/agents/sandbox/constants.d.ts +1 -1
- package/dist/plugin-sdk/auth/noxsoft-auth.d.ts +55 -0
- package/dist/plugin-sdk/channels/registry.d.ts +2 -2
- package/dist/plugin-sdk/cli/deps.d.ts +2 -1
- package/dist/plugin-sdk/cli/outbound-send-deps.d.ts +10 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +14 -0
- package/dist/plugin-sdk/config/types.models.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +1 -0
- package/dist/plugin-sdk/identity/loader.d.ts +1 -0
- package/dist/plugin-sdk/identity/trust-graph.d.ts +32 -0
- package/dist/plugin-sdk/index.js +57 -47
- package/dist/plugin-sdk/utils/message-channel.d.ts +2 -1
- package/dist/{plugins-DnJgmFJR.js → plugins-DYcg0qBW.js} +1 -1
- package/dist/{plugins-cli-CrrkMAYM.js → plugins-cli-Bc9oU1ld.js} +58 -57
- package/dist/{plugins-cli-D4VxQKaJ.js → plugins-cli-Dv0KQTWo.js} +36 -35
- package/dist/{polls-DuwPgAV7.js → polls-DFISjV7H.js} +5 -5
- package/dist/{ports-B1b1r9Dz.js → ports-DaVrZDUq.js} +2 -2
- package/dist/{ports-BX00e96t.js → ports-q535r1PZ.js} +2 -2
- package/dist/{program-CTDFmZNx.js → program-CuwbF8YO.js} +48 -40
- package/dist/{program-context-Hl6bnPfB.js → program-context-CxPfy-Wr.js} +51 -35
- package/dist/{progress-B-VBLfHr.js → progress-CVLvQV_t.js} +1 -1
- package/dist/{prompt-style-DU9Vjqe5.js → prompt-style-BI53UVgE.js} +1 -1
- package/dist/{prompts-D6b3zLVO.js → prompts-BmgT_kkv.js} +33 -2
- package/dist/prompts-Bq4QGFQM.js +158 -0
- package/dist/{pw-ai-BV57RRmp.js → pw-ai-CB-zeR7h.js} +5 -5
- package/dist/{pw-ai-CY-VcqJp.js → pw-ai-C_1-7IgH.js} +4 -4
- package/dist/{pw-ai-CTHtrCEC.js → pw-ai-DxNrJcCA.js} +3 -3
- package/dist/{qmd-manager-DJeQYS-r.js → qmd-manager-C_XBZ_bT.js} +5 -5
- package/dist/{qmd-manager-CwbYv6nJ.js → qmd-manager-CpNYgSrx.js} +7 -7
- package/dist/{qmd-manager-Cbm03z8H.js → qmd-manager-Q0OSDQ-e.js} +5 -5
- package/dist/{register.agent-CMoYTJqj.js → register.agent-DFQmkIEH.js} +53 -50
- package/dist/{register.agent-BKINbWbs.js → register.agent-DUjwGw9d.js} +77 -73
- package/dist/{register.anima-BHrZ90Sv.js → register.anima-CRFHJu2J.js} +21 -21
- package/dist/{register.anima-CnEy5VFQ.js → register.anima-CtKNrpE8.js} +21 -21
- package/dist/{register.configure-Cv5NkGH2.js → register.configure-CSSN07XN.js} +50 -49
- package/dist/register.configure-CnEKV57N.js +107 -0
- package/dist/register.maintenance-CU1A-90-.js +102 -0
- package/dist/{register.maintenance-DtAw8E_a.js → register.maintenance-fhcCB7ih.js} +48 -47
- package/dist/register.message-C1a0y2ZR.js +661 -0
- package/dist/register.message-fM0jSKB8.js +659 -0
- package/dist/register.onboard-B7Gavmvt.js +128 -0
- package/dist/{register.onboard-U3lIfaw_.js → register.onboard-BhPlqjFi.js} +50 -49
- package/dist/{register.setup-CLkGhR-e.js → register.setup-0jPnMgnz.js} +96 -92
- package/dist/{register.setup-Dyp5L_GQ.js → register.setup-CADdQUEN.js} +72 -69
- package/dist/{register.status-health-sessions-Dx-qZMol.js → register.status-health-sessions-Cu5fDT-z.js} +68 -67
- package/dist/{register.status-health-sessions-Cc2Y5gSj.js → register.status-health-sessions-DdQsABr_.js} +40 -39
- package/dist/{register.subclis-L55mGheS.js → register.subclis-CZ91ufCy.js} +28 -21
- package/dist/{reply-BgPvB-gR.js → reply-DtHlnzOx.js} +6631 -6172
- package/dist/{reply-prefix-37W_P4kH.js → reply-prefix-C8dIgJur.js} +1 -1
- package/dist/{reply-prefix-DBRqtDEq.js → reply-prefix-DmWGtcH-.js} +1 -1
- package/dist/{routes-ZlpnlJFF.js → routes-CWCAc8uJ.js} +2 -2
- package/dist/{routes-DeDgHj5Y.js → routes-FT0Us8Md.js} +6 -6
- package/dist/{run-DEHnKm2x.js → run-Dfz_7j7t.js} +1256 -166
- package/dist/{run-BFPM6M2S.js → run-DqBQ-bGn.js} +1230 -140
- package/dist/{run-main-Cxmjk1SF.js → run-main-DGDW0fhx.js} +51 -50
- package/dist/{runtime-guard-cBL2D5J8.js → runtime-guard-D14Z_QY6.js} +1 -1
- package/dist/{sandbox-DDOFuJU9.js → sandbox-D-N7M7lp.js} +2 -2
- package/dist/{sandbox-cli-GhcxR1Va.js → sandbox-cli-CQKz2I1X.js} +9 -9
- package/dist/{sandbox-cli-CGJvhJ4L.js → sandbox-cli-DHNFlTo-.js} +23 -23
- package/dist/{sandbox-B8Nza4lP.js → sandbox-pBHlfFdB.js} +6 -6
- package/dist/{security-cli-B7VIDDSL.js → security-cli-Bdi7MuP6.js} +14 -22
- package/dist/{security-cli-gsyz4Wrw.js → security-cli-C3aI09uy.js} +27 -35
- package/dist/{semantic-C3Z-zhNi.js → semantic-9rgWUrz3.js} +1 -1
- package/dist/{semantic-CG6X3rBo.js → semantic-C1UN3bb9.js} +1 -1
- package/dist/{semantic-DCd6zBnV.js → semantic-CQApJNO_.js} +1 -1
- package/dist/{server-context-Dkz4Ce8z.js → server-context-Clykq0XU.js} +1 -1
- package/dist/{server-context-BlJi7pjP.js → server-context-Yx4pgBqJ.js} +7 -7
- package/dist/{server-node-events-DBOg36in.js → server-node-events-BR1aXVlu.js} +55 -53
- package/dist/{server-node-events-CmZXzWcd.js → server-node-events-Ca797E1d.js} +34 -31
- package/dist/{service-QlHhVsQf.js → service-Dd1DfPia.js} +1 -1
- package/dist/{service-audit-D4xG05j8.js → service-audit-Bwpoc2LD.js} +1 -1
- package/dist/{service-audit-BaoBb09i.js → service-audit-KzOtcw_V.js} +3 -3
- package/dist/{session-BJ9XCJBg.js → session-5YO_H-Ra.js} +1 -1
- package/dist/{session-3MLbl1-K.js → session-BiA6jrcs.js} +1 -1
- package/dist/session-C7IGnhd1.js +190 -0
- package/dist/{session-KNXzWBht.js → session-CSmfU0D3.js} +1 -1
- package/dist/{session-CqKJvPTq.js → session-DLevr8Vd.js} +5 -5
- package/dist/session-DfsMJNG3.js +190 -0
- package/dist/{session-TAOVpONo.js → session-FmXsucR7.js} +2 -2
- package/dist/{session-cost-usage-BamtB1rn.js → session-cost-usage-BWqR-ik6.js} +1 -1
- package/dist/{sessions-C2th3rm6.js → sessions-BOzeFzuL.js} +12 -22
- package/dist/{sessions-1XK2mH6L.js → sessions-C_3wTmSA.js} +9 -19
- package/dist/{sessions-BrQHxX_o.js → sessions-Dj7_4mkr.js} +4 -4
- package/dist/{settings-cli-CCtkuc1r.js → settings-cli-DxNeu6kx.js} +79 -77
- package/dist/{settings-cli-Ccizggz2.js → settings-cli-Dytfop1H.js} +50 -49
- package/dist/{setup-token-Dqtgnjxw.js → setup-token-B802CZwe.js} +13 -18
- package/dist/{setup-token-Bcer2kX8.js → setup-token-DYh2QzJ-.js} +29 -34
- package/dist/{shared-Hnu5dChj.js → shared-C-rqLtIT.js} +2 -2
- package/dist/{shell-env-KRrv3dPW.js → shell-env-CMI9f7-7.js} +1 -1
- package/dist/{shell-env-B4ae4lFh.js → shell-env-HkVWMh--.js} +1 -1
- package/dist/{shell-env-PnmcBTp4.js → shell-env-iPnSIi-t.js} +1 -1
- package/dist/{skills-CQoUYlGu.js → skills-4v6-kw0C.js} +3 -3
- package/dist/{skills-cli-DQuLxQUM.js → skills-cli-BoasNTpZ.js} +15 -15
- package/dist/{skills-cli-CNNy0FxN.js → skills-cli-TeAq3fRG.js} +3 -3
- package/dist/{skills-install-2DbC1Yo2.js → skills-install-D6_qpRjW.js} +7 -7
- package/dist/{skills-install-CE6djAWL.js → skills-install-Qw2oU8L8.js} +2 -2
- package/dist/{skills-status-ybjSmiHu.js → skills-status-CvH7AUoY.js} +4 -4
- package/dist/{soul-Bt57OdSx.js → soul-BiIdv3Wp.js} +125 -5
- package/dist/{soul-DFeEGG5h.js → soul-Bt8UNmTq.js} +126 -5
- package/dist/{soul-CwWWw7cs.js → soul-D9k5zulC.js} +2 -2
- package/dist/{soul-Bru-rRjk.js → soul-DQSYs-4l.js} +1 -1
- package/dist/{sqlite-BTcAhNls.js → sqlite-BMMt7osH.js} +2 -2
- package/dist/{sqlite-ClLAW1iQ.js → sqlite-CZ1vD4VS.js} +4 -4
- package/dist/{sqlite-CLZ1eR5Q.js → sqlite-CpAJt-JS.js} +1 -1
- package/dist/{start-DfC7PlAH.js → start-BqnPia0t.js} +66 -63
- package/dist/start-C3fuLzX0.js +157 -0
- package/dist/{status-BVAoIQ0V.js → status-CHGNPonc.js} +26 -44
- package/dist/{status-BU6h4wUP.js → status-CxF6k_jr.js} +2 -2
- package/dist/{status-C9B6cEM0.js → status-DfZJJqNs.js} +15 -15
- package/dist/{status-BaEcHPtc.js → status-tLgozFYL.js} +4 -4
- package/dist/{status.update-CbIRaeaV.js → status.update-B6Tdpk07.js} +2 -2
- package/dist/{status.update-CPACVnCc.js → status.update-E9dSFk_b.js} +1 -1
- package/dist/{subagent-registry-MZIxVf8W.js → subagent-registry-CPtElVX0.js} +807 -348
- package/dist/{subsystem-BMsbqSb4.js → subsystem-BAADN1B8.js} +18 -27
- package/dist/{subsystem-CucjNlOk.js → subsystem-D-Xta-sj.js} +17 -26
- package/dist/{subsystem-DA3Cno1i.js → subsystem-D1AJZPgG.js} +38 -47
- package/dist/{system-cli-BKicxULp.js → system-cli-CP7JrhR0.js} +15 -15
- package/dist/{system-cli-Unb-WFAR.js → system-cli-DoLzi2Sn.js} +8 -8
- package/dist/{systemd-5KGZ3NHE.js → systemd-Bx76sJ3M.js} +2 -2
- package/dist/{systemd-linger-B-uyzDap.js → systemd-linger-BVwGXVS0.js} +2 -2
- package/dist/{systemd-linger-CS_pA1-a.js → systemd-linger-CxGmIy_5.js} +1 -1
- package/dist/{table-CdHBo5d1.js → table-Blmz7glr.js} +2 -2
- package/dist/{tokens-DGhK0fpG.js → tokens-SP2Q7i59.js} +1 -1
- package/dist/{tool-images-DK97edts.js → tool-images-2qproko3.js} +2 -2
- package/dist/{tool-images-Dq55i0mz.js → tool-images-C6cKHTbj.js} +2 -2
- package/dist/{tool-images-J0rGmoDV.js → tool-images-CgDT0Xzv.js} +2 -2
- package/dist/{tui-Bm8FEW0b.js → tui-C2eLfbhA.js} +5 -5
- package/dist/{tui-cli-BGjsxGle.js → tui-cli-BgcbCtgc.js} +12 -12
- package/dist/{tui-cli-TwCYv-a7.js → tui-cli-cLSYBQu9.js} +27 -27
- package/dist/{tui-DtGKiHUr.js → tui-r4qpJhNk.js} +10 -10
- package/dist/{update-Dfi92PZJ.js → update-CqKpX3cX.js} +3 -3
- package/dist/{update-Dle5MRUz.js → update-DA91za97.js} +1 -1
- package/dist/{update-cli-QMVW2eiR.js → update-cli-BuCw75tM.js} +87 -85
- package/dist/{update-cli-D1e-DsWy.js → update-cli-C-er5av6.js} +55 -54
- package/dist/{update-runner-DPmSGXS3.js → update-runner-czCqHZCu.js} +5 -5
- package/dist/{update-runner-iLJQF6VA.js → update-runner-kE8AMQt4.js} +1 -1
- package/dist/{utils-B60lF9Wq.js → utils-CLYlhJuc.js} +1 -1
- package/dist/{web-DJRRkHG8.js → web-BHGK5GtV.js} +24 -24
- package/dist/web-CyYunanU.js +65 -0
- package/dist/{web-DDAkSrtZ.js → web-DvTXV-fo.js} +35 -34
- package/dist/{web-DBQRQY6n.js → web-so3pGceM.js} +27 -27
- package/dist/{webhooks-cli-Cg0F2mU6.js → webhooks-cli-k3QMf7Rs.js} +4 -4
- package/dist/{webhooks-cli-BsWx7MgH.js → webhooks-cli-vlEfXEKm.js} +12 -12
- package/dist/{whatsapp-actions-gpz6-vPI.js → whatsapp-actions-6fPRKwPV.js} +11 -11
- package/dist/{whatsapp-actions-DJpQVKnT.js → whatsapp-actions-BJn-z76S.js} +17 -17
- package/dist/{whatsapp-actions-tWRWRZ4X.js → whatsapp-actions-C0tlEdLy.js} +5 -5
- package/dist/{whatsapp-actions-CMEP8v3k.js → whatsapp-actions-Hr-W8vjY.js} +13 -13
- package/dist/{widearea-dns-BDtWuGCY.js → widearea-dns-CHAT20aR.js} +1 -1
- package/dist/{workspace-BQkffCaR.js → workspace-BFIZCnGo.js} +5 -5
- package/dist/{ws-log-Bc4grA6W.js → ws-log-CUobU2tD.js} +1 -1
- package/package.json +1 -1
- package/templates/profiles/nox.profile.json5 +5 -5
- package/dist/cli--Gal7v4I.js +0 -101
- package/dist/config-cli-cyvL43DG.js +0 -15
- package/dist/control-ui/assets/index-B7CJLRZD.css +0 -1
- package/dist/control-ui/assets/index-DLPYIcs0.js +0 -58
- package/dist/control-ui/assets/index-DLPYIcs0.js.map +0 -1
- package/dist/deps-CeyVMZf1.js +0 -13
- package/dist/models-ByeH7ZKb.js +0 -1350
- package/dist/register.configure-3GfqcGLK.js +0 -105
- package/dist/register.maintenance-YZDsMymb.js +0 -100
- package/dist/register.onboard-Dswys-iV.js +0 -126
- package/dist/start-BPye9w5U.js +0 -154
- package/dist/web-DE-hmqXy.js +0 -64
- /package/dist/{BasicParser-BiEpjka-.js → BasicParser-D4BHCxVb.js} +0 -0
- /package/dist/{agents.config-DibGEnBs.js → agents.config-Br4ULmK0.js} +0 -0
- /package/dist/{archive-BIKRyvqD.js → archive-CNqghdwQ.js} +0 -0
- /package/dist/{archive-5e-Ytlq-.js → archive-D-dHRz-v.js} +0 -0
- /package/dist/{argv-B6vsXQtF.js → argv-nNQ109_K.js} +0 -0
- /package/dist/{auth-store-Vfd6oc1G.js → auth-store-BEfSfCbW.js} +0 -0
- /package/dist/{auto-update-BUbllW1X.js → auto-update-Cvd8YJrT.js} +0 -0
- /package/dist/{auto-update-DdH8fo63.js → auto-update-DO4nHkfM.js} +0 -0
- /package/dist/{brew-Bkf_MwX9.js → brew-DHWnVWm3.js} +0 -0
- /package/dist/{budget-CV0a771W.js → budget-DvjICb0t.js} +0 -0
- /package/dist/{budget-GiXjG9eW.js → budget-e0R5xsU3.js} +0 -0
- /package/dist/{command-options-DfPEZwUK.js → command-options-DtJ8-EC7.js} +0 -0
- /package/dist/{command-options-mgpP-XId.js → command-options-eC-m_qJx.js} +0 -0
- /package/dist/{delivery-queue-DGnDKL02.js → delivery-queue-BKQk1j0k.js} +0 -0
- /package/dist/{delivery-queue-DZ_ibFDu.js → delivery-queue-CExaJXRz.js} +0 -0
- /package/dist/{display-BwSYYxVE.js → display-4p3-O9mP.js} +0 -0
- /package/dist/{display-Dck2kudh.js → display-Bo8pBhMp.js} +0 -0
- /package/dist/{exec-approvals-BJikgQkX.js → exec-approvals-DK5-KCUz.js} +0 -0
- /package/dist/{format-wiLVr0D3.js → format-9DMvWYUJ.js} +0 -0
- /package/dist/{format-duration-C5oKCGwB.js → format-duration-CnGkTPRF.js} +0 -0
- /package/dist/{gmail-setup-utils-CR33Gqfc.js → gmail-setup-utils-BIXtKTpT.js} +0 -0
- /package/dist/{help-format-DJx5Rwy2.js → help-format-ZKxl6UCb.js} +0 -0
- /package/dist/{helpers-8O7IVGO-.js → helpers-CWQnEONe.js} +0 -0
- /package/dist/{hooks-status-DiqubDlK.js → hooks-status-DqfJDvYl.js} +0 -0
- /package/dist/{ipv4-BYbwrpG-.js → ipv4-CExV55ho.js} +0 -0
- /package/dist/{is-main-BnikY3ud.js → is-main-H-hpHkdq.js} +0 -0
- /package/dist/{lib-D1DXSMt_.js → lib-D0_kW-B6.js} +0 -0
- /package/dist/{links-3c7gzW-G.js → links-BjjDMNIq.js} +0 -0
- /package/dist/{logging-Bpf6Cepz.js → logging-DWwOqnTW.js} +0 -0
- /package/dist/{logging-DcXIbpwk.js → logging-_rCcBkls.js} +0 -0
- /package/dist/{model-param-b-BcBBSgiD.js → model-param-b-2KmFir_0.js} +0 -0
- /package/dist/{node-service-BDlDNv3t.js → node-service-cOoW5hLa.js} +0 -0
- /package/dist/{note-BaOKDvcy.js → note-CeLGcHqv.js} +0 -0
- /package/dist/{noxsoft-auth-Bmict45b.js → noxsoft-auth-CE75mBXE.js} +0 -0
- /package/dist/{noxsoft-auth-DpwLJIW0.js → noxsoft-auth-CgCk5707.js} +0 -0
- /package/dist/{pi-model-discovery-ClWISQ3j.js → pi-model-discovery-Bu4Zr7nI.js} +0 -0
- /package/dist/{ports-aNJUI3Mi.js → ports-BGLuwt2Z.js} +0 -0
- /package/dist/{progress-Dj2aBWOI.js → progress-glCgu57m.js} +0 -0
- /package/dist/{qmd-manager-DrDX4o7e.js → qmd-manager-CO795NK4.js} +0 -0
- /package/dist/{queue-B77yV52t.js → queue-DDq0uzy5.js} +0 -0
- /package/dist/{queue-wFYwitx0.js → queue-DtQ5sbyD.js} +0 -0
- /package/dist/{registry-gaRST__4.js → registry-BvymIcVf.js} +0 -0
- /package/dist/{registry-Cv8RtADU.js → registry-DwaHkd_j.js} +0 -0
- /package/dist/{requirements-CEowKaVY.js → requirements-Ct4XnMiK.js} +0 -0
- /package/dist/{skill-scanner-DGoUYV22.js → skill-scanner-5_Y3u6SU.js} +0 -0
- /package/dist/{skill-scanner-FO7SyxAD.js → skill-scanner-Dld2ijVw.js} +0 -0
- /package/dist/{templates-D-h5PNIK.js → templates-4_And8I_.js} +0 -0
- /package/dist/{templates-ndPXOyGA.js → templates-5Z-UIDze.js} +0 -0
- /package/dist/{types-DSS9sywz.js → types-BQk_oAin.js} +0 -0
- /package/dist/{usage-format-BtlQ-77V.js → usage-format-BSa7cHyK.js} +0 -0
- /package/dist/{ws-log-BA9w1cJs.js → ws-log-CG6cvCZW.js} +0 -0
|
@@ -1,35 +1,36 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
|
-
import { a as resolveOAuthDir, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, u as resolveRequiredHomeDir } from "./paths-
|
|
3
|
-
import { A as isAcpSessionKey, C as normalizeAccountId$1, D as resolveThreadSessionKeys, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, N as resolveThreadParentSessionKey, O as sanitizeAgentId, S as classifySessionKeyShape, T as normalizeMainKey, _ as DEFAULT_AGENT_ID, b as buildAgentPeerSessionKey, f as loadWorkspaceBootstrapFiles, g as DEFAULT_ACCOUNT_ID, j as isSubagentSessionKey, k as getSubagentDepth, l as ensureAgentWorkspace, m as resolveAnimaPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, u as filterBootstrapFilesForSession, v as DEFAULT_MAIN_KEY, w as normalizeAgentId, y as buildAgentMainSessionKey } from "./workspace-
|
|
4
|
-
import { A as normalizeLogLevel, D as getChildLogger, E as theme, T as isRich, a as unregisterActiveProgressLine, b as setVerbose, d as normalizeChannelId, h as setActivePluginRegistry, i as registerActiveProgressLine, n as defaultRuntime, p as getActivePluginRegistry, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeAnyChannelId, v as logVerbose, w as colorize, x as shouldLogVerbose } from "./subsystem-
|
|
5
|
-
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-
|
|
6
|
-
import { c as resolveDefaultAgentId, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds } from "./agent-scope-
|
|
7
|
-
import { A as supportsXHighThinking, At as assertSandboxPath, B as extractDeliveryInfo, Bt as normalizeToolName, C as listThinkingLevels, Ct as DEFAULT_UPLOAD_DIR, D as normalizeUsageDisplay, Dt as buildWorkspaceSkillSnapshot, E as normalizeThinkLevel, Et as buildWorkspaceSkillCommandSpecs, F as isLikelyContextOverflowError, Ft as applyOwnerOnlyToolPolicy, G as updateLastRoute, Gt as buildBootstrapContextFiles, H as loadSessionStore, Ht as stripPluginOnlyAllowlist, I as isTransientHttpError, It as buildPluginToolGroups, J as deliveryContextFromSession, Jt as HEARTBEAT_TOKEN, K as updateSessionStore, Kt as resolveBootstrapMaxChars, L as sanitizeUserFacingText, Lt as collectExplicitAllowlist, M as isCompactionFailureError, Mt as ensureBrowserControlAuth, N as isContextOverflowError, Nt as resolveBrowserControlAuth, O as normalizeVerboseLevel, Ot as resolvePluginSkillDirs, P as isFailoverErrorMessage, Pt as resolveSandboxConfigForAgent, Q as normalizeSessionDeliveryFields, R as ensureSandboxWorkspaceForSession, Rt as expandPolicyWithPluginGroups, S as formatXHighModelHint, St as saveMediaBuffer, T as normalizeReasoningLevel, Tt as getBridgeAuthForPort, U as readSessionUpdatedAt, Ut as compileGlobPatterns, V as appendAssistantMessageToSessionTranscript, Vt as resolveToolProfilePolicy, W as recordSessionMetaFromInbound, Wt as matchesAnyGlobPattern, X as mergeDeliveryContext, Xt as isSilentReplyText, Y as deliveryContextKey, Yt as SILENT_REPLY_TOKEN, Z as normalizeDeliveryContext, _ as throwIfAborted, _t as createBrowserRouteContext, at as resolveThreadFlag, b as initializeGlobalHookRunner, bt as resolveProfile, c as applyReplyThreading, ct as canonicalizeMainSessionAlias, d as shouldSuppressMessagingToolReplies, dt as deriveSessionMetaPatch, et as resolveSessionKey$1, f as createReplyToModeFilterForChannel, ft as getChannelDock, g as normalizeTargetForProvider, gt as resolveGroupSessionKey, h as normalizeChannelTargetInput, ht as normalizeChatType, it as resolveSessionResetType, j as classifyFailoverReason, jt as resolveSandboxedMediaSource, k as resolveResponseUsageMode, kt as assertMediaNotDataUrl, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, mt as resolveConversationLabel, nt as resolveChannelResetConfig, o as normalizeReplyPayloadsForDelivery, ot as DEFAULT_RESET_TRIGGERS, p as resolveReplyToMode, pt as listChannelDocks, q as updateSessionStoreEntry, qt as resolveBootstrapTotalMaxChars, rt as resolveSessionResetPolicy, s as applyReplyTagsToPayload, st as resolveFreshSessionTotalTokens, t as deliverOutboundPayloads, tt as evaluateSessionFreshness, u as isRenderablePayload, ut as resolveMainSessionKey, v as parseReplyDirectives, vt as registerBrowserRoutes, w as normalizeElevatedLevel, wt as resolvePathsWithinRoot, x as formatThinkingLevels, xt as getMediaDir, y as getGlobalHookRunner, yt as resolveBrowserConfig, z as resolveSandboxRuntimeStatus, zt as expandToolGroups } from "./deliver-
|
|
2
|
+
import { a as resolveOAuthDir, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, u as resolveRequiredHomeDir } from "./paths-B-AkG5FD.js";
|
|
3
|
+
import { A as isAcpSessionKey, C as normalizeAccountId$1, D as resolveThreadSessionKeys, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, N as resolveThreadParentSessionKey, O as sanitizeAgentId, S as classifySessionKeyShape, T as normalizeMainKey, _ as DEFAULT_AGENT_ID, b as buildAgentPeerSessionKey, f as loadWorkspaceBootstrapFiles, g as DEFAULT_ACCOUNT_ID, j as isSubagentSessionKey, k as getSubagentDepth, l as ensureAgentWorkspace, m as resolveAnimaPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, u as filterBootstrapFilesForSession, v as DEFAULT_MAIN_KEY, w as normalizeAgentId, y as buildAgentMainSessionKey } from "./workspace-BFIZCnGo.js";
|
|
4
|
+
import { A as normalizeLogLevel, D as getChildLogger, E as theme, T as isRich, a as unregisterActiveProgressLine, b as setVerbose, d as normalizeChannelId, h as setActivePluginRegistry, i as registerActiveProgressLine, n as defaultRuntime, p as getActivePluginRegistry, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeAnyChannelId, v as logVerbose, w as colorize, x as shouldLogVerbose } from "./subsystem-D1AJZPgG.js";
|
|
5
|
+
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-DUzVF5_D.js";
|
|
6
|
+
import { c as resolveDefaultAgentId, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds } from "./agent-scope-CxBzAozu.js";
|
|
7
|
+
import { A as supportsXHighThinking, At as assertSandboxPath, B as extractDeliveryInfo, Bt as normalizeToolName, C as listThinkingLevels, Ct as DEFAULT_UPLOAD_DIR, D as normalizeUsageDisplay, Dt as buildWorkspaceSkillSnapshot, E as normalizeThinkLevel, Et as buildWorkspaceSkillCommandSpecs, F as isLikelyContextOverflowError, Ft as applyOwnerOnlyToolPolicy, G as updateLastRoute, Gt as buildBootstrapContextFiles, H as loadSessionStore, Ht as stripPluginOnlyAllowlist, I as isTransientHttpError, It as buildPluginToolGroups, J as deliveryContextFromSession, Jt as HEARTBEAT_TOKEN, K as updateSessionStore, Kt as resolveBootstrapMaxChars, L as sanitizeUserFacingText, Lt as collectExplicitAllowlist, M as isCompactionFailureError, Mt as ensureBrowserControlAuth, N as isContextOverflowError, Nt as resolveBrowserControlAuth, O as normalizeVerboseLevel, Ot as resolvePluginSkillDirs, P as isFailoverErrorMessage, Pt as resolveSandboxConfigForAgent, Q as normalizeSessionDeliveryFields, R as ensureSandboxWorkspaceForSession, Rt as expandPolicyWithPluginGroups, S as formatXHighModelHint, St as saveMediaBuffer, T as normalizeReasoningLevel, Tt as getBridgeAuthForPort, U as readSessionUpdatedAt, Ut as compileGlobPatterns, V as appendAssistantMessageToSessionTranscript, Vt as resolveToolProfilePolicy, W as recordSessionMetaFromInbound, Wt as matchesAnyGlobPattern, X as mergeDeliveryContext, Xt as isSilentReplyText, Y as deliveryContextKey, Yt as SILENT_REPLY_TOKEN, Z as normalizeDeliveryContext, _ as throwIfAborted, _t as createBrowserRouteContext, at as resolveThreadFlag, b as initializeGlobalHookRunner, bt as resolveProfile, c as applyReplyThreading, ct as canonicalizeMainSessionAlias, d as shouldSuppressMessagingToolReplies, dt as deriveSessionMetaPatch, et as resolveSessionKey$1, f as createReplyToModeFilterForChannel, ft as getChannelDock, g as normalizeTargetForProvider, gt as resolveGroupSessionKey, h as normalizeChannelTargetInput, ht as normalizeChatType, it as resolveSessionResetType, j as classifyFailoverReason, jt as resolveSandboxedMediaSource, k as resolveResponseUsageMode, kt as assertMediaNotDataUrl, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, mt as resolveConversationLabel, nt as resolveChannelResetConfig, o as normalizeReplyPayloadsForDelivery, ot as DEFAULT_RESET_TRIGGERS, p as resolveReplyToMode, pt as listChannelDocks, q as updateSessionStoreEntry, qt as resolveBootstrapTotalMaxChars, rt as resolveSessionResetPolicy, s as applyReplyTagsToPayload, st as resolveFreshSessionTotalTokens, t as deliverOutboundPayloads, tt as evaluateSessionFreshness, u as isRenderablePayload, ut as resolveMainSessionKey, v as parseReplyDirectives, vt as registerBrowserRoutes, w as normalizeElevatedLevel, wt as resolvePathsWithinRoot, x as formatThinkingLevels, xt as getMediaDir, y as getGlobalHookRunner, yt as resolveBrowserConfig, z as resolveSandboxRuntimeStatus, zt as expandToolGroups } from "./deliver-d-CaN0uL.js";
|
|
8
8
|
import { i as triggerInternalHook, r as registerInternalHook, t as createInternalHookEvent } from "./internal-hooks-CWw3Hgeu.js";
|
|
9
|
-
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, _ as resetConfigOverrides, a as writeConfigFile, b as getConfigValueAtPath, c as parseDurationMs, d as discoverAnimaPlugins, f as applyTestPluginDefaults, g as getConfigOverrides, h as resolveMemorySlotDecision, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as resolveEnableState, n as loadConfig, o as validateConfigObjectWithPlugins, p as normalizePluginsConfig, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as setConfigOverride, w as VERSION, x as parseConfigPath, y as unsetConfigOverride } from "./config-
|
|
10
|
-
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-
|
|
11
|
-
import { a as modelKey, d as
|
|
12
|
-
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-
|
|
9
|
+
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, _ as resetConfigOverrides, a as writeConfigFile, b as getConfigValueAtPath, c as parseDurationMs, d as discoverAnimaPlugins, f as applyTestPluginDefaults, g as getConfigOverrides, h as resolveMemorySlotDecision, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as resolveEnableState, n as loadConfig, o as validateConfigObjectWithPlugins, p as normalizePluginsConfig, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as setConfigOverride, w as VERSION, x as parseConfigPath, y as unsetConfigOverride } from "./config-CweTwOtr.js";
|
|
10
|
+
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-HkVWMh--.js";
|
|
11
|
+
import { a as modelKey, d as resolveDefaultModelForAgent, f as resolveModelRefFromString, g as DEFAULT_PROVIDER, h as DEFAULT_MODEL, i as isCliProvider, m as DEFAULT_CONTEXT_TOKENS, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as resolveThinkingDefault, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveConfiguredModelRef } from "./model-selection-DjsJGv1R.js";
|
|
12
|
+
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-DLUBPBPz.js";
|
|
13
13
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-GLYKXXl-.js";
|
|
14
14
|
import { n as formatErrorMessage } from "./errors-UbDRvfEx.js";
|
|
15
|
-
import { A as detectMime, C as GATEWAY_CLIENT_MODES, E as getImageMetadata, F as kindFromMime, H as isBlockedHostname, I as normalizeMimeType$1, M as getFileExtension, N as imageMimeFromFormat, P as isAudioFileName, R as mediaKindFromMime, S as GATEWAY_CLIENT_IDS, U as isPrivateIpAddress, _ as isMarkdownCapableMessageChannel, a as chunkText, b as resolveGatewayMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as extensionForMime, k as resizeToJpeg, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as listDeliverableMessageChannels, w as GATEWAY_CLIENT_NAMES, x as resolveMessageChannel, y as normalizeMessageChannel, z as SsrFBlockedError } from "./chunk-
|
|
16
|
-
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-
|
|
17
|
-
import { t as sanitizeToolResultImages } from "./tool-images-
|
|
18
|
-
import { a as
|
|
19
|
-
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-
|
|
20
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-
|
|
21
|
-
import {
|
|
22
|
-
import { a as
|
|
15
|
+
import { A as detectMime, C as GATEWAY_CLIENT_MODES, E as getImageMetadata, F as kindFromMime, H as isBlockedHostname, I as normalizeMimeType$1, M as getFileExtension, N as imageMimeFromFormat, P as isAudioFileName, R as mediaKindFromMime, S as GATEWAY_CLIENT_IDS, U as isPrivateIpAddress, _ as isMarkdownCapableMessageChannel, a as chunkText, b as resolveGatewayMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as extensionForMime, k as resizeToJpeg, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as listDeliverableMessageChannels, w as GATEWAY_CLIENT_NAMES, x as resolveMessageChannel, y as normalizeMessageChannel, z as SsrFBlockedError } from "./chunk-B4Kx-ocg.js";
|
|
16
|
+
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-Q6h5HODL.js";
|
|
17
|
+
import { t as sanitizeToolResultImages } from "./tool-images-2qproko3.js";
|
|
18
|
+
import { _ as normalizeSecretInput, a as markAuthProfileUsed, c as markAuthProfileGood, d as resolveAnimaAgentDir, f as loadJsonFile, h as resolveAuthProfileDisplayLabel, i as markAuthProfileFailure, l as ensureAuthProfileStore, m as withFileLock$1, n as resolveAuthProfileOrder, o as resolveApiKeyForProfile, p as saveJsonFile, r as isProfileInCooldown, s as listProfilesForProvider, u as resolveAuthStorePathForDisplay } from "./auth-profiles-DtWUl1-k.js";
|
|
19
|
+
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-b_aZwo00.js";
|
|
20
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-CZ1vD4VS.js";
|
|
21
|
+
import { n as createAsyncLock } from "./soul-Bt8UNmTq.js";
|
|
22
|
+
import { a as readNumberParam, c as readStringParam, i as jsonResult, n as imageResult, r as imageResultFromFile, s as readStringArrayParam } from "./common-Bf_TG87Y.js";
|
|
23
|
+
import { a as resolveMarkdownTableMode, c as loadWebMedia, d as readResponseWithLimit, f as fetchWithSsrFGuard, i as convertMarkdownTables, l as MediaFetchError, m as fetchWithTimeout, o as normalizePollInput, p as bindAbortRelay, s as getDefaultLocalRoots, t as getActiveWebListener, u as fetchRemoteMedia } from "./active-listener-D2r8IO7g.js";
|
|
23
24
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-62lQTR6C.js";
|
|
24
|
-
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-
|
|
25
|
+
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-Bd0GoqEL.js";
|
|
25
26
|
import { createRequire } from "node:module";
|
|
26
|
-
import * as fs$
|
|
27
|
+
import * as fs$2 from "node:fs/promises";
|
|
27
28
|
import fs from "node:fs/promises";
|
|
28
29
|
import * as os$1 from "node:os";
|
|
29
30
|
import os, { homedir, tmpdir } from "node:os";
|
|
30
31
|
import * as path$1 from "node:path";
|
|
31
32
|
import path, { join } from "node:path";
|
|
32
|
-
import
|
|
33
|
+
import fs$1, { constants, existsSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
33
34
|
import JSON5 from "json5";
|
|
34
35
|
import { execFile, execSync, spawn, spawnSync } from "node:child_process";
|
|
35
36
|
import { promisify } from "node:util";
|
|
@@ -1317,7 +1318,7 @@ function resolvePowerShellPath() {
|
|
|
1317
1318
|
const systemRoot = process.env.SystemRoot || process.env.WINDIR;
|
|
1318
1319
|
if (systemRoot) {
|
|
1319
1320
|
const candidate = path.join(systemRoot, "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
1320
|
-
if (
|
|
1321
|
+
if (fs$1.existsSync(candidate)) return candidate;
|
|
1321
1322
|
}
|
|
1322
1323
|
return "powershell.exe";
|
|
1323
1324
|
}
|
|
@@ -1355,7 +1356,7 @@ function resolveShellFromPath(name) {
|
|
|
1355
1356
|
for (const entry of entries) {
|
|
1356
1357
|
const candidate = path.join(entry, name);
|
|
1357
1358
|
try {
|
|
1358
|
-
|
|
1359
|
+
fs$1.accessSync(candidate, fs$1.constants.X_OK);
|
|
1359
1360
|
return candidate;
|
|
1360
1361
|
} catch {}
|
|
1361
1362
|
}
|
|
@@ -1528,7 +1529,7 @@ function resolveRepoRoot(params) {
|
|
|
1528
1529
|
const configured = params.config?.agents?.defaults?.repoRoot?.trim();
|
|
1529
1530
|
if (configured) try {
|
|
1530
1531
|
const resolved = path.resolve(configured);
|
|
1531
|
-
if (
|
|
1532
|
+
if (fs$1.statSync(resolved).isDirectory()) return resolved;
|
|
1532
1533
|
} catch {}
|
|
1533
1534
|
const candidates = [params.workspaceDir, params.cwd].map((value) => value?.trim()).filter(Boolean);
|
|
1534
1535
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1545,7 +1546,7 @@ function findGitRoot(startDir) {
|
|
|
1545
1546
|
for (let i = 0; i < 12; i += 1) {
|
|
1546
1547
|
const gitPath = path.join(current, ".git");
|
|
1547
1548
|
try {
|
|
1548
|
-
const stat =
|
|
1549
|
+
const stat = fs$1.statSync(gitPath);
|
|
1549
1550
|
if (stat.isDirectory() || stat.isFile()) return current;
|
|
1550
1551
|
} catch {}
|
|
1551
1552
|
const parent = path.dirname(current);
|
|
@@ -2427,7 +2428,7 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2427
2428
|
const workspaceDir = params.workspaceDir?.trim();
|
|
2428
2429
|
if (workspaceDir) {
|
|
2429
2430
|
const workspaceDocs = path.join(workspaceDir, "docs");
|
|
2430
|
-
if (
|
|
2431
|
+
if (fs$1.existsSync(workspaceDocs)) return workspaceDocs;
|
|
2431
2432
|
}
|
|
2432
2433
|
const packageRoot = await resolveAnimaPackageRoot({
|
|
2433
2434
|
cwd: params.cwd,
|
|
@@ -2436,7 +2437,18 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2436
2437
|
});
|
|
2437
2438
|
if (!packageRoot) return null;
|
|
2438
2439
|
const packageDocs = path.join(packageRoot, "docs");
|
|
2439
|
-
return
|
|
2440
|
+
return fs$1.existsSync(packageDocs) ? packageDocs : null;
|
|
2441
|
+
}
|
|
2442
|
+
|
|
2443
|
+
//#endregion
|
|
2444
|
+
//#region src/agents/runner-capabilities.ts
|
|
2445
|
+
const CAPABILITY_HINTS = {
|
|
2446
|
+
"cli-native": "Use your native CLI capabilities when needed. Do not assume external MCP-style tools exist unless they are explicitly provided.",
|
|
2447
|
+
"local-tools": "Use only the tools explicitly provided in this session. Do not assume any other external MCP-style tools exist.",
|
|
2448
|
+
disabled: "Tools are disabled in this session. Do not call tools."
|
|
2449
|
+
};
|
|
2450
|
+
function appendRunnerCapabilityPrompt(prompt, mode) {
|
|
2451
|
+
return [prompt?.trim(), CAPABILITY_HINTS[mode]].filter(Boolean).join("\n");
|
|
2440
2452
|
}
|
|
2441
2453
|
|
|
2442
2454
|
//#endregion
|
|
@@ -2508,6 +2520,18 @@ function resolveRunWorkspaceDir(params) {
|
|
|
2508
2520
|
|
|
2509
2521
|
//#endregion
|
|
2510
2522
|
//#region src/agents/anthropic-direct-runner.ts
|
|
2523
|
+
/**
|
|
2524
|
+
* Anthropic Direct API Runner
|
|
2525
|
+
*
|
|
2526
|
+
* Makes calls directly to api.anthropic.com without needing the claude CLI
|
|
2527
|
+
* binary to be installed or logged in. Works with any valid token:
|
|
2528
|
+
*
|
|
2529
|
+
* sk-ant-api01-... (Console API key)
|
|
2530
|
+
* sk-ant-oat01-... (Claude Code OAuth access token)
|
|
2531
|
+
*
|
|
2532
|
+
* This runner is automatically used when an `anthropic:default` token credential
|
|
2533
|
+
* is present in the auth store and the claude CLI is unavailable or not logged in.
|
|
2534
|
+
*/
|
|
2511
2535
|
const log$9 = createSubsystemLogger("agent/anthropic-direct");
|
|
2512
2536
|
const MODEL_MAP$1 = {
|
|
2513
2537
|
opus: "claude-opus-4-5",
|
|
@@ -2583,7 +2607,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2583
2607
|
cwd: process.cwd(),
|
|
2584
2608
|
moduleUrl: import.meta.url
|
|
2585
2609
|
});
|
|
2586
|
-
const extraSystemPrompt =
|
|
2610
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "disabled");
|
|
2587
2611
|
const systemPrompt = buildSystemPrompt({
|
|
2588
2612
|
workspaceDir,
|
|
2589
2613
|
config: params.config,
|
|
@@ -2623,7 +2647,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2623
2647
|
"x-api-key": params.token,
|
|
2624
2648
|
"anthropic-version": "2023-06-01",
|
|
2625
2649
|
"content-type": "application/json",
|
|
2626
|
-
"user-agent": `anima/
|
|
2650
|
+
"user-agent": `anima/5.1.3 (direct-runner; ${os.platform()})`
|
|
2627
2651
|
},
|
|
2628
2652
|
body: JSON.stringify(requestBody),
|
|
2629
2653
|
signal: controller.signal
|
|
@@ -2656,7 +2680,6 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2656
2680
|
stopReason: data.stop_reason,
|
|
2657
2681
|
contentTypes: (data.content ?? []).map((b) => b.type)
|
|
2658
2682
|
});
|
|
2659
|
-
await params.onAssistantMessageStart?.();
|
|
2660
2683
|
if (outputText && params.onPartialReply) await params.onPartialReply({ text: outputText });
|
|
2661
2684
|
history.messages.push({
|
|
2662
2685
|
role: "assistant",
|
|
@@ -2914,13 +2937,20 @@ function setCodexExecModeArgs(args, mode) {
|
|
|
2914
2937
|
else nextArgs.push("--sandbox", mode);
|
|
2915
2938
|
return nextArgs;
|
|
2916
2939
|
}
|
|
2917
|
-
function
|
|
2940
|
+
function normalizeExecSecurity$2(execSecurity) {
|
|
2941
|
+
const normalized = execSecurity?.trim().toLowerCase();
|
|
2942
|
+
if (!normalized) return;
|
|
2943
|
+
if (normalized === "deny") return "deny";
|
|
2944
|
+
return "full";
|
|
2945
|
+
}
|
|
2946
|
+
function resolveManagedCodexExecMode(cfg, options) {
|
|
2947
|
+
if (normalizeExecSecurity$2(options?.execSecurity) === "deny") return "read-only";
|
|
2918
2948
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
2919
2949
|
if (workspaceAccess === "ro") return "read-only";
|
|
2920
2950
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
2921
2951
|
return CODEX_BYPASS_FLAG;
|
|
2922
2952
|
}
|
|
2923
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
2953
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
2924
2954
|
const normalized = normalizeBackendKey(provider);
|
|
2925
2955
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
2926
2956
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -2948,7 +2978,7 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
2948
2978
|
};
|
|
2949
2979
|
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
2950
2980
|
...merged,
|
|
2951
|
-
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg))
|
|
2981
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
2952
2982
|
};
|
|
2953
2983
|
const command = merged.command?.trim();
|
|
2954
2984
|
if (!command) return null;
|
|
@@ -3127,14 +3157,14 @@ async function runCliAgent(params) {
|
|
|
3127
3157
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
3128
3158
|
if (workspaceResolution.usedFallback) log$8.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
3129
3159
|
const workspaceDir = resolvedWorkspace;
|
|
3130
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
3160
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
3131
3161
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
3132
3162
|
const backend = backendResolved.config;
|
|
3133
3163
|
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
3134
3164
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
3135
3165
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
3136
3166
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
3137
|
-
const extraSystemPrompt =
|
|
3167
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
3138
3168
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
3139
3169
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
3140
3170
|
workspaceDir,
|
|
@@ -3184,13 +3214,21 @@ async function runCliAgent(params) {
|
|
|
3184
3214
|
const parsed = JSON.parse(lastLine);
|
|
3185
3215
|
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
3186
3216
|
const currentMode = effectiveCodexExecMode;
|
|
3187
|
-
if (previousMode
|
|
3217
|
+
if (!previousMode) {
|
|
3218
|
+
log$8.info("Codex execution mode is unknown for the saved session; forcing session restart.");
|
|
3219
|
+
useResume = false;
|
|
3220
|
+
isNew = true;
|
|
3221
|
+
} else if (previousMode !== currentMode) {
|
|
3188
3222
|
log$8.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
3189
3223
|
useResume = false;
|
|
3190
3224
|
isNew = true;
|
|
3191
3225
|
}
|
|
3192
3226
|
}
|
|
3193
|
-
} catch {
|
|
3227
|
+
} catch {
|
|
3228
|
+
log$8.info("Codex session transcript is unavailable; forcing session restart.");
|
|
3229
|
+
useResume = false;
|
|
3230
|
+
isNew = true;
|
|
3231
|
+
}
|
|
3194
3232
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
3195
3233
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
3196
3234
|
backend,
|
|
@@ -3306,8 +3344,9 @@ async function runCliAgent(params) {
|
|
|
3306
3344
|
if (stderr) log$8.debug(`cli stderr:\n${stderr}`);
|
|
3307
3345
|
}
|
|
3308
3346
|
if (result.code !== 0) {
|
|
3309
|
-
const
|
|
3310
|
-
const
|
|
3347
|
+
const timedOut = result.killed && result.signal === "SIGKILL";
|
|
3348
|
+
const err = timedOut ? `Request timed out after ${params.timeoutMs}ms` : stderr || stdout || "CLI failed.";
|
|
3349
|
+
const reason = timedOut ? "timeout" : classifyFailoverReason(err) ?? "unknown";
|
|
3311
3350
|
const status = resolveFailoverStatus(reason);
|
|
3312
3351
|
throw new FailoverError(err, {
|
|
3313
3352
|
reason,
|
|
@@ -4175,7 +4214,7 @@ async function getMemorySearchManager(params) {
|
|
|
4175
4214
|
if (cached) return { manager: cached };
|
|
4176
4215
|
}
|
|
4177
4216
|
try {
|
|
4178
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
4217
|
+
const { QmdMemoryManager } = await import("./qmd-manager-CpNYgSrx.js");
|
|
4179
4218
|
const primary = await QmdMemoryManager.create({
|
|
4180
4219
|
cfg: params.cfg,
|
|
4181
4220
|
agentId: params.agentId,
|
|
@@ -4187,7 +4226,7 @@ async function getMemorySearchManager(params) {
|
|
|
4187
4226
|
const wrapper = new FallbackMemoryManager({
|
|
4188
4227
|
primary,
|
|
4189
4228
|
fallbackFactory: async () => {
|
|
4190
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4229
|
+
const { MemoryIndexManager } = await import("./manager-b_aZwo00.js").then((n) => n.t);
|
|
4191
4230
|
return await MemoryIndexManager.get(params);
|
|
4192
4231
|
}
|
|
4193
4232
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -4200,7 +4239,7 @@ async function getMemorySearchManager(params) {
|
|
|
4200
4239
|
}
|
|
4201
4240
|
}
|
|
4202
4241
|
try {
|
|
4203
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4242
|
+
const { MemoryIndexManager } = await import("./manager-b_aZwo00.js").then((n) => n.t);
|
|
4204
4243
|
return { manager: await MemoryIndexManager.get(params) };
|
|
4205
4244
|
} catch (err) {
|
|
4206
4245
|
return {
|
|
@@ -5281,7 +5320,7 @@ function resolveDefaultIdentityPath() {
|
|
|
5281
5320
|
return path.join(resolveStateDir(), "identity", "device.json");
|
|
5282
5321
|
}
|
|
5283
5322
|
function ensureDir$2(filePath) {
|
|
5284
|
-
|
|
5323
|
+
fs$1.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
5285
5324
|
}
|
|
5286
5325
|
const ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
5287
5326
|
function base64UrlEncode(buf) {
|
|
@@ -5317,8 +5356,8 @@ function generateIdentity() {
|
|
|
5317
5356
|
}
|
|
5318
5357
|
function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
5319
5358
|
try {
|
|
5320
|
-
if (
|
|
5321
|
-
const raw =
|
|
5359
|
+
if (fs$1.existsSync(filePath)) {
|
|
5360
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
5322
5361
|
const parsed = JSON.parse(raw);
|
|
5323
5362
|
if (parsed?.version === 1 && typeof parsed.deviceId === "string" && typeof parsed.publicKeyPem === "string" && typeof parsed.privateKeyPem === "string") {
|
|
5324
5363
|
const derivedId = fingerprintPublicKey(parsed.publicKeyPem);
|
|
@@ -5327,9 +5366,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
5327
5366
|
...parsed,
|
|
5328
5367
|
deviceId: derivedId
|
|
5329
5368
|
};
|
|
5330
|
-
|
|
5369
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(updated, null, 2)}\n`, { mode: 384 });
|
|
5331
5370
|
try {
|
|
5332
|
-
|
|
5371
|
+
fs$1.chmodSync(filePath, 384);
|
|
5333
5372
|
} catch {}
|
|
5334
5373
|
return {
|
|
5335
5374
|
deviceId: derivedId,
|
|
@@ -5354,9 +5393,9 @@ function loadOrCreateDeviceIdentity(filePath = resolveDefaultIdentityPath()) {
|
|
|
5354
5393
|
privateKeyPem: identity.privateKeyPem,
|
|
5355
5394
|
createdAtMs: Date.now()
|
|
5356
5395
|
};
|
|
5357
|
-
|
|
5396
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(stored, null, 2)}\n`, { mode: 384 });
|
|
5358
5397
|
try {
|
|
5359
|
-
|
|
5398
|
+
fs$1.chmodSync(filePath, 384);
|
|
5360
5399
|
} catch {}
|
|
5361
5400
|
return identity;
|
|
5362
5401
|
}
|
|
@@ -5506,8 +5545,8 @@ function resolveDeviceAuthPath(env = process.env) {
|
|
|
5506
5545
|
}
|
|
5507
5546
|
function readStore(filePath) {
|
|
5508
5547
|
try {
|
|
5509
|
-
if (!
|
|
5510
|
-
const raw =
|
|
5548
|
+
if (!fs$1.existsSync(filePath)) return null;
|
|
5549
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
5511
5550
|
const parsed = JSON.parse(raw);
|
|
5512
5551
|
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
5513
5552
|
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
@@ -5517,10 +5556,10 @@ function readStore(filePath) {
|
|
|
5517
5556
|
}
|
|
5518
5557
|
}
|
|
5519
5558
|
function writeStore(filePath, store) {
|
|
5520
|
-
|
|
5521
|
-
|
|
5559
|
+
fs$1.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
5560
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
5522
5561
|
try {
|
|
5523
|
-
|
|
5562
|
+
fs$1.chmodSync(filePath, 384);
|
|
5524
5563
|
} catch {}
|
|
5525
5564
|
}
|
|
5526
5565
|
function loadDeviceAuthToken(params) {
|
|
@@ -5666,6 +5705,7 @@ const PollParamsSchema = Type.Object({
|
|
|
5666
5705
|
const AgentParamsSchema = Type.Object({
|
|
5667
5706
|
message: NonEmptyString,
|
|
5668
5707
|
agentId: Type.Optional(NonEmptyString),
|
|
5708
|
+
model: Type.Optional(Type.String()),
|
|
5669
5709
|
to: Type.Optional(Type.String()),
|
|
5670
5710
|
replyTo: Type.Optional(Type.String()),
|
|
5671
5711
|
sessionId: Type.Optional(Type.String()),
|
|
@@ -7978,7 +8018,7 @@ async function routeReply(params) {
|
|
|
7978
8018
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
7979
8019
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
7980
8020
|
try {
|
|
7981
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
8021
|
+
const { deliverOutboundPayloads } = await import("./deliver-d-CaN0uL.js").then((n) => n.n);
|
|
7982
8022
|
return {
|
|
7983
8023
|
ok: true,
|
|
7984
8024
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -8212,7 +8252,7 @@ function normalizeSessionKey(value) {
|
|
|
8212
8252
|
}
|
|
8213
8253
|
function readSessionStore(storePath) {
|
|
8214
8254
|
try {
|
|
8215
|
-
const raw =
|
|
8255
|
+
const raw = fs$1.readFileSync(storePath, "utf-8");
|
|
8216
8256
|
const parsed = JSON5.parse(raw);
|
|
8217
8257
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
|
|
8218
8258
|
} catch {}
|
|
@@ -11574,7 +11614,7 @@ async function loadModelCatalog(params) {
|
|
|
11574
11614
|
});
|
|
11575
11615
|
try {
|
|
11576
11616
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
11577
|
-
await (await import("./pi-auth-json-
|
|
11617
|
+
await (await import("./pi-auth-json-BmdBnmlZ.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
11578
11618
|
const piSdk = await importPiSdk();
|
|
11579
11619
|
const agentDir = resolveAnimaAgentDir();
|
|
11580
11620
|
const { join } = await import("node:path");
|
|
@@ -13334,8 +13374,8 @@ const resolveProfileOverride = (params) => {
|
|
|
13334
13374
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
13335
13375
|
const PROVIDER_RANK = new Map([
|
|
13336
13376
|
"anthropic",
|
|
13337
|
-
"openai",
|
|
13338
13377
|
"openai-codex",
|
|
13378
|
+
"openai",
|
|
13339
13379
|
"minimax",
|
|
13340
13380
|
"synthetic",
|
|
13341
13381
|
"google",
|
|
@@ -13671,7 +13711,7 @@ async function createModelSelectionState(params) {
|
|
|
13671
13711
|
}
|
|
13672
13712
|
}
|
|
13673
13713
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
13674
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
13714
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-DtWUl1-k.js").then((n) => n.t);
|
|
13675
13715
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
13676
13716
|
const providerKey = normalizeProviderId(provider);
|
|
13677
13717
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -14733,25 +14773,6 @@ function ensureSkillsWatcher(params) {
|
|
|
14733
14773
|
watchers.set(workspaceDir, state);
|
|
14734
14774
|
}
|
|
14735
14775
|
|
|
14736
|
-
//#endregion
|
|
14737
|
-
//#region src/infra/pairing-files.ts
|
|
14738
|
-
function createAsyncLock() {
|
|
14739
|
-
let lock = Promise.resolve();
|
|
14740
|
-
return async function withLock(fn) {
|
|
14741
|
-
const prev = lock;
|
|
14742
|
-
let release;
|
|
14743
|
-
lock = new Promise((resolve) => {
|
|
14744
|
-
release = resolve;
|
|
14745
|
-
});
|
|
14746
|
-
await prev;
|
|
14747
|
-
try {
|
|
14748
|
-
return await fn();
|
|
14749
|
-
} finally {
|
|
14750
|
-
release?.();
|
|
14751
|
-
}
|
|
14752
|
-
};
|
|
14753
|
-
}
|
|
14754
|
-
|
|
14755
14776
|
//#endregion
|
|
14756
14777
|
//#region src/infra/node-pairing.ts
|
|
14757
14778
|
const PENDING_TTL_MS = 300 * 1e3;
|
|
@@ -14815,8 +14836,8 @@ function listSkillCommandsForAgents(params) {
|
|
|
14815
14836
|
const visitedDirs = /* @__PURE__ */ new Set();
|
|
14816
14837
|
for (const agentId of agentIds) {
|
|
14817
14838
|
const workspaceDir = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
14818
|
-
if (!
|
|
14819
|
-
const canonicalDir =
|
|
14839
|
+
if (!fs$1.existsSync(workspaceDir)) continue;
|
|
14840
|
+
const canonicalDir = fs$1.realpathSync(workspaceDir);
|
|
14820
14841
|
if (visitedDirs.has(canonicalDir)) continue;
|
|
14821
14842
|
visitedDirs.add(canonicalDir);
|
|
14822
14843
|
const commands = buildWorkspaceSkillCommandSpecs(workspaceDir, {
|
|
@@ -15087,7 +15108,7 @@ function resolveAllowFromPath(channel, env = process.env) {
|
|
|
15087
15108
|
}
|
|
15088
15109
|
async function readJsonFile(filePath, fallback) {
|
|
15089
15110
|
try {
|
|
15090
|
-
const parsed = safeParseJson(await
|
|
15111
|
+
const parsed = safeParseJson(await fs$1.promises.readFile(filePath, "utf-8"));
|
|
15091
15112
|
if (parsed == null) return {
|
|
15092
15113
|
value: fallback,
|
|
15093
15114
|
exists: true
|
|
@@ -15109,18 +15130,18 @@ async function readJsonFile(filePath, fallback) {
|
|
|
15109
15130
|
}
|
|
15110
15131
|
async function writeJsonFile(filePath, value) {
|
|
15111
15132
|
const dir = path.dirname(filePath);
|
|
15112
|
-
await
|
|
15133
|
+
await fs$1.promises.mkdir(dir, {
|
|
15113
15134
|
recursive: true,
|
|
15114
15135
|
mode: 448
|
|
15115
15136
|
});
|
|
15116
15137
|
const tmp = path.join(dir, `${path.basename(filePath)}.${crypto.randomUUID()}.tmp`);
|
|
15117
|
-
await
|
|
15118
|
-
await
|
|
15119
|
-
await
|
|
15138
|
+
await fs$1.promises.writeFile(tmp, `${JSON.stringify(value, null, 2)}\n`, { encoding: "utf-8" });
|
|
15139
|
+
await fs$1.promises.chmod(tmp, 384);
|
|
15140
|
+
await fs$1.promises.rename(tmp, filePath);
|
|
15120
15141
|
}
|
|
15121
15142
|
async function ensureJsonFile(filePath, fallback) {
|
|
15122
15143
|
try {
|
|
15123
|
-
await
|
|
15144
|
+
await fs$1.promises.access(filePath);
|
|
15124
15145
|
} catch {
|
|
15125
15146
|
await writeJsonFile(filePath, fallback);
|
|
15126
15147
|
}
|
|
@@ -16163,8 +16184,8 @@ function expandHome$1(value) {
|
|
|
16163
16184
|
}
|
|
16164
16185
|
function isExecutableFile(filePath) {
|
|
16165
16186
|
try {
|
|
16166
|
-
if (!
|
|
16167
|
-
if (process.platform !== "win32")
|
|
16187
|
+
if (!fs$1.statSync(filePath).isFile()) return false;
|
|
16188
|
+
if (process.platform !== "win32") fs$1.accessSync(filePath, fs$1.constants.X_OK);
|
|
16168
16189
|
return true;
|
|
16169
16190
|
} catch {
|
|
16170
16191
|
return false;
|
|
@@ -16202,7 +16223,7 @@ function normalizeMatchTarget(value) {
|
|
|
16202
16223
|
}
|
|
16203
16224
|
function tryRealpath(value) {
|
|
16204
16225
|
try {
|
|
16205
|
-
return
|
|
16226
|
+
return fs$1.realpathSync(value);
|
|
16206
16227
|
} catch {
|
|
16207
16228
|
return null;
|
|
16208
16229
|
}
|
|
@@ -16840,7 +16861,7 @@ function isPathLikeToken(value) {
|
|
|
16840
16861
|
}
|
|
16841
16862
|
function defaultFileExists(filePath) {
|
|
16842
16863
|
try {
|
|
16843
|
-
return
|
|
16864
|
+
return fs$1.existsSync(filePath);
|
|
16844
16865
|
} catch {
|
|
16845
16866
|
return false;
|
|
16846
16867
|
}
|
|
@@ -17084,7 +17105,7 @@ function mergeLegacyAgent(current, legacy) {
|
|
|
17084
17105
|
}
|
|
17085
17106
|
function ensureDir$1(filePath) {
|
|
17086
17107
|
const dir = path.dirname(filePath);
|
|
17087
|
-
|
|
17108
|
+
fs$1.mkdirSync(dir, { recursive: true });
|
|
17088
17109
|
}
|
|
17089
17110
|
function coerceAllowlistEntries(allowlist) {
|
|
17090
17111
|
if (!Array.isArray(allowlist) || allowlist.length === 0) return Array.isArray(allowlist) ? allowlist : void 0;
|
|
@@ -17154,11 +17175,11 @@ function generateToken() {
|
|
|
17154
17175
|
function loadExecApprovals() {
|
|
17155
17176
|
const filePath = resolveExecApprovalsPath();
|
|
17156
17177
|
try {
|
|
17157
|
-
if (!
|
|
17178
|
+
if (!fs$1.existsSync(filePath)) return normalizeExecApprovals({
|
|
17158
17179
|
version: 1,
|
|
17159
17180
|
agents: {}
|
|
17160
17181
|
});
|
|
17161
|
-
const raw =
|
|
17182
|
+
const raw = fs$1.readFileSync(filePath, "utf8");
|
|
17162
17183
|
const parsed = JSON.parse(raw);
|
|
17163
17184
|
if (parsed?.version !== 1) return normalizeExecApprovals({
|
|
17164
17185
|
version: 1,
|
|
@@ -17175,9 +17196,9 @@ function loadExecApprovals() {
|
|
|
17175
17196
|
function saveExecApprovals(file) {
|
|
17176
17197
|
const filePath = resolveExecApprovalsPath();
|
|
17177
17198
|
ensureDir$1(filePath);
|
|
17178
|
-
|
|
17199
|
+
fs$1.writeFileSync(filePath, `${JSON.stringify(file, null, 2)}\n`, { mode: 384 });
|
|
17179
17200
|
try {
|
|
17180
|
-
|
|
17201
|
+
fs$1.chmodSync(filePath, 384);
|
|
17181
17202
|
} catch {}
|
|
17182
17203
|
}
|
|
17183
17204
|
function ensureExecApprovals() {
|
|
@@ -19771,10 +19792,10 @@ const resolveGitHead = (startDir) => {
|
|
|
19771
19792
|
for (let i = 0; i < 12; i += 1) {
|
|
19772
19793
|
const gitPath = path.join(current, ".git");
|
|
19773
19794
|
try {
|
|
19774
|
-
const stat =
|
|
19795
|
+
const stat = fs$1.statSync(gitPath);
|
|
19775
19796
|
if (stat.isDirectory()) return path.join(gitPath, "HEAD");
|
|
19776
19797
|
if (stat.isFile()) {
|
|
19777
|
-
const match =
|
|
19798
|
+
const match = fs$1.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
19778
19799
|
if (match?.[1]) {
|
|
19779
19800
|
const resolved = path.resolve(current, match[1].trim());
|
|
19780
19801
|
return path.join(resolved, "HEAD");
|
|
@@ -19832,7 +19853,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
19832
19853
|
cachedCommit = null;
|
|
19833
19854
|
return cachedCommit;
|
|
19834
19855
|
}
|
|
19835
|
-
const head =
|
|
19856
|
+
const head = fs$1.readFileSync(headPath, "utf-8").trim();
|
|
19836
19857
|
if (!head) {
|
|
19837
19858
|
cachedCommit = null;
|
|
19838
19859
|
return cachedCommit;
|
|
@@ -19840,7 +19861,7 @@ const resolveCommitHash = (options = {}) => {
|
|
|
19840
19861
|
if (head.startsWith("ref:")) {
|
|
19841
19862
|
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
19842
19863
|
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
19843
|
-
cachedCommit = formatCommit(
|
|
19864
|
+
cachedCommit = formatCommit(fs$1.readFileSync(refPath, "utf-8").trim());
|
|
19844
19865
|
return cachedCommit;
|
|
19845
19866
|
}
|
|
19846
19867
|
cachedCommit = formatCommit(head);
|
|
@@ -19945,9 +19966,9 @@ const readUsageFromSessionLog = (sessionId, sessionEntry, agentId, sessionKey, s
|
|
|
19945
19966
|
} catch {
|
|
19946
19967
|
return;
|
|
19947
19968
|
}
|
|
19948
|
-
if (!
|
|
19969
|
+
if (!fs$1.existsSync(logPath)) return;
|
|
19949
19970
|
try {
|
|
19950
|
-
const lines =
|
|
19971
|
+
const lines = fs$1.readFileSync(logPath, "utf-8").split(/\n+/);
|
|
19951
19972
|
let input = 0;
|
|
19952
19973
|
let output = 0;
|
|
19953
19974
|
let promptTokens = 0;
|
|
@@ -21476,7 +21497,7 @@ function defaultStore() {
|
|
|
21476
21497
|
function loadProviderStore() {
|
|
21477
21498
|
const storePath = resolveStorePath();
|
|
21478
21499
|
try {
|
|
21479
|
-
const raw =
|
|
21500
|
+
const raw = fs$1.readFileSync(storePath, "utf-8");
|
|
21480
21501
|
const parsed = JSON.parse(raw);
|
|
21481
21502
|
return {
|
|
21482
21503
|
providers: Array.isArray(parsed.providers) ? parsed.providers : [],
|
|
@@ -21522,8 +21543,8 @@ function resolveZaiApiKey() {
|
|
|
21522
21543
|
}
|
|
21523
21544
|
try {
|
|
21524
21545
|
const authPath = path.join(os.homedir(), ".pi", "agent", "auth.json");
|
|
21525
|
-
if (!
|
|
21526
|
-
const data = JSON.parse(
|
|
21546
|
+
if (!fs$1.existsSync(authPath)) return;
|
|
21547
|
+
const data = JSON.parse(fs$1.readFileSync(authPath, "utf-8"));
|
|
21527
21548
|
return data["z-ai"]?.access || data.zai?.access;
|
|
21528
21549
|
} catch {
|
|
21529
21550
|
return;
|
|
@@ -23244,7 +23265,7 @@ const applyCostTotal = (totals, costTotal) => {
|
|
|
23244
23265
|
totals.totalCost += costTotal;
|
|
23245
23266
|
};
|
|
23246
23267
|
async function scanTranscriptFile(params) {
|
|
23247
|
-
const fileStream =
|
|
23268
|
+
const fileStream = fs$1.createReadStream(params.filePath, { encoding: "utf-8" });
|
|
23248
23269
|
const rl = readline.createInterface({
|
|
23249
23270
|
input: fileStream,
|
|
23250
23271
|
crlfDelay: Infinity
|
|
@@ -23304,10 +23325,10 @@ async function loadCostUsageSummary(params) {
|
|
|
23304
23325
|
const dailyMap = /* @__PURE__ */ new Map();
|
|
23305
23326
|
const totals = emptyTotals();
|
|
23306
23327
|
const sessionsDir = resolveSessionTranscriptsDirForAgent(params?.agentId);
|
|
23307
|
-
const entries = await
|
|
23328
|
+
const entries = await fs$1.promises.readdir(sessionsDir, { withFileTypes: true }).catch(() => []);
|
|
23308
23329
|
const files = (await Promise.all(entries.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl")).map(async (entry) => {
|
|
23309
23330
|
const filePath = path.join(sessionsDir, entry.name);
|
|
23310
|
-
const stats = await
|
|
23331
|
+
const stats = await fs$1.promises.stat(filePath).catch(() => null);
|
|
23311
23332
|
if (!stats) return null;
|
|
23312
23333
|
if (stats.mtimeMs < sinceTime) return null;
|
|
23313
23334
|
return filePath;
|
|
@@ -23340,7 +23361,7 @@ async function loadCostUsageSummary(params) {
|
|
|
23340
23361
|
}
|
|
23341
23362
|
async function loadSessionCostSummary(params) {
|
|
23342
23363
|
const sessionFile = params.sessionFile ?? (params.sessionId ? resolveSessionFilePath(params.sessionId, params.sessionEntry, { agentId: params.agentId }) : void 0);
|
|
23343
|
-
if (!sessionFile || !
|
|
23364
|
+
if (!sessionFile || !fs$1.existsSync(sessionFile)) return null;
|
|
23344
23365
|
const totals = emptyTotals();
|
|
23345
23366
|
let firstActivity;
|
|
23346
23367
|
let lastActivity;
|
|
@@ -26924,7 +26945,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
26924
26945
|
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}`);
|
|
26925
26946
|
const body = res.body;
|
|
26926
26947
|
if (!body) throw new Error(`failed to download ${url}: empty response body`);
|
|
26927
|
-
const fileHandle = await fs$
|
|
26948
|
+
const fileHandle = await fs$2.open(filePath, "w");
|
|
26928
26949
|
let bytes = 0;
|
|
26929
26950
|
let thrown;
|
|
26930
26951
|
try {
|
|
@@ -26943,7 +26964,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
26943
26964
|
await fileHandle.close();
|
|
26944
26965
|
}
|
|
26945
26966
|
if (thrown) {
|
|
26946
|
-
await fs$
|
|
26967
|
+
await fs$2.unlink(filePath).catch(() => {});
|
|
26947
26968
|
throw thrown;
|
|
26948
26969
|
}
|
|
26949
26970
|
return {
|
|
@@ -26953,7 +26974,7 @@ async function writeUrlToFile(filePath, url) {
|
|
|
26953
26974
|
}
|
|
26954
26975
|
async function writeBase64ToFile(filePath, base64) {
|
|
26955
26976
|
const buf = Buffer.from(base64, "base64");
|
|
26956
|
-
await fs$
|
|
26977
|
+
await fs$2.writeFile(filePath, buf);
|
|
26957
26978
|
return {
|
|
26958
26979
|
path: filePath,
|
|
26959
26980
|
bytes: buf.length
|
|
@@ -27882,6 +27903,263 @@ function createGatewayTool(opts) {
|
|
|
27882
27903
|
};
|
|
27883
27904
|
}
|
|
27884
27905
|
|
|
27906
|
+
//#endregion
|
|
27907
|
+
//#region src/agents/model-auto.ts
|
|
27908
|
+
const DEFAULT_USAGE_THRESHOLD_PERCENT = 5;
|
|
27909
|
+
const USAGE_CACHE_TTL_MS = 6e4;
|
|
27910
|
+
const USAGE_TIMEOUT_MS = 1500;
|
|
27911
|
+
const usageSummaryCache = /* @__PURE__ */ new Map();
|
|
27912
|
+
function resolveRawAutoConfig(cfg) {
|
|
27913
|
+
const modelConfig = cfg?.agents?.defaults?.model;
|
|
27914
|
+
if (typeof modelConfig !== "object" || !modelConfig) return;
|
|
27915
|
+
return modelConfig.auto;
|
|
27916
|
+
}
|
|
27917
|
+
function dedupeProviders(values) {
|
|
27918
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27919
|
+
const result = [];
|
|
27920
|
+
for (const input of values) {
|
|
27921
|
+
if (!input) continue;
|
|
27922
|
+
const normalized = normalizeProviderId(input);
|
|
27923
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
27924
|
+
seen.add(normalized);
|
|
27925
|
+
result.push(normalized);
|
|
27926
|
+
}
|
|
27927
|
+
return result;
|
|
27928
|
+
}
|
|
27929
|
+
function resolveModelAutoConfig(cfg) {
|
|
27930
|
+
const raw = resolveRawAutoConfig(cfg);
|
|
27931
|
+
if (!raw?.enabled) return null;
|
|
27932
|
+
const byProvider = {};
|
|
27933
|
+
for (const [providerRaw, entry] of Object.entries(raw.byProvider ?? {})) {
|
|
27934
|
+
const provider = normalizeProviderId(providerRaw);
|
|
27935
|
+
if (!provider) continue;
|
|
27936
|
+
const models = Array.isArray(entry?.models) ? entry.models.map((value) => String(value ?? "").trim()).filter(Boolean) : [];
|
|
27937
|
+
if (models.length > 0) byProvider[provider] = { models };
|
|
27938
|
+
}
|
|
27939
|
+
const usageThresholdPercent = typeof raw.usageThresholdPercent === "number" && Number.isFinite(raw.usageThresholdPercent) ? Math.max(0, Math.min(100, raw.usageThresholdPercent)) : DEFAULT_USAGE_THRESHOLD_PERCENT;
|
|
27940
|
+
return {
|
|
27941
|
+
enabled: true,
|
|
27942
|
+
providerOrder: dedupeProviders(raw.providerOrder ?? []),
|
|
27943
|
+
byProvider,
|
|
27944
|
+
byWorkingMode: {
|
|
27945
|
+
read: Array.isArray(raw.byWorkingMode?.read) ? raw.byWorkingMode.read.map((value) => String(value ?? "").trim()).filter(Boolean) : [],
|
|
27946
|
+
write: Array.isArray(raw.byWorkingMode?.write) ? raw.byWorkingMode.write.map((value) => String(value ?? "").trim()).filter(Boolean) : []
|
|
27947
|
+
},
|
|
27948
|
+
usageCheck: raw.usageCheck === "prefer-available" ? "prefer-available" : "off",
|
|
27949
|
+
usageThresholdPercent
|
|
27950
|
+
};
|
|
27951
|
+
}
|
|
27952
|
+
function buildCandidatesFromRawModels(params) {
|
|
27953
|
+
const defaultProvider = params.defaultProvider ?? DEFAULT_PROVIDER;
|
|
27954
|
+
const index = buildModelAliasIndex({
|
|
27955
|
+
cfg: params.cfg ?? {},
|
|
27956
|
+
defaultProvider
|
|
27957
|
+
});
|
|
27958
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27959
|
+
const out = [];
|
|
27960
|
+
for (const raw of params.rawModels) {
|
|
27961
|
+
const resolved = resolveModelRefFromString({
|
|
27962
|
+
raw,
|
|
27963
|
+
defaultProvider,
|
|
27964
|
+
aliasIndex: index
|
|
27965
|
+
});
|
|
27966
|
+
if (!resolved) continue;
|
|
27967
|
+
const key = modelKey(resolved.ref.provider, resolved.ref.model);
|
|
27968
|
+
if (seen.has(key)) continue;
|
|
27969
|
+
seen.add(key);
|
|
27970
|
+
out.push(resolved.ref);
|
|
27971
|
+
}
|
|
27972
|
+
return out;
|
|
27973
|
+
}
|
|
27974
|
+
async function loadUsageSummary(agentDir, providers) {
|
|
27975
|
+
const key = `${agentDir ?? "main"}::${providers.slice().toSorted().join(",")}`;
|
|
27976
|
+
const now = Date.now();
|
|
27977
|
+
const cached = usageSummaryCache.get(key);
|
|
27978
|
+
if (cached && cached.expiresAt > now) return cached.summary;
|
|
27979
|
+
const summary = await loadProviderUsageSummary({
|
|
27980
|
+
agentDir,
|
|
27981
|
+
providers,
|
|
27982
|
+
timeoutMs: USAGE_TIMEOUT_MS
|
|
27983
|
+
});
|
|
27984
|
+
usageSummaryCache.set(key, {
|
|
27985
|
+
expiresAt: now + USAGE_CACHE_TTL_MS,
|
|
27986
|
+
summary
|
|
27987
|
+
});
|
|
27988
|
+
return summary;
|
|
27989
|
+
}
|
|
27990
|
+
function remainingPercent(snapshot) {
|
|
27991
|
+
if (snapshot.error || snapshot.windows.length === 0) return;
|
|
27992
|
+
const values = snapshot.windows.map((window) => 100 - window.usedPercent).filter((value) => Number.isFinite(value));
|
|
27993
|
+
if (values.length === 0) return;
|
|
27994
|
+
return Math.max(0, Math.min(...values));
|
|
27995
|
+
}
|
|
27996
|
+
async function resolveAvailability(params) {
|
|
27997
|
+
const availability = /* @__PURE__ */ new Map();
|
|
27998
|
+
const usageProviders = Array.from(new Set(params.providerOrder.map((provider) => resolveUsageProviderId(provider)).filter((provider) => Boolean(provider))));
|
|
27999
|
+
let summary;
|
|
28000
|
+
if (usageProviders.length > 0) try {
|
|
28001
|
+
summary = await loadUsageSummary(params.agentDir, usageProviders);
|
|
28002
|
+
} catch {
|
|
28003
|
+
summary = void 0;
|
|
28004
|
+
}
|
|
28005
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
28006
|
+
for (const entry of summary?.providers ?? []) snapshots.set(entry.provider, entry);
|
|
28007
|
+
for (const provider of params.providerOrder) {
|
|
28008
|
+
const usageProvider = resolveUsageProviderId(provider);
|
|
28009
|
+
if (!usageProvider) {
|
|
28010
|
+
availability.set(provider, {
|
|
28011
|
+
provider,
|
|
28012
|
+
state: "unknown"
|
|
28013
|
+
});
|
|
28014
|
+
continue;
|
|
28015
|
+
}
|
|
28016
|
+
const snapshot = snapshots.get(usageProvider);
|
|
28017
|
+
const percent = snapshot ? remainingPercent(snapshot) : void 0;
|
|
28018
|
+
availability.set(provider, {
|
|
28019
|
+
provider,
|
|
28020
|
+
usageProvider,
|
|
28021
|
+
remainingPercent: percent,
|
|
28022
|
+
state: percent === void 0 ? "unknown" : percent <= params.autoConfig.usageThresholdPercent ? "exhausted" : "available"
|
|
28023
|
+
});
|
|
28024
|
+
}
|
|
28025
|
+
return availability;
|
|
28026
|
+
}
|
|
28027
|
+
function reorderByAvailability(params) {
|
|
28028
|
+
const lockedPrimary = params.preservePrimary ? params.candidates[0] : void 0;
|
|
28029
|
+
const rest = params.preservePrimary ? params.candidates.slice(1) : params.candidates;
|
|
28030
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
28031
|
+
for (const candidate of rest) {
|
|
28032
|
+
const normalized = normalizeProviderId(candidate.provider);
|
|
28033
|
+
const group = grouped.get(normalized) ?? [];
|
|
28034
|
+
group.push({
|
|
28035
|
+
provider: normalized,
|
|
28036
|
+
model: candidate.model
|
|
28037
|
+
});
|
|
28038
|
+
grouped.set(normalized, group);
|
|
28039
|
+
}
|
|
28040
|
+
const order = [];
|
|
28041
|
+
for (const [provider, availability] of params.availability) if (availability.state === "available") order.push(provider);
|
|
28042
|
+
for (const [provider, availability] of params.availability) if (availability.state === "unknown") order.push(provider);
|
|
28043
|
+
for (const [provider, availability] of params.availability) if (availability.state === "exhausted") order.push(provider);
|
|
28044
|
+
for (const provider of grouped.keys()) if (!order.includes(provider)) order.push(provider);
|
|
28045
|
+
const ordered = [];
|
|
28046
|
+
for (const provider of order) {
|
|
28047
|
+
const group = grouped.get(provider) ?? [];
|
|
28048
|
+
ordered.push(...group);
|
|
28049
|
+
}
|
|
28050
|
+
return lockedPrimary ? [lockedPrimary, ...ordered] : ordered;
|
|
28051
|
+
}
|
|
28052
|
+
async function applyAutoModelRouting(params) {
|
|
28053
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
28054
|
+
if (!autoConfig) return {
|
|
28055
|
+
candidates: [...params.candidates],
|
|
28056
|
+
autoConfigured: false,
|
|
28057
|
+
preserveProviderOrder: false,
|
|
28058
|
+
availabilityByProvider: /* @__PURE__ */ new Map()
|
|
28059
|
+
};
|
|
28060
|
+
const providerOrder = dedupeProviders([...autoConfig.providerOrder, ...params.candidates.map((candidate) => candidate.provider)]);
|
|
28061
|
+
let candidates = [...params.candidates];
|
|
28062
|
+
const modePreferred = params.workingMode ? buildCandidatesFromRawModels({
|
|
28063
|
+
rawModels: autoConfig.byWorkingMode[params.workingMode] ?? [],
|
|
28064
|
+
cfg: params.cfg,
|
|
28065
|
+
defaultProvider: params.candidates[0]?.provider ?? DEFAULT_PROVIDER
|
|
28066
|
+
}) : [];
|
|
28067
|
+
if (modePreferred.length > 0) {
|
|
28068
|
+
const lockedPrimary = params.preservePrimary && candidates.length > 0 ? [candidates[0]] : [];
|
|
28069
|
+
const remainingCandidates = params.preservePrimary ? candidates.slice(1) : candidates;
|
|
28070
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28071
|
+
candidates = [
|
|
28072
|
+
...lockedPrimary,
|
|
28073
|
+
...modePreferred,
|
|
28074
|
+
...remainingCandidates
|
|
28075
|
+
].filter((candidate) => {
|
|
28076
|
+
const key = modelKey(candidate.provider, candidate.model);
|
|
28077
|
+
if (seen.has(key)) return false;
|
|
28078
|
+
seen.add(key);
|
|
28079
|
+
return true;
|
|
28080
|
+
});
|
|
28081
|
+
}
|
|
28082
|
+
const availability = await resolveAvailability({
|
|
28083
|
+
providerOrder,
|
|
28084
|
+
agentDir: params.agentDir,
|
|
28085
|
+
autoConfig
|
|
28086
|
+
});
|
|
28087
|
+
if (autoConfig.usageCheck === "prefer-available") candidates = reorderByAvailability({
|
|
28088
|
+
candidates,
|
|
28089
|
+
availability,
|
|
28090
|
+
preservePrimary: params.preservePrimary
|
|
28091
|
+
});
|
|
28092
|
+
return {
|
|
28093
|
+
candidates,
|
|
28094
|
+
autoConfigured: true,
|
|
28095
|
+
preserveProviderOrder: true,
|
|
28096
|
+
config: autoConfig,
|
|
28097
|
+
availabilityByProvider: availability
|
|
28098
|
+
};
|
|
28099
|
+
}
|
|
28100
|
+
|
|
28101
|
+
//#endregion
|
|
28102
|
+
//#region src/agents/model-preference.ts
|
|
28103
|
+
const HIGH_THINK_LEVELS = new Set(["high", "xhigh"]);
|
|
28104
|
+
const SESSION_COST_THRESHOLD_USD = .5;
|
|
28105
|
+
const SESSION_TOKEN_THRESHOLD = 3e5;
|
|
28106
|
+
const SESSION_TURN_THRESHOLD = 12;
|
|
28107
|
+
const SESSION_COMPACTION_THRESHOLD = 2;
|
|
28108
|
+
function toPositiveFiniteNumber(value) {
|
|
28109
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
28110
|
+
return value;
|
|
28111
|
+
}
|
|
28112
|
+
function shouldPreferCheap(entry) {
|
|
28113
|
+
if (!entry) return false;
|
|
28114
|
+
const sessionCostUsd = toPositiveFiniteNumber(entry.sessionEstimatedCostUsdTotal) ?? 0;
|
|
28115
|
+
const sessionInputTokens = toPositiveFiniteNumber(entry.sessionInputTokensTotal) ?? 0;
|
|
28116
|
+
const sessionOutputTokens = toPositiveFiniteNumber(entry.sessionOutputTokensTotal) ?? 0;
|
|
28117
|
+
const sessionTurnCount = toPositiveFiniteNumber(entry.sessionTurnCount) ?? 0;
|
|
28118
|
+
const compactionCount = toPositiveFiniteNumber(entry.compactionCount) ?? 0;
|
|
28119
|
+
return sessionCostUsd >= SESSION_COST_THRESHOLD_USD || sessionInputTokens + sessionOutputTokens >= SESSION_TOKEN_THRESHOLD || sessionTurnCount >= SESSION_TURN_THRESHOLD || compactionCount >= SESSION_COMPACTION_THRESHOLD;
|
|
28120
|
+
}
|
|
28121
|
+
function resolveCandidateCostScore(candidate, cfg) {
|
|
28122
|
+
const cost = resolveModelCostConfig({
|
|
28123
|
+
provider: candidate.provider,
|
|
28124
|
+
model: candidate.model,
|
|
28125
|
+
config: cfg
|
|
28126
|
+
});
|
|
28127
|
+
if (!cost) return;
|
|
28128
|
+
const values = [
|
|
28129
|
+
cost.input,
|
|
28130
|
+
cost.output,
|
|
28131
|
+
cost.cacheRead,
|
|
28132
|
+
cost.cacheWrite
|
|
28133
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
28134
|
+
if (values.length === 0) return;
|
|
28135
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
28136
|
+
}
|
|
28137
|
+
function resolveUsageAwareModelPreference(params) {
|
|
28138
|
+
if (params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride) return "preserve";
|
|
28139
|
+
if (params.thinkLevel && HIGH_THINK_LEVELS.has(params.thinkLevel)) return "prefer-strong";
|
|
28140
|
+
if (shouldPreferCheap(params.sessionEntry)) return "prefer-cheap";
|
|
28141
|
+
return "preserve";
|
|
28142
|
+
}
|
|
28143
|
+
function orderCandidatesByPreference(params) {
|
|
28144
|
+
const preferenceMode = params.preferenceMode ?? "preserve";
|
|
28145
|
+
if (preferenceMode === "preserve" || params.candidates.length <= 1) return [...params.candidates];
|
|
28146
|
+
const scoredCandidates = params.candidates.map((candidate) => ({
|
|
28147
|
+
candidate,
|
|
28148
|
+
score: resolveCandidateCostScore(candidate, params.cfg)
|
|
28149
|
+
}));
|
|
28150
|
+
const sortable = scoredCandidates.filter((entry) => entry.score !== void 0);
|
|
28151
|
+
if (sortable.length < 2) return [...params.candidates];
|
|
28152
|
+
sortable.sort((left, right) => preferenceMode === "prefer-cheap" ? left.score - right.score : right.score - left.score);
|
|
28153
|
+
const reordered = sortable.map((entry) => entry.candidate);
|
|
28154
|
+
let reorderedIndex = 0;
|
|
28155
|
+
return scoredCandidates.map((entry) => {
|
|
28156
|
+
if (entry.score === void 0) return entry.candidate;
|
|
28157
|
+
const next = reordered[reorderedIndex];
|
|
28158
|
+
reorderedIndex += 1;
|
|
28159
|
+
return next;
|
|
28160
|
+
});
|
|
28161
|
+
}
|
|
28162
|
+
|
|
27885
28163
|
//#endregion
|
|
27886
28164
|
//#region src/agents/model-fallback.ts
|
|
27887
28165
|
/**
|
|
@@ -27983,12 +28261,32 @@ function resolveFallbackCandidates(params) {
|
|
|
27983
28261
|
}, false);
|
|
27984
28262
|
return candidates;
|
|
27985
28263
|
}
|
|
28264
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
28265
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
28266
|
+
if (!execSecurity) return;
|
|
28267
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
28268
|
+
}
|
|
27986
28269
|
async function runWithModelFallback(params) {
|
|
27987
|
-
const
|
|
28270
|
+
const preservePrimary = Boolean(params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride);
|
|
28271
|
+
const resolvedWorkingMode = params.workingMode ?? resolveWorkingModeFromSessionEntry(params.sessionEntry);
|
|
28272
|
+
const candidates = orderCandidatesByPreference({
|
|
28273
|
+
candidates: (await applyAutoModelRouting({
|
|
28274
|
+
candidates: resolveFallbackCandidates({
|
|
28275
|
+
cfg: params.cfg,
|
|
28276
|
+
provider: params.provider,
|
|
28277
|
+
model: params.model,
|
|
28278
|
+
fallbacksOverride: params.fallbacksOverride
|
|
28279
|
+
}),
|
|
28280
|
+
cfg: params.cfg,
|
|
28281
|
+
agentDir: params.agentDir,
|
|
28282
|
+
preservePrimary,
|
|
28283
|
+
workingMode: resolvedWorkingMode
|
|
28284
|
+
})).candidates,
|
|
27988
28285
|
cfg: params.cfg,
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
28286
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
28287
|
+
thinkLevel: params.thinkLevel,
|
|
28288
|
+
sessionEntry: params.sessionEntry
|
|
28289
|
+
})
|
|
27992
28290
|
});
|
|
27993
28291
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
27994
28292
|
const attempts = [];
|
|
@@ -29089,6 +29387,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
29089
29387
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
29090
29388
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
29091
29389
|
}
|
|
29390
|
+
function resolveConfiguredNoxsoftTarget(params) {
|
|
29391
|
+
const trimmed = params.input.trim();
|
|
29392
|
+
if (!trimmed) return null;
|
|
29393
|
+
const configured = params.cfg.channels?.noxsoft?.channels;
|
|
29394
|
+
if (!configured) return null;
|
|
29395
|
+
const lower = trimmed.toLowerCase();
|
|
29396
|
+
for (const [name, entry] of Object.entries(configured)) {
|
|
29397
|
+
const channelId = entry?.id?.trim();
|
|
29398
|
+
if (!channelId) continue;
|
|
29399
|
+
if (lower === name.trim().toLowerCase() || trimmed === channelId) return {
|
|
29400
|
+
to: channelId,
|
|
29401
|
+
kind: "channel",
|
|
29402
|
+
display: name,
|
|
29403
|
+
source: "normalized"
|
|
29404
|
+
};
|
|
29405
|
+
}
|
|
29406
|
+
return null;
|
|
29407
|
+
}
|
|
29092
29408
|
async function resolveMessagingTarget(params) {
|
|
29093
29409
|
const raw = normalizeChannelTargetInput(params.input);
|
|
29094
29410
|
if (!raw) return {
|
|
@@ -29100,6 +29416,16 @@ async function resolveMessagingTarget(params) {
|
|
|
29100
29416
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
29101
29417
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
29102
29418
|
const normalized = normalizeTargetForProvider(params.channel, raw) ?? raw;
|
|
29419
|
+
if (params.channel === "noxsoft") {
|
|
29420
|
+
const configuredTarget = resolveConfiguredNoxsoftTarget({
|
|
29421
|
+
cfg: params.cfg,
|
|
29422
|
+
input: raw
|
|
29423
|
+
});
|
|
29424
|
+
if (configuredTarget) return {
|
|
29425
|
+
ok: true,
|
|
29426
|
+
target: configuredTarget
|
|
29427
|
+
};
|
|
29428
|
+
}
|
|
29103
29429
|
const looksLikeTargetId = () => {
|
|
29104
29430
|
const trimmed = raw.trim();
|
|
29105
29431
|
if (!trimmed) return false;
|
|
@@ -29314,6 +29640,10 @@ function applyCrossContextDecoration(params) {
|
|
|
29314
29640
|
};
|
|
29315
29641
|
}
|
|
29316
29642
|
|
|
29643
|
+
//#endregion
|
|
29644
|
+
//#region src/auth/noxsoft-auth.ts
|
|
29645
|
+
const TOKEN_PATH = path.join(os.homedir(), ".noxsoft-agent-token");
|
|
29646
|
+
|
|
29317
29647
|
//#endregion
|
|
29318
29648
|
//#region src/infra/outbound/targets.ts
|
|
29319
29649
|
function resolveSessionDeliveryTarget(params) {
|
|
@@ -29395,13 +29725,62 @@ function resolveGatewayOptions(opts) {
|
|
|
29395
29725
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
29396
29726
|
};
|
|
29397
29727
|
}
|
|
29728
|
+
function resolveNoxsoftApiBase(cfg) {
|
|
29729
|
+
return cfg.channels?.noxsoft?.apiUrl?.trim() || "https://auth.noxsoft.net";
|
|
29730
|
+
}
|
|
29731
|
+
function resolveNoxsoftToken(cfg) {
|
|
29732
|
+
const inlineToken = cfg.channels?.noxsoft?.token?.trim();
|
|
29733
|
+
if (inlineToken) return inlineToken;
|
|
29734
|
+
const tokenFile = cfg.channels?.noxsoft?.tokenFile?.trim() || TOKEN_PATH;
|
|
29735
|
+
try {
|
|
29736
|
+
const token = fs$1.readFileSync(tokenFile, "utf-8").trim();
|
|
29737
|
+
if (token) return token;
|
|
29738
|
+
} catch {}
|
|
29739
|
+
throw new Error(`NoxSoft token not configured. Expected token in ${tokenFile}`);
|
|
29740
|
+
}
|
|
29741
|
+
async function sendNoxsoftMessageDirect(params) {
|
|
29742
|
+
if (params.dryRun) return {
|
|
29743
|
+
channel: "noxsoft",
|
|
29744
|
+
to: params.to,
|
|
29745
|
+
via: "direct",
|
|
29746
|
+
mediaUrl: params.mediaUrl,
|
|
29747
|
+
mediaUrls: params.mediaUrls,
|
|
29748
|
+
dryRun: true
|
|
29749
|
+
};
|
|
29750
|
+
const token = resolveNoxsoftToken(params.cfg);
|
|
29751
|
+
const apiBase = resolveNoxsoftApiBase(params.cfg).replace(/\/+$/, "");
|
|
29752
|
+
const response = await fetch(`${apiBase}/api/agents/chat/channels/${params.to}/messages`, {
|
|
29753
|
+
method: "POST",
|
|
29754
|
+
headers: {
|
|
29755
|
+
Authorization: `Bearer ${token}`,
|
|
29756
|
+
"Content-Type": "application/json"
|
|
29757
|
+
},
|
|
29758
|
+
body: JSON.stringify({
|
|
29759
|
+
content: params.content,
|
|
29760
|
+
mediaUrl: params.mediaUrl ?? void 0,
|
|
29761
|
+
mediaUrls: params.mediaUrls?.length ? params.mediaUrls : void 0
|
|
29762
|
+
}),
|
|
29763
|
+
signal: params.abortSignal
|
|
29764
|
+
});
|
|
29765
|
+
if (!response.ok) {
|
|
29766
|
+
const text = await response.text().catch(() => "");
|
|
29767
|
+
throw new Error(`NoxSoft send failed (${response.status}): ${text}`);
|
|
29768
|
+
}
|
|
29769
|
+
const payload = await response.json().catch(() => ({}));
|
|
29770
|
+
const messageId = payload.messageId ?? payload.id ?? `noxsoft:${Date.now()}`;
|
|
29771
|
+
return {
|
|
29772
|
+
channel: "noxsoft",
|
|
29773
|
+
to: params.to,
|
|
29774
|
+
via: "direct",
|
|
29775
|
+
mediaUrl: params.mediaUrl,
|
|
29776
|
+
mediaUrls: params.mediaUrls,
|
|
29777
|
+
result: { messageId }
|
|
29778
|
+
};
|
|
29779
|
+
}
|
|
29398
29780
|
async function sendMessage(params) {
|
|
29399
29781
|
const cfg = params.cfg ?? loadConfig();
|
|
29400
|
-
const channel = params.channel?.trim() ?
|
|
29782
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29401
29783
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29402
|
-
const plugin = getChannelPlugin(channel);
|
|
29403
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29404
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29405
29784
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
29406
29785
|
text: params.content,
|
|
29407
29786
|
mediaUrl: params.mediaUrl,
|
|
@@ -29410,6 +29789,18 @@ async function sendMessage(params) {
|
|
|
29410
29789
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
29411
29790
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
29412
29791
|
const primaryMediaUrl = mirrorMediaUrls[0] ?? params.mediaUrl ?? null;
|
|
29792
|
+
if (channel === "noxsoft") return sendNoxsoftMessageDirect({
|
|
29793
|
+
cfg,
|
|
29794
|
+
to: params.to,
|
|
29795
|
+
content: params.content,
|
|
29796
|
+
mediaUrl: primaryMediaUrl,
|
|
29797
|
+
mediaUrls: mirrorMediaUrls.length ? mirrorMediaUrls : void 0,
|
|
29798
|
+
dryRun: params.dryRun,
|
|
29799
|
+
abortSignal: params.abortSignal
|
|
29800
|
+
});
|
|
29801
|
+
const plugin = getChannelPlugin(channel);
|
|
29802
|
+
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29803
|
+
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29413
29804
|
if (params.dryRun) return {
|
|
29414
29805
|
channel,
|
|
29415
29806
|
to: params.to,
|
|
@@ -29488,7 +29879,7 @@ async function sendMessage(params) {
|
|
|
29488
29879
|
}
|
|
29489
29880
|
async function sendPoll(params) {
|
|
29490
29881
|
const cfg = params.cfg ?? loadConfig();
|
|
29491
|
-
const channel = params.channel?.trim() ?
|
|
29882
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29492
29883
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29493
29884
|
const pollInput = {
|
|
29494
29885
|
question: params.question,
|
|
@@ -31729,7 +32120,7 @@ function resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, a
|
|
|
31729
32120
|
}
|
|
31730
32121
|
function archiveFileOnDisk(filePath, reason) {
|
|
31731
32122
|
const archived = `${filePath}.${reason}.${(/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-")}`;
|
|
31732
|
-
|
|
32123
|
+
fs$1.renameSync(filePath, archived);
|
|
31733
32124
|
return archived;
|
|
31734
32125
|
}
|
|
31735
32126
|
/**
|
|
@@ -31739,7 +32130,7 @@ function archiveFileOnDisk(filePath, reason) {
|
|
|
31739
32130
|
function archiveSessionTranscripts(opts) {
|
|
31740
32131
|
const archived = [];
|
|
31741
32132
|
for (const candidate of resolveSessionTranscriptCandidates(opts.sessionId, opts.storePath, opts.sessionFile, opts.agentId)) {
|
|
31742
|
-
if (!
|
|
32133
|
+
if (!fs$1.existsSync(candidate)) continue;
|
|
31743
32134
|
try {
|
|
31744
32135
|
archived.push(archiveFileOnDisk(candidate, opts.reason));
|
|
31745
32136
|
} catch {}
|
|
@@ -31786,7 +32177,7 @@ function listExistingAgentIdsFromDisk() {
|
|
|
31786
32177
|
const root = resolveStateDir();
|
|
31787
32178
|
const agentsDir = path.join(root, "agents");
|
|
31788
32179
|
try {
|
|
31789
|
-
return
|
|
32180
|
+
return fs$1.readdirSync(agentsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => normalizeAgentId(entry.name)).filter(Boolean);
|
|
31790
32181
|
} catch {
|
|
31791
32182
|
return [];
|
|
31792
32183
|
}
|
|
@@ -36106,6 +36497,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36106
36497
|
provider: params.followupRun.run.provider,
|
|
36107
36498
|
model: params.followupRun.run.model,
|
|
36108
36499
|
agentDir: params.followupRun.run.agentDir,
|
|
36500
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
36501
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36109
36502
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36110
36503
|
run: (provider, model) => {
|
|
36111
36504
|
params.opts?.onModelSelected?.({
|
|
@@ -36113,97 +36506,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36113
36506
|
model,
|
|
36114
36507
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
36115
36508
|
});
|
|
36116
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
36117
|
-
const startedAt = Date.now();
|
|
36118
|
-
emitAgentEvent$1({
|
|
36119
|
-
runId,
|
|
36120
|
-
stream: "lifecycle",
|
|
36121
|
-
data: {
|
|
36122
|
-
phase: "start",
|
|
36123
|
-
startedAt
|
|
36124
|
-
}
|
|
36125
|
-
});
|
|
36126
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
36127
|
-
return (async () => {
|
|
36128
|
-
let lifecycleTerminalEmitted = false;
|
|
36129
|
-
let sawCliStream = false;
|
|
36130
|
-
let lastCliStreamText = "";
|
|
36131
|
-
try {
|
|
36132
|
-
const result = await runCliAgent({
|
|
36133
|
-
sessionId: params.followupRun.run.sessionId,
|
|
36134
|
-
sessionKey: params.sessionKey,
|
|
36135
|
-
agentId: params.followupRun.run.agentId,
|
|
36136
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
36137
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
36138
|
-
config: params.followupRun.run.config,
|
|
36139
|
-
prompt: params.commandBody,
|
|
36140
|
-
provider,
|
|
36141
|
-
model,
|
|
36142
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36143
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36144
|
-
runId,
|
|
36145
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
36146
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
36147
|
-
cliSessionId,
|
|
36148
|
-
images: params.opts?.images,
|
|
36149
|
-
onTextStream: (text) => {
|
|
36150
|
-
const nextText = text.trim();
|
|
36151
|
-
if (!nextText) return;
|
|
36152
|
-
sawCliStream = true;
|
|
36153
|
-
lastCliStreamText = nextText;
|
|
36154
|
-
emitAgentEvent$1({
|
|
36155
|
-
runId,
|
|
36156
|
-
stream: "assistant",
|
|
36157
|
-
data: { text: nextText }
|
|
36158
|
-
});
|
|
36159
|
-
}
|
|
36160
|
-
});
|
|
36161
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
36162
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
36163
|
-
runId,
|
|
36164
|
-
stream: "assistant",
|
|
36165
|
-
data: { text: cliText }
|
|
36166
|
-
});
|
|
36167
|
-
emitAgentEvent$1({
|
|
36168
|
-
runId,
|
|
36169
|
-
stream: "lifecycle",
|
|
36170
|
-
data: {
|
|
36171
|
-
phase: "end",
|
|
36172
|
-
startedAt,
|
|
36173
|
-
endedAt: Date.now()
|
|
36174
|
-
}
|
|
36175
|
-
});
|
|
36176
|
-
lifecycleTerminalEmitted = true;
|
|
36177
|
-
return result;
|
|
36178
|
-
} catch (err) {
|
|
36179
|
-
emitAgentEvent$1({
|
|
36180
|
-
runId,
|
|
36181
|
-
stream: "lifecycle",
|
|
36182
|
-
data: {
|
|
36183
|
-
phase: "error",
|
|
36184
|
-
startedAt,
|
|
36185
|
-
endedAt: Date.now(),
|
|
36186
|
-
error: String(err)
|
|
36187
|
-
}
|
|
36188
|
-
});
|
|
36189
|
-
lifecycleTerminalEmitted = true;
|
|
36190
|
-
throw err;
|
|
36191
|
-
} finally {
|
|
36192
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
36193
|
-
runId,
|
|
36194
|
-
stream: "lifecycle",
|
|
36195
|
-
data: {
|
|
36196
|
-
phase: "error",
|
|
36197
|
-
startedAt,
|
|
36198
|
-
endedAt: Date.now(),
|
|
36199
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
36200
|
-
}
|
|
36201
|
-
});
|
|
36202
|
-
}
|
|
36203
|
-
})();
|
|
36204
|
-
}
|
|
36205
36509
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36206
|
-
return
|
|
36510
|
+
return runNoxSoftEmbeddedAgent({
|
|
36207
36511
|
sessionId: params.followupRun.run.sessionId,
|
|
36208
36512
|
sessionKey: params.sessionKey,
|
|
36209
36513
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36240,6 +36544,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36240
36544
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36241
36545
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36242
36546
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36547
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
36548
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
36243
36549
|
toolResultFormat: (() => {
|
|
36244
36550
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
36245
36551
|
if (!channel) return "markdown";
|
|
@@ -36271,6 +36577,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36271
36577
|
});
|
|
36272
36578
|
} : void 0,
|
|
36273
36579
|
onAgentEvent: async (evt) => {
|
|
36580
|
+
emitAgentEvent$1({
|
|
36581
|
+
runId,
|
|
36582
|
+
stream: evt.stream,
|
|
36583
|
+
data: evt.data
|
|
36584
|
+
});
|
|
36274
36585
|
if (evt.stream === "tool") {
|
|
36275
36586
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
36276
36587
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -36359,7 +36670,7 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36359
36670
|
if (corruptedSessionId) {
|
|
36360
36671
|
const transcriptPath = resolveSessionTranscriptPath(corruptedSessionId);
|
|
36361
36672
|
try {
|
|
36362
|
-
|
|
36673
|
+
fs$1.unlinkSync(transcriptPath);
|
|
36363
36674
|
} catch {}
|
|
36364
36675
|
}
|
|
36365
36676
|
delete params.activeSessionStore[sessionKey];
|
|
@@ -36540,10 +36851,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36540
36851
|
provider: params.followupRun.run.provider,
|
|
36541
36852
|
model: params.followupRun.run.model,
|
|
36542
36853
|
agentDir: params.followupRun.run.agentDir,
|
|
36854
|
+
sessionEntry: params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0) ?? void 0,
|
|
36855
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36543
36856
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36544
36857
|
run: (provider, model) => {
|
|
36545
36858
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36546
|
-
return
|
|
36859
|
+
return runNoxSoftEmbeddedAgent({
|
|
36547
36860
|
sessionId: params.followupRun.run.sessionId,
|
|
36548
36861
|
sessionKey: params.sessionKey,
|
|
36549
36862
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36577,6 +36890,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36577
36890
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36578
36891
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36579
36892
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36893
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
36580
36894
|
bashElevated: params.followupRun.run.bashElevated,
|
|
36581
36895
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36582
36896
|
runId: flushRunId,
|
|
@@ -36912,10 +37226,12 @@ function createFollowupRunner(params) {
|
|
|
36912
37226
|
provider: queued.run.provider,
|
|
36913
37227
|
model: queued.run.model,
|
|
36914
37228
|
agentDir: queued.run.agentDir,
|
|
37229
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
37230
|
+
thinkLevel: queued.run.thinkLevel,
|
|
36915
37231
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
36916
37232
|
run: (provider, model) => {
|
|
36917
37233
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
36918
|
-
return
|
|
37234
|
+
return runNoxSoftEmbeddedAgent({
|
|
36919
37235
|
sessionId: queued.run.sessionId,
|
|
36920
37236
|
sessionKey: queued.run.sessionKey,
|
|
36921
37237
|
agentId: queued.run.agentId,
|
|
@@ -36946,6 +37262,7 @@ function createFollowupRunner(params) {
|
|
|
36946
37262
|
verboseLevel: queued.run.verboseLevel,
|
|
36947
37263
|
reasoningLevel: queued.run.reasoningLevel,
|
|
36948
37264
|
execOverrides: queued.run.execOverrides,
|
|
37265
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
36949
37266
|
bashElevated: queued.run.bashElevated,
|
|
36950
37267
|
timeoutMs: queued.run.timeoutMs,
|
|
36951
37268
|
runId,
|
|
@@ -37160,7 +37477,7 @@ async function runReplyAgent(params) {
|
|
|
37160
37477
|
if (resolved) transcriptCandidates.add(resolved);
|
|
37161
37478
|
transcriptCandidates.add(resolveSessionTranscriptPath(prevSessionId, agentId));
|
|
37162
37479
|
for (const candidate of transcriptCandidates) try {
|
|
37163
|
-
|
|
37480
|
+
fs$1.unlinkSync(candidate);
|
|
37164
37481
|
} catch {}
|
|
37165
37482
|
}
|
|
37166
37483
|
return true;
|
|
@@ -37926,7 +38243,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
37926
38243
|
return;
|
|
37927
38244
|
}
|
|
37928
38245
|
try {
|
|
37929
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
38246
|
+
const { deliverOutboundPayloads } = await import("./deliver-d-CaN0uL.js").then((n) => n.n);
|
|
37930
38247
|
await deliverOutboundPayloads({
|
|
37931
38248
|
cfg: params.cfg,
|
|
37932
38249
|
channel,
|
|
@@ -37948,7 +38265,7 @@ function forkSessionFromParent(params) {
|
|
|
37948
38265
|
agentId: params.agentId,
|
|
37949
38266
|
sessionsDir: params.sessionsDir
|
|
37950
38267
|
});
|
|
37951
|
-
if (!parentSessionFile || !
|
|
38268
|
+
if (!parentSessionFile || !fs$1.existsSync(parentSessionFile)) return null;
|
|
37952
38269
|
try {
|
|
37953
38270
|
const manager = SessionManager.open(parentSessionFile);
|
|
37954
38271
|
const leafId = manager.getLeafId();
|
|
@@ -37972,7 +38289,7 @@ function forkSessionFromParent(params) {
|
|
|
37972
38289
|
cwd: manager.getCwd(),
|
|
37973
38290
|
parentSession: parentSessionFile
|
|
37974
38291
|
};
|
|
37975
|
-
|
|
38292
|
+
fs$1.writeFileSync(sessionFile, `${JSON.stringify(header)}\n`, "utf-8");
|
|
37976
38293
|
return {
|
|
37977
38294
|
sessionId,
|
|
37978
38295
|
sessionFile
|
|
@@ -39355,7 +39672,7 @@ function createWhatsAppLoginTool() {
|
|
|
39355
39672
|
force: Type.Optional(Type.Boolean())
|
|
39356
39673
|
}),
|
|
39357
39674
|
execute: async (_toolCallId, args) => {
|
|
39358
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
39675
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-OUAGpDsU.js");
|
|
39359
39676
|
if ((args?.action ?? "start") === "wait") {
|
|
39360
39677
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
39361
39678
|
return {
|
|
@@ -39607,7 +39924,7 @@ function formatExtraPaths(workspaceDir, extraPaths) {
|
|
|
39607
39924
|
}
|
|
39608
39925
|
async function checkReadableFile(pathname) {
|
|
39609
39926
|
try {
|
|
39610
|
-
await fs.access(pathname,
|
|
39927
|
+
await fs.access(pathname, fs$1.constants.R_OK);
|
|
39611
39928
|
return { exists: true };
|
|
39612
39929
|
} catch (err) {
|
|
39613
39930
|
const code = err.code;
|
|
@@ -39666,7 +39983,7 @@ async function scanMemoryFiles(workspaceDir, extraPaths = []) {
|
|
|
39666
39983
|
}
|
|
39667
39984
|
let dirReadable = null;
|
|
39668
39985
|
try {
|
|
39669
|
-
await fs.access(memoryDir,
|
|
39986
|
+
await fs.access(memoryDir, fs$1.constants.R_OK);
|
|
39670
39987
|
dirReadable = true;
|
|
39671
39988
|
} catch (err) {
|
|
39672
39989
|
const code = err.code;
|
|
@@ -40285,23 +40602,23 @@ let webLoginQrPromise = null;
|
|
|
40285
40602
|
let webChannelPromise = null;
|
|
40286
40603
|
let whatsappActionsPromise = null;
|
|
40287
40604
|
function loadWebOutbound() {
|
|
40288
|
-
webOutboundPromise ??= import("./outbound-
|
|
40605
|
+
webOutboundPromise ??= import("./outbound-Bmft-5um.js").then((n) => n.t);
|
|
40289
40606
|
return webOutboundPromise;
|
|
40290
40607
|
}
|
|
40291
40608
|
function loadWebLogin() {
|
|
40292
|
-
webLoginPromise ??= import("./login-
|
|
40609
|
+
webLoginPromise ??= import("./login-DKkQ3Czu.js").then((n) => n.n);
|
|
40293
40610
|
return webLoginPromise;
|
|
40294
40611
|
}
|
|
40295
40612
|
function loadWebLoginQr() {
|
|
40296
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
40613
|
+
webLoginQrPromise ??= import("./login-qr-OUAGpDsU.js");
|
|
40297
40614
|
return webLoginQrPromise;
|
|
40298
40615
|
}
|
|
40299
40616
|
function loadWebChannel() {
|
|
40300
|
-
webChannelPromise ??= import("./web-
|
|
40617
|
+
webChannelPromise ??= import("./web-so3pGceM.js");
|
|
40301
40618
|
return webChannelPromise;
|
|
40302
40619
|
}
|
|
40303
40620
|
function loadWhatsAppActions() {
|
|
40304
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
40621
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-Hr-W8vjY.js");
|
|
40305
40622
|
return whatsappActionsPromise;
|
|
40306
40623
|
}
|
|
40307
40624
|
function createPluginRuntime() {
|
|
@@ -40444,7 +40761,7 @@ const resolvePluginSdkAliasFile = (params) => {
|
|
|
40444
40761
|
const srcCandidate = path.join(cursor, "src", "plugin-sdk", params.srcFile);
|
|
40445
40762
|
const distCandidate = path.join(cursor, "dist", "plugin-sdk", params.distFile);
|
|
40446
40763
|
const orderedCandidates = isTest ? [distCandidate, srcCandidate] : [distCandidate];
|
|
40447
|
-
for (const candidate of orderedCandidates) if (
|
|
40764
|
+
for (const candidate of orderedCandidates) if (fs$1.existsSync(candidate)) return candidate;
|
|
40448
40765
|
const parent = path.dirname(cursor);
|
|
40449
40766
|
if (parent === cursor) break;
|
|
40450
40767
|
cursor = parent;
|
|
@@ -42569,15 +42886,6 @@ function createAnimaCodingTools(options) {
|
|
|
42569
42886
|
|
|
42570
42887
|
//#endregion
|
|
42571
42888
|
//#region src/agents/gemini-direct-runner.ts
|
|
42572
|
-
/**
|
|
42573
|
-
* Gemini Direct API Runner
|
|
42574
|
-
*
|
|
42575
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
42576
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
42577
|
-
*
|
|
42578
|
-
* This runner is automatically used when a google API key is available
|
|
42579
|
-
* and the provider is set to "google" or "gemini".
|
|
42580
|
-
*/
|
|
42581
42889
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
42582
42890
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
42583
42891
|
const MODEL_MAP = {
|
|
@@ -42669,7 +42977,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42669
42977
|
cwd: process.cwd(),
|
|
42670
42978
|
moduleUrl: import.meta.url
|
|
42671
42979
|
});
|
|
42672
|
-
const extraSystemPrompt =
|
|
42980
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
42673
42981
|
const systemPrompt = buildSystemPrompt({
|
|
42674
42982
|
workspaceDir,
|
|
42675
42983
|
config: params.config,
|
|
@@ -42748,7 +43056,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
42748
43056
|
};
|
|
42749
43057
|
}
|
|
42750
43058
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
42751
|
-
await params.onAssistantMessageStart?.();
|
|
42752
43059
|
const bodyStream = Readable.fromWeb(response.body);
|
|
42753
43060
|
let buffer = "";
|
|
42754
43061
|
let chunkAssistantText = "";
|
|
@@ -42774,12 +43081,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
42774
43081
|
nonTextParts.push(p);
|
|
42775
43082
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
42776
43083
|
}
|
|
42777
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
42778
43084
|
if (parsed.usageMetadata) {
|
|
42779
43085
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
42780
43086
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
42781
43087
|
}
|
|
42782
|
-
} catch
|
|
43088
|
+
} catch {}
|
|
42783
43089
|
}
|
|
42784
43090
|
}
|
|
42785
43091
|
if (functionCalls.length > 0) {
|
|
@@ -42839,7 +43145,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42839
43145
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
42840
43146
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
42841
43147
|
return {
|
|
42842
|
-
status: "failed",
|
|
43148
|
+
status: isAbort ? "timeout" : "failed",
|
|
42843
43149
|
meta: {
|
|
42844
43150
|
durationMs: Date.now() - started,
|
|
42845
43151
|
error: {
|
|
@@ -42876,7 +43182,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42876
43182
|
}
|
|
42877
43183
|
|
|
42878
43184
|
//#endregion
|
|
42879
|
-
//#region src/agents/
|
|
43185
|
+
//#region src/agents/noxsoft-runner.ts
|
|
42880
43186
|
function normalizeEmbeddedProvider(provider) {
|
|
42881
43187
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
42882
43188
|
}
|
|
@@ -42897,178 +43203,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
42897
43203
|
data
|
|
42898
43204
|
});
|
|
42899
43205
|
}
|
|
42900
|
-
|
|
42901
|
-
|
|
42902
|
-
if (
|
|
43206
|
+
function resolveDirectAuthProvider(provider) {
|
|
43207
|
+
if (provider === "anthropic" || provider === "claude") return "anthropic";
|
|
43208
|
+
if (provider === "google" || provider === "gemini") return "google";
|
|
43209
|
+
return null;
|
|
43210
|
+
}
|
|
43211
|
+
function resolveProfileFailureReason(result) {
|
|
43212
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43213
|
+
if (kind === "auth") return "auth";
|
|
43214
|
+
if (kind === "rate_limit") return "rate_limit";
|
|
43215
|
+
const classified = classifyFailoverReason(result.meta.error?.message ?? "");
|
|
43216
|
+
if (classified === "billing") return "billing";
|
|
43217
|
+
if (classified === "auth") return "auth";
|
|
43218
|
+
if (classified === "rate_limit") return "rate_limit";
|
|
43219
|
+
}
|
|
43220
|
+
function resolveResultErrorKind(result) {
|
|
43221
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43222
|
+
if (kind) return kind;
|
|
43223
|
+
return result.status === "timeout" ? "timeout" : "unknown";
|
|
43224
|
+
}
|
|
43225
|
+
function normalizeResultStatus(result) {
|
|
43226
|
+
const kind = resolveResultErrorKind(result);
|
|
43227
|
+
if (result.status === "timeout" || kind === "timeout") return "timeout";
|
|
43228
|
+
return result.status;
|
|
43229
|
+
}
|
|
43230
|
+
function normalizeResultPayloads(result) {
|
|
43231
|
+
const payloads = result.payloads?.filter((payload) => payload && typeof payload === "object");
|
|
43232
|
+
if (payloads && payloads.length > 0) return payloads;
|
|
43233
|
+
const output = result.output?.trim();
|
|
43234
|
+
return output ? [{ text: output }] : void 0;
|
|
43235
|
+
}
|
|
43236
|
+
function normalizeResultOutput(result, payloads) {
|
|
43237
|
+
const directOutput = result.output?.trim();
|
|
43238
|
+
if (directOutput) return directOutput;
|
|
43239
|
+
return payloads?.find((payload) => payload.text?.trim())?.text?.trim() || void 0;
|
|
43240
|
+
}
|
|
43241
|
+
function normalizeRunnerResult(params) {
|
|
43242
|
+
const payloads = normalizeResultPayloads(params.result);
|
|
43243
|
+
const output = normalizeResultOutput(params.result, payloads);
|
|
43244
|
+
const usage = normalizeUsage(params.result.meta.agentMeta?.usage);
|
|
43245
|
+
const lastCallUsage = normalizeUsage(params.result.meta.agentMeta?.lastCallUsage);
|
|
43246
|
+
const promptTokens = params.result.meta.agentMeta?.promptTokens ?? derivePromptTokens(usage ?? lastCallUsage);
|
|
43247
|
+
const status = normalizeResultStatus(params.result);
|
|
43248
|
+
const errorMessage = params.result.meta.error?.message?.trim();
|
|
43249
|
+
const errorKind = resolveResultErrorKind(params.result);
|
|
43250
|
+
return {
|
|
43251
|
+
...params.result,
|
|
43252
|
+
status,
|
|
43253
|
+
output,
|
|
43254
|
+
payloads,
|
|
43255
|
+
meta: {
|
|
43256
|
+
...params.result.meta,
|
|
43257
|
+
error: status === "completed" && !errorMessage ? void 0 : {
|
|
43258
|
+
message: errorMessage || (status === "timeout" ? "Request timed out." : "Runner execution failed."),
|
|
43259
|
+
kind: errorKind
|
|
43260
|
+
},
|
|
43261
|
+
agentMeta: {
|
|
43262
|
+
...params.result.meta.agentMeta,
|
|
43263
|
+
sessionId: params.result.meta.agentMeta?.sessionId?.trim() || params.sessionId,
|
|
43264
|
+
provider: params.provider,
|
|
43265
|
+
model: params.model ?? params.result.meta.agentMeta?.model,
|
|
43266
|
+
usage,
|
|
43267
|
+
promptTokens,
|
|
43268
|
+
lastCallUsage
|
|
43269
|
+
}
|
|
43270
|
+
}
|
|
43271
|
+
};
|
|
43272
|
+
}
|
|
43273
|
+
function coerceResultFailure(params) {
|
|
43274
|
+
if (params.result.status === "completed") return null;
|
|
43275
|
+
const message = params.result.meta.error?.message?.trim() || (params.result.status === "timeout" ? "Request timed out." : "Runner execution failed.");
|
|
43276
|
+
const reason = classifyFailoverReason(message) ?? resolveResultErrorKind(params.result);
|
|
43277
|
+
return new FailoverError(message, {
|
|
43278
|
+
reason: reason === "timeout" ? "timeout" : reason,
|
|
43279
|
+
provider: params.provider,
|
|
43280
|
+
model: params.model,
|
|
43281
|
+
status: resolveFailoverStatus(reason)
|
|
43282
|
+
});
|
|
43283
|
+
}
|
|
43284
|
+
async function resolveDirectProviderAuth(params) {
|
|
43285
|
+
return resolveApiKeyForProvider({
|
|
43286
|
+
provider: params.provider,
|
|
43287
|
+
cfg: params.config,
|
|
43288
|
+
preferredProfile: params.preferredProfile,
|
|
43289
|
+
agentDir: params.agentDir,
|
|
43290
|
+
store: params.store
|
|
43291
|
+
});
|
|
43292
|
+
}
|
|
43293
|
+
async function runDirectWithProfileFallback(params) {
|
|
43294
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
43295
|
+
const attemptedAuthSources = /* @__PURE__ */ new Set();
|
|
43296
|
+
let preferredProfile = params.authProfileId;
|
|
43297
|
+
let lastResult = null;
|
|
43298
|
+
for (;;) {
|
|
43299
|
+
const auth = await resolveDirectProviderAuth({
|
|
43300
|
+
provider: params.directProvider,
|
|
43301
|
+
config: params.config,
|
|
43302
|
+
agentDir: params.agentDir,
|
|
43303
|
+
preferredProfile,
|
|
43304
|
+
store
|
|
43305
|
+
});
|
|
43306
|
+
const authSourceKey = auth.profileId ?? `${auth.mode}:${auth.source}`;
|
|
43307
|
+
if (attemptedAuthSources.has(authSourceKey)) return lastResult ?? {
|
|
43308
|
+
status: "failed",
|
|
43309
|
+
meta: {
|
|
43310
|
+
durationMs: 0,
|
|
43311
|
+
error: {
|
|
43312
|
+
message: `Auth fallback loop detected for ${params.directProvider}.`,
|
|
43313
|
+
kind: "unknown"
|
|
43314
|
+
}
|
|
43315
|
+
}
|
|
43316
|
+
};
|
|
43317
|
+
attemptedAuthSources.add(authSourceKey);
|
|
43318
|
+
const result = params.directProvider === "anthropic" ? await runAnthropicDirectAgent({
|
|
43319
|
+
token: auth.apiKey ?? "",
|
|
43320
|
+
sessionId: params.sessionId,
|
|
43321
|
+
sessionKey: params.sessionKey,
|
|
43322
|
+
agentId: params.agentId,
|
|
43323
|
+
sessionFile: params.sessionFile,
|
|
43324
|
+
workspaceDir: params.workspaceDir,
|
|
43325
|
+
config: params.config,
|
|
43326
|
+
prompt: params.prompt,
|
|
43327
|
+
model: params.model,
|
|
43328
|
+
thinkLevel: params.thinkLevel,
|
|
43329
|
+
timeoutMs: params.timeoutMs,
|
|
43330
|
+
runId: params.runId,
|
|
43331
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43332
|
+
ownerNumbers: params.ownerNumbers,
|
|
43333
|
+
onPartialReply: params.emitPartial,
|
|
43334
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43335
|
+
}) : await runGeminiDirectAgent({
|
|
43336
|
+
apiKey: auth.apiKey ?? "",
|
|
43337
|
+
sessionId: params.sessionId,
|
|
43338
|
+
sessionKey: params.sessionKey,
|
|
43339
|
+
agentId: params.agentId,
|
|
43340
|
+
sessionFile: params.sessionFile,
|
|
43341
|
+
workspaceDir: params.workspaceDir,
|
|
43342
|
+
config: params.config,
|
|
43343
|
+
prompt: params.prompt,
|
|
43344
|
+
model: params.model,
|
|
43345
|
+
thinkLevel: params.thinkLevel,
|
|
43346
|
+
timeoutMs: params.timeoutMs,
|
|
43347
|
+
runId: params.runId,
|
|
43348
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43349
|
+
ownerNumbers: params.ownerNumbers,
|
|
43350
|
+
onPartialReply: params.emitPartial,
|
|
43351
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43352
|
+
});
|
|
43353
|
+
if (result.status === "completed") {
|
|
43354
|
+
if (auth.profileId) {
|
|
43355
|
+
await markAuthProfileUsed({
|
|
43356
|
+
store,
|
|
43357
|
+
profileId: auth.profileId,
|
|
43358
|
+
agentDir: params.agentDir
|
|
43359
|
+
});
|
|
43360
|
+
await markAuthProfileGood({
|
|
43361
|
+
store,
|
|
43362
|
+
provider: params.directProvider,
|
|
43363
|
+
profileId: auth.profileId,
|
|
43364
|
+
agentDir: params.agentDir
|
|
43365
|
+
});
|
|
43366
|
+
}
|
|
43367
|
+
return result;
|
|
43368
|
+
}
|
|
43369
|
+
lastResult = result;
|
|
43370
|
+
const failureReason = resolveProfileFailureReason(result);
|
|
43371
|
+
if (!auth.profileId || !failureReason) return result;
|
|
43372
|
+
await markAuthProfileFailure({
|
|
43373
|
+
store,
|
|
43374
|
+
profileId: auth.profileId,
|
|
43375
|
+
reason: failureReason,
|
|
43376
|
+
cfg: params.config,
|
|
43377
|
+
agentDir: params.agentDir
|
|
43378
|
+
});
|
|
43379
|
+
preferredProfile = void 0;
|
|
43380
|
+
}
|
|
43381
|
+
}
|
|
43382
|
+
async function resolveDirectStrategy(provider, config, agentDir) {
|
|
43383
|
+
const directProvider = resolveDirectAuthProvider(provider);
|
|
43384
|
+
if (!directProvider) return null;
|
|
43385
|
+
try {
|
|
43386
|
+
const auth = await resolveDirectProviderAuth({
|
|
43387
|
+
provider: directProvider,
|
|
43388
|
+
config,
|
|
43389
|
+
agentDir,
|
|
43390
|
+
store: ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false })
|
|
43391
|
+
});
|
|
43392
|
+
if (auth.apiKey) {
|
|
43393
|
+
if (directProvider === "anthropic" && auth.apiKey.startsWith("sk-ant-oat01-")) return null;
|
|
43394
|
+
return {
|
|
43395
|
+
kind: directProvider === "google" ? "gemini-direct" : "anthropic-direct",
|
|
43396
|
+
provider
|
|
43397
|
+
};
|
|
43398
|
+
}
|
|
43399
|
+
} catch {}
|
|
43400
|
+
return null;
|
|
43401
|
+
}
|
|
43402
|
+
async function resolveNoxSoftRunnerStrategy(params) {
|
|
42903
43403
|
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43404
|
+
const direct = await resolveDirectStrategy(provider, params.config, params.agentDir);
|
|
43405
|
+
if (direct) return direct;
|
|
43406
|
+
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43407
|
+
if (!resolveCliBackendConfig(cliProvider, params.config)) throw new Error(`No CLI backend available for provider "${provider}" (resolved "${cliProvider}").\nEither:\n • Run: anima setup-token (set an Anthropic API key — no CLI needed)\n • Install the matching CLI and log in`);
|
|
43408
|
+
return {
|
|
43409
|
+
kind: "cli",
|
|
43410
|
+
provider,
|
|
43411
|
+
cliProvider
|
|
43412
|
+
};
|
|
43413
|
+
}
|
|
43414
|
+
async function runNoxSoftEmbeddedAgent(params) {
|
|
43415
|
+
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43416
|
+
const normalizedRequestedRef = params.model?.trim() ? normalizeModelRef(provider, params.model) : null;
|
|
42904
43417
|
const startedAt = Date.now();
|
|
42905
43418
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
42906
43419
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
42907
43420
|
let assistantStarted = false;
|
|
42908
43421
|
const streamTasks = [];
|
|
42909
|
-
|
|
42910
|
-
|
|
42911
|
-
|
|
42912
|
-
|
|
42913
|
-
|
|
42914
|
-
|
|
42915
|
-
|
|
42916
|
-
|
|
42917
|
-
|
|
42918
|
-
|
|
42919
|
-
|
|
42920
|
-
|
|
42921
|
-
|
|
42922
|
-
|
|
42923
|
-
|
|
42924
|
-
|
|
42925
|
-
|
|
42926
|
-
|
|
42927
|
-
|
|
42928
|
-
|
|
42929
|
-
|
|
43422
|
+
const emitPartial = async (payload) => {
|
|
43423
|
+
if (!assistantStarted) {
|
|
43424
|
+
assistantStarted = true;
|
|
43425
|
+
await params.onAssistantMessageStart?.();
|
|
43426
|
+
}
|
|
43427
|
+
await params.onPartialReply?.(payload);
|
|
43428
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
43429
|
+
};
|
|
43430
|
+
const strategy = await resolveNoxSoftRunnerStrategy({
|
|
43431
|
+
provider: params.provider,
|
|
43432
|
+
config: params.config,
|
|
43433
|
+
agentDir: params.agentDir
|
|
43434
|
+
});
|
|
43435
|
+
if (strategy.kind === "anthropic-direct") {
|
|
43436
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43437
|
+
phase: "start",
|
|
43438
|
+
startedAt
|
|
43439
|
+
});
|
|
43440
|
+
try {
|
|
43441
|
+
const result = normalizeRunnerResult({
|
|
43442
|
+
result: await runDirectWithProfileFallback({
|
|
43443
|
+
...params,
|
|
43444
|
+
directProvider: "anthropic",
|
|
42930
43445
|
timeoutMs,
|
|
42931
43446
|
runId,
|
|
42932
|
-
|
|
42933
|
-
|
|
42934
|
-
|
|
42935
|
-
|
|
42936
|
-
|
|
42937
|
-
|
|
42938
|
-
|
|
42939
|
-
|
|
42940
|
-
|
|
42941
|
-
|
|
42942
|
-
|
|
42943
|
-
|
|
42944
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42945
|
-
phase: "end",
|
|
42946
|
-
durationMs: Date.now() - startedAt,
|
|
42947
|
-
status: result.status
|
|
42948
|
-
});
|
|
42949
|
-
return result;
|
|
42950
|
-
} catch (err) {
|
|
43447
|
+
emitPartial
|
|
43448
|
+
}),
|
|
43449
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43450
|
+
model: normalizedRequestedRef?.model,
|
|
43451
|
+
sessionId: params.sessionId
|
|
43452
|
+
});
|
|
43453
|
+
const failure = coerceResultFailure({
|
|
43454
|
+
result,
|
|
43455
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43456
|
+
model: result.meta.agentMeta?.model
|
|
43457
|
+
});
|
|
43458
|
+
if (failure) {
|
|
42951
43459
|
await emitAgentEvent(params, "lifecycle", {
|
|
42952
43460
|
phase: "error",
|
|
42953
|
-
|
|
43461
|
+
startedAt,
|
|
43462
|
+
endedAt: Date.now(),
|
|
43463
|
+
error: failure.message,
|
|
43464
|
+
status: result.status
|
|
42954
43465
|
});
|
|
42955
|
-
throw
|
|
43466
|
+
throw failure;
|
|
42956
43467
|
}
|
|
42957
|
-
}
|
|
42958
|
-
}
|
|
42959
|
-
if (provider === "google" || provider === "gemini") {
|
|
42960
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
42961
|
-
provider: "google",
|
|
42962
|
-
cfg: params.config
|
|
42963
|
-
}))?.apiKey;
|
|
42964
|
-
if (geminiApiKey) {
|
|
42965
43468
|
await emitAgentEvent(params, "lifecycle", {
|
|
42966
|
-
phase: "
|
|
42967
|
-
startedAt
|
|
43469
|
+
phase: "end",
|
|
43470
|
+
durationMs: Date.now() - startedAt,
|
|
43471
|
+
status: result.status
|
|
42968
43472
|
});
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42972
|
-
|
|
42973
|
-
|
|
42974
|
-
|
|
42975
|
-
|
|
42976
|
-
|
|
42977
|
-
|
|
42978
|
-
|
|
42979
|
-
|
|
42980
|
-
|
|
43473
|
+
return result;
|
|
43474
|
+
} catch (err) {
|
|
43475
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43476
|
+
phase: "error",
|
|
43477
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43478
|
+
});
|
|
43479
|
+
throw err;
|
|
43480
|
+
}
|
|
43481
|
+
}
|
|
43482
|
+
if (strategy.kind === "gemini-direct") {
|
|
43483
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43484
|
+
phase: "start",
|
|
43485
|
+
startedAt
|
|
43486
|
+
});
|
|
43487
|
+
try {
|
|
43488
|
+
const result = normalizeRunnerResult({
|
|
43489
|
+
result: await runDirectWithProfileFallback({
|
|
43490
|
+
...params,
|
|
43491
|
+
directProvider: "google",
|
|
42981
43492
|
timeoutMs,
|
|
42982
43493
|
runId,
|
|
42983
|
-
|
|
42984
|
-
|
|
42985
|
-
|
|
42986
|
-
|
|
42987
|
-
|
|
42988
|
-
|
|
42989
|
-
|
|
42990
|
-
|
|
42991
|
-
|
|
42992
|
-
|
|
42993
|
-
|
|
42994
|
-
|
|
42995
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42996
|
-
phase: "end",
|
|
42997
|
-
durationMs: Date.now() - startedAt,
|
|
42998
|
-
status: result.status
|
|
42999
|
-
});
|
|
43000
|
-
return result;
|
|
43001
|
-
} catch (err) {
|
|
43494
|
+
emitPartial
|
|
43495
|
+
}),
|
|
43496
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43497
|
+
model: normalizedRequestedRef?.model,
|
|
43498
|
+
sessionId: params.sessionId
|
|
43499
|
+
});
|
|
43500
|
+
const failure = coerceResultFailure({
|
|
43501
|
+
result,
|
|
43502
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43503
|
+
model: result.meta.agentMeta?.model
|
|
43504
|
+
});
|
|
43505
|
+
if (failure) {
|
|
43002
43506
|
await emitAgentEvent(params, "lifecycle", {
|
|
43003
43507
|
phase: "error",
|
|
43004
|
-
|
|
43508
|
+
startedAt,
|
|
43509
|
+
endedAt: Date.now(),
|
|
43510
|
+
error: failure.message,
|
|
43511
|
+
status: result.status
|
|
43005
43512
|
});
|
|
43006
|
-
throw
|
|
43513
|
+
throw failure;
|
|
43007
43514
|
}
|
|
43515
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43516
|
+
phase: "end",
|
|
43517
|
+
durationMs: Date.now() - startedAt,
|
|
43518
|
+
status: result.status
|
|
43519
|
+
});
|
|
43520
|
+
return result;
|
|
43521
|
+
} catch (err) {
|
|
43522
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43523
|
+
phase: "error",
|
|
43524
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43525
|
+
});
|
|
43526
|
+
throw err;
|
|
43008
43527
|
}
|
|
43009
43528
|
}
|
|
43010
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43011
|
-
if (!resolveCliBackendConfig(cliProvider, params.config)) throw new Error(`No CLI backend available for provider "${provider}" (resolved "${cliProvider}").\nEither:\n • Run: anima setup-token (set an Anthropic API key — no CLI needed)\n • Install the matching CLI and log in`);
|
|
43012
43529
|
await emitAgentEvent(params, "lifecycle", {
|
|
43013
43530
|
phase: "start",
|
|
43014
43531
|
startedAt
|
|
43015
43532
|
});
|
|
43016
43533
|
try {
|
|
43017
|
-
const result =
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43024
|
-
|
|
43025
|
-
|
|
43026
|
-
|
|
43027
|
-
|
|
43028
|
-
|
|
43029
|
-
|
|
43030
|
-
|
|
43031
|
-
|
|
43032
|
-
|
|
43033
|
-
|
|
43034
|
-
|
|
43035
|
-
|
|
43036
|
-
|
|
43037
|
-
|
|
43038
|
-
|
|
43039
|
-
|
|
43040
|
-
}
|
|
43041
|
-
|
|
43042
|
-
|
|
43043
|
-
|
|
43044
|
-
|
|
43045
|
-
|
|
43534
|
+
const result = normalizeRunnerResult({
|
|
43535
|
+
result: await runCliAgent({
|
|
43536
|
+
sessionId: params.sessionId,
|
|
43537
|
+
sessionKey: params.sessionKey,
|
|
43538
|
+
agentId: params.agentId,
|
|
43539
|
+
sessionFile: params.sessionFile,
|
|
43540
|
+
workspaceDir: params.workspaceDir,
|
|
43541
|
+
config: params.config,
|
|
43542
|
+
prompt: params.prompt,
|
|
43543
|
+
provider: strategy.cliProvider,
|
|
43544
|
+
model: params.model,
|
|
43545
|
+
thinkLevel: params.thinkLevel,
|
|
43546
|
+
timeoutMs,
|
|
43547
|
+
runId,
|
|
43548
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43549
|
+
ownerNumbers: params.ownerNumbers,
|
|
43550
|
+
cliSessionId: params.cliSessionId,
|
|
43551
|
+
sessionExecSecurity: params.execSecurity,
|
|
43552
|
+
images: params.images,
|
|
43553
|
+
streamParams: params.streamParams,
|
|
43554
|
+
onTextStream: (text) => {
|
|
43555
|
+
const nextText = text.trim();
|
|
43556
|
+
if (!nextText) return;
|
|
43557
|
+
streamTasks.push(emitPartial({ text: nextText }));
|
|
43558
|
+
}
|
|
43559
|
+
}),
|
|
43560
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43561
|
+
model: normalizedRequestedRef?.model,
|
|
43562
|
+
sessionId: params.sessionId
|
|
43046
43563
|
});
|
|
43047
43564
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
43048
43565
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
43049
|
-
if (finalText && !assistantStarted) {
|
|
43050
|
-
assistantStarted = true;
|
|
43051
|
-
await params.onAssistantMessageStart?.();
|
|
43052
|
-
await params.onPartialReply?.({ text: finalText });
|
|
43053
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
43054
|
-
}
|
|
43566
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
43055
43567
|
await emitAgentEvent(params, "lifecycle", {
|
|
43056
43568
|
phase: "end",
|
|
43057
43569
|
startedAt,
|
|
43058
43570
|
endedAt: Date.now(),
|
|
43059
|
-
aborted: false
|
|
43571
|
+
aborted: false,
|
|
43572
|
+
status: result.status
|
|
43060
43573
|
});
|
|
43061
|
-
return
|
|
43062
|
-
...result,
|
|
43063
|
-
meta: {
|
|
43064
|
-
...result.meta,
|
|
43065
|
-
agentMeta: {
|
|
43066
|
-
...result.meta.agentMeta,
|
|
43067
|
-
provider,
|
|
43068
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
43069
|
-
}
|
|
43070
|
-
}
|
|
43071
|
-
};
|
|
43574
|
+
return result;
|
|
43072
43575
|
} catch (error) {
|
|
43073
43576
|
const message = error instanceof Error ? error.message : String(error);
|
|
43074
43577
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -43080,6 +43583,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
43080
43583
|
throw error;
|
|
43081
43584
|
}
|
|
43082
43585
|
}
|
|
43586
|
+
|
|
43587
|
+
//#endregion
|
|
43588
|
+
//#region src/agents/pi-embedded.ts
|
|
43083
43589
|
async function compactEmbeddedPiSession(..._args) {
|
|
43084
43590
|
return {
|
|
43085
43591
|
ok: true,
|
|
@@ -43107,4 +43613,4 @@ async function waitForEmbeddedPiRunEnd(..._args) {
|
|
|
43107
43613
|
}
|
|
43108
43614
|
|
|
43109
43615
|
//#endregion
|
|
43110
|
-
export { resolveEffectiveMessagesConfig as $, applyVerboseOverride as A, shouldComputeCommandAuthorized as B, upsertChannelPairingRequest as C, lookupContextTokens as D, getSkillsSnapshotVersion as E, createInboundDebouncer as F, resolveAgentTimeoutMs as G, buildMentionRegexes as H, resolveInboundDebounceMs as I, extractShortModelName as J, AGENT_LANE_NESTED as K, formatInboundEnvelope as L, loadModelCatalog as M, registerUnhandledRejectionHandler as N, clearSessionAuthProfileOverride as O, finalizeInboundContext as P, hasInterSessionUserProvenance as Q, resolveEnvelopeFormatOptions as R, readChannelAllowFromStore as S, getRemoteSkillEligibility as T, normalizeMentionText as U, CURRENT_MESSAGE_MARKER as V, subagent_registry_exports as W, emitAgentEvent$1 as X, clearAgentRunContext as Y, registerAgentRunContext as Z, normalizeGroupActivation as _, resolveChannelGroupRequireMention as a, hasNonzeroUsage as b, createDedupeCache as c, setCliSessionId as d, resolveIdentityName as et, buildAgentSessionKey as f, runWithModelFallback as g, resolveSessionDeliveryTarget as h, resolveChannelGroupPolicy as i, enqueueSystemEvent as j, applyModelOverrideToSessionEntry as k, getReplyFromConfig as l, resolveOutboundTarget as m, buildPairingReply as n, resolveMessagePrefix as nt, shouldAckReactionForWhatsApp as o, resolveAgentRoute as p, AGENT_LANE_SUBAGENT as q, recordChannelActivity as r,
|
|
43616
|
+
export { resolveEffectiveMessagesConfig as $, applyVerboseOverride as A, shouldComputeCommandAuthorized as B, upsertChannelPairingRequest as C, lookupContextTokens as D, getSkillsSnapshotVersion as E, createInboundDebouncer as F, resolveAgentTimeoutMs as G, buildMentionRegexes as H, resolveInboundDebounceMs as I, extractShortModelName as J, AGENT_LANE_NESTED as K, formatInboundEnvelope as L, loadModelCatalog as M, registerUnhandledRejectionHandler as N, clearSessionAuthProfileOverride as O, finalizeInboundContext as P, hasInterSessionUserProvenance as Q, resolveEnvelopeFormatOptions as R, readChannelAllowFromStore as S, getRemoteSkillEligibility as T, normalizeMentionText as U, CURRENT_MESSAGE_MARKER as V, subagent_registry_exports as W, emitAgentEvent$1 as X, clearAgentRunContext as Y, registerAgentRunContext as Z, normalizeGroupActivation as _, resolveChannelGroupRequireMention as a, hasNonzeroUsage as b, createDedupeCache as c, setCliSessionId as d, resolveIdentityName as et, buildAgentSessionKey as f, runWithModelFallback as g, resolveSessionDeliveryTarget as h, resolveChannelGroupPolicy as i, enqueueSystemEvent as j, applyModelOverrideToSessionEntry as k, getReplyFromConfig as l, resolveOutboundTarget as m, buildPairingReply as n, resolveMessagePrefix as nt, shouldAckReactionForWhatsApp as o, resolveAgentRoute as p, AGENT_LANE_SUBAGENT as q, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s, runNoxSoftEmbeddedAgent as t, resolveIdentityNamePrefix as tt, getCliSessionId as u, parseActivationCommand as v, resolveSendPolicy as w, formatDurationPrecise as x, deriveSessionTotalTokens as y, hasControlCommand as z };
|