@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,27 +1,28 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
2
|
import { a as resolveOAuthDir, i as resolveGatewayPort, n as resolveConfigPath, s as resolveStateDir, u as resolveRequiredHomeDir } from "./paths-B-AkG5FD.js";
|
|
3
|
-
import { A as isAcpSessionKey, C as normalizeAccountId$1, D as resolveThreadSessionKeys, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, N as resolveThreadParentSessionKey, O as sanitizeAgentId, S as classifySessionKeyShape, T as normalizeMainKey, _ as DEFAULT_AGENT_ID, b as buildAgentPeerSessionKey, f as loadWorkspaceBootstrapFiles, g as DEFAULT_ACCOUNT_ID, j as isSubagentSessionKey, k as getSubagentDepth, l as ensureAgentWorkspace, m as resolveAnimaPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, u as filterBootstrapFilesForSession, v as DEFAULT_MAIN_KEY, w as normalizeAgentId, y as buildAgentMainSessionKey } from "./workspace-
|
|
4
|
-
import { A as normalizeLogLevel, D as getChildLogger, E as theme, T as isRich, a as unregisterActiveProgressLine, b as setVerbose, d as normalizeChannelId, h as setActivePluginRegistry, i as registerActiveProgressLine, n as defaultRuntime, p as getActivePluginRegistry, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeAnyChannelId, v as logVerbose, w as colorize, x as shouldLogVerbose } from "./subsystem-
|
|
5
|
-
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-
|
|
6
|
-
import { c as resolveDefaultAgentId, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds } from "./agent-scope-
|
|
7
|
-
import { A as supportsXHighThinking, At as assertSandboxPath, B as extractDeliveryInfo, Bt as normalizeToolName, C as listThinkingLevels, Ct as DEFAULT_UPLOAD_DIR, D as normalizeUsageDisplay, Dt as buildWorkspaceSkillSnapshot, E as normalizeThinkLevel, Et as buildWorkspaceSkillCommandSpecs, F as isLikelyContextOverflowError, Ft as applyOwnerOnlyToolPolicy, G as updateLastRoute, Gt as buildBootstrapContextFiles, H as loadSessionStore, Ht as stripPluginOnlyAllowlist, I as isTransientHttpError, It as buildPluginToolGroups, J as deliveryContextFromSession, Jt as HEARTBEAT_TOKEN, K as updateSessionStore, Kt as resolveBootstrapMaxChars, L as sanitizeUserFacingText, Lt as collectExplicitAllowlist, M as isCompactionFailureError, Mt as ensureBrowserControlAuth, N as isContextOverflowError, Nt as resolveBrowserControlAuth, O as normalizeVerboseLevel, Ot as resolvePluginSkillDirs, P as isFailoverErrorMessage, Pt as resolveSandboxConfigForAgent, Q as normalizeSessionDeliveryFields, R as ensureSandboxWorkspaceForSession, Rt as expandPolicyWithPluginGroups, S as formatXHighModelHint, St as saveMediaBuffer, T as normalizeReasoningLevel, Tt as getBridgeAuthForPort, U as readSessionUpdatedAt, Ut as compileGlobPatterns, V as appendAssistantMessageToSessionTranscript, Vt as resolveToolProfilePolicy, W as recordSessionMetaFromInbound, Wt as matchesAnyGlobPattern, X as mergeDeliveryContext, Xt as isSilentReplyText, Y as deliveryContextKey, Yt as SILENT_REPLY_TOKEN, Z as normalizeDeliveryContext, _ as throwIfAborted, _t as createBrowserRouteContext, at as resolveThreadFlag, b as initializeGlobalHookRunner, bt as resolveProfile, c as applyReplyThreading, ct as canonicalizeMainSessionAlias, d as shouldSuppressMessagingToolReplies, dt as deriveSessionMetaPatch, et as resolveSessionKey$1, f as createReplyToModeFilterForChannel, ft as getChannelDock, g as normalizeTargetForProvider, gt as resolveGroupSessionKey, h as normalizeChannelTargetInput, ht as normalizeChatType, it as resolveSessionResetType, j as classifyFailoverReason, jt as resolveSandboxedMediaSource, k as resolveResponseUsageMode, kt as assertMediaNotDataUrl, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, mt as resolveConversationLabel, nt as resolveChannelResetConfig, o as normalizeReplyPayloadsForDelivery, ot as DEFAULT_RESET_TRIGGERS, p as resolveReplyToMode, pt as listChannelDocks, q as updateSessionStoreEntry, qt as resolveBootstrapTotalMaxChars, rt as resolveSessionResetPolicy, s as applyReplyTagsToPayload, st as resolveFreshSessionTotalTokens, t as deliverOutboundPayloads, tt as evaluateSessionFreshness, u as isRenderablePayload, ut as resolveMainSessionKey, v as parseReplyDirectives, vt as registerBrowserRoutes, w as normalizeElevatedLevel, wt as resolvePathsWithinRoot, x as formatThinkingLevels, xt as getMediaDir, y as getGlobalHookRunner, yt as resolveBrowserConfig, z as resolveSandboxRuntimeStatus, zt as expandToolGroups } from "./deliver-
|
|
3
|
+
import { A as isAcpSessionKey, C as normalizeAccountId$1, D as resolveThreadSessionKeys, E as resolveAgentIdFromSessionKey, M as parseAgentSessionKey, N as resolveThreadParentSessionKey, O as sanitizeAgentId, S as classifySessionKeyShape, T as normalizeMainKey, _ as DEFAULT_AGENT_ID, b as buildAgentPeerSessionKey, f as loadWorkspaceBootstrapFiles, g as DEFAULT_ACCOUNT_ID, j as isSubagentSessionKey, k as getSubagentDepth, l as ensureAgentWorkspace, m as resolveAnimaPackageRoot, n as DEFAULT_AGENT_WORKSPACE_DIR, u as filterBootstrapFilesForSession, v as DEFAULT_MAIN_KEY, w as normalizeAgentId, y as buildAgentMainSessionKey } from "./workspace-BFIZCnGo.js";
|
|
4
|
+
import { A as normalizeLogLevel, D as getChildLogger, E as theme, T as isRich, a as unregisterActiveProgressLine, b as setVerbose, d as normalizeChannelId, h as setActivePluginRegistry, i as registerActiveProgressLine, n as defaultRuntime, p as getActivePluginRegistry, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeAnyChannelId, v as logVerbose, w as colorize, x as shouldLogVerbose } from "./subsystem-D1AJZPgG.js";
|
|
5
|
+
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-DUzVF5_D.js";
|
|
6
|
+
import { c as resolveDefaultAgentId, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds } from "./agent-scope-CxBzAozu.js";
|
|
7
|
+
import { A as supportsXHighThinking, At as assertSandboxPath, B as extractDeliveryInfo, Bt as normalizeToolName, C as listThinkingLevels, Ct as DEFAULT_UPLOAD_DIR, D as normalizeUsageDisplay, Dt as buildWorkspaceSkillSnapshot, E as normalizeThinkLevel, Et as buildWorkspaceSkillCommandSpecs, F as isLikelyContextOverflowError, Ft as applyOwnerOnlyToolPolicy, G as updateLastRoute, Gt as buildBootstrapContextFiles, H as loadSessionStore, Ht as stripPluginOnlyAllowlist, I as isTransientHttpError, It as buildPluginToolGroups, J as deliveryContextFromSession, Jt as HEARTBEAT_TOKEN, K as updateSessionStore, Kt as resolveBootstrapMaxChars, L as sanitizeUserFacingText, Lt as collectExplicitAllowlist, M as isCompactionFailureError, Mt as ensureBrowserControlAuth, N as isContextOverflowError, Nt as resolveBrowserControlAuth, O as normalizeVerboseLevel, Ot as resolvePluginSkillDirs, P as isFailoverErrorMessage, Pt as resolveSandboxConfigForAgent, Q as normalizeSessionDeliveryFields, R as ensureSandboxWorkspaceForSession, Rt as expandPolicyWithPluginGroups, S as formatXHighModelHint, St as saveMediaBuffer, T as normalizeReasoningLevel, Tt as getBridgeAuthForPort, U as readSessionUpdatedAt, Ut as compileGlobPatterns, V as appendAssistantMessageToSessionTranscript, Vt as resolveToolProfilePolicy, W as recordSessionMetaFromInbound, Wt as matchesAnyGlobPattern, X as mergeDeliveryContext, Xt as isSilentReplyText, Y as deliveryContextKey, Yt as SILENT_REPLY_TOKEN, Z as normalizeDeliveryContext, _ as throwIfAborted, _t as createBrowserRouteContext, at as resolveThreadFlag, b as initializeGlobalHookRunner, bt as resolveProfile, c as applyReplyThreading, ct as canonicalizeMainSessionAlias, d as shouldSuppressMessagingToolReplies, dt as deriveSessionMetaPatch, et as resolveSessionKey$1, f as createReplyToModeFilterForChannel, ft as getChannelDock, g as normalizeTargetForProvider, gt as resolveGroupSessionKey, h as normalizeChannelTargetInput, ht as normalizeChatType, it as resolveSessionResetType, j as classifyFailoverReason, jt as resolveSandboxedMediaSource, k as resolveResponseUsageMode, kt as assertMediaNotDataUrl, l as filterMessagingToolDuplicates, m as buildTargetResolverSignature, mt as resolveConversationLabel, nt as resolveChannelResetConfig, o as normalizeReplyPayloadsForDelivery, ot as DEFAULT_RESET_TRIGGERS, p as resolveReplyToMode, pt as listChannelDocks, q as updateSessionStoreEntry, qt as resolveBootstrapTotalMaxChars, rt as resolveSessionResetPolicy, s as applyReplyTagsToPayload, st as resolveFreshSessionTotalTokens, t as deliverOutboundPayloads, tt as evaluateSessionFreshness, u as isRenderablePayload, ut as resolveMainSessionKey, v as parseReplyDirectives, vt as registerBrowserRoutes, w as normalizeElevatedLevel, wt as resolvePathsWithinRoot, x as formatThinkingLevels, xt as getMediaDir, y as getGlobalHookRunner, yt as resolveBrowserConfig, z as resolveSandboxRuntimeStatus, zt as expandToolGroups } from "./deliver-d-CaN0uL.js";
|
|
8
8
|
import { i as triggerInternalHook, r as registerInternalHook, t as createInternalHookEvent } from "./internal-hooks-CWw3Hgeu.js";
|
|
9
|
-
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, _ as resetConfigOverrides, a as writeConfigFile, b as getConfigValueAtPath, c as parseDurationMs, d as discoverAnimaPlugins, f as applyTestPluginDefaults, g as getConfigOverrides, h as resolveMemorySlotDecision, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as resolveEnableState, n as loadConfig, o as validateConfigObjectWithPlugins, p as normalizePluginsConfig, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as setConfigOverride, w as VERSION, x as parseConfigPath, y as unsetConfigOverride } from "./config-
|
|
10
|
-
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-
|
|
11
|
-
import { a as modelKey, d as
|
|
12
|
-
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-
|
|
9
|
+
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, _ as resetConfigOverrides, a as writeConfigFile, b as getConfigValueAtPath, c as parseDurationMs, d as discoverAnimaPlugins, f as applyTestPluginDefaults, g as getConfigOverrides, h as resolveMemorySlotDecision, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as resolveEnableState, n as loadConfig, o as validateConfigObjectWithPlugins, p as normalizePluginsConfig, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as setConfigOverride, w as VERSION, x as parseConfigPath, y as unsetConfigOverride } from "./config-CweTwOtr.js";
|
|
10
|
+
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-HkVWMh--.js";
|
|
11
|
+
import { a as modelKey, d as resolveDefaultModelForAgent, f as resolveModelRefFromString, g as DEFAULT_PROVIDER, h as DEFAULT_MODEL, i as isCliProvider, m as DEFAULT_CONTEXT_TOKENS, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as resolveThinkingDefault, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveConfiguredModelRef } from "./model-selection-DjsJGv1R.js";
|
|
12
|
+
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-DLUBPBPz.js";
|
|
13
13
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-GLYKXXl-.js";
|
|
14
14
|
import { n as formatErrorMessage } from "./errors-UbDRvfEx.js";
|
|
15
|
-
import { A as detectMime, C as GATEWAY_CLIENT_MODES, E as getImageMetadata, F as kindFromMime, H as isBlockedHostname, I as normalizeMimeType$1, M as getFileExtension, N as imageMimeFromFormat, P as isAudioFileName, R as mediaKindFromMime, S as GATEWAY_CLIENT_IDS, U as isPrivateIpAddress, _ as isMarkdownCapableMessageChannel, a as chunkText, b as resolveGatewayMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as extensionForMime, k as resizeToJpeg, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as listDeliverableMessageChannels, w as GATEWAY_CLIENT_NAMES, x as resolveMessageChannel, y as normalizeMessageChannel, z as SsrFBlockedError } from "./chunk-
|
|
16
|
-
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-
|
|
17
|
-
import { t as sanitizeToolResultImages } from "./tool-images-
|
|
18
|
-
import { a as
|
|
19
|
-
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-
|
|
20
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-
|
|
21
|
-
import {
|
|
22
|
-
import { a as
|
|
15
|
+
import { A as detectMime, C as GATEWAY_CLIENT_MODES, E as getImageMetadata, F as kindFromMime, H as isBlockedHostname, I as normalizeMimeType$1, M as getFileExtension, N as imageMimeFromFormat, P as isAudioFileName, R as mediaKindFromMime, S as GATEWAY_CLIENT_IDS, U as isPrivateIpAddress, _ as isMarkdownCapableMessageChannel, a as chunkText, b as resolveGatewayMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as extensionForMime, k as resizeToJpeg, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as listDeliverableMessageChannels, w as GATEWAY_CLIENT_NAMES, x as resolveMessageChannel, y as normalizeMessageChannel, z as SsrFBlockedError } from "./chunk-B4Kx-ocg.js";
|
|
16
|
+
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-Q6h5HODL.js";
|
|
17
|
+
import { t as sanitizeToolResultImages } from "./tool-images-2qproko3.js";
|
|
18
|
+
import { _ as normalizeSecretInput, a as markAuthProfileUsed, c as markAuthProfileGood, d as resolveAnimaAgentDir, f as loadJsonFile, h as resolveAuthProfileDisplayLabel, i as markAuthProfileFailure, l as ensureAuthProfileStore, m as withFileLock$1, n as resolveAuthProfileOrder, o as resolveApiKeyForProfile, p as saveJsonFile, r as isProfileInCooldown, s as listProfilesForProvider, u as resolveAuthStorePathForDisplay } from "./auth-profiles-DtWUl1-k.js";
|
|
19
|
+
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-b_aZwo00.js";
|
|
20
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-CZ1vD4VS.js";
|
|
21
|
+
import { n as createAsyncLock } from "./soul-Bt8UNmTq.js";
|
|
22
|
+
import { a as readNumberParam, c as readStringParam, i as jsonResult, n as imageResult, r as imageResultFromFile, s as readStringArrayParam } from "./common-Bf_TG87Y.js";
|
|
23
|
+
import { a as resolveMarkdownTableMode, c as loadWebMedia, d as readResponseWithLimit, f as fetchWithSsrFGuard, i as convertMarkdownTables, l as MediaFetchError, m as fetchWithTimeout, o as normalizePollInput, p as bindAbortRelay, s as getDefaultLocalRoots, t as getActiveWebListener, u as fetchRemoteMedia } from "./active-listener-D2r8IO7g.js";
|
|
23
24
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-62lQTR6C.js";
|
|
24
|
-
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-
|
|
25
|
+
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-Bd0GoqEL.js";
|
|
25
26
|
import { createRequire } from "node:module";
|
|
26
27
|
import * as fs$2 from "node:fs/promises";
|
|
27
28
|
import fs from "node:fs/promises";
|
|
@@ -2439,6 +2440,17 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2439
2440
|
return fs$1.existsSync(packageDocs) ? packageDocs : null;
|
|
2440
2441
|
}
|
|
2441
2442
|
|
|
2443
|
+
//#endregion
|
|
2444
|
+
//#region src/agents/runner-capabilities.ts
|
|
2445
|
+
const CAPABILITY_HINTS = {
|
|
2446
|
+
"cli-native": "Use your native CLI capabilities when needed. Do not assume external MCP-style tools exist unless they are explicitly provided.",
|
|
2447
|
+
"local-tools": "Use only the tools explicitly provided in this session. Do not assume any other external MCP-style tools exist.",
|
|
2448
|
+
disabled: "Tools are disabled in this session. Do not call tools."
|
|
2449
|
+
};
|
|
2450
|
+
function appendRunnerCapabilityPrompt(prompt, mode) {
|
|
2451
|
+
return [prompt?.trim(), CAPABILITY_HINTS[mode]].filter(Boolean).join("\n");
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2442
2454
|
//#endregion
|
|
2443
2455
|
//#region src/logging/redact-identifier.ts
|
|
2444
2456
|
function sha256HexPrefix(value, len = 12) {
|
|
@@ -2508,6 +2520,18 @@ function resolveRunWorkspaceDir(params) {
|
|
|
2508
2520
|
|
|
2509
2521
|
//#endregion
|
|
2510
2522
|
//#region src/agents/anthropic-direct-runner.ts
|
|
2523
|
+
/**
|
|
2524
|
+
* Anthropic Direct API Runner
|
|
2525
|
+
*
|
|
2526
|
+
* Makes calls directly to api.anthropic.com without needing the claude CLI
|
|
2527
|
+
* binary to be installed or logged in. Works with any valid token:
|
|
2528
|
+
*
|
|
2529
|
+
* sk-ant-api01-... (Console API key)
|
|
2530
|
+
* sk-ant-oat01-... (Claude Code OAuth access token)
|
|
2531
|
+
*
|
|
2532
|
+
* This runner is automatically used when an `anthropic:default` token credential
|
|
2533
|
+
* is present in the auth store and the claude CLI is unavailable or not logged in.
|
|
2534
|
+
*/
|
|
2511
2535
|
const log$9 = createSubsystemLogger("agent/anthropic-direct");
|
|
2512
2536
|
const MODEL_MAP$1 = {
|
|
2513
2537
|
opus: "claude-opus-4-5",
|
|
@@ -2583,7 +2607,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2583
2607
|
cwd: process.cwd(),
|
|
2584
2608
|
moduleUrl: import.meta.url
|
|
2585
2609
|
});
|
|
2586
|
-
const extraSystemPrompt =
|
|
2610
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "disabled");
|
|
2587
2611
|
const systemPrompt = buildSystemPrompt({
|
|
2588
2612
|
workspaceDir,
|
|
2589
2613
|
config: params.config,
|
|
@@ -2623,7 +2647,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2623
2647
|
"x-api-key": params.token,
|
|
2624
2648
|
"anthropic-version": "2023-06-01",
|
|
2625
2649
|
"content-type": "application/json",
|
|
2626
|
-
"user-agent": `anima/
|
|
2650
|
+
"user-agent": `anima/5.1.3 (direct-runner; ${os.platform()})`
|
|
2627
2651
|
},
|
|
2628
2652
|
body: JSON.stringify(requestBody),
|
|
2629
2653
|
signal: controller.signal
|
|
@@ -2656,7 +2680,6 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2656
2680
|
stopReason: data.stop_reason,
|
|
2657
2681
|
contentTypes: (data.content ?? []).map((b) => b.type)
|
|
2658
2682
|
});
|
|
2659
|
-
await params.onAssistantMessageStart?.();
|
|
2660
2683
|
if (outputText && params.onPartialReply) await params.onPartialReply({ text: outputText });
|
|
2661
2684
|
history.messages.push({
|
|
2662
2685
|
role: "assistant",
|
|
@@ -2776,8 +2799,7 @@ const DEFAULT_CODEX_BACKEND = {
|
|
|
2776
2799
|
"--json",
|
|
2777
2800
|
"--color",
|
|
2778
2801
|
"never",
|
|
2779
|
-
"--sandbox",
|
|
2780
|
-
"danger-full-access",
|
|
2802
|
+
"--dangerously-bypass-approvals-and-sandbox",
|
|
2781
2803
|
"--skip-git-repo-check"
|
|
2782
2804
|
],
|
|
2783
2805
|
resumeArgs: [
|
|
@@ -2855,6 +2877,7 @@ const LEGACY_CODEX_RESUME_ARGS = [
|
|
|
2855
2877
|
"read-only",
|
|
2856
2878
|
"--skip-git-repo-check"
|
|
2857
2879
|
];
|
|
2880
|
+
const CODEX_BYPASS_FLAG = "--dangerously-bypass-approvals-and-sandbox";
|
|
2858
2881
|
function normalizeBackendKey(key) {
|
|
2859
2882
|
return normalizeProviderId(key);
|
|
2860
2883
|
}
|
|
@@ -2891,29 +2914,43 @@ function argsEqual(left, right) {
|
|
|
2891
2914
|
if (!left || !right || left.length !== right.length) return false;
|
|
2892
2915
|
return left.every((entry, index) => entry === right[index]);
|
|
2893
2916
|
}
|
|
2894
|
-
function
|
|
2917
|
+
function resolveCodexExecModeArg(args) {
|
|
2895
2918
|
if (!args) return;
|
|
2919
|
+
if (args.includes(CODEX_BYPASS_FLAG)) return CODEX_BYPASS_FLAG;
|
|
2896
2920
|
const index = args.indexOf("--sandbox");
|
|
2897
2921
|
const value = index >= 0 ? args[index + 1] : void 0;
|
|
2898
|
-
return
|
|
2899
|
-
}
|
|
2900
|
-
function
|
|
2901
|
-
const nextArgs = [
|
|
2902
|
-
const
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2922
|
+
return value === "workspace-write" || value === "read-only" ? value : void 0;
|
|
2923
|
+
}
|
|
2924
|
+
function setCodexExecModeArgs(args, mode) {
|
|
2925
|
+
const nextArgs = [];
|
|
2926
|
+
const source = args ?? [];
|
|
2927
|
+
for (let i = 0; i < source.length; i += 1) {
|
|
2928
|
+
const entry = source[i];
|
|
2929
|
+
if (entry === CODEX_BYPASS_FLAG) continue;
|
|
2930
|
+
if (entry === "--sandbox") {
|
|
2931
|
+
i += 1;
|
|
2932
|
+
continue;
|
|
2933
|
+
}
|
|
2934
|
+
nextArgs.push(entry);
|
|
2906
2935
|
}
|
|
2907
|
-
nextArgs.push(
|
|
2936
|
+
if (mode === CODEX_BYPASS_FLAG) nextArgs.push(CODEX_BYPASS_FLAG);
|
|
2937
|
+
else nextArgs.push("--sandbox", mode);
|
|
2908
2938
|
return nextArgs;
|
|
2909
2939
|
}
|
|
2910
|
-
function
|
|
2940
|
+
function normalizeExecSecurity$2(execSecurity) {
|
|
2941
|
+
const normalized = execSecurity?.trim().toLowerCase();
|
|
2942
|
+
if (!normalized) return;
|
|
2943
|
+
if (normalized === "deny") return "deny";
|
|
2944
|
+
return "full";
|
|
2945
|
+
}
|
|
2946
|
+
function resolveManagedCodexExecMode(cfg, options) {
|
|
2947
|
+
if (normalizeExecSecurity$2(options?.execSecurity) === "deny") return "read-only";
|
|
2911
2948
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
2912
2949
|
if (workspaceAccess === "ro") return "read-only";
|
|
2913
2950
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
2914
|
-
return
|
|
2951
|
+
return CODEX_BYPASS_FLAG;
|
|
2915
2952
|
}
|
|
2916
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
2953
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
2917
2954
|
const normalized = normalizeBackendKey(provider);
|
|
2918
2955
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
2919
2956
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -2939,9 +2976,9 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
2939
2976
|
...merged,
|
|
2940
2977
|
resumeArgs: DEFAULT_CODEX_BACKEND.resumeArgs
|
|
2941
2978
|
};
|
|
2942
|
-
if (!
|
|
2979
|
+
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
2943
2980
|
...merged,
|
|
2944
|
-
args:
|
|
2981
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
2945
2982
|
};
|
|
2946
2983
|
const command = merged.command?.trim();
|
|
2947
2984
|
if (!command) return null;
|
|
@@ -3120,14 +3157,14 @@ async function runCliAgent(params) {
|
|
|
3120
3157
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
3121
3158
|
if (workspaceResolution.usedFallback) log$8.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
3122
3159
|
const workspaceDir = resolvedWorkspace;
|
|
3123
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
3160
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
3124
3161
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
3125
3162
|
const backend = backendResolved.config;
|
|
3126
|
-
const
|
|
3163
|
+
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
3127
3164
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
3128
3165
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
3129
3166
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
3130
|
-
const extraSystemPrompt =
|
|
3167
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
3131
3168
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
3132
3169
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
3133
3170
|
workspaceDir,
|
|
@@ -3174,15 +3211,24 @@ async function runCliAgent(params) {
|
|
|
3174
3211
|
const lines = (await readFile(params.sessionFile, "utf-8")).trim().split("\n");
|
|
3175
3212
|
const lastLine = lines[lines.length - 1];
|
|
3176
3213
|
if (lastLine) {
|
|
3177
|
-
const
|
|
3178
|
-
const
|
|
3179
|
-
|
|
3180
|
-
|
|
3214
|
+
const parsed = JSON.parse(lastLine);
|
|
3215
|
+
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
3216
|
+
const currentMode = effectiveCodexExecMode;
|
|
3217
|
+
if (!previousMode) {
|
|
3218
|
+
log$8.info("Codex execution mode is unknown for the saved session; forcing session restart.");
|
|
3219
|
+
useResume = false;
|
|
3220
|
+
isNew = true;
|
|
3221
|
+
} else if (previousMode !== currentMode) {
|
|
3222
|
+
log$8.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
3181
3223
|
useResume = false;
|
|
3182
3224
|
isNew = true;
|
|
3183
3225
|
}
|
|
3184
3226
|
}
|
|
3185
|
-
} catch {
|
|
3227
|
+
} catch {
|
|
3228
|
+
log$8.info("Codex session transcript is unavailable; forcing session restart.");
|
|
3229
|
+
useResume = false;
|
|
3230
|
+
isNew = true;
|
|
3231
|
+
}
|
|
3186
3232
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
3187
3233
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
3188
3234
|
backend,
|
|
@@ -3298,8 +3344,9 @@ async function runCliAgent(params) {
|
|
|
3298
3344
|
if (stderr) log$8.debug(`cli stderr:\n${stderr}`);
|
|
3299
3345
|
}
|
|
3300
3346
|
if (result.code !== 0) {
|
|
3301
|
-
const
|
|
3302
|
-
const
|
|
3347
|
+
const timedOut = result.killed && result.signal === "SIGKILL";
|
|
3348
|
+
const err = timedOut ? `Request timed out after ${params.timeoutMs}ms` : stderr || stdout || "CLI failed.";
|
|
3349
|
+
const reason = timedOut ? "timeout" : classifyFailoverReason(err) ?? "unknown";
|
|
3303
3350
|
const status = resolveFailoverStatus(reason);
|
|
3304
3351
|
throw new FailoverError(err, {
|
|
3305
3352
|
reason,
|
|
@@ -3326,7 +3373,7 @@ async function runCliAgent(params) {
|
|
|
3326
3373
|
provider: params.provider,
|
|
3327
3374
|
model: modelId,
|
|
3328
3375
|
usage: output.usage,
|
|
3329
|
-
...
|
|
3376
|
+
...effectiveCodexExecMode ? { metadata: { effectiveCodexExecMode } } : {}
|
|
3330
3377
|
}
|
|
3331
3378
|
}
|
|
3332
3379
|
};
|
|
@@ -4167,7 +4214,7 @@ async function getMemorySearchManager(params) {
|
|
|
4167
4214
|
if (cached) return { manager: cached };
|
|
4168
4215
|
}
|
|
4169
4216
|
try {
|
|
4170
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
4217
|
+
const { QmdMemoryManager } = await import("./qmd-manager-CpNYgSrx.js");
|
|
4171
4218
|
const primary = await QmdMemoryManager.create({
|
|
4172
4219
|
cfg: params.cfg,
|
|
4173
4220
|
agentId: params.agentId,
|
|
@@ -4179,7 +4226,7 @@ async function getMemorySearchManager(params) {
|
|
|
4179
4226
|
const wrapper = new FallbackMemoryManager({
|
|
4180
4227
|
primary,
|
|
4181
4228
|
fallbackFactory: async () => {
|
|
4182
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4229
|
+
const { MemoryIndexManager } = await import("./manager-b_aZwo00.js").then((n) => n.t);
|
|
4183
4230
|
return await MemoryIndexManager.get(params);
|
|
4184
4231
|
}
|
|
4185
4232
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -4192,7 +4239,7 @@ async function getMemorySearchManager(params) {
|
|
|
4192
4239
|
}
|
|
4193
4240
|
}
|
|
4194
4241
|
try {
|
|
4195
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4242
|
+
const { MemoryIndexManager } = await import("./manager-b_aZwo00.js").then((n) => n.t);
|
|
4196
4243
|
return { manager: await MemoryIndexManager.get(params) };
|
|
4197
4244
|
} catch (err) {
|
|
4198
4245
|
return {
|
|
@@ -5658,6 +5705,7 @@ const PollParamsSchema = Type.Object({
|
|
|
5658
5705
|
const AgentParamsSchema = Type.Object({
|
|
5659
5706
|
message: NonEmptyString,
|
|
5660
5707
|
agentId: Type.Optional(NonEmptyString),
|
|
5708
|
+
model: Type.Optional(Type.String()),
|
|
5661
5709
|
to: Type.Optional(Type.String()),
|
|
5662
5710
|
replyTo: Type.Optional(Type.String()),
|
|
5663
5711
|
sessionId: Type.Optional(Type.String()),
|
|
@@ -7970,7 +8018,7 @@ async function routeReply(params) {
|
|
|
7970
8018
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
7971
8019
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
7972
8020
|
try {
|
|
7973
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
8021
|
+
const { deliverOutboundPayloads } = await import("./deliver-d-CaN0uL.js").then((n) => n.n);
|
|
7974
8022
|
return {
|
|
7975
8023
|
ok: true,
|
|
7976
8024
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -11566,7 +11614,7 @@ async function loadModelCatalog(params) {
|
|
|
11566
11614
|
});
|
|
11567
11615
|
try {
|
|
11568
11616
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
11569
|
-
await (await import("./pi-auth-json-
|
|
11617
|
+
await (await import("./pi-auth-json-BmdBnmlZ.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
11570
11618
|
const piSdk = await importPiSdk();
|
|
11571
11619
|
const agentDir = resolveAnimaAgentDir();
|
|
11572
11620
|
const { join } = await import("node:path");
|
|
@@ -13326,8 +13374,8 @@ const resolveProfileOverride = (params) => {
|
|
|
13326
13374
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
13327
13375
|
const PROVIDER_RANK = new Map([
|
|
13328
13376
|
"anthropic",
|
|
13329
|
-
"openai",
|
|
13330
13377
|
"openai-codex",
|
|
13378
|
+
"openai",
|
|
13331
13379
|
"minimax",
|
|
13332
13380
|
"synthetic",
|
|
13333
13381
|
"google",
|
|
@@ -13663,7 +13711,7 @@ async function createModelSelectionState(params) {
|
|
|
13663
13711
|
}
|
|
13664
13712
|
}
|
|
13665
13713
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
13666
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
13714
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-DtWUl1-k.js").then((n) => n.t);
|
|
13667
13715
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
13668
13716
|
const providerKey = normalizeProviderId(provider);
|
|
13669
13717
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -14725,25 +14773,6 @@ function ensureSkillsWatcher(params) {
|
|
|
14725
14773
|
watchers.set(workspaceDir, state);
|
|
14726
14774
|
}
|
|
14727
14775
|
|
|
14728
|
-
//#endregion
|
|
14729
|
-
//#region src/infra/pairing-files.ts
|
|
14730
|
-
function createAsyncLock() {
|
|
14731
|
-
let lock = Promise.resolve();
|
|
14732
|
-
return async function withLock(fn) {
|
|
14733
|
-
const prev = lock;
|
|
14734
|
-
let release;
|
|
14735
|
-
lock = new Promise((resolve) => {
|
|
14736
|
-
release = resolve;
|
|
14737
|
-
});
|
|
14738
|
-
await prev;
|
|
14739
|
-
try {
|
|
14740
|
-
return await fn();
|
|
14741
|
-
} finally {
|
|
14742
|
-
release?.();
|
|
14743
|
-
}
|
|
14744
|
-
};
|
|
14745
|
-
}
|
|
14746
|
-
|
|
14747
14776
|
//#endregion
|
|
14748
14777
|
//#region src/infra/node-pairing.ts
|
|
14749
14778
|
const PENDING_TTL_MS = 300 * 1e3;
|
|
@@ -27874,6 +27903,263 @@ function createGatewayTool(opts) {
|
|
|
27874
27903
|
};
|
|
27875
27904
|
}
|
|
27876
27905
|
|
|
27906
|
+
//#endregion
|
|
27907
|
+
//#region src/agents/model-auto.ts
|
|
27908
|
+
const DEFAULT_USAGE_THRESHOLD_PERCENT = 5;
|
|
27909
|
+
const USAGE_CACHE_TTL_MS = 6e4;
|
|
27910
|
+
const USAGE_TIMEOUT_MS = 1500;
|
|
27911
|
+
const usageSummaryCache = /* @__PURE__ */ new Map();
|
|
27912
|
+
function resolveRawAutoConfig(cfg) {
|
|
27913
|
+
const modelConfig = cfg?.agents?.defaults?.model;
|
|
27914
|
+
if (typeof modelConfig !== "object" || !modelConfig) return;
|
|
27915
|
+
return modelConfig.auto;
|
|
27916
|
+
}
|
|
27917
|
+
function dedupeProviders(values) {
|
|
27918
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27919
|
+
const result = [];
|
|
27920
|
+
for (const input of values) {
|
|
27921
|
+
if (!input) continue;
|
|
27922
|
+
const normalized = normalizeProviderId(input);
|
|
27923
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
27924
|
+
seen.add(normalized);
|
|
27925
|
+
result.push(normalized);
|
|
27926
|
+
}
|
|
27927
|
+
return result;
|
|
27928
|
+
}
|
|
27929
|
+
function resolveModelAutoConfig(cfg) {
|
|
27930
|
+
const raw = resolveRawAutoConfig(cfg);
|
|
27931
|
+
if (!raw?.enabled) return null;
|
|
27932
|
+
const byProvider = {};
|
|
27933
|
+
for (const [providerRaw, entry] of Object.entries(raw.byProvider ?? {})) {
|
|
27934
|
+
const provider = normalizeProviderId(providerRaw);
|
|
27935
|
+
if (!provider) continue;
|
|
27936
|
+
const models = Array.isArray(entry?.models) ? entry.models.map((value) => String(value ?? "").trim()).filter(Boolean) : [];
|
|
27937
|
+
if (models.length > 0) byProvider[provider] = { models };
|
|
27938
|
+
}
|
|
27939
|
+
const usageThresholdPercent = typeof raw.usageThresholdPercent === "number" && Number.isFinite(raw.usageThresholdPercent) ? Math.max(0, Math.min(100, raw.usageThresholdPercent)) : DEFAULT_USAGE_THRESHOLD_PERCENT;
|
|
27940
|
+
return {
|
|
27941
|
+
enabled: true,
|
|
27942
|
+
providerOrder: dedupeProviders(raw.providerOrder ?? []),
|
|
27943
|
+
byProvider,
|
|
27944
|
+
byWorkingMode: {
|
|
27945
|
+
read: Array.isArray(raw.byWorkingMode?.read) ? raw.byWorkingMode.read.map((value) => String(value ?? "").trim()).filter(Boolean) : [],
|
|
27946
|
+
write: Array.isArray(raw.byWorkingMode?.write) ? raw.byWorkingMode.write.map((value) => String(value ?? "").trim()).filter(Boolean) : []
|
|
27947
|
+
},
|
|
27948
|
+
usageCheck: raw.usageCheck === "prefer-available" ? "prefer-available" : "off",
|
|
27949
|
+
usageThresholdPercent
|
|
27950
|
+
};
|
|
27951
|
+
}
|
|
27952
|
+
function buildCandidatesFromRawModels(params) {
|
|
27953
|
+
const defaultProvider = params.defaultProvider ?? DEFAULT_PROVIDER;
|
|
27954
|
+
const index = buildModelAliasIndex({
|
|
27955
|
+
cfg: params.cfg ?? {},
|
|
27956
|
+
defaultProvider
|
|
27957
|
+
});
|
|
27958
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27959
|
+
const out = [];
|
|
27960
|
+
for (const raw of params.rawModels) {
|
|
27961
|
+
const resolved = resolveModelRefFromString({
|
|
27962
|
+
raw,
|
|
27963
|
+
defaultProvider,
|
|
27964
|
+
aliasIndex: index
|
|
27965
|
+
});
|
|
27966
|
+
if (!resolved) continue;
|
|
27967
|
+
const key = modelKey(resolved.ref.provider, resolved.ref.model);
|
|
27968
|
+
if (seen.has(key)) continue;
|
|
27969
|
+
seen.add(key);
|
|
27970
|
+
out.push(resolved.ref);
|
|
27971
|
+
}
|
|
27972
|
+
return out;
|
|
27973
|
+
}
|
|
27974
|
+
async function loadUsageSummary(agentDir, providers) {
|
|
27975
|
+
const key = `${agentDir ?? "main"}::${providers.slice().toSorted().join(",")}`;
|
|
27976
|
+
const now = Date.now();
|
|
27977
|
+
const cached = usageSummaryCache.get(key);
|
|
27978
|
+
if (cached && cached.expiresAt > now) return cached.summary;
|
|
27979
|
+
const summary = await loadProviderUsageSummary({
|
|
27980
|
+
agentDir,
|
|
27981
|
+
providers,
|
|
27982
|
+
timeoutMs: USAGE_TIMEOUT_MS
|
|
27983
|
+
});
|
|
27984
|
+
usageSummaryCache.set(key, {
|
|
27985
|
+
expiresAt: now + USAGE_CACHE_TTL_MS,
|
|
27986
|
+
summary
|
|
27987
|
+
});
|
|
27988
|
+
return summary;
|
|
27989
|
+
}
|
|
27990
|
+
function remainingPercent(snapshot) {
|
|
27991
|
+
if (snapshot.error || snapshot.windows.length === 0) return;
|
|
27992
|
+
const values = snapshot.windows.map((window) => 100 - window.usedPercent).filter((value) => Number.isFinite(value));
|
|
27993
|
+
if (values.length === 0) return;
|
|
27994
|
+
return Math.max(0, Math.min(...values));
|
|
27995
|
+
}
|
|
27996
|
+
async function resolveAvailability(params) {
|
|
27997
|
+
const availability = /* @__PURE__ */ new Map();
|
|
27998
|
+
const usageProviders = Array.from(new Set(params.providerOrder.map((provider) => resolveUsageProviderId(provider)).filter((provider) => Boolean(provider))));
|
|
27999
|
+
let summary;
|
|
28000
|
+
if (usageProviders.length > 0) try {
|
|
28001
|
+
summary = await loadUsageSummary(params.agentDir, usageProviders);
|
|
28002
|
+
} catch {
|
|
28003
|
+
summary = void 0;
|
|
28004
|
+
}
|
|
28005
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
28006
|
+
for (const entry of summary?.providers ?? []) snapshots.set(entry.provider, entry);
|
|
28007
|
+
for (const provider of params.providerOrder) {
|
|
28008
|
+
const usageProvider = resolveUsageProviderId(provider);
|
|
28009
|
+
if (!usageProvider) {
|
|
28010
|
+
availability.set(provider, {
|
|
28011
|
+
provider,
|
|
28012
|
+
state: "unknown"
|
|
28013
|
+
});
|
|
28014
|
+
continue;
|
|
28015
|
+
}
|
|
28016
|
+
const snapshot = snapshots.get(usageProvider);
|
|
28017
|
+
const percent = snapshot ? remainingPercent(snapshot) : void 0;
|
|
28018
|
+
availability.set(provider, {
|
|
28019
|
+
provider,
|
|
28020
|
+
usageProvider,
|
|
28021
|
+
remainingPercent: percent,
|
|
28022
|
+
state: percent === void 0 ? "unknown" : percent <= params.autoConfig.usageThresholdPercent ? "exhausted" : "available"
|
|
28023
|
+
});
|
|
28024
|
+
}
|
|
28025
|
+
return availability;
|
|
28026
|
+
}
|
|
28027
|
+
function reorderByAvailability(params) {
|
|
28028
|
+
const lockedPrimary = params.preservePrimary ? params.candidates[0] : void 0;
|
|
28029
|
+
const rest = params.preservePrimary ? params.candidates.slice(1) : params.candidates;
|
|
28030
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
28031
|
+
for (const candidate of rest) {
|
|
28032
|
+
const normalized = normalizeProviderId(candidate.provider);
|
|
28033
|
+
const group = grouped.get(normalized) ?? [];
|
|
28034
|
+
group.push({
|
|
28035
|
+
provider: normalized,
|
|
28036
|
+
model: candidate.model
|
|
28037
|
+
});
|
|
28038
|
+
grouped.set(normalized, group);
|
|
28039
|
+
}
|
|
28040
|
+
const order = [];
|
|
28041
|
+
for (const [provider, availability] of params.availability) if (availability.state === "available") order.push(provider);
|
|
28042
|
+
for (const [provider, availability] of params.availability) if (availability.state === "unknown") order.push(provider);
|
|
28043
|
+
for (const [provider, availability] of params.availability) if (availability.state === "exhausted") order.push(provider);
|
|
28044
|
+
for (const provider of grouped.keys()) if (!order.includes(provider)) order.push(provider);
|
|
28045
|
+
const ordered = [];
|
|
28046
|
+
for (const provider of order) {
|
|
28047
|
+
const group = grouped.get(provider) ?? [];
|
|
28048
|
+
ordered.push(...group);
|
|
28049
|
+
}
|
|
28050
|
+
return lockedPrimary ? [lockedPrimary, ...ordered] : ordered;
|
|
28051
|
+
}
|
|
28052
|
+
async function applyAutoModelRouting(params) {
|
|
28053
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
28054
|
+
if (!autoConfig) return {
|
|
28055
|
+
candidates: [...params.candidates],
|
|
28056
|
+
autoConfigured: false,
|
|
28057
|
+
preserveProviderOrder: false,
|
|
28058
|
+
availabilityByProvider: /* @__PURE__ */ new Map()
|
|
28059
|
+
};
|
|
28060
|
+
const providerOrder = dedupeProviders([...autoConfig.providerOrder, ...params.candidates.map((candidate) => candidate.provider)]);
|
|
28061
|
+
let candidates = [...params.candidates];
|
|
28062
|
+
const modePreferred = params.workingMode ? buildCandidatesFromRawModels({
|
|
28063
|
+
rawModels: autoConfig.byWorkingMode[params.workingMode] ?? [],
|
|
28064
|
+
cfg: params.cfg,
|
|
28065
|
+
defaultProvider: params.candidates[0]?.provider ?? DEFAULT_PROVIDER
|
|
28066
|
+
}) : [];
|
|
28067
|
+
if (modePreferred.length > 0) {
|
|
28068
|
+
const lockedPrimary = params.preservePrimary && candidates.length > 0 ? [candidates[0]] : [];
|
|
28069
|
+
const remainingCandidates = params.preservePrimary ? candidates.slice(1) : candidates;
|
|
28070
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28071
|
+
candidates = [
|
|
28072
|
+
...lockedPrimary,
|
|
28073
|
+
...modePreferred,
|
|
28074
|
+
...remainingCandidates
|
|
28075
|
+
].filter((candidate) => {
|
|
28076
|
+
const key = modelKey(candidate.provider, candidate.model);
|
|
28077
|
+
if (seen.has(key)) return false;
|
|
28078
|
+
seen.add(key);
|
|
28079
|
+
return true;
|
|
28080
|
+
});
|
|
28081
|
+
}
|
|
28082
|
+
const availability = await resolveAvailability({
|
|
28083
|
+
providerOrder,
|
|
28084
|
+
agentDir: params.agentDir,
|
|
28085
|
+
autoConfig
|
|
28086
|
+
});
|
|
28087
|
+
if (autoConfig.usageCheck === "prefer-available") candidates = reorderByAvailability({
|
|
28088
|
+
candidates,
|
|
28089
|
+
availability,
|
|
28090
|
+
preservePrimary: params.preservePrimary
|
|
28091
|
+
});
|
|
28092
|
+
return {
|
|
28093
|
+
candidates,
|
|
28094
|
+
autoConfigured: true,
|
|
28095
|
+
preserveProviderOrder: true,
|
|
28096
|
+
config: autoConfig,
|
|
28097
|
+
availabilityByProvider: availability
|
|
28098
|
+
};
|
|
28099
|
+
}
|
|
28100
|
+
|
|
28101
|
+
//#endregion
|
|
28102
|
+
//#region src/agents/model-preference.ts
|
|
28103
|
+
const HIGH_THINK_LEVELS = new Set(["high", "xhigh"]);
|
|
28104
|
+
const SESSION_COST_THRESHOLD_USD = .5;
|
|
28105
|
+
const SESSION_TOKEN_THRESHOLD = 3e5;
|
|
28106
|
+
const SESSION_TURN_THRESHOLD = 12;
|
|
28107
|
+
const SESSION_COMPACTION_THRESHOLD = 2;
|
|
28108
|
+
function toPositiveFiniteNumber(value) {
|
|
28109
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
28110
|
+
return value;
|
|
28111
|
+
}
|
|
28112
|
+
function shouldPreferCheap(entry) {
|
|
28113
|
+
if (!entry) return false;
|
|
28114
|
+
const sessionCostUsd = toPositiveFiniteNumber(entry.sessionEstimatedCostUsdTotal) ?? 0;
|
|
28115
|
+
const sessionInputTokens = toPositiveFiniteNumber(entry.sessionInputTokensTotal) ?? 0;
|
|
28116
|
+
const sessionOutputTokens = toPositiveFiniteNumber(entry.sessionOutputTokensTotal) ?? 0;
|
|
28117
|
+
const sessionTurnCount = toPositiveFiniteNumber(entry.sessionTurnCount) ?? 0;
|
|
28118
|
+
const compactionCount = toPositiveFiniteNumber(entry.compactionCount) ?? 0;
|
|
28119
|
+
return sessionCostUsd >= SESSION_COST_THRESHOLD_USD || sessionInputTokens + sessionOutputTokens >= SESSION_TOKEN_THRESHOLD || sessionTurnCount >= SESSION_TURN_THRESHOLD || compactionCount >= SESSION_COMPACTION_THRESHOLD;
|
|
28120
|
+
}
|
|
28121
|
+
function resolveCandidateCostScore(candidate, cfg) {
|
|
28122
|
+
const cost = resolveModelCostConfig({
|
|
28123
|
+
provider: candidate.provider,
|
|
28124
|
+
model: candidate.model,
|
|
28125
|
+
config: cfg
|
|
28126
|
+
});
|
|
28127
|
+
if (!cost) return;
|
|
28128
|
+
const values = [
|
|
28129
|
+
cost.input,
|
|
28130
|
+
cost.output,
|
|
28131
|
+
cost.cacheRead,
|
|
28132
|
+
cost.cacheWrite
|
|
28133
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
28134
|
+
if (values.length === 0) return;
|
|
28135
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
28136
|
+
}
|
|
28137
|
+
function resolveUsageAwareModelPreference(params) {
|
|
28138
|
+
if (params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride) return "preserve";
|
|
28139
|
+
if (params.thinkLevel && HIGH_THINK_LEVELS.has(params.thinkLevel)) return "prefer-strong";
|
|
28140
|
+
if (shouldPreferCheap(params.sessionEntry)) return "prefer-cheap";
|
|
28141
|
+
return "preserve";
|
|
28142
|
+
}
|
|
28143
|
+
function orderCandidatesByPreference(params) {
|
|
28144
|
+
const preferenceMode = params.preferenceMode ?? "preserve";
|
|
28145
|
+
if (preferenceMode === "preserve" || params.candidates.length <= 1) return [...params.candidates];
|
|
28146
|
+
const scoredCandidates = params.candidates.map((candidate) => ({
|
|
28147
|
+
candidate,
|
|
28148
|
+
score: resolveCandidateCostScore(candidate, params.cfg)
|
|
28149
|
+
}));
|
|
28150
|
+
const sortable = scoredCandidates.filter((entry) => entry.score !== void 0);
|
|
28151
|
+
if (sortable.length < 2) return [...params.candidates];
|
|
28152
|
+
sortable.sort((left, right) => preferenceMode === "prefer-cheap" ? left.score - right.score : right.score - left.score);
|
|
28153
|
+
const reordered = sortable.map((entry) => entry.candidate);
|
|
28154
|
+
let reorderedIndex = 0;
|
|
28155
|
+
return scoredCandidates.map((entry) => {
|
|
28156
|
+
if (entry.score === void 0) return entry.candidate;
|
|
28157
|
+
const next = reordered[reorderedIndex];
|
|
28158
|
+
reorderedIndex += 1;
|
|
28159
|
+
return next;
|
|
28160
|
+
});
|
|
28161
|
+
}
|
|
28162
|
+
|
|
27877
28163
|
//#endregion
|
|
27878
28164
|
//#region src/agents/model-fallback.ts
|
|
27879
28165
|
/**
|
|
@@ -27975,12 +28261,32 @@ function resolveFallbackCandidates(params) {
|
|
|
27975
28261
|
}, false);
|
|
27976
28262
|
return candidates;
|
|
27977
28263
|
}
|
|
28264
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
28265
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
28266
|
+
if (!execSecurity) return;
|
|
28267
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
28268
|
+
}
|
|
27978
28269
|
async function runWithModelFallback(params) {
|
|
27979
|
-
const
|
|
28270
|
+
const preservePrimary = Boolean(params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride);
|
|
28271
|
+
const resolvedWorkingMode = params.workingMode ?? resolveWorkingModeFromSessionEntry(params.sessionEntry);
|
|
28272
|
+
const candidates = orderCandidatesByPreference({
|
|
28273
|
+
candidates: (await applyAutoModelRouting({
|
|
28274
|
+
candidates: resolveFallbackCandidates({
|
|
28275
|
+
cfg: params.cfg,
|
|
28276
|
+
provider: params.provider,
|
|
28277
|
+
model: params.model,
|
|
28278
|
+
fallbacksOverride: params.fallbacksOverride
|
|
28279
|
+
}),
|
|
28280
|
+
cfg: params.cfg,
|
|
28281
|
+
agentDir: params.agentDir,
|
|
28282
|
+
preservePrimary,
|
|
28283
|
+
workingMode: resolvedWorkingMode
|
|
28284
|
+
})).candidates,
|
|
27980
28285
|
cfg: params.cfg,
|
|
27981
|
-
|
|
27982
|
-
|
|
27983
|
-
|
|
28286
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
28287
|
+
thinkLevel: params.thinkLevel,
|
|
28288
|
+
sessionEntry: params.sessionEntry
|
|
28289
|
+
})
|
|
27984
28290
|
});
|
|
27985
28291
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
27986
28292
|
const attempts = [];
|
|
@@ -29081,6 +29387,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
29081
29387
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
29082
29388
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
29083
29389
|
}
|
|
29390
|
+
function resolveConfiguredNoxsoftTarget(params) {
|
|
29391
|
+
const trimmed = params.input.trim();
|
|
29392
|
+
if (!trimmed) return null;
|
|
29393
|
+
const configured = params.cfg.channels?.noxsoft?.channels;
|
|
29394
|
+
if (!configured) return null;
|
|
29395
|
+
const lower = trimmed.toLowerCase();
|
|
29396
|
+
for (const [name, entry] of Object.entries(configured)) {
|
|
29397
|
+
const channelId = entry?.id?.trim();
|
|
29398
|
+
if (!channelId) continue;
|
|
29399
|
+
if (lower === name.trim().toLowerCase() || trimmed === channelId) return {
|
|
29400
|
+
to: channelId,
|
|
29401
|
+
kind: "channel",
|
|
29402
|
+
display: name,
|
|
29403
|
+
source: "normalized"
|
|
29404
|
+
};
|
|
29405
|
+
}
|
|
29406
|
+
return null;
|
|
29407
|
+
}
|
|
29084
29408
|
async function resolveMessagingTarget(params) {
|
|
29085
29409
|
const raw = normalizeChannelTargetInput(params.input);
|
|
29086
29410
|
if (!raw) return {
|
|
@@ -29092,6 +29416,16 @@ async function resolveMessagingTarget(params) {
|
|
|
29092
29416
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
29093
29417
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
29094
29418
|
const normalized = normalizeTargetForProvider(params.channel, raw) ?? raw;
|
|
29419
|
+
if (params.channel === "noxsoft") {
|
|
29420
|
+
const configuredTarget = resolveConfiguredNoxsoftTarget({
|
|
29421
|
+
cfg: params.cfg,
|
|
29422
|
+
input: raw
|
|
29423
|
+
});
|
|
29424
|
+
if (configuredTarget) return {
|
|
29425
|
+
ok: true,
|
|
29426
|
+
target: configuredTarget
|
|
29427
|
+
};
|
|
29428
|
+
}
|
|
29095
29429
|
const looksLikeTargetId = () => {
|
|
29096
29430
|
const trimmed = raw.trim();
|
|
29097
29431
|
if (!trimmed) return false;
|
|
@@ -29306,6 +29640,10 @@ function applyCrossContextDecoration(params) {
|
|
|
29306
29640
|
};
|
|
29307
29641
|
}
|
|
29308
29642
|
|
|
29643
|
+
//#endregion
|
|
29644
|
+
//#region src/auth/noxsoft-auth.ts
|
|
29645
|
+
const TOKEN_PATH = path.join(os.homedir(), ".noxsoft-agent-token");
|
|
29646
|
+
|
|
29309
29647
|
//#endregion
|
|
29310
29648
|
//#region src/infra/outbound/targets.ts
|
|
29311
29649
|
function resolveSessionDeliveryTarget(params) {
|
|
@@ -29387,13 +29725,62 @@ function resolveGatewayOptions(opts) {
|
|
|
29387
29725
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
29388
29726
|
};
|
|
29389
29727
|
}
|
|
29728
|
+
function resolveNoxsoftApiBase(cfg) {
|
|
29729
|
+
return cfg.channels?.noxsoft?.apiUrl?.trim() || "https://auth.noxsoft.net";
|
|
29730
|
+
}
|
|
29731
|
+
function resolveNoxsoftToken(cfg) {
|
|
29732
|
+
const inlineToken = cfg.channels?.noxsoft?.token?.trim();
|
|
29733
|
+
if (inlineToken) return inlineToken;
|
|
29734
|
+
const tokenFile = cfg.channels?.noxsoft?.tokenFile?.trim() || TOKEN_PATH;
|
|
29735
|
+
try {
|
|
29736
|
+
const token = fs$1.readFileSync(tokenFile, "utf-8").trim();
|
|
29737
|
+
if (token) return token;
|
|
29738
|
+
} catch {}
|
|
29739
|
+
throw new Error(`NoxSoft token not configured. Expected token in ${tokenFile}`);
|
|
29740
|
+
}
|
|
29741
|
+
async function sendNoxsoftMessageDirect(params) {
|
|
29742
|
+
if (params.dryRun) return {
|
|
29743
|
+
channel: "noxsoft",
|
|
29744
|
+
to: params.to,
|
|
29745
|
+
via: "direct",
|
|
29746
|
+
mediaUrl: params.mediaUrl,
|
|
29747
|
+
mediaUrls: params.mediaUrls,
|
|
29748
|
+
dryRun: true
|
|
29749
|
+
};
|
|
29750
|
+
const token = resolveNoxsoftToken(params.cfg);
|
|
29751
|
+
const apiBase = resolveNoxsoftApiBase(params.cfg).replace(/\/+$/, "");
|
|
29752
|
+
const response = await fetch(`${apiBase}/api/agents/chat/channels/${params.to}/messages`, {
|
|
29753
|
+
method: "POST",
|
|
29754
|
+
headers: {
|
|
29755
|
+
Authorization: `Bearer ${token}`,
|
|
29756
|
+
"Content-Type": "application/json"
|
|
29757
|
+
},
|
|
29758
|
+
body: JSON.stringify({
|
|
29759
|
+
content: params.content,
|
|
29760
|
+
mediaUrl: params.mediaUrl ?? void 0,
|
|
29761
|
+
mediaUrls: params.mediaUrls?.length ? params.mediaUrls : void 0
|
|
29762
|
+
}),
|
|
29763
|
+
signal: params.abortSignal
|
|
29764
|
+
});
|
|
29765
|
+
if (!response.ok) {
|
|
29766
|
+
const text = await response.text().catch(() => "");
|
|
29767
|
+
throw new Error(`NoxSoft send failed (${response.status}): ${text}`);
|
|
29768
|
+
}
|
|
29769
|
+
const payload = await response.json().catch(() => ({}));
|
|
29770
|
+
const messageId = payload.messageId ?? payload.id ?? `noxsoft:${Date.now()}`;
|
|
29771
|
+
return {
|
|
29772
|
+
channel: "noxsoft",
|
|
29773
|
+
to: params.to,
|
|
29774
|
+
via: "direct",
|
|
29775
|
+
mediaUrl: params.mediaUrl,
|
|
29776
|
+
mediaUrls: params.mediaUrls,
|
|
29777
|
+
result: { messageId }
|
|
29778
|
+
};
|
|
29779
|
+
}
|
|
29390
29780
|
async function sendMessage(params) {
|
|
29391
29781
|
const cfg = params.cfg ?? loadConfig();
|
|
29392
|
-
const channel = params.channel?.trim() ?
|
|
29782
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29393
29783
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29394
|
-
const plugin = getChannelPlugin(channel);
|
|
29395
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29396
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29397
29784
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
29398
29785
|
text: params.content,
|
|
29399
29786
|
mediaUrl: params.mediaUrl,
|
|
@@ -29402,6 +29789,18 @@ async function sendMessage(params) {
|
|
|
29402
29789
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
29403
29790
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
29404
29791
|
const primaryMediaUrl = mirrorMediaUrls[0] ?? params.mediaUrl ?? null;
|
|
29792
|
+
if (channel === "noxsoft") return sendNoxsoftMessageDirect({
|
|
29793
|
+
cfg,
|
|
29794
|
+
to: params.to,
|
|
29795
|
+
content: params.content,
|
|
29796
|
+
mediaUrl: primaryMediaUrl,
|
|
29797
|
+
mediaUrls: mirrorMediaUrls.length ? mirrorMediaUrls : void 0,
|
|
29798
|
+
dryRun: params.dryRun,
|
|
29799
|
+
abortSignal: params.abortSignal
|
|
29800
|
+
});
|
|
29801
|
+
const plugin = getChannelPlugin(channel);
|
|
29802
|
+
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29803
|
+
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29405
29804
|
if (params.dryRun) return {
|
|
29406
29805
|
channel,
|
|
29407
29806
|
to: params.to,
|
|
@@ -29480,7 +29879,7 @@ async function sendMessage(params) {
|
|
|
29480
29879
|
}
|
|
29481
29880
|
async function sendPoll(params) {
|
|
29482
29881
|
const cfg = params.cfg ?? loadConfig();
|
|
29483
|
-
const channel = params.channel?.trim() ?
|
|
29882
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29484
29883
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29485
29884
|
const pollInput = {
|
|
29486
29885
|
question: params.question,
|
|
@@ -36098,6 +36497,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36098
36497
|
provider: params.followupRun.run.provider,
|
|
36099
36498
|
model: params.followupRun.run.model,
|
|
36100
36499
|
agentDir: params.followupRun.run.agentDir,
|
|
36500
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
36501
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36101
36502
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36102
36503
|
run: (provider, model) => {
|
|
36103
36504
|
params.opts?.onModelSelected?.({
|
|
@@ -36105,97 +36506,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36105
36506
|
model,
|
|
36106
36507
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
36107
36508
|
});
|
|
36108
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
36109
|
-
const startedAt = Date.now();
|
|
36110
|
-
emitAgentEvent$1({
|
|
36111
|
-
runId,
|
|
36112
|
-
stream: "lifecycle",
|
|
36113
|
-
data: {
|
|
36114
|
-
phase: "start",
|
|
36115
|
-
startedAt
|
|
36116
|
-
}
|
|
36117
|
-
});
|
|
36118
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
36119
|
-
return (async () => {
|
|
36120
|
-
let lifecycleTerminalEmitted = false;
|
|
36121
|
-
let sawCliStream = false;
|
|
36122
|
-
let lastCliStreamText = "";
|
|
36123
|
-
try {
|
|
36124
|
-
const result = await runCliAgent({
|
|
36125
|
-
sessionId: params.followupRun.run.sessionId,
|
|
36126
|
-
sessionKey: params.sessionKey,
|
|
36127
|
-
agentId: params.followupRun.run.agentId,
|
|
36128
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
36129
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
36130
|
-
config: params.followupRun.run.config,
|
|
36131
|
-
prompt: params.commandBody,
|
|
36132
|
-
provider,
|
|
36133
|
-
model,
|
|
36134
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36135
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36136
|
-
runId,
|
|
36137
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
36138
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
36139
|
-
cliSessionId,
|
|
36140
|
-
images: params.opts?.images,
|
|
36141
|
-
onTextStream: (text) => {
|
|
36142
|
-
const nextText = text.trim();
|
|
36143
|
-
if (!nextText) return;
|
|
36144
|
-
sawCliStream = true;
|
|
36145
|
-
lastCliStreamText = nextText;
|
|
36146
|
-
emitAgentEvent$1({
|
|
36147
|
-
runId,
|
|
36148
|
-
stream: "assistant",
|
|
36149
|
-
data: { text: nextText }
|
|
36150
|
-
});
|
|
36151
|
-
}
|
|
36152
|
-
});
|
|
36153
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
36154
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
36155
|
-
runId,
|
|
36156
|
-
stream: "assistant",
|
|
36157
|
-
data: { text: cliText }
|
|
36158
|
-
});
|
|
36159
|
-
emitAgentEvent$1({
|
|
36160
|
-
runId,
|
|
36161
|
-
stream: "lifecycle",
|
|
36162
|
-
data: {
|
|
36163
|
-
phase: "end",
|
|
36164
|
-
startedAt,
|
|
36165
|
-
endedAt: Date.now()
|
|
36166
|
-
}
|
|
36167
|
-
});
|
|
36168
|
-
lifecycleTerminalEmitted = true;
|
|
36169
|
-
return result;
|
|
36170
|
-
} catch (err) {
|
|
36171
|
-
emitAgentEvent$1({
|
|
36172
|
-
runId,
|
|
36173
|
-
stream: "lifecycle",
|
|
36174
|
-
data: {
|
|
36175
|
-
phase: "error",
|
|
36176
|
-
startedAt,
|
|
36177
|
-
endedAt: Date.now(),
|
|
36178
|
-
error: String(err)
|
|
36179
|
-
}
|
|
36180
|
-
});
|
|
36181
|
-
lifecycleTerminalEmitted = true;
|
|
36182
|
-
throw err;
|
|
36183
|
-
} finally {
|
|
36184
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
36185
|
-
runId,
|
|
36186
|
-
stream: "lifecycle",
|
|
36187
|
-
data: {
|
|
36188
|
-
phase: "error",
|
|
36189
|
-
startedAt,
|
|
36190
|
-
endedAt: Date.now(),
|
|
36191
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
36192
|
-
}
|
|
36193
|
-
});
|
|
36194
|
-
}
|
|
36195
|
-
})();
|
|
36196
|
-
}
|
|
36197
36509
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36198
|
-
return
|
|
36510
|
+
return runNoxSoftEmbeddedAgent({
|
|
36199
36511
|
sessionId: params.followupRun.run.sessionId,
|
|
36200
36512
|
sessionKey: params.sessionKey,
|
|
36201
36513
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36232,6 +36544,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36232
36544
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36233
36545
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36234
36546
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36547
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
36548
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
36235
36549
|
toolResultFormat: (() => {
|
|
36236
36550
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
36237
36551
|
if (!channel) return "markdown";
|
|
@@ -36263,6 +36577,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36263
36577
|
});
|
|
36264
36578
|
} : void 0,
|
|
36265
36579
|
onAgentEvent: async (evt) => {
|
|
36580
|
+
emitAgentEvent$1({
|
|
36581
|
+
runId,
|
|
36582
|
+
stream: evt.stream,
|
|
36583
|
+
data: evt.data
|
|
36584
|
+
});
|
|
36266
36585
|
if (evt.stream === "tool") {
|
|
36267
36586
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
36268
36587
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -36532,10 +36851,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36532
36851
|
provider: params.followupRun.run.provider,
|
|
36533
36852
|
model: params.followupRun.run.model,
|
|
36534
36853
|
agentDir: params.followupRun.run.agentDir,
|
|
36854
|
+
sessionEntry: params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0) ?? void 0,
|
|
36855
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36535
36856
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36536
36857
|
run: (provider, model) => {
|
|
36537
36858
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36538
|
-
return
|
|
36859
|
+
return runNoxSoftEmbeddedAgent({
|
|
36539
36860
|
sessionId: params.followupRun.run.sessionId,
|
|
36540
36861
|
sessionKey: params.sessionKey,
|
|
36541
36862
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36569,6 +36890,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36569
36890
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36570
36891
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36571
36892
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36893
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
36572
36894
|
bashElevated: params.followupRun.run.bashElevated,
|
|
36573
36895
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36574
36896
|
runId: flushRunId,
|
|
@@ -36904,10 +37226,12 @@ function createFollowupRunner(params) {
|
|
|
36904
37226
|
provider: queued.run.provider,
|
|
36905
37227
|
model: queued.run.model,
|
|
36906
37228
|
agentDir: queued.run.agentDir,
|
|
37229
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
37230
|
+
thinkLevel: queued.run.thinkLevel,
|
|
36907
37231
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
36908
37232
|
run: (provider, model) => {
|
|
36909
37233
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
36910
|
-
return
|
|
37234
|
+
return runNoxSoftEmbeddedAgent({
|
|
36911
37235
|
sessionId: queued.run.sessionId,
|
|
36912
37236
|
sessionKey: queued.run.sessionKey,
|
|
36913
37237
|
agentId: queued.run.agentId,
|
|
@@ -36938,6 +37262,7 @@ function createFollowupRunner(params) {
|
|
|
36938
37262
|
verboseLevel: queued.run.verboseLevel,
|
|
36939
37263
|
reasoningLevel: queued.run.reasoningLevel,
|
|
36940
37264
|
execOverrides: queued.run.execOverrides,
|
|
37265
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
36941
37266
|
bashElevated: queued.run.bashElevated,
|
|
36942
37267
|
timeoutMs: queued.run.timeoutMs,
|
|
36943
37268
|
runId,
|
|
@@ -37918,7 +38243,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
37918
38243
|
return;
|
|
37919
38244
|
}
|
|
37920
38245
|
try {
|
|
37921
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
38246
|
+
const { deliverOutboundPayloads } = await import("./deliver-d-CaN0uL.js").then((n) => n.n);
|
|
37922
38247
|
await deliverOutboundPayloads({
|
|
37923
38248
|
cfg: params.cfg,
|
|
37924
38249
|
channel,
|
|
@@ -39347,7 +39672,7 @@ function createWhatsAppLoginTool() {
|
|
|
39347
39672
|
force: Type.Optional(Type.Boolean())
|
|
39348
39673
|
}),
|
|
39349
39674
|
execute: async (_toolCallId, args) => {
|
|
39350
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
39675
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-OUAGpDsU.js");
|
|
39351
39676
|
if ((args?.action ?? "start") === "wait") {
|
|
39352
39677
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
39353
39678
|
return {
|
|
@@ -40277,23 +40602,23 @@ let webLoginQrPromise = null;
|
|
|
40277
40602
|
let webChannelPromise = null;
|
|
40278
40603
|
let whatsappActionsPromise = null;
|
|
40279
40604
|
function loadWebOutbound() {
|
|
40280
|
-
webOutboundPromise ??= import("./outbound-
|
|
40605
|
+
webOutboundPromise ??= import("./outbound-Bmft-5um.js").then((n) => n.t);
|
|
40281
40606
|
return webOutboundPromise;
|
|
40282
40607
|
}
|
|
40283
40608
|
function loadWebLogin() {
|
|
40284
|
-
webLoginPromise ??= import("./login-
|
|
40609
|
+
webLoginPromise ??= import("./login-DKkQ3Czu.js").then((n) => n.n);
|
|
40285
40610
|
return webLoginPromise;
|
|
40286
40611
|
}
|
|
40287
40612
|
function loadWebLoginQr() {
|
|
40288
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
40613
|
+
webLoginQrPromise ??= import("./login-qr-OUAGpDsU.js");
|
|
40289
40614
|
return webLoginQrPromise;
|
|
40290
40615
|
}
|
|
40291
40616
|
function loadWebChannel() {
|
|
40292
|
-
webChannelPromise ??= import("./web-
|
|
40617
|
+
webChannelPromise ??= import("./web-so3pGceM.js");
|
|
40293
40618
|
return webChannelPromise;
|
|
40294
40619
|
}
|
|
40295
40620
|
function loadWhatsAppActions() {
|
|
40296
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
40621
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-Hr-W8vjY.js");
|
|
40297
40622
|
return whatsappActionsPromise;
|
|
40298
40623
|
}
|
|
40299
40624
|
function createPluginRuntime() {
|
|
@@ -42561,15 +42886,6 @@ function createAnimaCodingTools(options) {
|
|
|
42561
42886
|
|
|
42562
42887
|
//#endregion
|
|
42563
42888
|
//#region src/agents/gemini-direct-runner.ts
|
|
42564
|
-
/**
|
|
42565
|
-
* Gemini Direct API Runner
|
|
42566
|
-
*
|
|
42567
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
42568
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
42569
|
-
*
|
|
42570
|
-
* This runner is automatically used when a google API key is available
|
|
42571
|
-
* and the provider is set to "google" or "gemini".
|
|
42572
|
-
*/
|
|
42573
42889
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
42574
42890
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
42575
42891
|
const MODEL_MAP = {
|
|
@@ -42661,7 +42977,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42661
42977
|
cwd: process.cwd(),
|
|
42662
42978
|
moduleUrl: import.meta.url
|
|
42663
42979
|
});
|
|
42664
|
-
const extraSystemPrompt =
|
|
42980
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
42665
42981
|
const systemPrompt = buildSystemPrompt({
|
|
42666
42982
|
workspaceDir,
|
|
42667
42983
|
config: params.config,
|
|
@@ -42740,7 +43056,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
42740
43056
|
};
|
|
42741
43057
|
}
|
|
42742
43058
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
42743
|
-
await params.onAssistantMessageStart?.();
|
|
42744
43059
|
const bodyStream = Readable.fromWeb(response.body);
|
|
42745
43060
|
let buffer = "";
|
|
42746
43061
|
let chunkAssistantText = "";
|
|
@@ -42766,12 +43081,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
42766
43081
|
nonTextParts.push(p);
|
|
42767
43082
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
42768
43083
|
}
|
|
42769
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
42770
43084
|
if (parsed.usageMetadata) {
|
|
42771
43085
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
42772
43086
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
42773
43087
|
}
|
|
42774
|
-
} catch
|
|
43088
|
+
} catch {}
|
|
42775
43089
|
}
|
|
42776
43090
|
}
|
|
42777
43091
|
if (functionCalls.length > 0) {
|
|
@@ -42831,7 +43145,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42831
43145
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
42832
43146
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
42833
43147
|
return {
|
|
42834
|
-
status: "failed",
|
|
43148
|
+
status: isAbort ? "timeout" : "failed",
|
|
42835
43149
|
meta: {
|
|
42836
43150
|
durationMs: Date.now() - started,
|
|
42837
43151
|
error: {
|
|
@@ -42868,7 +43182,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42868
43182
|
}
|
|
42869
43183
|
|
|
42870
43184
|
//#endregion
|
|
42871
|
-
//#region src/agents/
|
|
43185
|
+
//#region src/agents/noxsoft-runner.ts
|
|
42872
43186
|
function normalizeEmbeddedProvider(provider) {
|
|
42873
43187
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
42874
43188
|
}
|
|
@@ -42889,178 +43203,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
42889
43203
|
data
|
|
42890
43204
|
});
|
|
42891
43205
|
}
|
|
42892
|
-
|
|
42893
|
-
|
|
42894
|
-
if (
|
|
43206
|
+
function resolveDirectAuthProvider(provider) {
|
|
43207
|
+
if (provider === "anthropic" || provider === "claude") return "anthropic";
|
|
43208
|
+
if (provider === "google" || provider === "gemini") return "google";
|
|
43209
|
+
return null;
|
|
43210
|
+
}
|
|
43211
|
+
function resolveProfileFailureReason(result) {
|
|
43212
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43213
|
+
if (kind === "auth") return "auth";
|
|
43214
|
+
if (kind === "rate_limit") return "rate_limit";
|
|
43215
|
+
const classified = classifyFailoverReason(result.meta.error?.message ?? "");
|
|
43216
|
+
if (classified === "billing") return "billing";
|
|
43217
|
+
if (classified === "auth") return "auth";
|
|
43218
|
+
if (classified === "rate_limit") return "rate_limit";
|
|
43219
|
+
}
|
|
43220
|
+
function resolveResultErrorKind(result) {
|
|
43221
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43222
|
+
if (kind) return kind;
|
|
43223
|
+
return result.status === "timeout" ? "timeout" : "unknown";
|
|
43224
|
+
}
|
|
43225
|
+
function normalizeResultStatus(result) {
|
|
43226
|
+
const kind = resolveResultErrorKind(result);
|
|
43227
|
+
if (result.status === "timeout" || kind === "timeout") return "timeout";
|
|
43228
|
+
return result.status;
|
|
43229
|
+
}
|
|
43230
|
+
function normalizeResultPayloads(result) {
|
|
43231
|
+
const payloads = result.payloads?.filter((payload) => payload && typeof payload === "object");
|
|
43232
|
+
if (payloads && payloads.length > 0) return payloads;
|
|
43233
|
+
const output = result.output?.trim();
|
|
43234
|
+
return output ? [{ text: output }] : void 0;
|
|
43235
|
+
}
|
|
43236
|
+
function normalizeResultOutput(result, payloads) {
|
|
43237
|
+
const directOutput = result.output?.trim();
|
|
43238
|
+
if (directOutput) return directOutput;
|
|
43239
|
+
return payloads?.find((payload) => payload.text?.trim())?.text?.trim() || void 0;
|
|
43240
|
+
}
|
|
43241
|
+
function normalizeRunnerResult(params) {
|
|
43242
|
+
const payloads = normalizeResultPayloads(params.result);
|
|
43243
|
+
const output = normalizeResultOutput(params.result, payloads);
|
|
43244
|
+
const usage = normalizeUsage(params.result.meta.agentMeta?.usage);
|
|
43245
|
+
const lastCallUsage = normalizeUsage(params.result.meta.agentMeta?.lastCallUsage);
|
|
43246
|
+
const promptTokens = params.result.meta.agentMeta?.promptTokens ?? derivePromptTokens(usage ?? lastCallUsage);
|
|
43247
|
+
const status = normalizeResultStatus(params.result);
|
|
43248
|
+
const errorMessage = params.result.meta.error?.message?.trim();
|
|
43249
|
+
const errorKind = resolveResultErrorKind(params.result);
|
|
43250
|
+
return {
|
|
43251
|
+
...params.result,
|
|
43252
|
+
status,
|
|
43253
|
+
output,
|
|
43254
|
+
payloads,
|
|
43255
|
+
meta: {
|
|
43256
|
+
...params.result.meta,
|
|
43257
|
+
error: status === "completed" && !errorMessage ? void 0 : {
|
|
43258
|
+
message: errorMessage || (status === "timeout" ? "Request timed out." : "Runner execution failed."),
|
|
43259
|
+
kind: errorKind
|
|
43260
|
+
},
|
|
43261
|
+
agentMeta: {
|
|
43262
|
+
...params.result.meta.agentMeta,
|
|
43263
|
+
sessionId: params.result.meta.agentMeta?.sessionId?.trim() || params.sessionId,
|
|
43264
|
+
provider: params.provider,
|
|
43265
|
+
model: params.model ?? params.result.meta.agentMeta?.model,
|
|
43266
|
+
usage,
|
|
43267
|
+
promptTokens,
|
|
43268
|
+
lastCallUsage
|
|
43269
|
+
}
|
|
43270
|
+
}
|
|
43271
|
+
};
|
|
43272
|
+
}
|
|
43273
|
+
function coerceResultFailure(params) {
|
|
43274
|
+
if (params.result.status === "completed") return null;
|
|
43275
|
+
const message = params.result.meta.error?.message?.trim() || (params.result.status === "timeout" ? "Request timed out." : "Runner execution failed.");
|
|
43276
|
+
const reason = classifyFailoverReason(message) ?? resolveResultErrorKind(params.result);
|
|
43277
|
+
return new FailoverError(message, {
|
|
43278
|
+
reason: reason === "timeout" ? "timeout" : reason,
|
|
43279
|
+
provider: params.provider,
|
|
43280
|
+
model: params.model,
|
|
43281
|
+
status: resolveFailoverStatus(reason)
|
|
43282
|
+
});
|
|
43283
|
+
}
|
|
43284
|
+
async function resolveDirectProviderAuth(params) {
|
|
43285
|
+
return resolveApiKeyForProvider({
|
|
43286
|
+
provider: params.provider,
|
|
43287
|
+
cfg: params.config,
|
|
43288
|
+
preferredProfile: params.preferredProfile,
|
|
43289
|
+
agentDir: params.agentDir,
|
|
43290
|
+
store: params.store
|
|
43291
|
+
});
|
|
43292
|
+
}
|
|
43293
|
+
async function runDirectWithProfileFallback(params) {
|
|
43294
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
43295
|
+
const attemptedAuthSources = /* @__PURE__ */ new Set();
|
|
43296
|
+
let preferredProfile = params.authProfileId;
|
|
43297
|
+
let lastResult = null;
|
|
43298
|
+
for (;;) {
|
|
43299
|
+
const auth = await resolveDirectProviderAuth({
|
|
43300
|
+
provider: params.directProvider,
|
|
43301
|
+
config: params.config,
|
|
43302
|
+
agentDir: params.agentDir,
|
|
43303
|
+
preferredProfile,
|
|
43304
|
+
store
|
|
43305
|
+
});
|
|
43306
|
+
const authSourceKey = auth.profileId ?? `${auth.mode}:${auth.source}`;
|
|
43307
|
+
if (attemptedAuthSources.has(authSourceKey)) return lastResult ?? {
|
|
43308
|
+
status: "failed",
|
|
43309
|
+
meta: {
|
|
43310
|
+
durationMs: 0,
|
|
43311
|
+
error: {
|
|
43312
|
+
message: `Auth fallback loop detected for ${params.directProvider}.`,
|
|
43313
|
+
kind: "unknown"
|
|
43314
|
+
}
|
|
43315
|
+
}
|
|
43316
|
+
};
|
|
43317
|
+
attemptedAuthSources.add(authSourceKey);
|
|
43318
|
+
const result = params.directProvider === "anthropic" ? await runAnthropicDirectAgent({
|
|
43319
|
+
token: auth.apiKey ?? "",
|
|
43320
|
+
sessionId: params.sessionId,
|
|
43321
|
+
sessionKey: params.sessionKey,
|
|
43322
|
+
agentId: params.agentId,
|
|
43323
|
+
sessionFile: params.sessionFile,
|
|
43324
|
+
workspaceDir: params.workspaceDir,
|
|
43325
|
+
config: params.config,
|
|
43326
|
+
prompt: params.prompt,
|
|
43327
|
+
model: params.model,
|
|
43328
|
+
thinkLevel: params.thinkLevel,
|
|
43329
|
+
timeoutMs: params.timeoutMs,
|
|
43330
|
+
runId: params.runId,
|
|
43331
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43332
|
+
ownerNumbers: params.ownerNumbers,
|
|
43333
|
+
onPartialReply: params.emitPartial,
|
|
43334
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43335
|
+
}) : await runGeminiDirectAgent({
|
|
43336
|
+
apiKey: auth.apiKey ?? "",
|
|
43337
|
+
sessionId: params.sessionId,
|
|
43338
|
+
sessionKey: params.sessionKey,
|
|
43339
|
+
agentId: params.agentId,
|
|
43340
|
+
sessionFile: params.sessionFile,
|
|
43341
|
+
workspaceDir: params.workspaceDir,
|
|
43342
|
+
config: params.config,
|
|
43343
|
+
prompt: params.prompt,
|
|
43344
|
+
model: params.model,
|
|
43345
|
+
thinkLevel: params.thinkLevel,
|
|
43346
|
+
timeoutMs: params.timeoutMs,
|
|
43347
|
+
runId: params.runId,
|
|
43348
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43349
|
+
ownerNumbers: params.ownerNumbers,
|
|
43350
|
+
onPartialReply: params.emitPartial,
|
|
43351
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43352
|
+
});
|
|
43353
|
+
if (result.status === "completed") {
|
|
43354
|
+
if (auth.profileId) {
|
|
43355
|
+
await markAuthProfileUsed({
|
|
43356
|
+
store,
|
|
43357
|
+
profileId: auth.profileId,
|
|
43358
|
+
agentDir: params.agentDir
|
|
43359
|
+
});
|
|
43360
|
+
await markAuthProfileGood({
|
|
43361
|
+
store,
|
|
43362
|
+
provider: params.directProvider,
|
|
43363
|
+
profileId: auth.profileId,
|
|
43364
|
+
agentDir: params.agentDir
|
|
43365
|
+
});
|
|
43366
|
+
}
|
|
43367
|
+
return result;
|
|
43368
|
+
}
|
|
43369
|
+
lastResult = result;
|
|
43370
|
+
const failureReason = resolveProfileFailureReason(result);
|
|
43371
|
+
if (!auth.profileId || !failureReason) return result;
|
|
43372
|
+
await markAuthProfileFailure({
|
|
43373
|
+
store,
|
|
43374
|
+
profileId: auth.profileId,
|
|
43375
|
+
reason: failureReason,
|
|
43376
|
+
cfg: params.config,
|
|
43377
|
+
agentDir: params.agentDir
|
|
43378
|
+
});
|
|
43379
|
+
preferredProfile = void 0;
|
|
43380
|
+
}
|
|
43381
|
+
}
|
|
43382
|
+
async function resolveDirectStrategy(provider, config, agentDir) {
|
|
43383
|
+
const directProvider = resolveDirectAuthProvider(provider);
|
|
43384
|
+
if (!directProvider) return null;
|
|
43385
|
+
try {
|
|
43386
|
+
const auth = await resolveDirectProviderAuth({
|
|
43387
|
+
provider: directProvider,
|
|
43388
|
+
config,
|
|
43389
|
+
agentDir,
|
|
43390
|
+
store: ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false })
|
|
43391
|
+
});
|
|
43392
|
+
if (auth.apiKey) {
|
|
43393
|
+
if (directProvider === "anthropic" && auth.apiKey.startsWith("sk-ant-oat01-")) return null;
|
|
43394
|
+
return {
|
|
43395
|
+
kind: directProvider === "google" ? "gemini-direct" : "anthropic-direct",
|
|
43396
|
+
provider
|
|
43397
|
+
};
|
|
43398
|
+
}
|
|
43399
|
+
} catch {}
|
|
43400
|
+
return null;
|
|
43401
|
+
}
|
|
43402
|
+
async function resolveNoxSoftRunnerStrategy(params) {
|
|
42895
43403
|
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43404
|
+
const direct = await resolveDirectStrategy(provider, params.config, params.agentDir);
|
|
43405
|
+
if (direct) return direct;
|
|
43406
|
+
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43407
|
+
if (!resolveCliBackendConfig(cliProvider, params.config)) throw new Error(`No CLI backend available for provider "${provider}" (resolved "${cliProvider}").\nEither:\n • Run: anima setup-token (set an Anthropic API key — no CLI needed)\n • Install the matching CLI and log in`);
|
|
43408
|
+
return {
|
|
43409
|
+
kind: "cli",
|
|
43410
|
+
provider,
|
|
43411
|
+
cliProvider
|
|
43412
|
+
};
|
|
43413
|
+
}
|
|
43414
|
+
async function runNoxSoftEmbeddedAgent(params) {
|
|
43415
|
+
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43416
|
+
const normalizedRequestedRef = params.model?.trim() ? normalizeModelRef(provider, params.model) : null;
|
|
42896
43417
|
const startedAt = Date.now();
|
|
42897
43418
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
42898
43419
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
42899
43420
|
let assistantStarted = false;
|
|
42900
43421
|
const streamTasks = [];
|
|
42901
|
-
|
|
42902
|
-
|
|
42903
|
-
|
|
42904
|
-
|
|
42905
|
-
|
|
42906
|
-
|
|
42907
|
-
|
|
42908
|
-
|
|
42909
|
-
|
|
42910
|
-
|
|
42911
|
-
|
|
42912
|
-
|
|
42913
|
-
|
|
42914
|
-
|
|
42915
|
-
|
|
42916
|
-
|
|
42917
|
-
|
|
42918
|
-
|
|
42919
|
-
|
|
42920
|
-
|
|
42921
|
-
|
|
43422
|
+
const emitPartial = async (payload) => {
|
|
43423
|
+
if (!assistantStarted) {
|
|
43424
|
+
assistantStarted = true;
|
|
43425
|
+
await params.onAssistantMessageStart?.();
|
|
43426
|
+
}
|
|
43427
|
+
await params.onPartialReply?.(payload);
|
|
43428
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
43429
|
+
};
|
|
43430
|
+
const strategy = await resolveNoxSoftRunnerStrategy({
|
|
43431
|
+
provider: params.provider,
|
|
43432
|
+
config: params.config,
|
|
43433
|
+
agentDir: params.agentDir
|
|
43434
|
+
});
|
|
43435
|
+
if (strategy.kind === "anthropic-direct") {
|
|
43436
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43437
|
+
phase: "start",
|
|
43438
|
+
startedAt
|
|
43439
|
+
});
|
|
43440
|
+
try {
|
|
43441
|
+
const result = normalizeRunnerResult({
|
|
43442
|
+
result: await runDirectWithProfileFallback({
|
|
43443
|
+
...params,
|
|
43444
|
+
directProvider: "anthropic",
|
|
42922
43445
|
timeoutMs,
|
|
42923
43446
|
runId,
|
|
42924
|
-
|
|
42925
|
-
|
|
42926
|
-
|
|
42927
|
-
|
|
42928
|
-
|
|
42929
|
-
|
|
42930
|
-
|
|
42931
|
-
|
|
42932
|
-
|
|
42933
|
-
|
|
42934
|
-
|
|
42935
|
-
|
|
42936
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42937
|
-
phase: "end",
|
|
42938
|
-
durationMs: Date.now() - startedAt,
|
|
42939
|
-
status: result.status
|
|
42940
|
-
});
|
|
42941
|
-
return result;
|
|
42942
|
-
} catch (err) {
|
|
43447
|
+
emitPartial
|
|
43448
|
+
}),
|
|
43449
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43450
|
+
model: normalizedRequestedRef?.model,
|
|
43451
|
+
sessionId: params.sessionId
|
|
43452
|
+
});
|
|
43453
|
+
const failure = coerceResultFailure({
|
|
43454
|
+
result,
|
|
43455
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43456
|
+
model: result.meta.agentMeta?.model
|
|
43457
|
+
});
|
|
43458
|
+
if (failure) {
|
|
42943
43459
|
await emitAgentEvent(params, "lifecycle", {
|
|
42944
43460
|
phase: "error",
|
|
42945
|
-
|
|
43461
|
+
startedAt,
|
|
43462
|
+
endedAt: Date.now(),
|
|
43463
|
+
error: failure.message,
|
|
43464
|
+
status: result.status
|
|
42946
43465
|
});
|
|
42947
|
-
throw
|
|
43466
|
+
throw failure;
|
|
42948
43467
|
}
|
|
42949
|
-
}
|
|
42950
|
-
}
|
|
42951
|
-
if (provider === "google" || provider === "gemini") {
|
|
42952
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
42953
|
-
provider: "google",
|
|
42954
|
-
cfg: params.config
|
|
42955
|
-
}))?.apiKey;
|
|
42956
|
-
if (geminiApiKey) {
|
|
42957
43468
|
await emitAgentEvent(params, "lifecycle", {
|
|
42958
|
-
phase: "
|
|
42959
|
-
startedAt
|
|
43469
|
+
phase: "end",
|
|
43470
|
+
durationMs: Date.now() - startedAt,
|
|
43471
|
+
status: result.status
|
|
42960
43472
|
});
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
|
|
42964
|
-
|
|
42965
|
-
|
|
42966
|
-
|
|
42967
|
-
|
|
42968
|
-
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42972
|
-
|
|
43473
|
+
return result;
|
|
43474
|
+
} catch (err) {
|
|
43475
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43476
|
+
phase: "error",
|
|
43477
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43478
|
+
});
|
|
43479
|
+
throw err;
|
|
43480
|
+
}
|
|
43481
|
+
}
|
|
43482
|
+
if (strategy.kind === "gemini-direct") {
|
|
43483
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43484
|
+
phase: "start",
|
|
43485
|
+
startedAt
|
|
43486
|
+
});
|
|
43487
|
+
try {
|
|
43488
|
+
const result = normalizeRunnerResult({
|
|
43489
|
+
result: await runDirectWithProfileFallback({
|
|
43490
|
+
...params,
|
|
43491
|
+
directProvider: "google",
|
|
42973
43492
|
timeoutMs,
|
|
42974
43493
|
runId,
|
|
42975
|
-
|
|
42976
|
-
|
|
42977
|
-
|
|
42978
|
-
|
|
42979
|
-
|
|
42980
|
-
|
|
42981
|
-
|
|
42982
|
-
|
|
42983
|
-
|
|
42984
|
-
|
|
42985
|
-
|
|
42986
|
-
|
|
42987
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42988
|
-
phase: "end",
|
|
42989
|
-
durationMs: Date.now() - startedAt,
|
|
42990
|
-
status: result.status
|
|
42991
|
-
});
|
|
42992
|
-
return result;
|
|
42993
|
-
} catch (err) {
|
|
43494
|
+
emitPartial
|
|
43495
|
+
}),
|
|
43496
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43497
|
+
model: normalizedRequestedRef?.model,
|
|
43498
|
+
sessionId: params.sessionId
|
|
43499
|
+
});
|
|
43500
|
+
const failure = coerceResultFailure({
|
|
43501
|
+
result,
|
|
43502
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43503
|
+
model: result.meta.agentMeta?.model
|
|
43504
|
+
});
|
|
43505
|
+
if (failure) {
|
|
42994
43506
|
await emitAgentEvent(params, "lifecycle", {
|
|
42995
43507
|
phase: "error",
|
|
42996
|
-
|
|
43508
|
+
startedAt,
|
|
43509
|
+
endedAt: Date.now(),
|
|
43510
|
+
error: failure.message,
|
|
43511
|
+
status: result.status
|
|
42997
43512
|
});
|
|
42998
|
-
throw
|
|
43513
|
+
throw failure;
|
|
42999
43514
|
}
|
|
43515
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43516
|
+
phase: "end",
|
|
43517
|
+
durationMs: Date.now() - startedAt,
|
|
43518
|
+
status: result.status
|
|
43519
|
+
});
|
|
43520
|
+
return result;
|
|
43521
|
+
} catch (err) {
|
|
43522
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43523
|
+
phase: "error",
|
|
43524
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43525
|
+
});
|
|
43526
|
+
throw err;
|
|
43000
43527
|
}
|
|
43001
43528
|
}
|
|
43002
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43003
|
-
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`);
|
|
43004
43529
|
await emitAgentEvent(params, "lifecycle", {
|
|
43005
43530
|
phase: "start",
|
|
43006
43531
|
startedAt
|
|
43007
43532
|
});
|
|
43008
43533
|
try {
|
|
43009
|
-
const result =
|
|
43010
|
-
|
|
43011
|
-
|
|
43012
|
-
|
|
43013
|
-
|
|
43014
|
-
|
|
43015
|
-
|
|
43016
|
-
|
|
43017
|
-
|
|
43018
|
-
|
|
43019
|
-
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43024
|
-
|
|
43025
|
-
|
|
43026
|
-
|
|
43027
|
-
|
|
43028
|
-
|
|
43029
|
-
|
|
43030
|
-
|
|
43031
|
-
|
|
43032
|
-
}
|
|
43033
|
-
|
|
43034
|
-
|
|
43035
|
-
|
|
43036
|
-
|
|
43037
|
-
|
|
43534
|
+
const result = normalizeRunnerResult({
|
|
43535
|
+
result: await runCliAgent({
|
|
43536
|
+
sessionId: params.sessionId,
|
|
43537
|
+
sessionKey: params.sessionKey,
|
|
43538
|
+
agentId: params.agentId,
|
|
43539
|
+
sessionFile: params.sessionFile,
|
|
43540
|
+
workspaceDir: params.workspaceDir,
|
|
43541
|
+
config: params.config,
|
|
43542
|
+
prompt: params.prompt,
|
|
43543
|
+
provider: strategy.cliProvider,
|
|
43544
|
+
model: params.model,
|
|
43545
|
+
thinkLevel: params.thinkLevel,
|
|
43546
|
+
timeoutMs,
|
|
43547
|
+
runId,
|
|
43548
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43549
|
+
ownerNumbers: params.ownerNumbers,
|
|
43550
|
+
cliSessionId: params.cliSessionId,
|
|
43551
|
+
sessionExecSecurity: params.execSecurity,
|
|
43552
|
+
images: params.images,
|
|
43553
|
+
streamParams: params.streamParams,
|
|
43554
|
+
onTextStream: (text) => {
|
|
43555
|
+
const nextText = text.trim();
|
|
43556
|
+
if (!nextText) return;
|
|
43557
|
+
streamTasks.push(emitPartial({ text: nextText }));
|
|
43558
|
+
}
|
|
43559
|
+
}),
|
|
43560
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43561
|
+
model: normalizedRequestedRef?.model,
|
|
43562
|
+
sessionId: params.sessionId
|
|
43038
43563
|
});
|
|
43039
43564
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
43040
43565
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
43041
|
-
if (finalText && !assistantStarted) {
|
|
43042
|
-
assistantStarted = true;
|
|
43043
|
-
await params.onAssistantMessageStart?.();
|
|
43044
|
-
await params.onPartialReply?.({ text: finalText });
|
|
43045
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
43046
|
-
}
|
|
43566
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
43047
43567
|
await emitAgentEvent(params, "lifecycle", {
|
|
43048
43568
|
phase: "end",
|
|
43049
43569
|
startedAt,
|
|
43050
43570
|
endedAt: Date.now(),
|
|
43051
|
-
aborted: false
|
|
43571
|
+
aborted: false,
|
|
43572
|
+
status: result.status
|
|
43052
43573
|
});
|
|
43053
|
-
return
|
|
43054
|
-
...result,
|
|
43055
|
-
meta: {
|
|
43056
|
-
...result.meta,
|
|
43057
|
-
agentMeta: {
|
|
43058
|
-
...result.meta.agentMeta,
|
|
43059
|
-
provider,
|
|
43060
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
43061
|
-
}
|
|
43062
|
-
}
|
|
43063
|
-
};
|
|
43574
|
+
return result;
|
|
43064
43575
|
} catch (error) {
|
|
43065
43576
|
const message = error instanceof Error ? error.message : String(error);
|
|
43066
43577
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -43072,6 +43583,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
43072
43583
|
throw error;
|
|
43073
43584
|
}
|
|
43074
43585
|
}
|
|
43586
|
+
|
|
43587
|
+
//#endregion
|
|
43588
|
+
//#region src/agents/pi-embedded.ts
|
|
43075
43589
|
async function compactEmbeddedPiSession(..._args) {
|
|
43076
43590
|
return {
|
|
43077
43591
|
ok: true,
|
|
@@ -43099,4 +43613,4 @@ async function waitForEmbeddedPiRunEnd(..._args) {
|
|
|
43099
43613
|
}
|
|
43100
43614
|
|
|
43101
43615
|
//#endregion
|
|
43102
|
-
export { resolveEffectiveMessagesConfig as $, applyVerboseOverride as A, shouldComputeCommandAuthorized as B, upsertChannelPairingRequest as C, lookupContextTokens as D, getSkillsSnapshotVersion as E, createInboundDebouncer as F, resolveAgentTimeoutMs as G, buildMentionRegexes as H, resolveInboundDebounceMs as I, extractShortModelName as J, AGENT_LANE_NESTED as K, formatInboundEnvelope as L, loadModelCatalog as M, registerUnhandledRejectionHandler as N, clearSessionAuthProfileOverride as O, finalizeInboundContext as P, hasInterSessionUserProvenance as Q, resolveEnvelopeFormatOptions as R, readChannelAllowFromStore as S, getRemoteSkillEligibility as T, normalizeMentionText as U, CURRENT_MESSAGE_MARKER as V, subagent_registry_exports as W, emitAgentEvent$1 as X, clearAgentRunContext as Y, registerAgentRunContext as Z, normalizeGroupActivation as _, resolveChannelGroupRequireMention as a, hasNonzeroUsage as b, createDedupeCache as c, setCliSessionId as d, resolveIdentityName as et, buildAgentSessionKey as f, runWithModelFallback as g, resolveSessionDeliveryTarget as h, resolveChannelGroupPolicy as i, enqueueSystemEvent as j, applyModelOverrideToSessionEntry as k, getReplyFromConfig as l, resolveOutboundTarget as m, buildPairingReply as n, resolveMessagePrefix as nt, shouldAckReactionForWhatsApp as o, resolveAgentRoute as p, AGENT_LANE_SUBAGENT as q, recordChannelActivity as r,
|
|
43616
|
+
export { resolveEffectiveMessagesConfig as $, applyVerboseOverride as A, shouldComputeCommandAuthorized as B, upsertChannelPairingRequest as C, lookupContextTokens as D, getSkillsSnapshotVersion as E, createInboundDebouncer as F, resolveAgentTimeoutMs as G, buildMentionRegexes as H, resolveInboundDebounceMs as I, extractShortModelName as J, AGENT_LANE_NESTED as K, formatInboundEnvelope as L, loadModelCatalog as M, registerUnhandledRejectionHandler as N, clearSessionAuthProfileOverride as O, finalizeInboundContext as P, hasInterSessionUserProvenance as Q, resolveEnvelopeFormatOptions as R, readChannelAllowFromStore as S, getRemoteSkillEligibility as T, normalizeMentionText as U, CURRENT_MESSAGE_MARKER as V, subagent_registry_exports as W, emitAgentEvent$1 as X, clearAgentRunContext as Y, registerAgentRunContext as Z, normalizeGroupActivation as _, resolveChannelGroupRequireMention as a, hasNonzeroUsage as b, createDedupeCache as c, setCliSessionId as d, resolveIdentityName as et, buildAgentSessionKey as f, runWithModelFallback as g, resolveSessionDeliveryTarget as h, resolveChannelGroupPolicy as i, enqueueSystemEvent as j, applyModelOverrideToSessionEntry as k, getReplyFromConfig as l, resolveOutboundTarget as m, buildPairingReply as n, resolveMessagePrefix as nt, shouldAckReactionForWhatsApp as o, resolveAgentRoute as p, AGENT_LANE_SUBAGENT as q, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s, runNoxSoftEmbeddedAgent as t, resolveIdentityNamePrefix as tt, getCliSessionId as u, parseActivationCommand as v, resolveSendPolicy as w, formatDurationPrecise as x, deriveSessionTotalTokens as y, hasControlCommand as z };
|