@noxsoft/anima 5.1.2 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/dist/{APEv2Parser-DV7AH14P.js → APEv2Parser-Dvsbp_2R.js} +3 -3
- package/dist/{AbstractID3Parser-C3RlCr-Y.js → AbstractID3Parser-IB9gxozg.js} +5 -5
- package/dist/{AiffParser-DaFyNU8n.js → AiffParser-R2IhrBzL.js} +4 -4
- package/dist/{AsfParser-CDCRfCXr.js → AsfParser-DJEueUMg.js} +4 -4
- package/dist/{DsdiffParser-BX31LICZ.js → DsdiffParser-DXLYn9tT.js} +4 -4
- package/dist/{DsfParser-C3JBjE-C.js → DsfParser-D2--NF0i.js} +5 -5
- package/dist/{FlacParser-DY4m-7v1.js → FlacParser-8cDAjrth.js} +5 -5
- package/dist/{ID3v1Parser-DL9AGlNt.js → ID3v1Parser-B494XuP9.js} +3 -3
- package/dist/{ID3v2Parser-Mr8o-5GJ.js → ID3v2Parser-DlxcNqv5.js} +4 -4
- package/dist/{ID3v2Token-DQqGh8AB.js → ID3v2Token-CSLSVrSQ.js} +2 -2
- package/dist/{MP4Parser-DkunlEqI.js → MP4Parser-COql2J-w.js} +6 -6
- package/dist/{MatroskaParser-IKjHx0h7.js → MatroskaParser-bNP5wC2F.js} +3 -3
- package/dist/{MpegParser-EecSeRWJ.js → MpegParser-C1gjfYqq.js} +4 -4
- package/dist/{MusepackParser-CkfsAeuE.js → MusepackParser-DBdYf7kV.js} +5 -5
- package/dist/{OggParser-z3QlSd8U.js → OggParser-CxajqbK3.js} +5 -5
- package/dist/{Util-DDVY6AaC.js → Util-BRZxoY1Q.js} +1 -1
- package/dist/{WavPackParser-PimUUBRx.js → WavPackParser-CtH9QFia.js} +4 -4
- package/dist/{WaveParser-B539YtoQ.js → WaveParser-yufLki1G.js} +5 -5
- package/dist/{accounts-CL0JV_xk.js → accounts-B_2nt5Cd.js} +2 -2
- package/dist/{accounts-CYEa4ttU.js → accounts-COxGcLGB.js} +1 -1
- package/dist/{accounts-Bj5MvaDs.js → accounts-DIES085e.js} +11 -11
- package/dist/{accounts-DZsqyow2.js → accounts-TUsfghIW.js} +38 -38
- package/dist/{acp-cli-ynoZZhYQ.js → acp-cli-CWgqDQQH.js} +6 -6
- package/dist/{acp-cli-BFAoKBvs.js → acp-cli-D0wfP8-l.js} +16 -16
- package/dist/{active-listener-BWPgtTZp.js → active-listener-BKtsWhsb.js} +4 -4
- package/dist/{active-listener-GJR3nLhX.js → active-listener-D2r8IO7g.js} +5 -5
- package/dist/{agent-DUAarfNl.js → agent-CnS0SRpT.js} +93 -236
- package/dist/{agent-CaaEZsXl.js → agent-VRQM14Xp.js} +98 -229
- package/dist/{agent-scope-C9CiVcmh.js → agent-scope-ByIGrCTT.js} +2 -2
- package/dist/{agent-scope-D3HZp64M.js → agent-scope-CXxC8FFX.js} +2 -2
- package/dist/{agent-scope-BZ8hjIt_.js → agent-scope-CxBzAozu.js} +3 -3
- package/dist/{agents-t54YcbvK.js → agents-CvMRplDx.js} +15 -13
- package/dist/{agents.config-J7iEgdW_.js → agents.config-BR5JLtud.js} +1 -1
- package/dist/{anthropic-direct-runner-B12V2Q5H.js → anthropic-direct-runner-BeYCnvZ8.js} +37 -15
- package/dist/{anthropic-direct-runner-CzQb7QkD.js → anthropic-direct-runner-C2Kwju-r.js} +29 -7
- package/dist/{audit-ByHmjh-G.js → audit-B05W5ckN.js} +23 -34
- package/dist/{audit-HJOpXfgY.js → audit-DDz7UOIx.js} +18 -15
- package/dist/{auth-DXrALxdm.js → auth-DsC5pZ_0.js} +2 -2
- package/dist/{prompts-CneQ6SeF.js → auth-choice-DY1saszS.js} +12 -107
- package/dist/{auth-choice-DPWnLV_w.js → auth-choice-Dc5TAJwT.js} +10 -9
- package/dist/{auth-health-DmrnGklu.js → auth-health-Cc8-vy8y.js} +1 -1
- package/dist/auth-health-Dhr8p2SD.js +149 -0
- package/dist/{auth-profiles-BF5x9Ej0.js → auth-profiles-Brxz2ojJ.js} +193 -42
- package/dist/{auth-profiles-DjCH4kWT.js → auth-profiles-C-LuhW6c.js} +195 -44
- package/dist/{auth-profiles-PJVsRqf4.js → auth-profiles-DKu7ZUzl.js} +189 -29
- package/dist/{auth-profiles-eZzmaeR3.js → auth-profiles-DtWUl1-k.js} +198 -38
- package/dist/{auth-store-CnRrUELz.js → auth-store-Bd0GoqEL.js} +13 -13
- package/dist/{auth-store-KnWGteIV.js → auth-store-BpYI9t_y.js} +3 -3
- package/dist/{auth-store-DjcQlyze.js → auth-store-Jvgz2_l1.js} +2 -2
- package/dist/{banner-D9JyV5SF.js → banner-DAMtSjUF.js} +1 -1
- package/dist/{bonjour-discovery-QsoaZ8Pr.js → bonjour-discovery-Co-b97Dz.js} +2 -2
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +222 -151
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +24 -24
- package/dist/{call-DHZ76BNg.js → call-B4lhqS6H.js} +3 -3
- package/dist/{call-DQjoz63V.js → call-CDPbPDAr.js} +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +18967 -16484
- package/dist/{catalog-AZNRamJ4.js → catalog-CsXv59Tq.js} +2 -2
- package/dist/{channel-web-CQIbtfme.js → channel-web-B8mzTSaY.js} +15 -15
- package/dist/{channels-status-issues-DdjvFHx9.js → channels-status-issues-WkG3Tmxk.js} +4 -4
- package/dist/{chrome-HTuFjVWW.js → chrome-B8EnYGj1.js} +9 -9
- package/dist/{chrome-BNggURXT.js → chrome-BaU-H9m7.js} +3 -3
- package/dist/{chrome-Cfak4A3i.js → chrome-DLUBPBPz.js} +12 -12
- package/dist/{chunk-CyT-_QsQ.js → chunk-B4Kx-ocg.js} +11 -9
- package/dist/{chunk-Dffz_QIs.js → chunk-CFSle8n5.js} +1 -1
- package/dist/{chunk-D3vyM2EQ.js → chunk-Cy0Bj0F3.js} +1 -1
- package/dist/{chunk-DFqo_u5A.js → chunk-DJXDX69U.js} +11 -9
- package/dist/{clack-prompter-QbDK4ABC.js → clack-prompter-0JW5kry0.js} +3 -3
- package/dist/{clack-prompter-rXuqdPbx.js → clack-prompter-fZSmnHda.js} +5 -5
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-kT9Mb3dT.js → cli-D8exVpuI.js} +30 -29
- package/dist/cli-hcHk5KuP.js +102 -0
- package/dist/{cli-utils-BdkJVXjy.js → cli-utils-D2X_bDLt.js} +9 -1
- package/dist/{cli-utils-DGnL8raH.js → cli-utils-DcDBK4C5.js} +9 -1
- package/dist/{client-D9E5Wwb_.js → client-BWkoTfOH.js} +3 -2
- package/dist/{client-DzIcZx4J.js → client-CfLiulzK.js} +2 -1
- package/dist/{command-registry-vEVxxxzI.js → command-registry-D3VhxpWx.js} +21 -12
- package/dist/{commands-NIY0IDXe.js → commands-DE8FNH0v.js} +92 -20
- package/dist/{commands-eY0Ao0wt.js → commands-Mekaw9WG.js} +92 -20
- package/dist/{common-C2wAYEWA.js → common-BCW6hLGI.js} +2 -2
- package/dist/{common-BzPvZcxT.js → common-Bf_TG87Y.js} +2 -2
- package/dist/{common-6Fcbzr42.js → common-DT_obM-k.js} +2 -2
- package/dist/{completion-cli-BBKG6buM.js → completion-cli-B3BqQJq9.js} +3 -3
- package/dist/{completion-cli-C84I5l8a.js → completion-cli-CepDzeW1.js} +2 -2
- package/dist/{config-Ofh9gKvs.js → config-BrVuTQ8R.js} +14 -2
- package/dist/{config-6FVC8hW0.js → config-CweTwOtr.js} +40 -28
- package/dist/{config-DqwH4y-D.js → config-DaD4FsAn.js} +19 -7
- package/dist/{config-D2kCn7yR.js → config-ZYN8tezd.js} +18 -6
- package/dist/{config-cli-CQzq5yWB.js → config-cli-3CaIxSKo.js} +4 -4
- package/dist/config-cli-B6Np85rk.js +15 -0
- package/dist/{config-guard-B1plY6aQ.js → config-guard-C4b2dksv.js} +2 -2
- package/dist/{config-guard-CYlpjNN7.js → config-guard-CWhoBtB3.js} +20 -20
- package/dist/{config-sync-CYX9Tzyr.js → config-sync-CCVp-tVX.js} +2 -2
- package/dist/{config-sync-CDUhjDom.js → config-sync-CMO_5lyl.js} +2 -2
- package/dist/{configure-G6h2Ppk0.js → configure-D882Bg7c.js} +39 -15
- package/dist/{configure-Bv6mqD0j.js → configure-D88dg6mE.js} +79 -77
- package/dist/{configure-DxQqSUJs.js → configure-xpjwedvJ.js} +50 -49
- package/dist/{configure-B-dfdPKX.js → configure-zXK6UZ51.js} +49 -24
- package/dist/{context-CpsnZLOp.js → context-B5X720Bs.js} +1 -1
- package/dist/{control-service-D1oxSXVg.js → control-service-3CI4vt1h.js} +2 -2
- package/dist/{control-service-CzAfyR4e.js → control-service-5YtMvm7D.js} +5 -5
- package/dist/control-ui/assets/index-Bwcvc7fq.css +1 -0
- package/dist/control-ui/assets/index-CBUvF5Mp.js +72 -0
- package/dist/control-ui/assets/index-CBUvF5Mp.js.map +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-DVpMpG5G.js +2 -0
- package/dist/control-ui/assets/index-DVpMpG5G.js.map +1 -0
- package/dist/control-ui/assets/observers-CxfWf9RO.js +2 -0
- package/dist/control-ui/assets/observers-CxfWf9RO.js.map +1 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js +138 -0
- package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js.map +1 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js +129 -0
- package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/{cron-cli-C4qZZo4e.js → cron-cli-Cht6Itx6.js} +18 -18
- package/dist/{cron-cli-CSivg2i9.js → cron-cli-D9XrF-Gx.js} +8 -8
- package/dist/{daemon-cli-DfxT-pQ4.js → daemon-cli-9zrnYRjh.js} +8 -8
- package/dist/{daemon-cli-KMzjJH_D.js → daemon-cli-CrdPhSxr.js} +15 -15
- package/dist/daemon-cli.js +34 -6
- package/dist/{daemon-runtime-CIE27usH.js → daemon-runtime-BrUj88ZO.js} +2 -2
- package/dist/{daemon-runtime-BfgstLVI.js → daemon-runtime-DCqwraWR.js} +1 -1
- package/dist/{deliver-8r6UbXnC.js → deliver-B-dPbUIs.js} +18 -28
- package/dist/{deliver-ahx1N11n.js → deliver-BKzX3YoN.js} +7 -7
- package/dist/{deliver-DVt8TbK9.js → deliver-C1L5nO0K.js} +3 -3
- package/dist/{deliver-D2hQZ9X0.js → deliver-d-CaN0uL.js} +59 -69
- package/dist/deps-DyT32VfN.js +23 -0
- package/dist/{diagnostics-DXeDqA_-.js → diagnostics-Cu9pZAFn.js} +1 -1
- package/dist/{dispatcher-DpSnqIL0.js → dispatcher-BQQugU-7.js} +1 -1
- package/dist/{dispatcher-DzT6jltc.js → dispatcher-DzwzLQRk.js} +2 -2
- package/dist/{dns-cli-D9ka2fZD.js → dns-cli-C8KIX4P3.js} +12 -12
- package/dist/{dns-cli-D2Orvc8E.js → dns-cli-V2bo6vSt.js} +3 -3
- package/dist/{docs-cli-CKfzGqYM.js → docs-cli-Bt-YV3xs.js} +2 -2
- package/dist/{docs-cli-DWYXJd-j.js → docs-cli-D2cVJxjP.js} +7 -7
- package/dist/{doctor-vXt5qjNJ.js → doctor-DEnSKgHu.js} +21 -21
- package/dist/{doctor-DumyG85t.js → doctor-WpKCNZeO.js} +36 -181
- package/dist/{doctor-completion-lAyxyd7X.js → doctor-completion-CPff9UlF.js} +2 -2
- package/dist/{doctor-completion-C8JSWfqN.js → doctor-completion-CypXc1Uo.js} +2 -2
- package/dist/{doctor-config-flow-DA50eWp5.js → doctor-config-flow-Bgl0Cc20.js} +6 -6
- package/dist/{doctor-config-flow-BjfGQ1Br.js → doctor-config-flow-Dxy7RIm0.js} +4 -4
- package/dist/{engine-BVchKo5_.js → engine-DpbYPop7.js} +9 -9
- package/dist/{engine-CKqNpVwE.js → engine-zmn3SOYa.js} +10 -9
- package/dist/entry.js +19 -28
- package/dist/{env-DVJCc7dM.js → env-DlTia1B4.js} +1 -1
- package/dist/{exec-cazBMA02.js → exec-BylR5qWS.js} +1 -1
- package/dist/{exec-gKbUce2p.js → exec-C6tXfeqA.js} +1 -1
- package/dist/{exec-Bfd4ztFZ.js → exec-DUzVF5_D.js} +7 -7
- package/dist/{exec-approvals-cli-BPwW6GIK.js → exec-approvals-cli-CN2WeH7y.js} +20 -20
- package/dist/{exec-approvals-cli-6HndodnP.js → exec-approvals-cli-DYZVBnqS.js} +8 -8
- package/dist/extensionAPI.js +22 -22
- package/dist/format-BCAtE7cT.js +20 -0
- package/dist/{frontmatter-BP4GSt5L.js → frontmatter-Dsa7N963.js} +2 -2
- package/dist/{gateway-cli-CHhTweWb.js → gateway-cli-B_xsx5Nv.js} +104 -101
- package/dist/{gateway-cli-B60L2z4a.js → gateway-cli-D3VBOA_i.js} +69 -66
- package/dist/{gateway-rpc-CrSglZPE.js → gateway-rpc-Cj_h2sVM.js} +3 -3
- package/dist/{gateway-rpc-BtOX_e53.js → gateway-rpc-CnXMGsxp.js} +3 -3
- package/dist/{gmail-setup-utils-D2uUKNlF.js → gmail-setup-utils-DaJoXV_3.js} +3 -3
- package/dist/{health-BttJ1Qeh.js → health-C8KCBhuo.js} +8 -8
- package/dist/{health-D8fJ6U_k.js → health-CabOEPQ0.js} +13 -13
- package/dist/{health-format-CH6JWH45.js → health-format-D-JJ5_S4.js} +2 -2
- package/dist/{heartbeat-visibility-DcGQOTXe.js → heartbeat-visibility-BjYY-mKG.js} +1 -1
- package/dist/{heartbeat-visibility-B2MDtPTL.js → heartbeat-visibility-ZfNSbFcq.js} +1 -1
- package/dist/{help-format-7YidDC5Z.js → help-format-Dt-I_Mls.js} +1 -1
- package/dist/{hooks-cli-DRUryj5H.js → hooks-cli-Cs7GUa7G.js} +34 -33
- package/dist/{hooks-cli-BMZF6RF3.js → hooks-cli-DOs9WZ3K.js} +56 -55
- package/dist/{hooks-status-VvwKn90L.js → hooks-status-DdweuSIj.js} +4 -4
- package/dist/{image-ops-BUy__GHL.js → image-ops-Ct3GueyT.js} +1 -1
- package/dist/index.js +79 -71
- package/dist/{init-B8PBeUpi.js → init-CFndGgTJ.js} +1 -1
- package/dist/{init-DxkAVKP0.js → init-DkBwXNme.js} +1 -1
- package/dist/{installs-sayrGjx1.js → installs-Bi6UipiE.js} +6 -6
- package/dist/{installs-BcnNDR54.js → installs-a4Vz_J08.js} +3 -3
- package/dist/ipv4-DfMwLQ0d.js +14 -0
- package/dist/{lib-D4dE4_XZ.js → lib-6xd5SQjU.js} +20 -20
- package/dist/{lifecycle-core-BerWWP7p.js → lifecycle-core-B8PI1NZJ.js} +3 -3
- package/dist/{links-OhvsEkVw.js → links-DcilUrqq.js} +1 -1
- package/dist/llm-slug-generator.js +25 -25
- package/dist/{loader-CLNb0v_s.js → loader-Bw2wdN4l.js} +159 -3
- package/dist/{loader-Bww_qb65.js → loader-C87TLS4J.js} +159 -3
- package/dist/{logging-DhXRGHWg.js → logging-Chc1Sj6N.js} +1 -1
- package/dist/{login-BovU8kno.js → login-BHnvW9HA.js} +6 -6
- package/dist/{login-BPtmlRRv.js → login-BTOKtSQN.js} +5 -5
- package/dist/{login-C54B66KM.js → login-CrMpAZ0n.js} +4 -4
- package/dist/{login-C4mptULi.js → login-DKkQ3Czu.js} +5 -5
- package/dist/{login-qr-bim3Nkyu.js → login-qr-BGbHImRb.js} +8 -8
- package/dist/{login-qr-pFbvowe5.js → login-qr-CsAVGp00.js} +12 -12
- package/dist/{login-qr-657mh7cI.js → login-qr-DILcBA_q.js} +6 -6
- package/dist/{login-qr-BxNKHxcf.js → login-qr-OUAGpDsU.js} +10 -10
- package/dist/{logs-cli-CQStwrGd.js → logs-cli-Bc6IOyHA.js} +8 -8
- package/dist/{logs-cli-De79vyiP.js → logs-cli-BiAJbjnq.js} +15 -15
- package/dist/{manager-B043uMPT.js → manager-BYu34CX3.js} +12 -12
- package/dist/{manager-Cvmm95Pf.js → manager-C6L_DH0O.js} +2 -2
- package/dist/{manager-BtrVJ8Ve.js → manager-D8VCuzru.js} +9 -9
- package/dist/{manager-A3pC-CW-.js → manager-b_aZwo00.js} +16 -16
- package/dist/{manifest-registry-D-DOtLzo.js → manifest-registry-qF960vMH.js} +1 -1
- package/dist/{memory-cli-COl5xoIl.js → memory-cli-B0kKl-9T.js} +7 -7
- package/dist/{memory-cli-691NgCXx.js → memory-cli-DLtBA6r5.js} +11 -11
- package/dist/{message-channel-DZYYDt1_.js → message-channel-CMsexA3K.js} +9 -7
- package/dist/{message-channel-DdOBO6Qm.js → message-channel-DIHHKJhk.js} +8 -6
- package/dist/{migrate-DkBWjPPs.js → migrate-DuohB_ur.js} +3 -3
- package/dist/{migrate-BLjwxe9X.js → migrate-bgeTT_GR.js} +3 -3
- package/dist/{model-auth-DKhjNVHc.js → model-auth-CHB3EySM.js} +10 -5
- package/dist/{model-auth-CxAB4iZ0.js → model-auth-KpsOXKDc.js} +3 -3
- package/dist/model-param-b-C1QDqzQp.js +16 -0
- package/dist/{model-selection-BPkpXepz.js → model-selection-CLcoOT3e.js} +25 -7
- package/dist/{model-selection-wCaVeFbb.js → model-selection-CY6r_3wt.js} +25 -7
- package/dist/{model-selection-DFbDH9o2.js → model-selection-DcO3qJOu.js} +24 -6
- package/dist/{model-selection-BI8CKPwQ.js → model-selection-DjsJGv1R.js} +67 -8
- package/dist/models-BM2_NkMu.js +2707 -0
- package/dist/models-cli-BjY8wA-C.js +272 -0
- package/dist/models-cli-BpjeKsUz.js +2946 -0
- package/dist/{node-cli-Ajhng-5p.js → node-cli-BmuVEJ1C.js} +12 -12
- package/dist/{node-cli-t3N6HE9R.js → node-cli-DU_oREff.js} +27 -27
- package/dist/{node-service-4B-0AjmA.js → node-service-qZXF7T7A.js} +1 -1
- package/dist/{note-De2zPKl3.js → note-iMYVGjpA.js} +2 -2
- package/dist/noxsoft-bootstrap-C4dSx7K_.js +77 -0
- package/dist/noxsoft-bootstrap-CrlkSFzd.js +77 -0
- package/dist/{npm-registry-spec-CFp4OEe4.js → npm-registry-spec-Br4B4I_3.js} +2 -2
- package/dist/{npm-registry-spec-DVDcgWxm.js → npm-registry-spec-jf7Mowdn.js} +1 -1
- package/dist/{onboard-xSPFmM29.js → onboard-DM9gULJN.js} +24 -19
- package/dist/{onboard-i4CJtSb9.js → onboard-_-D81kAy.js} +19 -15
- package/dist/{onboard-channels-RsbA6EaD.js → onboard-channels-CtT-RN60.js} +8 -8
- package/dist/{onboard-channels-D6Gt3CsX.js → onboard-channels-UkphAdCy.js} +4 -4
- package/dist/{onboard-helpers-IeOtcIME.js → onboard-helpers-CFudIoX4.js} +3 -3
- package/dist/{onboard-helpers-DPqXrhma.js → onboard-helpers-CJ3HzoUO.js} +7 -7
- package/dist/{onboarding-CZBVMwFn.js → onboarding-BB9PteK8.js} +20 -17
- package/dist/{onboarding-Cao0a_Z1.js → onboarding-Djmm0PEM.js} +27 -23
- package/dist/{orchestrator-COMX8CF2.js → orchestrator-C1nWKIJS.js} +7 -3
- package/dist/{orchestrator-BLXpTTgr.js → orchestrator-C2ypFiPL.js} +6 -3
- package/dist/{outbound-DWfSyfZC.js → outbound-Bmft-5um.js} +4 -4
- package/dist/{outbound-Rs0fFC2g.js → outbound-C577aWZp.js} +1 -1
- package/dist/{outbound-DLCmFGfJ.js → outbound-DW2eod1S.js} +4 -4
- package/dist/{outbound-uxBpmALx.js → outbound-fPqdCDR4.js} +4 -4
- package/dist/outbound-send-deps-DVfWC4E8.js +14 -0
- package/dist/outbound-send-deps-T_FgdfgW.js +36 -0
- package/dist/{parse-timeout-DkOL1T_l.js → parse-timeout-C4WLf3Qy.js} +3 -3
- package/dist/{parse-timeout-DlU4ymhF.js → parse-timeout-D4UO8pY_.js} +1 -1
- package/dist/{path-env-CjpH-KWH.js → path-env-DLQPf9qj.js} +2 -2
- package/dist/{paths-D2eokayo.js → paths-B-AkG5FD.js} +3 -3
- package/dist/{paths-DQMKfv60.js → paths-CAQJvbeZ.js} +2 -2
- package/dist/{paths-Cwszsz1I.js → paths-Q6h5HODL.js} +2 -2
- package/dist/{pi-auth-json-BLdaEAx2.js → pi-auth-json-B_lKNFK6.js} +5 -5
- package/dist/{pi-auth-json-BH7uvkKr.js → pi-auth-json-BmdBnmlZ.js} +8 -9
- package/dist/{pi-auth-json-DjxzPUt3.js → pi-auth-json-DkYqdjrV.js} +2 -2
- package/dist/{pi-auth-json-smxh_Xud.js → pi-auth-json-WTvcP2gz.js} +9 -8
- package/dist/{pi-embedded-D4eEfxIU.js → pi-embedded-BMbtgOzv.js} +825 -319
- package/dist/{pi-embedded-DifnZvKk.js → pi-embedded-DfbM3fAT.js} +888 -382
- package/dist/{pi-embedded-helpers-B6wVA0hU.js → pi-embedded-helpers-BZ9GspxK.js} +1 -1
- package/dist/{pi-tools.policy-CDgjN_3f.js → pi-tools.policy-D2FusuQa.js} +3 -3
- package/dist/{pi-tools.policy-ox141hP6.js → pi-tools.policy-WdTAfqbV.js} +6 -6
- package/dist/{plugin-auto-enable-Mj7AnofW.js → plugin-auto-enable-CtYcdTju.js} +5 -5
- package/dist/{plugin-auto-enable-OqDAK-ap.js → plugin-auto-enable-DhuD30Je.js} +2 -2
- package/dist/{plugin-registry-CpXm8ADp.js → plugin-registry-DePMxn4z.js} +4 -4
- package/dist/{plugin-registry-CkZnT8Fb.js → plugin-registry-QTkplP4s.js} +2 -2
- package/dist/plugin-sdk/agents/cli-backends.d.ts +4 -1
- package/dist/plugin-sdk/agents/cli-credentials.d.ts +0 -10
- package/dist/plugin-sdk/agents/cli-runner.d.ts +2 -0
- package/dist/plugin-sdk/agents/defaults.d.ts +2 -2
- package/dist/plugin-sdk/agents/model-auto.d.ts +43 -0
- package/dist/plugin-sdk/agents/model-fallback.d.ts +5 -0
- package/dist/plugin-sdk/agents/model-preference.d.ts +25 -0
- package/dist/plugin-sdk/agents/noxsoft-runner.d.ts +94 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +6 -3
- package/dist/plugin-sdk/agents/pi-embedded.d.ts +6 -50
- package/dist/plugin-sdk/agents/runner-capabilities.d.ts +2 -0
- package/dist/plugin-sdk/agents/sandbox/constants.d.ts +1 -1
- package/dist/plugin-sdk/auth/noxsoft-auth.d.ts +55 -0
- package/dist/plugin-sdk/channels/registry.d.ts +2 -2
- package/dist/plugin-sdk/cli/deps.d.ts +2 -1
- package/dist/plugin-sdk/cli/outbound-send-deps.d.ts +10 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +14 -0
- package/dist/plugin-sdk/config/types.models.d.ts +1 -1
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +1 -0
- package/dist/plugin-sdk/identity/loader.d.ts +1 -0
- package/dist/plugin-sdk/identity/trust-graph.d.ts +32 -0
- package/dist/plugin-sdk/index.js +57 -47
- package/dist/plugin-sdk/utils/message-channel.d.ts +2 -1
- package/dist/{plugins-DnJgmFJR.js → plugins-DYcg0qBW.js} +1 -1
- package/dist/{plugins-cli-CrrkMAYM.js → plugins-cli-Bc9oU1ld.js} +58 -57
- package/dist/{plugins-cli-D4VxQKaJ.js → plugins-cli-Dv0KQTWo.js} +36 -35
- package/dist/{polls-DuwPgAV7.js → polls-DFISjV7H.js} +5 -5
- package/dist/{ports-B1b1r9Dz.js → ports-DaVrZDUq.js} +2 -2
- package/dist/{ports-BX00e96t.js → ports-q535r1PZ.js} +2 -2
- package/dist/{program-CTDFmZNx.js → program-CuwbF8YO.js} +48 -40
- package/dist/{program-context-Hl6bnPfB.js → program-context-CxPfy-Wr.js} +51 -35
- package/dist/{progress-B-VBLfHr.js → progress-CVLvQV_t.js} +1 -1
- package/dist/{prompt-style-DU9Vjqe5.js → prompt-style-BI53UVgE.js} +1 -1
- package/dist/{prompts-D6b3zLVO.js → prompts-BmgT_kkv.js} +33 -2
- package/dist/prompts-Bq4QGFQM.js +158 -0
- package/dist/{pw-ai-BV57RRmp.js → pw-ai-CB-zeR7h.js} +5 -5
- package/dist/{pw-ai-CY-VcqJp.js → pw-ai-C_1-7IgH.js} +4 -4
- package/dist/{pw-ai-CTHtrCEC.js → pw-ai-DxNrJcCA.js} +3 -3
- package/dist/{qmd-manager-DJeQYS-r.js → qmd-manager-C_XBZ_bT.js} +5 -5
- package/dist/{qmd-manager-CwbYv6nJ.js → qmd-manager-CpNYgSrx.js} +7 -7
- package/dist/{qmd-manager-Cbm03z8H.js → qmd-manager-Q0OSDQ-e.js} +5 -5
- package/dist/{register.agent-CMoYTJqj.js → register.agent-DFQmkIEH.js} +53 -50
- package/dist/{register.agent-BKINbWbs.js → register.agent-DUjwGw9d.js} +77 -73
- package/dist/{register.anima-BHrZ90Sv.js → register.anima-CRFHJu2J.js} +21 -21
- package/dist/{register.anima-CnEy5VFQ.js → register.anima-CtKNrpE8.js} +21 -21
- package/dist/{register.configure-Cv5NkGH2.js → register.configure-CSSN07XN.js} +50 -49
- package/dist/register.configure-CnEKV57N.js +107 -0
- package/dist/register.maintenance-CU1A-90-.js +102 -0
- package/dist/{register.maintenance-DtAw8E_a.js → register.maintenance-fhcCB7ih.js} +48 -47
- package/dist/register.message-C1a0y2ZR.js +661 -0
- package/dist/register.message-fM0jSKB8.js +659 -0
- package/dist/register.onboard-B7Gavmvt.js +128 -0
- package/dist/{register.onboard-U3lIfaw_.js → register.onboard-BhPlqjFi.js} +50 -49
- package/dist/{register.setup-CLkGhR-e.js → register.setup-0jPnMgnz.js} +96 -92
- package/dist/{register.setup-Dyp5L_GQ.js → register.setup-CADdQUEN.js} +72 -69
- package/dist/{register.status-health-sessions-Dx-qZMol.js → register.status-health-sessions-Cu5fDT-z.js} +68 -67
- package/dist/{register.status-health-sessions-Cc2Y5gSj.js → register.status-health-sessions-DdQsABr_.js} +40 -39
- package/dist/{register.subclis-L55mGheS.js → register.subclis-CZ91ufCy.js} +28 -21
- package/dist/{reply-BgPvB-gR.js → reply-DtHlnzOx.js} +6631 -6172
- package/dist/{reply-prefix-37W_P4kH.js → reply-prefix-C8dIgJur.js} +1 -1
- package/dist/{reply-prefix-DBRqtDEq.js → reply-prefix-DmWGtcH-.js} +1 -1
- package/dist/{routes-ZlpnlJFF.js → routes-CWCAc8uJ.js} +2 -2
- package/dist/{routes-DeDgHj5Y.js → routes-FT0Us8Md.js} +6 -6
- package/dist/{run-DEHnKm2x.js → run-Dfz_7j7t.js} +1256 -166
- package/dist/{run-BFPM6M2S.js → run-DqBQ-bGn.js} +1230 -140
- package/dist/{run-main-Cxmjk1SF.js → run-main-DGDW0fhx.js} +51 -50
- package/dist/{runtime-guard-cBL2D5J8.js → runtime-guard-D14Z_QY6.js} +1 -1
- package/dist/{sandbox-DDOFuJU9.js → sandbox-D-N7M7lp.js} +2 -2
- package/dist/{sandbox-cli-GhcxR1Va.js → sandbox-cli-CQKz2I1X.js} +9 -9
- package/dist/{sandbox-cli-CGJvhJ4L.js → sandbox-cli-DHNFlTo-.js} +23 -23
- package/dist/{sandbox-B8Nza4lP.js → sandbox-pBHlfFdB.js} +6 -6
- package/dist/{security-cli-B7VIDDSL.js → security-cli-Bdi7MuP6.js} +14 -22
- package/dist/{security-cli-gsyz4Wrw.js → security-cli-C3aI09uy.js} +27 -35
- package/dist/{semantic-C3Z-zhNi.js → semantic-9rgWUrz3.js} +1 -1
- package/dist/{semantic-CG6X3rBo.js → semantic-C1UN3bb9.js} +1 -1
- package/dist/{semantic-DCd6zBnV.js → semantic-CQApJNO_.js} +1 -1
- package/dist/{server-context-Dkz4Ce8z.js → server-context-Clykq0XU.js} +1 -1
- package/dist/{server-context-BlJi7pjP.js → server-context-Yx4pgBqJ.js} +7 -7
- package/dist/{server-node-events-DBOg36in.js → server-node-events-BR1aXVlu.js} +55 -53
- package/dist/{server-node-events-CmZXzWcd.js → server-node-events-Ca797E1d.js} +34 -31
- package/dist/{service-QlHhVsQf.js → service-Dd1DfPia.js} +1 -1
- package/dist/{service-audit-D4xG05j8.js → service-audit-Bwpoc2LD.js} +1 -1
- package/dist/{service-audit-BaoBb09i.js → service-audit-KzOtcw_V.js} +3 -3
- package/dist/{session-BJ9XCJBg.js → session-5YO_H-Ra.js} +1 -1
- package/dist/{session-3MLbl1-K.js → session-BiA6jrcs.js} +1 -1
- package/dist/session-C7IGnhd1.js +190 -0
- package/dist/{session-KNXzWBht.js → session-CSmfU0D3.js} +1 -1
- package/dist/{session-CqKJvPTq.js → session-DLevr8Vd.js} +5 -5
- package/dist/session-DfsMJNG3.js +190 -0
- package/dist/{session-TAOVpONo.js → session-FmXsucR7.js} +2 -2
- package/dist/{session-cost-usage-BamtB1rn.js → session-cost-usage-BWqR-ik6.js} +1 -1
- package/dist/{sessions-C2th3rm6.js → sessions-BOzeFzuL.js} +12 -22
- package/dist/{sessions-1XK2mH6L.js → sessions-C_3wTmSA.js} +9 -19
- package/dist/{sessions-BrQHxX_o.js → sessions-Dj7_4mkr.js} +4 -4
- package/dist/{settings-cli-CCtkuc1r.js → settings-cli-DxNeu6kx.js} +79 -77
- package/dist/{settings-cli-Ccizggz2.js → settings-cli-Dytfop1H.js} +50 -49
- package/dist/{setup-token-Dqtgnjxw.js → setup-token-B802CZwe.js} +13 -18
- package/dist/{setup-token-Bcer2kX8.js → setup-token-DYh2QzJ-.js} +29 -34
- package/dist/{shared-Hnu5dChj.js → shared-C-rqLtIT.js} +2 -2
- package/dist/{shell-env-KRrv3dPW.js → shell-env-CMI9f7-7.js} +1 -1
- package/dist/{shell-env-B4ae4lFh.js → shell-env-HkVWMh--.js} +1 -1
- package/dist/{shell-env-PnmcBTp4.js → shell-env-iPnSIi-t.js} +1 -1
- package/dist/{skills-CQoUYlGu.js → skills-4v6-kw0C.js} +3 -3
- package/dist/{skills-cli-DQuLxQUM.js → skills-cli-BoasNTpZ.js} +15 -15
- package/dist/{skills-cli-CNNy0FxN.js → skills-cli-TeAq3fRG.js} +3 -3
- package/dist/{skills-install-2DbC1Yo2.js → skills-install-D6_qpRjW.js} +7 -7
- package/dist/{skills-install-CE6djAWL.js → skills-install-Qw2oU8L8.js} +2 -2
- package/dist/{skills-status-ybjSmiHu.js → skills-status-CvH7AUoY.js} +4 -4
- package/dist/{soul-Bt57OdSx.js → soul-BiIdv3Wp.js} +125 -5
- package/dist/{soul-DFeEGG5h.js → soul-Bt8UNmTq.js} +126 -5
- package/dist/{soul-CwWWw7cs.js → soul-D9k5zulC.js} +2 -2
- package/dist/{soul-Bru-rRjk.js → soul-DQSYs-4l.js} +1 -1
- package/dist/{sqlite-BTcAhNls.js → sqlite-BMMt7osH.js} +2 -2
- package/dist/{sqlite-ClLAW1iQ.js → sqlite-CZ1vD4VS.js} +4 -4
- package/dist/{sqlite-CLZ1eR5Q.js → sqlite-CpAJt-JS.js} +1 -1
- package/dist/{start-DfC7PlAH.js → start-BqnPia0t.js} +66 -63
- package/dist/start-C3fuLzX0.js +157 -0
- package/dist/{status-BVAoIQ0V.js → status-CHGNPonc.js} +26 -44
- package/dist/{status-BU6h4wUP.js → status-CxF6k_jr.js} +2 -2
- package/dist/{status-C9B6cEM0.js → status-DfZJJqNs.js} +15 -15
- package/dist/{status-BaEcHPtc.js → status-tLgozFYL.js} +4 -4
- package/dist/{status.update-CbIRaeaV.js → status.update-B6Tdpk07.js} +2 -2
- package/dist/{status.update-CPACVnCc.js → status.update-E9dSFk_b.js} +1 -1
- package/dist/{subagent-registry-MZIxVf8W.js → subagent-registry-CPtElVX0.js} +807 -348
- package/dist/{subsystem-BMsbqSb4.js → subsystem-BAADN1B8.js} +18 -27
- package/dist/{subsystem-CucjNlOk.js → subsystem-D-Xta-sj.js} +17 -26
- package/dist/{subsystem-DA3Cno1i.js → subsystem-D1AJZPgG.js} +38 -47
- package/dist/{system-cli-BKicxULp.js → system-cli-CP7JrhR0.js} +15 -15
- package/dist/{system-cli-Unb-WFAR.js → system-cli-DoLzi2Sn.js} +8 -8
- package/dist/{systemd-5KGZ3NHE.js → systemd-Bx76sJ3M.js} +2 -2
- package/dist/{systemd-linger-B-uyzDap.js → systemd-linger-BVwGXVS0.js} +2 -2
- package/dist/{systemd-linger-CS_pA1-a.js → systemd-linger-CxGmIy_5.js} +1 -1
- package/dist/{table-CdHBo5d1.js → table-Blmz7glr.js} +2 -2
- package/dist/{tokens-DGhK0fpG.js → tokens-SP2Q7i59.js} +1 -1
- package/dist/{tool-images-DK97edts.js → tool-images-2qproko3.js} +2 -2
- package/dist/{tool-images-Dq55i0mz.js → tool-images-C6cKHTbj.js} +2 -2
- package/dist/{tool-images-J0rGmoDV.js → tool-images-CgDT0Xzv.js} +2 -2
- package/dist/{tui-Bm8FEW0b.js → tui-C2eLfbhA.js} +5 -5
- package/dist/{tui-cli-BGjsxGle.js → tui-cli-BgcbCtgc.js} +12 -12
- package/dist/{tui-cli-TwCYv-a7.js → tui-cli-cLSYBQu9.js} +27 -27
- package/dist/{tui-DtGKiHUr.js → tui-r4qpJhNk.js} +10 -10
- package/dist/{update-Dfi92PZJ.js → update-CqKpX3cX.js} +3 -3
- package/dist/{update-Dle5MRUz.js → update-DA91za97.js} +1 -1
- package/dist/{update-cli-QMVW2eiR.js → update-cli-BuCw75tM.js} +87 -85
- package/dist/{update-cli-D1e-DsWy.js → update-cli-C-er5av6.js} +55 -54
- package/dist/{update-runner-DPmSGXS3.js → update-runner-czCqHZCu.js} +5 -5
- package/dist/{update-runner-iLJQF6VA.js → update-runner-kE8AMQt4.js} +1 -1
- package/dist/{utils-B60lF9Wq.js → utils-CLYlhJuc.js} +1 -1
- package/dist/{web-DJRRkHG8.js → web-BHGK5GtV.js} +24 -24
- package/dist/web-CyYunanU.js +65 -0
- package/dist/{web-DDAkSrtZ.js → web-DvTXV-fo.js} +35 -34
- package/dist/{web-DBQRQY6n.js → web-so3pGceM.js} +27 -27
- package/dist/{webhooks-cli-Cg0F2mU6.js → webhooks-cli-k3QMf7Rs.js} +4 -4
- package/dist/{webhooks-cli-BsWx7MgH.js → webhooks-cli-vlEfXEKm.js} +12 -12
- package/dist/{whatsapp-actions-gpz6-vPI.js → whatsapp-actions-6fPRKwPV.js} +11 -11
- package/dist/{whatsapp-actions-DJpQVKnT.js → whatsapp-actions-BJn-z76S.js} +17 -17
- package/dist/{whatsapp-actions-tWRWRZ4X.js → whatsapp-actions-C0tlEdLy.js} +5 -5
- package/dist/{whatsapp-actions-CMEP8v3k.js → whatsapp-actions-Hr-W8vjY.js} +13 -13
- package/dist/{widearea-dns-BDtWuGCY.js → widearea-dns-CHAT20aR.js} +1 -1
- package/dist/{workspace-BQkffCaR.js → workspace-BFIZCnGo.js} +5 -5
- package/dist/{ws-log-Bc4grA6W.js → ws-log-CUobU2tD.js} +1 -1
- package/package.json +1 -1
- package/templates/profiles/nox.profile.json5 +5 -5
- package/dist/cli--Gal7v4I.js +0 -101
- package/dist/config-cli-cyvL43DG.js +0 -15
- package/dist/control-ui/assets/index-B7CJLRZD.css +0 -1
- package/dist/control-ui/assets/index-DLPYIcs0.js +0 -58
- package/dist/control-ui/assets/index-DLPYIcs0.js.map +0 -1
- package/dist/deps-CeyVMZf1.js +0 -13
- package/dist/models-ByeH7ZKb.js +0 -1350
- package/dist/register.configure-3GfqcGLK.js +0 -105
- package/dist/register.maintenance-YZDsMymb.js +0 -100
- package/dist/register.onboard-Dswys-iV.js +0 -126
- package/dist/start-BPye9w5U.js +0 -154
- package/dist/web-DE-hmqXy.js +0 -64
- /package/dist/{BasicParser-BiEpjka-.js → BasicParser-D4BHCxVb.js} +0 -0
- /package/dist/{agents.config-DibGEnBs.js → agents.config-Br4ULmK0.js} +0 -0
- /package/dist/{archive-BIKRyvqD.js → archive-CNqghdwQ.js} +0 -0
- /package/dist/{archive-5e-Ytlq-.js → archive-D-dHRz-v.js} +0 -0
- /package/dist/{argv-B6vsXQtF.js → argv-nNQ109_K.js} +0 -0
- /package/dist/{auth-store-Vfd6oc1G.js → auth-store-BEfSfCbW.js} +0 -0
- /package/dist/{auto-update-BUbllW1X.js → auto-update-Cvd8YJrT.js} +0 -0
- /package/dist/{auto-update-DdH8fo63.js → auto-update-DO4nHkfM.js} +0 -0
- /package/dist/{brew-Bkf_MwX9.js → brew-DHWnVWm3.js} +0 -0
- /package/dist/{budget-CV0a771W.js → budget-DvjICb0t.js} +0 -0
- /package/dist/{budget-GiXjG9eW.js → budget-e0R5xsU3.js} +0 -0
- /package/dist/{command-options-DfPEZwUK.js → command-options-DtJ8-EC7.js} +0 -0
- /package/dist/{command-options-mgpP-XId.js → command-options-eC-m_qJx.js} +0 -0
- /package/dist/{delivery-queue-DGnDKL02.js → delivery-queue-BKQk1j0k.js} +0 -0
- /package/dist/{delivery-queue-DZ_ibFDu.js → delivery-queue-CExaJXRz.js} +0 -0
- /package/dist/{display-BwSYYxVE.js → display-4p3-O9mP.js} +0 -0
- /package/dist/{display-Dck2kudh.js → display-Bo8pBhMp.js} +0 -0
- /package/dist/{exec-approvals-BJikgQkX.js → exec-approvals-DK5-KCUz.js} +0 -0
- /package/dist/{format-wiLVr0D3.js → format-9DMvWYUJ.js} +0 -0
- /package/dist/{format-duration-C5oKCGwB.js → format-duration-CnGkTPRF.js} +0 -0
- /package/dist/{gmail-setup-utils-CR33Gqfc.js → gmail-setup-utils-BIXtKTpT.js} +0 -0
- /package/dist/{help-format-DJx5Rwy2.js → help-format-ZKxl6UCb.js} +0 -0
- /package/dist/{helpers-8O7IVGO-.js → helpers-CWQnEONe.js} +0 -0
- /package/dist/{hooks-status-DiqubDlK.js → hooks-status-DqfJDvYl.js} +0 -0
- /package/dist/{ipv4-BYbwrpG-.js → ipv4-CExV55ho.js} +0 -0
- /package/dist/{is-main-BnikY3ud.js → is-main-H-hpHkdq.js} +0 -0
- /package/dist/{lib-D1DXSMt_.js → lib-D0_kW-B6.js} +0 -0
- /package/dist/{links-3c7gzW-G.js → links-BjjDMNIq.js} +0 -0
- /package/dist/{logging-Bpf6Cepz.js → logging-DWwOqnTW.js} +0 -0
- /package/dist/{logging-DcXIbpwk.js → logging-_rCcBkls.js} +0 -0
- /package/dist/{model-param-b-BcBBSgiD.js → model-param-b-2KmFir_0.js} +0 -0
- /package/dist/{node-service-BDlDNv3t.js → node-service-cOoW5hLa.js} +0 -0
- /package/dist/{note-BaOKDvcy.js → note-CeLGcHqv.js} +0 -0
- /package/dist/{noxsoft-auth-Bmict45b.js → noxsoft-auth-CE75mBXE.js} +0 -0
- /package/dist/{noxsoft-auth-DpwLJIW0.js → noxsoft-auth-CgCk5707.js} +0 -0
- /package/dist/{pi-model-discovery-ClWISQ3j.js → pi-model-discovery-Bu4Zr7nI.js} +0 -0
- /package/dist/{ports-aNJUI3Mi.js → ports-BGLuwt2Z.js} +0 -0
- /package/dist/{progress-Dj2aBWOI.js → progress-glCgu57m.js} +0 -0
- /package/dist/{qmd-manager-DrDX4o7e.js → qmd-manager-CO795NK4.js} +0 -0
- /package/dist/{queue-B77yV52t.js → queue-DDq0uzy5.js} +0 -0
- /package/dist/{queue-wFYwitx0.js → queue-DtQ5sbyD.js} +0 -0
- /package/dist/{registry-gaRST__4.js → registry-BvymIcVf.js} +0 -0
- /package/dist/{registry-Cv8RtADU.js → registry-DwaHkd_j.js} +0 -0
- /package/dist/{requirements-CEowKaVY.js → requirements-Ct4XnMiK.js} +0 -0
- /package/dist/{skill-scanner-DGoUYV22.js → skill-scanner-5_Y3u6SU.js} +0 -0
- /package/dist/{skill-scanner-FO7SyxAD.js → skill-scanner-Dld2ijVw.js} +0 -0
- /package/dist/{templates-D-h5PNIK.js → templates-4_And8I_.js} +0 -0
- /package/dist/{templates-ndPXOyGA.js → templates-5Z-UIDze.js} +0 -0
- /package/dist/{types-DSS9sywz.js → types-BQk_oAin.js} +0 -0
- /package/dist/{usage-format-BtlQ-77V.js → usage-format-BSa7cHyK.js} +0 -0
- /package/dist/{ws-log-BA9w1cJs.js → ws-log-CG6cvCZW.js} +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { n as __exportAll } from "./chunk-BXK9XSlF.js";
|
|
2
|
-
import { B as resolveRequiredHomeDir, C as colorize, E as getChildLogger, F as resolveOAuthDir, L as resolveStateDir, M as resolveConfigPath, P as resolveGatewayPort, T as theme, _ as logVerbose, a as unregisterActiveProgressLine, b as shouldLogVerbose, f as getActivePluginRegistry, i as registerActiveProgressLine, k as normalizeLogLevel, l as normalizeAnyChannelId, m as setActivePluginRegistry, n as defaultRuntime, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeChannelId, w as isRich, y as setVerbose } from "./subsystem-
|
|
3
|
-
import { A as classifySessionKeyShape, B as parseAgentSessionKey, D as buildAgentMainSessionKey, E as DEFAULT_MAIN_KEY, F as resolveThreadSessionKeys, I as sanitizeAgentId, L as getSubagentDepth, M as normalizeAgentId, N as normalizeMainKey, O as buildAgentPeerSessionKey, P as resolveAgentIdFromSessionKey, R as isAcpSessionKey, S as resolveAnimaPackageRoot, T as DEFAULT_AGENT_ID, V as resolveThreadParentSessionKey, b as filterBootstrapFilesForSession, c as resolveDefaultAgentId, f as DEFAULT_AGENT_WORKSPACE_DIR, i as resolveAgentModelFallbacksOverride, j as normalizeAccountId$1, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds, w as DEFAULT_ACCOUNT_ID, x as loadWorkspaceBootstrapFiles, y as ensureAgentWorkspace, z as isSubagentSessionKey } from "./agent-scope-
|
|
4
|
-
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-
|
|
5
|
-
import { a as modelKey, d as resolveModelRefFromString, f as resolveThinkingDefault, h as DEFAULT_PROVIDER, i as isCliProvider, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveDefaultModelForAgent } from "./model-selection-
|
|
6
|
-
import { $ as resolveChannelResetConfig, A as isContextOverflowError, At as resolveSandboxConfigForAgent, B as readSessionUpdatedAt, Bt as matchesAnyGlobPattern, C as normalizeThinkLevel, Ct as buildWorkspaceSkillSnapshot, D as supportsXHighThinking, Dt as resolveSandboxedMediaSource, E as resolveResponseUsageMode, Et as assertSandboxPath, F as ensureSandboxWorkspaceForSession, Ft as expandToolGroups, G as updateSessionStoreEntry, Gt as SILENT_REPLY_TOKEN, Ht as resolveBootstrapMaxChars, I as resolveSandboxRuntimeStatus, It as normalizeToolName, J as mergeDeliveryContext, K as deliveryContextFromSession, Kt as isSilentReplyText, L as extractDeliveryInfo, Lt as resolveToolProfilePolicy, M as isLikelyContextOverflowError, Mt as buildPluginToolGroups, N as isTransientHttpError, Nt as collectExplicitAllowlist, O as classifyFailoverReason, Ot as ensureBrowserControlAuth, P as sanitizeUserFacingText, Pt as expandPolicyWithPluginGroups, Q as evaluateSessionFreshness, R as appendAssistantMessageToSessionTranscript, Rt as stripPluginOnlyAllowlist, S as normalizeReasoningLevel, St as buildWorkspaceSkillCommandSpecs, T as normalizeVerboseLevel, Tt as assertMediaNotDataUrl, U as updateLastRoute, Ut as resolveBootstrapTotalMaxChars, V as recordSessionMetaFromInbound, Vt as buildBootstrapContextFiles, W as updateSessionStore, Wt as HEARTBEAT_TOKEN, X as normalizeSessionDeliveryFields, Y as normalizeDeliveryContext, Z as resolveSessionKey$1, _ as initializeGlobalHookRunner, _t as getMediaDir, a as applyReplyThreading, at as canonicalizeMainSessionAlias, b as listThinkingLevels, bt as resolvePathsWithinRoot, c as shouldSuppressMessagingToolReplies, ct as getChannelDock, d as buildTargetResolverSignature, dt as normalizeChatType, et as resolveSessionResetPolicy, f as normalizeChannelTargetInput, ft as resolveGroupSessionKey, g as getGlobalHookRunner, gt as resolveProfile, h as parseReplyDirectives, ht as resolveBrowserConfig, i as applyReplyTagsToPayload, it as resolveFreshSessionTotalTokens, j as isFailoverErrorMessage, jt as applyOwnerOnlyToolPolicy, k as isCompactionFailureError, kt as resolveBrowserControlAuth, l as createReplyToModeFilterForChannel, lt as listChannelDocks, m as throwIfAborted, mt as registerBrowserRoutes, nt as resolveThreadFlag, o as filterMessagingToolDuplicates, ot as resolveMainSessionKey, p as normalizeTargetForProvider, pt as createBrowserRouteContext, q as deliveryContextKey, r as normalizeReplyPayloadsForDelivery, rt as DEFAULT_RESET_TRIGGERS, s as isRenderablePayload, st as deriveSessionMetaPatch, t as deliverOutboundPayloads, tt as resolveSessionResetType, u as resolveReplyToMode, ut as resolveConversationLabel, v as formatThinkingLevels, vt as saveMediaBuffer, w as normalizeUsageDisplay, wt as resolvePluginSkillDirs, x as normalizeElevatedLevel, xt as getBridgeAuthForPort, y as formatXHighModelHint, yt as DEFAULT_UPLOAD_DIR, z as loadSessionStore, zt as compileGlobPatterns } from "./deliver-
|
|
7
|
-
import { C as parseConfigPath, E as VERSION, S as getConfigValueAtPath, T as unsetConfigValueAtPath, _ as resolveMemorySlotDecision, a as writeConfigFile, b as setConfigOverride, c as parseDurationMs, d as discoverAnimaPlugins, g as resolveEnableState, h as normalizePluginsConfig, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as applyTestPluginDefaults, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as getConfigOverrides, w as setConfigValueAtPath, x as unsetConfigOverride, y as resetConfigOverrides } from "./config-
|
|
8
|
-
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-
|
|
9
|
-
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-
|
|
2
|
+
import { B as resolveRequiredHomeDir, C as colorize, E as getChildLogger, F as resolveOAuthDir, L as resolveStateDir, M as resolveConfigPath, P as resolveGatewayPort, T as theme, _ as logVerbose, a as unregisterActiveProgressLine, b as shouldLogVerbose, f as getActivePluginRegistry, i as registerActiveProgressLine, k as normalizeLogLevel, l as normalizeAnyChannelId, m as setActivePluginRegistry, n as defaultRuntime, r as clearActiveProgressLine, s as CHAT_CHANNEL_ORDER, t as createSubsystemLogger, u as normalizeChannelId, w as isRich, y as setVerbose } from "./subsystem-D-Xta-sj.js";
|
|
3
|
+
import { A as classifySessionKeyShape, B as parseAgentSessionKey, D as buildAgentMainSessionKey, E as DEFAULT_MAIN_KEY, F as resolveThreadSessionKeys, I as sanitizeAgentId, L as getSubagentDepth, M as normalizeAgentId, N as normalizeMainKey, O as buildAgentPeerSessionKey, P as resolveAgentIdFromSessionKey, R as isAcpSessionKey, S as resolveAnimaPackageRoot, T as DEFAULT_AGENT_ID, V as resolveThreadParentSessionKey, b as filterBootstrapFilesForSession, c as resolveDefaultAgentId, f as DEFAULT_AGENT_WORKSPACE_DIR, i as resolveAgentModelFallbacksOverride, j as normalizeAccountId$1, l as resolveSessionAgentId, n as resolveAgentConfig, o as resolveAgentSkillsFilter, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, u as resolveSessionAgentIds, w as DEFAULT_ACCOUNT_ID, x as loadWorkspaceBootstrapFiles, y as ensureAgentWorkspace, z as isSubagentSessionKey } from "./agent-scope-ByIGrCTT.js";
|
|
4
|
+
import { D as shortenHomePath, E as shortenHomeInString, O as sleep, T as safeParseJson, _ as isRecord, a as logDebug, c as logWarn, d as clampInt, g as isPlainObject, h as formatTerminalLink, i as spawnWithFallback, j as truncateUtf16Safe, k as sliceUtf16Safe, l as CONFIG_DIR, m as escapeRegExp, n as runExec, o as logError, p as ensureDir$3, r as formatSpawnError, s as logInfo, t as runCommandWithTimeout, w as resolveUserPath } from "./exec-C6tXfeqA.js";
|
|
5
|
+
import { a as modelKey, d as resolveModelRefFromString, f as resolveThinkingDefault, h as DEFAULT_PROVIDER, i as isCliProvider, l as resolveConfiguredModelRef, m as DEFAULT_MODEL, n as buildConfiguredAllowlistKeys, o as normalizeModelRef, p as DEFAULT_CONTEXT_TOKENS, r as buildModelAliasIndex, s as normalizeProviderId, t as buildAllowedModelSet, u as resolveDefaultModelForAgent } from "./model-selection-CLcoOT3e.js";
|
|
6
|
+
import { $ as resolveChannelResetConfig, A as isContextOverflowError, At as resolveSandboxConfigForAgent, B as readSessionUpdatedAt, Bt as matchesAnyGlobPattern, C as normalizeThinkLevel, Ct as buildWorkspaceSkillSnapshot, D as supportsXHighThinking, Dt as resolveSandboxedMediaSource, E as resolveResponseUsageMode, Et as assertSandboxPath, F as ensureSandboxWorkspaceForSession, Ft as expandToolGroups, G as updateSessionStoreEntry, Gt as SILENT_REPLY_TOKEN, Ht as resolveBootstrapMaxChars, I as resolveSandboxRuntimeStatus, It as normalizeToolName, J as mergeDeliveryContext, K as deliveryContextFromSession, Kt as isSilentReplyText, L as extractDeliveryInfo, Lt as resolveToolProfilePolicy, M as isLikelyContextOverflowError, Mt as buildPluginToolGroups, N as isTransientHttpError, Nt as collectExplicitAllowlist, O as classifyFailoverReason, Ot as ensureBrowserControlAuth, P as sanitizeUserFacingText, Pt as expandPolicyWithPluginGroups, Q as evaluateSessionFreshness, R as appendAssistantMessageToSessionTranscript, Rt as stripPluginOnlyAllowlist, S as normalizeReasoningLevel, St as buildWorkspaceSkillCommandSpecs, T as normalizeVerboseLevel, Tt as assertMediaNotDataUrl, U as updateLastRoute, Ut as resolveBootstrapTotalMaxChars, V as recordSessionMetaFromInbound, Vt as buildBootstrapContextFiles, W as updateSessionStore, Wt as HEARTBEAT_TOKEN, X as normalizeSessionDeliveryFields, Y as normalizeDeliveryContext, Z as resolveSessionKey$1, _ as initializeGlobalHookRunner, _t as getMediaDir, a as applyReplyThreading, at as canonicalizeMainSessionAlias, b as listThinkingLevels, bt as resolvePathsWithinRoot, c as shouldSuppressMessagingToolReplies, ct as getChannelDock, d as buildTargetResolverSignature, dt as normalizeChatType, et as resolveSessionResetPolicy, f as normalizeChannelTargetInput, ft as resolveGroupSessionKey, g as getGlobalHookRunner, gt as resolveProfile, h as parseReplyDirectives, ht as resolveBrowserConfig, i as applyReplyTagsToPayload, it as resolveFreshSessionTotalTokens, j as isFailoverErrorMessage, jt as applyOwnerOnlyToolPolicy, k as isCompactionFailureError, kt as resolveBrowserControlAuth, l as createReplyToModeFilterForChannel, lt as listChannelDocks, m as throwIfAborted, mt as registerBrowserRoutes, nt as resolveThreadFlag, o as filterMessagingToolDuplicates, ot as resolveMainSessionKey, p as normalizeTargetForProvider, pt as createBrowserRouteContext, q as deliveryContextKey, r as normalizeReplyPayloadsForDelivery, rt as DEFAULT_RESET_TRIGGERS, s as isRenderablePayload, st as deriveSessionMetaPatch, t as deliverOutboundPayloads, tt as resolveSessionResetType, u as resolveReplyToMode, ut as resolveConversationLabel, v as formatThinkingLevels, vt as saveMediaBuffer, w as normalizeUsageDisplay, wt as resolvePluginSkillDirs, x as normalizeElevatedLevel, xt as getBridgeAuthForPort, y as formatXHighModelHint, yt as DEFAULT_UPLOAD_DIR, z as loadSessionStore, zt as compileGlobPatterns } from "./deliver-B-dPbUIs.js";
|
|
7
|
+
import { C as parseConfigPath, E as VERSION, S as getConfigValueAtPath, T as unsetConfigValueAtPath, _ as resolveMemorySlotDecision, a as writeConfigFile, b as setConfigOverride, c as parseDurationMs, d as discoverAnimaPlugins, g as resolveEnableState, h as normalizePluginsConfig, i as resolveConfigSnapshotHash, l as validateJsonSchemaValue, m as applyTestPluginDefaults, n as loadConfig, o as validateConfigObjectWithPlugins, r as readConfigFileSnapshot, u as loadPluginManifestRegistry, v as getConfigOverrides, w as setConfigValueAtPath, x as unsetConfigOverride, y as resetConfigOverrides } from "./config-ZYN8tezd.js";
|
|
8
|
+
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-CMI9f7-7.js";
|
|
9
|
+
import { S as pickPrimaryTailnetIPv4, T as DEFAULT_AI_SNAPSHOT_MAX_CHARS, _ as ensureChromeExtensionRelayServer, x as pickPrimaryLanIPv4, y as rawDataToString } from "./chrome-B8EnYGj1.js";
|
|
10
10
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-CsqJApTg.js";
|
|
11
11
|
import { n as formatErrorMessage } from "./errors-CllZhhV1.js";
|
|
12
|
-
import { A as extensionForMime, C as GATEWAY_CLIENT_NAMES, F as normalizeMimeType$1, H as isPrivateIpAddress, L as mediaKindFromMime, M as imageMimeFromFormat, N as isAudioFileName, O as resizeToJpeg, P as kindFromMime, R as SsrFBlockedError, S as GATEWAY_CLIENT_MODES, T as getImageMetadata, V as isBlockedHostname, _ as listDeliverableMessageChannels, a as chunkText, b as resolveMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isMarkdownCapableMessageChannel, h as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as getFileExtension, k as detectMime, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as normalizeMessageChannel, x as GATEWAY_CLIENT_IDS, y as resolveGatewayMessageChannel } from "./chunk-
|
|
13
|
-
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-
|
|
14
|
-
import { t as sanitizeToolResultImages } from "./tool-images-
|
|
15
|
-
import { a as
|
|
16
|
-
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-
|
|
17
|
-
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-
|
|
18
|
-
import {
|
|
19
|
-
import { a as
|
|
12
|
+
import { A as extensionForMime, C as GATEWAY_CLIENT_NAMES, F as normalizeMimeType$1, H as isPrivateIpAddress, L as mediaKindFromMime, M as imageMimeFromFormat, N as isAudioFileName, O as resizeToJpeg, P as kindFromMime, R as SsrFBlockedError, S as GATEWAY_CLIENT_MODES, T as getImageMetadata, V as isBlockedHostname, _ as listDeliverableMessageChannels, a as chunkText, b as resolveMessageChannel, c as resolveTextChunkLimit, d as listChannelPlugins, f as normalizeChannelId$1, g as isMarkdownCapableMessageChannel, h as isInternalMessageChannel, i as chunkMarkdownTextWithMode, j as getFileExtension, k as detectMime, m as isDeliverableMessageChannel, o as chunkTextWithMode, p as INTERNAL_MESSAGE_CHANNEL, r as chunkMarkdownText, s as resolveChunkMode, t as chunkByNewline, u as getChannelPlugin, v as normalizeMessageChannel, x as GATEWAY_CLIENT_IDS, y as resolveGatewayMessageChannel } from "./chunk-DJXDX69U.js";
|
|
13
|
+
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionFilePathOptions, s as resolveStorePath$1 } from "./paths-CAQJvbeZ.js";
|
|
14
|
+
import { t as sanitizeToolResultImages } from "./tool-images-C6cKHTbj.js";
|
|
15
|
+
import { _ as normalizeSecretInput, a as markAuthProfileUsed, c as markAuthProfileGood, d as resolveAnimaAgentDir, f as loadJsonFile, h as resolveAuthProfileDisplayLabel, i as markAuthProfileFailure, l as ensureAuthProfileStore, m as withFileLock$1, n as resolveAuthProfileOrder, o as resolveApiKeyForProfile, p as saveJsonFile, r as isProfileInCooldown, s as listProfilesForProvider, u as resolveAuthStorePathForDisplay } from "./auth-profiles-DKu7ZUzl.js";
|
|
16
|
+
import { a as requireApiKey, c as resolveModelAuthMode, i as getCustomProviderApiKey, n as resolveMemorySearchConfig, o as resolveApiKeyForProvider, r as getApiKeyForModel, s as resolveEnvApiKey } from "./manager-BYu34CX3.js";
|
|
17
|
+
import { d as listMemoryFiles, f as normalizeExtraMemoryPaths } from "./sqlite-BMMt7osH.js";
|
|
18
|
+
import { n as createAsyncLock } from "./soul-BiIdv3Wp.js";
|
|
19
|
+
import { a as readNumberParam, c as readStringParam, i as jsonResult, n as imageResult, r as imageResultFromFile, s as readStringArrayParam } from "./common-DT_obM-k.js";
|
|
20
|
+
import { a as resolveMarkdownTableMode, c as loadWebMedia, d as readResponseWithLimit, f as fetchWithSsrFGuard, i as convertMarkdownTables, l as MediaFetchError, m as fetchWithTimeout, o as normalizePollInput, p as bindAbortRelay, s as getDefaultLocalRoots, t as getActiveWebListener, u as fetchRemoteMedia } from "./active-listener-BKtsWhsb.js";
|
|
20
21
|
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-B1cF8Wk2.js";
|
|
21
|
-
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-
|
|
22
|
+
import { d as webAuthExists, i as logoutWeb, n as getWebAuthAgeMs, r as logWebSelfId, s as readWebSelfId } from "./auth-store-BpYI9t_y.js";
|
|
22
23
|
import { createRequire } from "node:module";
|
|
23
24
|
import * as path$1 from "node:path";
|
|
24
25
|
import path, { join } from "node:path";
|
|
@@ -35,7 +36,7 @@ import crypto, { X509Certificate, randomUUID } from "node:crypto";
|
|
|
35
36
|
import AjvPkg from "ajv";
|
|
36
37
|
import net from "node:net";
|
|
37
38
|
import { CURRENT_SESSION_VERSION, SessionManager, codingTools, createEditTool, createReadTool, createWriteTool, readTool } from "@mariozechner/pi-coding-agent";
|
|
38
|
-
import { WebSocket
|
|
39
|
+
import { WebSocket } from "ws";
|
|
39
40
|
import { complete, completeSimple } from "@mariozechner/pi-ai";
|
|
40
41
|
import { EdgeTTS } from "node-edge-tts";
|
|
41
42
|
import { Readable } from "node:stream";
|
|
@@ -2574,6 +2575,17 @@ async function resolveAnimaDocsPath(params) {
|
|
|
2574
2575
|
return fs.existsSync(packageDocs) ? packageDocs : null;
|
|
2575
2576
|
}
|
|
2576
2577
|
|
|
2578
|
+
//#endregion
|
|
2579
|
+
//#region src/agents/runner-capabilities.ts
|
|
2580
|
+
const CAPABILITY_HINTS = {
|
|
2581
|
+
"cli-native": "Use your native CLI capabilities when needed. Do not assume external MCP-style tools exist unless they are explicitly provided.",
|
|
2582
|
+
"local-tools": "Use only the tools explicitly provided in this session. Do not assume any other external MCP-style tools exist.",
|
|
2583
|
+
disabled: "Tools are disabled in this session. Do not call tools."
|
|
2584
|
+
};
|
|
2585
|
+
function appendRunnerCapabilityPrompt(prompt, mode) {
|
|
2586
|
+
return [prompt?.trim(), CAPABILITY_HINTS[mode]].filter(Boolean).join("\n");
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2577
2589
|
//#endregion
|
|
2578
2590
|
//#region src/logging/redact-identifier.ts
|
|
2579
2591
|
function sha256HexPrefix(value, len = 12) {
|
|
@@ -2643,6 +2655,18 @@ function resolveRunWorkspaceDir(params) {
|
|
|
2643
2655
|
|
|
2644
2656
|
//#endregion
|
|
2645
2657
|
//#region src/agents/anthropic-direct-runner.ts
|
|
2658
|
+
/**
|
|
2659
|
+
* Anthropic Direct API Runner
|
|
2660
|
+
*
|
|
2661
|
+
* Makes calls directly to api.anthropic.com without needing the claude CLI
|
|
2662
|
+
* binary to be installed or logged in. Works with any valid token:
|
|
2663
|
+
*
|
|
2664
|
+
* sk-ant-api01-... (Console API key)
|
|
2665
|
+
* sk-ant-oat01-... (Claude Code OAuth access token)
|
|
2666
|
+
*
|
|
2667
|
+
* This runner is automatically used when an `anthropic:default` token credential
|
|
2668
|
+
* is present in the auth store and the claude CLI is unavailable or not logged in.
|
|
2669
|
+
*/
|
|
2646
2670
|
const log$9 = createSubsystemLogger("agent/anthropic-direct");
|
|
2647
2671
|
const MODEL_MAP$1 = {
|
|
2648
2672
|
opus: "claude-opus-4-5",
|
|
@@ -2718,7 +2742,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2718
2742
|
cwd: process.cwd(),
|
|
2719
2743
|
moduleUrl: import.meta.url
|
|
2720
2744
|
});
|
|
2721
|
-
const extraSystemPrompt =
|
|
2745
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "disabled");
|
|
2722
2746
|
const systemPrompt = buildSystemPrompt({
|
|
2723
2747
|
workspaceDir,
|
|
2724
2748
|
config: params.config,
|
|
@@ -2758,7 +2782,7 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2758
2782
|
"x-api-key": params.token,
|
|
2759
2783
|
"anthropic-version": "2023-06-01",
|
|
2760
2784
|
"content-type": "application/json",
|
|
2761
|
-
"user-agent": `anima/
|
|
2785
|
+
"user-agent": `anima/5.1.3 (direct-runner; ${os.platform()})`
|
|
2762
2786
|
},
|
|
2763
2787
|
body: JSON.stringify(requestBody),
|
|
2764
2788
|
signal: controller.signal
|
|
@@ -2791,7 +2815,6 @@ async function runAnthropicDirectAgent(params) {
|
|
|
2791
2815
|
stopReason: data.stop_reason,
|
|
2792
2816
|
contentTypes: (data.content ?? []).map((b) => b.type)
|
|
2793
2817
|
});
|
|
2794
|
-
await params.onAssistantMessageStart?.();
|
|
2795
2818
|
if (outputText && params.onPartialReply) await params.onPartialReply({ text: outputText });
|
|
2796
2819
|
history.messages.push({
|
|
2797
2820
|
role: "assistant",
|
|
@@ -3049,13 +3072,20 @@ function setCodexExecModeArgs(args, mode) {
|
|
|
3049
3072
|
else nextArgs.push("--sandbox", mode);
|
|
3050
3073
|
return nextArgs;
|
|
3051
3074
|
}
|
|
3052
|
-
function
|
|
3075
|
+
function normalizeExecSecurity$2(execSecurity) {
|
|
3076
|
+
const normalized = execSecurity?.trim().toLowerCase();
|
|
3077
|
+
if (!normalized) return;
|
|
3078
|
+
if (normalized === "deny") return "deny";
|
|
3079
|
+
return "full";
|
|
3080
|
+
}
|
|
3081
|
+
function resolveManagedCodexExecMode(cfg, options) {
|
|
3082
|
+
if (normalizeExecSecurity$2(options?.execSecurity) === "deny") return "read-only";
|
|
3053
3083
|
const workspaceAccess = cfg?.agents?.defaults?.sandbox?.workspaceAccess;
|
|
3054
3084
|
if (workspaceAccess === "ro") return "read-only";
|
|
3055
3085
|
if (workspaceAccess === "rw") return "workspace-write";
|
|
3056
3086
|
return CODEX_BYPASS_FLAG;
|
|
3057
3087
|
}
|
|
3058
|
-
function resolveCliBackendConfig(provider, cfg) {
|
|
3088
|
+
function resolveCliBackendConfig(provider, cfg, options) {
|
|
3059
3089
|
const normalized = normalizeBackendKey(provider);
|
|
3060
3090
|
const configured = cfg?.agents?.defaults?.cliBackends ?? {};
|
|
3061
3091
|
if (CLAUDE_BACKEND_ALIAS_SET.has(normalized)) {
|
|
@@ -3083,7 +3113,7 @@ function resolveCliBackendConfig(provider, cfg) {
|
|
|
3083
3113
|
};
|
|
3084
3114
|
if (!resolveCodexExecModeArg(override?.args) || (override?.args ? argsEqual(override.args, LEGACY_CODEX_ARGS) : false)) merged = {
|
|
3085
3115
|
...merged,
|
|
3086
|
-
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg))
|
|
3116
|
+
args: setCodexExecModeArgs(merged.args, resolveManagedCodexExecMode(cfg, options))
|
|
3087
3117
|
};
|
|
3088
3118
|
const command = merged.command?.trim();
|
|
3089
3119
|
if (!command) return null;
|
|
@@ -3262,14 +3292,14 @@ async function runCliAgent(params) {
|
|
|
3262
3292
|
const redactedWorkspace = redactRunIdentifier(resolvedWorkspace);
|
|
3263
3293
|
if (workspaceResolution.usedFallback) log$8.warn(`[workspace-fallback] caller=runCliAgent reason=${workspaceResolution.fallbackReason} run=${params.runId} session=${redactedSessionId} sessionKey=${redactedSessionKey} agent=${workspaceResolution.agentId} workspace=${redactedWorkspace}`);
|
|
3264
3294
|
const workspaceDir = resolvedWorkspace;
|
|
3265
|
-
const backendResolved = resolveCliBackendConfig(params.provider, params.config);
|
|
3295
|
+
const backendResolved = resolveCliBackendConfig(params.provider, params.config, { execSecurity: params.sessionExecSecurity });
|
|
3266
3296
|
if (!backendResolved) throw new Error(`Unknown CLI backend: ${params.provider}`);
|
|
3267
3297
|
const backend = backendResolved.config;
|
|
3268
3298
|
const effectiveCodexExecMode = resolveCodexExecModeArg(backend.args);
|
|
3269
3299
|
const modelId = (params.model ?? "default").trim() || "default";
|
|
3270
3300
|
const normalizedModel = normalizeCliModel(modelId, backend);
|
|
3271
3301
|
const modelDisplay = `${params.provider}/${modelId}`;
|
|
3272
|
-
const extraSystemPrompt =
|
|
3302
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "cli-native");
|
|
3273
3303
|
const sessionLabel = params.sessionKey ?? params.sessionId;
|
|
3274
3304
|
const { contextFiles } = await resolveBootstrapContextForRun({
|
|
3275
3305
|
workspaceDir,
|
|
@@ -3319,13 +3349,21 @@ async function runCliAgent(params) {
|
|
|
3319
3349
|
const parsed = JSON.parse(lastLine);
|
|
3320
3350
|
const previousMode = parsed.metadata?.effectiveCodexExecMode ?? parsed.metadata?.effectiveSandbox;
|
|
3321
3351
|
const currentMode = effectiveCodexExecMode;
|
|
3322
|
-
if (previousMode
|
|
3352
|
+
if (!previousMode) {
|
|
3353
|
+
log$8.info("Codex execution mode is unknown for the saved session; forcing session restart.");
|
|
3354
|
+
useResume = false;
|
|
3355
|
+
isNew = true;
|
|
3356
|
+
} else if (previousMode !== currentMode) {
|
|
3323
3357
|
log$8.info(`Codex execution mode changed (${previousMode} -> ${currentMode}); forcing session restart.`);
|
|
3324
3358
|
useResume = false;
|
|
3325
3359
|
isNew = true;
|
|
3326
3360
|
}
|
|
3327
3361
|
}
|
|
3328
|
-
} catch {
|
|
3362
|
+
} catch {
|
|
3363
|
+
log$8.info("Codex session transcript is unavailable; forcing session restart.");
|
|
3364
|
+
useResume = false;
|
|
3365
|
+
isNew = true;
|
|
3366
|
+
}
|
|
3329
3367
|
const sessionIdSent = cliSessionIdToSend ? useResume || Boolean(backend.sessionArg) || Boolean(backend.sessionArgs?.length) ? cliSessionIdToSend : void 0 : void 0;
|
|
3330
3368
|
const systemPromptArg = resolveSystemPromptUsage({
|
|
3331
3369
|
backend,
|
|
@@ -3441,8 +3479,9 @@ async function runCliAgent(params) {
|
|
|
3441
3479
|
if (stderr) log$8.debug(`cli stderr:\n${stderr}`);
|
|
3442
3480
|
}
|
|
3443
3481
|
if (result.code !== 0) {
|
|
3444
|
-
const
|
|
3445
|
-
const
|
|
3482
|
+
const timedOut = result.killed && result.signal === "SIGKILL";
|
|
3483
|
+
const err = timedOut ? `Request timed out after ${params.timeoutMs}ms` : stderr || stdout || "CLI failed.";
|
|
3484
|
+
const reason = timedOut ? "timeout" : classifyFailoverReason(err) ?? "unknown";
|
|
3446
3485
|
const status = resolveFailoverStatus(reason);
|
|
3447
3486
|
throw new FailoverError(err, {
|
|
3448
3487
|
reason,
|
|
@@ -4241,7 +4280,7 @@ async function getMemorySearchManager(params) {
|
|
|
4241
4280
|
if (cached) return { manager: cached };
|
|
4242
4281
|
}
|
|
4243
4282
|
try {
|
|
4244
|
-
const { QmdMemoryManager } = await import("./qmd-manager-
|
|
4283
|
+
const { QmdMemoryManager } = await import("./qmd-manager-Q0OSDQ-e.js");
|
|
4245
4284
|
const primary = await QmdMemoryManager.create({
|
|
4246
4285
|
cfg: params.cfg,
|
|
4247
4286
|
agentId: params.agentId,
|
|
@@ -4253,7 +4292,7 @@ async function getMemorySearchManager(params) {
|
|
|
4253
4292
|
const wrapper = new FallbackMemoryManager({
|
|
4254
4293
|
primary,
|
|
4255
4294
|
fallbackFactory: async () => {
|
|
4256
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4295
|
+
const { MemoryIndexManager } = await import("./manager-BYu34CX3.js").then((n) => n.t);
|
|
4257
4296
|
return await MemoryIndexManager.get(params);
|
|
4258
4297
|
}
|
|
4259
4298
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -4266,7 +4305,7 @@ async function getMemorySearchManager(params) {
|
|
|
4266
4305
|
}
|
|
4267
4306
|
}
|
|
4268
4307
|
try {
|
|
4269
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4308
|
+
const { MemoryIndexManager } = await import("./manager-BYu34CX3.js").then((n) => n.t);
|
|
4270
4309
|
return { manager: await MemoryIndexManager.get(params) };
|
|
4271
4310
|
} catch (err) {
|
|
4272
4311
|
return {
|
|
@@ -5706,6 +5745,7 @@ const PollParamsSchema = Type.Object({
|
|
|
5706
5745
|
const AgentParamsSchema = Type.Object({
|
|
5707
5746
|
message: NonEmptyString,
|
|
5708
5747
|
agentId: Type.Optional(NonEmptyString),
|
|
5748
|
+
model: Type.Optional(Type.String()),
|
|
5709
5749
|
to: Type.Optional(Type.String()),
|
|
5710
5750
|
replyTo: Type.Optional(Type.String()),
|
|
5711
5751
|
sessionId: Type.Optional(Type.String()),
|
|
@@ -6814,7 +6854,7 @@ var GatewayClient = class {
|
|
|
6814
6854
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("ANIMA Gateway TLS fingerprint mismatch");
|
|
6815
6855
|
});
|
|
6816
6856
|
}
|
|
6817
|
-
this.ws = new WebSocket
|
|
6857
|
+
this.ws = new WebSocket(url, wsOptions);
|
|
6818
6858
|
this.ws.on("open", () => {
|
|
6819
6859
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
6820
6860
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -7017,7 +7057,7 @@ var GatewayClient = class {
|
|
|
7017
7057
|
return null;
|
|
7018
7058
|
}
|
|
7019
7059
|
async request(method, params, opts) {
|
|
7020
|
-
if (!this.ws || this.ws.readyState !== WebSocket
|
|
7060
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("ANIMA Gateway not connected");
|
|
7021
7061
|
const id = randomUUID();
|
|
7022
7062
|
const frame = {
|
|
7023
7063
|
type: "req",
|
|
@@ -8015,7 +8055,7 @@ async function routeReply(params) {
|
|
|
8015
8055
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
8016
8056
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
8017
8057
|
try {
|
|
8018
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
8058
|
+
const { deliverOutboundPayloads } = await import("./deliver-B-dPbUIs.js").then((n) => n.n);
|
|
8019
8059
|
return {
|
|
8020
8060
|
ok: true,
|
|
8021
8061
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -11611,7 +11651,7 @@ async function loadModelCatalog(params) {
|
|
|
11611
11651
|
});
|
|
11612
11652
|
try {
|
|
11613
11653
|
await ensureAnimaModelsJson(params?.config ?? loadConfig());
|
|
11614
|
-
await (await import("./pi-auth-json-
|
|
11654
|
+
await (await import("./pi-auth-json-B_lKNFK6.js")).ensurePiAuthJsonFromAuthProfiles(resolveAnimaAgentDir());
|
|
11615
11655
|
const piSdk = await importPiSdk();
|
|
11616
11656
|
const agentDir = resolveAnimaAgentDir();
|
|
11617
11657
|
const { join } = await import("node:path");
|
|
@@ -13371,8 +13411,8 @@ const resolveProfileOverride = (params) => {
|
|
|
13371
13411
|
//#region src/auto-reply/reply/directive-handling.model-picker.ts
|
|
13372
13412
|
const PROVIDER_RANK = new Map([
|
|
13373
13413
|
"anthropic",
|
|
13374
|
-
"openai",
|
|
13375
13414
|
"openai-codex",
|
|
13415
|
+
"openai",
|
|
13376
13416
|
"minimax",
|
|
13377
13417
|
"synthetic",
|
|
13378
13418
|
"google",
|
|
@@ -13708,7 +13748,7 @@ async function createModelSelectionState(params) {
|
|
|
13708
13748
|
}
|
|
13709
13749
|
}
|
|
13710
13750
|
if (sessionEntry && sessionStore && sessionKey && sessionEntry.authProfileOverride) {
|
|
13711
|
-
const { ensureAuthProfileStore } = await import("./auth-profiles-
|
|
13751
|
+
const { ensureAuthProfileStore } = await import("./auth-profiles-DKu7ZUzl.js").then((n) => n.t);
|
|
13712
13752
|
const profile = ensureAuthProfileStore(void 0, { allowKeychainPrompt: false }).profiles[sessionEntry.authProfileOverride];
|
|
13713
13753
|
const providerKey = normalizeProviderId(provider);
|
|
13714
13754
|
if (!profile || normalizeProviderId(profile.provider) !== providerKey) await clearSessionAuthProfileOverride({
|
|
@@ -14770,25 +14810,6 @@ function ensureSkillsWatcher(params) {
|
|
|
14770
14810
|
watchers.set(workspaceDir, state);
|
|
14771
14811
|
}
|
|
14772
14812
|
|
|
14773
|
-
//#endregion
|
|
14774
|
-
//#region src/infra/pairing-files.ts
|
|
14775
|
-
function createAsyncLock() {
|
|
14776
|
-
let lock = Promise.resolve();
|
|
14777
|
-
return async function withLock(fn) {
|
|
14778
|
-
const prev = lock;
|
|
14779
|
-
let release;
|
|
14780
|
-
lock = new Promise((resolve) => {
|
|
14781
|
-
release = resolve;
|
|
14782
|
-
});
|
|
14783
|
-
await prev;
|
|
14784
|
-
try {
|
|
14785
|
-
return await fn();
|
|
14786
|
-
} finally {
|
|
14787
|
-
release?.();
|
|
14788
|
-
}
|
|
14789
|
-
};
|
|
14790
|
-
}
|
|
14791
|
-
|
|
14792
14813
|
//#endregion
|
|
14793
14814
|
//#region src/infra/node-pairing.ts
|
|
14794
14815
|
const PENDING_TTL_MS = 300 * 1e3;
|
|
@@ -27919,6 +27940,263 @@ function createGatewayTool(opts) {
|
|
|
27919
27940
|
};
|
|
27920
27941
|
}
|
|
27921
27942
|
|
|
27943
|
+
//#endregion
|
|
27944
|
+
//#region src/agents/model-auto.ts
|
|
27945
|
+
const DEFAULT_USAGE_THRESHOLD_PERCENT = 5;
|
|
27946
|
+
const USAGE_CACHE_TTL_MS = 6e4;
|
|
27947
|
+
const USAGE_TIMEOUT_MS = 1500;
|
|
27948
|
+
const usageSummaryCache = /* @__PURE__ */ new Map();
|
|
27949
|
+
function resolveRawAutoConfig(cfg) {
|
|
27950
|
+
const modelConfig = cfg?.agents?.defaults?.model;
|
|
27951
|
+
if (typeof modelConfig !== "object" || !modelConfig) return;
|
|
27952
|
+
return modelConfig.auto;
|
|
27953
|
+
}
|
|
27954
|
+
function dedupeProviders(values) {
|
|
27955
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27956
|
+
const result = [];
|
|
27957
|
+
for (const input of values) {
|
|
27958
|
+
if (!input) continue;
|
|
27959
|
+
const normalized = normalizeProviderId(input);
|
|
27960
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
27961
|
+
seen.add(normalized);
|
|
27962
|
+
result.push(normalized);
|
|
27963
|
+
}
|
|
27964
|
+
return result;
|
|
27965
|
+
}
|
|
27966
|
+
function resolveModelAutoConfig(cfg) {
|
|
27967
|
+
const raw = resolveRawAutoConfig(cfg);
|
|
27968
|
+
if (!raw?.enabled) return null;
|
|
27969
|
+
const byProvider = {};
|
|
27970
|
+
for (const [providerRaw, entry] of Object.entries(raw.byProvider ?? {})) {
|
|
27971
|
+
const provider = normalizeProviderId(providerRaw);
|
|
27972
|
+
if (!provider) continue;
|
|
27973
|
+
const models = Array.isArray(entry?.models) ? entry.models.map((value) => String(value ?? "").trim()).filter(Boolean) : [];
|
|
27974
|
+
if (models.length > 0) byProvider[provider] = { models };
|
|
27975
|
+
}
|
|
27976
|
+
const usageThresholdPercent = typeof raw.usageThresholdPercent === "number" && Number.isFinite(raw.usageThresholdPercent) ? Math.max(0, Math.min(100, raw.usageThresholdPercent)) : DEFAULT_USAGE_THRESHOLD_PERCENT;
|
|
27977
|
+
return {
|
|
27978
|
+
enabled: true,
|
|
27979
|
+
providerOrder: dedupeProviders(raw.providerOrder ?? []),
|
|
27980
|
+
byProvider,
|
|
27981
|
+
byWorkingMode: {
|
|
27982
|
+
read: Array.isArray(raw.byWorkingMode?.read) ? raw.byWorkingMode.read.map((value) => String(value ?? "").trim()).filter(Boolean) : [],
|
|
27983
|
+
write: Array.isArray(raw.byWorkingMode?.write) ? raw.byWorkingMode.write.map((value) => String(value ?? "").trim()).filter(Boolean) : []
|
|
27984
|
+
},
|
|
27985
|
+
usageCheck: raw.usageCheck === "prefer-available" ? "prefer-available" : "off",
|
|
27986
|
+
usageThresholdPercent
|
|
27987
|
+
};
|
|
27988
|
+
}
|
|
27989
|
+
function buildCandidatesFromRawModels(params) {
|
|
27990
|
+
const defaultProvider = params.defaultProvider ?? DEFAULT_PROVIDER;
|
|
27991
|
+
const index = buildModelAliasIndex({
|
|
27992
|
+
cfg: params.cfg ?? {},
|
|
27993
|
+
defaultProvider
|
|
27994
|
+
});
|
|
27995
|
+
const seen = /* @__PURE__ */ new Set();
|
|
27996
|
+
const out = [];
|
|
27997
|
+
for (const raw of params.rawModels) {
|
|
27998
|
+
const resolved = resolveModelRefFromString({
|
|
27999
|
+
raw,
|
|
28000
|
+
defaultProvider,
|
|
28001
|
+
aliasIndex: index
|
|
28002
|
+
});
|
|
28003
|
+
if (!resolved) continue;
|
|
28004
|
+
const key = modelKey(resolved.ref.provider, resolved.ref.model);
|
|
28005
|
+
if (seen.has(key)) continue;
|
|
28006
|
+
seen.add(key);
|
|
28007
|
+
out.push(resolved.ref);
|
|
28008
|
+
}
|
|
28009
|
+
return out;
|
|
28010
|
+
}
|
|
28011
|
+
async function loadUsageSummary(agentDir, providers) {
|
|
28012
|
+
const key = `${agentDir ?? "main"}::${providers.slice().toSorted().join(",")}`;
|
|
28013
|
+
const now = Date.now();
|
|
28014
|
+
const cached = usageSummaryCache.get(key);
|
|
28015
|
+
if (cached && cached.expiresAt > now) return cached.summary;
|
|
28016
|
+
const summary = await loadProviderUsageSummary({
|
|
28017
|
+
agentDir,
|
|
28018
|
+
providers,
|
|
28019
|
+
timeoutMs: USAGE_TIMEOUT_MS
|
|
28020
|
+
});
|
|
28021
|
+
usageSummaryCache.set(key, {
|
|
28022
|
+
expiresAt: now + USAGE_CACHE_TTL_MS,
|
|
28023
|
+
summary
|
|
28024
|
+
});
|
|
28025
|
+
return summary;
|
|
28026
|
+
}
|
|
28027
|
+
function remainingPercent(snapshot) {
|
|
28028
|
+
if (snapshot.error || snapshot.windows.length === 0) return;
|
|
28029
|
+
const values = snapshot.windows.map((window) => 100 - window.usedPercent).filter((value) => Number.isFinite(value));
|
|
28030
|
+
if (values.length === 0) return;
|
|
28031
|
+
return Math.max(0, Math.min(...values));
|
|
28032
|
+
}
|
|
28033
|
+
async function resolveAvailability(params) {
|
|
28034
|
+
const availability = /* @__PURE__ */ new Map();
|
|
28035
|
+
const usageProviders = Array.from(new Set(params.providerOrder.map((provider) => resolveUsageProviderId(provider)).filter((provider) => Boolean(provider))));
|
|
28036
|
+
let summary;
|
|
28037
|
+
if (usageProviders.length > 0) try {
|
|
28038
|
+
summary = await loadUsageSummary(params.agentDir, usageProviders);
|
|
28039
|
+
} catch {
|
|
28040
|
+
summary = void 0;
|
|
28041
|
+
}
|
|
28042
|
+
const snapshots = /* @__PURE__ */ new Map();
|
|
28043
|
+
for (const entry of summary?.providers ?? []) snapshots.set(entry.provider, entry);
|
|
28044
|
+
for (const provider of params.providerOrder) {
|
|
28045
|
+
const usageProvider = resolveUsageProviderId(provider);
|
|
28046
|
+
if (!usageProvider) {
|
|
28047
|
+
availability.set(provider, {
|
|
28048
|
+
provider,
|
|
28049
|
+
state: "unknown"
|
|
28050
|
+
});
|
|
28051
|
+
continue;
|
|
28052
|
+
}
|
|
28053
|
+
const snapshot = snapshots.get(usageProvider);
|
|
28054
|
+
const percent = snapshot ? remainingPercent(snapshot) : void 0;
|
|
28055
|
+
availability.set(provider, {
|
|
28056
|
+
provider,
|
|
28057
|
+
usageProvider,
|
|
28058
|
+
remainingPercent: percent,
|
|
28059
|
+
state: percent === void 0 ? "unknown" : percent <= params.autoConfig.usageThresholdPercent ? "exhausted" : "available"
|
|
28060
|
+
});
|
|
28061
|
+
}
|
|
28062
|
+
return availability;
|
|
28063
|
+
}
|
|
28064
|
+
function reorderByAvailability(params) {
|
|
28065
|
+
const lockedPrimary = params.preservePrimary ? params.candidates[0] : void 0;
|
|
28066
|
+
const rest = params.preservePrimary ? params.candidates.slice(1) : params.candidates;
|
|
28067
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
28068
|
+
for (const candidate of rest) {
|
|
28069
|
+
const normalized = normalizeProviderId(candidate.provider);
|
|
28070
|
+
const group = grouped.get(normalized) ?? [];
|
|
28071
|
+
group.push({
|
|
28072
|
+
provider: normalized,
|
|
28073
|
+
model: candidate.model
|
|
28074
|
+
});
|
|
28075
|
+
grouped.set(normalized, group);
|
|
28076
|
+
}
|
|
28077
|
+
const order = [];
|
|
28078
|
+
for (const [provider, availability] of params.availability) if (availability.state === "available") order.push(provider);
|
|
28079
|
+
for (const [provider, availability] of params.availability) if (availability.state === "unknown") order.push(provider);
|
|
28080
|
+
for (const [provider, availability] of params.availability) if (availability.state === "exhausted") order.push(provider);
|
|
28081
|
+
for (const provider of grouped.keys()) if (!order.includes(provider)) order.push(provider);
|
|
28082
|
+
const ordered = [];
|
|
28083
|
+
for (const provider of order) {
|
|
28084
|
+
const group = grouped.get(provider) ?? [];
|
|
28085
|
+
ordered.push(...group);
|
|
28086
|
+
}
|
|
28087
|
+
return lockedPrimary ? [lockedPrimary, ...ordered] : ordered;
|
|
28088
|
+
}
|
|
28089
|
+
async function applyAutoModelRouting(params) {
|
|
28090
|
+
const autoConfig = resolveModelAutoConfig(params.cfg);
|
|
28091
|
+
if (!autoConfig) return {
|
|
28092
|
+
candidates: [...params.candidates],
|
|
28093
|
+
autoConfigured: false,
|
|
28094
|
+
preserveProviderOrder: false,
|
|
28095
|
+
availabilityByProvider: /* @__PURE__ */ new Map()
|
|
28096
|
+
};
|
|
28097
|
+
const providerOrder = dedupeProviders([...autoConfig.providerOrder, ...params.candidates.map((candidate) => candidate.provider)]);
|
|
28098
|
+
let candidates = [...params.candidates];
|
|
28099
|
+
const modePreferred = params.workingMode ? buildCandidatesFromRawModels({
|
|
28100
|
+
rawModels: autoConfig.byWorkingMode[params.workingMode] ?? [],
|
|
28101
|
+
cfg: params.cfg,
|
|
28102
|
+
defaultProvider: params.candidates[0]?.provider ?? DEFAULT_PROVIDER
|
|
28103
|
+
}) : [];
|
|
28104
|
+
if (modePreferred.length > 0) {
|
|
28105
|
+
const lockedPrimary = params.preservePrimary && candidates.length > 0 ? [candidates[0]] : [];
|
|
28106
|
+
const remainingCandidates = params.preservePrimary ? candidates.slice(1) : candidates;
|
|
28107
|
+
const seen = /* @__PURE__ */ new Set();
|
|
28108
|
+
candidates = [
|
|
28109
|
+
...lockedPrimary,
|
|
28110
|
+
...modePreferred,
|
|
28111
|
+
...remainingCandidates
|
|
28112
|
+
].filter((candidate) => {
|
|
28113
|
+
const key = modelKey(candidate.provider, candidate.model);
|
|
28114
|
+
if (seen.has(key)) return false;
|
|
28115
|
+
seen.add(key);
|
|
28116
|
+
return true;
|
|
28117
|
+
});
|
|
28118
|
+
}
|
|
28119
|
+
const availability = await resolveAvailability({
|
|
28120
|
+
providerOrder,
|
|
28121
|
+
agentDir: params.agentDir,
|
|
28122
|
+
autoConfig
|
|
28123
|
+
});
|
|
28124
|
+
if (autoConfig.usageCheck === "prefer-available") candidates = reorderByAvailability({
|
|
28125
|
+
candidates,
|
|
28126
|
+
availability,
|
|
28127
|
+
preservePrimary: params.preservePrimary
|
|
28128
|
+
});
|
|
28129
|
+
return {
|
|
28130
|
+
candidates,
|
|
28131
|
+
autoConfigured: true,
|
|
28132
|
+
preserveProviderOrder: true,
|
|
28133
|
+
config: autoConfig,
|
|
28134
|
+
availabilityByProvider: availability
|
|
28135
|
+
};
|
|
28136
|
+
}
|
|
28137
|
+
|
|
28138
|
+
//#endregion
|
|
28139
|
+
//#region src/agents/model-preference.ts
|
|
28140
|
+
const HIGH_THINK_LEVELS = new Set(["high", "xhigh"]);
|
|
28141
|
+
const SESSION_COST_THRESHOLD_USD = .5;
|
|
28142
|
+
const SESSION_TOKEN_THRESHOLD = 3e5;
|
|
28143
|
+
const SESSION_TURN_THRESHOLD = 12;
|
|
28144
|
+
const SESSION_COMPACTION_THRESHOLD = 2;
|
|
28145
|
+
function toPositiveFiniteNumber(value) {
|
|
28146
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
28147
|
+
return value;
|
|
28148
|
+
}
|
|
28149
|
+
function shouldPreferCheap(entry) {
|
|
28150
|
+
if (!entry) return false;
|
|
28151
|
+
const sessionCostUsd = toPositiveFiniteNumber(entry.sessionEstimatedCostUsdTotal) ?? 0;
|
|
28152
|
+
const sessionInputTokens = toPositiveFiniteNumber(entry.sessionInputTokensTotal) ?? 0;
|
|
28153
|
+
const sessionOutputTokens = toPositiveFiniteNumber(entry.sessionOutputTokensTotal) ?? 0;
|
|
28154
|
+
const sessionTurnCount = toPositiveFiniteNumber(entry.sessionTurnCount) ?? 0;
|
|
28155
|
+
const compactionCount = toPositiveFiniteNumber(entry.compactionCount) ?? 0;
|
|
28156
|
+
return sessionCostUsd >= SESSION_COST_THRESHOLD_USD || sessionInputTokens + sessionOutputTokens >= SESSION_TOKEN_THRESHOLD || sessionTurnCount >= SESSION_TURN_THRESHOLD || compactionCount >= SESSION_COMPACTION_THRESHOLD;
|
|
28157
|
+
}
|
|
28158
|
+
function resolveCandidateCostScore(candidate, cfg) {
|
|
28159
|
+
const cost = resolveModelCostConfig({
|
|
28160
|
+
provider: candidate.provider,
|
|
28161
|
+
model: candidate.model,
|
|
28162
|
+
config: cfg
|
|
28163
|
+
});
|
|
28164
|
+
if (!cost) return;
|
|
28165
|
+
const values = [
|
|
28166
|
+
cost.input,
|
|
28167
|
+
cost.output,
|
|
28168
|
+
cost.cacheRead,
|
|
28169
|
+
cost.cacheWrite
|
|
28170
|
+
].filter((value) => typeof value === "number" && Number.isFinite(value));
|
|
28171
|
+
if (values.length === 0) return;
|
|
28172
|
+
return values.reduce((sum, value) => sum + value, 0);
|
|
28173
|
+
}
|
|
28174
|
+
function resolveUsageAwareModelPreference(params) {
|
|
28175
|
+
if (params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride) return "preserve";
|
|
28176
|
+
if (params.thinkLevel && HIGH_THINK_LEVELS.has(params.thinkLevel)) return "prefer-strong";
|
|
28177
|
+
if (shouldPreferCheap(params.sessionEntry)) return "prefer-cheap";
|
|
28178
|
+
return "preserve";
|
|
28179
|
+
}
|
|
28180
|
+
function orderCandidatesByPreference(params) {
|
|
28181
|
+
const preferenceMode = params.preferenceMode ?? "preserve";
|
|
28182
|
+
if (preferenceMode === "preserve" || params.candidates.length <= 1) return [...params.candidates];
|
|
28183
|
+
const scoredCandidates = params.candidates.map((candidate) => ({
|
|
28184
|
+
candidate,
|
|
28185
|
+
score: resolveCandidateCostScore(candidate, params.cfg)
|
|
28186
|
+
}));
|
|
28187
|
+
const sortable = scoredCandidates.filter((entry) => entry.score !== void 0);
|
|
28188
|
+
if (sortable.length < 2) return [...params.candidates];
|
|
28189
|
+
sortable.sort((left, right) => preferenceMode === "prefer-cheap" ? left.score - right.score : right.score - left.score);
|
|
28190
|
+
const reordered = sortable.map((entry) => entry.candidate);
|
|
28191
|
+
let reorderedIndex = 0;
|
|
28192
|
+
return scoredCandidates.map((entry) => {
|
|
28193
|
+
if (entry.score === void 0) return entry.candidate;
|
|
28194
|
+
const next = reordered[reorderedIndex];
|
|
28195
|
+
reorderedIndex += 1;
|
|
28196
|
+
return next;
|
|
28197
|
+
});
|
|
28198
|
+
}
|
|
28199
|
+
|
|
27922
28200
|
//#endregion
|
|
27923
28201
|
//#region src/agents/model-fallback.ts
|
|
27924
28202
|
/**
|
|
@@ -28020,12 +28298,32 @@ function resolveFallbackCandidates(params) {
|
|
|
28020
28298
|
}, false);
|
|
28021
28299
|
return candidates;
|
|
28022
28300
|
}
|
|
28301
|
+
function resolveWorkingModeFromSessionEntry(entry) {
|
|
28302
|
+
const execSecurity = entry?.execSecurity?.trim().toLowerCase();
|
|
28303
|
+
if (!execSecurity) return;
|
|
28304
|
+
return execSecurity === "deny" ? "read" : "write";
|
|
28305
|
+
}
|
|
28023
28306
|
async function runWithModelFallback(params) {
|
|
28024
|
-
const
|
|
28307
|
+
const preservePrimary = Boolean(params.sessionEntry?.providerOverride || params.sessionEntry?.modelOverride);
|
|
28308
|
+
const resolvedWorkingMode = params.workingMode ?? resolveWorkingModeFromSessionEntry(params.sessionEntry);
|
|
28309
|
+
const candidates = orderCandidatesByPreference({
|
|
28310
|
+
candidates: (await applyAutoModelRouting({
|
|
28311
|
+
candidates: resolveFallbackCandidates({
|
|
28312
|
+
cfg: params.cfg,
|
|
28313
|
+
provider: params.provider,
|
|
28314
|
+
model: params.model,
|
|
28315
|
+
fallbacksOverride: params.fallbacksOverride
|
|
28316
|
+
}),
|
|
28317
|
+
cfg: params.cfg,
|
|
28318
|
+
agentDir: params.agentDir,
|
|
28319
|
+
preservePrimary,
|
|
28320
|
+
workingMode: resolvedWorkingMode
|
|
28321
|
+
})).candidates,
|
|
28025
28322
|
cfg: params.cfg,
|
|
28026
|
-
|
|
28027
|
-
|
|
28028
|
-
|
|
28323
|
+
preferenceMode: resolveUsageAwareModelPreference({
|
|
28324
|
+
thinkLevel: params.thinkLevel,
|
|
28325
|
+
sessionEntry: params.sessionEntry
|
|
28326
|
+
})
|
|
28029
28327
|
});
|
|
28030
28328
|
const authStore = params.cfg ? ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false }) : null;
|
|
28031
28329
|
const attempts = [];
|
|
@@ -29126,6 +29424,24 @@ function pickAmbiguousMatch(entries, mode) {
|
|
|
29126
29424
|
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
29127
29425
|
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
29128
29426
|
}
|
|
29427
|
+
function resolveConfiguredNoxsoftTarget(params) {
|
|
29428
|
+
const trimmed = params.input.trim();
|
|
29429
|
+
if (!trimmed) return null;
|
|
29430
|
+
const configured = params.cfg.channels?.noxsoft?.channels;
|
|
29431
|
+
if (!configured) return null;
|
|
29432
|
+
const lower = trimmed.toLowerCase();
|
|
29433
|
+
for (const [name, entry] of Object.entries(configured)) {
|
|
29434
|
+
const channelId = entry?.id?.trim();
|
|
29435
|
+
if (!channelId) continue;
|
|
29436
|
+
if (lower === name.trim().toLowerCase() || trimmed === channelId) return {
|
|
29437
|
+
to: channelId,
|
|
29438
|
+
kind: "channel",
|
|
29439
|
+
display: name,
|
|
29440
|
+
source: "normalized"
|
|
29441
|
+
};
|
|
29442
|
+
}
|
|
29443
|
+
return null;
|
|
29444
|
+
}
|
|
29129
29445
|
async function resolveMessagingTarget(params) {
|
|
29130
29446
|
const raw = normalizeChannelTargetInput(params.input);
|
|
29131
29447
|
if (!raw) return {
|
|
@@ -29137,6 +29453,16 @@ async function resolveMessagingTarget(params) {
|
|
|
29137
29453
|
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
29138
29454
|
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
29139
29455
|
const normalized = normalizeTargetForProvider(params.channel, raw) ?? raw;
|
|
29456
|
+
if (params.channel === "noxsoft") {
|
|
29457
|
+
const configuredTarget = resolveConfiguredNoxsoftTarget({
|
|
29458
|
+
cfg: params.cfg,
|
|
29459
|
+
input: raw
|
|
29460
|
+
});
|
|
29461
|
+
if (configuredTarget) return {
|
|
29462
|
+
ok: true,
|
|
29463
|
+
target: configuredTarget
|
|
29464
|
+
};
|
|
29465
|
+
}
|
|
29140
29466
|
const looksLikeTargetId = () => {
|
|
29141
29467
|
const trimmed = raw.trim();
|
|
29142
29468
|
if (!trimmed) return false;
|
|
@@ -29351,6 +29677,10 @@ function applyCrossContextDecoration(params) {
|
|
|
29351
29677
|
};
|
|
29352
29678
|
}
|
|
29353
29679
|
|
|
29680
|
+
//#endregion
|
|
29681
|
+
//#region src/auth/noxsoft-auth.ts
|
|
29682
|
+
const TOKEN_PATH = path.join(os.homedir(), ".noxsoft-agent-token");
|
|
29683
|
+
|
|
29354
29684
|
//#endregion
|
|
29355
29685
|
//#region src/infra/outbound/targets.ts
|
|
29356
29686
|
function resolveSessionDeliveryTarget(params) {
|
|
@@ -29432,13 +29762,62 @@ function resolveGatewayOptions(opts) {
|
|
|
29432
29762
|
mode: opts?.mode ?? GATEWAY_CLIENT_MODES.CLI
|
|
29433
29763
|
};
|
|
29434
29764
|
}
|
|
29765
|
+
function resolveNoxsoftApiBase(cfg) {
|
|
29766
|
+
return cfg.channels?.noxsoft?.apiUrl?.trim() || "https://auth.noxsoft.net";
|
|
29767
|
+
}
|
|
29768
|
+
function resolveNoxsoftToken(cfg) {
|
|
29769
|
+
const inlineToken = cfg.channels?.noxsoft?.token?.trim();
|
|
29770
|
+
if (inlineToken) return inlineToken;
|
|
29771
|
+
const tokenFile = cfg.channels?.noxsoft?.tokenFile?.trim() || TOKEN_PATH;
|
|
29772
|
+
try {
|
|
29773
|
+
const token = fs.readFileSync(tokenFile, "utf-8").trim();
|
|
29774
|
+
if (token) return token;
|
|
29775
|
+
} catch {}
|
|
29776
|
+
throw new Error(`NoxSoft token not configured. Expected token in ${tokenFile}`);
|
|
29777
|
+
}
|
|
29778
|
+
async function sendNoxsoftMessageDirect(params) {
|
|
29779
|
+
if (params.dryRun) return {
|
|
29780
|
+
channel: "noxsoft",
|
|
29781
|
+
to: params.to,
|
|
29782
|
+
via: "direct",
|
|
29783
|
+
mediaUrl: params.mediaUrl,
|
|
29784
|
+
mediaUrls: params.mediaUrls,
|
|
29785
|
+
dryRun: true
|
|
29786
|
+
};
|
|
29787
|
+
const token = resolveNoxsoftToken(params.cfg);
|
|
29788
|
+
const apiBase = resolveNoxsoftApiBase(params.cfg).replace(/\/+$/, "");
|
|
29789
|
+
const response = await fetch(`${apiBase}/api/agents/chat/channels/${params.to}/messages`, {
|
|
29790
|
+
method: "POST",
|
|
29791
|
+
headers: {
|
|
29792
|
+
Authorization: `Bearer ${token}`,
|
|
29793
|
+
"Content-Type": "application/json"
|
|
29794
|
+
},
|
|
29795
|
+
body: JSON.stringify({
|
|
29796
|
+
content: params.content,
|
|
29797
|
+
mediaUrl: params.mediaUrl ?? void 0,
|
|
29798
|
+
mediaUrls: params.mediaUrls?.length ? params.mediaUrls : void 0
|
|
29799
|
+
}),
|
|
29800
|
+
signal: params.abortSignal
|
|
29801
|
+
});
|
|
29802
|
+
if (!response.ok) {
|
|
29803
|
+
const text = await response.text().catch(() => "");
|
|
29804
|
+
throw new Error(`NoxSoft send failed (${response.status}): ${text}`);
|
|
29805
|
+
}
|
|
29806
|
+
const payload = await response.json().catch(() => ({}));
|
|
29807
|
+
const messageId = payload.messageId ?? payload.id ?? `noxsoft:${Date.now()}`;
|
|
29808
|
+
return {
|
|
29809
|
+
channel: "noxsoft",
|
|
29810
|
+
to: params.to,
|
|
29811
|
+
via: "direct",
|
|
29812
|
+
mediaUrl: params.mediaUrl,
|
|
29813
|
+
mediaUrls: params.mediaUrls,
|
|
29814
|
+
result: { messageId }
|
|
29815
|
+
};
|
|
29816
|
+
}
|
|
29435
29817
|
async function sendMessage(params) {
|
|
29436
29818
|
const cfg = params.cfg ?? loadConfig();
|
|
29437
|
-
const channel = params.channel?.trim() ?
|
|
29819
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29438
29820
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29439
|
-
const plugin = getChannelPlugin(channel);
|
|
29440
|
-
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29441
|
-
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29442
29821
|
const normalizedPayloads = normalizeReplyPayloadsForDelivery([{
|
|
29443
29822
|
text: params.content,
|
|
29444
29823
|
mediaUrl: params.mediaUrl,
|
|
@@ -29447,6 +29826,18 @@ async function sendMessage(params) {
|
|
|
29447
29826
|
const mirrorText = normalizedPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
29448
29827
|
const mirrorMediaUrls = normalizedPayloads.flatMap((payload) => payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []));
|
|
29449
29828
|
const primaryMediaUrl = mirrorMediaUrls[0] ?? params.mediaUrl ?? null;
|
|
29829
|
+
if (channel === "noxsoft") return sendNoxsoftMessageDirect({
|
|
29830
|
+
cfg,
|
|
29831
|
+
to: params.to,
|
|
29832
|
+
content: params.content,
|
|
29833
|
+
mediaUrl: primaryMediaUrl,
|
|
29834
|
+
mediaUrls: mirrorMediaUrls.length ? mirrorMediaUrls : void 0,
|
|
29835
|
+
dryRun: params.dryRun,
|
|
29836
|
+
abortSignal: params.abortSignal
|
|
29837
|
+
});
|
|
29838
|
+
const plugin = getChannelPlugin(channel);
|
|
29839
|
+
if (!plugin) throw new Error(`Unknown channel: ${channel}`);
|
|
29840
|
+
const deliveryMode = plugin.outbound?.deliveryMode ?? "direct";
|
|
29450
29841
|
if (params.dryRun) return {
|
|
29451
29842
|
channel,
|
|
29452
29843
|
to: params.to,
|
|
@@ -29525,7 +29916,7 @@ async function sendMessage(params) {
|
|
|
29525
29916
|
}
|
|
29526
29917
|
async function sendPoll(params) {
|
|
29527
29918
|
const cfg = params.cfg ?? loadConfig();
|
|
29528
|
-
const channel = params.channel?.trim() ?
|
|
29919
|
+
const channel = params.channel?.trim() ? normalizeMessageChannel(params.channel) : (await resolveMessageChannelSelection({ cfg })).channel;
|
|
29529
29920
|
if (!channel) throw new Error(`Unknown channel: ${params.channel}`);
|
|
29530
29921
|
const pollInput = {
|
|
29531
29922
|
question: params.question,
|
|
@@ -36143,6 +36534,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36143
36534
|
provider: params.followupRun.run.provider,
|
|
36144
36535
|
model: params.followupRun.run.model,
|
|
36145
36536
|
agentDir: params.followupRun.run.agentDir,
|
|
36537
|
+
sessionEntry: params.getActiveSessionEntry(),
|
|
36538
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36146
36539
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36147
36540
|
run: (provider, model) => {
|
|
36148
36541
|
params.opts?.onModelSelected?.({
|
|
@@ -36150,97 +36543,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36150
36543
|
model,
|
|
36151
36544
|
thinkLevel: params.followupRun.run.thinkLevel
|
|
36152
36545
|
});
|
|
36153
|
-
if (isCliProvider(provider, params.followupRun.run.config)) {
|
|
36154
|
-
const startedAt = Date.now();
|
|
36155
|
-
emitAgentEvent$1({
|
|
36156
|
-
runId,
|
|
36157
|
-
stream: "lifecycle",
|
|
36158
|
-
data: {
|
|
36159
|
-
phase: "start",
|
|
36160
|
-
startedAt
|
|
36161
|
-
}
|
|
36162
|
-
});
|
|
36163
|
-
const cliSessionId = getCliSessionId(params.getActiveSessionEntry(), provider);
|
|
36164
|
-
return (async () => {
|
|
36165
|
-
let lifecycleTerminalEmitted = false;
|
|
36166
|
-
let sawCliStream = false;
|
|
36167
|
-
let lastCliStreamText = "";
|
|
36168
|
-
try {
|
|
36169
|
-
const result = await runCliAgent({
|
|
36170
|
-
sessionId: params.followupRun.run.sessionId,
|
|
36171
|
-
sessionKey: params.sessionKey,
|
|
36172
|
-
agentId: params.followupRun.run.agentId,
|
|
36173
|
-
sessionFile: params.followupRun.run.sessionFile,
|
|
36174
|
-
workspaceDir: params.followupRun.run.workspaceDir,
|
|
36175
|
-
config: params.followupRun.run.config,
|
|
36176
|
-
prompt: params.commandBody,
|
|
36177
|
-
provider,
|
|
36178
|
-
model,
|
|
36179
|
-
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36180
|
-
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36181
|
-
runId,
|
|
36182
|
-
extraSystemPrompt: params.followupRun.run.extraSystemPrompt,
|
|
36183
|
-
ownerNumbers: params.followupRun.run.ownerNumbers,
|
|
36184
|
-
cliSessionId,
|
|
36185
|
-
images: params.opts?.images,
|
|
36186
|
-
onTextStream: (text) => {
|
|
36187
|
-
const nextText = text.trim();
|
|
36188
|
-
if (!nextText) return;
|
|
36189
|
-
sawCliStream = true;
|
|
36190
|
-
lastCliStreamText = nextText;
|
|
36191
|
-
emitAgentEvent$1({
|
|
36192
|
-
runId,
|
|
36193
|
-
stream: "assistant",
|
|
36194
|
-
data: { text: nextText }
|
|
36195
|
-
});
|
|
36196
|
-
}
|
|
36197
|
-
});
|
|
36198
|
-
const cliText = result.payloads?.[0]?.text?.trim();
|
|
36199
|
-
if (cliText && (!sawCliStream || cliText !== lastCliStreamText)) emitAgentEvent$1({
|
|
36200
|
-
runId,
|
|
36201
|
-
stream: "assistant",
|
|
36202
|
-
data: { text: cliText }
|
|
36203
|
-
});
|
|
36204
|
-
emitAgentEvent$1({
|
|
36205
|
-
runId,
|
|
36206
|
-
stream: "lifecycle",
|
|
36207
|
-
data: {
|
|
36208
|
-
phase: "end",
|
|
36209
|
-
startedAt,
|
|
36210
|
-
endedAt: Date.now()
|
|
36211
|
-
}
|
|
36212
|
-
});
|
|
36213
|
-
lifecycleTerminalEmitted = true;
|
|
36214
|
-
return result;
|
|
36215
|
-
} catch (err) {
|
|
36216
|
-
emitAgentEvent$1({
|
|
36217
|
-
runId,
|
|
36218
|
-
stream: "lifecycle",
|
|
36219
|
-
data: {
|
|
36220
|
-
phase: "error",
|
|
36221
|
-
startedAt,
|
|
36222
|
-
endedAt: Date.now(),
|
|
36223
|
-
error: String(err)
|
|
36224
|
-
}
|
|
36225
|
-
});
|
|
36226
|
-
lifecycleTerminalEmitted = true;
|
|
36227
|
-
throw err;
|
|
36228
|
-
} finally {
|
|
36229
|
-
if (!lifecycleTerminalEmitted) emitAgentEvent$1({
|
|
36230
|
-
runId,
|
|
36231
|
-
stream: "lifecycle",
|
|
36232
|
-
data: {
|
|
36233
|
-
phase: "error",
|
|
36234
|
-
startedAt,
|
|
36235
|
-
endedAt: Date.now(),
|
|
36236
|
-
error: "CLI run completed without lifecycle terminal event"
|
|
36237
|
-
}
|
|
36238
|
-
});
|
|
36239
|
-
}
|
|
36240
|
-
})();
|
|
36241
|
-
}
|
|
36242
36546
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36243
|
-
return
|
|
36547
|
+
return runNoxSoftEmbeddedAgent({
|
|
36244
36548
|
sessionId: params.followupRun.run.sessionId,
|
|
36245
36549
|
sessionKey: params.sessionKey,
|
|
36246
36550
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36277,6 +36581,8 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36277
36581
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36278
36582
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36279
36583
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36584
|
+
execSecurity: params.getActiveSessionEntry()?.execSecurity,
|
|
36585
|
+
cliSessionId: getCliSessionId(params.getActiveSessionEntry(), provider),
|
|
36280
36586
|
toolResultFormat: (() => {
|
|
36281
36587
|
const channel = resolveMessageChannel(params.sessionCtx.Surface, params.sessionCtx.Provider);
|
|
36282
36588
|
if (!channel) return "markdown";
|
|
@@ -36308,6 +36614,11 @@ async function runAgentTurnWithFallback(params) {
|
|
|
36308
36614
|
});
|
|
36309
36615
|
} : void 0,
|
|
36310
36616
|
onAgentEvent: async (evt) => {
|
|
36617
|
+
emitAgentEvent$1({
|
|
36618
|
+
runId,
|
|
36619
|
+
stream: evt.stream,
|
|
36620
|
+
data: evt.data
|
|
36621
|
+
});
|
|
36311
36622
|
if (evt.stream === "tool") {
|
|
36312
36623
|
const phase = typeof evt.data.phase === "string" ? evt.data.phase : "";
|
|
36313
36624
|
if (phase === "start" || phase === "update") await params.typingSignals.signalToolStart();
|
|
@@ -36577,10 +36888,12 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36577
36888
|
provider: params.followupRun.run.provider,
|
|
36578
36889
|
model: params.followupRun.run.model,
|
|
36579
36890
|
agentDir: params.followupRun.run.agentDir,
|
|
36891
|
+
sessionEntry: params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0) ?? void 0,
|
|
36892
|
+
thinkLevel: params.followupRun.run.thinkLevel,
|
|
36580
36893
|
fallbacksOverride: resolveAgentModelFallbacksOverride(params.followupRun.run.config, resolveAgentIdFromSessionKey(params.followupRun.run.sessionKey)),
|
|
36581
36894
|
run: (provider, model) => {
|
|
36582
36895
|
const authProfileId = provider === params.followupRun.run.provider ? params.followupRun.run.authProfileId : void 0;
|
|
36583
|
-
return
|
|
36896
|
+
return runNoxSoftEmbeddedAgent({
|
|
36584
36897
|
sessionId: params.followupRun.run.sessionId,
|
|
36585
36898
|
sessionKey: params.sessionKey,
|
|
36586
36899
|
agentId: params.followupRun.run.agentId,
|
|
@@ -36614,6 +36927,7 @@ async function runMemoryFlushIfNeeded(params) {
|
|
|
36614
36927
|
verboseLevel: params.followupRun.run.verboseLevel,
|
|
36615
36928
|
reasoningLevel: params.followupRun.run.reasoningLevel,
|
|
36616
36929
|
execOverrides: params.followupRun.run.execOverrides,
|
|
36930
|
+
execSecurity: (params.sessionEntry ?? (params.sessionKey ? params.sessionStore?.[params.sessionKey] : void 0))?.execSecurity,
|
|
36617
36931
|
bashElevated: params.followupRun.run.bashElevated,
|
|
36618
36932
|
timeoutMs: params.followupRun.run.timeoutMs,
|
|
36619
36933
|
runId: flushRunId,
|
|
@@ -36949,10 +37263,12 @@ function createFollowupRunner(params) {
|
|
|
36949
37263
|
provider: queued.run.provider,
|
|
36950
37264
|
model: queued.run.model,
|
|
36951
37265
|
agentDir: queued.run.agentDir,
|
|
37266
|
+
sessionEntry: (sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry ?? void 0,
|
|
37267
|
+
thinkLevel: queued.run.thinkLevel,
|
|
36952
37268
|
fallbacksOverride: resolveAgentModelFallbacksOverride(queued.run.config, resolveAgentIdFromSessionKey(queued.run.sessionKey)),
|
|
36953
37269
|
run: (provider, model) => {
|
|
36954
37270
|
const authProfileId = provider === queued.run.provider ? queued.run.authProfileId : void 0;
|
|
36955
|
-
return
|
|
37271
|
+
return runNoxSoftEmbeddedAgent({
|
|
36956
37272
|
sessionId: queued.run.sessionId,
|
|
36957
37273
|
sessionKey: queued.run.sessionKey,
|
|
36958
37274
|
agentId: queued.run.agentId,
|
|
@@ -36983,6 +37299,7 @@ function createFollowupRunner(params) {
|
|
|
36983
37299
|
verboseLevel: queued.run.verboseLevel,
|
|
36984
37300
|
reasoningLevel: queued.run.reasoningLevel,
|
|
36985
37301
|
execOverrides: queued.run.execOverrides,
|
|
37302
|
+
execSecurity: ((sessionKey ? sessionStore?.[sessionKey] : void 0) ?? sessionEntry)?.execSecurity,
|
|
36986
37303
|
bashElevated: queued.run.bashElevated,
|
|
36987
37304
|
timeoutMs: queued.run.timeoutMs,
|
|
36988
37305
|
runId,
|
|
@@ -37963,7 +38280,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
37963
38280
|
return;
|
|
37964
38281
|
}
|
|
37965
38282
|
try {
|
|
37966
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
38283
|
+
const { deliverOutboundPayloads } = await import("./deliver-B-dPbUIs.js").then((n) => n.n);
|
|
37967
38284
|
await deliverOutboundPayloads({
|
|
37968
38285
|
cfg: params.cfg,
|
|
37969
38286
|
channel,
|
|
@@ -39392,7 +39709,7 @@ function createWhatsAppLoginTool() {
|
|
|
39392
39709
|
force: Type.Optional(Type.Boolean())
|
|
39393
39710
|
}),
|
|
39394
39711
|
execute: async (_toolCallId, args) => {
|
|
39395
|
-
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-
|
|
39712
|
+
const { startWebLoginWithQr, waitForWebLogin } = await import("./login-qr-BGbHImRb.js");
|
|
39396
39713
|
if ((args?.action ?? "start") === "wait") {
|
|
39397
39714
|
const result = await waitForWebLogin({ timeoutMs: typeof args.timeoutMs === "number" ? args.timeoutMs : void 0 });
|
|
39398
39715
|
return {
|
|
@@ -40322,23 +40639,23 @@ let webLoginQrPromise = null;
|
|
|
40322
40639
|
let webChannelPromise = null;
|
|
40323
40640
|
let whatsappActionsPromise = null;
|
|
40324
40641
|
function loadWebOutbound() {
|
|
40325
|
-
webOutboundPromise ??= import("./outbound-
|
|
40642
|
+
webOutboundPromise ??= import("./outbound-DW2eod1S.js").then((n) => n.t);
|
|
40326
40643
|
return webOutboundPromise;
|
|
40327
40644
|
}
|
|
40328
40645
|
function loadWebLogin() {
|
|
40329
|
-
webLoginPromise ??= import("./login-
|
|
40646
|
+
webLoginPromise ??= import("./login-BTOKtSQN.js").then((n) => n.n);
|
|
40330
40647
|
return webLoginPromise;
|
|
40331
40648
|
}
|
|
40332
40649
|
function loadWebLoginQr() {
|
|
40333
|
-
webLoginQrPromise ??= import("./login-qr-
|
|
40650
|
+
webLoginQrPromise ??= import("./login-qr-BGbHImRb.js");
|
|
40334
40651
|
return webLoginQrPromise;
|
|
40335
40652
|
}
|
|
40336
40653
|
function loadWebChannel() {
|
|
40337
|
-
webChannelPromise ??= import("./web-
|
|
40654
|
+
webChannelPromise ??= import("./web-BHGK5GtV.js");
|
|
40338
40655
|
return webChannelPromise;
|
|
40339
40656
|
}
|
|
40340
40657
|
function loadWhatsAppActions() {
|
|
40341
|
-
whatsappActionsPromise ??= import("./whatsapp-actions-
|
|
40658
|
+
whatsappActionsPromise ??= import("./whatsapp-actions-6fPRKwPV.js");
|
|
40342
40659
|
return whatsappActionsPromise;
|
|
40343
40660
|
}
|
|
40344
40661
|
function createPluginRuntime() {
|
|
@@ -42606,15 +42923,6 @@ function createAnimaCodingTools(options) {
|
|
|
42606
42923
|
|
|
42607
42924
|
//#endregion
|
|
42608
42925
|
//#region src/agents/gemini-direct-runner.ts
|
|
42609
|
-
/**
|
|
42610
|
-
* Gemini Direct API Runner
|
|
42611
|
-
*
|
|
42612
|
-
* Makes calls directly to generativelanguage.googleapis.com without needing
|
|
42613
|
-
* a CLI wrapper. Works with Google API keys (GEMINI_API_KEY).
|
|
42614
|
-
*
|
|
42615
|
-
* This runner is automatically used when a google API key is available
|
|
42616
|
-
* and the provider is set to "google" or "gemini".
|
|
42617
|
-
*/
|
|
42618
42926
|
const log = createSubsystemLogger("agent/gemini-direct");
|
|
42619
42927
|
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
42620
42928
|
const MODEL_MAP = {
|
|
@@ -42706,7 +43014,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42706
43014
|
cwd: process.cwd(),
|
|
42707
43015
|
moduleUrl: import.meta.url
|
|
42708
43016
|
});
|
|
42709
|
-
const extraSystemPrompt =
|
|
43017
|
+
const extraSystemPrompt = appendRunnerCapabilityPrompt(params.extraSystemPrompt, "local-tools");
|
|
42710
43018
|
const systemPrompt = buildSystemPrompt({
|
|
42711
43019
|
workspaceDir,
|
|
42712
43020
|
config: params.config,
|
|
@@ -42785,7 +43093,6 @@ async function runGeminiDirectAgent(params) {
|
|
|
42785
43093
|
};
|
|
42786
43094
|
}
|
|
42787
43095
|
if (!response.body) throw new Error("No response body received from Gemini API");
|
|
42788
|
-
await params.onAssistantMessageStart?.();
|
|
42789
43096
|
const bodyStream = Readable.fromWeb(response.body);
|
|
42790
43097
|
let buffer = "";
|
|
42791
43098
|
let chunkAssistantText = "";
|
|
@@ -42811,12 +43118,11 @@ async function runGeminiDirectAgent(params) {
|
|
|
42811
43118
|
nonTextParts.push(p);
|
|
42812
43119
|
if (p.functionCall) functionCalls.push(p.functionCall);
|
|
42813
43120
|
}
|
|
42814
|
-
if (parsed.candidates?.[0]?.finishReason) parsed.candidates[0].finishReason;
|
|
42815
43121
|
if (parsed.usageMetadata) {
|
|
42816
43122
|
totalInputTokens = Math.max(totalInputTokens, parsed.usageMetadata.promptTokenCount ?? 0);
|
|
42817
43123
|
totalOutputTokens += parsed.usageMetadata.candidatesTokenCount ?? 0;
|
|
42818
43124
|
}
|
|
42819
|
-
} catch
|
|
43125
|
+
} catch {}
|
|
42820
43126
|
}
|
|
42821
43127
|
}
|
|
42822
43128
|
if (functionCalls.length > 0) {
|
|
@@ -42876,7 +43182,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42876
43182
|
const errorMsg = isAbort ? `Request timed out after ${params.timeoutMs}ms` : String(err);
|
|
42877
43183
|
log.error(`gemini api error: ${errorMsg}`, { error: String(err) });
|
|
42878
43184
|
return {
|
|
42879
|
-
status: "failed",
|
|
43185
|
+
status: isAbort ? "timeout" : "failed",
|
|
42880
43186
|
meta: {
|
|
42881
43187
|
durationMs: Date.now() - started,
|
|
42882
43188
|
error: {
|
|
@@ -42913,7 +43219,7 @@ async function runGeminiDirectAgent(params) {
|
|
|
42913
43219
|
}
|
|
42914
43220
|
|
|
42915
43221
|
//#endregion
|
|
42916
|
-
//#region src/agents/
|
|
43222
|
+
//#region src/agents/noxsoft-runner.ts
|
|
42917
43223
|
function normalizeEmbeddedProvider(provider) {
|
|
42918
43224
|
return normalizeProviderId(provider ?? "") || "anthropic";
|
|
42919
43225
|
}
|
|
@@ -42934,178 +43240,375 @@ async function emitAgentEvent(params, stream, data) {
|
|
|
42934
43240
|
data
|
|
42935
43241
|
});
|
|
42936
43242
|
}
|
|
42937
|
-
|
|
42938
|
-
|
|
42939
|
-
if (
|
|
43243
|
+
function resolveDirectAuthProvider(provider) {
|
|
43244
|
+
if (provider === "anthropic" || provider === "claude") return "anthropic";
|
|
43245
|
+
if (provider === "google" || provider === "gemini") return "google";
|
|
43246
|
+
return null;
|
|
43247
|
+
}
|
|
43248
|
+
function resolveProfileFailureReason(result) {
|
|
43249
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43250
|
+
if (kind === "auth") return "auth";
|
|
43251
|
+
if (kind === "rate_limit") return "rate_limit";
|
|
43252
|
+
const classified = classifyFailoverReason(result.meta.error?.message ?? "");
|
|
43253
|
+
if (classified === "billing") return "billing";
|
|
43254
|
+
if (classified === "auth") return "auth";
|
|
43255
|
+
if (classified === "rate_limit") return "rate_limit";
|
|
43256
|
+
}
|
|
43257
|
+
function resolveResultErrorKind(result) {
|
|
43258
|
+
const kind = result.meta.error?.kind?.trim().toLowerCase();
|
|
43259
|
+
if (kind) return kind;
|
|
43260
|
+
return result.status === "timeout" ? "timeout" : "unknown";
|
|
43261
|
+
}
|
|
43262
|
+
function normalizeResultStatus(result) {
|
|
43263
|
+
const kind = resolveResultErrorKind(result);
|
|
43264
|
+
if (result.status === "timeout" || kind === "timeout") return "timeout";
|
|
43265
|
+
return result.status;
|
|
43266
|
+
}
|
|
43267
|
+
function normalizeResultPayloads(result) {
|
|
43268
|
+
const payloads = result.payloads?.filter((payload) => payload && typeof payload === "object");
|
|
43269
|
+
if (payloads && payloads.length > 0) return payloads;
|
|
43270
|
+
const output = result.output?.trim();
|
|
43271
|
+
return output ? [{ text: output }] : void 0;
|
|
43272
|
+
}
|
|
43273
|
+
function normalizeResultOutput(result, payloads) {
|
|
43274
|
+
const directOutput = result.output?.trim();
|
|
43275
|
+
if (directOutput) return directOutput;
|
|
43276
|
+
return payloads?.find((payload) => payload.text?.trim())?.text?.trim() || void 0;
|
|
43277
|
+
}
|
|
43278
|
+
function normalizeRunnerResult(params) {
|
|
43279
|
+
const payloads = normalizeResultPayloads(params.result);
|
|
43280
|
+
const output = normalizeResultOutput(params.result, payloads);
|
|
43281
|
+
const usage = normalizeUsage(params.result.meta.agentMeta?.usage);
|
|
43282
|
+
const lastCallUsage = normalizeUsage(params.result.meta.agentMeta?.lastCallUsage);
|
|
43283
|
+
const promptTokens = params.result.meta.agentMeta?.promptTokens ?? derivePromptTokens(usage ?? lastCallUsage);
|
|
43284
|
+
const status = normalizeResultStatus(params.result);
|
|
43285
|
+
const errorMessage = params.result.meta.error?.message?.trim();
|
|
43286
|
+
const errorKind = resolveResultErrorKind(params.result);
|
|
43287
|
+
return {
|
|
43288
|
+
...params.result,
|
|
43289
|
+
status,
|
|
43290
|
+
output,
|
|
43291
|
+
payloads,
|
|
43292
|
+
meta: {
|
|
43293
|
+
...params.result.meta,
|
|
43294
|
+
error: status === "completed" && !errorMessage ? void 0 : {
|
|
43295
|
+
message: errorMessage || (status === "timeout" ? "Request timed out." : "Runner execution failed."),
|
|
43296
|
+
kind: errorKind
|
|
43297
|
+
},
|
|
43298
|
+
agentMeta: {
|
|
43299
|
+
...params.result.meta.agentMeta,
|
|
43300
|
+
sessionId: params.result.meta.agentMeta?.sessionId?.trim() || params.sessionId,
|
|
43301
|
+
provider: params.provider,
|
|
43302
|
+
model: params.model ?? params.result.meta.agentMeta?.model,
|
|
43303
|
+
usage,
|
|
43304
|
+
promptTokens,
|
|
43305
|
+
lastCallUsage
|
|
43306
|
+
}
|
|
43307
|
+
}
|
|
43308
|
+
};
|
|
43309
|
+
}
|
|
43310
|
+
function coerceResultFailure(params) {
|
|
43311
|
+
if (params.result.status === "completed") return null;
|
|
43312
|
+
const message = params.result.meta.error?.message?.trim() || (params.result.status === "timeout" ? "Request timed out." : "Runner execution failed.");
|
|
43313
|
+
const reason = classifyFailoverReason(message) ?? resolveResultErrorKind(params.result);
|
|
43314
|
+
return new FailoverError(message, {
|
|
43315
|
+
reason: reason === "timeout" ? "timeout" : reason,
|
|
43316
|
+
provider: params.provider,
|
|
43317
|
+
model: params.model,
|
|
43318
|
+
status: resolveFailoverStatus(reason)
|
|
43319
|
+
});
|
|
43320
|
+
}
|
|
43321
|
+
async function resolveDirectProviderAuth(params) {
|
|
43322
|
+
return resolveApiKeyForProvider({
|
|
43323
|
+
provider: params.provider,
|
|
43324
|
+
cfg: params.config,
|
|
43325
|
+
preferredProfile: params.preferredProfile,
|
|
43326
|
+
agentDir: params.agentDir,
|
|
43327
|
+
store: params.store
|
|
43328
|
+
});
|
|
43329
|
+
}
|
|
43330
|
+
async function runDirectWithProfileFallback(params) {
|
|
43331
|
+
const store = ensureAuthProfileStore(params.agentDir, { allowKeychainPrompt: false });
|
|
43332
|
+
const attemptedAuthSources = /* @__PURE__ */ new Set();
|
|
43333
|
+
let preferredProfile = params.authProfileId;
|
|
43334
|
+
let lastResult = null;
|
|
43335
|
+
for (;;) {
|
|
43336
|
+
const auth = await resolveDirectProviderAuth({
|
|
43337
|
+
provider: params.directProvider,
|
|
43338
|
+
config: params.config,
|
|
43339
|
+
agentDir: params.agentDir,
|
|
43340
|
+
preferredProfile,
|
|
43341
|
+
store
|
|
43342
|
+
});
|
|
43343
|
+
const authSourceKey = auth.profileId ?? `${auth.mode}:${auth.source}`;
|
|
43344
|
+
if (attemptedAuthSources.has(authSourceKey)) return lastResult ?? {
|
|
43345
|
+
status: "failed",
|
|
43346
|
+
meta: {
|
|
43347
|
+
durationMs: 0,
|
|
43348
|
+
error: {
|
|
43349
|
+
message: `Auth fallback loop detected for ${params.directProvider}.`,
|
|
43350
|
+
kind: "unknown"
|
|
43351
|
+
}
|
|
43352
|
+
}
|
|
43353
|
+
};
|
|
43354
|
+
attemptedAuthSources.add(authSourceKey);
|
|
43355
|
+
const result = params.directProvider === "anthropic" ? await runAnthropicDirectAgent({
|
|
43356
|
+
token: auth.apiKey ?? "",
|
|
43357
|
+
sessionId: params.sessionId,
|
|
43358
|
+
sessionKey: params.sessionKey,
|
|
43359
|
+
agentId: params.agentId,
|
|
43360
|
+
sessionFile: params.sessionFile,
|
|
43361
|
+
workspaceDir: params.workspaceDir,
|
|
43362
|
+
config: params.config,
|
|
43363
|
+
prompt: params.prompt,
|
|
43364
|
+
model: params.model,
|
|
43365
|
+
thinkLevel: params.thinkLevel,
|
|
43366
|
+
timeoutMs: params.timeoutMs,
|
|
43367
|
+
runId: params.runId,
|
|
43368
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43369
|
+
ownerNumbers: params.ownerNumbers,
|
|
43370
|
+
onPartialReply: params.emitPartial,
|
|
43371
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43372
|
+
}) : await runGeminiDirectAgent({
|
|
43373
|
+
apiKey: auth.apiKey ?? "",
|
|
43374
|
+
sessionId: params.sessionId,
|
|
43375
|
+
sessionKey: params.sessionKey,
|
|
43376
|
+
agentId: params.agentId,
|
|
43377
|
+
sessionFile: params.sessionFile,
|
|
43378
|
+
workspaceDir: params.workspaceDir,
|
|
43379
|
+
config: params.config,
|
|
43380
|
+
prompt: params.prompt,
|
|
43381
|
+
model: params.model,
|
|
43382
|
+
thinkLevel: params.thinkLevel,
|
|
43383
|
+
timeoutMs: params.timeoutMs,
|
|
43384
|
+
runId: params.runId,
|
|
43385
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43386
|
+
ownerNumbers: params.ownerNumbers,
|
|
43387
|
+
onPartialReply: params.emitPartial,
|
|
43388
|
+
onAssistantMessageStart: params.onAssistantMessageStart
|
|
43389
|
+
});
|
|
43390
|
+
if (result.status === "completed") {
|
|
43391
|
+
if (auth.profileId) {
|
|
43392
|
+
await markAuthProfileUsed({
|
|
43393
|
+
store,
|
|
43394
|
+
profileId: auth.profileId,
|
|
43395
|
+
agentDir: params.agentDir
|
|
43396
|
+
});
|
|
43397
|
+
await markAuthProfileGood({
|
|
43398
|
+
store,
|
|
43399
|
+
provider: params.directProvider,
|
|
43400
|
+
profileId: auth.profileId,
|
|
43401
|
+
agentDir: params.agentDir
|
|
43402
|
+
});
|
|
43403
|
+
}
|
|
43404
|
+
return result;
|
|
43405
|
+
}
|
|
43406
|
+
lastResult = result;
|
|
43407
|
+
const failureReason = resolveProfileFailureReason(result);
|
|
43408
|
+
if (!auth.profileId || !failureReason) return result;
|
|
43409
|
+
await markAuthProfileFailure({
|
|
43410
|
+
store,
|
|
43411
|
+
profileId: auth.profileId,
|
|
43412
|
+
reason: failureReason,
|
|
43413
|
+
cfg: params.config,
|
|
43414
|
+
agentDir: params.agentDir
|
|
43415
|
+
});
|
|
43416
|
+
preferredProfile = void 0;
|
|
43417
|
+
}
|
|
43418
|
+
}
|
|
43419
|
+
async function resolveDirectStrategy(provider, config, agentDir) {
|
|
43420
|
+
const directProvider = resolveDirectAuthProvider(provider);
|
|
43421
|
+
if (!directProvider) return null;
|
|
43422
|
+
try {
|
|
43423
|
+
const auth = await resolveDirectProviderAuth({
|
|
43424
|
+
provider: directProvider,
|
|
43425
|
+
config,
|
|
43426
|
+
agentDir,
|
|
43427
|
+
store: ensureAuthProfileStore(agentDir, { allowKeychainPrompt: false })
|
|
43428
|
+
});
|
|
43429
|
+
if (auth.apiKey) {
|
|
43430
|
+
if (directProvider === "anthropic" && auth.apiKey.startsWith("sk-ant-oat01-")) return null;
|
|
43431
|
+
return {
|
|
43432
|
+
kind: directProvider === "google" ? "gemini-direct" : "anthropic-direct",
|
|
43433
|
+
provider
|
|
43434
|
+
};
|
|
43435
|
+
}
|
|
43436
|
+
} catch {}
|
|
43437
|
+
return null;
|
|
43438
|
+
}
|
|
43439
|
+
async function resolveNoxSoftRunnerStrategy(params) {
|
|
42940
43440
|
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43441
|
+
const direct = await resolveDirectStrategy(provider, params.config, params.agentDir);
|
|
43442
|
+
if (direct) return direct;
|
|
43443
|
+
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43444
|
+
if (!resolveCliBackendConfig(cliProvider, params.config)) throw new Error(`No CLI backend available for provider "${provider}" (resolved "${cliProvider}").\nEither:\n • Run: anima setup-token (set an Anthropic API key — no CLI needed)\n • Install the matching CLI and log in`);
|
|
43445
|
+
return {
|
|
43446
|
+
kind: "cli",
|
|
43447
|
+
provider,
|
|
43448
|
+
cliProvider
|
|
43449
|
+
};
|
|
43450
|
+
}
|
|
43451
|
+
async function runNoxSoftEmbeddedAgent(params) {
|
|
43452
|
+
const provider = normalizeEmbeddedProvider(params.provider);
|
|
43453
|
+
const normalizedRequestedRef = params.model?.trim() ? normalizeModelRef(provider, params.model) : null;
|
|
42941
43454
|
const startedAt = Date.now();
|
|
42942
43455
|
const runId = params.runId?.trim() || crypto.randomUUID();
|
|
42943
43456
|
const timeoutMs = typeof params.timeoutMs === "number" && params.timeoutMs > 0 ? params.timeoutMs : 12e4;
|
|
42944
43457
|
let assistantStarted = false;
|
|
42945
43458
|
const streamTasks = [];
|
|
42946
|
-
|
|
42947
|
-
|
|
42948
|
-
|
|
42949
|
-
|
|
42950
|
-
|
|
42951
|
-
|
|
42952
|
-
|
|
42953
|
-
|
|
42954
|
-
|
|
42955
|
-
|
|
42956
|
-
|
|
42957
|
-
|
|
42958
|
-
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42962
|
-
|
|
42963
|
-
|
|
42964
|
-
|
|
42965
|
-
|
|
42966
|
-
|
|
43459
|
+
const emitPartial = async (payload) => {
|
|
43460
|
+
if (!assistantStarted) {
|
|
43461
|
+
assistantStarted = true;
|
|
43462
|
+
await params.onAssistantMessageStart?.();
|
|
43463
|
+
}
|
|
43464
|
+
await params.onPartialReply?.(payload);
|
|
43465
|
+
await emitAgentEvent(params, "assistant", { text: payload.text });
|
|
43466
|
+
};
|
|
43467
|
+
const strategy = await resolveNoxSoftRunnerStrategy({
|
|
43468
|
+
provider: params.provider,
|
|
43469
|
+
config: params.config,
|
|
43470
|
+
agentDir: params.agentDir
|
|
43471
|
+
});
|
|
43472
|
+
if (strategy.kind === "anthropic-direct") {
|
|
43473
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43474
|
+
phase: "start",
|
|
43475
|
+
startedAt
|
|
43476
|
+
});
|
|
43477
|
+
try {
|
|
43478
|
+
const result = normalizeRunnerResult({
|
|
43479
|
+
result: await runDirectWithProfileFallback({
|
|
43480
|
+
...params,
|
|
43481
|
+
directProvider: "anthropic",
|
|
42967
43482
|
timeoutMs,
|
|
42968
43483
|
runId,
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42972
|
-
|
|
42973
|
-
|
|
42974
|
-
|
|
42975
|
-
|
|
42976
|
-
|
|
42977
|
-
|
|
42978
|
-
|
|
42979
|
-
|
|
42980
|
-
|
|
42981
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
42982
|
-
phase: "end",
|
|
42983
|
-
durationMs: Date.now() - startedAt,
|
|
42984
|
-
status: result.status
|
|
42985
|
-
});
|
|
42986
|
-
return result;
|
|
42987
|
-
} catch (err) {
|
|
43484
|
+
emitPartial
|
|
43485
|
+
}),
|
|
43486
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43487
|
+
model: normalizedRequestedRef?.model,
|
|
43488
|
+
sessionId: params.sessionId
|
|
43489
|
+
});
|
|
43490
|
+
const failure = coerceResultFailure({
|
|
43491
|
+
result,
|
|
43492
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43493
|
+
model: result.meta.agentMeta?.model
|
|
43494
|
+
});
|
|
43495
|
+
if (failure) {
|
|
42988
43496
|
await emitAgentEvent(params, "lifecycle", {
|
|
42989
43497
|
phase: "error",
|
|
42990
|
-
|
|
43498
|
+
startedAt,
|
|
43499
|
+
endedAt: Date.now(),
|
|
43500
|
+
error: failure.message,
|
|
43501
|
+
status: result.status
|
|
42991
43502
|
});
|
|
42992
|
-
throw
|
|
43503
|
+
throw failure;
|
|
42993
43504
|
}
|
|
42994
|
-
}
|
|
42995
|
-
}
|
|
42996
|
-
if (provider === "google" || provider === "gemini") {
|
|
42997
|
-
const geminiApiKey = (await resolveApiKeyForProvider({
|
|
42998
|
-
provider: "google",
|
|
42999
|
-
cfg: params.config
|
|
43000
|
-
}))?.apiKey;
|
|
43001
|
-
if (geminiApiKey) {
|
|
43002
43505
|
await emitAgentEvent(params, "lifecycle", {
|
|
43003
|
-
phase: "
|
|
43004
|
-
startedAt
|
|
43506
|
+
phase: "end",
|
|
43507
|
+
durationMs: Date.now() - startedAt,
|
|
43508
|
+
status: result.status
|
|
43005
43509
|
});
|
|
43006
|
-
|
|
43007
|
-
|
|
43008
|
-
|
|
43009
|
-
|
|
43010
|
-
|
|
43011
|
-
|
|
43012
|
-
|
|
43013
|
-
|
|
43014
|
-
|
|
43015
|
-
|
|
43016
|
-
|
|
43017
|
-
|
|
43510
|
+
return result;
|
|
43511
|
+
} catch (err) {
|
|
43512
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43513
|
+
phase: "error",
|
|
43514
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43515
|
+
});
|
|
43516
|
+
throw err;
|
|
43517
|
+
}
|
|
43518
|
+
}
|
|
43519
|
+
if (strategy.kind === "gemini-direct") {
|
|
43520
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43521
|
+
phase: "start",
|
|
43522
|
+
startedAt
|
|
43523
|
+
});
|
|
43524
|
+
try {
|
|
43525
|
+
const result = normalizeRunnerResult({
|
|
43526
|
+
result: await runDirectWithProfileFallback({
|
|
43527
|
+
...params,
|
|
43528
|
+
directProvider: "google",
|
|
43018
43529
|
timeoutMs,
|
|
43019
43530
|
runId,
|
|
43020
|
-
|
|
43021
|
-
|
|
43022
|
-
|
|
43023
|
-
|
|
43024
|
-
|
|
43025
|
-
|
|
43026
|
-
|
|
43027
|
-
|
|
43028
|
-
|
|
43029
|
-
|
|
43030
|
-
|
|
43031
|
-
|
|
43032
|
-
await emitAgentEvent(params, "lifecycle", {
|
|
43033
|
-
phase: "end",
|
|
43034
|
-
durationMs: Date.now() - startedAt,
|
|
43035
|
-
status: result.status
|
|
43036
|
-
});
|
|
43037
|
-
return result;
|
|
43038
|
-
} catch (err) {
|
|
43531
|
+
emitPartial
|
|
43532
|
+
}),
|
|
43533
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43534
|
+
model: normalizedRequestedRef?.model,
|
|
43535
|
+
sessionId: params.sessionId
|
|
43536
|
+
});
|
|
43537
|
+
const failure = coerceResultFailure({
|
|
43538
|
+
result,
|
|
43539
|
+
provider: result.meta.agentMeta?.provider ?? provider,
|
|
43540
|
+
model: result.meta.agentMeta?.model
|
|
43541
|
+
});
|
|
43542
|
+
if (failure) {
|
|
43039
43543
|
await emitAgentEvent(params, "lifecycle", {
|
|
43040
43544
|
phase: "error",
|
|
43041
|
-
|
|
43545
|
+
startedAt,
|
|
43546
|
+
endedAt: Date.now(),
|
|
43547
|
+
error: failure.message,
|
|
43548
|
+
status: result.status
|
|
43042
43549
|
});
|
|
43043
|
-
throw
|
|
43550
|
+
throw failure;
|
|
43044
43551
|
}
|
|
43552
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43553
|
+
phase: "end",
|
|
43554
|
+
durationMs: Date.now() - startedAt,
|
|
43555
|
+
status: result.status
|
|
43556
|
+
});
|
|
43557
|
+
return result;
|
|
43558
|
+
} catch (err) {
|
|
43559
|
+
await emitAgentEvent(params, "lifecycle", {
|
|
43560
|
+
phase: "error",
|
|
43561
|
+
error: String(err instanceof Error ? err.message : err)
|
|
43562
|
+
});
|
|
43563
|
+
throw err;
|
|
43045
43564
|
}
|
|
43046
43565
|
}
|
|
43047
|
-
const cliProvider = resolveCompatCliProvider(provider, params.config);
|
|
43048
|
-
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`);
|
|
43049
43566
|
await emitAgentEvent(params, "lifecycle", {
|
|
43050
43567
|
phase: "start",
|
|
43051
43568
|
startedAt
|
|
43052
43569
|
});
|
|
43053
43570
|
try {
|
|
43054
|
-
const result =
|
|
43055
|
-
|
|
43056
|
-
|
|
43057
|
-
|
|
43058
|
-
|
|
43059
|
-
|
|
43060
|
-
|
|
43061
|
-
|
|
43062
|
-
|
|
43063
|
-
|
|
43064
|
-
|
|
43065
|
-
|
|
43066
|
-
|
|
43067
|
-
|
|
43068
|
-
|
|
43069
|
-
|
|
43070
|
-
|
|
43071
|
-
|
|
43072
|
-
|
|
43073
|
-
|
|
43074
|
-
|
|
43075
|
-
|
|
43076
|
-
|
|
43077
|
-
}
|
|
43078
|
-
|
|
43079
|
-
|
|
43080
|
-
|
|
43081
|
-
|
|
43082
|
-
|
|
43571
|
+
const result = normalizeRunnerResult({
|
|
43572
|
+
result: await runCliAgent({
|
|
43573
|
+
sessionId: params.sessionId,
|
|
43574
|
+
sessionKey: params.sessionKey,
|
|
43575
|
+
agentId: params.agentId,
|
|
43576
|
+
sessionFile: params.sessionFile,
|
|
43577
|
+
workspaceDir: params.workspaceDir,
|
|
43578
|
+
config: params.config,
|
|
43579
|
+
prompt: params.prompt,
|
|
43580
|
+
provider: strategy.cliProvider,
|
|
43581
|
+
model: params.model,
|
|
43582
|
+
thinkLevel: params.thinkLevel,
|
|
43583
|
+
timeoutMs,
|
|
43584
|
+
runId,
|
|
43585
|
+
extraSystemPrompt: params.extraSystemPrompt,
|
|
43586
|
+
ownerNumbers: params.ownerNumbers,
|
|
43587
|
+
cliSessionId: params.cliSessionId,
|
|
43588
|
+
sessionExecSecurity: params.execSecurity,
|
|
43589
|
+
images: params.images,
|
|
43590
|
+
streamParams: params.streamParams,
|
|
43591
|
+
onTextStream: (text) => {
|
|
43592
|
+
const nextText = text.trim();
|
|
43593
|
+
if (!nextText) return;
|
|
43594
|
+
streamTasks.push(emitPartial({ text: nextText }));
|
|
43595
|
+
}
|
|
43596
|
+
}),
|
|
43597
|
+
provider: normalizedRequestedRef?.provider ?? provider,
|
|
43598
|
+
model: normalizedRequestedRef?.model,
|
|
43599
|
+
sessionId: params.sessionId
|
|
43083
43600
|
});
|
|
43084
43601
|
if (streamTasks.length > 0) await Promise.allSettled(streamTasks);
|
|
43085
43602
|
const finalText = result.payloads?.[0]?.text?.trim();
|
|
43086
|
-
if (finalText && !assistantStarted) {
|
|
43087
|
-
assistantStarted = true;
|
|
43088
|
-
await params.onAssistantMessageStart?.();
|
|
43089
|
-
await params.onPartialReply?.({ text: finalText });
|
|
43090
|
-
await emitAgentEvent(params, "assistant", { text: finalText });
|
|
43091
|
-
}
|
|
43603
|
+
if (finalText && !assistantStarted) await emitPartial({ text: finalText });
|
|
43092
43604
|
await emitAgentEvent(params, "lifecycle", {
|
|
43093
43605
|
phase: "end",
|
|
43094
43606
|
startedAt,
|
|
43095
43607
|
endedAt: Date.now(),
|
|
43096
|
-
aborted: false
|
|
43608
|
+
aborted: false,
|
|
43609
|
+
status: result.status
|
|
43097
43610
|
});
|
|
43098
|
-
return
|
|
43099
|
-
...result,
|
|
43100
|
-
meta: {
|
|
43101
|
-
...result.meta,
|
|
43102
|
-
agentMeta: {
|
|
43103
|
-
...result.meta.agentMeta,
|
|
43104
|
-
provider,
|
|
43105
|
-
model: params.model?.trim() || result.meta.agentMeta?.model
|
|
43106
|
-
}
|
|
43107
|
-
}
|
|
43108
|
-
};
|
|
43611
|
+
return result;
|
|
43109
43612
|
} catch (error) {
|
|
43110
43613
|
const message = error instanceof Error ? error.message : String(error);
|
|
43111
43614
|
await emitAgentEvent(params, "lifecycle", {
|
|
@@ -43117,6 +43620,9 @@ async function runEmbeddedPiAgent(...args) {
|
|
|
43117
43620
|
throw error;
|
|
43118
43621
|
}
|
|
43119
43622
|
}
|
|
43623
|
+
|
|
43624
|
+
//#endregion
|
|
43625
|
+
//#region src/agents/pi-embedded.ts
|
|
43120
43626
|
async function compactEmbeddedPiSession(..._args) {
|
|
43121
43627
|
return {
|
|
43122
43628
|
ok: true,
|
|
@@ -43144,4 +43650,4 @@ async function waitForEmbeddedPiRunEnd(..._args) {
|
|
|
43144
43650
|
}
|
|
43145
43651
|
|
|
43146
43652
|
//#endregion
|
|
43147
|
-
export { resolveAgentTimeoutMs as A, resolveEnvelopeFormatOptions as C, buildMentionRegexes as D, CURRENT_MESSAGE_MARKER as E, resolveIdentityNamePrefix as F, resolveMessagePrefix as I, resolveAgentIdentity as M, resolveEffectiveMessagesConfig as N, normalizeMentionText as O, resolveIdentityName as P, formatInboundEnvelope as S, shouldComputeCommandAuthorized as T, enqueueSystemEvent as _, resolveChannelGroupRequireMention as a, createInboundDebouncer as b, createDedupeCache as c, resolveAgentRoute as d, normalizeGroupActivation as f, upsertChannelPairingRequest as g, readChannelAllowFromStore as h, resolveChannelGroupPolicy as i, extractShortModelName as j, subagent_registry_exports as k, getReplyFromConfig as l, formatDurationPrecise as m, buildPairingReply as n, shouldAckReactionForWhatsApp as o, parseActivationCommand as p, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s,
|
|
43653
|
+
export { resolveAgentTimeoutMs as A, resolveEnvelopeFormatOptions as C, buildMentionRegexes as D, CURRENT_MESSAGE_MARKER as E, resolveIdentityNamePrefix as F, resolveMessagePrefix as I, resolveAgentIdentity as M, resolveEffectiveMessagesConfig as N, normalizeMentionText as O, resolveIdentityName as P, formatInboundEnvelope as S, shouldComputeCommandAuthorized as T, enqueueSystemEvent as _, resolveChannelGroupRequireMention as a, createInboundDebouncer as b, createDedupeCache as c, resolveAgentRoute as d, normalizeGroupActivation as f, upsertChannelPairingRequest as g, readChannelAllowFromStore as h, resolveChannelGroupPolicy as i, extractShortModelName as j, subagent_registry_exports as k, getReplyFromConfig as l, formatDurationPrecise as m, buildPairingReply as n, shouldAckReactionForWhatsApp as o, parseActivationCommand as p, recordChannelActivity as r, dispatchReplyWithBufferedBlockDispatcher as s, runNoxSoftEmbeddedAgent as t, buildAgentSessionKey as u, registerUnhandledRejectionHandler as v, hasControlCommand as w, resolveInboundDebounceMs as x, finalizeInboundContext as y };
|