@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,24 +1,25 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
|
-
import { B as resolveRequiredHomeDir, C as colorize, E as getChildLogger, F as resolveOAuthDir, L as resolveStateDir, M as resolveConfigPath, P as resolveGatewayPort, T as theme, _ as logVerbose, a as unregisterActiveProgressLine, b as shouldLogVerbose, f as getActivePluginRegistry, i as registerActiveProgressLine, k as normalizeLogLevel, l as normalizeAnyChannelId, m as setActivePluginRegistry, n as defaultRuntime, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeChannelId, w as isRich, y as setVerbose } from "./subsystem-
|
|
3
|
-
import { A as classifySessionKeyShape, B as parseAgentSessionKey, D as buildAgentMainSessionKey, E as DEFAULT_MAIN_KEY, F as resolveThreadSessionKeys, I as sanitizeAgentId, L as getSubagentDepth, M as normalizeAgentId, N as normalizeMainKey, O as buildAgentPeerSessionKey, P as resolveAgentIdFromSessionKey, R as isAcpSessionKey, S as resolveAnimaPackageRoot, T as DEFAULT_AGENT_ID, V as resolveThreadParentSessionKey, b as filterBootstrapFilesForSession, c as resolveDefaultAgentId, f as DEFAULT_AGENT_WORKSPACE_DIR, i as resolveAgentModelFallbacksOverride, j as normalizeAccountId$1, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds, w as DEFAULT_ACCOUNT_ID, x as loadWorkspaceBootstrapFiles, y as ensureAgentWorkspace, z as isSubagentSessionKey } from "./agent-scope-
|
|
4
|
-
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-
|
|
5
|
-
import { a as modelKey, d as resolveModelRefFromString, f as resolveThinkingDefault, h as DEFAULT_PROVIDER, i as isCliProvider, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveDefaultModelForAgent } from "./model-selection-
|
|
6
|
-
import { $ as resolveChannelResetConfig, A as isContextOverflowError, At as resolveSandboxConfigForAgent, B as readSessionUpdatedAt, Bt as matchesAnyGlobPattern, C as normalizeThinkLevel, Ct as buildWorkspaceSkillSnapshot, D as supportsXHighThinking, Dt as resolveSandboxedMediaSource, E as resolveResponseUsageMode, Et as assertSandboxPath, F as ensureSandboxWorkspaceForSession, Ft as expandToolGroups, G as updateSessionStoreEntry, Gt as SILENT_REPLY_TOKEN, Ht as resolveBootstrapMaxChars, I as resolveSandboxRuntimeStatus, It as normalizeToolName, J as mergeDeliveryContext, K as deliveryContextFromSession, Kt as isSilentReplyText, L as extractDeliveryInfo, Lt as resolveToolProfilePolicy, M as isLikelyContextOverflowError, Mt as buildPluginToolGroups, N as isTransientHttpError, Nt as collectExplicitAllowlist, O as classifyFailoverReason, Ot as ensureBrowserControlAuth, P as sanitizeUserFacingText, Pt as expandPolicyWithPluginGroups, Q as evaluateSessionFreshness, R as appendAssistantMessageToSessionTranscript, Rt as stripPluginOnlyAllowlist, S as normalizeReasoningLevel, St as buildWorkspaceSkillCommandSpecs, T as normalizeVerboseLevel, Tt as assertMediaNotDataUrl, U as updateLastRoute, Ut as resolveBootstrapTotalMaxChars, V as recordSessionMetaFromInbound, Vt as buildBootstrapContextFiles, W as updateSessionStore, Wt as HEARTBEAT_TOKEN, X as normalizeSessionDeliveryFields, Y as normalizeDeliveryContext, Z as resolveSessionKey$1, _ as initializeGlobalHookRunner, _t as getMediaDir, a as applyReplyThreading, at as canonicalizeMainSessionAlias, b as listThinkingLevels, bt as resolvePathsWithinRoot, c as shouldSuppressMessagingToolReplies, ct as getChannelDock, d as buildTargetResolverSignature, dt as normalizeChatType, et as resolveSessionResetPolicy, f as normalizeChannelTargetInput, ft as resolveGroupSessionKey, g as getGlobalHookRunner, gt as resolveProfile, h as parseReplyDirectives, ht as resolveBrowserConfig, i as applyReplyTagsToPayload, it as resolveFreshSessionTotalTokens, j as isFailoverErrorMessage, jt as applyOwnerOnlyToolPolicy, k as isCompactionFailureError, kt as resolveBrowserControlAuth, l as createReplyToModeFilterForChannel, lt as listChannelDocks, m as throwIfAborted, mt as registerBrowserRoutes, nt as resolveThreadFlag, o as filterMessagingToolDuplicates, ot as resolveMainSessionKey, p as normalizeTargetForProvider, pt as createBrowserRouteContext, q as deliveryContextKey, r as normalizeReplyPayloadsForDelivery, rt as DEFAULT_RESET_TRIGGERS, s as isRenderablePayload, st as deriveSessionMetaPatch, t as deliverOutboundPayloads, tt as resolveSessionResetType, u as resolveReplyToMode, ut as resolveConversationLabel, v as formatThinkingLevels, vt as saveMediaBuffer, w as normalizeUsageDisplay, wt as resolvePluginSkillDirs, x as normalizeElevatedLevel, xt as getBridgeAuthForPort, y as formatXHighModelHint, yt as DEFAULT_UPLOAD_DIR, z as loadSessionStore, zt as compileGlobPatterns } from "./deliver-
|
|
7
|
-
import { C as parseConfigPath, E as VERSION, S as getConfigValueAtPath, T as unsetConfigValueAtPath, _ as resolveMemorySlotDecision, a as writeConfigFile, b as setConfigOverride, c as parseDurationMs, d as discoverAnimaPlugins, g as resolveEnableState, h as normalizePluginsConfig, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as applyTestPluginDefaults, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as getConfigOverrides, w as setConfigValueAtPath, x as unsetConfigOverride, y as resetConfigOverrides } from "./config-
|
|
8
|
-
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-
|
|
9
|
-
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-
|
|
2
|
+
import { B as resolveRequiredHomeDir, C as colorize, E as getChildLogger, F as resolveOAuthDir, L as resolveStateDir, M as resolveConfigPath, P as resolveGatewayPort, T as theme, _ as logVerbose, a as unregisterActiveProgressLine, b as shouldLogVerbose, f as getActivePluginRegistry, i as registerActiveProgressLine, k as normalizeLogLevel, l as normalizeAnyChannelId, m as setActivePluginRegistry, n as defaultRuntime, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeChannelId, w as isRich, y as setVerbose } from "./subsystem-D-Xta-sj.js";
|
|
3
|
+
import { A as classifySessionKeyShape, B as parseAgentSessionKey, D as buildAgentMainSessionKey, E as DEFAULT_MAIN_KEY, F as resolveThreadSessionKeys, I as sanitizeAgentId, L as getSubagentDepth, M as normalizeAgentId, N as normalizeMainKey, O as buildAgentPeerSessionKey, P as resolveAgentIdFromSessionKey, R as isAcpSessionKey, S as resolveAnimaPackageRoot, T as DEFAULT_AGENT_ID, V as resolveThreadParentSessionKey, b as filterBootstrapFilesForSession, c as resolveDefaultAgentId, f as DEFAULT_AGENT_WORKSPACE_DIR, i as resolveAgentModelFallbacksOverride, j as normalizeAccountId$1, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds, w as DEFAULT_ACCOUNT_ID, x as loadWorkspaceBootstrapFiles, y as ensureAgentWorkspace, z as isSubagentSessionKey } from "./agent-scope-ByIGrCTT.js";
|
|
4
|
+
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-C6tXfeqA.js";
|
|
5
|
+
import { a as modelKey, d as resolveModelRefFromString, f as resolveThinkingDefault, h as DEFAULT_PROVIDER, i as isCliProvider, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveDefaultModelForAgent } from "./model-selection-CLcoOT3e.js";
|
|
6
|
+
import { $ as resolveChannelResetConfig, A as isContextOverflowError, At as resolveSandboxConfigForAgent, B as readSessionUpdatedAt, Bt as matchesAnyGlobPattern, C as normalizeThinkLevel, Ct as buildWorkspaceSkillSnapshot, D as supportsXHighThinking, Dt as resolveSandboxedMediaSource, E as resolveResponseUsageMode, Et as assertSandboxPath, F as ensureSandboxWorkspaceForSession, Ft as expandToolGroups, G as updateSessionStoreEntry, Gt as SILENT_REPLY_TOKEN, Ht as resolveBootstrapMaxChars, I as resolveSandboxRuntimeStatus, It as normalizeToolName, J as mergeDeliveryContext, K as deliveryContextFromSession, Kt as isSilentReplyText, L as extractDeliveryInfo, Lt as resolveToolProfilePolicy, M as isLikelyContextOverflowError, Mt as buildPluginToolGroups, N as isTransientHttpError, Nt as collectExplicitAllowlist, O as classifyFailoverReason, Ot as ensureBrowserControlAuth, P as sanitizeUserFacingText, Pt as expandPolicyWithPluginGroups, Q as evaluateSessionFreshness, R as appendAssistantMessageToSessionTranscript, Rt as stripPluginOnlyAllowlist, S as normalizeReasoningLevel, St as buildWorkspaceSkillCommandSpecs, T as normalizeVerboseLevel, Tt as assertMediaNotDataUrl, U as updateLastRoute, Ut as resolveBootstrapTotalMaxChars, V as recordSessionMetaFromInbound, Vt as buildBootstrapContextFiles, W as updateSessionStore, Wt as HEARTBEAT_TOKEN, X as normalizeSessionDeliveryFields, Y as normalizeDeliveryContext, Z as resolveSessionKey$1, _ as initializeGlobalHookRunner, _t as getMediaDir, a as applyReplyThreading, at as canonicalizeMainSessionAlias, b as listThinkingLevels, bt as resolvePathsWithinRoot, c as shouldSuppressMessagingToolReplies, ct as getChannelDock, d as buildTargetResolverSignature, dt as normalizeChatType, et as resolveSessionResetPolicy, f as normalizeChannelTargetInput, ft as resolveGroupSessionKey, g as getGlobalHookRunner, gt as resolveProfile, h as parseReplyDirectives, ht as resolveBrowserConfig, i as applyReplyTagsToPayload, it as resolveFreshSessionTotalTokens, j as isFailoverErrorMessage, jt as applyOwnerOnlyToolPolicy, k as isCompactionFailureError, kt as resolveBrowserControlAuth, l as createReplyToModeFilterForChannel, lt as listChannelDocks, m as throwIfAborted, mt as registerBrowserRoutes, nt as resolveThreadFlag, o as filterMessagingToolDuplicates, ot as resolveMainSessionKey, p as normalizeTargetForProvider, pt as createBrowserRouteContext, q as deliveryContextKey, r as normalizeReplyPayloadsForDelivery, rt as DEFAULT_RESET_TRIGGERS, s as isRenderablePayload, st as deriveSessionMetaPatch, t as deliverOutboundPayloads, tt as resolveSessionResetType, u as resolveReplyToMode, ut as resolveConversationLabel, v as formatThinkingLevels, vt as saveMediaBuffer, w as normalizeUsageDisplay, wt as resolvePluginSkillDirs, x as normalizeElevatedLevel, xt as getBridgeAuthForPort, y as formatXHighModelHint, yt as DEFAULT_UPLOAD_DIR, z as loadSessionStore, zt as compileGlobPatterns } from "./deliver-B-dPbUIs.js";
|
|
7
|
+
import { C as parseConfigPath, E as VERSION, S as getConfigValueAtPath, T as unsetConfigValueAtPath, _ as resolveMemorySlotDecision, a as writeConfigFile, b as setConfigOverride, c as parseDurationMs, d as discoverAnimaPlugins, g as resolveEnableState, h as normalizePluginsConfig, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as applyTestPluginDefaults, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as getConfigOverrides, w as setConfigValueAtPath, x as unsetConfigOverride, y as resetConfigOverrides } from "./config-ZYN8tezd.js";
|
|
8
|
+
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-CMI9f7-7.js";
|
|
9
|
+
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-B8EnYGj1.js";
|
|
10
10
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-CsqJApTg.js";
|
|
11
11
|
import { n as formatErrorMessage } from "./errors-CllZhhV1.js";
|
|
12
|
-
import { A as extensionForMime, C as GATEWAY_CLIENT_NAMES, F as normalizeMimeType$1, H as isPrivateIpAddress, L as mediaKindFromMime, M as imageMimeFromFormat, N as isAudioFileName, O as resizeToJpeg, P as kindFromMime, R as SsrFBlockedError, S as GATEWAY_CLIENT_MODES, T as getImageMetadata, V as isBlockedHostname, _ as listDeliverableMessageChannels, a as chunkText, b as resolveMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isMarkdownCapableMessageChannel, h as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as getFileExtension, k as detectMime, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as normalizeMessageChannel, x as GATEWAY_CLIENT_IDS, y as resolveGatewayMessageChannel } from "./chunk-
|
|
13
|
-
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-
|
|
14
|
-
import { t as sanitizeToolResultImages } from "./tool-images-
|
|
15
|
-
import { a as
|
|
16
|
-
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-
|
|
17
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-
|
|
18
|
-
import {
|
|
19
|
-
import { a as
|
|
12
|
+
import { A as extensionForMime, C as GATEWAY_CLIENT_NAMES, F as normalizeMimeType$1, H as isPrivateIpAddress, L as mediaKindFromMime, M as imageMimeFromFormat, N as isAudioFileName, O as resizeToJpeg, P as kindFromMime, R as SsrFBlockedError, S as GATEWAY_CLIENT_MODES, T as getImageMetadata, V as isBlockedHostname, _ as listDeliverableMessageChannels, a as chunkText, b as resolveMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isMarkdownCapableMessageChannel, h as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as getFileExtension, k as detectMime, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as normalizeMessageChannel, x as GATEWAY_CLIENT_IDS, y as resolveGatewayMessageChannel } from "./chunk-DJXDX69U.js";
|
|
13
|
+
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-CAQJvbeZ.js";
|
|
14
|
+
import { t as sanitizeToolResultImages } from "./tool-images-C6cKHTbj.js";
|
|
15
|
+
import { _ as normalizeSecretInput, a as markAuthProfileUsed, c as markAuthProfileGood, d as resolveAnimaAgentDir, f as loadJsonFile, h as resolveAuthProfileDisplayLabel, i as markAuthProfileFailure, l as ensureAuthProfileStore, m as withFileLock$1, n as resolveAuthProfileOrder, o as resolveApiKeyForProfile, p as saveJsonFile, r as isProfileInCooldown, s as listProfilesForProvider, u as resolveAuthStorePathForDisplay } from "./auth-profiles-DKu7ZUzl.js";
|
|
16
|
+
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-BYu34CX3.js";
|
|
17
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-BMMt7osH.js";
|
|
18
|
+
import { n as createAsyncLock } from "./soul-BiIdv3Wp.js";
|
|
19
|
+
import { a as readNumberParam, c as readStringParam, i as jsonResult, n as imageResult, r as imageResultFromFile, s as readStringArrayParam } from "./common-DT_obM-k.js";
|
|
20
|
+
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-BKtsWhsb.js";
|
|
20
21
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-B1cF8Wk2.js";
|
|
21
|
-
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-
|
|
22
|
+
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-BpYI9t_y.js";
|
|
22
23
|
import { createRequire } from "node:module";
|
|
23
24
|
import * as path$1 from "node:path";
|
|
24
25
|
import path, { join } from "node:path";
|
|
@@ -35,7 +36,7 @@ import crypto, { X509Certificate, randomUUID } from "node:crypto";
|
|
|
35
36
|
import AjvPkg from "ajv";
|
|
36
37
|
import net from "node:net";
|
|
37
38
|
import { CURRENT_SESSION_VERSION, SessionManager, codingTools, createEditTool, createReadTool, createWriteTool, readTool } from "@mariozechner/pi-coding-agent";
|
|
38
|
-
import { WebSocket
|
|
39
|
+
import { WebSocket } from "ws";
|
|
39
40
|
import { complete, completeSimple } from "@mariozechner/pi-ai";
|
|
40
41
|
import { EdgeTTS } from "node-edge-tts";
|
|
41
42
|
import { Readable } from "node:stream";
|
|
@@ -2574,6 +2575,17 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2574
2575
|
return fs.existsSync(packageDocs) ? packageDocs : null;
|
|
2575
2576
|
}
|
|
2576
2577
|
|
|
2578
|
+
//#endregion
|
|
2579
|
+
//#region src/agents/runner-capabilities.ts
|
|
2580
|
+
const CAPABILITY_HINTS = {
|
|
2581
|
+
"cli-native": "Use your native CLI capabilities when needed. Do not assume external MCP-style tools exist unless they are explicitly provided.",
|
|
2582
|
+
"local-tools": "Use only the tools explicitly provided in this session. Do not assume any other external MCP-style tools exist.",
|
|
2583
|
+
disabled: "Tools are disabled in this session. Do not call tools."
|
|
2584
|
+
};
|
|
2585
|
+
function appendRunnerCapabilityPrompt(prompt, mode) {
|
|
2586
|
+
return [prompt?.trim(), CAPABILITY_HINTS[mode]].filter(Boolean).join("\n");
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2577
2589
|
//#endregion
|
|
2578
2590
|
//#region src/logging/redact-identifier.ts
|
|
2579
2591
|
function sha256HexPrefix(value, len = 12) {
|
|
@@ -2643,6 +2655,18 @@ function resolveRunWorkspaceDir(params) {
|
|
|
2643
2655
|
|
|
2644
2656
|
//#endregion
|
|
2645
2657
|
//#region src/agents/anthropic-direct-runner.ts
|
|
2658
|
+
/**
|
|
2659
|
+
* Anthropic Direct API Runner
|
|
2660
|
+
*
|
|
2661
|
+
* Makes calls directly to api.anthropic.com without needing the claude CLI
|
|
2662
|
+
* binary to be installed or logged in. Works with any valid token:
|
|
2663
|
+
*
|
|
2664
|
+
* sk-ant-api01-... (Console API key)
|
|
2665
|
+
* sk-ant-oat01-... (Claude Code OAuth access token)
|
|
2666
|
+
*
|
|
2667
|
+
* This runner is automatically used when an `anthropic:default` token credential
|
|
2668
|
+
* is present in the auth store and the claude CLI is unavailable or not logged in.
|
|
2669
|
+
*/
|
|
2646
2670
|
const log$9 = createSubsystemLogger("agent/anthropic-direct");
|
|
2647
2671
|
const MODEL_MAP$1 = {
|
|
2648
2672
|
opus: "claude-opus-4-5",
|
|
@@ -2718,7 +2742,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2718
2742
|
cwd: process.cwd(),
|
|
2719
2743
|
moduleUrl: import.meta.url
|
|
2720
2744
|
});
|
|
2721
|
-
const extraSystemPrompt =
|
|
2745
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "disabled");
|
|
2722
2746
|
const systemPrompt = buildSystemPrompt({
|
|
2723
2747
|
workspaceDir,
|
|
2724
2748
|
config: params.config,
|
|
@@ -2758,7 +2782,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2758
2782
|
"x-api-key": params.token,
|
|
2759
2783
|
"anthropic-version": "2023-06-01",
|
|
2760
2784
|
"content-type": "application/json",
|
|
2761
|
-
"user-agent": `anima/
|
|
2785
|
+
"user-agent": `anima/5.1.3 (direct-runner; ${os.platform()})`
|
|
2762
2786
|
},
|
|
2763
2787
|
body: JSON.stringify(requestBody),
|
|
2764
2788
|
signal: controller.signal
|
|
@@ -2791,7 +2815,6 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2791
2815
|
stopReason: data.stop_reason,
|
|
2792
2816
|
contentTypes: (data.content ?? []).map((b) => b.type)
|
|
2793
2817
|
});
|
|
2794
|
-
await params.onAssistantMessageStart?.();
|
|
2795
2818
|
if (outputText && params.onPartialReply) await params.onPartialReply({ text: outputText });
|
|
2796
2819
|
history.messages.push({
|
|
2797
2820
|
role: "assistant",
|
|
@@ -2911,8 +2934,7 @@ const DEFAULT_CODEX_BACKEND = {
|
|
|
2911
2934
|
"--json",
|
|
2912
2935
|
"--color",
|
|
2913
2936
|
"never",
|
|
2914
|
-
"--sandbox",
|
|
2915
|
-
"danger-full-access",
|
|
2937
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
2916
2938
|
"--skip-git-repo-check"
|
|
2917
2939
|
],
|
|
2918
2940
|
resumeArgs: [
|
|
@@ -2990,6 +3012,7 @@ const LEGACY_CODEX_RESUME_ARGS = [
|
|
|
2990
3012
|
"read-only",
|
|
2991
3013
|
"--skip-git-repo-check"
|
|
2992
3014
|
];
|
|
3015
|
+
const CODEX_BYPASS_FLAG = "--dangerously-bypass-approvals-and-sandbox";
|
|
2993
3016
|
function normalizeBackendKey(key) {
|
|
2994
3017
|
return normalizeProviderId(key);
|
|
2995
3018
|
}
|
|
@@ -3026,29 +3049,43 @@ function argsEqual(left, right) {
|
|
|
3026
3049
|
if (!left || !right || left.length !== right.length) return false;
|
|
3027
3050
|
return left.every((entry, index) => entry === right[index]);
|
|
3028
3051
|
}
|
|
3029
|
-
function
|
|
3052
|
+
function resolveCodexExecModeArg(args) {
|
|
3030
3053
|
if (!args) return;
|
|
3054
|
+
if (args.includes(CODEX_BYPASS_FLAG)) return CODEX_BYPASS_FLAG;
|
|
3031
3055
|
const index = args.indexOf("--sandbox");
|
|
3032
3056
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
3033
|
-
return
|
|
3034
|
-
}
|
|
3035
|
-
function
|
|
3036
|
-
const nextArgs = [
|
|
3037
|
-
const
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3057
|
+
return value === "workspace-write" || value === "read-only" ? value : void 0;
|
|
3058
|
+
}
|
|
3059
|
+
function setCodexExecModeArgs(args, mode) {
|
|
3060
|
+
const nextArgs = [];
|
|
3061
|
+
const source = args ?? [];
|
|
3062
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
3063
|
+
const entry = source[i];
|
|
3064
|
+
if (entry === CODEX_BYPASS_FLAG) continue;
|
|
3065
|
+
if (entry === "--sandbox") {
|
|
3066
|
+
i += 1;
|
|
3067
|
+
continue;
|
|
3068
|
+
}
|
|
3069
|
+
nextArgs.push(entry);
|
|
3041
3070
|
}
|
|
3042
|
-
nextArgs.push(
|
|
3071
|
+
if (mode === CODEX_BYPASS_FLAG) nextArgs.push(CODEX_BYPASS_FLAG);
|
|
3072
|
+
else nextArgs.push("--sandbox", mode);
|
|
3043
3073
|
return nextArgs;
|
|
3044
3074
|
}
|
|
3045
|
-
function
|
|
3075
|
+
function normalizeExecSecurity$2(execSecurity) {
|
|
3076
|
+
const normalized = execSecurity?.trim().toLowerCase();
|
|
3077
|
+
if (!normalized) return;
|
|
3078
|
+
if (normalized === "deny") return "deny";
|
|
3079
|
+
return "full";
|
|
3080
|
+
}
|
|
3081
|
+
function resolveManagedCodexExecMode(cfg, options) {
|
|
3082
|
+
if (normalizeExecSecurity$2(options?.execSecurity) === "deny") return "read-only";
|
|
3046
3083
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
3047
3084
|
if (workspaceAccess === "ro") return "read-only";
|
|
3048
3085
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
3049
|
-
return
|
|
3086
|
+
return CODEX_BYPASS_FLAG;
|
|
3050
3087
|
}
|
|
3051
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
3088
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
3052
3089
|
const normalized = normalizeBackendKey(provider);
|
|
3053
3090
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
3054
3091
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -3074,9 +3111,9 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
3074
3111
|
...merged,
|
|
3075
3112
|
resumeArgs: DEFAULT_CODEX_BACKEND.resumeArgs
|
|
3076
3113
|
};
|
|
3077
|
-
if (!
|
|
3114
|
+
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
3078
3115
|
...merged,
|
|
3079
|
-
args:
|
|
3116
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
3080
3117
|
};
|
|
3081
3118
|
const command = merged.command?.trim();
|
|
3082
3119
|
if (!command) return null;
|
|
@@ -3255,14 +3292,14 @@ async function runCliAgent(params) {
|
|
|
3255
3292
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
3256
3293
|
if (workspaceResolution.usedFallback) log$8.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
3257
3294
|
const workspaceDir = resolvedWorkspace;
|
|
3258
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
3295
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
3259
3296
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
3260
3297
|
const backend = backendResolved.config;
|
|
3261
|
-
const
|
|
3298
|
+
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
3262
3299
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
3263
3300
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
3264
3301
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
3265
|
-
const extraSystemPrompt =
|
|
3302
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
3266
3303
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
3267
3304
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
3268
3305
|
workspaceDir,
|
|
@@ -3309,15 +3346,24 @@ async function runCliAgent(params) {
|
|
|
3309
3346
|
const lines = (await readFile(params.sessionFile, "utf-8")).trim().split("\n");
|
|
3310
3347
|
const lastLine = lines[lines.length - 1];
|
|
3311
3348
|
if (lastLine) {
|
|
3312
|
-
const
|
|
3313
|
-
const
|
|
3314
|
-
|
|
3315
|
-
|
|
3349
|
+
const parsed = JSON.parse(lastLine);
|
|
3350
|
+
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
3351
|
+
const currentMode = effectiveCodexExecMode;
|
|
3352
|
+
if (!previousMode) {
|
|
3353
|
+
log$8.info("Codex execution mode is unknown for the saved session; forcing session restart.");
|
|
3354
|
+
useResume = false;
|
|
3355
|
+
isNew = true;
|
|
3356
|
+
} else if (previousMode !== currentMode) {
|
|
3357
|
+
log$8.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
3316
3358
|
useResume = false;
|
|
3317
3359
|
isNew = true;
|
|
3318
3360
|
}
|
|
3319
3361
|
}
|
|
3320
|
-
} catch {
|
|
3362
|
+
} catch {
|
|
3363
|
+
log$8.info("Codex session transcript is unavailable; forcing session restart.");
|
|
3364
|
+
useResume = false;
|
|
3365
|
+
isNew = true;
|
|
3366
|
+
}
|
|
3321
3367
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
3322
3368
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
3323
3369
|
backend,
|
|
@@ -3433,8 +3479,9 @@ async function runCliAgent(params) {
|
|
|
3433
3479
|
if (stderr) log$8.debug(`cli stderr:\n${stderr}`);
|
|
3434
3480
|
}
|
|
3435
3481
|
if (result.code !== 0) {
|
|
3436
|
-
const
|
|
3437
|
-
const
|
|
3482
|
+
const timedOut = result.killed && result.signal === "SIGKILL";
|
|
3483
|
+
const err = timedOut ? `Request timed out after ${params.timeoutMs}ms` : stderr || stdout || "CLI failed.";
|
|
3484
|
+
const reason = timedOut ? "timeout" : classifyFailoverReason(err) ?? "unknown";
|
|
3438
3485
|
const status = resolveFailoverStatus(reason);
|
|
3439
3486
|
throw new FailoverError(err, {
|
|
3440
3487
|
reason,
|
|
@@ -3461,7 +3508,7 @@ async function runCliAgent(params) {
|
|
|
3461
3508
|
provider: params.provider,
|
|
3462
3509
|
model: modelId,
|
|
3463
3510
|
usage: output.usage,
|
|
3464
|
-
...
|
|
3511
|
+
...effectiveCodexExecMode ? { metadata: { effectiveCodexExecMode } } : {}
|
|
3465
3512
|
}
|
|
3466
3513
|
}
|
|
3467
3514
|
};
|
|
@@ -4233,7 +4280,7 @@ async function getMemorySearchManager(params) {
|
|
|
4233
4280
|
if (cached) return { manager: cached };
|
|
4234
4281
|
}
|
|
4235
4282
|
try {
|
|
4236
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
4283
|
+
const { QmdMemoryManager } = await import("./qmd-manager-Q0OSDQ-e.js");
|
|
4237
4284
|
const primary = await QmdMemoryManager.create({
|
|
4238
4285
|
cfg: params.cfg,
|
|
4239
4286
|
agentId: params.agentId,
|
|
@@ -4245,7 +4292,7 @@ async function getMemorySearchManager(params) {
|
|
|
4245
4292
|
const wrapper = new FallbackMemoryManager({
|
|
4246
4293
|
primary,
|
|
4247
4294
|
fallbackFactory: async () => {
|
|
4248
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4295
|
+
const { MemoryIndexManager } = await import("./manager-BYu34CX3.js").then((n) => n.t);
|
|
4249
4296
|
return await MemoryIndexManager.get(params);
|
|
4250
4297
|
}
|
|
4251
4298
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -4258,7 +4305,7 @@ async function getMemorySearchManager(params) {
|
|
|
4258
4305
|
}
|
|
4259
4306
|
}
|
|
4260
4307
|
try {
|
|
4261
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4308
|
+
const { MemoryIndexManager } = await import("./manager-BYu34CX3.js").then((n) => n.t);
|
|
4262
4309
|
return { manager: await MemoryIndexManager.get(params) };
|
|
4263
4310
|
} catch (err) {
|
|
4264
4311
|
return {
|
|
@@ -5698,6 +5745,7 @@ const PollParamsSchema = Type.Object({
|
|
|
5698
5745
|
const AgentParamsSchema = Type.Object({
|
|
5699
5746
|
message: NonEmptyString,
|
|
5700
5747
|
agentId: Type.Optional(NonEmptyString),
|
|
5748
|
+
model: Type.Optional(Type.String()),
|
|
5701
5749
|
to: Type.Optional(Type.String()),
|
|
5702
5750
|
replyTo: Type.Optional(Type.String()),
|
|
5703
5751
|
sessionId: Type.Optional(Type.String()),
|
|
@@ -6806,7 +6854,7 @@ var GatewayClient = class {
|
|
|
6806
6854
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("ANIMA Gateway TLS fingerprint mismatch");
|
|
6807
6855
|
});
|
|
6808
6856
|
}
|
|
6809
|
-
this.ws = new WebSocket
|
|
6857
|
+
this.ws = new WebSocket(url, wsOptions);
|
|
6810
6858
|
this.ws.on("open", () => {
|
|
6811
6859
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
6812
6860
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -7009,7 +7057,7 @@ var GatewayClient = class {
|
|
|
7009
7057
|
return null;
|
|
7010
7058
|
}
|
|
7011
7059
|
async request(method, params, opts) {
|
|
7012
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
7060
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("ANIMA Gateway not connected");
|
|
7013
7061
|
const id = randomUUID();
|
|
7014
7062
|
const frame = {
|
|
7015
7063
|
type: "req",
|
|
@@ -8007,7 +8055,7 @@ async function routeReply(params) {
|
|
|
8007
8055
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
8008
8056
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
8009
8057
|
try {
|
|
8010
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
8058
|
+
const { deliverOutboundPayloads } = await import("./deliver-B-dPbUIs.js").then((n) => n.n);
|
|
8011
8059
|
return {
|
|
8012
8060
|
ok: true,
|
|
8013
8061
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -11603,7 +11651,7 @@ async function loadModelCatalog(params) {
|
|
|
11603
11651
|
});
|
|
11604
11652
|
try {
|
|
11605
11653
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
11606
|
-
await (await import("./pi-auth-json-
|
|
11654
|
+
await (await import("./pi-auth-json-B_lKNFK6.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
11607
11655
|
const piSdk = await importPiSdk();
|
|
11608
11656
|
const agentDir = resolveAnimaAgentDir();
|
|
11609
11657
|
const { join } = await import("node:path");
|
|
@@ -13363,8 +13411,8 @@ const resolveProfileOverride = (params) => {
|
|
|
13363
13411
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
13364
13412
|
const PROVIDER_RANK = new Map([
|
|
13365
13413
|
"anthropic",
|
|
13366
|
-
"openai",
|
|
13367
13414
|
"openai-codex",
|
|
13415
|
+
"openai",
|
|
13368
13416
|
"minimax",
|
|
13369
13417
|
"synthetic",
|
|
13370
13418
|
"google",
|
|
@@ -13700,7 +13748,7 @@ async function createModelSelectionState(params) {
|
|
|
13700
13748
|
}
|
|
13701
13749
|
}
|
|
13702
13750
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
13703
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
13751
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-DKu7ZUzl.js").then((n) => n.t);
|
|
13704
13752
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
13705
13753
|
const providerKey = normalizeProviderId(provider);
|
|
13706
13754
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -14762,25 +14810,6 @@ function ensureSkillsWatcher(params) {
|
|
|
14762
14810
|
watchers.set(workspaceDir, state);
|
|
14763
14811
|
}
|
|
14764
14812
|
|
|
14765
|
-
//#endregion
|
|
14766
|
-
//#region src/infra/pairing-files.ts
|
|
14767
|
-
function createAsyncLock() {
|
|
14768
|
-
let lock = Promise.resolve();
|
|
14769
|
-
return async function withLock(fn) {
|
|
14770
|
-
const prev = lock;
|
|
14771
|
-
let release;
|
|
14772
|
-
lock = new Promise((resolve) => {
|
|
14773
|
-
release = resolve;
|
|
14774
|
-
});
|
|
14775
|
-
await prev;
|
|
14776
|
-
try {
|
|
14777
|
-
return await fn();
|
|
14778
|
-
} finally {
|
|
14779
|
-
release?.();
|
|
14780
|
-
}
|
|
14781
|
-
};
|
|
14782
|
-
}
|
|
14783
|
-
|
|
14784
14813
|
//#endregion
|
|
14785
14814
|
//#region src/infra/node-pairing.ts
|
|
14786
14815
|
const PENDING_TTL_MS = 300 * 1e3;
|
|
@@ -27911,6 +27940,263 @@ function createGatewayTool(opts) {
|
|
|
27911
27940
|
};
|
|
27912
27941
|
}
|
|
27913
27942
|
|
|
27943
|
+
//#endregion
|
|
27944
|
+
//#region src/agents/model-auto.ts
|
|
27945
|
+
const DEFAULT_USAGE_THRESHOLD_PERCENT = 5;
|
|
27946
|
+
const USAGE_CACHE_TTL_MS = 6e4;
|
|
27947
|
+
const USAGE_TIMEOUT_MS = 1500;
|
|
27948
|
+
const usageSummaryCache = /* @__PURE__ */ new Map();
|
|
27949
|
+
function resolveRawAutoConfig(cfg) {
|
|
27950
|
+
const modelConfig = cfg?.agents?.defaults?.model;
|
|
27951
|
+
if (typeof modelConfig !== "object" || !modelConfig) return;
|
|
27952
|
+
return modelConfig.auto;
|
|
27953
|
+
}
|
|
27954
|
+
function dedupeProviders(values) {
|
|
27955
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27956
|
+
const result = [];
|
|
27957
|
+
for (const input of values) {
|
|
27958
|
+
if (!input) continue;
|
|
27959
|
+
const normalized = normalizeProviderId(input);
|
|
27960
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
27961
|
+
seen.add(normalized);
|
|
27962
|
+
result.push(normalized);
|
|
27963
|
+
}
|
|
27964
|
+
return result;
|
|
27965
|
+
}
|
|
27966
|
+
function resolveModelAutoConfig(cfg) {
|
|
27967
|
+
const raw = resolveRawAutoConfig(cfg);
|
|
27968
|
+
if (!raw?.enabled) return null;
|
|
27969
|
+
const byProvider = {};
|
|
27970
|
+
for (const [providerRaw, entry] of Object.entries(raw.byProvider ?? {})) {
|
|
27971
|
+
const provider = normalizeProviderId(providerRaw);
|
|
27972
|
+
if (!provider) continue;
|
|
27973
|
+
const models = Array.isArray(entry?.models) ? entry.models.map((value) => String(value ?? "").trim()).filter(Boolean) : [];
|
|
27974
|
+
if (models.length > 0) byProvider[provider] = { models };
|
|
27975
|
+
}
|
|
27976
|
+
const usageThresholdPercent = typeof raw.usageThresholdPercent === "number" && Number.isFinite(raw.usageThresholdPercent) ? Math.max(0, Math.min(100, raw.usageThresholdPercent)) : DEFAULT_USAGE_THRESHOLD_PERCENT;
|
|
27977
|
+
return {
|
|
27978
|
+
enabled: true,
|
|
27979
|
+
providerOrder: dedupeProviders(raw.providerOrder ?? []),
|
|
27980
|
+
byProvider,
|
|
27981
|
+
byWorkingMode: {
|
|
27982
|
+
read: Array.isArray(raw.byWorkingMode?.read) ? raw.byWorkingMode.read.map((value) => String(value ?? "").trim()).filter(Boolean) : [],
|
|
27983
|
+
write: Array.isArray(raw.byWorkingMode?.write) ? raw.byWorkingMode.write.map((value) => String(value ?? "").trim()).filter(Boolean) : []
|
|
27984
|
+
},
|
|
27985
|
+
usageCheck: raw.usageCheck === "prefer-available" ? "prefer-available" : "off",
|
|
27986
|
+
usageThresholdPercent
|
|
27987
|
+
};
|
|
27988
|
+
}
|
|
27989
|
+
function buildCandidatesFromRawModels(params) {
|
|
27990
|
+
const defaultProvider = params.defaultProvider ?? DEFAULT_PROVIDER;
|
|
27991
|
+
const index = buildModelAliasIndex({
|
|
27992
|
+
cfg: params.cfg ?? {},
|
|
27993
|
+
defaultProvider
|
|
27994
|
+
});
|
|
27995
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27996
|
+
const out = [];
|
|
27997
|
+
for (const raw of params.rawModels) {
|
|
27998
|
+
const resolved = resolveModelRefFromString({
|
|
27999
|
+
raw,
|
|
28000
|
+
defaultProvider,
|
|
28001
|
+
aliasIndex: index
|
|
28002
|
+
});
|
|
28003
|
+
if (!resolved) continue;
|
|
28004
|
+
const key = modelKey(resolved.ref.provider, resolved.ref.model);
|
|
28005
|
+
if (seen.has(key)) continue;
|
|
28006
|
+
seen.add(key);
|
|
28007
|
+
out.push(resolved.ref);
|
|
28008
|
+
}
|
|
28009
|
+
return out;
|
|
28010
|
+
}
|
|
28011
|
+
async function loadUsageSummary(agentDir, providers) {
|
|
28012
|
+
const key = `${agentDir ?? "main"}::${providers.slice().toSorted().join(",")}`;
|
|
28013
|
+
const now = Date.now();
|
|
28014
|
+
const cached = usageSummaryCache.get(key);
|
|
28015
|
+
if (cached && cached.expiresAt > now) return cached.summary;
|
|
28016
|
+
const summary = await loadProviderUsageSummary({
|
|
28017
|
+
agentDir,
|
|
28018
|
+
providers,
|
|
28019
|
+
timeoutMs: USAGE_TIMEOUT_MS
|
|
28020
|
+
});
|
|
28021
|
+
usageSummaryCache.set(key, {
|
|
28022
|
+
expiresAt: now + USAGE_CACHE_TTL_MS,
|
|
28023
|
+
summary
|
|
28024
|
+
});
|
|
28025
|
+
return summary;
|
|
28026
|
+
}
|
|
28027
|
+
function remainingPercent(snapshot) {
|
|
28028
|
+
if (snapshot.error || snapshot.windows.length === 0) return;
|
|
28029
|
+
const values = snapshot.windows.map((window) => 100 - window.usedPercent).filter((value) => Number.isFinite(value));
|
|
28030
|
+
if (values.length === 0) return;
|
|
28031
|
+
return Math.max(0, Math.min(...values));
|
|
28032
|
+
}
|
|
28033
|
+
async function resolveAvailability(params) {
|
|
28034
|
+
const availability = /* @__PURE__ */ new Map();
|
|
28035
|
+
const usageProviders = Array.from(new Set(params.providerOrder.map((provider) => resolveUsageProviderId(provider)).filter((provider) => Boolean(provider))));
|
|
28036
|
+
let summary;
|
|
28037
|
+
if (usageProviders.length > 0) try {
|
|
28038
|
+
summary = await loadUsageSummary(params.agentDir, usageProviders);
|
|
28039
|
+
} catch {
|
|
28040
|
+
summary = void 0;
|
|
28041
|
+
}
|
|
28042
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
28043
|
+
for (const entry of summary?.providers ?? []) snapshots.set(entry.provider, entry);
|
|
28044
|
+
for (const provider of params.providerOrder) {
|
|
28045
|
+
const usageProvider = resolveUsageProviderId(provider);
|
|
28046
|
+
if (!usageProvider) {
|
|
28047
|
+
availability.set(provider, {
|
|
28048
|
+
provider,
|
|
28049
|
+
state: "unknown"
|
|
28050
|
+
});
|
|
28051
|
+
continue;
|
|
28052
|
+
}
|
|
28053
|
+
const snapshot = snapshots.get(usageProvider);
|
|
28054
|
+
const percent = snapshot ? remainingPercent(snapshot) : void 0;
|
|
28055
|
+
availability.set(provider, {
|
|
28056
|
+
provider,
|
|
28057
|
+
usageProvider,
|
|
28058
|
+
remainingPercent: percent,
|
|
28059
|
+
state: percent === void 0 ? "unknown" : percent <= params.autoConfig.usageThresholdPercent ? "exhausted" : "available"
|
|
28060
|
+
});
|
|
28061
|
+
}
|
|
28062
|
+
return availability;
|
|
28063
|
+
}
|
|
28064
|
+
function reorderByAvailability(params) {
|
|
28065
|
+
const lockedPrimary = params.preservePrimary ? params.candidates[0] : void 0;
|
|
28066
|
+
const rest = params.preservePrimary ? params.candidates.slice(1) : params.candidates;
|
|
28067
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
28068
|
+
for (const candidate of rest) {
|
|
28069
|
+
const normalized = normalizeProviderId(candidate.provider);
|
|
28070
|
+
const group = grouped.get(normalized) ?? [];
|
|
28071
|
+
group.push({
|
|
28072
|
+
provider: normalized,
|
|
28073
|
+
model: candidate.model
|
|
28074
|
+
});
|
|
28075
|
+
grouped.set(normalized, group);
|
|
28076
|
+
}
|
|
28077
|
+
const order = [];
|
|
28078
|
+
for (const [provider, availability] of params.availability) if (availability.state === "available") order.push(provider);
|
|
28079
|
+
for (const [provider, availability] of params.availability) if (availability.state === "unknown") order.push(provider);
|
|
28080
|
+
for (const [provider, availability] of params.availability) if (availability.state === "exhausted") order.push(provider);
|
|
28081
|
+
for (const provider of grouped.keys()) if (!order.includes(provider)) order.push(provider);
|
|
28082
|
+
const ordered = [];
|
|
28083
|
+
for (const provider of order) {
|
|
28084
|
+
const group = grouped.get(provider) ?? [];
|
|
28085
|
+
ordered.push(...group);
|
|
28086
|
+
}
|
|
28087
|
+
return lockedPrimary ? [lockedPrimary, ...ordered] : ordered;
|
|
28088
|
+
}
|
|
28089
|
+
async function applyAutoModelRouting(params) {
|
|
28090
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
28091
|
+
if (!autoConfig) return {
|
|
28092
|
+
candidates: [...params.candidates],
|
|
28093
|
+
autoConfigured: false,
|
|
28094
|
+
preserveProviderOrder: false,
|
|
28095
|
+
availabilityByProvider: /* @__PURE__ */ new Map()
|
|
28096
|
+
};
|
|
28097
|
+
const providerOrder = dedupeProviders([...autoConfig.providerOrder, ...params.candidates.map((candidate) => candidate.provider)]);
|
|
28098
|
+
let candidates = [...params.candidates];
|
|
28099
|
+
const modePreferred = params.workingMode ? buildCandidatesFromRawModels({
|
|
28100
|
+
rawModels: autoConfig.byWorkingMode[params.workingMode] ?? [],
|
|
28101
|
+
cfg: params.cfg,
|
|
28102
|
+
defaultProvider: params.candidates[0]?.provider ?? DEFAULT_PROVIDER
|
|
28103
|
+
}) : [];
|
|
28104
|
+
if (modePreferred.length > 0) {
|
|
28105
|
+
const lockedPrimary = params.preservePrimary && candidates.length > 0 ? [candidates[0]] : [];
|
|
28106
|
+
const remainingCandidates = params.preservePrimary ? candidates.slice(1) : candidates;
|
|
28107
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28108
|
+
candidates = [
|
|
28109
|
+
...lockedPrimary,
|
|
28110
|
+
...modePreferred,
|
|
28111
|
+
...remainingCandidates
|
|
28112
|
+
].filter((candidate) => {
|
|
28113
|
+
const key = modelKey(candidate.provider, candidate.model);
|
|
28114
|
+
if (seen.has(key)) return false;
|
|
28115
|
+
seen.add(key);
|
|
28116
|
+
return true;
|
|
28117
|
+
});
|
|
28118
|
+
}
|
|
28119
|
+
const availability = await resolveAvailability({
|
|
28120
|
+
providerOrder,
|
|
28121
|
+
agentDir: params.agentDir,
|
|
28122
|
+
autoConfig
|
|
28123
|
+
});
|
|
28124
|
+
if (autoConfig.usageCheck === "prefer-available") candidates = reorderByAvailability({
|
|
28125
|
+
candidates,
|
|
28126
|
+
availability,
|
|
28127
|
+
preservePrimary: params.preservePrimary
|
|
28128
|
+
});
|
|
28129
|
+
return {
|
|
28130
|
+
candidates,
|
|
28131
|
+
autoConfigured: true,
|
|
28132
|
+
preserveProviderOrder: true,
|
|
28133
|
+
config: autoConfig,
|
|
28134
|
+
availabilityByProvider: availability
|
|
28135
|
+
};
|
|
28136
|
+
}
|
|
28137
|
+
|
|
28138
|
+
//#endregion
|
|
28139
|
+
//#region src/agents/model-preference.ts
|
|
28140
|
+
const HIGH_THINK_LEVELS = new Set(["high", "xhigh"]);
|
|
28141
|
+
const SESSION_COST_THRESHOLD_USD = .5;
|
|
28142
|
+
const SESSION_TOKEN_THRESHOLD = 3e5;
|
|
28143
|
+
const SESSION_TURN_THRESHOLD = 12;
|
|
28144
|
+
const SESSION_COMPACTION_THRESHOLD = 2;
|
|
28145
|
+
function toPositiveFiniteNumber(value) {
|
|
28146
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
28147
|
+
return value;
|
|
28148
|
+
}
|
|
28149
|
+
function shouldPreferCheap(entry) {
|
|
28150
|
+
if (!entry) return false;
|
|
28151
|
+
const sessionCostUsd = toPositiveFiniteNumber(entry.sessionEstimatedCostUsdTotal) ?? 0;
|
|
28152
|
+
const sessionInputTokens = toPositiveFiniteNumber(entry.sessionInputTokensTotal) ?? 0;
|
|
28153
|
+
const sessionOutputTokens = toPositiveFiniteNumber(entry.sessionOutputTokensTotal) ?? 0;
|
|
28154
|
+
const sessionTurnCount = toPositiveFiniteNumber(entry.sessionTurnCount) ?? 0;
|
|
28155
|
+
const compactionCount = toPositiveFiniteNumber(entry.compactionCount) ?? 0;
|
|
28156
|
+
return sessionCostUsd >= SESSION_COST_THRESHOLD_USD || sessionInputTokens + sessionOutputTokens >= SESSION_TOKEN_THRESHOLD || sessionTurnCount >= SESSION_TURN_THRESHOLD || compactionCount >= SESSION_COMPACTION_THRESHOLD;
|
|
28157
|
+
}
|
|
28158
|
+
function resolveCandidateCostScore(candidate, cfg) {
|
|
28159
|
+
const cost = resolveModelCostConfig({
|
|
28160
|
+
provider: candidate.provider,
|
|
28161
|
+
model: candidate.model,
|
|
28162
|
+
config: cfg
|
|
28163
|
+
});
|
|
28164
|
+
if (!cost) return;
|
|
28165
|
+
const values = [
|
|
28166
|
+
cost.input,
|
|
28167
|
+
cost.output,
|
|
28168
|
+
cost.cacheRead,
|
|
28169
|
+
cost.cacheWrite
|
|
28170
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
28171
|
+
if (values.length === 0) return;
|
|
28172
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
28173
|
+
}
|
|
28174
|
+
function resolveUsageAwareModelPreference(params) {
|
|
28175
|
+
if (params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride) return "preserve";
|
|
28176
|
+
if (params.thinkLevel && HIGH_THINK_LEVELS.has(params.thinkLevel)) return "prefer-strong";
|
|
28177
|
+
if (shouldPreferCheap(params.sessionEntry)) return "prefer-cheap";
|
|
28178
|
+
return "preserve";
|
|
28179
|
+
}
|
|
28180
|
+
function orderCandidatesByPreference(params) {
|
|
28181
|
+
const preferenceMode = params.preferenceMode ?? "preserve";
|
|
28182
|
+
if (preferenceMode === "preserve" || params.candidates.length <= 1) return [...params.candidates];
|
|
28183
|
+
const scoredCandidates = params.candidates.map((candidate) => ({
|
|
28184
|
+
candidate,
|
|
28185
|
+
score: resolveCandidateCostScore(candidate, params.cfg)
|
|
28186
|
+
}));
|
|
28187
|
+
const sortable = scoredCandidates.filter((entry) => entry.score !== void 0);
|
|
28188
|
+
if (sortable.length < 2) return [...params.candidates];
|
|
28189
|
+
sortable.sort((left, right) => preferenceMode === "prefer-cheap" ? left.score - right.score : right.score - left.score);
|
|
28190
|
+
const reordered = sortable.map((entry) => entry.candidate);
|
|
28191
|
+
let reorderedIndex = 0;
|
|
28192
|
+
return scoredCandidates.map((entry) => {
|
|
28193
|
+
if (entry.score === void 0) return entry.candidate;
|
|
28194
|
+
const next = reordered[reorderedIndex];
|
|
28195
|
+
reorderedIndex += 1;
|
|
28196
|
+
return next;
|
|
28197
|
+
});
|
|
28198
|
+
}
|
|
28199
|
+
|
|
27914
28200
|
//#endregion
|
|
27915
28201
|
//#region src/agents/model-fallback.ts
|
|
27916
28202
|
/**
|
|
@@ -28012,12 +28298,32 @@ function resolveFallbackCandidates(params) {
|
|
|
28012
28298
|
}, false);
|
|
28013
28299
|
return candidates;
|
|
28014
28300
|
}
|
|
28301
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
28302
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
28303
|
+
if (!execSecurity) return;
|
|
28304
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
28305
|
+
}
|
|
28015
28306
|
async function runWithModelFallback(params) {
|
|
28016
|
-
const
|
|
28307
|
+
const preservePrimary = Boolean(params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride);
|
|
28308
|
+
const resolvedWorkingMode = params.workingMode ?? resolveWorkingModeFromSessionEntry(params.sessionEntry);
|
|
28309
|
+
const candidates = orderCandidatesByPreference({
|
|
28310
|
+
candidates: (await applyAutoModelRouting({
|
|
28311
|
+
candidates: resolveFallbackCandidates({
|
|
28312
|
+
cfg: params.cfg,
|
|
28313
|
+
provider: params.provider,
|
|
28314
|
+
model: params.model,
|
|
28315
|
+
fallbacksOverride: params.fallbacksOverride
|
|
28316
|
+
}),
|
|
28317
|
+
cfg: params.cfg,
|
|
28318
|
+
agentDir: params.agentDir,
|
|
28319
|
+
preservePrimary,
|
|
28320
|
+
workingMode: resolvedWorkingMode
|
|
28321
|
+
})).candidates,
|
|
28017
28322
|
cfg: params.cfg,
|
|
28018
|
-
|
|
28019
|
-
|
|
28020
|
-
|
|
28323
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
28324
|
+
thinkLevel: params.thinkLevel,
|
|
28325
|
+
sessionEntry: params.sessionEntry
|
|
28326
|
+
})
|
|
28021
28327
|
});
|
|
28022
28328
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
28023
28329
|
const attempts = [];
|
|
@@ -29118,6 +29424,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
29118
29424
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
29119
29425
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
29120
29426
|
}
|
|
29427
|
+
function resolveConfiguredNoxsoftTarget(params) {
|
|
29428
|
+
const trimmed = params.input.trim();
|
|
29429
|
+
if (!trimmed) return null;
|
|
29430
|
+
const configured = params.cfg.channels?.noxsoft?.channels;
|
|
29431
|
+
if (!configured) return null;
|
|
29432
|
+
const lower = trimmed.toLowerCase();
|
|
29433
|
+
for (const [name, entry] of Object.entries(configured)) {
|
|
29434
|
+
const channelId = entry?.id?.trim();
|
|
29435
|
+
if (!channelId) continue;
|
|
29436
|
+
if (lower === name.trim().toLowerCase() || trimmed === channelId) return {
|
|
29437
|
+
to: channelId,
|
|
29438
|
+
kind: "channel",
|
|
29439
|
+
display: name,
|
|
29440
|
+
source: "normalized"
|
|
29441
|
+
};
|
|
29442
|
+
}
|
|
29443
|
+
return null;
|
|
29444
|
+
}
|
|
29121
29445
|
async function resolveMessagingTarget(params) {
|
|
29122
29446
|
const raw = normalizeChannelTargetInput(params.input);
|
|
29123
29447
|
if (!raw) return {
|
|
@@ -29129,6 +29453,16 @@ async function resolveMessagingTarget(params) {
|
|
|
29129
29453
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
29130
29454
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
29131
29455
|
const normalized = normalizeTargetForProvider(params.channel, raw) ?? raw;
|
|
29456
|
+
if (params.channel === "noxsoft") {
|
|
29457
|
+
const configuredTarget = resolveConfiguredNoxsoftTarget({
|
|
29458
|
+
cfg: params.cfg,
|
|
29459
|
+
input: raw
|
|
29460
|
+
});
|
|
29461
|
+
if (configuredTarget) return {
|
|
29462
|
+
ok: true,
|
|
29463
|
+
target: configuredTarget
|
|
29464
|
+
};
|
|
29465
|
+
}
|
|
29132
29466
|
const looksLikeTargetId = () => {
|
|
29133
29467
|
const trimmed = raw.trim();
|
|
29134
29468
|
if (!trimmed) return false;
|
|
@@ -29343,6 +29677,10 @@ function applyCrossContextDecoration(params) {
|
|
|
29343
29677
|
};
|
|
29344
29678
|
}
|
|
29345
29679
|
|
|
29680
|
+
//#endregion
|
|
29681
|
+
//#region src/auth/noxsoft-auth.ts
|
|
29682
|
+
const TOKEN_PATH = path.join(os.homedir(), ".noxsoft-agent-token");
|
|
29683
|
+
|
|
29346
29684
|
//#endregion
|
|
29347
29685
|
//#region src/infra/outbound/targets.ts
|
|
29348
29686
|
function resolveSessionDeliveryTarget(params) {
|
|
@@ -29424,13 +29762,62 @@ function resolveGatewayOptions(opts) {
|
|
|
29424
29762
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
29425
29763
|
};
|
|
29426
29764
|
}
|
|
29765
|
+
function resolveNoxsoftApiBase(cfg) {
|
|
29766
|
+
return cfg.channels?.noxsoft?.apiUrl?.trim() || "https://auth.noxsoft.net";
|
|
29767
|
+
}
|
|
29768
|
+
function resolveNoxsoftToken(cfg) {
|
|
29769
|
+
const inlineToken = cfg.channels?.noxsoft?.token?.trim();
|
|
29770
|
+
if (inlineToken) return inlineToken;
|
|
29771
|
+
const tokenFile = cfg.channels?.noxsoft?.tokenFile?.trim() || TOKEN_PATH;
|
|
29772
|
+
try {
|
|
29773
|
+
const token = fs.readFileSync(tokenFile, "utf-8").trim();
|
|
29774
|
+
if (token) return token;
|
|
29775
|
+
} catch {}
|
|
29776
|
+
throw new Error(`NoxSoft token not configured. Expected token in ${tokenFile}`);
|
|
29777
|
+
}
|
|
29778
|
+
async function sendNoxsoftMessageDirect(params) {
|
|
29779
|
+
if (params.dryRun) return {
|
|
29780
|
+
channel: "noxsoft",
|
|
29781
|
+
to: params.to,
|
|
29782
|
+
via: "direct",
|
|
29783
|
+
mediaUrl: params.mediaUrl,
|
|
29784
|
+
mediaUrls: params.mediaUrls,
|
|
29785
|
+
dryRun: true
|
|
29786
|
+
};
|
|
29787
|
+
const token = resolveNoxsoftToken(params.cfg);
|
|
29788
|
+
const apiBase = resolveNoxsoftApiBase(params.cfg).replace(/\/+$/, "");
|
|
29789
|
+
const response = await fetch(`${apiBase}/api/agents/chat/channels/${params.to}/messages`, {
|
|
29790
|
+
method: "POST",
|
|
29791
|
+
headers: {
|
|
29792
|
+
Authorization: `Bearer ${token}`,
|
|
29793
|
+
"Content-Type": "application/json"
|
|
29794
|
+
},
|
|
29795
|
+
body: JSON.stringify({
|
|
29796
|
+
content: params.content,
|
|
29797
|
+
mediaUrl: params.mediaUrl ?? void 0,
|
|
29798
|
+
mediaUrls: params.mediaUrls?.length ? params.mediaUrls : void 0
|
|
29799
|
+
}),
|
|
29800
|
+
signal: params.abortSignal
|
|
29801
|
+
});
|
|
29802
|
+
if (!response.ok) {
|
|
29803
|
+
const text = await response.text().catch(() => "");
|
|
29804
|
+
throw new Error(`NoxSoft send failed (${response.status}): ${text}`);
|
|
29805
|
+
}
|
|
29806
|
+
const payload = await response.json().catch(() => ({}));
|
|
29807
|
+
const messageId = payload.messageId ?? payload.id ?? `noxsoft:${Date.now()}`;
|
|
29808
|
+
return {
|
|
29809
|
+
channel: "noxsoft",
|
|
29810
|
+
to: params.to,
|
|
29811
|
+
via: "direct",
|
|
29812
|
+
mediaUrl: params.mediaUrl,
|
|
29813
|
+
mediaUrls: params.mediaUrls,
|
|
29814
|
+
result: { messageId }
|
|
29815
|
+
};
|
|
29816
|
+
}
|
|
29427
29817
|
async function sendMessage(params) {
|
|
29428
29818
|
const cfg = params.cfg ?? loadConfig();
|
|
29429
|
-
const channel = params.channel?.trim() ?
|
|
29819
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29430
29820
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29431
|
-
const plugin = getChannelPlugin(channel);
|
|
29432
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29433
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29434
29821
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
29435
29822
|
text: params.content,
|
|
29436
29823
|
mediaUrl: params.mediaUrl,
|
|
@@ -29439,6 +29826,18 @@ async function sendMessage(params) {
|
|
|
29439
29826
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
29440
29827
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
29441
29828
|
const primaryMediaUrl = mirrorMediaUrls[0] ?? params.mediaUrl ?? null;
|
|
29829
|
+
if (channel === "noxsoft") return sendNoxsoftMessageDirect({
|
|
29830
|
+
cfg,
|
|
29831
|
+
to: params.to,
|
|
29832
|
+
content: params.content,
|
|
29833
|
+
mediaUrl: primaryMediaUrl,
|
|
29834
|
+
mediaUrls: mirrorMediaUrls.length ? mirrorMediaUrls : void 0,
|
|
29835
|
+
dryRun: params.dryRun,
|
|
29836
|
+
abortSignal: params.abortSignal
|
|
29837
|
+
});
|
|
29838
|
+
const plugin = getChannelPlugin(channel);
|
|
29839
|
+
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29840
|
+
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29442
29841
|
if (params.dryRun) return {
|
|
29443
29842
|
channel,
|
|
29444
29843
|
to: params.to,
|
|
@@ -29517,7 +29916,7 @@ async function sendMessage(params) {
|
|
|
29517
29916
|
}
|
|
29518
29917
|
async function sendPoll(params) {
|
|
29519
29918
|
const cfg = params.cfg ?? loadConfig();
|
|
29520
|
-
const channel = params.channel?.trim() ?
|
|
29919
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29521
29920
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29522
29921
|
const pollInput = {
|
|
29523
29922
|
question: params.question,
|
|
@@ -36135,6 +36534,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36135
36534
|
provider: params.followupRun.run.provider,
|
|
36136
36535
|
model: params.followupRun.run.model,
|
|
36137
36536
|
agentDir: params.followupRun.run.agentDir,
|
|
36537
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
36538
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36138
36539
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36139
36540
|
run: (provider, model) => {
|
|
36140
36541
|
params.opts?.onModelSelected?.({
|
|
@@ -36142,97 +36543,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36142
36543
|
model,
|
|
36143
36544
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
36144
36545
|
});
|
|
36145
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
36146
|
-
const startedAt = Date.now();
|
|
36147
|
-
emitAgentEvent$1({
|
|
36148
|
-
runId,
|
|
36149
|
-
stream: "lifecycle",
|
|
36150
|
-
data: {
|
|
36151
|
-
phase: "start",
|
|
36152
|
-
startedAt
|
|
36153
|
-
}
|
|
36154
|
-
});
|
|
36155
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
36156
|
-
return (async () => {
|
|
36157
|
-
let lifecycleTerminalEmitted = false;
|
|
36158
|
-
let sawCliStream = false;
|
|
36159
|
-
let lastCliStreamText = "";
|
|
36160
|
-
try {
|
|
36161
|
-
const result = await runCliAgent({
|
|
36162
|
-
sessionId: params.followupRun.run.sessionId,
|
|
36163
|
-
sessionKey: params.sessionKey,
|
|
36164
|
-
agentId: params.followupRun.run.agentId,
|
|
36165
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
36166
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
36167
|
-
config: params.followupRun.run.config,
|
|
36168
|
-
prompt: params.commandBody,
|
|
36169
|
-
provider,
|
|
36170
|
-
model,
|
|
36171
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36172
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36173
|
-
runId,
|
|
36174
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
36175
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
36176
|
-
cliSessionId,
|
|
36177
|
-
images: params.opts?.images,
|
|
36178
|
-
onTextStream: (text) => {
|
|
36179
|
-
const nextText = text.trim();
|
|
36180
|
-
if (!nextText) return;
|
|
36181
|
-
sawCliStream = true;
|
|
36182
|
-
lastCliStreamText = nextText;
|
|
36183
|
-
emitAgentEvent$1({
|
|
36184
|
-
runId,
|
|
36185
|
-
stream: "assistant",
|
|
36186
|
-
data: { text: nextText }
|
|
36187
|
-
});
|
|
36188
|
-
}
|
|
36189
|
-
});
|
|
36190
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
36191
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
36192
|
-
runId,
|
|
36193
|
-
stream: "assistant",
|
|
36194
|
-
data: { text: cliText }
|
|
36195
|
-
});
|
|
36196
|
-
emitAgentEvent$1({
|
|
36197
|
-
runId,
|
|
36198
|
-
stream: "lifecycle",
|
|
36199
|
-
data: {
|
|
36200
|
-
phase: "end",
|
|
36201
|
-
startedAt,
|
|
36202
|
-
endedAt: Date.now()
|
|
36203
|
-
}
|
|
36204
|
-
});
|
|
36205
|
-
lifecycleTerminalEmitted = true;
|
|
36206
|
-
return result;
|
|
36207
|
-
} catch (err) {
|
|
36208
|
-
emitAgentEvent$1({
|
|
36209
|
-
runId,
|
|
36210
|
-
stream: "lifecycle",
|
|
36211
|
-
data: {
|
|
36212
|
-
phase: "error",
|
|
36213
|
-
startedAt,
|
|
36214
|
-
endedAt: Date.now(),
|
|
36215
|
-
error: String(err)
|
|
36216
|
-
}
|
|
36217
|
-
});
|
|
36218
|
-
lifecycleTerminalEmitted = true;
|
|
36219
|
-
throw err;
|
|
36220
|
-
} finally {
|
|
36221
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
36222
|
-
runId,
|
|
36223
|
-
stream: "lifecycle",
|
|
36224
|
-
data: {
|
|
36225
|
-
phase: "error",
|
|
36226
|
-
startedAt,
|
|
36227
|
-
endedAt: Date.now(),
|
|
36228
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
36229
|
-
}
|
|
36230
|
-
});
|
|
36231
|
-
}
|
|
36232
|
-
})();
|
|
36233
|
-
}
|
|
36234
36546
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36235
|
-
return
|
|
36547
|
+
return runNoxSoftEmbeddedAgent({
|
|
36236
36548
|
sessionId: params.followupRun.run.sessionId,
|
|
36237
36549
|
sessionKey: params.sessionKey,
|
|
36238
36550
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36269,6 +36581,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36269
36581
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36270
36582
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36271
36583
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36584
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
36585
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
36272
36586
|
toolResultFormat: (() => {
|
|
36273
36587
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
36274
36588
|
if (!channel) return "markdown";
|
|
@@ -36300,6 +36614,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36300
36614
|
});
|
|
36301
36615
|
} : void 0,
|
|
36302
36616
|
onAgentEvent: async (evt) => {
|
|
36617
|
+
emitAgentEvent$1({
|
|
36618
|
+
runId,
|
|
36619
|
+
stream: evt.stream,
|
|
36620
|
+
data: evt.data
|
|
36621
|
+
});
|
|
36303
36622
|
if (evt.stream === "tool") {
|
|
36304
36623
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
36305
36624
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -36569,10 +36888,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36569
36888
|
provider: params.followupRun.run.provider,
|
|
36570
36889
|
model: params.followupRun.run.model,
|
|
36571
36890
|
agentDir: params.followupRun.run.agentDir,
|
|
36891
|
+
sessionEntry: params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0) ?? void 0,
|
|
36892
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36572
36893
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36573
36894
|
run: (provider, model) => {
|
|
36574
36895
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36575
|
-
return
|
|
36896
|
+
return runNoxSoftEmbeddedAgent({
|
|
36576
36897
|
sessionId: params.followupRun.run.sessionId,
|
|
36577
36898
|
sessionKey: params.sessionKey,
|
|
36578
36899
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36606,6 +36927,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36606
36927
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36607
36928
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36608
36929
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36930
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
36609
36931
|
bashElevated: params.followupRun.run.bashElevated,
|
|
36610
36932
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36611
36933
|
runId: flushRunId,
|
|
@@ -36941,10 +37263,12 @@ function createFollowupRunner(params) {
|
|
|
36941
37263
|
provider: queued.run.provider,
|
|
36942
37264
|
model: queued.run.model,
|
|
36943
37265
|
agentDir: queued.run.agentDir,
|
|
37266
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
37267
|
+
thinkLevel: queued.run.thinkLevel,
|
|
36944
37268
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
36945
37269
|
run: (provider, model) => {
|
|
36946
37270
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
36947
|
-
return
|
|
37271
|
+
return runNoxSoftEmbeddedAgent({
|
|
36948
37272
|
sessionId: queued.run.sessionId,
|
|
36949
37273
|
sessionKey: queued.run.sessionKey,
|
|
36950
37274
|
agentId: queued.run.agentId,
|
|
@@ -36975,6 +37299,7 @@ function createFollowupRunner(params) {
|
|
|
36975
37299
|
verboseLevel: queued.run.verboseLevel,
|
|
36976
37300
|
reasoningLevel: queued.run.reasoningLevel,
|
|
36977
37301
|
execOverrides: queued.run.execOverrides,
|
|
37302
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
36978
37303
|
bashElevated: queued.run.bashElevated,
|
|
36979
37304
|
timeoutMs: queued.run.timeoutMs,
|
|
36980
37305
|
runId,
|
|
@@ -37955,7 +38280,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
37955
38280
|
return;
|
|
37956
38281
|
}
|
|
37957
38282
|
try {
|
|
37958
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
38283
|
+
const { deliverOutboundPayloads } = await import("./deliver-B-dPbUIs.js").then((n) => n.n);
|
|
37959
38284
|
await deliverOutboundPayloads({
|
|
37960
38285
|
cfg: params.cfg,
|
|
37961
38286
|
channel,
|
|
@@ -39384,7 +39709,7 @@ function createWhatsAppLoginTool() {
|
|
|
39384
39709
|
force: Type.Optional(Type.Boolean())
|
|
39385
39710
|
}),
|
|
39386
39711
|
execute: async (_toolCallId, args) => {
|
|
39387
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
39712
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-BGbHImRb.js");
|
|
39388
39713
|
if ((args?.action ?? "start") === "wait") {
|
|
39389
39714
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
39390
39715
|
return {
|
|
@@ -40314,23 +40639,23 @@ let webLoginQrPromise = null;
|
|
|
40314
40639
|
let webChannelPromise = null;
|
|
40315
40640
|
let whatsappActionsPromise = null;
|
|
40316
40641
|
function loadWebOutbound() {
|
|
40317
|
-
webOutboundPromise ??= import("./outbound-
|
|
40642
|
+
webOutboundPromise ??= import("./outbound-DW2eod1S.js").then((n) => n.t);
|
|
40318
40643
|
return webOutboundPromise;
|
|
40319
40644
|
}
|
|
40320
40645
|
function loadWebLogin() {
|
|
40321
|
-
webLoginPromise ??= import("./login-
|
|
40646
|
+
webLoginPromise ??= import("./login-BTOKtSQN.js").then((n) => n.n);
|
|
40322
40647
|
return webLoginPromise;
|
|
40323
40648
|
}
|
|
40324
40649
|
function loadWebLoginQr() {
|
|
40325
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
40650
|
+
webLoginQrPromise ??= import("./login-qr-BGbHImRb.js");
|
|
40326
40651
|
return webLoginQrPromise;
|
|
40327
40652
|
}
|
|
40328
40653
|
function loadWebChannel() {
|
|
40329
|
-
webChannelPromise ??= import("./web-
|
|
40654
|
+
webChannelPromise ??= import("./web-BHGK5GtV.js");
|
|
40330
40655
|
return webChannelPromise;
|
|
40331
40656
|
}
|
|
40332
40657
|
function loadWhatsAppActions() {
|
|
40333
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
40658
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-6fPRKwPV.js");
|
|
40334
40659
|
return whatsappActionsPromise;
|
|
40335
40660
|
}
|
|
40336
40661
|
function createPluginRuntime() {
|
|
@@ -42598,15 +42923,6 @@ function createAnimaCodingTools(options) {
|
|
|
42598
42923
|
|
|
42599
42924
|
//#endregion
|
|
42600
42925
|
//#region src/agents/gemini-direct-runner.ts
|
|
42601
|
-
/**
|
|
42602
|
-
* Gemini Direct API Runner
|
|
42603
|
-
*
|
|
42604
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
42605
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
42606
|
-
*
|
|
42607
|
-
* This runner is automatically used when a google API key is available
|
|
42608
|
-
* and the provider is set to "google" or "gemini".
|
|
42609
|
-
*/
|
|
42610
42926
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
42611
42927
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
42612
42928
|
const MODEL_MAP = {
|
|
@@ -42698,7 +43014,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42698
43014
|
cwd: process.cwd(),
|
|
42699
43015
|
moduleUrl: import.meta.url
|
|
42700
43016
|
});
|
|
42701
|
-
const extraSystemPrompt =
|
|
43017
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
42702
43018
|
const systemPrompt = buildSystemPrompt({
|
|
42703
43019
|
workspaceDir,
|
|
42704
43020
|
config: params.config,
|
|
@@ -42777,7 +43093,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
42777
43093
|
};
|
|
42778
43094
|
}
|
|
42779
43095
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
42780
|
-
await params.onAssistantMessageStart?.();
|
|
42781
43096
|
const bodyStream = Readable.fromWeb(response.body);
|
|
42782
43097
|
let buffer = "";
|
|
42783
43098
|
let chunkAssistantText = "";
|
|
@@ -42803,12 +43118,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
42803
43118
|
nonTextParts.push(p);
|
|
42804
43119
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
42805
43120
|
}
|
|
42806
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
42807
43121
|
if (parsed.usageMetadata) {
|
|
42808
43122
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
42809
43123
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
42810
43124
|
}
|
|
42811
|
-
} catch
|
|
43125
|
+
} catch {}
|
|
42812
43126
|
}
|
|
42813
43127
|
}
|
|
42814
43128
|
if (functionCalls.length > 0) {
|
|
@@ -42868,7 +43182,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42868
43182
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
42869
43183
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
42870
43184
|
return {
|
|
42871
|
-
status: "failed",
|
|
43185
|
+
status: isAbort ? "timeout" : "failed",
|
|
42872
43186
|
meta: {
|
|
42873
43187
|
durationMs: Date.now() - started,
|
|
42874
43188
|
error: {
|
|
@@ -42905,7 +43219,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42905
43219
|
}
|
|
42906
43220
|
|
|
42907
43221
|
//#endregion
|
|
42908
|
-
//#region src/agents/
|
|
43222
|
+
//#region src/agents/noxsoft-runner.ts
|
|
42909
43223
|
function normalizeEmbeddedProvider(provider) {
|
|
42910
43224
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
42911
43225
|
}
|
|
@@ -42926,178 +43240,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
42926
43240
|
data
|
|
42927
43241
|
});
|
|
42928
43242
|
}
|
|
42929
|
-
|
|
42930
|
-
|
|
42931
|
-
if (
|
|
43243
|
+
function resolveDirectAuthProvider(provider) {
|
|
43244
|
+
if (provider === "anthropic" || provider === "claude") return "anthropic";
|
|
43245
|
+
if (provider === "google" || provider === "gemini") return "google";
|
|
43246
|
+
return null;
|
|
43247
|
+
}
|
|
43248
|
+
function resolveProfileFailureReason(result) {
|
|
43249
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43250
|
+
if (kind === "auth") return "auth";
|
|
43251
|
+
if (kind === "rate_limit") return "rate_limit";
|
|
43252
|
+
const classified = classifyFailoverReason(result.meta.error?.message ?? "");
|
|
43253
|
+
if (classified === "billing") return "billing";
|
|
43254
|
+
if (classified === "auth") return "auth";
|
|
43255
|
+
if (classified === "rate_limit") return "rate_limit";
|
|
43256
|
+
}
|
|
43257
|
+
function resolveResultErrorKind(result) {
|
|
43258
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43259
|
+
if (kind) return kind;
|
|
43260
|
+
return result.status === "timeout" ? "timeout" : "unknown";
|
|
43261
|
+
}
|
|
43262
|
+
function normalizeResultStatus(result) {
|
|
43263
|
+
const kind = resolveResultErrorKind(result);
|
|
43264
|
+
if (result.status === "timeout" || kind === "timeout") return "timeout";
|
|
43265
|
+
return result.status;
|
|
43266
|
+
}
|
|
43267
|
+
function normalizeResultPayloads(result) {
|
|
43268
|
+
const payloads = result.payloads?.filter((payload) => payload && typeof payload === "object");
|
|
43269
|
+
if (payloads && payloads.length > 0) return payloads;
|
|
43270
|
+
const output = result.output?.trim();
|
|
43271
|
+
return output ? [{ text: output }] : void 0;
|
|
43272
|
+
}
|
|
43273
|
+
function normalizeResultOutput(result, payloads) {
|
|
43274
|
+
const directOutput = result.output?.trim();
|
|
43275
|
+
if (directOutput) return directOutput;
|
|
43276
|
+
return payloads?.find((payload) => payload.text?.trim())?.text?.trim() || void 0;
|
|
43277
|
+
}
|
|
43278
|
+
function normalizeRunnerResult(params) {
|
|
43279
|
+
const payloads = normalizeResultPayloads(params.result);
|
|
43280
|
+
const output = normalizeResultOutput(params.result, payloads);
|
|
43281
|
+
const usage = normalizeUsage(params.result.meta.agentMeta?.usage);
|
|
43282
|
+
const lastCallUsage = normalizeUsage(params.result.meta.agentMeta?.lastCallUsage);
|
|
43283
|
+
const promptTokens = params.result.meta.agentMeta?.promptTokens ?? derivePromptTokens(usage ?? lastCallUsage);
|
|
43284
|
+
const status = normalizeResultStatus(params.result);
|
|
43285
|
+
const errorMessage = params.result.meta.error?.message?.trim();
|
|
43286
|
+
const errorKind = resolveResultErrorKind(params.result);
|
|
43287
|
+
return {
|
|
43288
|
+
...params.result,
|
|
43289
|
+
status,
|
|
43290
|
+
output,
|
|
43291
|
+
payloads,
|
|
43292
|
+
meta: {
|
|
43293
|
+
...params.result.meta,
|
|
43294
|
+
error: status === "completed" && !errorMessage ? void 0 : {
|
|
43295
|
+
message: errorMessage || (status === "timeout" ? "Request timed out." : "Runner execution failed."),
|
|
43296
|
+
kind: errorKind
|
|
43297
|
+
},
|
|
43298
|
+
agentMeta: {
|
|
43299
|
+
...params.result.meta.agentMeta,
|
|
43300
|
+
sessionId: params.result.meta.agentMeta?.sessionId?.trim() || params.sessionId,
|
|
43301
|
+
provider: params.provider,
|
|
43302
|
+
model: params.model ?? params.result.meta.agentMeta?.model,
|
|
43303
|
+
usage,
|
|
43304
|
+
promptTokens,
|
|
43305
|
+
lastCallUsage
|
|
43306
|
+
}
|
|
43307
|
+
}
|
|
43308
|
+
};
|
|
43309
|
+
}
|
|
43310
|
+
function coerceResultFailure(params) {
|
|
43311
|
+
if (params.result.status === "completed") return null;
|
|
43312
|
+
const message = params.result.meta.error?.message?.trim() || (params.result.status === "timeout" ? "Request timed out." : "Runner execution failed.");
|
|
43313
|
+
const reason = classifyFailoverReason(message) ?? resolveResultErrorKind(params.result);
|
|
43314
|
+
return new FailoverError(message, {
|
|
43315
|
+
reason: reason === "timeout" ? "timeout" : reason,
|
|
43316
|
+
provider: params.provider,
|
|
43317
|
+
model: params.model,
|
|
43318
|
+
status: resolveFailoverStatus(reason)
|
|
43319
|
+
});
|
|
43320
|
+
}
|
|
43321
|
+
async function resolveDirectProviderAuth(params) {
|
|
43322
|
+
return resolveApiKeyForProvider({
|
|
43323
|
+
provider: params.provider,
|
|
43324
|
+
cfg: params.config,
|
|
43325
|
+
preferredProfile: params.preferredProfile,
|
|
43326
|
+
agentDir: params.agentDir,
|
|
43327
|
+
store: params.store
|
|
43328
|
+
});
|
|
43329
|
+
}
|
|
43330
|
+
async function runDirectWithProfileFallback(params) {
|
|
43331
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
43332
|
+
const attemptedAuthSources = /* @__PURE__ */ new Set();
|
|
43333
|
+
let preferredProfile = params.authProfileId;
|
|
43334
|
+
let lastResult = null;
|
|
43335
|
+
for (;;) {
|
|
43336
|
+
const auth = await resolveDirectProviderAuth({
|
|
43337
|
+
provider: params.directProvider,
|
|
43338
|
+
config: params.config,
|
|
43339
|
+
agentDir: params.agentDir,
|
|
43340
|
+
preferredProfile,
|
|
43341
|
+
store
|
|
43342
|
+
});
|
|
43343
|
+
const authSourceKey = auth.profileId ?? `${auth.mode}:${auth.source}`;
|
|
43344
|
+
if (attemptedAuthSources.has(authSourceKey)) return lastResult ?? {
|
|
43345
|
+
status: "failed",
|
|
43346
|
+
meta: {
|
|
43347
|
+
durationMs: 0,
|
|
43348
|
+
error: {
|
|
43349
|
+
message: `Auth fallback loop detected for ${params.directProvider}.`,
|
|
43350
|
+
kind: "unknown"
|
|
43351
|
+
}
|
|
43352
|
+
}
|
|
43353
|
+
};
|
|
43354
|
+
attemptedAuthSources.add(authSourceKey);
|
|
43355
|
+
const result = params.directProvider === "anthropic" ? await runAnthropicDirectAgent({
|
|
43356
|
+
token: auth.apiKey ?? "",
|
|
43357
|
+
sessionId: params.sessionId,
|
|
43358
|
+
sessionKey: params.sessionKey,
|
|
43359
|
+
agentId: params.agentId,
|
|
43360
|
+
sessionFile: params.sessionFile,
|
|
43361
|
+
workspaceDir: params.workspaceDir,
|
|
43362
|
+
config: params.config,
|
|
43363
|
+
prompt: params.prompt,
|
|
43364
|
+
model: params.model,
|
|
43365
|
+
thinkLevel: params.thinkLevel,
|
|
43366
|
+
timeoutMs: params.timeoutMs,
|
|
43367
|
+
runId: params.runId,
|
|
43368
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43369
|
+
ownerNumbers: params.ownerNumbers,
|
|
43370
|
+
onPartialReply: params.emitPartial,
|
|
43371
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43372
|
+
}) : await runGeminiDirectAgent({
|
|
43373
|
+
apiKey: auth.apiKey ?? "",
|
|
43374
|
+
sessionId: params.sessionId,
|
|
43375
|
+
sessionKey: params.sessionKey,
|
|
43376
|
+
agentId: params.agentId,
|
|
43377
|
+
sessionFile: params.sessionFile,
|
|
43378
|
+
workspaceDir: params.workspaceDir,
|
|
43379
|
+
config: params.config,
|
|
43380
|
+
prompt: params.prompt,
|
|
43381
|
+
model: params.model,
|
|
43382
|
+
thinkLevel: params.thinkLevel,
|
|
43383
|
+
timeoutMs: params.timeoutMs,
|
|
43384
|
+
runId: params.runId,
|
|
43385
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43386
|
+
ownerNumbers: params.ownerNumbers,
|
|
43387
|
+
onPartialReply: params.emitPartial,
|
|
43388
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43389
|
+
});
|
|
43390
|
+
if (result.status === "completed") {
|
|
43391
|
+
if (auth.profileId) {
|
|
43392
|
+
await markAuthProfileUsed({
|
|
43393
|
+
store,
|
|
43394
|
+
profileId: auth.profileId,
|
|
43395
|
+
agentDir: params.agentDir
|
|
43396
|
+
});
|
|
43397
|
+
await markAuthProfileGood({
|
|
43398
|
+
store,
|
|
43399
|
+
provider: params.directProvider,
|
|
43400
|
+
profileId: auth.profileId,
|
|
43401
|
+
agentDir: params.agentDir
|
|
43402
|
+
});
|
|
43403
|
+
}
|
|
43404
|
+
return result;
|
|
43405
|
+
}
|
|
43406
|
+
lastResult = result;
|
|
43407
|
+
const failureReason = resolveProfileFailureReason(result);
|
|
43408
|
+
if (!auth.profileId || !failureReason) return result;
|
|
43409
|
+
await markAuthProfileFailure({
|
|
43410
|
+
store,
|
|
43411
|
+
profileId: auth.profileId,
|
|
43412
|
+
reason: failureReason,
|
|
43413
|
+
cfg: params.config,
|
|
43414
|
+
agentDir: params.agentDir
|
|
43415
|
+
});
|
|
43416
|
+
preferredProfile = void 0;
|
|
43417
|
+
}
|
|
43418
|
+
}
|
|
43419
|
+
async function resolveDirectStrategy(provider, config, agentDir) {
|
|
43420
|
+
const directProvider = resolveDirectAuthProvider(provider);
|
|
43421
|
+
if (!directProvider) return null;
|
|
43422
|
+
try {
|
|
43423
|
+
const auth = await resolveDirectProviderAuth({
|
|
43424
|
+
provider: directProvider,
|
|
43425
|
+
config,
|
|
43426
|
+
agentDir,
|
|
43427
|
+
store: ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false })
|
|
43428
|
+
});
|
|
43429
|
+
if (auth.apiKey) {
|
|
43430
|
+
if (directProvider === "anthropic" && auth.apiKey.startsWith("sk-ant-oat01-")) return null;
|
|
43431
|
+
return {
|
|
43432
|
+
kind: directProvider === "google" ? "gemini-direct" : "anthropic-direct",
|
|
43433
|
+
provider
|
|
43434
|
+
};
|
|
43435
|
+
}
|
|
43436
|
+
} catch {}
|
|
43437
|
+
return null;
|
|
43438
|
+
}
|
|
43439
|
+
async function resolveNoxSoftRunnerStrategy(params) {
|
|
42932
43440
|
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43441
|
+
const direct = await resolveDirectStrategy(provider, params.config, params.agentDir);
|
|
43442
|
+
if (direct) return direct;
|
|
43443
|
+
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43444
|
+
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`);
|
|
43445
|
+
return {
|
|
43446
|
+
kind: "cli",
|
|
43447
|
+
provider,
|
|
43448
|
+
cliProvider
|
|
43449
|
+
};
|
|
43450
|
+
}
|
|
43451
|
+
async function runNoxSoftEmbeddedAgent(params) {
|
|
43452
|
+
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43453
|
+
const normalizedRequestedRef = params.model?.trim() ? normalizeModelRef(provider, params.model) : null;
|
|
42933
43454
|
const startedAt = Date.now();
|
|
42934
43455
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
42935
43456
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
42936
43457
|
let assistantStarted = false;
|
|
42937
43458
|
const streamTasks = [];
|
|
42938
|
-
|
|
42939
|
-
|
|
42940
|
-
|
|
42941
|
-
|
|
42942
|
-
|
|
42943
|
-
|
|
42944
|
-
|
|
42945
|
-
|
|
42946
|
-
|
|
42947
|
-
|
|
42948
|
-
|
|
42949
|
-
|
|
42950
|
-
|
|
42951
|
-
|
|
42952
|
-
|
|
42953
|
-
|
|
42954
|
-
|
|
42955
|
-
|
|
42956
|
-
|
|
42957
|
-
|
|
42958
|
-
|
|
43459
|
+
const emitPartial = async (payload) => {
|
|
43460
|
+
if (!assistantStarted) {
|
|
43461
|
+
assistantStarted = true;
|
|
43462
|
+
await params.onAssistantMessageStart?.();
|
|
43463
|
+
}
|
|
43464
|
+
await params.onPartialReply?.(payload);
|
|
43465
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
43466
|
+
};
|
|
43467
|
+
const strategy = await resolveNoxSoftRunnerStrategy({
|
|
43468
|
+
provider: params.provider,
|
|
43469
|
+
config: params.config,
|
|
43470
|
+
agentDir: params.agentDir
|
|
43471
|
+
});
|
|
43472
|
+
if (strategy.kind === "anthropic-direct") {
|
|
43473
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43474
|
+
phase: "start",
|
|
43475
|
+
startedAt
|
|
43476
|
+
});
|
|
43477
|
+
try {
|
|
43478
|
+
const result = normalizeRunnerResult({
|
|
43479
|
+
result: await runDirectWithProfileFallback({
|
|
43480
|
+
...params,
|
|
43481
|
+
directProvider: "anthropic",
|
|
42959
43482
|
timeoutMs,
|
|
42960
43483
|
runId,
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
|
|
42964
|
-
|
|
42965
|
-
|
|
42966
|
-
|
|
42967
|
-
|
|
42968
|
-
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42972
|
-
|
|
42973
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42974
|
-
phase: "end",
|
|
42975
|
-
durationMs: Date.now() - startedAt,
|
|
42976
|
-
status: result.status
|
|
42977
|
-
});
|
|
42978
|
-
return result;
|
|
42979
|
-
} catch (err) {
|
|
43484
|
+
emitPartial
|
|
43485
|
+
}),
|
|
43486
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43487
|
+
model: normalizedRequestedRef?.model,
|
|
43488
|
+
sessionId: params.sessionId
|
|
43489
|
+
});
|
|
43490
|
+
const failure = coerceResultFailure({
|
|
43491
|
+
result,
|
|
43492
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43493
|
+
model: result.meta.agentMeta?.model
|
|
43494
|
+
});
|
|
43495
|
+
if (failure) {
|
|
42980
43496
|
await emitAgentEvent(params, "lifecycle", {
|
|
42981
43497
|
phase: "error",
|
|
42982
|
-
|
|
43498
|
+
startedAt,
|
|
43499
|
+
endedAt: Date.now(),
|
|
43500
|
+
error: failure.message,
|
|
43501
|
+
status: result.status
|
|
42983
43502
|
});
|
|
42984
|
-
throw
|
|
43503
|
+
throw failure;
|
|
42985
43504
|
}
|
|
42986
|
-
}
|
|
42987
|
-
}
|
|
42988
|
-
if (provider === "google" || provider === "gemini") {
|
|
42989
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
42990
|
-
provider: "google",
|
|
42991
|
-
cfg: params.config
|
|
42992
|
-
}))?.apiKey;
|
|
42993
|
-
if (geminiApiKey) {
|
|
42994
43505
|
await emitAgentEvent(params, "lifecycle", {
|
|
42995
|
-
phase: "
|
|
42996
|
-
startedAt
|
|
43506
|
+
phase: "end",
|
|
43507
|
+
durationMs: Date.now() - startedAt,
|
|
43508
|
+
status: result.status
|
|
42997
43509
|
});
|
|
42998
|
-
|
|
42999
|
-
|
|
43000
|
-
|
|
43001
|
-
|
|
43002
|
-
|
|
43003
|
-
|
|
43004
|
-
|
|
43005
|
-
|
|
43006
|
-
|
|
43007
|
-
|
|
43008
|
-
|
|
43009
|
-
|
|
43510
|
+
return result;
|
|
43511
|
+
} catch (err) {
|
|
43512
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43513
|
+
phase: "error",
|
|
43514
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43515
|
+
});
|
|
43516
|
+
throw err;
|
|
43517
|
+
}
|
|
43518
|
+
}
|
|
43519
|
+
if (strategy.kind === "gemini-direct") {
|
|
43520
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43521
|
+
phase: "start",
|
|
43522
|
+
startedAt
|
|
43523
|
+
});
|
|
43524
|
+
try {
|
|
43525
|
+
const result = normalizeRunnerResult({
|
|
43526
|
+
result: await runDirectWithProfileFallback({
|
|
43527
|
+
...params,
|
|
43528
|
+
directProvider: "google",
|
|
43010
43529
|
timeoutMs,
|
|
43011
43530
|
runId,
|
|
43012
|
-
|
|
43013
|
-
|
|
43014
|
-
|
|
43015
|
-
|
|
43016
|
-
|
|
43017
|
-
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43024
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
43025
|
-
phase: "end",
|
|
43026
|
-
durationMs: Date.now() - startedAt,
|
|
43027
|
-
status: result.status
|
|
43028
|
-
});
|
|
43029
|
-
return result;
|
|
43030
|
-
} catch (err) {
|
|
43531
|
+
emitPartial
|
|
43532
|
+
}),
|
|
43533
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43534
|
+
model: normalizedRequestedRef?.model,
|
|
43535
|
+
sessionId: params.sessionId
|
|
43536
|
+
});
|
|
43537
|
+
const failure = coerceResultFailure({
|
|
43538
|
+
result,
|
|
43539
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43540
|
+
model: result.meta.agentMeta?.model
|
|
43541
|
+
});
|
|
43542
|
+
if (failure) {
|
|
43031
43543
|
await emitAgentEvent(params, "lifecycle", {
|
|
43032
43544
|
phase: "error",
|
|
43033
|
-
|
|
43545
|
+
startedAt,
|
|
43546
|
+
endedAt: Date.now(),
|
|
43547
|
+
error: failure.message,
|
|
43548
|
+
status: result.status
|
|
43034
43549
|
});
|
|
43035
|
-
throw
|
|
43550
|
+
throw failure;
|
|
43036
43551
|
}
|
|
43552
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43553
|
+
phase: "end",
|
|
43554
|
+
durationMs: Date.now() - startedAt,
|
|
43555
|
+
status: result.status
|
|
43556
|
+
});
|
|
43557
|
+
return result;
|
|
43558
|
+
} catch (err) {
|
|
43559
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43560
|
+
phase: "error",
|
|
43561
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43562
|
+
});
|
|
43563
|
+
throw err;
|
|
43037
43564
|
}
|
|
43038
43565
|
}
|
|
43039
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43040
|
-
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`);
|
|
43041
43566
|
await emitAgentEvent(params, "lifecycle", {
|
|
43042
43567
|
phase: "start",
|
|
43043
43568
|
startedAt
|
|
43044
43569
|
});
|
|
43045
43570
|
try {
|
|
43046
|
-
const result =
|
|
43047
|
-
|
|
43048
|
-
|
|
43049
|
-
|
|
43050
|
-
|
|
43051
|
-
|
|
43052
|
-
|
|
43053
|
-
|
|
43054
|
-
|
|
43055
|
-
|
|
43056
|
-
|
|
43057
|
-
|
|
43058
|
-
|
|
43059
|
-
|
|
43060
|
-
|
|
43061
|
-
|
|
43062
|
-
|
|
43063
|
-
|
|
43064
|
-
|
|
43065
|
-
|
|
43066
|
-
|
|
43067
|
-
|
|
43068
|
-
|
|
43069
|
-
}
|
|
43070
|
-
|
|
43071
|
-
|
|
43072
|
-
|
|
43073
|
-
|
|
43074
|
-
|
|
43571
|
+
const result = normalizeRunnerResult({
|
|
43572
|
+
result: await runCliAgent({
|
|
43573
|
+
sessionId: params.sessionId,
|
|
43574
|
+
sessionKey: params.sessionKey,
|
|
43575
|
+
agentId: params.agentId,
|
|
43576
|
+
sessionFile: params.sessionFile,
|
|
43577
|
+
workspaceDir: params.workspaceDir,
|
|
43578
|
+
config: params.config,
|
|
43579
|
+
prompt: params.prompt,
|
|
43580
|
+
provider: strategy.cliProvider,
|
|
43581
|
+
model: params.model,
|
|
43582
|
+
thinkLevel: params.thinkLevel,
|
|
43583
|
+
timeoutMs,
|
|
43584
|
+
runId,
|
|
43585
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43586
|
+
ownerNumbers: params.ownerNumbers,
|
|
43587
|
+
cliSessionId: params.cliSessionId,
|
|
43588
|
+
sessionExecSecurity: params.execSecurity,
|
|
43589
|
+
images: params.images,
|
|
43590
|
+
streamParams: params.streamParams,
|
|
43591
|
+
onTextStream: (text) => {
|
|
43592
|
+
const nextText = text.trim();
|
|
43593
|
+
if (!nextText) return;
|
|
43594
|
+
streamTasks.push(emitPartial({ text: nextText }));
|
|
43595
|
+
}
|
|
43596
|
+
}),
|
|
43597
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43598
|
+
model: normalizedRequestedRef?.model,
|
|
43599
|
+
sessionId: params.sessionId
|
|
43075
43600
|
});
|
|
43076
43601
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
43077
43602
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
43078
|
-
if (finalText && !assistantStarted) {
|
|
43079
|
-
assistantStarted = true;
|
|
43080
|
-
await params.onAssistantMessageStart?.();
|
|
43081
|
-
await params.onPartialReply?.({ text: finalText });
|
|
43082
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
43083
|
-
}
|
|
43603
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
43084
43604
|
await emitAgentEvent(params, "lifecycle", {
|
|
43085
43605
|
phase: "end",
|
|
43086
43606
|
startedAt,
|
|
43087
43607
|
endedAt: Date.now(),
|
|
43088
|
-
aborted: false
|
|
43608
|
+
aborted: false,
|
|
43609
|
+
status: result.status
|
|
43089
43610
|
});
|
|
43090
|
-
return
|
|
43091
|
-
...result,
|
|
43092
|
-
meta: {
|
|
43093
|
-
...result.meta,
|
|
43094
|
-
agentMeta: {
|
|
43095
|
-
...result.meta.agentMeta,
|
|
43096
|
-
provider,
|
|
43097
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
43098
|
-
}
|
|
43099
|
-
}
|
|
43100
|
-
};
|
|
43611
|
+
return result;
|
|
43101
43612
|
} catch (error) {
|
|
43102
43613
|
const message = error instanceof Error ? error.message : String(error);
|
|
43103
43614
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -43109,6 +43620,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
43109
43620
|
throw error;
|
|
43110
43621
|
}
|
|
43111
43622
|
}
|
|
43623
|
+
|
|
43624
|
+
//#endregion
|
|
43625
|
+
//#region src/agents/pi-embedded.ts
|
|
43112
43626
|
async function compactEmbeddedPiSession(..._args) {
|
|
43113
43627
|
return {
|
|
43114
43628
|
ok: true,
|
|
@@ -43136,4 +43650,4 @@ async function waitForEmbeddedPiRunEnd(..._args) {
|
|
|
43136
43650
|
}
|
|
43137
43651
|
|
|
43138
43652
|
//#endregion
|
|
43139
|
-
export { resolveAgentTimeoutMs as A, resolveEnvelopeFormatOptions as C, buildMentionRegexes as D, CURRENT_MESSAGE_MARKER as E, resolveIdentityNamePrefix as F, resolveMessagePrefix as I, resolveAgentIdentity as M, resolveEffectiveMessagesConfig as N, normalizeMentionText as O, resolveIdentityName as P, formatInboundEnvelope as S, shouldComputeCommandAuthorized as T, enqueueSystemEvent as _, resolveChannelGroupRequireMention as a, createInboundDebouncer as b, createDedupeCache as c, resolveAgentRoute as d, normalizeGroupActivation as f, upsertChannelPairingRequest as g, readChannelAllowFromStore as h, resolveChannelGroupPolicy as i, extractShortModelName as j, subagent_registry_exports as k, getReplyFromConfig as l, formatDurationPrecise as m, buildPairingReply as n, shouldAckReactionForWhatsApp as o, parseActivationCommand as p, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s,
|
|
43653
|
+
export { resolveAgentTimeoutMs as A, resolveEnvelopeFormatOptions as C, buildMentionRegexes as D, CURRENT_MESSAGE_MARKER as E, resolveIdentityNamePrefix as F, resolveMessagePrefix as I, resolveAgentIdentity as M, resolveEffectiveMessagesConfig as N, normalizeMentionText as O, resolveIdentityName as P, formatInboundEnvelope as S, shouldComputeCommandAuthorized as T, enqueueSystemEvent as _, resolveChannelGroupRequireMention as a, createInboundDebouncer as b, createDedupeCache as c, resolveAgentRoute as d, normalizeGroupActivation as f, upsertChannelPairingRequest as g, readChannelAllowFromStore as h, resolveChannelGroupPolicy as i, extractShortModelName as j, subagent_registry_exports as k, getReplyFromConfig as l, formatDurationPrecise as m, buildPairingReply as n, shouldAckReactionForWhatsApp as o, parseActivationCommand as p, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s, runNoxSoftEmbeddedAgent as t, buildAgentSessionKey as u, registerUnhandledRejectionHandler as v, hasControlCommand as w, resolveInboundDebounceMs as x, finalizeInboundContext as y };
|