@noxsoft/anima 5.1.1 → 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-Dyb3ijJm.js → accounts-TUsfghIW.js} +5 -5
- 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-B7OcwSxK.js → active-listener-D2r8IO7g.js} +4 -4
- package/dist/{agent-DImD77Te.js → agent-CnS0SRpT.js} +93 -236
- package/dist/{agent-B8ciDTm6.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-BHR6uOLT.js → agent-scope-CxBzAozu.js} +2 -2
- package/dist/{agents-DvkZi7oF.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-C9IyM74_.js → auth-choice-DY1saszS.js} +12 -107
- package/dist/{auth-choice-i9Z_cli_.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-Da39zGOD.js → auth-profiles-DtWUl1-k.js} +189 -29
- package/dist/{auth-store-Bl6rpC4E.js → auth-store-Bd0GoqEL.js} +3 -3
- 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-CjrhpA68.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 +220 -149
- package/dist/bundled/bootstrap-extra-files/handler.js +3 -3
- package/dist/bundled/session-memory/handler.js +22 -22
- 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-9ikdY9RK.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-CkSIMI7j.js → chrome-DLUBPBPz.js} +2 -2
- package/dist/{chunk-5llVa3wc.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-DlmPIB0y.js → clack-prompter-fZSmnHda.js} +5 -5
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-d0H0Bpz9.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-Dv064HDc.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-CKoFTq83.js → common-Bf_TG87Y.js} +2 -2
- package/dist/{common-6Fcbzr42.js → common-DT_obM-k.js} +2 -2
- package/dist/{completion-cli-Blp8bILB.js → completion-cli-B3BqQJq9.js} +3 -3
- package/dist/{completion-cli-C-fu_7Kd.js → completion-cli-CepDzeW1.js} +2 -2
- package/dist/{config-Ofh9gKvs.js → config-BrVuTQ8R.js} +14 -2
- package/dist/{config-BfhpauV9.js → config-CweTwOtr.js} +19 -7
- 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-BFQDt_5i.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-CDUhjDom.js → config-sync-CCVp-tVX.js} +4 -4
- package/dist/{config-sync-CYX9Tzyr.js → config-sync-CMO_5lyl.js} +4 -4
- package/dist/{configure-CJYocuSp.js → configure-D882Bg7c.js} +39 -15
- package/dist/{configure-DLPHJ8nv.js → configure-D88dg6mE.js} +79 -77
- package/dist/{configure-Bbx4y0lr.js → configure-xpjwedvJ.js} +50 -49
- package/dist/{configure-fHta2Meh.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-CoQP7nSu.js → deliver-d-CaN0uL.js} +18 -28
- 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-qayl5A-F.js → doctor-DEnSKgHu.js} +21 -21
- package/dist/{doctor-2O2knHXJ.js → doctor-WpKCNZeO.js} +36 -181
- package/dist/{doctor-completion-CaC89XwQ.js → doctor-completion-CPff9UlF.js} +2 -2
- package/dist/{doctor-completion-jbYrRr0H.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-CKqNpVwE.js → engine-DpbYPop7.js} +6 -6
- package/dist/{engine-BVchKo5_.js → engine-zmn3SOYa.js} +7 -6
- 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-CEFTijVj.js → exec-DUzVF5_D.js} +1 -1
- 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/{gateway-cli-DAPK-NMP.js → gateway-cli-B_xsx5Nv.js} +104 -101
- package/dist/{gateway-cli-CDg1qmsU.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-BNasz7nv.js → health-C8KCBhuo.js} +8 -8
- package/dist/{health-2sA2ziYt.js → health-CabOEPQ0.js} +13 -13
- package/dist/{health-format-CH6JWH45.js → health-format-D-JJ5_S4.js} +2 -2
- package/dist/{heartbeat-visibility-B2MDtPTL.js → heartbeat-visibility-BjYY-mKG.js} +1 -1
- package/dist/{heartbeat-visibility-DcGQOTXe.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-D8SvsiGN.js → hooks-cli-Cs7GUa7G.js} +34 -33
- package/dist/{hooks-cli-Cwe9oz1p.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 +23 -23
- 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-7Yj2TvMd.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-CuwWMetN.js → login-qr-OUAGpDsU.js} +9 -9
- 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-kdmVqWxk.js → manager-b_aZwo00.js} +12 -12
- 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-BuMFehML.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-BPkpXepz.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-DJ4ON8sf.js → onboard-DM9gULJN.js} +24 -19
- package/dist/{onboard-DbzYS52G.js → onboard-_-D81kAy.js} +19 -15
- package/dist/{onboard-channels-CWMuM-3k.js → onboard-channels-CtT-RN60.js} +8 -8
- package/dist/{onboard-channels-Cqeff8-v.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-SrNptVqc.js → onboarding-BB9PteK8.js} +20 -17
- package/dist/{onboarding-GIx1Wpw0.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-CovlPIFx.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-DQMKfv60.js → paths-CAQJvbeZ.js} +2 -2
- package/dist/{paths-CLxC7m0Z.js → paths-Q6h5HODL.js} +1 -1
- 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-BLCyhR5p.js → pi-auth-json-WTvcP2gz.js} +9 -8
- package/dist/{pi-embedded-BL-Js-lp.js → pi-embedded-BMbtgOzv.js} +852 -338
- package/dist/{pi-embedded-fZ1QlJ9C.js → pi-embedded-DfbM3fAT.js} +850 -336
- 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-DboWDOrG.js → plugin-registry-DePMxn4z.js} +4 -4
- package/dist/{plugin-registry-X7L3BrUu.js → plugin-registry-QTkplP4s.js} +2 -2
- package/dist/plugin-sdk/agents/cli-backends.d.ts +8 -2
- 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-C-PA_T5k.js → plugins-cli-Bc9oU1ld.js} +58 -57
- package/dist/{plugins-cli-BraLLKDO.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-BriwVW7P.js → program-CuwbF8YO.js} +48 -40
- package/dist/{program-context-oXX-h-yI.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-BJfL9dGV.js → pw-ai-C_1-7IgH.js} +3 -3
- 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-DHQgWjsV.js → qmd-manager-CpNYgSrx.js} +6 -6
- package/dist/{qmd-manager-Cbm03z8H.js → qmd-manager-Q0OSDQ-e.js} +5 -5
- package/dist/{register.agent-BO5BCkbO.js → register.agent-DFQmkIEH.js} +53 -50
- package/dist/{register.agent-BMKeVZeq.js → register.agent-DUjwGw9d.js} +77 -73
- package/dist/{register.anima-BS8nsOpD.js → register.anima-CRFHJu2J.js} +21 -21
- package/dist/{register.anima-DPurDgXW.js → register.anima-CtKNrpE8.js} +21 -21
- package/dist/{register.configure-Di8agIXW.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-DjXwK16H.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-BkUxrYi2.js → register.onboard-BhPlqjFi.js} +50 -49
- package/dist/{register.setup-DyqOWQ2D.js → register.setup-0jPnMgnz.js} +96 -92
- package/dist/{register.setup-DEtz71o0.js → register.setup-CADdQUEN.js} +72 -69
- package/dist/{register.status-health-sessions-DjsEuYmp.js → register.status-health-sessions-Cu5fDT-z.js} +68 -67
- package/dist/{register.status-health-sessions-CXMn5NfF.js → register.status-health-sessions-DdQsABr_.js} +40 -39
- package/dist/{register.subclis-CMlPDwE5.js → register.subclis-CZ91ufCy.js} +28 -21
- package/dist/{reply-DWdVFSBB.js → reply-DtHlnzOx.js} +6658 -6191
- package/dist/{reply-prefix-CRGxza-M.js → reply-prefix-C8dIgJur.js} +1 -1
- package/dist/{reply-prefix-_gr2uQ1Z.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-GZnwhuUG.js → run-Dfz_7j7t.js} +1256 -166
- package/dist/{run-CXLRGLdR.js → run-DqBQ-bGn.js} +1230 -140
- package/dist/{run-main-Coy6Vx7R.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-BZw2SVoG.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-yZM_OBSZ.js → server-node-events-BR1aXVlu.js} +55 -53
- package/dist/{server-node-events-BMO931Md.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-CB9OL4Ml.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-_DoMmFH9.js → settings-cli-DxNeu6kx.js} +79 -77
- package/dist/{settings-cli-BVBFgDUd.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-DaSbgZYX.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-DFeEGG5h.js → soul-BiIdv3Wp.js} +124 -4
- package/dist/{soul-B7vtVbSs.js → soul-Bt8UNmTq.js} +125 -4
- 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-D_h-b5t2.js → sqlite-CZ1vD4VS.js} +2 -2
- package/dist/{sqlite-CLZ1eR5Q.js → sqlite-CpAJt-JS.js} +1 -1
- package/dist/{start-C6a18wc7.js → start-BqnPia0t.js} +66 -63
- package/dist/start-C3fuLzX0.js +157 -0
- package/dist/{status-DyD7gtoK.js → status-CHGNPonc.js} +26 -44
- package/dist/{status-CUyIggna.js → status-CxF6k_jr.js} +2 -2
- package/dist/{status-CWgHkLTE.js → status-DfZJJqNs.js} +15 -15
- package/dist/{status-DmsznVj5.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-BVrDlKmm.js → subagent-registry-CPtElVX0.js} +834 -367
- 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-BP2l3SHn.js → subsystem-D1AJZPgG.js} +18 -27
- 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-CUx-9B7B.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-JPLB8AtM.js → update-cli-BuCw75tM.js} +87 -85
- package/dist/{update-cli-4VAEZsrR.js → update-cli-C-er5av6.js} +55 -54
- package/dist/{update-runner-BxdLd4Q8.js → update-runner-czCqHZCu.js} +5 -5
- package/dist/{update-runner-pmlbxeZ-.js → update-runner-kE8AMQt4.js} +1 -1
- package/dist/{utils-B60lF9Wq.js → utils-CLYlhJuc.js} +1 -1
- package/dist/{web-cpPr1Em8.js → web-BHGK5GtV.js} +24 -24
- package/dist/web-CyYunanU.js +65 -0
- package/dist/{web-D8EsFSet.js → web-DvTXV-fo.js} +35 -34
- package/dist/{web-B3O004_b.js → web-so3pGceM.js} +25 -25
- 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-9PCfw-Zh.js → whatsapp-actions-Hr-W8vjY.js} +12 -12
- package/dist/{widearea-dns-BDtWuGCY.js → widearea-dns-CHAT20aR.js} +1 -1
- package/dist/{workspace-Cvio8QlZ.js → workspace-BFIZCnGo.js} +1 -1
- 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-PD3ygS3H.js +0 -101
- package/dist/config-cli-CgG6CaWK.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-CMFpRoYp.js +0 -13
- package/dist/models-2GYW4-6h.js +0 -1350
- package/dist/register.configure-Dvg0Vi23.js +0 -105
- package/dist/register.maintenance-CKE15LXK.js +0 -100
- package/dist/register.onboard-Du-u1lcX.js +0 -126
- package/dist/start-C0Uw_pIA.js +0 -154
- package/dist/web-B9-C6C1i.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";
|
|
@@ -583,8 +585,7 @@ const DEFAULT_CODEX_BACKEND = {
|
|
|
583
585
|
"--json",
|
|
584
586
|
"--color",
|
|
585
587
|
"never",
|
|
586
|
-
"--sandbox",
|
|
587
|
-
"danger-full-access",
|
|
588
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
588
589
|
"--skip-git-repo-check"
|
|
589
590
|
],
|
|
590
591
|
resumeArgs: [
|
|
@@ -662,6 +663,7 @@ const LEGACY_CODEX_RESUME_ARGS = [
|
|
|
662
663
|
"read-only",
|
|
663
664
|
"--skip-git-repo-check"
|
|
664
665
|
];
|
|
666
|
+
const CODEX_BYPASS_FLAG = "--dangerously-bypass-approvals-and-sandbox";
|
|
665
667
|
function normalizeBackendKey(key) {
|
|
666
668
|
return normalizeProviderId(key);
|
|
667
669
|
}
|
|
@@ -698,29 +700,43 @@ function argsEqual(left, right) {
|
|
|
698
700
|
if (!left || !right || left.length !== right.length) return false;
|
|
699
701
|
return left.every((entry, index) => entry === right[index]);
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function resolveCodexExecModeArg(args) {
|
|
702
704
|
if (!args) return;
|
|
705
|
+
if (args.includes(CODEX_BYPASS_FLAG)) return CODEX_BYPASS_FLAG;
|
|
703
706
|
const index = args.indexOf("--sandbox");
|
|
704
707
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
705
|
-
return
|
|
706
|
-
}
|
|
707
|
-
function
|
|
708
|
-
const nextArgs = [
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
708
|
+
return value === "workspace-write" || value === "read-only" ? value : void 0;
|
|
709
|
+
}
|
|
710
|
+
function setCodexExecModeArgs(args, mode) {
|
|
711
|
+
const nextArgs = [];
|
|
712
|
+
const source = args ?? [];
|
|
713
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
714
|
+
const entry = source[i];
|
|
715
|
+
if (entry === CODEX_BYPASS_FLAG) continue;
|
|
716
|
+
if (entry === "--sandbox") {
|
|
717
|
+
i += 1;
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
nextArgs.push(entry);
|
|
713
721
|
}
|
|
714
|
-
nextArgs.push(
|
|
722
|
+
if (mode === CODEX_BYPASS_FLAG) nextArgs.push(CODEX_BYPASS_FLAG);
|
|
723
|
+
else nextArgs.push("--sandbox", mode);
|
|
715
724
|
return nextArgs;
|
|
716
725
|
}
|
|
717
|
-
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";
|
|
718
734
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
719
735
|
if (workspaceAccess === "ro") return "read-only";
|
|
720
736
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
721
|
-
return
|
|
737
|
+
return CODEX_BYPASS_FLAG;
|
|
722
738
|
}
|
|
723
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
739
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
724
740
|
const normalized = normalizeBackendKey(provider);
|
|
725
741
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
726
742
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -746,9 +762,9 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
746
762
|
...merged,
|
|
747
763
|
resumeArgs: DEFAULT_CODEX_BACKEND.resumeArgs
|
|
748
764
|
};
|
|
749
|
-
if (!
|
|
765
|
+
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
750
766
|
...merged,
|
|
751
|
-
args:
|
|
767
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
752
768
|
};
|
|
753
769
|
const command = merged.command?.trim();
|
|
754
770
|
if (!command) return null;
|
|
@@ -927,14 +943,14 @@ async function runCliAgent(params) {
|
|
|
927
943
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
928
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}`);
|
|
929
945
|
const workspaceDir = resolvedWorkspace;
|
|
930
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
946
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
931
947
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
932
948
|
const backend = backendResolved.config;
|
|
933
|
-
const
|
|
949
|
+
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
934
950
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
935
951
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
936
952
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
937
|
-
const extraSystemPrompt =
|
|
953
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
938
954
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
939
955
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
940
956
|
workspaceDir,
|
|
@@ -981,15 +997,24 @@ async function runCliAgent(params) {
|
|
|
981
997
|
const lines = (await readFile(params.sessionFile, "utf-8")).trim().split("\n");
|
|
982
998
|
const lastLine = lines[lines.length - 1];
|
|
983
999
|
if (lastLine) {
|
|
984
|
-
const
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
-
|
|
1000
|
+
const parsed = JSON.parse(lastLine);
|
|
1001
|
+
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
1002
|
+
const currentMode = effectiveCodexExecMode;
|
|
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) {
|
|
1008
|
+
log$6.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
988
1009
|
useResume = false;
|
|
989
1010
|
isNew = true;
|
|
990
1011
|
}
|
|
991
1012
|
}
|
|
992
|
-
} catch {
|
|
1013
|
+
} catch {
|
|
1014
|
+
log$6.info("Codex session transcript is unavailable; forcing session restart.");
|
|
1015
|
+
useResume = false;
|
|
1016
|
+
isNew = true;
|
|
1017
|
+
}
|
|
993
1018
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
994
1019
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
995
1020
|
backend,
|
|
@@ -1105,8 +1130,9 @@ async function runCliAgent(params) {
|
|
|
1105
1130
|
if (stderr) log$6.debug(`cli stderr:\n${stderr}`);
|
|
1106
1131
|
}
|
|
1107
1132
|
if (result.code !== 0) {
|
|
1108
|
-
const
|
|
1109
|
-
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";
|
|
1110
1136
|
const status = resolveFailoverStatus(reason);
|
|
1111
1137
|
throw new FailoverError(err, {
|
|
1112
1138
|
reason,
|
|
@@ -1133,7 +1159,7 @@ async function runCliAgent(params) {
|
|
|
1133
1159
|
provider: params.provider,
|
|
1134
1160
|
model: modelId,
|
|
1135
1161
|
usage: output.usage,
|
|
1136
|
-
...
|
|
1162
|
+
...effectiveCodexExecMode ? { metadata: { effectiveCodexExecMode } } : {}
|
|
1137
1163
|
}
|
|
1138
1164
|
}
|
|
1139
1165
|
};
|
|
@@ -4568,7 +4594,7 @@ async function loadModelCatalog(params) {
|
|
|
4568
4594
|
});
|
|
4569
4595
|
try {
|
|
4570
4596
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
4571
|
-
await (await import("./pi-auth-json-
|
|
4597
|
+
await (await import("./pi-auth-json-DkYqdjrV.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
4572
4598
|
const piSdk = await importPiSdk();
|
|
4573
4599
|
const agentDir = resolveAnimaAgentDir();
|
|
4574
4600
|
const { join } = await import("node:path");
|
|
@@ -6363,8 +6389,8 @@ const resolveProfileOverride = (params) => {
|
|
|
6363
6389
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
6364
6390
|
const PROVIDER_RANK = new Map([
|
|
6365
6391
|
"anthropic",
|
|
6366
|
-
"openai",
|
|
6367
6392
|
"openai-codex",
|
|
6393
|
+
"openai",
|
|
6368
6394
|
"minimax",
|
|
6369
6395
|
"synthetic",
|
|
6370
6396
|
"google",
|
|
@@ -6680,7 +6706,7 @@ async function createModelSelectionState(params) {
|
|
|
6680
6706
|
}
|
|
6681
6707
|
}
|
|
6682
6708
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
6683
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
6709
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-Brxz2ojJ.js").then((n) => n.t);
|
|
6684
6710
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
6685
6711
|
const providerKey = normalizeProviderId(provider);
|
|
6686
6712
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -7748,58 +7774,6 @@ function ensureSkillsWatcher(params) {
|
|
|
7748
7774
|
watchers.set(workspaceDir, state);
|
|
7749
7775
|
}
|
|
7750
7776
|
|
|
7751
|
-
//#endregion
|
|
7752
|
-
//#region src/infra/pairing-files.ts
|
|
7753
|
-
function resolvePairingPaths(baseDir, subdir) {
|
|
7754
|
-
const root = baseDir ?? resolveStateDir();
|
|
7755
|
-
const dir = path.join(root, subdir);
|
|
7756
|
-
return {
|
|
7757
|
-
dir,
|
|
7758
|
-
pendingPath: path.join(dir, "pending.json"),
|
|
7759
|
-
pairedPath: path.join(dir, "paired.json")
|
|
7760
|
-
};
|
|
7761
|
-
}
|
|
7762
|
-
async function readJsonFile(filePath) {
|
|
7763
|
-
try {
|
|
7764
|
-
const raw = await fs$1.readFile(filePath, "utf8");
|
|
7765
|
-
return JSON.parse(raw);
|
|
7766
|
-
} catch {
|
|
7767
|
-
return null;
|
|
7768
|
-
}
|
|
7769
|
-
}
|
|
7770
|
-
async function writeJsonAtomic(filePath, value) {
|
|
7771
|
-
const dir = path.dirname(filePath);
|
|
7772
|
-
await fs$1.mkdir(dir, { recursive: true });
|
|
7773
|
-
const tmp = `${filePath}.${randomUUID()}.tmp`;
|
|
7774
|
-
await fs$1.writeFile(tmp, JSON.stringify(value, null, 2), "utf8");
|
|
7775
|
-
try {
|
|
7776
|
-
await fs$1.chmod(tmp, 384);
|
|
7777
|
-
} catch {}
|
|
7778
|
-
await fs$1.rename(tmp, filePath);
|
|
7779
|
-
try {
|
|
7780
|
-
await fs$1.chmod(filePath, 384);
|
|
7781
|
-
} catch {}
|
|
7782
|
-
}
|
|
7783
|
-
function pruneExpiredPending(pendingById, nowMs, ttlMs) {
|
|
7784
|
-
for (const [id, req] of Object.entries(pendingById)) if (nowMs - req.ts > ttlMs) delete pendingById[id];
|
|
7785
|
-
}
|
|
7786
|
-
function createAsyncLock() {
|
|
7787
|
-
let lock = Promise.resolve();
|
|
7788
|
-
return async function withLock(fn) {
|
|
7789
|
-
const prev = lock;
|
|
7790
|
-
let release;
|
|
7791
|
-
lock = new Promise((resolve) => {
|
|
7792
|
-
release = resolve;
|
|
7793
|
-
});
|
|
7794
|
-
await prev;
|
|
7795
|
-
try {
|
|
7796
|
-
return await fn();
|
|
7797
|
-
} finally {
|
|
7798
|
-
release?.();
|
|
7799
|
-
}
|
|
7800
|
-
};
|
|
7801
|
-
}
|
|
7802
|
-
|
|
7803
7777
|
//#endregion
|
|
7804
7778
|
//#region src/infra/pairing-token.ts
|
|
7805
7779
|
const PAIRING_TOKEN_BYTES = 32;
|
|
@@ -16054,7 +16028,7 @@ async function routeReply(params) {
|
|
|
16054
16028
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
16055
16029
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
16056
16030
|
try {
|
|
16057
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
16031
|
+
const { deliverOutboundPayloads } = await import("./deliver-C1L5nO0K.js").then((n) => n.n);
|
|
16058
16032
|
return {
|
|
16059
16033
|
ok: true,
|
|
16060
16034
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -19469,6 +19443,275 @@ function createGatewayTool(opts) {
|
|
|
19469
19443
|
};
|
|
19470
19444
|
}
|
|
19471
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
|
+
|
|
19472
19715
|
//#endregion
|
|
19473
19716
|
//#region src/agents/model-fallback.ts
|
|
19474
19717
|
/**
|
|
@@ -19570,12 +19813,32 @@ function resolveFallbackCandidates(params) {
|
|
|
19570
19813
|
}, false);
|
|
19571
19814
|
return candidates;
|
|
19572
19815
|
}
|
|
19816
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
19817
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
19818
|
+
if (!execSecurity) return;
|
|
19819
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
19820
|
+
}
|
|
19573
19821
|
async function runWithModelFallback(params) {
|
|
19574
|
-
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,
|
|
19575
19837
|
cfg: params.cfg,
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19838
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
19839
|
+
thinkLevel: params.thinkLevel,
|
|
19840
|
+
sessionEntry: params.sessionEntry
|
|
19841
|
+
})
|
|
19579
19842
|
});
|
|
19580
19843
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
19581
19844
|
const attempts = [];
|
|
@@ -20689,6 +20952,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
20689
20952
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
20690
20953
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
20691
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
|
+
}
|
|
20692
20973
|
async function resolveMessagingTarget(params) {
|
|
20693
20974
|
const raw = normalizeChannelTargetInput(params.input);
|
|
20694
20975
|
if (!raw) return {
|
|
@@ -20700,6 +20981,16 @@ async function resolveMessagingTarget(params) {
|
|
|
20700
20981
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
20701
20982
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
20702
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
|
+
}
|
|
20703
20994
|
const looksLikeTargetId = () => {
|
|
20704
20995
|
const trimmed = raw.trim();
|
|
20705
20996
|
if (!trimmed) return false;
|
|
@@ -21115,13 +21406,62 @@ function resolveGatewayOptions(opts) {
|
|
|
21115
21406
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
21116
21407
|
};
|
|
21117
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
|
+
}
|
|
21118
21461
|
async function sendMessage(params) {
|
|
21119
21462
|
const cfg = params.cfg ?? loadConfig();
|
|
21120
|
-
const channel = params.channel?.trim() ?
|
|
21463
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
21121
21464
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
21122
|
-
const plugin = getChannelPlugin(channel);
|
|
21123
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
21124
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
21125
21465
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
21126
21466
|
text: params.content,
|
|
21127
21467
|
mediaUrl: params.mediaUrl,
|
|
@@ -21130,6 +21470,18 @@ async function sendMessage(params) {
|
|
|
21130
21470
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
21131
21471
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
21132
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";
|
|
21133
21485
|
if (params.dryRun) return {
|
|
21134
21486
|
channel,
|
|
21135
21487
|
to: params.to,
|
|
@@ -21208,7 +21560,7 @@ async function sendMessage(params) {
|
|
|
21208
21560
|
}
|
|
21209
21561
|
async function sendPoll(params) {
|
|
21210
21562
|
const cfg = params.cfg ?? loadConfig();
|
|
21211
|
-
const channel = params.channel?.trim() ?
|
|
21563
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
21212
21564
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
21213
21565
|
const pollInput = {
|
|
21214
21566
|
question: params.question,
|
|
@@ -28944,6 +29296,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
28944
29296
|
provider: params.followupRun.run.provider,
|
|
28945
29297
|
model: params.followupRun.run.model,
|
|
28946
29298
|
agentDir: params.followupRun.run.agentDir,
|
|
29299
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
29300
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
28947
29301
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
28948
29302
|
run: (provider, model) => {
|
|
28949
29303
|
params.opts?.onModelSelected?.({
|
|
@@ -28951,97 +29305,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
28951
29305
|
model,
|
|
28952
29306
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
28953
29307
|
});
|
|
28954
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
28955
|
-
const startedAt = Date.now();
|
|
28956
|
-
emitAgentEvent$1({
|
|
28957
|
-
runId,
|
|
28958
|
-
stream: "lifecycle",
|
|
28959
|
-
data: {
|
|
28960
|
-
phase: "start",
|
|
28961
|
-
startedAt
|
|
28962
|
-
}
|
|
28963
|
-
});
|
|
28964
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
28965
|
-
return (async () => {
|
|
28966
|
-
let lifecycleTerminalEmitted = false;
|
|
28967
|
-
let sawCliStream = false;
|
|
28968
|
-
let lastCliStreamText = "";
|
|
28969
|
-
try {
|
|
28970
|
-
const result = await runCliAgent({
|
|
28971
|
-
sessionId: params.followupRun.run.sessionId,
|
|
28972
|
-
sessionKey: params.sessionKey,
|
|
28973
|
-
agentId: params.followupRun.run.agentId,
|
|
28974
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
28975
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
28976
|
-
config: params.followupRun.run.config,
|
|
28977
|
-
prompt: params.commandBody,
|
|
28978
|
-
provider,
|
|
28979
|
-
model,
|
|
28980
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
28981
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
28982
|
-
runId,
|
|
28983
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
28984
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
28985
|
-
cliSessionId,
|
|
28986
|
-
images: params.opts?.images,
|
|
28987
|
-
onTextStream: (text) => {
|
|
28988
|
-
const nextText = text.trim();
|
|
28989
|
-
if (!nextText) return;
|
|
28990
|
-
sawCliStream = true;
|
|
28991
|
-
lastCliStreamText = nextText;
|
|
28992
|
-
emitAgentEvent$1({
|
|
28993
|
-
runId,
|
|
28994
|
-
stream: "assistant",
|
|
28995
|
-
data: { text: nextText }
|
|
28996
|
-
});
|
|
28997
|
-
}
|
|
28998
|
-
});
|
|
28999
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
29000
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
29001
|
-
runId,
|
|
29002
|
-
stream: "assistant",
|
|
29003
|
-
data: { text: cliText }
|
|
29004
|
-
});
|
|
29005
|
-
emitAgentEvent$1({
|
|
29006
|
-
runId,
|
|
29007
|
-
stream: "lifecycle",
|
|
29008
|
-
data: {
|
|
29009
|
-
phase: "end",
|
|
29010
|
-
startedAt,
|
|
29011
|
-
endedAt: Date.now()
|
|
29012
|
-
}
|
|
29013
|
-
});
|
|
29014
|
-
lifecycleTerminalEmitted = true;
|
|
29015
|
-
return result;
|
|
29016
|
-
} catch (err) {
|
|
29017
|
-
emitAgentEvent$1({
|
|
29018
|
-
runId,
|
|
29019
|
-
stream: "lifecycle",
|
|
29020
|
-
data: {
|
|
29021
|
-
phase: "error",
|
|
29022
|
-
startedAt,
|
|
29023
|
-
endedAt: Date.now(),
|
|
29024
|
-
error: String(err)
|
|
29025
|
-
}
|
|
29026
|
-
});
|
|
29027
|
-
lifecycleTerminalEmitted = true;
|
|
29028
|
-
throw err;
|
|
29029
|
-
} finally {
|
|
29030
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
29031
|
-
runId,
|
|
29032
|
-
stream: "lifecycle",
|
|
29033
|
-
data: {
|
|
29034
|
-
phase: "error",
|
|
29035
|
-
startedAt,
|
|
29036
|
-
endedAt: Date.now(),
|
|
29037
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
29038
|
-
}
|
|
29039
|
-
});
|
|
29040
|
-
}
|
|
29041
|
-
})();
|
|
29042
|
-
}
|
|
29043
29308
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
29044
|
-
return
|
|
29309
|
+
return runNoxSoftEmbeddedAgent({
|
|
29045
29310
|
sessionId: params.followupRun.run.sessionId,
|
|
29046
29311
|
sessionKey: params.sessionKey,
|
|
29047
29312
|
agentId: params.followupRun.run.agentId,
|
|
@@ -29078,6 +29343,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
29078
29343
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
29079
29344
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
29080
29345
|
execOverrides: params.followupRun.run.execOverrides,
|
|
29346
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
29347
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
29081
29348
|
toolResultFormat: (() => {
|
|
29082
29349
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
29083
29350
|
if (!channel) return "markdown";
|
|
@@ -29109,6 +29376,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
29109
29376
|
});
|
|
29110
29377
|
} : void 0,
|
|
29111
29378
|
onAgentEvent: async (evt) => {
|
|
29379
|
+
emitAgentEvent$1({
|
|
29380
|
+
runId,
|
|
29381
|
+
stream: evt.stream,
|
|
29382
|
+
data: evt.data
|
|
29383
|
+
});
|
|
29112
29384
|
if (evt.stream === "tool") {
|
|
29113
29385
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
29114
29386
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -29378,10 +29650,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
29378
29650
|
provider: params.followupRun.run.provider,
|
|
29379
29651
|
model: params.followupRun.run.model,
|
|
29380
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,
|
|
29381
29655
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
29382
29656
|
run: (provider, model) => {
|
|
29383
29657
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
29384
|
-
return
|
|
29658
|
+
return runNoxSoftEmbeddedAgent({
|
|
29385
29659
|
sessionId: params.followupRun.run.sessionId,
|
|
29386
29660
|
sessionKey: params.sessionKey,
|
|
29387
29661
|
agentId: params.followupRun.run.agentId,
|
|
@@ -29415,6 +29689,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
29415
29689
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
29416
29690
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
29417
29691
|
execOverrides: params.followupRun.run.execOverrides,
|
|
29692
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
29418
29693
|
bashElevated: params.followupRun.run.bashElevated,
|
|
29419
29694
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
29420
29695
|
runId: flushRunId,
|
|
@@ -29750,10 +30025,12 @@ function createFollowupRunner(params) {
|
|
|
29750
30025
|
provider: queued.run.provider,
|
|
29751
30026
|
model: queued.run.model,
|
|
29752
30027
|
agentDir: queued.run.agentDir,
|
|
30028
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
30029
|
+
thinkLevel: queued.run.thinkLevel,
|
|
29753
30030
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
29754
30031
|
run: (provider, model) => {
|
|
29755
30032
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
29756
|
-
return
|
|
30033
|
+
return runNoxSoftEmbeddedAgent({
|
|
29757
30034
|
sessionId: queued.run.sessionId,
|
|
29758
30035
|
sessionKey: queued.run.sessionKey,
|
|
29759
30036
|
agentId: queued.run.agentId,
|
|
@@ -29784,6 +30061,7 @@ function createFollowupRunner(params) {
|
|
|
29784
30061
|
verboseLevel: queued.run.verboseLevel,
|
|
29785
30062
|
reasoningLevel: queued.run.reasoningLevel,
|
|
29786
30063
|
execOverrides: queued.run.execOverrides,
|
|
30064
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
29787
30065
|
bashElevated: queued.run.bashElevated,
|
|
29788
30066
|
timeoutMs: queued.run.timeoutMs,
|
|
29789
30067
|
runId,
|
|
@@ -30764,7 +31042,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
30764
31042
|
return;
|
|
30765
31043
|
}
|
|
30766
31044
|
try {
|
|
30767
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
31045
|
+
const { deliverOutboundPayloads } = await import("./deliver-C1L5nO0K.js").then((n) => n.n);
|
|
30768
31046
|
await deliverOutboundPayloads({
|
|
30769
31047
|
cfg: params.cfg,
|
|
30770
31048
|
channel,
|
|
@@ -32201,7 +32479,7 @@ function createWhatsAppLoginTool() {
|
|
|
32201
32479
|
force: Type.Optional(Type.Boolean())
|
|
32202
32480
|
}),
|
|
32203
32481
|
execute: async (_toolCallId, args) => {
|
|
32204
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
32482
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-DILcBA_q.js");
|
|
32205
32483
|
if ((args?.action ?? "start") === "wait") {
|
|
32206
32484
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
32207
32485
|
return {
|
|
@@ -32376,23 +32654,23 @@ let webLoginQrPromise = null;
|
|
|
32376
32654
|
let webChannelPromise = null;
|
|
32377
32655
|
let whatsappActionsPromise = null;
|
|
32378
32656
|
function loadWebOutbound() {
|
|
32379
|
-
webOutboundPromise ??= import("./outbound-
|
|
32657
|
+
webOutboundPromise ??= import("./outbound-C577aWZp.js").then((n) => n.t);
|
|
32380
32658
|
return webOutboundPromise;
|
|
32381
32659
|
}
|
|
32382
32660
|
function loadWebLogin() {
|
|
32383
|
-
webLoginPromise ??= import("./login-
|
|
32661
|
+
webLoginPromise ??= import("./login-CrMpAZ0n.js").then((n) => n.n);
|
|
32384
32662
|
return webLoginPromise;
|
|
32385
32663
|
}
|
|
32386
32664
|
function loadWebLoginQr() {
|
|
32387
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
32665
|
+
webLoginQrPromise ??= import("./login-qr-DILcBA_q.js");
|
|
32388
32666
|
return webLoginQrPromise;
|
|
32389
32667
|
}
|
|
32390
32668
|
function loadWebChannel() {
|
|
32391
|
-
webChannelPromise ??= import("./web-
|
|
32669
|
+
webChannelPromise ??= import("./web-DvTXV-fo.js");
|
|
32392
32670
|
return webChannelPromise;
|
|
32393
32671
|
}
|
|
32394
32672
|
function loadWhatsAppActions() {
|
|
32395
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
32673
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-C0tlEdLy.js");
|
|
32396
32674
|
return whatsappActionsPromise;
|
|
32397
32675
|
}
|
|
32398
32676
|
function createPluginRuntime() {
|
|
@@ -34466,15 +34744,6 @@ function createAnimaCodingTools(options) {
|
|
|
34466
34744
|
|
|
34467
34745
|
//#endregion
|
|
34468
34746
|
//#region src/agents/gemini-direct-runner.ts
|
|
34469
|
-
/**
|
|
34470
|
-
* Gemini Direct API Runner
|
|
34471
|
-
*
|
|
34472
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
34473
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
34474
|
-
*
|
|
34475
|
-
* This runner is automatically used when a google API key is available
|
|
34476
|
-
* and the provider is set to "google" or "gemini".
|
|
34477
|
-
*/
|
|
34478
34747
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
34479
34748
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
34480
34749
|
const MODEL_MAP = {
|
|
@@ -34566,7 +34835,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34566
34835
|
cwd: process.cwd(),
|
|
34567
34836
|
moduleUrl: import.meta.url
|
|
34568
34837
|
});
|
|
34569
|
-
const extraSystemPrompt =
|
|
34838
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
34570
34839
|
const systemPrompt = buildSystemPrompt({
|
|
34571
34840
|
workspaceDir,
|
|
34572
34841
|
config: params.config,
|
|
@@ -34645,7 +34914,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
34645
34914
|
};
|
|
34646
34915
|
}
|
|
34647
34916
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
34648
|
-
await params.onAssistantMessageStart?.();
|
|
34649
34917
|
const bodyStream = Readable.fromWeb(response.body);
|
|
34650
34918
|
let buffer = "";
|
|
34651
34919
|
let chunkAssistantText = "";
|
|
@@ -34671,12 +34939,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
34671
34939
|
nonTextParts.push(p);
|
|
34672
34940
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
34673
34941
|
}
|
|
34674
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
34675
34942
|
if (parsed.usageMetadata) {
|
|
34676
34943
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
34677
34944
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
34678
34945
|
}
|
|
34679
|
-
} catch
|
|
34946
|
+
} catch {}
|
|
34680
34947
|
}
|
|
34681
34948
|
}
|
|
34682
34949
|
if (functionCalls.length > 0) {
|
|
@@ -34736,7 +35003,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34736
35003
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
34737
35004
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
34738
35005
|
return {
|
|
34739
|
-
status: "failed",
|
|
35006
|
+
status: isAbort ? "timeout" : "failed",
|
|
34740
35007
|
meta: {
|
|
34741
35008
|
durationMs: Date.now() - started,
|
|
34742
35009
|
error: {
|
|
@@ -34773,7 +35040,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
34773
35040
|
}
|
|
34774
35041
|
|
|
34775
35042
|
//#endregion
|
|
34776
|
-
//#region src/agents/
|
|
35043
|
+
//#region src/agents/noxsoft-runner.ts
|
|
34777
35044
|
function normalizeEmbeddedProvider(provider) {
|
|
34778
35045
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
34779
35046
|
}
|
|
@@ -34794,178 +35061,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
34794
35061
|
data
|
|
34795
35062
|
});
|
|
34796
35063
|
}
|
|
34797
|
-
|
|
34798
|
-
|
|
34799
|
-
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) {
|
|
34800
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;
|
|
34801
35275
|
const startedAt = Date.now();
|
|
34802
35276
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
34803
35277
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
34804
35278
|
let assistantStarted = false;
|
|
34805
35279
|
const streamTasks = [];
|
|
34806
|
-
|
|
34807
|
-
|
|
34808
|
-
|
|
34809
|
-
|
|
34810
|
-
|
|
34811
|
-
|
|
34812
|
-
|
|
34813
|
-
|
|
34814
|
-
|
|
34815
|
-
|
|
34816
|
-
|
|
34817
|
-
|
|
34818
|
-
|
|
34819
|
-
|
|
34820
|
-
|
|
34821
|
-
|
|
34822
|
-
|
|
34823
|
-
|
|
34824
|
-
|
|
34825
|
-
|
|
34826
|
-
|
|
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",
|
|
34827
35303
|
timeoutMs,
|
|
34828
35304
|
runId,
|
|
34829
|
-
|
|
34830
|
-
|
|
34831
|
-
|
|
34832
|
-
|
|
34833
|
-
|
|
34834
|
-
|
|
34835
|
-
|
|
34836
|
-
|
|
34837
|
-
|
|
34838
|
-
|
|
34839
|
-
|
|
34840
|
-
|
|
34841
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
34842
|
-
phase: "end",
|
|
34843
|
-
durationMs: Date.now() - startedAt,
|
|
34844
|
-
status: result.status
|
|
34845
|
-
});
|
|
34846
|
-
return result;
|
|
34847
|
-
} 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) {
|
|
34848
35317
|
await emitAgentEvent(params, "lifecycle", {
|
|
34849
35318
|
phase: "error",
|
|
34850
|
-
|
|
35319
|
+
startedAt,
|
|
35320
|
+
endedAt: Date.now(),
|
|
35321
|
+
error: failure.message,
|
|
35322
|
+
status: result.status
|
|
34851
35323
|
});
|
|
34852
|
-
throw
|
|
35324
|
+
throw failure;
|
|
34853
35325
|
}
|
|
34854
|
-
}
|
|
34855
|
-
}
|
|
34856
|
-
if (provider === "google" || provider === "gemini") {
|
|
34857
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
34858
|
-
provider: "google",
|
|
34859
|
-
cfg: params.config
|
|
34860
|
-
}))?.apiKey;
|
|
34861
|
-
if (geminiApiKey) {
|
|
34862
35326
|
await emitAgentEvent(params, "lifecycle", {
|
|
34863
|
-
phase: "
|
|
34864
|
-
startedAt
|
|
35327
|
+
phase: "end",
|
|
35328
|
+
durationMs: Date.now() - startedAt,
|
|
35329
|
+
status: result.status
|
|
34865
35330
|
});
|
|
34866
|
-
|
|
34867
|
-
|
|
34868
|
-
|
|
34869
|
-
|
|
34870
|
-
|
|
34871
|
-
|
|
34872
|
-
|
|
34873
|
-
|
|
34874
|
-
|
|
34875
|
-
|
|
34876
|
-
|
|
34877
|
-
|
|
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",
|
|
34878
35350
|
timeoutMs,
|
|
34879
35351
|
runId,
|
|
34880
|
-
|
|
34881
|
-
|
|
34882
|
-
|
|
34883
|
-
|
|
34884
|
-
|
|
34885
|
-
|
|
34886
|
-
|
|
34887
|
-
|
|
34888
|
-
|
|
34889
|
-
|
|
34890
|
-
|
|
34891
|
-
|
|
34892
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
34893
|
-
phase: "end",
|
|
34894
|
-
durationMs: Date.now() - startedAt,
|
|
34895
|
-
status: result.status
|
|
34896
|
-
});
|
|
34897
|
-
return result;
|
|
34898
|
-
} 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) {
|
|
34899
35364
|
await emitAgentEvent(params, "lifecycle", {
|
|
34900
35365
|
phase: "error",
|
|
34901
|
-
|
|
35366
|
+
startedAt,
|
|
35367
|
+
endedAt: Date.now(),
|
|
35368
|
+
error: failure.message,
|
|
35369
|
+
status: result.status
|
|
34902
35370
|
});
|
|
34903
|
-
throw
|
|
35371
|
+
throw failure;
|
|
34904
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;
|
|
34905
35385
|
}
|
|
34906
35386
|
}
|
|
34907
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
34908
|
-
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`);
|
|
34909
35387
|
await emitAgentEvent(params, "lifecycle", {
|
|
34910
35388
|
phase: "start",
|
|
34911
35389
|
startedAt
|
|
34912
35390
|
});
|
|
34913
35391
|
try {
|
|
34914
|
-
const result =
|
|
34915
|
-
|
|
34916
|
-
|
|
34917
|
-
|
|
34918
|
-
|
|
34919
|
-
|
|
34920
|
-
|
|
34921
|
-
|
|
34922
|
-
|
|
34923
|
-
|
|
34924
|
-
|
|
34925
|
-
|
|
34926
|
-
|
|
34927
|
-
|
|
34928
|
-
|
|
34929
|
-
|
|
34930
|
-
|
|
34931
|
-
|
|
34932
|
-
|
|
34933
|
-
|
|
34934
|
-
|
|
34935
|
-
|
|
34936
|
-
|
|
34937
|
-
}
|
|
34938
|
-
|
|
34939
|
-
|
|
34940
|
-
|
|
34941
|
-
|
|
34942
|
-
|
|
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
|
|
34943
35421
|
});
|
|
34944
35422
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
34945
35423
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
34946
|
-
if (finalText && !assistantStarted) {
|
|
34947
|
-
assistantStarted = true;
|
|
34948
|
-
await params.onAssistantMessageStart?.();
|
|
34949
|
-
await params.onPartialReply?.({ text: finalText });
|
|
34950
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
34951
|
-
}
|
|
35424
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
34952
35425
|
await emitAgentEvent(params, "lifecycle", {
|
|
34953
35426
|
phase: "end",
|
|
34954
35427
|
startedAt,
|
|
34955
35428
|
endedAt: Date.now(),
|
|
34956
|
-
aborted: false
|
|
35429
|
+
aborted: false,
|
|
35430
|
+
status: result.status
|
|
34957
35431
|
});
|
|
34958
|
-
return
|
|
34959
|
-
...result,
|
|
34960
|
-
meta: {
|
|
34961
|
-
...result.meta,
|
|
34962
|
-
agentMeta: {
|
|
34963
|
-
...result.meta.agentMeta,
|
|
34964
|
-
provider,
|
|
34965
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
34966
|
-
}
|
|
34967
|
-
}
|
|
34968
|
-
};
|
|
35432
|
+
return result;
|
|
34969
35433
|
} catch (error) {
|
|
34970
35434
|
const message = error instanceof Error ? error.message : String(error);
|
|
34971
35435
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -34977,6 +35441,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
34977
35441
|
throw error;
|
|
34978
35442
|
}
|
|
34979
35443
|
}
|
|
35444
|
+
|
|
35445
|
+
//#endregion
|
|
35446
|
+
//#region src/agents/pi-embedded.ts
|
|
34980
35447
|
async function compactEmbeddedPiSession(..._args) {
|
|
34981
35448
|
return {
|
|
34982
35449
|
ok: true,
|
|
@@ -36124,4 +36591,4 @@ function initSubagentRegistry() {
|
|
|
36124
36591
|
}
|
|
36125
36592
|
|
|
36126
36593
|
//#endregion
|
|
36127
|
-
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 };
|