@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,56 +1,58 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
2
|
import { $ as resolveStateDir, Dt as resolveRequiredHomeDir, N as theme, O as shouldLogVerbose, P as getChildLogger, T as logVerbose, Y as resolveGatewayPort, ct as normalizeAnyChannelId, g as defaultRuntime, lt as normalizeChannelId, n as isTruthyEnvValue, nt as CHAT_CHANNEL_ORDER, o as createSubsystemLogger, pt as setActivePluginRegistry, ut as normalizeChatChannelId, z as normalizeLogLevel } from "./entry.js";
|
|
3
|
-
import { S as resolveAuthProfileDisplayLabel, a as
|
|
3
|
+
import { S as saveJsonFile, T as resolveAuthProfileDisplayLabel, a as markAuthProfileUsed, i as markAuthProfileFailure, l as listProfilesForProvider, n as resolveAuthProfileOrder, p as ensureAuthProfileStore, r as isProfileInCooldown, s as resolveApiKeyForProfile, u as markAuthProfileGood, v as resolveAuthStorePathForDisplay, w as normalizeSecretInput, x as loadJsonFile } from "./auth-profiles-Brxz2ojJ.js";
|
|
4
4
|
import { r as resolveCliName, t as formatCliCommand } from "./command-format-kLw3YIIu.js";
|
|
5
5
|
import { S as resolveThreadParentSessionKey, _ as isAcpSessionKey, a as buildAgentPeerSessionKey, b as isSubagentSessionKey, c as normalizeAccountId$1, d as resolveAgentIdFromSessionKey, f as resolveThreadSessionKeys, g as getSubagentDepth, i as buildAgentMainSessionKey, l as normalizeAgentId, n as DEFAULT_AGENT_ID, p as sanitizeAgentId, r as DEFAULT_MAIN_KEY, t as DEFAULT_ACCOUNT_ID, u as normalizeMainKey, v as isCronRunSessionKey, x as parseAgentSessionKey } from "./session-key-DP2WHl90.js";
|
|
6
6
|
import { C as sleep, E as truncateUtf16Safe, S as shortenHomePath, c as escapeRegExp, d as isRecord, r as clampInt, t as CONFIG_DIR, u as isPlainObject, w as sliceUtf16Safe, y as resolveUserPath } from "./utils-D1VGbO3C.js";
|
|
7
7
|
import { a as logDebug, c as logWarn, i as spawnWithFallback, n as runExec, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout } from "./exec-BtBJICHE.js";
|
|
8
8
|
import { c as resolveDefaultAgentId, f as DEFAULT_AGENT_WORKSPACE_DIR, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds, x as ensureAgentWorkspace } from "./agent-scope-Dm8IL1Ks.js";
|
|
9
|
-
import { _ as DEFAULT_MODEL, a as isCliProvider, c as normalizeProviderId, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDefault, m as resolveModelRefFromString, n as buildConfiguredAllowlistKeys, o as modelKey, r as buildModelAliasIndex, s as normalizeModelRef, t as buildAllowedModelSet, v as DEFAULT_PROVIDER } from "./model-selection-
|
|
9
|
+
import { _ as DEFAULT_MODEL, a as isCliProvider, c as normalizeProviderId, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDefault, m as resolveModelRefFromString, n as buildConfiguredAllowlistKeys, o as modelKey, r as buildModelAliasIndex, s as normalizeModelRef, t as buildAllowedModelSet, v as DEFAULT_PROVIDER } from "./model-selection-DcO3qJOu.js";
|
|
10
10
|
import { t as resolveAnimaAgentDir } from "./agent-paths-niQrLbGc.js";
|
|
11
11
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-BZryRo8-.js";
|
|
12
12
|
import { c as assertMediaNotDataUrl, i as loadWorkspaceSkillEntries, l as assertSandboxPath, n as buildWorkspaceSkillCommandSpecs, o as resolvePluginSkillDirs, r as buildWorkspaceSkillSnapshot, u as resolveSandboxedMediaSource } from "./skills-DtoVe1dS.js";
|
|
13
13
|
import { a as applyTestPluginDefaults, c as resolveEnableState, l as resolveMemorySlotDecision, n as discoverAnimaPlugins, s as normalizePluginsConfig, t as loadPluginManifestRegistry } from "./manifest-registry-W_OfCIRP.js";
|
|
14
|
-
import { C as unsetConfigValueAtPath, M as VERSION, S as setConfigValueAtPath, _ as resetConfigOverrides, b as getConfigValueAtPath, c as resolveConfigSnapshotHash, g as getConfigOverrides, h as validateJsonSchemaValue, i as loadConfig, l as writeConfigFile, m as parseDurationMs, o as readConfigFileSnapshot, u as validateConfigObjectWithPlugins, v as setConfigOverride, x as parseConfigPath, y as unsetConfigOverride } from "./config-
|
|
14
|
+
import { C as unsetConfigValueAtPath, M as VERSION, S as setConfigValueAtPath, _ as resetConfigOverrides, b as getConfigValueAtPath, c as resolveConfigSnapshotHash, g as getConfigOverrides, h as validateJsonSchemaValue, i as loadConfig, l as writeConfigFile, m as parseDurationMs, o as readConfigFileSnapshot, u as validateConfigObjectWithPlugins, v as setConfigOverride, x as parseConfigPath, y as unsetConfigOverride } from "./config-BrVuTQ8R.js";
|
|
15
15
|
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell } from "./shell-env-2QqHvBMl.js";
|
|
16
|
-
import { At as SESSION_LABEL_MAX_LENGTH, Mt as hasInterSessionUserProvenance } from "./client-
|
|
17
|
-
import { a as randomIdempotencyKey, n as callGateway } from "./call-
|
|
18
|
-
import { a as isInternalMessageChannel, c as listDeliverableMessageChannels, d as resolveMessageChannel, h as GATEWAY_CLIENT_NAMES, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES, n as isDeliverableMessageChannel, o as isMarkdownCapableMessageChannel, p as GATEWAY_CLIENT_IDS, t as INTERNAL_MESSAGE_CHANNEL, u as resolveGatewayMessageChannel } from "./message-channel-
|
|
19
|
-
import { A as buildGroupDisplayName, D as listChannelDocks, E as getChannelDock, F as normalizeDeliveryContext, I as normalizeSessionDeliveryFields, M as deliveryContextFromSession, N as deliveryContextKey, O as resolveConversationLabel, P as mergeDeliveryContext, S as resolveMainSessionKey, _ as DEFAULT_RESET_TRIGGERS, a as readSessionUpdatedAt, b as resolveAgentMainSessionKey, c as updateLastRoute, d as resolveSessionKey$1, f as evaluateSessionFreshness, g as resolveThreadFlag, h as resolveSessionResetType, i as loadSessionStore, j as resolveGroupSessionKey, k as normalizeChatType, l as updateSessionStore, m as resolveSessionResetPolicy, n as appendAssistantMessageToSessionTranscript, o as recordSessionMetaFromInbound, p as resolveChannelResetConfig, t as extractDeliveryInfo, u as updateSessionStoreEntry, v as resolveFreshSessionTotalTokens, w as deriveSessionMetaPatch, y as canonicalizeMainSessionAlias } from "./sessions-
|
|
16
|
+
import { At as SESSION_LABEL_MAX_LENGTH, Mt as hasInterSessionUserProvenance } from "./client-CfLiulzK.js";
|
|
17
|
+
import { a as randomIdempotencyKey, n as callGateway } from "./call-B4lhqS6H.js";
|
|
18
|
+
import { a as isInternalMessageChannel, c as listDeliverableMessageChannels, d as resolveMessageChannel, h as GATEWAY_CLIENT_NAMES, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES, n as isDeliverableMessageChannel, o as isMarkdownCapableMessageChannel, p as GATEWAY_CLIENT_IDS, t as INTERNAL_MESSAGE_CHANNEL, u as resolveGatewayMessageChannel } from "./message-channel-DIHHKJhk.js";
|
|
19
|
+
import { A as buildGroupDisplayName, D as listChannelDocks, E as getChannelDock, F as normalizeDeliveryContext, I as normalizeSessionDeliveryFields, M as deliveryContextFromSession, N as deliveryContextKey, O as resolveConversationLabel, P as mergeDeliveryContext, S as resolveMainSessionKey, _ as DEFAULT_RESET_TRIGGERS, a as readSessionUpdatedAt, b as resolveAgentMainSessionKey, c as updateLastRoute, d as resolveSessionKey$1, f as evaluateSessionFreshness, g as resolveThreadFlag, h as resolveSessionResetType, i as loadSessionStore, j as resolveGroupSessionKey, k as normalizeChatType, l as updateSessionStore, m as resolveSessionResetPolicy, n as appendAssistantMessageToSessionTranscript, o as recordSessionMetaFromInbound, p as resolveChannelResetConfig, t as extractDeliveryInfo, u as updateSessionStoreEntry, v as resolveFreshSessionTotalTokens, w as deriveSessionMetaPatch, y as canonicalizeMainSessionAlias } from "./sessions-C_3wTmSA.js";
|
|
20
20
|
import { n as SILENT_REPLY_TOKEN, r as isSilentReplyText, t as HEARTBEAT_TOKEN } from "./tokens-CmlI2hSz.js";
|
|
21
|
-
import { $ as
|
|
21
|
+
import { $ as isVoiceCompatibleAudio, A as getLastTtsAttempt, B as resolveTtsConfig, C as formatUserTime, D as killProcessTree, E as getShellConfig, F as isTtsProviderConfigured, G as setTtsEnabled, I as maybeApplyTtsToPayload, J as textToSpeech, K as setTtsMaxLength, L as normalizeTtsAutoMode, M as getTtsProvider, N as isSummarizationEnabled, O as sanitizeBinaryOutput, P as isTtsEnabled, R as resolveTtsApiKey, S as buildSystemPromptParams, T as resolveUserTimezone, U as setLastTtsAttempt, V as resolveTtsPrefsPath, W as setSummarizationEnabled, Y as textToSpeechTelephony, _ as resolvePromptInput, at as triggerInternalHook, b as writeCliImages, c as appendImagePathsToPrompt, d as cleanupResumeProcesses, et as makeBootstrapWarn, f as cleanupSuspendedCliProcesses, g as parseCliJsonl, h as parseCliJson, i as resolveRunWorkspaceDir, it as registerInternalHook, j as getTtsMaxLength, k as buildTtsSystemPromptHint, l as buildCliArgs, lt as resolveHeartbeatPrompt, m as normalizeCliModel, o as appendRunnerCapabilityPrompt, p as enqueueCliRun, q as setTtsProvider, r as redactRunIdentifier, rt as createInternalHookEvent, s as resolveAnimaDocsPath, t as runAnthropicDirectAgent, tt as resolveBootstrapContextForRun, u as buildSystemPrompt, ut as stripHeartbeatToken, v as resolveSessionIdToSend, w as resolveUserTimeFormat, x as buildAgentSystemPrompt, y as resolveSystemPromptUsage, z as resolveTtsAutoMode } from "./anthropic-direct-runner-C2Kwju-r.js";
|
|
22
22
|
import { S as resolveBootstrapMaxChars, _ as isFailoverErrorMessage, a as normalizeElevatedLevel, b as sanitizeUserFacingText, c as normalizeUsageDisplay, d as supportsXHighThinking, g as isContextOverflowError, h as isCompactionFailureError, l as normalizeVerboseLevel, n as formatXHighModelHint, o as normalizeReasoningLevel, p as classifyFailoverReason, s as normalizeThinkLevel, t as formatThinkingLevels, u as resolveResponseUsageMode, v as isLikelyContextOverflowError, y as isTransientHttpError } from "./pi-embedded-helpers-D2SLlgS4.js";
|
|
23
|
-
import { _ as resolveToolProfilePolicy, a as ensureSandboxWorkspaceForSession, c as resolveSandboxConfigForAgent, d as applyOwnerOnlyToolPolicy, f as buildPluginToolGroups, g as normalizeToolName, m as expandPolicyWithPluginGroups, o as resolveSandboxRuntimeStatus, p as collectExplicitAllowlist, s as getBridgeAuthForPort, v as stripPluginOnlyAllowlist } from "./sandbox-
|
|
23
|
+
import { _ as resolveToolProfilePolicy, a as ensureSandboxWorkspaceForSession, c as resolveSandboxConfigForAgent, d as applyOwnerOnlyToolPolicy, f as buildPluginToolGroups, g as normalizeToolName, m as expandPolicyWithPluginGroups, o as resolveSandboxRuntimeStatus, p as collectExplicitAllowlist, s as getBridgeAuthForPort, v as stripPluginOnlyAllowlist } from "./sandbox-D-N7M7lp.js";
|
|
24
24
|
import { x as DEFAULT_AI_SNAPSHOT_MAX_CHARS } from "./chrome-CmxIwwsr.js";
|
|
25
25
|
import { c as safeEqualSecret } from "./auth-Cp__MMeO.js";
|
|
26
|
-
import { a as resolveBrowserConfig, h as resolveBrowserControlAuth } from "./server-context-
|
|
27
|
-
import { a as resolvePathsWithinRoot, i as DEFAULT_UPLOAD_DIR, n as getMediaDir, r as saveMediaBuffer } from "./routes-
|
|
26
|
+
import { a as resolveBrowserConfig, h as resolveBrowserControlAuth } from "./server-context-Clykq0XU.js";
|
|
27
|
+
import { a as resolvePathsWithinRoot, i as DEFAULT_UPLOAD_DIR, n as getMediaDir, r as saveMediaBuffer } from "./routes-CWCAc8uJ.js";
|
|
28
28
|
import { n as formatErrorMessage, r as formatUncaughtError, t as extractErrorCode } from "./errors-COFgygw8.js";
|
|
29
29
|
import { a as resizeToJpeg, c as getFileExtension, d as kindFromMime, h as SsrFBlockedError, l as imageMimeFromFormat, m as mediaKindFromMime, n as getImageMetadata, o as detectMime, s as extensionForMime, u as isAudioFileName, v as isBlockedHostname, y as isPrivateIpAddress } from "./image-ops-BdrMmiG4.js";
|
|
30
30
|
import { n as listChannelPlugins, r as normalizeChannelId$1, t as getChannelPlugin } from "./plugins-BOMS6J5A.js";
|
|
31
31
|
import { a as resolveSessionTranscriptPathInDir, c as resolveStorePath$1, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, r as resolveSessionFilePathOptions } from "./paths-DMk3Q7yD.js";
|
|
32
32
|
import { t as sanitizeToolResultImages } from "./tool-images-D1HuaGdS.js";
|
|
33
|
-
import { i as resolveApiKeyForProvider, n as getCustomProviderApiKey, o as resolveEnvApiKey, r as requireApiKey, s as resolveModelAuthMode, t as getApiKeyForModel } from "./model-auth-
|
|
34
|
-
import { _ as throwIfAborted, b as initializeGlobalHookRunner, c as applyReplyThreading, d as shouldSuppressMessagingToolReplies, f as createReplyToModeFilterForChannel, g as normalizeTargetForProvider, h as normalizeChannelTargetInput, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, o as normalizeReplyPayloadsForDelivery, p as resolveReplyToMode, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as isRenderablePayload, v as parseReplyDirectives, y as getGlobalHookRunner } from "./deliver-
|
|
35
|
-
import { i as resolveMemoryBackendConfig, n as registerMemoryCli, r as getMemorySearchManager } from "./memory-cli-
|
|
36
|
-
import { n as resolveMemorySearchConfig } from "./manager-
|
|
33
|
+
import { i as resolveApiKeyForProvider, n as getCustomProviderApiKey, o as resolveEnvApiKey, r as requireApiKey, s as resolveModelAuthMode, t as getApiKeyForModel } from "./model-auth-KpsOXKDc.js";
|
|
34
|
+
import { _ as throwIfAborted, b as initializeGlobalHookRunner, c as applyReplyThreading, d as shouldSuppressMessagingToolReplies, f as createReplyToModeFilterForChannel, g as normalizeTargetForProvider, h as normalizeChannelTargetInput, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, o as normalizeReplyPayloadsForDelivery, p as resolveReplyToMode, s as applyReplyTagsToPayload, t as deliverOutboundPayloads, u as isRenderablePayload, v as parseReplyDirectives, y as getGlobalHookRunner } from "./deliver-C1L5nO0K.js";
|
|
35
|
+
import { i as resolveMemoryBackendConfig, n as registerMemoryCli, r as getMemorySearchManager } from "./memory-cli-B0kKl-9T.js";
|
|
36
|
+
import { n as resolveMemorySearchConfig } from "./manager-C6L_DH0O.js";
|
|
37
|
+
import { c as pruneExpiredPending, d as writeJsonAtomic, l as readJsonFile, s as createAsyncLock, u as resolvePairingPaths } from "./loader-C87TLS4J.js";
|
|
37
38
|
import { a as jsonResult, c as readStringArrayParam, i as imageResultFromFile, l as readStringParam, o as readNumberParam, r as imageResult } from "./common-CqIa2poH.js";
|
|
38
|
-
import { a as chunkText, c as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, o as chunkTextWithMode, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline } from "./chunk-
|
|
39
|
-
import { a as shouldHandleTextCommands, i as normalizeCommandBody, n as listChatCommands, r as listChatCommandsForConfig, t as parseTimeoutMs } from "./parse-timeout-
|
|
39
|
+
import { a as chunkText, c as resolveTextChunkLimit, i as chunkMarkdownTextWithMode, o as chunkTextWithMode, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline } from "./chunk-Cy0Bj0F3.js";
|
|
40
|
+
import { a as shouldHandleTextCommands, i as normalizeCommandBody, n as listChatCommands, r as listChatCommandsForConfig, t as parseTimeoutMs } from "./parse-timeout-D4UO8pY_.js";
|
|
40
41
|
import { n as formatTimeAgo } from "./format-relative-CBDSicUs.js";
|
|
41
42
|
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-gGCoq55D.js";
|
|
42
|
-
import { n as ensureAnimaModelsJson, t as lookupContextTokens } from "./context-
|
|
43
|
-
import { a as resolveSubagentToolPolicy, c as addChannelAllowFromStoreEntry, d as upsertChannelPairingRequest, f as listPairingChannels, i as resolveGroupToolPolicy, l as readChannelAllowFromStore, n as isToolAllowedByPolicies, o as resolveChannelGroupPolicy, r as resolveEffectiveToolPolicy, s as resolveChannelGroupRequireMention, t as filterToolsByPolicy, u as removeChannelAllowFromStoreEntry } from "./pi-tools.policy-
|
|
43
|
+
import { n as ensureAnimaModelsJson, t as lookupContextTokens } from "./context-B5X720Bs.js";
|
|
44
|
+
import { a as resolveSubagentToolPolicy, c as addChannelAllowFromStoreEntry, d as upsertChannelPairingRequest, f as listPairingChannels, i as resolveGroupToolPolicy, l as readChannelAllowFromStore, n as isToolAllowedByPolicies, o as resolveChannelGroupPolicy, r as resolveEffectiveToolPolicy, s as resolveChannelGroupRequireMention, t as filterToolsByPolicy, u as removeChannelAllowFromStoreEntry } from "./pi-tools.policy-D2FusuQa.js";
|
|
44
45
|
import { a as minSecurity, c as recordAllowlistUse, d as resolveExecApprovalsFromFile, g as resolveSafeBins, h as evaluateShellAllowlist, i as maxAsk, l as requiresExecApproval, n as addAllowlistEntry, u as resolveExecApprovals, v as buildSafeBinsShellCommand, y as buildSafeShellCommand } from "./exec-approvals-CpOeHRBL.js";
|
|
45
46
|
import { t as resolveNodeIdFromCandidates } from "./node-match-Cbt-ZqUE.js";
|
|
46
47
|
import { t as formatDurationCompact$1 } from "./format-duration-BoQ6ac8g.js";
|
|
47
48
|
import { c as derivePromptTokens, d as normalizeUsage, l as deriveSessionTotalTokens, n as loadCostUsageSummary, o as extractToolCallNames, r as loadSessionCostSummary, s as hasToolCall, u as hasNonzeroUsage } from "./session-cost-usage-DnxtnK1E.js";
|
|
48
49
|
import { i as resolveModelCostConfig, n as formatTokenCount$2, r as formatUsd, t as estimateUsageCost } from "./usage-format-BGCAJt5K.js";
|
|
49
50
|
import { d as resolveGatewaySystemdServiceName, l as resolveGatewayLaunchAgentLabel } from "./constants-Dt8s_a7s.js";
|
|
50
|
-
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-
|
|
51
|
-
import { t as createBrowserRouteDispatcher } from "./dispatcher-
|
|
51
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-3CI4vt1h.js";
|
|
52
|
+
import { t as createBrowserRouteDispatcher } from "./dispatcher-BQQugU-7.js";
|
|
52
53
|
import { t as parseAbsoluteTimeMs } from "./parse-DLMgOMDI.js";
|
|
53
|
-
import {
|
|
54
|
+
import { t as TOKEN_PATH } from "./noxsoft-auth-CgCk5707.js";
|
|
55
|
+
import { a as logoutWeb, c as readWebSelfId, f as webAuthExists, i as logWebSelfId, n as getWebAuthAgeMs } from "./auth-store-BEfSfCbW.js";
|
|
54
56
|
import { createRequire } from "node:module";
|
|
55
57
|
import { spawn, spawnSync } from "node:child_process";
|
|
56
58
|
import process$1 from "node:process";
|
|
@@ -721,13 +723,20 @@ function setCodexExecModeArgs(args, mode) {
|
|
|
721
723
|
else nextArgs.push("--sandbox", mode);
|
|
722
724
|
return nextArgs;
|
|
723
725
|
}
|
|
724
|
-
function
|
|
726
|
+
function normalizeExecSecurity$2(execSecurity) {
|
|
727
|
+
const normalized = execSecurity?.trim().toLowerCase();
|
|
728
|
+
if (!normalized) return;
|
|
729
|
+
if (normalized === "deny") return "deny";
|
|
730
|
+
return "full";
|
|
731
|
+
}
|
|
732
|
+
function resolveManagedCodexExecMode(cfg, options) {
|
|
733
|
+
if (normalizeExecSecurity$2(options?.execSecurity) === "deny") return "read-only";
|
|
725
734
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
726
735
|
if (workspaceAccess === "ro") return "read-only";
|
|
727
736
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
728
737
|
return CODEX_BYPASS_FLAG;
|
|
729
738
|
}
|
|
730
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
739
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
731
740
|
const normalized = normalizeBackendKey(provider);
|
|
732
741
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
733
742
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -755,7 +764,7 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
755
764
|
};
|
|
756
765
|
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
757
766
|
...merged,
|
|
758
|
-
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg))
|
|
767
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
759
768
|
};
|
|
760
769
|
const command = merged.command?.trim();
|
|
761
770
|
if (!command) return null;
|
|
@@ -934,14 +943,14 @@ async function runCliAgent(params) {
|
|
|
934
943
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
935
944
|
if (workspaceResolution.usedFallback) log$6.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
936
945
|
const workspaceDir = resolvedWorkspace;
|
|
937
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
946
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
938
947
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
939
948
|
const backend = backendResolved.config;
|
|
940
949
|
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
941
950
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
942
951
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
943
952
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
944
|
-
const extraSystemPrompt =
|
|
953
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
945
954
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
946
955
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
947
956
|
workspaceDir,
|
|
@@ -991,13 +1000,21 @@ async function runCliAgent(params) {
|
|
|
991
1000
|
const parsed = JSON.parse(lastLine);
|
|
992
1001
|
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
993
1002
|
const currentMode = effectiveCodexExecMode;
|
|
994
|
-
if (previousMode
|
|
1003
|
+
if (!previousMode) {
|
|
1004
|
+
log$6.info("Codex execution mode is unknown for the saved session; forcing session restart.");
|
|
1005
|
+
useResume = false;
|
|
1006
|
+
isNew = true;
|
|
1007
|
+
} else if (previousMode !== currentMode) {
|
|
995
1008
|
log$6.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
996
1009
|
useResume = false;
|
|
997
1010
|
isNew = true;
|
|
998
1011
|
}
|
|
999
1012
|
}
|
|
1000
|
-
} catch {
|
|
1013
|
+
} catch {
|
|
1014
|
+
log$6.info("Codex session transcript is unavailable; forcing session restart.");
|
|
1015
|
+
useResume = false;
|
|
1016
|
+
isNew = true;
|
|
1017
|
+
}
|
|
1001
1018
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
1002
1019
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
1003
1020
|
backend,
|
|
@@ -1113,8 +1130,9 @@ async function runCliAgent(params) {
|
|
|
1113
1130
|
if (stderr) log$6.debug(`cli stderr:\n${stderr}`);
|
|
1114
1131
|
}
|
|
1115
1132
|
if (result.code !== 0) {
|
|
1116
|
-
const
|
|
1117
|
-
const
|
|
1133
|
+
const timedOut = result.killed && result.signal === "SIGKILL";
|
|
1134
|
+
const err = timedOut ? `Request timed out after ${params.timeoutMs}ms` : stderr || stdout || "CLI failed.";
|
|
1135
|
+
const reason = timedOut ? "timeout" : classifyFailoverReason(err) ?? "unknown";
|
|
1118
1136
|
const status = resolveFailoverStatus(reason);
|
|
1119
1137
|
throw new FailoverError(err, {
|
|
1120
1138
|
reason,
|
|
@@ -4576,7 +4594,7 @@ async function loadModelCatalog(params) {
|
|
|
4576
4594
|
});
|
|
4577
4595
|
try {
|
|
4578
4596
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
4579
|
-
await (await import("./pi-auth-json-
|
|
4597
|
+
await (await import("./pi-auth-json-DkYqdjrV.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
4580
4598
|
const piSdk = await importPiSdk();
|
|
4581
4599
|
const agentDir = resolveAnimaAgentDir();
|
|
4582
4600
|
const { join } = await import("node:path");
|
|
@@ -6371,8 +6389,8 @@ const resolveProfileOverride = (params) => {
|
|
|
6371
6389
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
6372
6390
|
const PROVIDER_RANK = new Map([
|
|
6373
6391
|
"anthropic",
|
|
6374
|
-
"openai",
|
|
6375
6392
|
"openai-codex",
|
|
6393
|
+
"openai",
|
|
6376
6394
|
"minimax",
|
|
6377
6395
|
"synthetic",
|
|
6378
6396
|
"google",
|
|
@@ -6688,7 +6706,7 @@ async function createModelSelectionState(params) {
|
|
|
6688
6706
|
}
|
|
6689
6707
|
}
|
|
6690
6708
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
6691
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
6709
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-Brxz2ojJ.js").then((n) => n.t);
|
|
6692
6710
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
6693
6711
|
const providerKey = normalizeProviderId(provider);
|
|
6694
6712
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -7756,58 +7774,6 @@ function ensureSkillsWatcher(params) {
|
|
|
7756
7774
|
watchers.set(workspaceDir, state);
|
|
7757
7775
|
}
|
|
7758
7776
|
|
|
7759
|
-
//#endregion
|
|
7760
|
-
//#region src/infra/pairing-files.ts
|
|
7761
|
-
function resolvePairingPaths(baseDir, subdir) {
|
|
7762
|
-
const root = baseDir ?? resolveStateDir();
|
|
7763
|
-
const dir = path.join(root, subdir);
|
|
7764
|
-
return {
|
|
7765
|
-
dir,
|
|
7766
|
-
pendingPath: path.join(dir, "pending.json"),
|
|
7767
|
-
pairedPath: path.join(dir, "paired.json")
|
|
7768
|
-
};
|
|
7769
|
-
}
|
|
7770
|
-
async function readJsonFile(filePath) {
|
|
7771
|
-
try {
|
|
7772
|
-
const raw = await fs$1.readFile(filePath, "utf8");
|
|
7773
|
-
return JSON.parse(raw);
|
|
7774
|
-
} catch {
|
|
7775
|
-
return null;
|
|
7776
|
-
}
|
|
7777
|
-
}
|
|
7778
|
-
async function writeJsonAtomic(filePath, value) {
|
|
7779
|
-
const dir = path.dirname(filePath);
|
|
7780
|
-
await fs$1.mkdir(dir, { recursive: true });
|
|
7781
|
-
const tmp = `${filePath}.${randomUUID()}.tmp`;
|
|
7782
|
-
await fs$1.writeFile(tmp, JSON.stringify(value, null, 2), "utf8");
|
|
7783
|
-
try {
|
|
7784
|
-
await fs$1.chmod(tmp, 384);
|
|
7785
|
-
} catch {}
|
|
7786
|
-
await fs$1.rename(tmp, filePath);
|
|
7787
|
-
try {
|
|
7788
|
-
await fs$1.chmod(filePath, 384);
|
|
7789
|
-
} catch {}
|
|
7790
|
-
}
|
|
7791
|
-
function pruneExpiredPending(pendingById, nowMs, ttlMs) {
|
|
7792
|
-
for (const [id, req] of Object.entries(pendingById)) if (nowMs - req.ts > ttlMs) delete pendingById[id];
|
|
7793
|
-
}
|
|
7794
|
-
function createAsyncLock() {
|
|
7795
|
-
let lock = Promise.resolve();
|
|
7796
|
-
return async function withLock(fn) {
|
|
7797
|
-
const prev = lock;
|
|
7798
|
-
let release;
|
|
7799
|
-
lock = new Promise((resolve) => {
|
|
7800
|
-
release = resolve;
|
|
7801
|
-
});
|
|
7802
|
-
await prev;
|
|
7803
|
-
try {
|
|
7804
|
-
return await fn();
|
|
7805
|
-
} finally {
|
|
7806
|
-
release?.();
|
|
7807
|
-
}
|
|
7808
|
-
};
|
|
7809
|
-
}
|
|
7810
|
-
|
|
7811
7777
|
//#endregion
|
|
7812
7778
|
//#region src/infra/pairing-token.ts
|
|
7813
7779
|
const PAIRING_TOKEN_BYTES = 32;
|
|
@@ -16062,7 +16028,7 @@ async function routeReply(params) {
|
|
|
16062
16028
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
16063
16029
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
16064
16030
|
try {
|
|
16065
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
16031
|
+
const { deliverOutboundPayloads } = await import("./deliver-C1L5nO0K.js").then((n) => n.n);
|
|
16066
16032
|
return {
|
|
16067
16033
|
ok: true,
|
|
16068
16034
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -19477,6 +19443,275 @@ function createGatewayTool(opts) {
|
|
|
19477
19443
|
};
|
|
19478
19444
|
}
|
|
19479
19445
|
|
|
19446
|
+
//#endregion
|
|
19447
|
+
//#region src/agents/model-auto.ts
|
|
19448
|
+
const DEFAULT_USAGE_THRESHOLD_PERCENT = 5;
|
|
19449
|
+
const USAGE_CACHE_TTL_MS = 6e4;
|
|
19450
|
+
const USAGE_TIMEOUT_MS = 1500;
|
|
19451
|
+
const usageSummaryCache = /* @__PURE__ */ new Map();
|
|
19452
|
+
function resolveRawAutoConfig(cfg) {
|
|
19453
|
+
const modelConfig = cfg?.agents?.defaults?.model;
|
|
19454
|
+
if (typeof modelConfig !== "object" || !modelConfig) return;
|
|
19455
|
+
return modelConfig.auto;
|
|
19456
|
+
}
|
|
19457
|
+
function dedupeProviders(values) {
|
|
19458
|
+
const seen = /* @__PURE__ */ new Set();
|
|
19459
|
+
const result = [];
|
|
19460
|
+
for (const input of values) {
|
|
19461
|
+
if (!input) continue;
|
|
19462
|
+
const normalized = normalizeProviderId(input);
|
|
19463
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
19464
|
+
seen.add(normalized);
|
|
19465
|
+
result.push(normalized);
|
|
19466
|
+
}
|
|
19467
|
+
return result;
|
|
19468
|
+
}
|
|
19469
|
+
function resolveModelAutoConfig(cfg) {
|
|
19470
|
+
const raw = resolveRawAutoConfig(cfg);
|
|
19471
|
+
if (!raw?.enabled) return null;
|
|
19472
|
+
const byProvider = {};
|
|
19473
|
+
for (const [providerRaw, entry] of Object.entries(raw.byProvider ?? {})) {
|
|
19474
|
+
const provider = normalizeProviderId(providerRaw);
|
|
19475
|
+
if (!provider) continue;
|
|
19476
|
+
const models = Array.isArray(entry?.models) ? entry.models.map((value) => String(value ?? "").trim()).filter(Boolean) : [];
|
|
19477
|
+
if (models.length > 0) byProvider[provider] = { models };
|
|
19478
|
+
}
|
|
19479
|
+
const usageThresholdPercent = typeof raw.usageThresholdPercent === "number" && Number.isFinite(raw.usageThresholdPercent) ? Math.max(0, Math.min(100, raw.usageThresholdPercent)) : DEFAULT_USAGE_THRESHOLD_PERCENT;
|
|
19480
|
+
return {
|
|
19481
|
+
enabled: true,
|
|
19482
|
+
providerOrder: dedupeProviders(raw.providerOrder ?? []),
|
|
19483
|
+
byProvider,
|
|
19484
|
+
byWorkingMode: {
|
|
19485
|
+
read: Array.isArray(raw.byWorkingMode?.read) ? raw.byWorkingMode.read.map((value) => String(value ?? "").trim()).filter(Boolean) : [],
|
|
19486
|
+
write: Array.isArray(raw.byWorkingMode?.write) ? raw.byWorkingMode.write.map((value) => String(value ?? "").trim()).filter(Boolean) : []
|
|
19487
|
+
},
|
|
19488
|
+
usageCheck: raw.usageCheck === "prefer-available" ? "prefer-available" : "off",
|
|
19489
|
+
usageThresholdPercent
|
|
19490
|
+
};
|
|
19491
|
+
}
|
|
19492
|
+
function buildCandidatesFromRawModels(params) {
|
|
19493
|
+
const defaultProvider = params.defaultProvider ?? DEFAULT_PROVIDER;
|
|
19494
|
+
const index = buildModelAliasIndex({
|
|
19495
|
+
cfg: params.cfg ?? {},
|
|
19496
|
+
defaultProvider
|
|
19497
|
+
});
|
|
19498
|
+
const seen = /* @__PURE__ */ new Set();
|
|
19499
|
+
const out = [];
|
|
19500
|
+
for (const raw of params.rawModels) {
|
|
19501
|
+
const resolved = resolveModelRefFromString({
|
|
19502
|
+
raw,
|
|
19503
|
+
defaultProvider,
|
|
19504
|
+
aliasIndex: index
|
|
19505
|
+
});
|
|
19506
|
+
if (!resolved) continue;
|
|
19507
|
+
const key = modelKey(resolved.ref.provider, resolved.ref.model);
|
|
19508
|
+
if (seen.has(key)) continue;
|
|
19509
|
+
seen.add(key);
|
|
19510
|
+
out.push(resolved.ref);
|
|
19511
|
+
}
|
|
19512
|
+
return out;
|
|
19513
|
+
}
|
|
19514
|
+
function resolveWorkingModeModelSelection(params) {
|
|
19515
|
+
if (!params.workingMode) return null;
|
|
19516
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
19517
|
+
if (!autoConfig) return null;
|
|
19518
|
+
const modeModels = autoConfig.byWorkingMode[params.workingMode];
|
|
19519
|
+
if (!modeModels || modeModels.length === 0) return null;
|
|
19520
|
+
return buildCandidatesFromRawModels({
|
|
19521
|
+
rawModels: modeModels,
|
|
19522
|
+
cfg: params.cfg,
|
|
19523
|
+
defaultProvider: params.defaultProvider
|
|
19524
|
+
})[0] ?? null;
|
|
19525
|
+
}
|
|
19526
|
+
async function loadUsageSummary(agentDir, providers) {
|
|
19527
|
+
const key = `${agentDir ?? "main"}::${providers.slice().toSorted().join(",")}`;
|
|
19528
|
+
const now = Date.now();
|
|
19529
|
+
const cached = usageSummaryCache.get(key);
|
|
19530
|
+
if (cached && cached.expiresAt > now) return cached.summary;
|
|
19531
|
+
const summary = await loadProviderUsageSummary({
|
|
19532
|
+
agentDir,
|
|
19533
|
+
providers,
|
|
19534
|
+
timeoutMs: USAGE_TIMEOUT_MS
|
|
19535
|
+
});
|
|
19536
|
+
usageSummaryCache.set(key, {
|
|
19537
|
+
expiresAt: now + USAGE_CACHE_TTL_MS,
|
|
19538
|
+
summary
|
|
19539
|
+
});
|
|
19540
|
+
return summary;
|
|
19541
|
+
}
|
|
19542
|
+
function remainingPercent(snapshot) {
|
|
19543
|
+
if (snapshot.error || snapshot.windows.length === 0) return;
|
|
19544
|
+
const values = snapshot.windows.map((window) => 100 - window.usedPercent).filter((value) => Number.isFinite(value));
|
|
19545
|
+
if (values.length === 0) return;
|
|
19546
|
+
return Math.max(0, Math.min(...values));
|
|
19547
|
+
}
|
|
19548
|
+
async function resolveAvailability(params) {
|
|
19549
|
+
const availability = /* @__PURE__ */ new Map();
|
|
19550
|
+
const usageProviders = Array.from(new Set(params.providerOrder.map((provider) => resolveUsageProviderId(provider)).filter((provider) => Boolean(provider))));
|
|
19551
|
+
let summary;
|
|
19552
|
+
if (usageProviders.length > 0) try {
|
|
19553
|
+
summary = await loadUsageSummary(params.agentDir, usageProviders);
|
|
19554
|
+
} catch {
|
|
19555
|
+
summary = void 0;
|
|
19556
|
+
}
|
|
19557
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
19558
|
+
for (const entry of summary?.providers ?? []) snapshots.set(entry.provider, entry);
|
|
19559
|
+
for (const provider of params.providerOrder) {
|
|
19560
|
+
const usageProvider = resolveUsageProviderId(provider);
|
|
19561
|
+
if (!usageProvider) {
|
|
19562
|
+
availability.set(provider, {
|
|
19563
|
+
provider,
|
|
19564
|
+
state: "unknown"
|
|
19565
|
+
});
|
|
19566
|
+
continue;
|
|
19567
|
+
}
|
|
19568
|
+
const snapshot = snapshots.get(usageProvider);
|
|
19569
|
+
const percent = snapshot ? remainingPercent(snapshot) : void 0;
|
|
19570
|
+
availability.set(provider, {
|
|
19571
|
+
provider,
|
|
19572
|
+
usageProvider,
|
|
19573
|
+
remainingPercent: percent,
|
|
19574
|
+
state: percent === void 0 ? "unknown" : percent <= params.autoConfig.usageThresholdPercent ? "exhausted" : "available"
|
|
19575
|
+
});
|
|
19576
|
+
}
|
|
19577
|
+
return availability;
|
|
19578
|
+
}
|
|
19579
|
+
function reorderByAvailability(params) {
|
|
19580
|
+
const lockedPrimary = params.preservePrimary ? params.candidates[0] : void 0;
|
|
19581
|
+
const rest = params.preservePrimary ? params.candidates.slice(1) : params.candidates;
|
|
19582
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
19583
|
+
for (const candidate of rest) {
|
|
19584
|
+
const normalized = normalizeProviderId(candidate.provider);
|
|
19585
|
+
const group = grouped.get(normalized) ?? [];
|
|
19586
|
+
group.push({
|
|
19587
|
+
provider: normalized,
|
|
19588
|
+
model: candidate.model
|
|
19589
|
+
});
|
|
19590
|
+
grouped.set(normalized, group);
|
|
19591
|
+
}
|
|
19592
|
+
const order = [];
|
|
19593
|
+
for (const [provider, availability] of params.availability) if (availability.state === "available") order.push(provider);
|
|
19594
|
+
for (const [provider, availability] of params.availability) if (availability.state === "unknown") order.push(provider);
|
|
19595
|
+
for (const [provider, availability] of params.availability) if (availability.state === "exhausted") order.push(provider);
|
|
19596
|
+
for (const provider of grouped.keys()) if (!order.includes(provider)) order.push(provider);
|
|
19597
|
+
const ordered = [];
|
|
19598
|
+
for (const provider of order) {
|
|
19599
|
+
const group = grouped.get(provider) ?? [];
|
|
19600
|
+
ordered.push(...group);
|
|
19601
|
+
}
|
|
19602
|
+
return lockedPrimary ? [lockedPrimary, ...ordered] : ordered;
|
|
19603
|
+
}
|
|
19604
|
+
async function applyAutoModelRouting(params) {
|
|
19605
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
19606
|
+
if (!autoConfig) return {
|
|
19607
|
+
candidates: [...params.candidates],
|
|
19608
|
+
autoConfigured: false,
|
|
19609
|
+
preserveProviderOrder: false,
|
|
19610
|
+
availabilityByProvider: /* @__PURE__ */ new Map()
|
|
19611
|
+
};
|
|
19612
|
+
const providerOrder = dedupeProviders([...autoConfig.providerOrder, ...params.candidates.map((candidate) => candidate.provider)]);
|
|
19613
|
+
let candidates = [...params.candidates];
|
|
19614
|
+
const modePreferred = params.workingMode ? buildCandidatesFromRawModels({
|
|
19615
|
+
rawModels: autoConfig.byWorkingMode[params.workingMode] ?? [],
|
|
19616
|
+
cfg: params.cfg,
|
|
19617
|
+
defaultProvider: params.candidates[0]?.provider ?? DEFAULT_PROVIDER
|
|
19618
|
+
}) : [];
|
|
19619
|
+
if (modePreferred.length > 0) {
|
|
19620
|
+
const lockedPrimary = params.preservePrimary && candidates.length > 0 ? [candidates[0]] : [];
|
|
19621
|
+
const remainingCandidates = params.preservePrimary ? candidates.slice(1) : candidates;
|
|
19622
|
+
const seen = /* @__PURE__ */ new Set();
|
|
19623
|
+
candidates = [
|
|
19624
|
+
...lockedPrimary,
|
|
19625
|
+
...modePreferred,
|
|
19626
|
+
...remainingCandidates
|
|
19627
|
+
].filter((candidate) => {
|
|
19628
|
+
const key = modelKey(candidate.provider, candidate.model);
|
|
19629
|
+
if (seen.has(key)) return false;
|
|
19630
|
+
seen.add(key);
|
|
19631
|
+
return true;
|
|
19632
|
+
});
|
|
19633
|
+
}
|
|
19634
|
+
const availability = await resolveAvailability({
|
|
19635
|
+
providerOrder,
|
|
19636
|
+
agentDir: params.agentDir,
|
|
19637
|
+
autoConfig
|
|
19638
|
+
});
|
|
19639
|
+
if (autoConfig.usageCheck === "prefer-available") candidates = reorderByAvailability({
|
|
19640
|
+
candidates,
|
|
19641
|
+
availability,
|
|
19642
|
+
preservePrimary: params.preservePrimary
|
|
19643
|
+
});
|
|
19644
|
+
return {
|
|
19645
|
+
candidates,
|
|
19646
|
+
autoConfigured: true,
|
|
19647
|
+
preserveProviderOrder: true,
|
|
19648
|
+
config: autoConfig,
|
|
19649
|
+
availabilityByProvider: availability
|
|
19650
|
+
};
|
|
19651
|
+
}
|
|
19652
|
+
|
|
19653
|
+
//#endregion
|
|
19654
|
+
//#region src/agents/model-preference.ts
|
|
19655
|
+
const HIGH_THINK_LEVELS = new Set(["high", "xhigh"]);
|
|
19656
|
+
const SESSION_COST_THRESHOLD_USD = .5;
|
|
19657
|
+
const SESSION_TOKEN_THRESHOLD = 3e5;
|
|
19658
|
+
const SESSION_TURN_THRESHOLD = 12;
|
|
19659
|
+
const SESSION_COMPACTION_THRESHOLD = 2;
|
|
19660
|
+
function toPositiveFiniteNumber(value) {
|
|
19661
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
19662
|
+
return value;
|
|
19663
|
+
}
|
|
19664
|
+
function shouldPreferCheap(entry) {
|
|
19665
|
+
if (!entry) return false;
|
|
19666
|
+
const sessionCostUsd = toPositiveFiniteNumber(entry.sessionEstimatedCostUsdTotal) ?? 0;
|
|
19667
|
+
const sessionInputTokens = toPositiveFiniteNumber(entry.sessionInputTokensTotal) ?? 0;
|
|
19668
|
+
const sessionOutputTokens = toPositiveFiniteNumber(entry.sessionOutputTokensTotal) ?? 0;
|
|
19669
|
+
const sessionTurnCount = toPositiveFiniteNumber(entry.sessionTurnCount) ?? 0;
|
|
19670
|
+
const compactionCount = toPositiveFiniteNumber(entry.compactionCount) ?? 0;
|
|
19671
|
+
return sessionCostUsd >= SESSION_COST_THRESHOLD_USD || sessionInputTokens + sessionOutputTokens >= SESSION_TOKEN_THRESHOLD || sessionTurnCount >= SESSION_TURN_THRESHOLD || compactionCount >= SESSION_COMPACTION_THRESHOLD;
|
|
19672
|
+
}
|
|
19673
|
+
function resolveCandidateCostScore(candidate, cfg) {
|
|
19674
|
+
const cost = resolveModelCostConfig({
|
|
19675
|
+
provider: candidate.provider,
|
|
19676
|
+
model: candidate.model,
|
|
19677
|
+
config: cfg
|
|
19678
|
+
});
|
|
19679
|
+
if (!cost) return;
|
|
19680
|
+
const values = [
|
|
19681
|
+
cost.input,
|
|
19682
|
+
cost.output,
|
|
19683
|
+
cost.cacheRead,
|
|
19684
|
+
cost.cacheWrite
|
|
19685
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
19686
|
+
if (values.length === 0) return;
|
|
19687
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
19688
|
+
}
|
|
19689
|
+
function resolveUsageAwareModelPreference(params) {
|
|
19690
|
+
if (params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride) return "preserve";
|
|
19691
|
+
if (params.thinkLevel && HIGH_THINK_LEVELS.has(params.thinkLevel)) return "prefer-strong";
|
|
19692
|
+
if (shouldPreferCheap(params.sessionEntry)) return "prefer-cheap";
|
|
19693
|
+
return "preserve";
|
|
19694
|
+
}
|
|
19695
|
+
function orderCandidatesByPreference(params) {
|
|
19696
|
+
const preferenceMode = params.preferenceMode ?? "preserve";
|
|
19697
|
+
if (preferenceMode === "preserve" || params.candidates.length <= 1) return [...params.candidates];
|
|
19698
|
+
const scoredCandidates = params.candidates.map((candidate) => ({
|
|
19699
|
+
candidate,
|
|
19700
|
+
score: resolveCandidateCostScore(candidate, params.cfg)
|
|
19701
|
+
}));
|
|
19702
|
+
const sortable = scoredCandidates.filter((entry) => entry.score !== void 0);
|
|
19703
|
+
if (sortable.length < 2) return [...params.candidates];
|
|
19704
|
+
sortable.sort((left, right) => preferenceMode === "prefer-cheap" ? left.score - right.score : right.score - left.score);
|
|
19705
|
+
const reordered = sortable.map((entry) => entry.candidate);
|
|
19706
|
+
let reorderedIndex = 0;
|
|
19707
|
+
return scoredCandidates.map((entry) => {
|
|
19708
|
+
if (entry.score === void 0) return entry.candidate;
|
|
19709
|
+
const next = reordered[reorderedIndex];
|
|
19710
|
+
reorderedIndex += 1;
|
|
19711
|
+
return next;
|
|
19712
|
+
});
|
|
19713
|
+
}
|
|
19714
|
+
|
|
19480
19715
|
//#endregion
|
|
19481
19716
|
//#region src/agents/model-fallback.ts
|
|
19482
19717
|
/**
|
|
@@ -19578,12 +19813,32 @@ function resolveFallbackCandidates(params) {
|
|
|
19578
19813
|
}, false);
|
|
19579
19814
|
return candidates;
|
|
19580
19815
|
}
|
|
19816
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
19817
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
19818
|
+
if (!execSecurity) return;
|
|
19819
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
19820
|
+
}
|
|
19581
19821
|
async function runWithModelFallback(params) {
|
|
19582
|
-
const
|
|
19822
|
+
const preservePrimary = Boolean(params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride);
|
|
19823
|
+
const resolvedWorkingMode = params.workingMode ?? resolveWorkingModeFromSessionEntry(params.sessionEntry);
|
|
19824
|
+
const candidates = orderCandidatesByPreference({
|
|
19825
|
+
candidates: (await applyAutoModelRouting({
|
|
19826
|
+
candidates: resolveFallbackCandidates({
|
|
19827
|
+
cfg: params.cfg,
|
|
19828
|
+
provider: params.provider,
|
|
19829
|
+
model: params.model,
|
|
19830
|
+
fallbacksOverride: params.fallbacksOverride
|
|
19831
|
+
}),
|
|
19832
|
+
cfg: params.cfg,
|
|
19833
|
+
agentDir: params.agentDir,
|
|
19834
|
+
preservePrimary,
|
|
19835
|
+
workingMode: resolvedWorkingMode
|
|
19836
|
+
})).candidates,
|
|
19583
19837
|
cfg: params.cfg,
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19838
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
19839
|
+
thinkLevel: params.thinkLevel,
|
|
19840
|
+
sessionEntry: params.sessionEntry
|
|
19841
|
+
})
|
|
19587
19842
|
});
|
|
19588
19843
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
19589
19844
|
const attempts = [];
|
|
@@ -20697,6 +20952,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
20697
20952
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
20698
20953
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
20699
20954
|
}
|
|
20955
|
+
function resolveConfiguredNoxsoftTarget(params) {
|
|
20956
|
+
const trimmed = params.input.trim();
|
|
20957
|
+
if (!trimmed) return null;
|
|
20958
|
+
const configured = params.cfg.channels?.noxsoft?.channels;
|
|
20959
|
+
if (!configured) return null;
|
|
20960
|
+
const lower = trimmed.toLowerCase();
|
|
20961
|
+
for (const [name, entry] of Object.entries(configured)) {
|
|
20962
|
+
const channelId = entry?.id?.trim();
|
|
20963
|
+
if (!channelId) continue;
|
|
20964
|
+
if (lower === name.trim().toLowerCase() || trimmed === channelId) return {
|
|
20965
|
+
to: channelId,
|
|
20966
|
+
kind: "channel",
|
|
20967
|
+
display: name,
|
|
20968
|
+
source: "normalized"
|
|
20969
|
+
};
|
|
20970
|
+
}
|
|
20971
|
+
return null;
|
|
20972
|
+
}
|
|
20700
20973
|
async function resolveMessagingTarget(params) {
|
|
20701
20974
|
const raw = normalizeChannelTargetInput(params.input);
|
|
20702
20975
|
if (!raw) return {
|
|
@@ -20708,6 +20981,16 @@ async function resolveMessagingTarget(params) {
|
|
|
20708
20981
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
20709
20982
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
20710
20983
|
const normalized = normalizeTargetForProvider(params.channel, raw) ?? raw;
|
|
20984
|
+
if (params.channel === "noxsoft") {
|
|
20985
|
+
const configuredTarget = resolveConfiguredNoxsoftTarget({
|
|
20986
|
+
cfg: params.cfg,
|
|
20987
|
+
input: raw
|
|
20988
|
+
});
|
|
20989
|
+
if (configuredTarget) return {
|
|
20990
|
+
ok: true,
|
|
20991
|
+
target: configuredTarget
|
|
20992
|
+
};
|
|
20993
|
+
}
|
|
20711
20994
|
const looksLikeTargetId = () => {
|
|
20712
20995
|
const trimmed = raw.trim();
|
|
20713
20996
|
if (!trimmed) return false;
|
|
@@ -21123,13 +21406,62 @@ function resolveGatewayOptions(opts) {
|
|
|
21123
21406
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
21124
21407
|
};
|
|
21125
21408
|
}
|
|
21409
|
+
function resolveNoxsoftApiBase(cfg) {
|
|
21410
|
+
return cfg.channels?.noxsoft?.apiUrl?.trim() || "https://auth.noxsoft.net";
|
|
21411
|
+
}
|
|
21412
|
+
function resolveNoxsoftToken(cfg) {
|
|
21413
|
+
const inlineToken = cfg.channels?.noxsoft?.token?.trim();
|
|
21414
|
+
if (inlineToken) return inlineToken;
|
|
21415
|
+
const tokenFile = cfg.channels?.noxsoft?.tokenFile?.trim() || TOKEN_PATH;
|
|
21416
|
+
try {
|
|
21417
|
+
const token = fs.readFileSync(tokenFile, "utf-8").trim();
|
|
21418
|
+
if (token) return token;
|
|
21419
|
+
} catch {}
|
|
21420
|
+
throw new Error(`NoxSoft token not configured. Expected token in ${tokenFile}`);
|
|
21421
|
+
}
|
|
21422
|
+
async function sendNoxsoftMessageDirect(params) {
|
|
21423
|
+
if (params.dryRun) return {
|
|
21424
|
+
channel: "noxsoft",
|
|
21425
|
+
to: params.to,
|
|
21426
|
+
via: "direct",
|
|
21427
|
+
mediaUrl: params.mediaUrl,
|
|
21428
|
+
mediaUrls: params.mediaUrls,
|
|
21429
|
+
dryRun: true
|
|
21430
|
+
};
|
|
21431
|
+
const token = resolveNoxsoftToken(params.cfg);
|
|
21432
|
+
const apiBase = resolveNoxsoftApiBase(params.cfg).replace(/\/+$/, "");
|
|
21433
|
+
const response = await fetch(`${apiBase}/api/agents/chat/channels/${params.to}/messages`, {
|
|
21434
|
+
method: "POST",
|
|
21435
|
+
headers: {
|
|
21436
|
+
Authorization: `Bearer ${token}`,
|
|
21437
|
+
"Content-Type": "application/json"
|
|
21438
|
+
},
|
|
21439
|
+
body: JSON.stringify({
|
|
21440
|
+
content: params.content,
|
|
21441
|
+
mediaUrl: params.mediaUrl ?? void 0,
|
|
21442
|
+
mediaUrls: params.mediaUrls?.length ? params.mediaUrls : void 0
|
|
21443
|
+
}),
|
|
21444
|
+
signal: params.abortSignal
|
|
21445
|
+
});
|
|
21446
|
+
if (!response.ok) {
|
|
21447
|
+
const text = await response.text().catch(() => "");
|
|
21448
|
+
throw new Error(`NoxSoft send failed (${response.status}): ${text}`);
|
|
21449
|
+
}
|
|
21450
|
+
const payload = await response.json().catch(() => ({}));
|
|
21451
|
+
const messageId = payload.messageId ?? payload.id ?? `noxsoft:${Date.now()}`;
|
|
21452
|
+
return {
|
|
21453
|
+
channel: "noxsoft",
|
|
21454
|
+
to: params.to,
|
|
21455
|
+
via: "direct",
|
|
21456
|
+
mediaUrl: params.mediaUrl,
|
|
21457
|
+
mediaUrls: params.mediaUrls,
|
|
21458
|
+
result: { messageId }
|
|
21459
|
+
};
|
|
21460
|
+
}
|
|
21126
21461
|
async function sendMessage(params) {
|
|
21127
21462
|
const cfg = params.cfg ?? loadConfig();
|
|
21128
|
-
const channel = params.channel?.trim() ?
|
|
21463
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
21129
21464
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
21130
|
-
const plugin = getChannelPlugin(channel);
|
|
21131
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
21132
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
21133
21465
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
21134
21466
|
text: params.content,
|
|
21135
21467
|
mediaUrl: params.mediaUrl,
|
|
@@ -21138,6 +21470,18 @@ async function sendMessage(params) {
|
|
|
21138
21470
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
21139
21471
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
21140
21472
|
const primaryMediaUrl = mirrorMediaUrls[0] ?? params.mediaUrl ?? null;
|
|
21473
|
+
if (channel === "noxsoft") return sendNoxsoftMessageDirect({
|
|
21474
|
+
cfg,
|
|
21475
|
+
to: params.to,
|
|
21476
|
+
content: params.content,
|
|
21477
|
+
mediaUrl: primaryMediaUrl,
|
|
21478
|
+
mediaUrls: mirrorMediaUrls.length ? mirrorMediaUrls : void 0,
|
|
21479
|
+
dryRun: params.dryRun,
|
|
21480
|
+
abortSignal: params.abortSignal
|
|
21481
|
+
});
|
|
21482
|
+
const plugin = getChannelPlugin(channel);
|
|
21483
|
+
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
21484
|
+
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
21141
21485
|
if (params.dryRun) return {
|
|
21142
21486
|
channel,
|
|
21143
21487
|
to: params.to,
|
|
@@ -21216,7 +21560,7 @@ async function sendMessage(params) {
|
|
|
21216
21560
|
}
|
|
21217
21561
|
async function sendPoll(params) {
|
|
21218
21562
|
const cfg = params.cfg ?? loadConfig();
|
|
21219
|
-
const channel = params.channel?.trim() ?
|
|
21563
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
21220
21564
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
21221
21565
|
const pollInput = {
|
|
21222
21566
|
question: params.question,
|
|
@@ -28952,6 +29296,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
28952
29296
|
provider: params.followupRun.run.provider,
|
|
28953
29297
|
model: params.followupRun.run.model,
|
|
28954
29298
|
agentDir: params.followupRun.run.agentDir,
|
|
29299
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
29300
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
28955
29301
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
28956
29302
|
run: (provider, model) => {
|
|
28957
29303
|
params.opts?.onModelSelected?.({
|
|
@@ -28959,97 +29305,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
28959
29305
|
model,
|
|
28960
29306
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
28961
29307
|
});
|
|
28962
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
28963
|
-
const startedAt = Date.now();
|
|
28964
|
-
emitAgentEvent$1({
|
|
28965
|
-
runId,
|
|
28966
|
-
stream: "lifecycle",
|
|
28967
|
-
data: {
|
|
28968
|
-
phase: "start",
|
|
28969
|
-
startedAt
|
|
28970
|
-
}
|
|
28971
|
-
});
|
|
28972
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
28973
|
-
return (async () => {
|
|
28974
|
-
let lifecycleTerminalEmitted = false;
|
|
28975
|
-
let sawCliStream = false;
|
|
28976
|
-
let lastCliStreamText = "";
|
|
28977
|
-
try {
|
|
28978
|
-
const result = await runCliAgent({
|
|
28979
|
-
sessionId: params.followupRun.run.sessionId,
|
|
28980
|
-
sessionKey: params.sessionKey,
|
|
28981
|
-
agentId: params.followupRun.run.agentId,
|
|
28982
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
28983
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
28984
|
-
config: params.followupRun.run.config,
|
|
28985
|
-
prompt: params.commandBody,
|
|
28986
|
-
provider,
|
|
28987
|
-
model,
|
|
28988
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
28989
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
28990
|
-
runId,
|
|
28991
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
28992
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
28993
|
-
cliSessionId,
|
|
28994
|
-
images: params.opts?.images,
|
|
28995
|
-
onTextStream: (text) => {
|
|
28996
|
-
const nextText = text.trim();
|
|
28997
|
-
if (!nextText) return;
|
|
28998
|
-
sawCliStream = true;
|
|
28999
|
-
lastCliStreamText = nextText;
|
|
29000
|
-
emitAgentEvent$1({
|
|
29001
|
-
runId,
|
|
29002
|
-
stream: "assistant",
|
|
29003
|
-
data: { text: nextText }
|
|
29004
|
-
});
|
|
29005
|
-
}
|
|
29006
|
-
});
|
|
29007
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
29008
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
29009
|
-
runId,
|
|
29010
|
-
stream: "assistant",
|
|
29011
|
-
data: { text: cliText }
|
|
29012
|
-
});
|
|
29013
|
-
emitAgentEvent$1({
|
|
29014
|
-
runId,
|
|
29015
|
-
stream: "lifecycle",
|
|
29016
|
-
data: {
|
|
29017
|
-
phase: "end",
|
|
29018
|
-
startedAt,
|
|
29019
|
-
endedAt: Date.now()
|
|
29020
|
-
}
|
|
29021
|
-
});
|
|
29022
|
-
lifecycleTerminalEmitted = true;
|
|
29023
|
-
return result;
|
|
29024
|
-
} catch (err) {
|
|
29025
|
-
emitAgentEvent$1({
|
|
29026
|
-
runId,
|
|
29027
|
-
stream: "lifecycle",
|
|
29028
|
-
data: {
|
|
29029
|
-
phase: "error",
|
|
29030
|
-
startedAt,
|
|
29031
|
-
endedAt: Date.now(),
|
|
29032
|
-
error: String(err)
|
|
29033
|
-
}
|
|
29034
|
-
});
|
|
29035
|
-
lifecycleTerminalEmitted = true;
|
|
29036
|
-
throw err;
|
|
29037
|
-
} finally {
|
|
29038
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
29039
|
-
runId,
|
|
29040
|
-
stream: "lifecycle",
|
|
29041
|
-
data: {
|
|
29042
|
-
phase: "error",
|
|
29043
|
-
startedAt,
|
|
29044
|
-
endedAt: Date.now(),
|
|
29045
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
29046
|
-
}
|
|
29047
|
-
});
|
|
29048
|
-
}
|
|
29049
|
-
})();
|
|
29050
|
-
}
|
|
29051
29308
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
29052
|
-
return
|
|
29309
|
+
return runNoxSoftEmbeddedAgent({
|
|
29053
29310
|
sessionId: params.followupRun.run.sessionId,
|
|
29054
29311
|
sessionKey: params.sessionKey,
|
|
29055
29312
|
agentId: params.followupRun.run.agentId,
|
|
@@ -29086,6 +29343,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
29086
29343
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
29087
29344
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
29088
29345
|
execOverrides: params.followupRun.run.execOverrides,
|
|
29346
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
29347
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
29089
29348
|
toolResultFormat: (() => {
|
|
29090
29349
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
29091
29350
|
if (!channel) return "markdown";
|
|
@@ -29117,6 +29376,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
29117
29376
|
});
|
|
29118
29377
|
} : void 0,
|
|
29119
29378
|
onAgentEvent: async (evt) => {
|
|
29379
|
+
emitAgentEvent$1({
|
|
29380
|
+
runId,
|
|
29381
|
+
stream: evt.stream,
|
|
29382
|
+
data: evt.data
|
|
29383
|
+
});
|
|
29120
29384
|
if (evt.stream === "tool") {
|
|
29121
29385
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
29122
29386
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -29386,10 +29650,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
29386
29650
|
provider: params.followupRun.run.provider,
|
|
29387
29651
|
model: params.followupRun.run.model,
|
|
29388
29652
|
agentDir: params.followupRun.run.agentDir,
|
|
29653
|
+
sessionEntry: params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0) ?? void 0,
|
|
29654
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
29389
29655
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
29390
29656
|
run: (provider, model) => {
|
|
29391
29657
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
29392
|
-
return
|
|
29658
|
+
return runNoxSoftEmbeddedAgent({
|
|
29393
29659
|
sessionId: params.followupRun.run.sessionId,
|
|
29394
29660
|
sessionKey: params.sessionKey,
|
|
29395
29661
|
agentId: params.followupRun.run.agentId,
|
|
@@ -29423,6 +29689,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
29423
29689
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
29424
29690
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
29425
29691
|
execOverrides: params.followupRun.run.execOverrides,
|
|
29692
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
29426
29693
|
bashElevated: params.followupRun.run.bashElevated,
|
|
29427
29694
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
29428
29695
|
runId: flushRunId,
|
|
@@ -29758,10 +30025,12 @@ function createFollowupRunner(params) {
|
|
|
29758
30025
|
provider: queued.run.provider,
|
|
29759
30026
|
model: queued.run.model,
|
|
29760
30027
|
agentDir: queued.run.agentDir,
|
|
30028
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
30029
|
+
thinkLevel: queued.run.thinkLevel,
|
|
29761
30030
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
29762
30031
|
run: (provider, model) => {
|
|
29763
30032
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
29764
|
-
return
|
|
30033
|
+
return runNoxSoftEmbeddedAgent({
|
|
29765
30034
|
sessionId: queued.run.sessionId,
|
|
29766
30035
|
sessionKey: queued.run.sessionKey,
|
|
29767
30036
|
agentId: queued.run.agentId,
|
|
@@ -29792,6 +30061,7 @@ function createFollowupRunner(params) {
|
|
|
29792
30061
|
verboseLevel: queued.run.verboseLevel,
|
|
29793
30062
|
reasoningLevel: queued.run.reasoningLevel,
|
|
29794
30063
|
execOverrides: queued.run.execOverrides,
|
|
30064
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
29795
30065
|
bashElevated: queued.run.bashElevated,
|
|
29796
30066
|
timeoutMs: queued.run.timeoutMs,
|
|
29797
30067
|
runId,
|
|
@@ -30772,7 +31042,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
30772
31042
|
return;
|
|
30773
31043
|
}
|
|
30774
31044
|
try {
|
|
30775
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
31045
|
+
const { deliverOutboundPayloads } = await import("./deliver-C1L5nO0K.js").then((n) => n.n);
|
|
30776
31046
|
await deliverOutboundPayloads({
|
|
30777
31047
|
cfg: params.cfg,
|
|
30778
31048
|
channel,
|
|
@@ -32209,7 +32479,7 @@ function createWhatsAppLoginTool() {
|
|
|
32209
32479
|
force: Type.Optional(Type.Boolean())
|
|
32210
32480
|
}),
|
|
32211
32481
|
execute: async (_toolCallId, args) => {
|
|
32212
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
32482
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-DILcBA_q.js");
|
|
32213
32483
|
if ((args?.action ?? "start") === "wait") {
|
|
32214
32484
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
32215
32485
|
return {
|
|
@@ -32384,23 +32654,23 @@ let webLoginQrPromise = null;
|
|
|
32384
32654
|
let webChannelPromise = null;
|
|
32385
32655
|
let whatsappActionsPromise = null;
|
|
32386
32656
|
function loadWebOutbound() {
|
|
32387
|
-
webOutboundPromise ??= import("./outbound-
|
|
32657
|
+
webOutboundPromise ??= import("./outbound-C577aWZp.js").then((n) => n.t);
|
|
32388
32658
|
return webOutboundPromise;
|
|
32389
32659
|
}
|
|
32390
32660
|
function loadWebLogin() {
|
|
32391
|
-
webLoginPromise ??= import("./login-
|
|
32661
|
+
webLoginPromise ??= import("./login-CrMpAZ0n.js").then((n) => n.n);
|
|
32392
32662
|
return webLoginPromise;
|
|
32393
32663
|
}
|
|
32394
32664
|
function loadWebLoginQr() {
|
|
32395
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
32665
|
+
webLoginQrPromise ??= import("./login-qr-DILcBA_q.js");
|
|
32396
32666
|
return webLoginQrPromise;
|
|
32397
32667
|
}
|
|
32398
32668
|
function loadWebChannel() {
|
|
32399
|
-
webChannelPromise ??= import("./web-
|
|
32669
|
+
webChannelPromise ??= import("./web-DvTXV-fo.js");
|
|
32400
32670
|
return webChannelPromise;
|
|
32401
32671
|
}
|
|
32402
32672
|
function loadWhatsAppActions() {
|
|
32403
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
32673
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-C0tlEdLy.js");
|
|
32404
32674
|
return whatsappActionsPromise;
|
|
32405
32675
|
}
|
|
32406
32676
|
function createPluginRuntime() {
|
|
@@ -34474,15 +34744,6 @@ function createAnimaCodingTools(options) {
|
|
|
34474
34744
|
|
|
34475
34745
|
//#endregion
|
|
34476
34746
|
//#region src/agents/gemini-direct-runner.ts
|
|
34477
|
-
/**
|
|
34478
|
-
* Gemini Direct API Runner
|
|
34479
|
-
*
|
|
34480
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
34481
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
34482
|
-
*
|
|
34483
|
-
* This runner is automatically used when a google API key is available
|
|
34484
|
-
* and the provider is set to "google" or "gemini".
|
|
34485
|
-
*/
|
|
34486
34747
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
34487
34748
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
34488
34749
|
const MODEL_MAP = {
|
|
@@ -34574,7 +34835,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34574
34835
|
cwd: process.cwd(),
|
|
34575
34836
|
moduleUrl: import.meta.url
|
|
34576
34837
|
});
|
|
34577
|
-
const extraSystemPrompt =
|
|
34838
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
34578
34839
|
const systemPrompt = buildSystemPrompt({
|
|
34579
34840
|
workspaceDir,
|
|
34580
34841
|
config: params.config,
|
|
@@ -34653,7 +34914,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
34653
34914
|
};
|
|
34654
34915
|
}
|
|
34655
34916
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
34656
|
-
await params.onAssistantMessageStart?.();
|
|
34657
34917
|
const bodyStream = Readable.fromWeb(response.body);
|
|
34658
34918
|
let buffer = "";
|
|
34659
34919
|
let chunkAssistantText = "";
|
|
@@ -34679,12 +34939,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
34679
34939
|
nonTextParts.push(p);
|
|
34680
34940
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
34681
34941
|
}
|
|
34682
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
34683
34942
|
if (parsed.usageMetadata) {
|
|
34684
34943
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
34685
34944
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
34686
34945
|
}
|
|
34687
|
-
} catch
|
|
34946
|
+
} catch {}
|
|
34688
34947
|
}
|
|
34689
34948
|
}
|
|
34690
34949
|
if (functionCalls.length > 0) {
|
|
@@ -34744,7 +35003,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34744
35003
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
34745
35004
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
34746
35005
|
return {
|
|
34747
|
-
status: "failed",
|
|
35006
|
+
status: isAbort ? "timeout" : "failed",
|
|
34748
35007
|
meta: {
|
|
34749
35008
|
durationMs: Date.now() - started,
|
|
34750
35009
|
error: {
|
|
@@ -34781,7 +35040,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34781
35040
|
}
|
|
34782
35041
|
|
|
34783
35042
|
//#endregion
|
|
34784
|
-
//#region src/agents/
|
|
35043
|
+
//#region src/agents/noxsoft-runner.ts
|
|
34785
35044
|
function normalizeEmbeddedProvider(provider) {
|
|
34786
35045
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
34787
35046
|
}
|
|
@@ -34802,178 +35061,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
34802
35061
|
data
|
|
34803
35062
|
});
|
|
34804
35063
|
}
|
|
34805
|
-
|
|
34806
|
-
|
|
34807
|
-
if (
|
|
35064
|
+
function resolveDirectAuthProvider(provider) {
|
|
35065
|
+
if (provider === "anthropic" || provider === "claude") return "anthropic";
|
|
35066
|
+
if (provider === "google" || provider === "gemini") return "google";
|
|
35067
|
+
return null;
|
|
35068
|
+
}
|
|
35069
|
+
function resolveProfileFailureReason(result) {
|
|
35070
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
35071
|
+
if (kind === "auth") return "auth";
|
|
35072
|
+
if (kind === "rate_limit") return "rate_limit";
|
|
35073
|
+
const classified = classifyFailoverReason(result.meta.error?.message ?? "");
|
|
35074
|
+
if (classified === "billing") return "billing";
|
|
35075
|
+
if (classified === "auth") return "auth";
|
|
35076
|
+
if (classified === "rate_limit") return "rate_limit";
|
|
35077
|
+
}
|
|
35078
|
+
function resolveResultErrorKind(result) {
|
|
35079
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
35080
|
+
if (kind) return kind;
|
|
35081
|
+
return result.status === "timeout" ? "timeout" : "unknown";
|
|
35082
|
+
}
|
|
35083
|
+
function normalizeResultStatus(result) {
|
|
35084
|
+
const kind = resolveResultErrorKind(result);
|
|
35085
|
+
if (result.status === "timeout" || kind === "timeout") return "timeout";
|
|
35086
|
+
return result.status;
|
|
35087
|
+
}
|
|
35088
|
+
function normalizeResultPayloads(result) {
|
|
35089
|
+
const payloads = result.payloads?.filter((payload) => payload && typeof payload === "object");
|
|
35090
|
+
if (payloads && payloads.length > 0) return payloads;
|
|
35091
|
+
const output = result.output?.trim();
|
|
35092
|
+
return output ? [{ text: output }] : void 0;
|
|
35093
|
+
}
|
|
35094
|
+
function normalizeResultOutput(result, payloads) {
|
|
35095
|
+
const directOutput = result.output?.trim();
|
|
35096
|
+
if (directOutput) return directOutput;
|
|
35097
|
+
return payloads?.find((payload) => payload.text?.trim())?.text?.trim() || void 0;
|
|
35098
|
+
}
|
|
35099
|
+
function normalizeRunnerResult(params) {
|
|
35100
|
+
const payloads = normalizeResultPayloads(params.result);
|
|
35101
|
+
const output = normalizeResultOutput(params.result, payloads);
|
|
35102
|
+
const usage = normalizeUsage(params.result.meta.agentMeta?.usage);
|
|
35103
|
+
const lastCallUsage = normalizeUsage(params.result.meta.agentMeta?.lastCallUsage);
|
|
35104
|
+
const promptTokens = params.result.meta.agentMeta?.promptTokens ?? derivePromptTokens(usage ?? lastCallUsage);
|
|
35105
|
+
const status = normalizeResultStatus(params.result);
|
|
35106
|
+
const errorMessage = params.result.meta.error?.message?.trim();
|
|
35107
|
+
const errorKind = resolveResultErrorKind(params.result);
|
|
35108
|
+
return {
|
|
35109
|
+
...params.result,
|
|
35110
|
+
status,
|
|
35111
|
+
output,
|
|
35112
|
+
payloads,
|
|
35113
|
+
meta: {
|
|
35114
|
+
...params.result.meta,
|
|
35115
|
+
error: status === "completed" && !errorMessage ? void 0 : {
|
|
35116
|
+
message: errorMessage || (status === "timeout" ? "Request timed out." : "Runner execution failed."),
|
|
35117
|
+
kind: errorKind
|
|
35118
|
+
},
|
|
35119
|
+
agentMeta: {
|
|
35120
|
+
...params.result.meta.agentMeta,
|
|
35121
|
+
sessionId: params.result.meta.agentMeta?.sessionId?.trim() || params.sessionId,
|
|
35122
|
+
provider: params.provider,
|
|
35123
|
+
model: params.model ?? params.result.meta.agentMeta?.model,
|
|
35124
|
+
usage,
|
|
35125
|
+
promptTokens,
|
|
35126
|
+
lastCallUsage
|
|
35127
|
+
}
|
|
35128
|
+
}
|
|
35129
|
+
};
|
|
35130
|
+
}
|
|
35131
|
+
function coerceResultFailure(params) {
|
|
35132
|
+
if (params.result.status === "completed") return null;
|
|
35133
|
+
const message = params.result.meta.error?.message?.trim() || (params.result.status === "timeout" ? "Request timed out." : "Runner execution failed.");
|
|
35134
|
+
const reason = classifyFailoverReason(message) ?? resolveResultErrorKind(params.result);
|
|
35135
|
+
return new FailoverError(message, {
|
|
35136
|
+
reason: reason === "timeout" ? "timeout" : reason,
|
|
35137
|
+
provider: params.provider,
|
|
35138
|
+
model: params.model,
|
|
35139
|
+
status: resolveFailoverStatus(reason)
|
|
35140
|
+
});
|
|
35141
|
+
}
|
|
35142
|
+
async function resolveDirectProviderAuth(params) {
|
|
35143
|
+
return resolveApiKeyForProvider({
|
|
35144
|
+
provider: params.provider,
|
|
35145
|
+
cfg: params.config,
|
|
35146
|
+
preferredProfile: params.preferredProfile,
|
|
35147
|
+
agentDir: params.agentDir,
|
|
35148
|
+
store: params.store
|
|
35149
|
+
});
|
|
35150
|
+
}
|
|
35151
|
+
async function runDirectWithProfileFallback(params) {
|
|
35152
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
35153
|
+
const attemptedAuthSources = /* @__PURE__ */ new Set();
|
|
35154
|
+
let preferredProfile = params.authProfileId;
|
|
35155
|
+
let lastResult = null;
|
|
35156
|
+
for (;;) {
|
|
35157
|
+
const auth = await resolveDirectProviderAuth({
|
|
35158
|
+
provider: params.directProvider,
|
|
35159
|
+
config: params.config,
|
|
35160
|
+
agentDir: params.agentDir,
|
|
35161
|
+
preferredProfile,
|
|
35162
|
+
store
|
|
35163
|
+
});
|
|
35164
|
+
const authSourceKey = auth.profileId ?? `${auth.mode}:${auth.source}`;
|
|
35165
|
+
if (attemptedAuthSources.has(authSourceKey)) return lastResult ?? {
|
|
35166
|
+
status: "failed",
|
|
35167
|
+
meta: {
|
|
35168
|
+
durationMs: 0,
|
|
35169
|
+
error: {
|
|
35170
|
+
message: `Auth fallback loop detected for ${params.directProvider}.`,
|
|
35171
|
+
kind: "unknown"
|
|
35172
|
+
}
|
|
35173
|
+
}
|
|
35174
|
+
};
|
|
35175
|
+
attemptedAuthSources.add(authSourceKey);
|
|
35176
|
+
const result = params.directProvider === "anthropic" ? await runAnthropicDirectAgent({
|
|
35177
|
+
token: auth.apiKey ?? "",
|
|
35178
|
+
sessionId: params.sessionId,
|
|
35179
|
+
sessionKey: params.sessionKey,
|
|
35180
|
+
agentId: params.agentId,
|
|
35181
|
+
sessionFile: params.sessionFile,
|
|
35182
|
+
workspaceDir: params.workspaceDir,
|
|
35183
|
+
config: params.config,
|
|
35184
|
+
prompt: params.prompt,
|
|
35185
|
+
model: params.model,
|
|
35186
|
+
thinkLevel: params.thinkLevel,
|
|
35187
|
+
timeoutMs: params.timeoutMs,
|
|
35188
|
+
runId: params.runId,
|
|
35189
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
35190
|
+
ownerNumbers: params.ownerNumbers,
|
|
35191
|
+
onPartialReply: params.emitPartial,
|
|
35192
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
35193
|
+
}) : await runGeminiDirectAgent({
|
|
35194
|
+
apiKey: auth.apiKey ?? "",
|
|
35195
|
+
sessionId: params.sessionId,
|
|
35196
|
+
sessionKey: params.sessionKey,
|
|
35197
|
+
agentId: params.agentId,
|
|
35198
|
+
sessionFile: params.sessionFile,
|
|
35199
|
+
workspaceDir: params.workspaceDir,
|
|
35200
|
+
config: params.config,
|
|
35201
|
+
prompt: params.prompt,
|
|
35202
|
+
model: params.model,
|
|
35203
|
+
thinkLevel: params.thinkLevel,
|
|
35204
|
+
timeoutMs: params.timeoutMs,
|
|
35205
|
+
runId: params.runId,
|
|
35206
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
35207
|
+
ownerNumbers: params.ownerNumbers,
|
|
35208
|
+
onPartialReply: params.emitPartial,
|
|
35209
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
35210
|
+
});
|
|
35211
|
+
if (result.status === "completed") {
|
|
35212
|
+
if (auth.profileId) {
|
|
35213
|
+
await markAuthProfileUsed({
|
|
35214
|
+
store,
|
|
35215
|
+
profileId: auth.profileId,
|
|
35216
|
+
agentDir: params.agentDir
|
|
35217
|
+
});
|
|
35218
|
+
await markAuthProfileGood({
|
|
35219
|
+
store,
|
|
35220
|
+
provider: params.directProvider,
|
|
35221
|
+
profileId: auth.profileId,
|
|
35222
|
+
agentDir: params.agentDir
|
|
35223
|
+
});
|
|
35224
|
+
}
|
|
35225
|
+
return result;
|
|
35226
|
+
}
|
|
35227
|
+
lastResult = result;
|
|
35228
|
+
const failureReason = resolveProfileFailureReason(result);
|
|
35229
|
+
if (!auth.profileId || !failureReason) return result;
|
|
35230
|
+
await markAuthProfileFailure({
|
|
35231
|
+
store,
|
|
35232
|
+
profileId: auth.profileId,
|
|
35233
|
+
reason: failureReason,
|
|
35234
|
+
cfg: params.config,
|
|
35235
|
+
agentDir: params.agentDir
|
|
35236
|
+
});
|
|
35237
|
+
preferredProfile = void 0;
|
|
35238
|
+
}
|
|
35239
|
+
}
|
|
35240
|
+
async function resolveDirectStrategy(provider, config, agentDir) {
|
|
35241
|
+
const directProvider = resolveDirectAuthProvider(provider);
|
|
35242
|
+
if (!directProvider) return null;
|
|
35243
|
+
try {
|
|
35244
|
+
const auth = await resolveDirectProviderAuth({
|
|
35245
|
+
provider: directProvider,
|
|
35246
|
+
config,
|
|
35247
|
+
agentDir,
|
|
35248
|
+
store: ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false })
|
|
35249
|
+
});
|
|
35250
|
+
if (auth.apiKey) {
|
|
35251
|
+
if (directProvider === "anthropic" && auth.apiKey.startsWith("sk-ant-oat01-")) return null;
|
|
35252
|
+
return {
|
|
35253
|
+
kind: directProvider === "google" ? "gemini-direct" : "anthropic-direct",
|
|
35254
|
+
provider
|
|
35255
|
+
};
|
|
35256
|
+
}
|
|
35257
|
+
} catch {}
|
|
35258
|
+
return null;
|
|
35259
|
+
}
|
|
35260
|
+
async function resolveNoxSoftRunnerStrategy(params) {
|
|
34808
35261
|
const provider = normalizeEmbeddedProvider(params.provider);
|
|
35262
|
+
const direct = await resolveDirectStrategy(provider, params.config, params.agentDir);
|
|
35263
|
+
if (direct) return direct;
|
|
35264
|
+
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
35265
|
+
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`);
|
|
35266
|
+
return {
|
|
35267
|
+
kind: "cli",
|
|
35268
|
+
provider,
|
|
35269
|
+
cliProvider
|
|
35270
|
+
};
|
|
35271
|
+
}
|
|
35272
|
+
async function runNoxSoftEmbeddedAgent(params) {
|
|
35273
|
+
const provider = normalizeEmbeddedProvider(params.provider);
|
|
35274
|
+
const normalizedRequestedRef = params.model?.trim() ? normalizeModelRef(provider, params.model) : null;
|
|
34809
35275
|
const startedAt = Date.now();
|
|
34810
35276
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
34811
35277
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
34812
35278
|
let assistantStarted = false;
|
|
34813
35279
|
const streamTasks = [];
|
|
34814
|
-
|
|
34815
|
-
|
|
34816
|
-
|
|
34817
|
-
|
|
34818
|
-
|
|
34819
|
-
|
|
34820
|
-
|
|
34821
|
-
|
|
34822
|
-
|
|
34823
|
-
|
|
34824
|
-
|
|
34825
|
-
|
|
34826
|
-
|
|
34827
|
-
|
|
34828
|
-
|
|
34829
|
-
|
|
34830
|
-
|
|
34831
|
-
|
|
34832
|
-
|
|
34833
|
-
|
|
34834
|
-
|
|
35280
|
+
const emitPartial = async (payload) => {
|
|
35281
|
+
if (!assistantStarted) {
|
|
35282
|
+
assistantStarted = true;
|
|
35283
|
+
await params.onAssistantMessageStart?.();
|
|
35284
|
+
}
|
|
35285
|
+
await params.onPartialReply?.(payload);
|
|
35286
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
35287
|
+
};
|
|
35288
|
+
const strategy = await resolveNoxSoftRunnerStrategy({
|
|
35289
|
+
provider: params.provider,
|
|
35290
|
+
config: params.config,
|
|
35291
|
+
agentDir: params.agentDir
|
|
35292
|
+
});
|
|
35293
|
+
if (strategy.kind === "anthropic-direct") {
|
|
35294
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
35295
|
+
phase: "start",
|
|
35296
|
+
startedAt
|
|
35297
|
+
});
|
|
35298
|
+
try {
|
|
35299
|
+
const result = normalizeRunnerResult({
|
|
35300
|
+
result: await runDirectWithProfileFallback({
|
|
35301
|
+
...params,
|
|
35302
|
+
directProvider: "anthropic",
|
|
34835
35303
|
timeoutMs,
|
|
34836
35304
|
runId,
|
|
34837
|
-
|
|
34838
|
-
|
|
34839
|
-
|
|
34840
|
-
|
|
34841
|
-
|
|
34842
|
-
|
|
34843
|
-
|
|
34844
|
-
|
|
34845
|
-
|
|
34846
|
-
|
|
34847
|
-
|
|
34848
|
-
|
|
34849
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
34850
|
-
phase: "end",
|
|
34851
|
-
durationMs: Date.now() - startedAt,
|
|
34852
|
-
status: result.status
|
|
34853
|
-
});
|
|
34854
|
-
return result;
|
|
34855
|
-
} catch (err) {
|
|
35305
|
+
emitPartial
|
|
35306
|
+
}),
|
|
35307
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
35308
|
+
model: normalizedRequestedRef?.model,
|
|
35309
|
+
sessionId: params.sessionId
|
|
35310
|
+
});
|
|
35311
|
+
const failure = coerceResultFailure({
|
|
35312
|
+
result,
|
|
35313
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
35314
|
+
model: result.meta.agentMeta?.model
|
|
35315
|
+
});
|
|
35316
|
+
if (failure) {
|
|
34856
35317
|
await emitAgentEvent(params, "lifecycle", {
|
|
34857
35318
|
phase: "error",
|
|
34858
|
-
|
|
35319
|
+
startedAt,
|
|
35320
|
+
endedAt: Date.now(),
|
|
35321
|
+
error: failure.message,
|
|
35322
|
+
status: result.status
|
|
34859
35323
|
});
|
|
34860
|
-
throw
|
|
35324
|
+
throw failure;
|
|
34861
35325
|
}
|
|
34862
|
-
}
|
|
34863
|
-
}
|
|
34864
|
-
if (provider === "google" || provider === "gemini") {
|
|
34865
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
34866
|
-
provider: "google",
|
|
34867
|
-
cfg: params.config
|
|
34868
|
-
}))?.apiKey;
|
|
34869
|
-
if (geminiApiKey) {
|
|
34870
35326
|
await emitAgentEvent(params, "lifecycle", {
|
|
34871
|
-
phase: "
|
|
34872
|
-
startedAt
|
|
35327
|
+
phase: "end",
|
|
35328
|
+
durationMs: Date.now() - startedAt,
|
|
35329
|
+
status: result.status
|
|
34873
35330
|
});
|
|
34874
|
-
|
|
34875
|
-
|
|
34876
|
-
|
|
34877
|
-
|
|
34878
|
-
|
|
34879
|
-
|
|
34880
|
-
|
|
34881
|
-
|
|
34882
|
-
|
|
34883
|
-
|
|
34884
|
-
|
|
34885
|
-
|
|
35331
|
+
return result;
|
|
35332
|
+
} catch (err) {
|
|
35333
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
35334
|
+
phase: "error",
|
|
35335
|
+
error: String(err instanceof Error ? err.message : err)
|
|
35336
|
+
});
|
|
35337
|
+
throw err;
|
|
35338
|
+
}
|
|
35339
|
+
}
|
|
35340
|
+
if (strategy.kind === "gemini-direct") {
|
|
35341
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
35342
|
+
phase: "start",
|
|
35343
|
+
startedAt
|
|
35344
|
+
});
|
|
35345
|
+
try {
|
|
35346
|
+
const result = normalizeRunnerResult({
|
|
35347
|
+
result: await runDirectWithProfileFallback({
|
|
35348
|
+
...params,
|
|
35349
|
+
directProvider: "google",
|
|
34886
35350
|
timeoutMs,
|
|
34887
35351
|
runId,
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
|
|
34891
|
-
|
|
34892
|
-
|
|
34893
|
-
|
|
34894
|
-
|
|
34895
|
-
|
|
34896
|
-
|
|
34897
|
-
|
|
34898
|
-
|
|
34899
|
-
|
|
34900
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
34901
|
-
phase: "end",
|
|
34902
|
-
durationMs: Date.now() - startedAt,
|
|
34903
|
-
status: result.status
|
|
34904
|
-
});
|
|
34905
|
-
return result;
|
|
34906
|
-
} catch (err) {
|
|
35352
|
+
emitPartial
|
|
35353
|
+
}),
|
|
35354
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
35355
|
+
model: normalizedRequestedRef?.model,
|
|
35356
|
+
sessionId: params.sessionId
|
|
35357
|
+
});
|
|
35358
|
+
const failure = coerceResultFailure({
|
|
35359
|
+
result,
|
|
35360
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
35361
|
+
model: result.meta.agentMeta?.model
|
|
35362
|
+
});
|
|
35363
|
+
if (failure) {
|
|
34907
35364
|
await emitAgentEvent(params, "lifecycle", {
|
|
34908
35365
|
phase: "error",
|
|
34909
|
-
|
|
35366
|
+
startedAt,
|
|
35367
|
+
endedAt: Date.now(),
|
|
35368
|
+
error: failure.message,
|
|
35369
|
+
status: result.status
|
|
34910
35370
|
});
|
|
34911
|
-
throw
|
|
35371
|
+
throw failure;
|
|
34912
35372
|
}
|
|
35373
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
35374
|
+
phase: "end",
|
|
35375
|
+
durationMs: Date.now() - startedAt,
|
|
35376
|
+
status: result.status
|
|
35377
|
+
});
|
|
35378
|
+
return result;
|
|
35379
|
+
} catch (err) {
|
|
35380
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
35381
|
+
phase: "error",
|
|
35382
|
+
error: String(err instanceof Error ? err.message : err)
|
|
35383
|
+
});
|
|
35384
|
+
throw err;
|
|
34913
35385
|
}
|
|
34914
35386
|
}
|
|
34915
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
34916
|
-
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`);
|
|
34917
35387
|
await emitAgentEvent(params, "lifecycle", {
|
|
34918
35388
|
phase: "start",
|
|
34919
35389
|
startedAt
|
|
34920
35390
|
});
|
|
34921
35391
|
try {
|
|
34922
|
-
const result =
|
|
34923
|
-
|
|
34924
|
-
|
|
34925
|
-
|
|
34926
|
-
|
|
34927
|
-
|
|
34928
|
-
|
|
34929
|
-
|
|
34930
|
-
|
|
34931
|
-
|
|
34932
|
-
|
|
34933
|
-
|
|
34934
|
-
|
|
34935
|
-
|
|
34936
|
-
|
|
34937
|
-
|
|
34938
|
-
|
|
34939
|
-
|
|
34940
|
-
|
|
34941
|
-
|
|
34942
|
-
|
|
34943
|
-
|
|
34944
|
-
|
|
34945
|
-
}
|
|
34946
|
-
|
|
34947
|
-
|
|
34948
|
-
|
|
34949
|
-
|
|
34950
|
-
|
|
35392
|
+
const result = normalizeRunnerResult({
|
|
35393
|
+
result: await runCliAgent({
|
|
35394
|
+
sessionId: params.sessionId,
|
|
35395
|
+
sessionKey: params.sessionKey,
|
|
35396
|
+
agentId: params.agentId,
|
|
35397
|
+
sessionFile: params.sessionFile,
|
|
35398
|
+
workspaceDir: params.workspaceDir,
|
|
35399
|
+
config: params.config,
|
|
35400
|
+
prompt: params.prompt,
|
|
35401
|
+
provider: strategy.cliProvider,
|
|
35402
|
+
model: params.model,
|
|
35403
|
+
thinkLevel: params.thinkLevel,
|
|
35404
|
+
timeoutMs,
|
|
35405
|
+
runId,
|
|
35406
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
35407
|
+
ownerNumbers: params.ownerNumbers,
|
|
35408
|
+
cliSessionId: params.cliSessionId,
|
|
35409
|
+
sessionExecSecurity: params.execSecurity,
|
|
35410
|
+
images: params.images,
|
|
35411
|
+
streamParams: params.streamParams,
|
|
35412
|
+
onTextStream: (text) => {
|
|
35413
|
+
const nextText = text.trim();
|
|
35414
|
+
if (!nextText) return;
|
|
35415
|
+
streamTasks.push(emitPartial({ text: nextText }));
|
|
35416
|
+
}
|
|
35417
|
+
}),
|
|
35418
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
35419
|
+
model: normalizedRequestedRef?.model,
|
|
35420
|
+
sessionId: params.sessionId
|
|
34951
35421
|
});
|
|
34952
35422
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
34953
35423
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
34954
|
-
if (finalText && !assistantStarted) {
|
|
34955
|
-
assistantStarted = true;
|
|
34956
|
-
await params.onAssistantMessageStart?.();
|
|
34957
|
-
await params.onPartialReply?.({ text: finalText });
|
|
34958
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
34959
|
-
}
|
|
35424
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
34960
35425
|
await emitAgentEvent(params, "lifecycle", {
|
|
34961
35426
|
phase: "end",
|
|
34962
35427
|
startedAt,
|
|
34963
35428
|
endedAt: Date.now(),
|
|
34964
|
-
aborted: false
|
|
35429
|
+
aborted: false,
|
|
35430
|
+
status: result.status
|
|
34965
35431
|
});
|
|
34966
|
-
return
|
|
34967
|
-
...result,
|
|
34968
|
-
meta: {
|
|
34969
|
-
...result.meta,
|
|
34970
|
-
agentMeta: {
|
|
34971
|
-
...result.meta.agentMeta,
|
|
34972
|
-
provider,
|
|
34973
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
34974
|
-
}
|
|
34975
|
-
}
|
|
34976
|
-
};
|
|
35432
|
+
return result;
|
|
34977
35433
|
} catch (error) {
|
|
34978
35434
|
const message = error instanceof Error ? error.message : String(error);
|
|
34979
35435
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -34985,6 +35441,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
34985
35441
|
throw error;
|
|
34986
35442
|
}
|
|
34987
35443
|
}
|
|
35444
|
+
|
|
35445
|
+
//#endregion
|
|
35446
|
+
//#region src/agents/pi-embedded.ts
|
|
34988
35447
|
async function compactEmbeddedPiSession(..._args) {
|
|
34989
35448
|
return {
|
|
34990
35449
|
ok: true,
|
|
@@ -36132,4 +36591,4 @@ function initSubagentRegistry() {
|
|
|
36132
36591
|
}
|
|
36133
36592
|
|
|
36134
36593
|
//#endregion
|
|
36135
|
-
export {
|
|
36594
|
+
export { ensureOutboundSessionEntry as $, extractImageContentFromSource as $n, loadProviderStore as $t, getTotalQueueSize as A, registerSkillsChangeListener as An, CHANNEL_TARGETS_DESCRIPTION as At, loadCombinedSessionStoreForGateway as B, installUnhandledRejectionHandler as Bn, AGENT_LANE_SUBAGENT as Bt, createDedupeCache as C, renamePairedNode as Cn, resolveMessagePrefix as Cr, normalizeCronJobPatch as Ct, setCliSessionId as D, generatePairingToken as Dn, getAgentRunContext as Dr, normalizePayloadToSystemText as Dt, getCliSessionId as E, verifyNodeToken as En, emitAgentEvent$1 as Er, normalizeOptionalText as Et, readLatestAssistantReply as F, enqueueSystemEvent as Fn, isExternalHookSession as Ft, archiveFileOnDisk as G, DEFAULT_INPUT_IMAGE_MAX_BYTES as Gn, isGatewaySigusr1RestartExternallyAllowed as Gt, pruneLegacyStoreKeys as H, DEFAULT_INPUT_FILE_MAX_BYTES as Hn, consumeGatewaySigusr1RestartAuthorization as Ht, resolveAnnounceTargetFromKey as I, isSystemEventContextChanged as In, applyBrowserProxyPaths as It, readSessionMessages as J, DEFAULT_INPUT_PDF_MAX_PAGES as Jn, setGatewaySigusr1RestartPolicy as Jt, archiveSessionTranscripts as K, DEFAULT_INPUT_IMAGE_MIMES as Kn, markGatewaySigusr1RestartHandled as Kt, canonicalizeSpawnedByForAgent as L, peekSystemEventEntries as Ln, persistBrowserProxyFiles as Lt, setCommandLaneConcurrency as M, applyModelOverrideToSessionEntry as Mn, buildSafeExternalPrompt as Mt, waitForActiveTasks as N, applyVerboseOverride as Nn, detectSuspiciousPatterns as Nt, getActiveTaskCount as O, verifyPairingToken as On, onAgentEvent as Or, normalizeRequiredName as Ot, createAnimaTools as P, parseVerboseOverride as Pn, getHookType as Pt, runMessageAction as Q, extractFileContentFromSource as Qn, loadProviderUsageSummary as Qt, listAgentsForGateway as R, peekSystemEvents as Rn, extractShortModelName as Rt, getTotalPendingReplies as S, rejectNodePairing as Sn, resolveIdentityNamePrefix as Sr, normalizeCronJobCreate as St, BARE_SESSION_RESET_PROMPT as T, updatePairedNodeMetadata as Tn, clearAgentRunContext as Tr, normalizeOptionalAgentId as Tt, resolveGatewaySessionStoreTarget as U, DEFAULT_INPUT_FILE_MAX_CHARS as Un, deferGatewayRestartUntilIdle as Ut, loadSessionEntry as V, registerUnhandledRejectionHandler as Vn, CommandLane as Vt, resolveSessionModelRef as W, DEFAULT_INPUT_FILE_MIMES as Wn, emitGatewayRestart as Wt, resolveSessionTranscriptCandidates as X, DEFAULT_INPUT_PDF_MIN_TEXT_CHARS as Xn, normalizeGroupActivation as Xt, readSessionPreviewItemsFromTranscript as Y, DEFAULT_INPUT_PDF_MAX_PIXELS as Yn, setPreRestartDeferralCheck as Yt, stripEnvelopeFromMessages as Z, DEFAULT_INPUT_TIMEOUT_MS as Zn, parseActivationCommand as Zt, recordChannelActivity as _, refreshRemoteNodeBins as _n, buildMentionRegexes as _r, formatRestartSentinelMessage as _t, runSubagentAnnounceFlow as a, buildChannelSummary as an, stopDiagnosticHeartbeat as ar, resolveHeartbeatDeliveryTarget as at, dispatchInboundMessage as b, approveNodePairing as bn, resolveEffectiveMessagesConfig as br, trimLogTail as bt, waitForEmbeddedPiRunEnd as c, resolveCommitHash as cn, resolveInboundDebounceMs as cr, resolveSessionDeliveryTarget as ct, buildDefaultToolPolicyPipelineSteps as d, normalizeSendPolicy as dn, formatZonedTimestamp as dr, resolveMessageChannelSelection as dt, maskApiKey as en, normalizeMimeList as er, resolveOutboundSessionRoute as et, sniffMimeFromBase64 as f, resolveSendPolicy as fn, hasControlCommand as fr, CHANNEL_MESSAGE_ACTION_NAMES as ft, getChannelActivity as g, refreshRemoteBinsForConnectedNodes as gn, CURRENT_MESSAGE_MARKER as gr, formatDoctorNonInteractiveHint as gt, buildPairingReply as h, recordRemoteNodeInfo as hn, stopSubagentsForRequester as hr, consumeRestartSentinel as ht, subagent_registry_exports as i, resolveUsageProviderId as in, startDiagnosticHeartbeat as ir, resolvePreferredAccountId as it, resetAllLanes as j, clearSessionAuthProfileOverride as jn, CHANNEL_TARGET_DESCRIPTION as jt, getQueueSize as k, getSkillsSnapshotVersion as kn, registerAgentRunContext as kr, migrateLegacyCronPayload as kt, runNoxSoftEmbeddedAgent as l, requestHeartbeatNow as ln, formatInboundEnvelope as lr, formatTargetDisplay as lt, loadAnimaPlugins as m, primeRemoteSkillsCache as mn, isAbortTrigger as mr, resolveWorkingModeModelSelection as mt, initSubagentRegistry as n, formatUsageReportLines as nn, finalizeInboundContext as nr, resolveAgentRoute as nt, clearSessionQueues as o, buildChannelAccountSnapshot as on, isDiagnosticsEnabled as or, resolveHeartbeatSenderContext as ot, getPluginToolMeta as p, getRemoteSkillEligibility as pn, shouldComputeCommandAuthorized as pr, runWithModelFallback as pt, capArrayByJsonBytes as q, DEFAULT_INPUT_MAX_REDIRECTS as qn, scheduleGatewaySigusr1Restart as qt, listDescendantRunsForRequester as r, formatUsageWindowSummary as rn, resolveAgentTimeoutMs as rr, buildChannelAccountBindings as rt, abortEmbeddedPiRun as s, formatChannelAllowFrom as sn, createInboundDebouncer as sr, resolveOutboundTarget as st, countActiveDescendantRuns as t, saveProviderStore as tn, estimateBase64DecodedBytes as tr, buildAgentSessionKey as tt, applyToolPolicyPipeline as u, setHeartbeatWakeHandler as un, resolveEnvelopeFormatOptions as ur, resetDirectoryCache as ut, shouldAckReactionForWhatsApp as v, removeRemoteNodeInfo as vn, normalizeMentionText as vr, readRestartSentinel as vt, getReplyFromConfig as w, requestNodePairing as wn, describeFailoverError as wr, inferLegacyName as wt, createReplyDispatcher as x, listNodePairing as xn, resolveIdentityName as xr, writeRestartSentinel as xt, dispatchReplyWithBufferedBlockDispatcher as y, setSkillsRemoteRegistry as yn, resolveAgentIdentity as yr, summarizeRestartSentinel as yt, listSessionsFromStore as z, loadModelCatalog as zn, AGENT_LANE_NESTED as zt };
|