@noxsoft/anima 5.1.2 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (488) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +2 -2
  3. package/dist/{APEv2Parser-DV7AH14P.js → APEv2Parser-Dvsbp_2R.js} +3 -3
  4. package/dist/{AbstractID3Parser-C3RlCr-Y.js → AbstractID3Parser-IB9gxozg.js} +5 -5
  5. package/dist/{AiffParser-DaFyNU8n.js → AiffParser-R2IhrBzL.js} +4 -4
  6. package/dist/{AsfParser-CDCRfCXr.js → AsfParser-DJEueUMg.js} +4 -4
  7. package/dist/{DsdiffParser-BX31LICZ.js → DsdiffParser-DXLYn9tT.js} +4 -4
  8. package/dist/{DsfParser-C3JBjE-C.js → DsfParser-D2--NF0i.js} +5 -5
  9. package/dist/{FlacParser-DY4m-7v1.js → FlacParser-8cDAjrth.js} +5 -5
  10. package/dist/{ID3v1Parser-DL9AGlNt.js → ID3v1Parser-B494XuP9.js} +3 -3
  11. package/dist/{ID3v2Parser-Mr8o-5GJ.js → ID3v2Parser-DlxcNqv5.js} +4 -4
  12. package/dist/{ID3v2Token-DQqGh8AB.js → ID3v2Token-CSLSVrSQ.js} +2 -2
  13. package/dist/{MP4Parser-DkunlEqI.js → MP4Parser-COql2J-w.js} +6 -6
  14. package/dist/{MatroskaParser-IKjHx0h7.js → MatroskaParser-bNP5wC2F.js} +3 -3
  15. package/dist/{MpegParser-EecSeRWJ.js → MpegParser-C1gjfYqq.js} +4 -4
  16. package/dist/{MusepackParser-CkfsAeuE.js → MusepackParser-DBdYf7kV.js} +5 -5
  17. package/dist/{OggParser-z3QlSd8U.js → OggParser-CxajqbK3.js} +5 -5
  18. package/dist/{Util-DDVY6AaC.js → Util-BRZxoY1Q.js} +1 -1
  19. package/dist/{WavPackParser-PimUUBRx.js → WavPackParser-CtH9QFia.js} +4 -4
  20. package/dist/{WaveParser-B539YtoQ.js → WaveParser-yufLki1G.js} +5 -5
  21. package/dist/{accounts-CL0JV_xk.js → accounts-B_2nt5Cd.js} +2 -2
  22. package/dist/{accounts-CYEa4ttU.js → accounts-COxGcLGB.js} +1 -1
  23. package/dist/{accounts-Bj5MvaDs.js → accounts-DIES085e.js} +11 -11
  24. package/dist/{accounts-DZsqyow2.js → accounts-TUsfghIW.js} +38 -38
  25. package/dist/{acp-cli-ynoZZhYQ.js → acp-cli-CWgqDQQH.js} +6 -6
  26. package/dist/{acp-cli-BFAoKBvs.js → acp-cli-D0wfP8-l.js} +16 -16
  27. package/dist/{active-listener-BWPgtTZp.js → active-listener-BKtsWhsb.js} +4 -4
  28. package/dist/{active-listener-GJR3nLhX.js → active-listener-D2r8IO7g.js} +5 -5
  29. package/dist/{agent-DUAarfNl.js → agent-CnS0SRpT.js} +93 -236
  30. package/dist/{agent-CaaEZsXl.js → agent-VRQM14Xp.js} +98 -229
  31. package/dist/{agent-scope-C9CiVcmh.js → agent-scope-ByIGrCTT.js} +2 -2
  32. package/dist/{agent-scope-D3HZp64M.js → agent-scope-CXxC8FFX.js} +2 -2
  33. package/dist/{agent-scope-BZ8hjIt_.js → agent-scope-CxBzAozu.js} +3 -3
  34. package/dist/{agents-t54YcbvK.js → agents-CvMRplDx.js} +15 -13
  35. package/dist/{agents.config-J7iEgdW_.js → agents.config-BR5JLtud.js} +1 -1
  36. package/dist/{anthropic-direct-runner-B12V2Q5H.js → anthropic-direct-runner-BeYCnvZ8.js} +37 -15
  37. package/dist/{anthropic-direct-runner-CzQb7QkD.js → anthropic-direct-runner-C2Kwju-r.js} +29 -7
  38. package/dist/{audit-ByHmjh-G.js → audit-B05W5ckN.js} +23 -34
  39. package/dist/{audit-HJOpXfgY.js → audit-DDz7UOIx.js} +18 -15
  40. package/dist/{auth-DXrALxdm.js → auth-DsC5pZ_0.js} +2 -2
  41. package/dist/{prompts-CneQ6SeF.js → auth-choice-DY1saszS.js} +12 -107
  42. package/dist/{auth-choice-DPWnLV_w.js → auth-choice-Dc5TAJwT.js} +10 -9
  43. package/dist/{auth-health-DmrnGklu.js → auth-health-Cc8-vy8y.js} +1 -1
  44. package/dist/auth-health-Dhr8p2SD.js +149 -0
  45. package/dist/{auth-profiles-BF5x9Ej0.js → auth-profiles-Brxz2ojJ.js} +193 -42
  46. package/dist/{auth-profiles-DjCH4kWT.js → auth-profiles-C-LuhW6c.js} +195 -44
  47. package/dist/{auth-profiles-PJVsRqf4.js → auth-profiles-DKu7ZUzl.js} +189 -29
  48. package/dist/{auth-profiles-eZzmaeR3.js → auth-profiles-DtWUl1-k.js} +198 -38
  49. package/dist/{auth-store-CnRrUELz.js → auth-store-Bd0GoqEL.js} +13 -13
  50. package/dist/{auth-store-KnWGteIV.js → auth-store-BpYI9t_y.js} +3 -3
  51. package/dist/{auth-store-DjcQlyze.js → auth-store-Jvgz2_l1.js} +2 -2
  52. package/dist/{banner-D9JyV5SF.js → banner-DAMtSjUF.js} +1 -1
  53. package/dist/{bonjour-discovery-QsoaZ8Pr.js → bonjour-discovery-Co-b97Dz.js} +2 -2
  54. package/dist/build-info.json +3 -3
  55. package/dist/bundled/boot-md/handler.js +222 -151
  56. package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
  57. package/dist/bundled/command-logger/handler.js +1 -1
  58. package/dist/bundled/session-memory/handler.js +24 -24
  59. package/dist/{call-DHZ76BNg.js → call-B4lhqS6H.js} +3 -3
  60. package/dist/{call-DQjoz63V.js → call-CDPbPDAr.js} +4 -4
  61. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  62. package/dist/{catalog-AZNRamJ4.js → catalog-CsXv59Tq.js} +2 -2
  63. package/dist/{channel-web-CQIbtfme.js → channel-web-B8mzTSaY.js} +15 -15
  64. package/dist/{channels-status-issues-DdjvFHx9.js → channels-status-issues-WkG3Tmxk.js} +4 -4
  65. package/dist/{chrome-HTuFjVWW.js → chrome-B8EnYGj1.js} +9 -9
  66. package/dist/{chrome-BNggURXT.js → chrome-BaU-H9m7.js} +3 -3
  67. package/dist/{chrome-Cfak4A3i.js → chrome-DLUBPBPz.js} +12 -12
  68. package/dist/{chunk-CyT-_QsQ.js → chunk-B4Kx-ocg.js} +11 -9
  69. package/dist/{chunk-Dffz_QIs.js → chunk-CFSle8n5.js} +1 -1
  70. package/dist/{chunk-D3vyM2EQ.js → chunk-Cy0Bj0F3.js} +1 -1
  71. package/dist/{chunk-DFqo_u5A.js → chunk-DJXDX69U.js} +11 -9
  72. package/dist/{clack-prompter-QbDK4ABC.js → clack-prompter-0JW5kry0.js} +3 -3
  73. package/dist/{clack-prompter-rXuqdPbx.js → clack-prompter-fZSmnHda.js} +5 -5
  74. package/dist/cli/daemon-cli.js +1 -1
  75. package/dist/{cli-kT9Mb3dT.js → cli-D8exVpuI.js} +30 -29
  76. package/dist/cli-hcHk5KuP.js +102 -0
  77. package/dist/{cli-utils-BdkJVXjy.js → cli-utils-D2X_bDLt.js} +9 -1
  78. package/dist/{cli-utils-DGnL8raH.js → cli-utils-DcDBK4C5.js} +9 -1
  79. package/dist/{client-D9E5Wwb_.js → client-BWkoTfOH.js} +3 -2
  80. package/dist/{client-DzIcZx4J.js → client-CfLiulzK.js} +2 -1
  81. package/dist/{command-registry-vEVxxxzI.js → command-registry-D3VhxpWx.js} +21 -12
  82. package/dist/{commands-NIY0IDXe.js → commands-DE8FNH0v.js} +92 -20
  83. package/dist/{commands-eY0Ao0wt.js → commands-Mekaw9WG.js} +92 -20
  84. package/dist/{common-C2wAYEWA.js → common-BCW6hLGI.js} +2 -2
  85. package/dist/{common-BzPvZcxT.js → common-Bf_TG87Y.js} +2 -2
  86. package/dist/{common-6Fcbzr42.js → common-DT_obM-k.js} +2 -2
  87. package/dist/{completion-cli-BBKG6buM.js → completion-cli-B3BqQJq9.js} +3 -3
  88. package/dist/{completion-cli-C84I5l8a.js → completion-cli-CepDzeW1.js} +2 -2
  89. package/dist/{config-Ofh9gKvs.js → config-BrVuTQ8R.js} +14 -2
  90. package/dist/{config-6FVC8hW0.js → config-CweTwOtr.js} +40 -28
  91. package/dist/{config-DqwH4y-D.js → config-DaD4FsAn.js} +19 -7
  92. package/dist/{config-D2kCn7yR.js → config-ZYN8tezd.js} +18 -6
  93. package/dist/{config-cli-CQzq5yWB.js → config-cli-3CaIxSKo.js} +4 -4
  94. package/dist/config-cli-B6Np85rk.js +15 -0
  95. package/dist/{config-guard-B1plY6aQ.js → config-guard-C4b2dksv.js} +2 -2
  96. package/dist/{config-guard-CYlpjNN7.js → config-guard-CWhoBtB3.js} +20 -20
  97. package/dist/{config-sync-CYX9Tzyr.js → config-sync-CCVp-tVX.js} +2 -2
  98. package/dist/{config-sync-CDUhjDom.js → config-sync-CMO_5lyl.js} +2 -2
  99. package/dist/{configure-G6h2Ppk0.js → configure-D882Bg7c.js} +39 -15
  100. package/dist/{configure-Bv6mqD0j.js → configure-D88dg6mE.js} +79 -77
  101. package/dist/{configure-DxQqSUJs.js → configure-xpjwedvJ.js} +50 -49
  102. package/dist/{configure-B-dfdPKX.js → configure-zXK6UZ51.js} +49 -24
  103. package/dist/{context-CpsnZLOp.js → context-B5X720Bs.js} +1 -1
  104. package/dist/{control-service-D1oxSXVg.js → control-service-3CI4vt1h.js} +2 -2
  105. package/dist/{control-service-CzAfyR4e.js → control-service-5YtMvm7D.js} +5 -5
  106. package/dist/control-ui/assets/index-C4ejMN5U.js +72 -0
  107. package/dist/control-ui/assets/index-C4ejMN5U.js.map +1 -0
  108. package/dist/control-ui/assets/index-CcPNqN3R.css +1 -0
  109. package/dist/control-ui/assets/index-D7Bf6Say.js +3 -0
  110. package/dist/control-ui/assets/index-D7Bf6Say.js.map +1 -0
  111. package/dist/control-ui/assets/index-yhFuaOnc.js +2 -0
  112. package/dist/control-ui/assets/index-yhFuaOnc.js.map +1 -0
  113. package/dist/control-ui/assets/observers-V7q9lNYt.js +2 -0
  114. package/dist/control-ui/assets/observers-V7q9lNYt.js.map +1 -0
  115. package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js +138 -0
  116. package/dist/control-ui/assets/rrweb-plugin-console-record-sPdhR0i8.js.map +1 -0
  117. package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js +129 -0
  118. package/dist/control-ui/assets/rrweb-record-CMVXB7aO.js.map +1 -0
  119. package/dist/control-ui/index.html +2 -2
  120. package/dist/{cron-cli-C4qZZo4e.js → cron-cli-Cht6Itx6.js} +18 -18
  121. package/dist/{cron-cli-CSivg2i9.js → cron-cli-D9XrF-Gx.js} +8 -8
  122. package/dist/{daemon-cli-DfxT-pQ4.js → daemon-cli-9zrnYRjh.js} +8 -8
  123. package/dist/{daemon-cli-KMzjJH_D.js → daemon-cli-CrdPhSxr.js} +15 -15
  124. package/dist/daemon-cli.js +34 -6
  125. package/dist/{daemon-runtime-CIE27usH.js → daemon-runtime-BrUj88ZO.js} +2 -2
  126. package/dist/{daemon-runtime-BfgstLVI.js → daemon-runtime-DCqwraWR.js} +1 -1
  127. package/dist/{deliver-8r6UbXnC.js → deliver-B-dPbUIs.js} +18 -28
  128. package/dist/{deliver-ahx1N11n.js → deliver-BKzX3YoN.js} +7 -7
  129. package/dist/{deliver-DVt8TbK9.js → deliver-C1L5nO0K.js} +3 -3
  130. package/dist/{deliver-D2hQZ9X0.js → deliver-d-CaN0uL.js} +59 -69
  131. package/dist/deps-DyT32VfN.js +23 -0
  132. package/dist/{diagnostics-DXeDqA_-.js → diagnostics-Cu9pZAFn.js} +1 -1
  133. package/dist/{dispatcher-DpSnqIL0.js → dispatcher-BQQugU-7.js} +1 -1
  134. package/dist/{dispatcher-DzT6jltc.js → dispatcher-DzwzLQRk.js} +2 -2
  135. package/dist/{dns-cli-D9ka2fZD.js → dns-cli-C8KIX4P3.js} +12 -12
  136. package/dist/{dns-cli-D2Orvc8E.js → dns-cli-V2bo6vSt.js} +3 -3
  137. package/dist/{docs-cli-CKfzGqYM.js → docs-cli-Bt-YV3xs.js} +2 -2
  138. package/dist/{docs-cli-DWYXJd-j.js → docs-cli-D2cVJxjP.js} +7 -7
  139. package/dist/{doctor-vXt5qjNJ.js → doctor-DEnSKgHu.js} +21 -21
  140. package/dist/{doctor-DumyG85t.js → doctor-WpKCNZeO.js} +36 -181
  141. package/dist/{doctor-completion-lAyxyd7X.js → doctor-completion-CPff9UlF.js} +2 -2
  142. package/dist/{doctor-completion-C8JSWfqN.js → doctor-completion-CypXc1Uo.js} +2 -2
  143. package/dist/{doctor-config-flow-DA50eWp5.js → doctor-config-flow-Bgl0Cc20.js} +6 -6
  144. package/dist/{doctor-config-flow-BjfGQ1Br.js → doctor-config-flow-Dxy7RIm0.js} +4 -4
  145. package/dist/{engine-BVchKo5_.js → engine-DpbYPop7.js} +9 -9
  146. package/dist/{engine-CKqNpVwE.js → engine-zmn3SOYa.js} +10 -9
  147. package/dist/entry.js +19 -28
  148. package/dist/{env-DVJCc7dM.js → env-DlTia1B4.js} +1 -1
  149. package/dist/{exec-cazBMA02.js → exec-BylR5qWS.js} +1 -1
  150. package/dist/{exec-gKbUce2p.js → exec-C6tXfeqA.js} +1 -1
  151. package/dist/{exec-Bfd4ztFZ.js → exec-DUzVF5_D.js} +7 -7
  152. package/dist/{exec-approvals-cli-BPwW6GIK.js → exec-approvals-cli-CN2WeH7y.js} +20 -20
  153. package/dist/{exec-approvals-cli-6HndodnP.js → exec-approvals-cli-DYZVBnqS.js} +8 -8
  154. package/dist/extensionAPI.js +22 -22
  155. package/dist/format-BCAtE7cT.js +20 -0
  156. package/dist/{frontmatter-BP4GSt5L.js → frontmatter-Dsa7N963.js} +2 -2
  157. package/dist/{gateway-cli-CHhTweWb.js → gateway-cli-B_xsx5Nv.js} +104 -101
  158. package/dist/{gateway-cli-B60L2z4a.js → gateway-cli-D3VBOA_i.js} +69 -66
  159. package/dist/{gateway-rpc-CrSglZPE.js → gateway-rpc-Cj_h2sVM.js} +3 -3
  160. package/dist/{gateway-rpc-BtOX_e53.js → gateway-rpc-CnXMGsxp.js} +3 -3
  161. package/dist/{gmail-setup-utils-D2uUKNlF.js → gmail-setup-utils-DaJoXV_3.js} +3 -3
  162. package/dist/{health-BttJ1Qeh.js → health-C8KCBhuo.js} +8 -8
  163. package/dist/{health-D8fJ6U_k.js → health-CabOEPQ0.js} +13 -13
  164. package/dist/{health-format-CH6JWH45.js → health-format-D-JJ5_S4.js} +2 -2
  165. package/dist/{heartbeat-visibility-DcGQOTXe.js → heartbeat-visibility-BjYY-mKG.js} +1 -1
  166. package/dist/{heartbeat-visibility-B2MDtPTL.js → heartbeat-visibility-ZfNSbFcq.js} +1 -1
  167. package/dist/{help-format-7YidDC5Z.js → help-format-Dt-I_Mls.js} +1 -1
  168. package/dist/{hooks-cli-DRUryj5H.js → hooks-cli-Cs7GUa7G.js} +34 -33
  169. package/dist/{hooks-cli-BMZF6RF3.js → hooks-cli-DOs9WZ3K.js} +56 -55
  170. package/dist/{hooks-status-VvwKn90L.js → hooks-status-DdweuSIj.js} +4 -4
  171. package/dist/{image-ops-BUy__GHL.js → image-ops-Ct3GueyT.js} +1 -1
  172. package/dist/index.js +79 -71
  173. package/dist/{init-B8PBeUpi.js → init-CFndGgTJ.js} +1 -1
  174. package/dist/{init-DxkAVKP0.js → init-DkBwXNme.js} +1 -1
  175. package/dist/{installs-sayrGjx1.js → installs-Bi6UipiE.js} +6 -6
  176. package/dist/{installs-BcnNDR54.js → installs-a4Vz_J08.js} +3 -3
  177. package/dist/ipv4-DfMwLQ0d.js +14 -0
  178. package/dist/{lib-D4dE4_XZ.js → lib-6xd5SQjU.js} +20 -20
  179. package/dist/{lifecycle-core-BerWWP7p.js → lifecycle-core-B8PI1NZJ.js} +3 -3
  180. package/dist/{links-OhvsEkVw.js → links-DcilUrqq.js} +1 -1
  181. package/dist/llm-slug-generator.js +25 -25
  182. package/dist/{loader-CLNb0v_s.js → loader-Bw2wdN4l.js} +159 -3
  183. package/dist/{loader-Bww_qb65.js → loader-C87TLS4J.js} +159 -3
  184. package/dist/{logging-DhXRGHWg.js → logging-Chc1Sj6N.js} +1 -1
  185. package/dist/{login-BovU8kno.js → login-BHnvW9HA.js} +6 -6
  186. package/dist/{login-BPtmlRRv.js → login-BTOKtSQN.js} +5 -5
  187. package/dist/{login-C54B66KM.js → login-CrMpAZ0n.js} +4 -4
  188. package/dist/{login-C4mptULi.js → login-DKkQ3Czu.js} +5 -5
  189. package/dist/{login-qr-bim3Nkyu.js → login-qr-BGbHImRb.js} +8 -8
  190. package/dist/{login-qr-pFbvowe5.js → login-qr-CsAVGp00.js} +12 -12
  191. package/dist/{login-qr-657mh7cI.js → login-qr-DILcBA_q.js} +6 -6
  192. package/dist/{login-qr-BxNKHxcf.js → login-qr-OUAGpDsU.js} +10 -10
  193. package/dist/{logs-cli-CQStwrGd.js → logs-cli-Bc6IOyHA.js} +8 -8
  194. package/dist/{logs-cli-De79vyiP.js → logs-cli-BiAJbjnq.js} +15 -15
  195. package/dist/{manager-B043uMPT.js → manager-BYu34CX3.js} +12 -12
  196. package/dist/{manager-Cvmm95Pf.js → manager-C6L_DH0O.js} +2 -2
  197. package/dist/{manager-BtrVJ8Ve.js → manager-D8VCuzru.js} +9 -9
  198. package/dist/{manager-A3pC-CW-.js → manager-b_aZwo00.js} +16 -16
  199. package/dist/{manifest-registry-D-DOtLzo.js → manifest-registry-qF960vMH.js} +1 -1
  200. package/dist/{memory-cli-COl5xoIl.js → memory-cli-B0kKl-9T.js} +7 -7
  201. package/dist/{memory-cli-691NgCXx.js → memory-cli-DLtBA6r5.js} +11 -11
  202. package/dist/{message-channel-DZYYDt1_.js → message-channel-CMsexA3K.js} +9 -7
  203. package/dist/{message-channel-DdOBO6Qm.js → message-channel-DIHHKJhk.js} +8 -6
  204. package/dist/{migrate-DkBWjPPs.js → migrate-DuohB_ur.js} +3 -3
  205. package/dist/{migrate-BLjwxe9X.js → migrate-bgeTT_GR.js} +3 -3
  206. package/dist/{model-auth-DKhjNVHc.js → model-auth-CHB3EySM.js} +10 -5
  207. package/dist/{model-auth-CxAB4iZ0.js → model-auth-KpsOXKDc.js} +3 -3
  208. package/dist/model-param-b-C1QDqzQp.js +16 -0
  209. package/dist/{model-selection-BPkpXepz.js → model-selection-CLcoOT3e.js} +25 -7
  210. package/dist/{model-selection-wCaVeFbb.js → model-selection-CY6r_3wt.js} +25 -7
  211. package/dist/{model-selection-DFbDH9o2.js → model-selection-DcO3qJOu.js} +24 -6
  212. package/dist/{model-selection-BI8CKPwQ.js → model-selection-DjsJGv1R.js} +67 -8
  213. package/dist/models-BM2_NkMu.js +2707 -0
  214. package/dist/models-cli-BjY8wA-C.js +272 -0
  215. package/dist/models-cli-BpjeKsUz.js +2946 -0
  216. package/dist/{node-cli-Ajhng-5p.js → node-cli-BmuVEJ1C.js} +12 -12
  217. package/dist/{node-cli-t3N6HE9R.js → node-cli-DU_oREff.js} +27 -27
  218. package/dist/{node-service-4B-0AjmA.js → node-service-qZXF7T7A.js} +1 -1
  219. package/dist/{note-De2zPKl3.js → note-iMYVGjpA.js} +2 -2
  220. package/dist/noxsoft-bootstrap-C4dSx7K_.js +77 -0
  221. package/dist/noxsoft-bootstrap-CrlkSFzd.js +77 -0
  222. package/dist/{npm-registry-spec-CFp4OEe4.js → npm-registry-spec-Br4B4I_3.js} +2 -2
  223. package/dist/{npm-registry-spec-DVDcgWxm.js → npm-registry-spec-jf7Mowdn.js} +1 -1
  224. package/dist/{onboard-xSPFmM29.js → onboard-DM9gULJN.js} +24 -19
  225. package/dist/{onboard-i4CJtSb9.js → onboard-_-D81kAy.js} +19 -15
  226. package/dist/{onboard-channels-RsbA6EaD.js → onboard-channels-CtT-RN60.js} +8 -8
  227. package/dist/{onboard-channels-D6Gt3CsX.js → onboard-channels-UkphAdCy.js} +4 -4
  228. package/dist/{onboard-helpers-IeOtcIME.js → onboard-helpers-CFudIoX4.js} +3 -3
  229. package/dist/{onboard-helpers-DPqXrhma.js → onboard-helpers-CJ3HzoUO.js} +7 -7
  230. package/dist/{onboarding-CZBVMwFn.js → onboarding-BB9PteK8.js} +20 -17
  231. package/dist/{onboarding-Cao0a_Z1.js → onboarding-Djmm0PEM.js} +27 -23
  232. package/dist/{orchestrator-COMX8CF2.js → orchestrator-C1nWKIJS.js} +7 -3
  233. package/dist/{orchestrator-BLXpTTgr.js → orchestrator-C2ypFiPL.js} +6 -3
  234. package/dist/{outbound-DWfSyfZC.js → outbound-Bmft-5um.js} +4 -4
  235. package/dist/{outbound-Rs0fFC2g.js → outbound-C577aWZp.js} +1 -1
  236. package/dist/{outbound-DLCmFGfJ.js → outbound-DW2eod1S.js} +4 -4
  237. package/dist/{outbound-uxBpmALx.js → outbound-fPqdCDR4.js} +4 -4
  238. package/dist/outbound-send-deps-DVfWC4E8.js +14 -0
  239. package/dist/outbound-send-deps-T_FgdfgW.js +36 -0
  240. package/dist/{parse-timeout-DkOL1T_l.js → parse-timeout-C4WLf3Qy.js} +3 -3
  241. package/dist/{parse-timeout-DlU4ymhF.js → parse-timeout-D4UO8pY_.js} +1 -1
  242. package/dist/{path-env-CjpH-KWH.js → path-env-DLQPf9qj.js} +2 -2
  243. package/dist/{paths-D2eokayo.js → paths-B-AkG5FD.js} +3 -3
  244. package/dist/{paths-DQMKfv60.js → paths-CAQJvbeZ.js} +2 -2
  245. package/dist/{paths-Cwszsz1I.js → paths-Q6h5HODL.js} +2 -2
  246. package/dist/{pi-auth-json-BLdaEAx2.js → pi-auth-json-B_lKNFK6.js} +5 -5
  247. package/dist/{pi-auth-json-BH7uvkKr.js → pi-auth-json-BmdBnmlZ.js} +8 -9
  248. package/dist/{pi-auth-json-DjxzPUt3.js → pi-auth-json-DkYqdjrV.js} +2 -2
  249. package/dist/{pi-auth-json-smxh_Xud.js → pi-auth-json-WTvcP2gz.js} +9 -8
  250. package/dist/{pi-embedded-D4eEfxIU.js → pi-embedded-BMbtgOzv.js} +825 -319
  251. package/dist/{pi-embedded-DifnZvKk.js → pi-embedded-DfbM3fAT.js} +888 -382
  252. package/dist/{pi-embedded-helpers-B6wVA0hU.js → pi-embedded-helpers-BZ9GspxK.js} +1 -1
  253. package/dist/{pi-tools.policy-CDgjN_3f.js → pi-tools.policy-D2FusuQa.js} +3 -3
  254. package/dist/{pi-tools.policy-ox141hP6.js → pi-tools.policy-WdTAfqbV.js} +6 -6
  255. package/dist/{plugin-auto-enable-Mj7AnofW.js → plugin-auto-enable-CtYcdTju.js} +5 -5
  256. package/dist/{plugin-auto-enable-OqDAK-ap.js → plugin-auto-enable-DhuD30Je.js} +2 -2
  257. package/dist/{plugin-registry-CpXm8ADp.js → plugin-registry-DePMxn4z.js} +4 -4
  258. package/dist/{plugin-registry-CkZnT8Fb.js → plugin-registry-QTkplP4s.js} +2 -2
  259. package/dist/plugin-sdk/agents/cli-backends.d.ts +4 -1
  260. package/dist/plugin-sdk/agents/cli-credentials.d.ts +0 -10
  261. package/dist/plugin-sdk/agents/cli-runner.d.ts +2 -0
  262. package/dist/plugin-sdk/agents/defaults.d.ts +2 -2
  263. package/dist/plugin-sdk/agents/model-auto.d.ts +43 -0
  264. package/dist/plugin-sdk/agents/model-fallback.d.ts +5 -0
  265. package/dist/plugin-sdk/agents/model-preference.d.ts +25 -0
  266. package/dist/plugin-sdk/agents/noxsoft-runner.d.ts +94 -0
  267. package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +6 -3
  268. package/dist/plugin-sdk/agents/pi-embedded.d.ts +6 -50
  269. package/dist/plugin-sdk/agents/runner-capabilities.d.ts +2 -0
  270. package/dist/plugin-sdk/agents/sandbox/constants.d.ts +1 -1
  271. package/dist/plugin-sdk/auth/noxsoft-auth.d.ts +55 -0
  272. package/dist/plugin-sdk/channels/registry.d.ts +2 -2
  273. package/dist/plugin-sdk/cli/deps.d.ts +2 -1
  274. package/dist/plugin-sdk/cli/outbound-send-deps.d.ts +10 -0
  275. package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
  276. package/dist/plugin-sdk/config/types.agent-defaults.d.ts +14 -0
  277. package/dist/plugin-sdk/config/types.models.d.ts +1 -1
  278. package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +13 -0
  279. package/dist/plugin-sdk/config/zod-schema.agents.d.ts +13 -0
  280. package/dist/plugin-sdk/config/zod-schema.d.ts +13 -0
  281. package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +1 -0
  282. package/dist/plugin-sdk/identity/loader.d.ts +1 -0
  283. package/dist/plugin-sdk/identity/trust-graph.d.ts +32 -0
  284. package/dist/plugin-sdk/index.js +57 -47
  285. package/dist/plugin-sdk/utils/message-channel.d.ts +2 -1
  286. package/dist/{plugins-DnJgmFJR.js → plugins-DYcg0qBW.js} +1 -1
  287. package/dist/{plugins-cli-CrrkMAYM.js → plugins-cli-Bc9oU1ld.js} +58 -57
  288. package/dist/{plugins-cli-D4VxQKaJ.js → plugins-cli-Dv0KQTWo.js} +36 -35
  289. package/dist/{polls-DuwPgAV7.js → polls-DFISjV7H.js} +5 -5
  290. package/dist/{ports-B1b1r9Dz.js → ports-DaVrZDUq.js} +2 -2
  291. package/dist/{ports-BX00e96t.js → ports-q535r1PZ.js} +2 -2
  292. package/dist/{program-CTDFmZNx.js → program-CuwbF8YO.js} +48 -40
  293. package/dist/{program-context-Hl6bnPfB.js → program-context-CxPfy-Wr.js} +51 -35
  294. package/dist/{progress-B-VBLfHr.js → progress-CVLvQV_t.js} +1 -1
  295. package/dist/{prompt-style-DU9Vjqe5.js → prompt-style-BI53UVgE.js} +1 -1
  296. package/dist/{prompts-D6b3zLVO.js → prompts-BmgT_kkv.js} +33 -2
  297. package/dist/prompts-Bq4QGFQM.js +158 -0
  298. package/dist/{pw-ai-BV57RRmp.js → pw-ai-CB-zeR7h.js} +5 -5
  299. package/dist/{pw-ai-CY-VcqJp.js → pw-ai-C_1-7IgH.js} +4 -4
  300. package/dist/{pw-ai-CTHtrCEC.js → pw-ai-DxNrJcCA.js} +3 -3
  301. package/dist/{qmd-manager-DJeQYS-r.js → qmd-manager-C_XBZ_bT.js} +5 -5
  302. package/dist/{qmd-manager-CwbYv6nJ.js → qmd-manager-CpNYgSrx.js} +7 -7
  303. package/dist/{qmd-manager-Cbm03z8H.js → qmd-manager-Q0OSDQ-e.js} +5 -5
  304. package/dist/{register.agent-CMoYTJqj.js → register.agent-DFQmkIEH.js} +53 -50
  305. package/dist/{register.agent-BKINbWbs.js → register.agent-DUjwGw9d.js} +77 -73
  306. package/dist/{register.anima-BHrZ90Sv.js → register.anima-CRFHJu2J.js} +21 -21
  307. package/dist/{register.anima-CnEy5VFQ.js → register.anima-CtKNrpE8.js} +21 -21
  308. package/dist/{register.configure-Cv5NkGH2.js → register.configure-CSSN07XN.js} +50 -49
  309. package/dist/register.configure-CnEKV57N.js +107 -0
  310. package/dist/register.maintenance-CU1A-90-.js +102 -0
  311. package/dist/{register.maintenance-DtAw8E_a.js → register.maintenance-fhcCB7ih.js} +48 -47
  312. package/dist/register.message-C1a0y2ZR.js +661 -0
  313. package/dist/register.message-fM0jSKB8.js +659 -0
  314. package/dist/register.onboard-B7Gavmvt.js +128 -0
  315. package/dist/{register.onboard-U3lIfaw_.js → register.onboard-BhPlqjFi.js} +50 -49
  316. package/dist/{register.setup-CLkGhR-e.js → register.setup-0jPnMgnz.js} +96 -92
  317. package/dist/{register.setup-Dyp5L_GQ.js → register.setup-CADdQUEN.js} +72 -69
  318. package/dist/{register.status-health-sessions-Dx-qZMol.js → register.status-health-sessions-Cu5fDT-z.js} +68 -67
  319. package/dist/{register.status-health-sessions-Cc2Y5gSj.js → register.status-health-sessions-DdQsABr_.js} +40 -39
  320. package/dist/{register.subclis-L55mGheS.js → register.subclis-CZ91ufCy.js} +28 -21
  321. package/dist/{reply-BgPvB-gR.js → reply-DtHlnzOx.js} +6631 -6172
  322. package/dist/{reply-prefix-37W_P4kH.js → reply-prefix-C8dIgJur.js} +1 -1
  323. package/dist/{reply-prefix-DBRqtDEq.js → reply-prefix-DmWGtcH-.js} +1 -1
  324. package/dist/{routes-ZlpnlJFF.js → routes-CWCAc8uJ.js} +2 -2
  325. package/dist/{routes-DeDgHj5Y.js → routes-FT0Us8Md.js} +6 -6
  326. package/dist/{run-DEHnKm2x.js → run-Dfz_7j7t.js} +1256 -166
  327. package/dist/{run-BFPM6M2S.js → run-DqBQ-bGn.js} +1230 -140
  328. package/dist/{run-main-Cxmjk1SF.js → run-main-DGDW0fhx.js} +51 -50
  329. package/dist/{runtime-guard-cBL2D5J8.js → runtime-guard-D14Z_QY6.js} +1 -1
  330. package/dist/{sandbox-DDOFuJU9.js → sandbox-D-N7M7lp.js} +2 -2
  331. package/dist/{sandbox-cli-GhcxR1Va.js → sandbox-cli-CQKz2I1X.js} +9 -9
  332. package/dist/{sandbox-cli-CGJvhJ4L.js → sandbox-cli-DHNFlTo-.js} +23 -23
  333. package/dist/{sandbox-B8Nza4lP.js → sandbox-pBHlfFdB.js} +6 -6
  334. package/dist/{security-cli-B7VIDDSL.js → security-cli-Bdi7MuP6.js} +14 -22
  335. package/dist/{security-cli-gsyz4Wrw.js → security-cli-C3aI09uy.js} +27 -35
  336. package/dist/{semantic-C3Z-zhNi.js → semantic-9rgWUrz3.js} +1 -1
  337. package/dist/{semantic-CG6X3rBo.js → semantic-C1UN3bb9.js} +1 -1
  338. package/dist/{semantic-DCd6zBnV.js → semantic-CQApJNO_.js} +1 -1
  339. package/dist/{server-context-Dkz4Ce8z.js → server-context-Clykq0XU.js} +1 -1
  340. package/dist/{server-context-BlJi7pjP.js → server-context-Yx4pgBqJ.js} +7 -7
  341. package/dist/{server-node-events-DBOg36in.js → server-node-events-BR1aXVlu.js} +55 -53
  342. package/dist/{server-node-events-CmZXzWcd.js → server-node-events-Ca797E1d.js} +34 -31
  343. package/dist/{service-QlHhVsQf.js → service-Dd1DfPia.js} +1 -1
  344. package/dist/{service-audit-D4xG05j8.js → service-audit-Bwpoc2LD.js} +1 -1
  345. package/dist/{service-audit-BaoBb09i.js → service-audit-KzOtcw_V.js} +3 -3
  346. package/dist/{session-BJ9XCJBg.js → session-5YO_H-Ra.js} +1 -1
  347. package/dist/{session-3MLbl1-K.js → session-BiA6jrcs.js} +1 -1
  348. package/dist/session-C7IGnhd1.js +190 -0
  349. package/dist/{session-KNXzWBht.js → session-CSmfU0D3.js} +1 -1
  350. package/dist/{session-CqKJvPTq.js → session-DLevr8Vd.js} +5 -5
  351. package/dist/session-DfsMJNG3.js +190 -0
  352. package/dist/{session-TAOVpONo.js → session-FmXsucR7.js} +2 -2
  353. package/dist/{session-cost-usage-BamtB1rn.js → session-cost-usage-BWqR-ik6.js} +1 -1
  354. package/dist/{sessions-C2th3rm6.js → sessions-BOzeFzuL.js} +12 -22
  355. package/dist/{sessions-1XK2mH6L.js → sessions-C_3wTmSA.js} +9 -19
  356. package/dist/{sessions-BrQHxX_o.js → sessions-Dj7_4mkr.js} +4 -4
  357. package/dist/{settings-cli-CCtkuc1r.js → settings-cli-DxNeu6kx.js} +79 -77
  358. package/dist/{settings-cli-Ccizggz2.js → settings-cli-Dytfop1H.js} +50 -49
  359. package/dist/{setup-token-Dqtgnjxw.js → setup-token-B802CZwe.js} +13 -18
  360. package/dist/{setup-token-Bcer2kX8.js → setup-token-DYh2QzJ-.js} +29 -34
  361. package/dist/{shared-Hnu5dChj.js → shared-C-rqLtIT.js} +2 -2
  362. package/dist/{shell-env-KRrv3dPW.js → shell-env-CMI9f7-7.js} +1 -1
  363. package/dist/{shell-env-B4ae4lFh.js → shell-env-HkVWMh--.js} +1 -1
  364. package/dist/{shell-env-PnmcBTp4.js → shell-env-iPnSIi-t.js} +1 -1
  365. package/dist/{skills-CQoUYlGu.js → skills-4v6-kw0C.js} +3 -3
  366. package/dist/{skills-cli-DQuLxQUM.js → skills-cli-BoasNTpZ.js} +15 -15
  367. package/dist/{skills-cli-CNNy0FxN.js → skills-cli-TeAq3fRG.js} +3 -3
  368. package/dist/{skills-install-2DbC1Yo2.js → skills-install-D6_qpRjW.js} +7 -7
  369. package/dist/{skills-install-CE6djAWL.js → skills-install-Qw2oU8L8.js} +2 -2
  370. package/dist/{skills-status-ybjSmiHu.js → skills-status-CvH7AUoY.js} +4 -4
  371. package/dist/{soul-Bt57OdSx.js → soul-BiIdv3Wp.js} +125 -5
  372. package/dist/{soul-DFeEGG5h.js → soul-Bt8UNmTq.js} +126 -5
  373. package/dist/{soul-CwWWw7cs.js → soul-D9k5zulC.js} +2 -2
  374. package/dist/{soul-Bru-rRjk.js → soul-DQSYs-4l.js} +1 -1
  375. package/dist/{sqlite-BTcAhNls.js → sqlite-BMMt7osH.js} +2 -2
  376. package/dist/{sqlite-ClLAW1iQ.js → sqlite-CZ1vD4VS.js} +4 -4
  377. package/dist/{sqlite-CLZ1eR5Q.js → sqlite-CpAJt-JS.js} +1 -1
  378. package/dist/{start-DfC7PlAH.js → start-BqnPia0t.js} +66 -63
  379. package/dist/start-C3fuLzX0.js +157 -0
  380. package/dist/{status-BVAoIQ0V.js → status-CHGNPonc.js} +26 -44
  381. package/dist/{status-BU6h4wUP.js → status-CxF6k_jr.js} +2 -2
  382. package/dist/{status-C9B6cEM0.js → status-DfZJJqNs.js} +15 -15
  383. package/dist/{status-BaEcHPtc.js → status-tLgozFYL.js} +4 -4
  384. package/dist/{status.update-CbIRaeaV.js → status.update-B6Tdpk07.js} +2 -2
  385. package/dist/{status.update-CPACVnCc.js → status.update-E9dSFk_b.js} +1 -1
  386. package/dist/{subagent-registry-MZIxVf8W.js → subagent-registry-CPtElVX0.js} +807 -348
  387. package/dist/{subsystem-BMsbqSb4.js → subsystem-BAADN1B8.js} +18 -27
  388. package/dist/{subsystem-CucjNlOk.js → subsystem-D-Xta-sj.js} +17 -26
  389. package/dist/{subsystem-DA3Cno1i.js → subsystem-D1AJZPgG.js} +38 -47
  390. package/dist/{system-cli-BKicxULp.js → system-cli-CP7JrhR0.js} +15 -15
  391. package/dist/{system-cli-Unb-WFAR.js → system-cli-DoLzi2Sn.js} +8 -8
  392. package/dist/{systemd-5KGZ3NHE.js → systemd-Bx76sJ3M.js} +2 -2
  393. package/dist/{systemd-linger-B-uyzDap.js → systemd-linger-BVwGXVS0.js} +2 -2
  394. package/dist/{systemd-linger-CS_pA1-a.js → systemd-linger-CxGmIy_5.js} +1 -1
  395. package/dist/{table-CdHBo5d1.js → table-Blmz7glr.js} +2 -2
  396. package/dist/{tokens-DGhK0fpG.js → tokens-SP2Q7i59.js} +1 -1
  397. package/dist/{tool-images-DK97edts.js → tool-images-2qproko3.js} +2 -2
  398. package/dist/{tool-images-Dq55i0mz.js → tool-images-C6cKHTbj.js} +2 -2
  399. package/dist/{tool-images-J0rGmoDV.js → tool-images-CgDT0Xzv.js} +2 -2
  400. package/dist/{tui-Bm8FEW0b.js → tui-C2eLfbhA.js} +5 -5
  401. package/dist/{tui-cli-BGjsxGle.js → tui-cli-BgcbCtgc.js} +12 -12
  402. package/dist/{tui-cli-TwCYv-a7.js → tui-cli-cLSYBQu9.js} +27 -27
  403. package/dist/{tui-DtGKiHUr.js → tui-r4qpJhNk.js} +10 -10
  404. package/dist/{update-Dfi92PZJ.js → update-CqKpX3cX.js} +3 -3
  405. package/dist/{update-Dle5MRUz.js → update-DA91za97.js} +1 -1
  406. package/dist/{update-cli-QMVW2eiR.js → update-cli-BuCw75tM.js} +87 -85
  407. package/dist/{update-cli-D1e-DsWy.js → update-cli-C-er5av6.js} +55 -54
  408. package/dist/{update-runner-DPmSGXS3.js → update-runner-czCqHZCu.js} +5 -5
  409. package/dist/{update-runner-iLJQF6VA.js → update-runner-kE8AMQt4.js} +1 -1
  410. package/dist/{utils-B60lF9Wq.js → utils-CLYlhJuc.js} +1 -1
  411. package/dist/{web-DJRRkHG8.js → web-BHGK5GtV.js} +24 -24
  412. package/dist/web-CyYunanU.js +65 -0
  413. package/dist/{web-DDAkSrtZ.js → web-DvTXV-fo.js} +35 -34
  414. package/dist/{web-DBQRQY6n.js → web-so3pGceM.js} +27 -27
  415. package/dist/{webhooks-cli-Cg0F2mU6.js → webhooks-cli-k3QMf7Rs.js} +4 -4
  416. package/dist/{webhooks-cli-BsWx7MgH.js → webhooks-cli-vlEfXEKm.js} +12 -12
  417. package/dist/{whatsapp-actions-gpz6-vPI.js → whatsapp-actions-6fPRKwPV.js} +11 -11
  418. package/dist/{whatsapp-actions-DJpQVKnT.js → whatsapp-actions-BJn-z76S.js} +17 -17
  419. package/dist/{whatsapp-actions-tWRWRZ4X.js → whatsapp-actions-C0tlEdLy.js} +5 -5
  420. package/dist/{whatsapp-actions-CMEP8v3k.js → whatsapp-actions-Hr-W8vjY.js} +13 -13
  421. package/dist/{widearea-dns-BDtWuGCY.js → widearea-dns-CHAT20aR.js} +1 -1
  422. package/dist/{workspace-BQkffCaR.js → workspace-BFIZCnGo.js} +5 -5
  423. package/dist/{ws-log-Bc4grA6W.js → ws-log-CUobU2tD.js} +1 -1
  424. package/package.json +1 -1
  425. package/templates/profiles/nox.profile.json5 +5 -5
  426. package/dist/cli--Gal7v4I.js +0 -101
  427. package/dist/config-cli-cyvL43DG.js +0 -15
  428. package/dist/control-ui/assets/index-B7CJLRZD.css +0 -1
  429. package/dist/control-ui/assets/index-DLPYIcs0.js +0 -58
  430. package/dist/control-ui/assets/index-DLPYIcs0.js.map +0 -1
  431. package/dist/deps-CeyVMZf1.js +0 -13
  432. package/dist/models-ByeH7ZKb.js +0 -1350
  433. package/dist/register.configure-3GfqcGLK.js +0 -105
  434. package/dist/register.maintenance-YZDsMymb.js +0 -100
  435. package/dist/register.onboard-Dswys-iV.js +0 -126
  436. package/dist/start-BPye9w5U.js +0 -154
  437. package/dist/web-DE-hmqXy.js +0 -64
  438. /package/dist/{BasicParser-BiEpjka-.js → BasicParser-D4BHCxVb.js} +0 -0
  439. /package/dist/{agents.config-DibGEnBs.js → agents.config-Br4ULmK0.js} +0 -0
  440. /package/dist/{archive-BIKRyvqD.js → archive-CNqghdwQ.js} +0 -0
  441. /package/dist/{archive-5e-Ytlq-.js → archive-D-dHRz-v.js} +0 -0
  442. /package/dist/{argv-B6vsXQtF.js → argv-nNQ109_K.js} +0 -0
  443. /package/dist/{auth-store-Vfd6oc1G.js → auth-store-BEfSfCbW.js} +0 -0
  444. /package/dist/{auto-update-BUbllW1X.js → auto-update-Cvd8YJrT.js} +0 -0
  445. /package/dist/{auto-update-DdH8fo63.js → auto-update-DO4nHkfM.js} +0 -0
  446. /package/dist/{brew-Bkf_MwX9.js → brew-DHWnVWm3.js} +0 -0
  447. /package/dist/{budget-CV0a771W.js → budget-DvjICb0t.js} +0 -0
  448. /package/dist/{budget-GiXjG9eW.js → budget-e0R5xsU3.js} +0 -0
  449. /package/dist/{command-options-DfPEZwUK.js → command-options-DtJ8-EC7.js} +0 -0
  450. /package/dist/{command-options-mgpP-XId.js → command-options-eC-m_qJx.js} +0 -0
  451. /package/dist/{delivery-queue-DGnDKL02.js → delivery-queue-BKQk1j0k.js} +0 -0
  452. /package/dist/{delivery-queue-DZ_ibFDu.js → delivery-queue-CExaJXRz.js} +0 -0
  453. /package/dist/{display-BwSYYxVE.js → display-4p3-O9mP.js} +0 -0
  454. /package/dist/{display-Dck2kudh.js → display-Bo8pBhMp.js} +0 -0
  455. /package/dist/{exec-approvals-BJikgQkX.js → exec-approvals-DK5-KCUz.js} +0 -0
  456. /package/dist/{format-wiLVr0D3.js → format-9DMvWYUJ.js} +0 -0
  457. /package/dist/{format-duration-C5oKCGwB.js → format-duration-CnGkTPRF.js} +0 -0
  458. /package/dist/{gmail-setup-utils-CR33Gqfc.js → gmail-setup-utils-BIXtKTpT.js} +0 -0
  459. /package/dist/{help-format-DJx5Rwy2.js → help-format-ZKxl6UCb.js} +0 -0
  460. /package/dist/{helpers-8O7IVGO-.js → helpers-CWQnEONe.js} +0 -0
  461. /package/dist/{hooks-status-DiqubDlK.js → hooks-status-DqfJDvYl.js} +0 -0
  462. /package/dist/{ipv4-BYbwrpG-.js → ipv4-CExV55ho.js} +0 -0
  463. /package/dist/{is-main-BnikY3ud.js → is-main-H-hpHkdq.js} +0 -0
  464. /package/dist/{lib-D1DXSMt_.js → lib-D0_kW-B6.js} +0 -0
  465. /package/dist/{links-3c7gzW-G.js → links-BjjDMNIq.js} +0 -0
  466. /package/dist/{logging-Bpf6Cepz.js → logging-DWwOqnTW.js} +0 -0
  467. /package/dist/{logging-DcXIbpwk.js → logging-_rCcBkls.js} +0 -0
  468. /package/dist/{model-param-b-BcBBSgiD.js → model-param-b-2KmFir_0.js} +0 -0
  469. /package/dist/{node-service-BDlDNv3t.js → node-service-cOoW5hLa.js} +0 -0
  470. /package/dist/{note-BaOKDvcy.js → note-CeLGcHqv.js} +0 -0
  471. /package/dist/{noxsoft-auth-Bmict45b.js → noxsoft-auth-CE75mBXE.js} +0 -0
  472. /package/dist/{noxsoft-auth-DpwLJIW0.js → noxsoft-auth-CgCk5707.js} +0 -0
  473. /package/dist/{pi-model-discovery-ClWISQ3j.js → pi-model-discovery-Bu4Zr7nI.js} +0 -0
  474. /package/dist/{ports-aNJUI3Mi.js → ports-BGLuwt2Z.js} +0 -0
  475. /package/dist/{progress-Dj2aBWOI.js → progress-glCgu57m.js} +0 -0
  476. /package/dist/{qmd-manager-DrDX4o7e.js → qmd-manager-CO795NK4.js} +0 -0
  477. /package/dist/{queue-B77yV52t.js → queue-DDq0uzy5.js} +0 -0
  478. /package/dist/{queue-wFYwitx0.js → queue-DtQ5sbyD.js} +0 -0
  479. /package/dist/{registry-gaRST__4.js → registry-BvymIcVf.js} +0 -0
  480. /package/dist/{registry-Cv8RtADU.js → registry-DwaHkd_j.js} +0 -0
  481. /package/dist/{requirements-CEowKaVY.js → requirements-Ct4XnMiK.js} +0 -0
  482. /package/dist/{skill-scanner-DGoUYV22.js → skill-scanner-5_Y3u6SU.js} +0 -0
  483. /package/dist/{skill-scanner-FO7SyxAD.js → skill-scanner-Dld2ijVw.js} +0 -0
  484. /package/dist/{templates-D-h5PNIK.js → templates-4_And8I_.js} +0 -0
  485. /package/dist/{templates-ndPXOyGA.js → templates-5Z-UIDze.js} +0 -0
  486. /package/dist/{types-DSS9sywz.js → types-BQk_oAin.js} +0 -0
  487. /package/dist/{usage-format-BtlQ-77V.js → usage-format-BSa7cHyK.js} +0 -0
  488. /package/dist/{ws-log-BA9w1cJs.js → ws-log-CG6cvCZW.js} +0 -0
@@ -1,75 +1,77 @@
1
1
  import { $ as resolveStateDir, B as CONFIG_PATH, D as setVerbose, F as getLogger, G as resolveConfigPath, H as STATE_DIR, I as getResolvedLoggerSettings, J as resolveGatewayLockDir, L as setLoggerOverride, P as getChildLogger, Tt as expandHomePrefix, U as isNixMode, Y as resolveGatewayPort, d as setConsoleSubsystemFilter, dt as getActivePluginRegistry, f as setConsoleTimestampPrefix, g as defaultRuntime, l as getResolvedConsoleSettings, n as isTruthyEnvValue, o as createSubsystemLogger, r as logAcceptedEnvOption, rt as DEFAULT_CHAT_CHANNEL, s as runtimeForLogger, tt as CHANNEL_IDS } from "./entry.js";
2
- import { x as normalizeSecretInput } from "./auth-profiles-BF5x9Ej0.js";
2
+ import { w as normalizeSecretInput } from "./auth-profiles-Brxz2ojJ.js";
3
3
  import { t as formatCliCommand } from "./command-format-kLw3YIIu.js";
4
4
  import { b as isSubagentSessionKey, d as resolveAgentIdFromSessionKey, i as buildAgentMainSessionKey, l as normalizeAgentId, m as toAgentRequestSessionKey, n as DEFAULT_AGENT_ID, t as DEFAULT_ACCOUNT_ID, u as normalizeMainKey, v as isCronRunSessionKey, x as parseAgentSessionKey } from "./session-key-DP2WHl90.js";
5
5
  import { E as truncateUtf16Safe, S as shortenHomePath, n as clamp, s as ensureDir, t as CONFIG_DIR, u as isPlainObject, y as resolveUserPath } from "./utils-D1VGbO3C.js";
6
6
  import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-BtBJICHE.js";
7
7
  import { t as resolveAnimaPackageRoot } from "./anima-root-CxtpOklc.js";
8
8
  import { T as resolveWorkspaceTemplateDir, _ as DEFAULT_MEMORY_FILENAME, b as DEFAULT_USER_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, g as DEFAULT_MEMORY_ALT_FILENAME, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, v as DEFAULT_SOUL_FILENAME, w as resolveDefaultAgentWorkspaceDir, x as ensureAgentWorkspace, y as DEFAULT_TOOLS_FILENAME } from "./agent-scope-Dm8IL1Ks.js";
9
- import { _ as DEFAULT_MODEL, a as isCliProvider, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDefault, i as getModelRefStatus, p as resolveHooksGmailModel, u as resolveAllowedModelRef, v as DEFAULT_PROVIDER } from "./model-selection-DFbDH9o2.js";
9
+ import { _ as DEFAULT_MODEL, a as isCliProvider, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, g as DEFAULT_CONTEXT_TOKENS, h as resolveThinkingDefault, i as getModelRefStatus, p as resolveHooksGmailModel, u as resolveAllowedModelRef, v as DEFAULT_PROVIDER } from "./model-selection-DcO3qJOu.js";
10
10
  import { i as loadWorkspaceSkillEntries, r as buildWorkspaceSkillSnapshot, x as hasBinary } from "./skills-DtoVe1dS.js";
11
11
  import { o as isTestDefaultMemorySlotDisabled } from "./manifest-registry-W_OfCIRP.js";
12
12
  import { t as buildWorkspaceSkillStatus } from "./skills-status-DuLjkX2E.js";
13
- import { A as resolveAgentMaxConcurrent, M as VERSION, T as applyLegacyMigrations, a as parseConfigJson5, c as resolveConfigSnapshotHash, d as AnimaSchema, i as loadConfig, j as resolveSubagentMaxConcurrent, l as writeConfigFile, m as parseDurationMs, n as migrateLegacyConfig, o as readConfigFileSnapshot, p as sensitive, r as createConfigIO, s as readConfigFileSnapshotForWrite, u as validateConfigObjectWithPlugins, w as applyMergePatch } from "./config-Ofh9gKvs.js";
14
- import { $ as validateNodePairRequestParams, A as validateCronStatusParams, B as validateExecApprovalsNodeGetParams, C as validateConfigSetParams, Ct as validateWizardCancelParams, D as validateCronRemoveParams, Dt as PROTOCOL_VERSION, E as validateCronListParams, Et as validateWizardStatusParams, F as validateDeviceTokenRevokeParams, G as validateNodeDescribeParams, H as validateExecApprovalsSetParams, I as validateDeviceTokenRotateParams, It as deriveDeviceIdFromPublicKey, J as validateNodeInvokeResultParams, K as validateNodeEventParams, L as validateExecApprovalRequestParams, M as validateDevicePairApproveParams, N as validateDevicePairListParams, Nt as normalizeInputProvenance, O as validateCronRunParams, Ot as ErrorCodes, P as validateDevicePairRejectParams, Pt as buildDeviceAuthPayload, Q as validateNodePairRejectParams, R as validateExecApprovalResolveParams, Rt as normalizeDevicePublicKeyBase64Url, S as validateConfigSchemaParams, St as validateWebLoginWaitParams, T as validateCronAddParams, Tt as validateWizardStartParams, U as validateLogsTailParams, V as validateExecApprovalsNodeSetParams, W as validateModelsListParams, X as validateNodePairApproveParams, Y as validateNodeListParams, Z as validateNodePairListParams, _ as validateChatInjectParams, _t as validateTalkConfigParams, a as validateAgentWaitParams, at as validateSessionsCompactParams, b as validateConfigGetParams, bt as validateWakeParams, c as validateAgentsFilesGetParams, ct as validateSessionsPatchParams, d as validateAgentsListParams, dt as validateSessionsResolveParams, et as validateNodePairVerifyParams, f as validateAgentsUpdateParams, ft as validateSessionsUsageParams, g as validateChatHistoryParams, gt as validateSkillsUpdateParams, h as validateChatAbortParams, ht as validateSkillsStatusParams, i as validateAgentParams, it as validateSendParams, j as validateCronUpdateParams, jt as parseSessionLabel, k as validateCronRunsParams, kt as errorShape, l as validateAgentsFilesListParams, lt as validateSessionsPreviewParams, m as validateChannelsStatusParams, mt as validateSkillsInstallParams, n as formatValidationErrors, nt as validatePollParams, o as validateAgentsCreateParams, ot as validateSessionsDeleteParams, p as validateChannelsLogoutParams, pt as validateSkillsBinsParams, q as validateNodeInvokeParams, r as validateAgentIdentityParams, rt as validateRequestFrame, s as validateAgentsDeleteParams, st as validateSessionsListParams, tt as validateNodeRenameParams, u as validateAgentsFilesSetParams, ut as validateSessionsResetParams, v as validateChatSendParams, vt as validateTalkModeParams, w as validateConnectParams, wt as validateWizardNextParams, x as validateConfigPatchParams, xt as validateWebLoginStartParams, y as validateConfigApplyParams, yt as validateUpdateRunParams, z as validateExecApprovalsGetParams, zt as verifyDeviceSignature } from "./client-DzIcZx4J.js";
13
+ import { A as resolveAgentMaxConcurrent, M as VERSION, T as applyLegacyMigrations, a as parseConfigJson5, c as resolveConfigSnapshotHash, d as AnimaSchema, i as loadConfig, j as resolveSubagentMaxConcurrent, l as writeConfigFile, m as parseDurationMs, n as migrateLegacyConfig, o as readConfigFileSnapshot, p as sensitive, r as createConfigIO, s as readConfigFileSnapshotForWrite, u as validateConfigObjectWithPlugins, w as applyMergePatch } from "./config-BrVuTQ8R.js";
14
+ import { $ as validateNodePairRequestParams, A as validateCronStatusParams, B as validateExecApprovalsNodeGetParams, C as validateConfigSetParams, Ct as validateWizardCancelParams, D as validateCronRemoveParams, Dt as PROTOCOL_VERSION, E as validateCronListParams, Et as validateWizardStatusParams, F as validateDeviceTokenRevokeParams, G as validateNodeDescribeParams, H as validateExecApprovalsSetParams, I as validateDeviceTokenRotateParams, It as deriveDeviceIdFromPublicKey, J as validateNodeInvokeResultParams, K as validateNodeEventParams, L as validateExecApprovalRequestParams, M as validateDevicePairApproveParams, N as validateDevicePairListParams, Nt as normalizeInputProvenance, O as validateCronRunParams, Ot as ErrorCodes, P as validateDevicePairRejectParams, Pt as buildDeviceAuthPayload, Q as validateNodePairRejectParams, R as validateExecApprovalResolveParams, Rt as normalizeDevicePublicKeyBase64Url, S as validateConfigSchemaParams, St as validateWebLoginWaitParams, T as validateCronAddParams, Tt as validateWizardStartParams, U as validateLogsTailParams, V as validateExecApprovalsNodeSetParams, W as validateModelsListParams, X as validateNodePairApproveParams, Y as validateNodeListParams, Z as validateNodePairListParams, _ as validateChatInjectParams, _t as validateTalkConfigParams, a as validateAgentWaitParams, at as validateSessionsCompactParams, b as validateConfigGetParams, bt as validateWakeParams, c as validateAgentsFilesGetParams, ct as validateSessionsPatchParams, d as validateAgentsListParams, dt as validateSessionsResolveParams, et as validateNodePairVerifyParams, f as validateAgentsUpdateParams, ft as validateSessionsUsageParams, g as validateChatHistoryParams, gt as validateSkillsUpdateParams, h as validateChatAbortParams, ht as validateSkillsStatusParams, i as validateAgentParams, it as validateSendParams, j as validateCronUpdateParams, jt as parseSessionLabel, k as validateCronRunsParams, kt as errorShape, l as validateAgentsFilesListParams, lt as validateSessionsPreviewParams, m as validateChannelsStatusParams, mt as validateSkillsInstallParams, n as formatValidationErrors, nt as validatePollParams, o as validateAgentsCreateParams, ot as validateSessionsDeleteParams, p as validateChannelsLogoutParams, pt as validateSkillsBinsParams, q as validateNodeInvokeParams, r as validateAgentIdentityParams, rt as validateRequestFrame, s as validateAgentsDeleteParams, st as validateSessionsListParams, tt as validateNodeRenameParams, u as validateAgentsFilesSetParams, ut as validateSessionsResetParams, v as validateChatSendParams, vt as validateTalkModeParams, w as validateConnectParams, wt as validateWizardNextParams, x as validateConfigPatchParams, xt as validateWebLoginStartParams, y as validateConfigApplyParams, yt as validateUpdateRunParams, z as validateExecApprovalsGetParams, zt as verifyDeviceSignature } from "./client-CfLiulzK.js";
15
15
  import { n as pickPrimaryTailnetIPv6, t as pickPrimaryTailnetIPv4 } from "./tailnet-DpzsRR75.js";
16
- import { s as loadGatewayTlsRuntime$1 } from "./call-DHZ76BNg.js";
17
- import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, i as isGatewayMessageChannel, l as normalizeMessageChannel, n as isDeliverableMessageChannel, p as GATEWAY_CLIENT_IDS, r as isGatewayCliClient, s as isWebchatClient, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-DdOBO6Qm.js";
16
+ import { s as loadGatewayTlsRuntime$1 } from "./call-B4lhqS6H.js";
17
+ import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, i as isGatewayMessageChannel, l as normalizeMessageChannel, n as isDeliverableMessageChannel, p as GATEWAY_CLIENT_IDS, r as isGatewayCliClient, s as isWebchatClient, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-DIHHKJhk.js";
18
18
  import { c as resolveGatewayBindHost, d as rawDataToString, i as isTrustedProxyAddress, l as resolveGatewayClientIp, n as isLoopbackHost, r as isPrivateOrLoopbackAddress, s as pickPrimaryLanIPv4, t as isLoopbackAddress, u as resolveGatewayListenHosts } from "./net-CRsiP49R.js";
19
- import { $ as resolveOutboundSessionRoute, $n as normalizeMimeList, A as getTotalQueueSize, At as applyBrowserProxyPaths, B as loadCombinedSessionStoreForGateway, Bn as registerUnhandledRejectionHandler, Bt as markGatewaySigusr1RestartHandled, Cn as createAsyncLock, Cr as runCliAgent, Ct as normalizePayloadToSystemText, D as setCliSessionId, Dn as writeJsonAtomic, Dr as getAgentRunContext, Dt as detectSuspiciousPatterns, E as getCliSessionId, En as resolvePairingPaths, Er as emitAgentEvent, Et as buildSafeExternalPrompt, F as readLatestAssistantReply, Fn as isSystemEventContextChanged, Ft as CommandLane, G as archiveFileOnDisk, Gn as DEFAULT_INPUT_IMAGE_MIMES, H as pruneLegacyStoreKeys, Hn as DEFAULT_INPUT_FILE_MAX_CHARS, Ht as setGatewaySigusr1RestartPolicy, I as resolveAnnounceTargetFromKey, It as consumeGatewaySigusr1RestartAuthorization, J as readSessionMessages, Jn as DEFAULT_INPUT_PDF_MAX_PIXELS, Jt as maskApiKey, K as archiveSessionTranscripts, Kn as DEFAULT_INPUT_MAX_REDIRECTS, Kt as loadProviderUsageSummary, L as canonicalizeSpawnedByForAgent, Lt as deferGatewayRestartUntilIdle, M as setCommandLaneConcurrency, Mn as applyVerboseOverride, N as waitForActiveTasks, Nn as parseVerboseOverride, O as getActiveTaskCount, On as getSkillsSnapshotVersion, Or as onAgentEvent, Ot as getHookType, P as createAnimaTools, Pn as enqueueSystemEvent, Q as ensureOutboundSessionEntry, Qn as extractImageContentFromSource, R as listAgentsForGateway, Rn as loadModelCatalog, Rt as emitGatewayRestart, S as getTotalPendingReplies, Sn as verifyPairingToken, St as normalizeOptionalText, T as BARE_SESSION_RESET_PROMPT, Tn as readJsonFile, Tr as clearAgentRunContext, Tt as migrateLegacyCronPayload, U as resolveGatewaySessionStoreTarget, Un as DEFAULT_INPUT_FILE_MIMES, Ut as setPreRestartDeferralCheck, V as loadSessionEntry, Vn as DEFAULT_INPUT_FILE_MAX_BYTES, Vt as scheduleGatewaySigusr1Restart, W as resolveSessionModelRef, Wn as DEFAULT_INPUT_IMAGE_MAX_BYTES, Wt as normalizeGroupActivation, X as resolveSessionTranscriptCandidates, Xn as DEFAULT_INPUT_TIMEOUT_MS, Y as readSessionPreviewItemsFromTranscript, Yn as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, Yt as saveProviderStore, Z as stripEnvelopeFromMessages, Zn as extractFileContentFromSource, _n as renamePairedNode, _t as writeRestartSentinel, a as runSubagentAnnounceFlow, an as normalizeSendPolicy, ar as isDiagnosticsEnabled, b as dispatchInboundMessage, bn as verifyNodeToken, bt as inferLegacyName, c as runEmbeddedPiAgent, cn as primeRemoteSkillsCache, ct as resetDirectoryCache, d as buildDefaultToolPolicyPipelineSteps, dn as refreshRemoteNodeBins, dt as consumeRestartSentinel, er as estimateBase64DecodedBytes, f as sniffMimeFromBase64, fn as removeRemoteNodeInfo, ft as formatDoctorNonInteractiveHint, g as getChannelActivity, gn as rejectNodePairing, hn as listNodePairing, ht as summarizeRestartSentinel, ir as stopDiagnosticHeartbeat, j as resetAllLanes, jn as applyModelOverrideToSessionEntry, jt as persistBrowserProxyFiles, kn as registerSkillsChangeListener, kr as registerAgentRunContext, kt as isExternalHookSession, l as waitForEmbeddedPiRunEnd, ln as recordRemoteNodeInfo, lt as resolveMessageChannelSelection, m as loadAnimaPlugins, mn as approveNodePairing, mr as stopSubagentsForRequester, n as initSubagentRegistry, nr as resolveAgentTimeoutMs, o as clearSessionQueues, on as resolveSendPolicy, ot as resolveOutboundTarget, p as getPluginToolMeta, pn as setSkillsRemoteRegistry, pr as isAbortTrigger, pt as formatRestartSentinelMessage, q as capArrayByJsonBytes, qn as DEFAULT_INPUT_PDF_MAX_PAGES, qt as loadProviderStore, r as listDescendantRunsForRequester, rn as requestHeartbeatNow, rr as startDiagnosticHeartbeat, s as abortEmbeddedPiRun, sn as getRemoteSkillEligibility, st as resolveSessionDeliveryTarget, t as countActiveDescendantRuns, u as applyToolPolicyPipeline, un as refreshRemoteBinsForConnectedNodes, ur as formatZonedTimestamp, ut as runWithModelFallback, vn as requestNodePairing, vr as resolveAgentIdentity, vt as normalizeCronJobCreate, wn as pruneExpiredPending, wt as normalizeRequiredName, x as createReplyDispatcher, xn as generatePairingToken, xt as normalizeOptionalAgentId, yn as updatePairedNodeMetadata, yt as normalizeCronJobPatch, z as listSessionsFromStore, zt as isGatewaySigusr1RestartExternallyAllowed } from "./subagent-registry-MZIxVf8W.js";
20
- import { C as resolveMainSessionKeyFromConfig, I as normalizeSessionDeliveryFields, M as deliveryContextFromSession, P as mergeDeliveryContext, S as resolveMainSessionKey, T as snapshotSessionOrigin, b as resolveAgentMainSessionKey, i as loadSessionStore, l as updateSessionStore, t as extractDeliveryInfo, x as resolveExplicitAgentSessionKey } from "./sessions-1XK2mH6L.js";
19
+ import { $ as ensureOutboundSessionEntry, $n as extractImageContentFromSource, $t as loadProviderStore, A as getTotalQueueSize, An as registerSkillsChangeListener, B as loadCombinedSessionStoreForGateway, Cn as renamePairedNode, Ct as normalizeCronJobPatch, D as setCliSessionId, Dn as generatePairingToken, Dr as getAgentRunContext, Dt as normalizePayloadToSystemText, E as getCliSessionId, En as verifyNodeToken, Er as emitAgentEvent, Et as normalizeOptionalText, F as readLatestAssistantReply, Fn as enqueueSystemEvent, Ft as isExternalHookSession, G as archiveFileOnDisk, Gn as DEFAULT_INPUT_IMAGE_MAX_BYTES, Gt as isGatewaySigusr1RestartExternallyAllowed, H as pruneLegacyStoreKeys, Hn as DEFAULT_INPUT_FILE_MAX_BYTES, Ht as consumeGatewaySigusr1RestartAuthorization, I as resolveAnnounceTargetFromKey, In as isSystemEventContextChanged, It as applyBrowserProxyPaths, J as readSessionMessages, Jn as DEFAULT_INPUT_PDF_MAX_PAGES, Jt as setGatewaySigusr1RestartPolicy, K as archiveSessionTranscripts, Kn as DEFAULT_INPUT_IMAGE_MIMES, Kt as markGatewaySigusr1RestartHandled, L as canonicalizeSpawnedByForAgent, Lt as persistBrowserProxyFiles, M as setCommandLaneConcurrency, Mn as applyModelOverrideToSessionEntry, Mt as buildSafeExternalPrompt, N as waitForActiveTasks, Nn as applyVerboseOverride, Nt as detectSuspiciousPatterns, O as getActiveTaskCount, On as verifyPairingToken, Or as onAgentEvent, Ot as normalizeRequiredName, P as createAnimaTools, Pn as parseVerboseOverride, Pt as getHookType, Qn as extractFileContentFromSource, Qt as loadProviderUsageSummary, R as listAgentsForGateway, S as getTotalPendingReplies, Sn as rejectNodePairing, St as normalizeCronJobCreate, T as BARE_SESSION_RESET_PROMPT, Tn as updatePairedNodeMetadata, Tr as clearAgentRunContext, Tt as normalizeOptionalAgentId, U as resolveGatewaySessionStoreTarget, Un as DEFAULT_INPUT_FILE_MAX_CHARS, Ut as deferGatewayRestartUntilIdle, V as loadSessionEntry, Vn as registerUnhandledRejectionHandler, Vt as CommandLane, W as resolveSessionModelRef, Wn as DEFAULT_INPUT_FILE_MIMES, Wt as emitGatewayRestart, X as resolveSessionTranscriptCandidates, Xn as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, Xt as normalizeGroupActivation, Y as readSessionPreviewItemsFromTranscript, Yn as DEFAULT_INPUT_PDF_MAX_PIXELS, Yt as setPreRestartDeferralCheck, Z as stripEnvelopeFromMessages, Zn as DEFAULT_INPUT_TIMEOUT_MS, _n as refreshRemoteNodeBins, _t as formatRestartSentinelMessage, a as runSubagentAnnounceFlow, ar as stopDiagnosticHeartbeat, b as dispatchInboundMessage, bn as approveNodePairing, c as waitForEmbeddedPiRunEnd, ct as resolveSessionDeliveryTarget, d as buildDefaultToolPolicyPipelineSteps, dn as normalizeSendPolicy, dr as formatZonedTimestamp, dt as resolveMessageChannelSelection, en as maskApiKey, er as normalizeMimeList, et as resolveOutboundSessionRoute, f as sniffMimeFromBase64, fn as resolveSendPolicy, g as getChannelActivity, gn as refreshRemoteBinsForConnectedNodes, gt as formatDoctorNonInteractiveHint, hn as recordRemoteNodeInfo, hr as stopSubagentsForRequester, ht as consumeRestartSentinel, ir as startDiagnosticHeartbeat, j as resetAllLanes, kn as getSkillsSnapshotVersion, kr as registerAgentRunContext, kt as migrateLegacyCronPayload, l as runNoxSoftEmbeddedAgent, ln as requestHeartbeatNow, m as loadAnimaPlugins, mn as primeRemoteSkillsCache, mr as isAbortTrigger, mt as resolveWorkingModeModelSelection, n as initSubagentRegistry, o as clearSessionQueues, or as isDiagnosticsEnabled, p as getPluginToolMeta, pn as getRemoteSkillEligibility, pt as runWithModelFallback, q as capArrayByJsonBytes, qn as DEFAULT_INPUT_MAX_REDIRECTS, qt as scheduleGatewaySigusr1Restart, r as listDescendantRunsForRequester, rr as resolveAgentTimeoutMs, s as abortEmbeddedPiRun, st as resolveOutboundTarget, t as countActiveDescendantRuns, tn as saveProviderStore, tr as estimateBase64DecodedBytes, u as applyToolPolicyPipeline, ut as resetDirectoryCache, vn as removeRemoteNodeInfo, wn as requestNodePairing, wt as inferLegacyName, x as createReplyDispatcher, xn as listNodePairing, xt as writeRestartSentinel, yn as setSkillsRemoteRegistry, yr as resolveAgentIdentity, yt as summarizeRestartSentinel, z as listSessionsFromStore, zn as loadModelCatalog } from "./subagent-registry-CPtElVX0.js";
20
+ import { C as resolveMainSessionKeyFromConfig, I as normalizeSessionDeliveryFields, M as deliveryContextFromSession, P as mergeDeliveryContext, S as resolveMainSessionKey, T as snapshotSessionOrigin, b as resolveAgentMainSessionKey, i as loadSessionStore, l as updateSessionStore, t as extractDeliveryInfo, x as resolveExplicitAgentSessionKey } from "./sessions-C_3wTmSA.js";
21
21
  import { n as SILENT_REPLY_TOKEN, r as isSilentReplyText } from "./tokens-CmlI2hSz.js";
22
- import { B as resolveTtsPrefsPath, K as setTtsProvider, L as resolveTtsApiKey, N as isTtsEnabled, P as isTtsProviderConfigured, R as resolveTtsAutoMode, V as resolveTtsProviderOrder, W as setTtsEnabled, X as OPENAI_TTS_VOICES, Y as OPENAI_TTS_MODELS, at as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, it as triggerInternalHook, j as getTtsProvider, lt as stripHeartbeatToken, nt as createInternalHookEvent, q as textToSpeech, rt as registerInternalHook, tt as clearInternalHooks, w as resolveUserTimezone, z as resolveTtsConfig } from "./anthropic-direct-runner-CzQb7QkD.js";
22
+ import { B as resolveTtsConfig, F as isTtsProviderConfigured, G as setTtsEnabled, H as resolveTtsProviderOrder, J as textToSpeech, M as getTtsProvider, P as isTtsEnabled, R as resolveTtsApiKey, T as resolveUserTimezone, V as resolveTtsPrefsPath, X as OPENAI_TTS_MODELS, Z as OPENAI_TTS_VOICES, at as triggerInternalHook, it as registerInternalHook, nt as clearInternalHooks, ot as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, q as setTtsProvider, rt as createInternalHookEvent, ut as stripHeartbeatToken, z as resolveTtsAutoMode } from "./anthropic-direct-runner-C2Kwju-r.js";
23
23
  import { a as normalizeElevatedLevel, c as normalizeUsageDisplay, d as supportsXHighThinking, l as normalizeVerboseLevel, n as formatXHighModelHint, o as normalizeReasoningLevel, s as normalizeThinkLevel, t as formatThinkingLevels } from "./pi-embedded-helpers-D2SLlgS4.js";
24
- import { _ as resolveToolProfilePolicy, p as collectExplicitAllowlist } from "./sandbox-DDOFuJU9.js";
24
+ import { _ as resolveToolProfilePolicy, p as collectExplicitAllowlist } from "./sandbox-D-N7M7lp.js";
25
25
  import { a as AUTH_RATE_LIMIT_SCOPE_DEVICE_TOKEN, c as safeEqualSecret, d as enableTailscaleFunnel, f as enableTailscaleServe, i as resolveGatewayAuth, l as disableTailscaleFunnel, m as getTailnetHostname, n as authorizeGatewayConnect, o as AUTH_RATE_LIMIT_SCOPE_SHARED_SECRET, r as isLocalDirectRequest, s as createAuthRateLimiter, t as assertGatewayAuthConfigured, u as disableTailscaleServe } from "./auth-Cp__MMeO.js";
26
- import { r as movePathToTrash } from "./server-context-Dkz4Ce8z.js";
26
+ import { r as movePathToTrash } from "./server-context-Clykq0XU.js";
27
27
  import { n as formatErrorMessage } from "./errors-COFgygw8.js";
28
28
  import { o as detectMime } from "./image-ops-BdrMmiG4.js";
29
29
  import { i as formatPortDiagnostics, n as inspectPortUsage } from "./ports-B_f42zcA.js";
30
30
  import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-BOMS6J5A.js";
31
31
  import { c as resolveStorePath, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, r as resolveSessionFilePathOptions, s as resolveSessionTranscriptsDirForAgent } from "./paths-DMk3Q7yD.js";
32
- import { o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads, x as runGlobalGatewayStopSafely, y as getGlobalHookRunner } from "./deliver-DVt8TbK9.js";
33
- import { i as resolveMemoryBackendConfig, r as getMemorySearchManager } from "./memory-cli-COl5xoIl.js";
32
+ import { o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads, x as runGlobalGatewayStopSafely, y as getGlobalHookRunner } from "./deliver-C1L5nO0K.js";
33
+ import { i as resolveMemoryBackendConfig, r as getMemorySearchManager } from "./memory-cli-B0kKl-9T.js";
34
+ import { a as readTrustGraphSnapshot, c as pruneExpiredPending, d as writeJsonAtomic, l as readJsonFile, o as saveTrustGraph, s as createAsyncLock, u as resolvePairingPaths } from "./loader-C87TLS4J.js";
34
35
  import { t as ToolInputError } from "./common-CqIa2poH.js";
35
36
  import { o as normalizePollInput } from "./active-listener-gGCoq55D.js";
36
- import { t as lookupContextTokens } from "./context-CpsnZLOp.js";
37
- import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, r as resolveEffectiveToolPolicy } from "./pi-tools.policy-CDgjN_3f.js";
37
+ import { t as lookupContextTokens } from "./context-B5X720Bs.js";
38
+ import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, r as resolveEffectiveToolPolicy } from "./pi-tools.policy-D2FusuQa.js";
38
39
  import { f as resolveExecApprovalsSocketPath, o as normalizeExecApprovals, p as saveExecApprovals, r as ensureExecApprovals, s as readExecApprovalsSnapshot, t as DEFAULT_EXEC_APPROVAL_TIMEOUT_MS } from "./exec-approvals-CpOeHRBL.js";
39
40
  import { i as loadSessionUsageTimeSeries, l as deriveSessionTotalTokens, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions, u as hasNonzeroUsage } from "./session-cost-usage-DnxtnK1E.js";
40
- import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-D1oxSXVg.js";
41
- import { t as createBrowserRouteDispatcher } from "./dispatcher-DpSnqIL0.js";
41
+ import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-3CI4vt1h.js";
42
+ import { t as createBrowserRouteDispatcher } from "./dispatcher-BQQugU-7.js";
42
43
  import { t as parseAbsoluteTimeMs } from "./parse-DLMgOMDI.js";
43
- import { c as saveToken, i as getToken, l as whoami, n as clearToken, o as registerWithInvite, s as resolveSuggestedIdentity, t as TOKEN_PATH } from "./noxsoft-auth-DpwLJIW0.js";
44
- import { c as resolveCronStyleNow, i as onHeartbeatEvent, r as getLastHeartbeatEvent, t as resolveHeartbeatVisibility } from "./heartbeat-visibility-DcGQOTXe.js";
45
- import { r as buildHistoryContextFromEntries, t as createReplyPrefixOptions } from "./reply-prefix-DBRqtDEq.js";
44
+ import { c as saveToken, i as getToken, l as whoami, n as clearToken, o as registerWithInvite, s as resolveSuggestedIdentity, t as TOKEN_PATH } from "./noxsoft-auth-CgCk5707.js";
45
+ import { c as resolveCronStyleNow, i as onHeartbeatEvent, r as getLastHeartbeatEvent, t as resolveHeartbeatVisibility } from "./heartbeat-visibility-BjYY-mKG.js";
46
+ import { r as buildHistoryContextFromEntries, t as createReplyPrefixOptions } from "./reply-prefix-DmWGtcH-.js";
46
47
  import { t as ensureAnimaCliOnPath } from "./path-env-CafGfJPa.js";
47
48
  import { n as DEFAULT_GATEWAY_HTTP_TOOL_DENY } from "./dangerous-tools-Asx2qyrG.js";
48
- import { C as resolveAssistantAvatarUrl, S as normalizeControlUiBasePath, b as CONTROL_UI_AVATAR_PREFIX, c as handleReset, h as resolveControlUiLinks, x as buildControlUiAvatarUrl } from "./onboard-helpers-IeOtcIME.js";
49
+ import { C as resolveAssistantAvatarUrl, S as normalizeControlUiBasePath, b as CONTROL_UI_AVATAR_PREFIX, c as handleReset, h as resolveControlUiLinks, x as buildControlUiAvatarUrl } from "./onboard-helpers-CFudIoX4.js";
49
50
  import { t as resolveGatewayService } from "./service-4VfZwSv1.js";
50
51
  import { t as parsePort } from "./parse-port-BKB9Exlg.js";
51
52
  import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-CtU9Fx7K.js";
52
53
  import { i as toOptionString, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-7KwLAyAq.js";
53
- import { o as isNodeCommandAllowed, s as resolveNodeCommandAllowlist } from "./audit-HJOpXfgY.js";
54
- import { r as getStatusSummary } from "./status-C9B6cEM0.js";
54
+ import { o as isNodeCommandAllowed, s as resolveNodeCommandAllowlist } from "./audit-DDz7UOIx.js";
55
+ import { r as getStatusSummary } from "./status-DfZJJqNs.js";
55
56
  import { t as resolveChannelDefaultAccountId } from "./helpers-CVp8W9aa.js";
56
- import { c as setHeartbeatsEnabled, l as startHeartbeatRunner, n as getHealthSnapshot, s as runHeartbeatOnce } from "./health-BttJ1Qeh.js";
57
- import { a as createOutboundSendDeps, i as resolveAgentOutboundTarget, o as createDefaultDeps, r as resolveAgentDeliveryPlan, s as createOutboundSendDeps$1, t as agentCommand } from "./agent-DUAarfNl.js";
57
+ import { c as setHeartbeatsEnabled, l as startHeartbeatRunner, n as getHealthSnapshot, s as runHeartbeatOnce } from "./health-C8KCBhuo.js";
58
+ import { n as createDefaultDeps, r as createOutboundSendDeps$1, t as createOutboundSendDeps } from "./outbound-send-deps-T_FgdfgW.js";
58
59
  import { t as buildChannelUiCatalog } from "./catalog-B-TAbJ2o.js";
59
- import { t as applyPluginAutoEnable } from "./plugin-auto-enable-OqDAK-ap.js";
60
+ import { t as applyPluginAutoEnable } from "./plugin-auto-enable-DhuD30Je.js";
60
61
  import { a as resolveControlUiRootOverrideSync, n as ensureControlUiAssetsBuilt, o as resolveControlUiRootSync } from "./health-format-BLnFZCH_.js";
61
62
  import { n as validateSystemRunCommandConsistency, r as getMachineDisplayName, t as formatExecCommand } from "./system-run-command-CxQM9dLk.js";
62
63
  import { h as normalizeUpdateChannel, l as DEFAULT_PACKAGE_CHANNEL, n as checkUpdateStatus, o as resolveNpmChannelTag, r as compareSemverStrings } from "./channels-status-issues-CklLFAsD.js";
63
- import { t as WizardCancelledError } from "./prompts-D6b3zLVO.js";
64
- import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-DiqubDlK.js";
65
- import { t as runOnboardingWizard } from "./onboarding-CZBVMwFn.js";
66
- import { a as setGatewayWsLogStyle, i as summarizeAgentEventForWsLog, n as logWs, r as shouldLogWs, t as formatForLog } from "./ws-log-BA9w1cJs.js";
67
- import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-CR33Gqfc.js";
68
- import { a as loadAgentIdentity, c as loadAgentIdentityFromWorkspace, i as listAgentEntries, o as pruneAgentConfig, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-DibGEnBs.js";
69
- import { t as migrateFromCoherence } from "./migrate-DkBWjPPs.js";
70
- import { t as installSkill } from "./skills-install-CE6djAWL.js";
71
- import { t as runGatewayUpdate } from "./update-runner-iLJQF6VA.js";
72
- import { n as forceFreePortAndWait } from "./ports-aNJUI3Mi.js";
64
+ import { t as WizardCancelledError } from "./prompts-BmgT_kkv.js";
65
+ import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-DqfJDvYl.js";
66
+ import { t as runOnboardingWizard } from "./onboarding-BB9PteK8.js";
67
+ import { a as setGatewayWsLogStyle, i as summarizeAgentEventForWsLog, n as logWs, r as shouldLogWs, t as formatForLog } from "./ws-log-CG6cvCZW.js";
68
+ import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-BIXtKTpT.js";
69
+ import { a as loadAgentIdentity, c as loadAgentIdentityFromWorkspace, i as listAgentEntries, o as pruneAgentConfig, r as findAgentEntryIndex, t as applyAgentConfig } from "./agents.config-Br4ULmK0.js";
70
+ import { n as resolveAgentDeliveryPlan, r as resolveAgentOutboundTarget, t as agentCommand } from "./agent-CnS0SRpT.js";
71
+ import { t as migrateFromCoherence } from "./migrate-bgeTT_GR.js";
72
+ import { t as installSkill } from "./skills-install-Qw2oU8L8.js";
73
+ import { t as runGatewayUpdate } from "./update-runner-kE8AMQt4.js";
74
+ import { n as forceFreePortAndWait } from "./ports-BGLuwt2Z.js";
73
75
  import { execFile, spawn, spawnSync } from "node:child_process";
74
76
  import os from "node:os";
75
77
  import path from "node:path";
@@ -107,7 +109,7 @@ function getActiveEmbeddedRunCount() {
107
109
 
108
110
  //#endregion
109
111
  //#region src/infra/exec-approval-forwarder.ts
110
- const log$6 = createSubsystemLogger("gateway/exec-approvals");
112
+ const log$7 = createSubsystemLogger("gateway/exec-approvals");
111
113
  const DEFAULT_MODE = "session";
112
114
  function normalizeMode(mode) {
113
115
  return mode ?? DEFAULT_MODE;
@@ -222,7 +224,7 @@ async function deliverToTargets(params) {
222
224
  payloads: [{ text: params.text }]
223
225
  });
224
226
  } catch (err) {
225
- log$6.error(`exec approvals: failed to deliver to ${channel}:${target.to}: ${String(err)}`);
227
+ log$7.error(`exec approvals: failed to deliver to ${channel}:${target.to}: ${String(err)}`);
226
228
  }
227
229
  });
228
230
  await Promise.allSettled(deliveries);
@@ -1459,7 +1461,7 @@ function createAgentEventHandler({ broadcast, broadcastToConnIds, nodeSendToSess
1459
1461
  * Automatically starts `gog gmail watch serve` when the gateway starts,
1460
1462
  * if hooks.gmail is configured with an account.
1461
1463
  */
1462
- const log$5 = createSubsystemLogger("gmail-watcher");
1464
+ const log$6 = createSubsystemLogger("gmail-watcher");
1463
1465
  const ADDRESS_IN_USE_RE = /address already in use|EADDRINUSE/i;
1464
1466
  function isAddressInUseError(line) {
1465
1467
  return ADDRESS_IN_USE_RE.test(line);
@@ -1483,13 +1485,13 @@ async function startGmailWatch(cfg) {
1483
1485
  const result = await runCommandWithTimeout(args, { timeoutMs: 12e4 });
1484
1486
  if (result.code !== 0) {
1485
1487
  const message = result.stderr || result.stdout || "gog watch start failed";
1486
- log$5.error(`watch start failed: ${message}`);
1488
+ log$6.error(`watch start failed: ${message}`);
1487
1489
  return false;
1488
1490
  }
1489
- log$5.info(`watch started for ${cfg.account}`);
1491
+ log$6.info(`watch started for ${cfg.account}`);
1490
1492
  return true;
1491
1493
  } catch (err) {
1492
- log$5.error(`watch start error: ${String(err)}`);
1494
+ log$6.error(`watch start error: ${String(err)}`);
1493
1495
  return false;
1494
1496
  }
1495
1497
  }
@@ -1498,7 +1500,7 @@ async function startGmailWatch(cfg) {
1498
1500
  */
1499
1501
  function spawnGogServe(cfg) {
1500
1502
  const args = buildGogWatchServeArgs(cfg);
1501
- log$5.info(`starting gog ${args.join(" ")}`);
1503
+ log$6.info(`starting gog ${args.join(" ")}`);
1502
1504
  let addressInUse = false;
1503
1505
  const child = spawn("gog", args, {
1504
1506
  stdio: [
@@ -1510,25 +1512,25 @@ function spawnGogServe(cfg) {
1510
1512
  });
1511
1513
  child.stdout?.on("data", (data) => {
1512
1514
  const line = data.toString().trim();
1513
- if (line) log$5.info(`[gog] ${line}`);
1515
+ if (line) log$6.info(`[gog] ${line}`);
1514
1516
  });
1515
1517
  child.stderr?.on("data", (data) => {
1516
1518
  const line = data.toString().trim();
1517
1519
  if (!line) return;
1518
1520
  if (isAddressInUseError(line)) addressInUse = true;
1519
- log$5.warn(`[gog] ${line}`);
1521
+ log$6.warn(`[gog] ${line}`);
1520
1522
  });
1521
1523
  child.on("error", (err) => {
1522
- log$5.error(`gog process error: ${String(err)}`);
1524
+ log$6.error(`gog process error: ${String(err)}`);
1523
1525
  });
1524
1526
  child.on("exit", (code, signal) => {
1525
1527
  if (shuttingDown) return;
1526
1528
  if (addressInUse) {
1527
- log$5.warn("gog serve failed to bind (address already in use); stopping restarts. Another watcher is likely running. Set ANIMA_SKIP_GMAIL_WATCHER=1 or stop the other process.");
1529
+ log$6.warn("gog serve failed to bind (address already in use); stopping restarts. Another watcher is likely running. Set ANIMA_SKIP_GMAIL_WATCHER=1 or stop the other process.");
1528
1530
  watcherProcess = null;
1529
1531
  return;
1530
1532
  }
1531
- log$5.warn(`gog exited (code=${code}, signal=${signal}); restarting in 5s`);
1533
+ log$6.warn(`gog exited (code=${code}, signal=${signal}); restarting in 5s`);
1532
1534
  watcherProcess = null;
1533
1535
  setTimeout(() => {
1534
1536
  if (shuttingDown || !currentConfig) return;
@@ -1568,15 +1570,15 @@ async function startGmailWatcher(cfg) {
1568
1570
  port: runtimeConfig.serve.port,
1569
1571
  target: runtimeConfig.tailscale.target
1570
1572
  });
1571
- log$5.info(`tailscale ${runtimeConfig.tailscale.mode} configured for port ${runtimeConfig.serve.port}`);
1573
+ log$6.info(`tailscale ${runtimeConfig.tailscale.mode} configured for port ${runtimeConfig.serve.port}`);
1572
1574
  } catch (err) {
1573
- log$5.error(`tailscale setup failed: ${String(err)}`);
1575
+ log$6.error(`tailscale setup failed: ${String(err)}`);
1574
1576
  return {
1575
1577
  started: false,
1576
1578
  reason: `tailscale setup failed: ${String(err)}`
1577
1579
  };
1578
1580
  }
1579
- if (!await startGmailWatch(runtimeConfig)) log$5.warn("gmail watch start failed, but continuing with serve");
1581
+ if (!await startGmailWatch(runtimeConfig)) log$6.warn("gmail watch start failed, but continuing with serve");
1580
1582
  shuttingDown = false;
1581
1583
  watcherProcess = spawnGogServe(runtimeConfig);
1582
1584
  const renewMs = runtimeConfig.renewEveryMinutes * 6e4;
@@ -1584,7 +1586,7 @@ async function startGmailWatcher(cfg) {
1584
1586
  if (shuttingDown) return;
1585
1587
  startGmailWatch(runtimeConfig);
1586
1588
  }, renewMs);
1587
- log$5.info(`gmail watcher started for ${runtimeConfig.account} (renew every ${runtimeConfig.renewEveryMinutes}m)`);
1589
+ log$6.info(`gmail watcher started for ${runtimeConfig.account} (renew every ${runtimeConfig.renewEveryMinutes}m)`);
1588
1590
  return { started: true };
1589
1591
  }
1590
1592
  /**
@@ -1597,7 +1599,7 @@ async function stopGmailWatcher() {
1597
1599
  renewInterval = null;
1598
1600
  }
1599
1601
  if (watcherProcess) {
1600
- log$5.info("stopping gmail watcher");
1602
+ log$6.info("stopping gmail watcher");
1601
1603
  watcherProcess.kill("SIGTERM");
1602
1604
  await new Promise((resolve) => {
1603
1605
  const timeout = setTimeout(() => {
@@ -1612,7 +1614,7 @@ async function stopGmailWatcher() {
1612
1614
  watcherProcess = null;
1613
1615
  }
1614
1616
  currentConfig = null;
1615
- log$5.info("gmail watcher stopped");
1617
+ log$6.info("gmail watcher stopped");
1616
1618
  }
1617
1619
 
1618
1620
  //#endregion
@@ -2132,12 +2134,12 @@ async function runCronIsolatedAgentTurn(params) {
2132
2134
  }
2133
2135
  }
2134
2136
  const modelOverrideRaw = params.job.payload.kind === "agentTurn" ? params.job.payload.model : void 0;
2135
- const modelOverride = typeof modelOverrideRaw === "string" ? modelOverrideRaw.trim() : void 0;
2136
- if (modelOverride !== void 0 && modelOverride.length > 0) {
2137
+ const requestedModelOverride = typeof modelOverrideRaw === "string" ? modelOverrideRaw.trim() : void 0;
2138
+ if (requestedModelOverride !== void 0 && requestedModelOverride.length > 0) {
2137
2139
  const resolvedOverride = resolveAllowedModelRef({
2138
2140
  cfg: cfgWithAgentDefaults,
2139
2141
  catalog: await loadCatalog(),
2140
- raw: modelOverride,
2142
+ raw: requestedModelOverride,
2141
2143
  defaultProvider: resolvedDefault.provider,
2142
2144
  defaultModel: resolvedDefault.model
2143
2145
  });
@@ -2175,7 +2177,7 @@ async function runCronIsolatedAgentTurn(params) {
2175
2177
  const labelSuffix = typeof params.job.name === "string" && params.job.name.trim() ? params.job.name.trim() : params.job.id;
2176
2178
  cronSession.sessionEntry.label = `Cron: ${labelSuffix}`;
2177
2179
  }
2178
- if (!modelOverride && !hooksGmailModelApplied) {
2180
+ if (!requestedModelOverride && !hooksGmailModelApplied) {
2179
2181
  const sessionModelOverride = cronSession.sessionEntry.modelOverride?.trim();
2180
2182
  if (sessionModelOverride) {
2181
2183
  const sessionProviderOverride = cronSession.sessionEntry.providerOverride?.trim() || resolvedDefault.provider;
@@ -2281,27 +2283,11 @@ async function runCronIsolatedAgentTurn(params) {
2281
2283
  provider,
2282
2284
  model,
2283
2285
  agentDir,
2286
+ sessionEntry: cronSession.sessionEntry,
2287
+ thinkLevel,
2284
2288
  fallbacksOverride: resolveAgentModelFallbacksOverride(params.cfg, agentId),
2285
2289
  run: (providerOverride, modelOverride) => {
2286
- if (isCliProvider(providerOverride, cfgWithAgentDefaults)) {
2287
- const cliSessionId = getCliSessionId(cronSession.sessionEntry, providerOverride);
2288
- return runCliAgent({
2289
- sessionId: cronSession.sessionEntry.sessionId,
2290
- sessionKey: agentSessionKey,
2291
- agentId,
2292
- sessionFile,
2293
- workspaceDir,
2294
- config: cfgWithAgentDefaults,
2295
- prompt: commandBody,
2296
- provider: providerOverride,
2297
- model: modelOverride,
2298
- thinkLevel,
2299
- timeoutMs,
2300
- runId: cronSession.sessionEntry.sessionId,
2301
- cliSessionId
2302
- });
2303
- }
2304
- return runEmbeddedPiAgent({
2290
+ return runNoxSoftEmbeddedAgent({
2305
2291
  sessionId: cronSession.sessionEntry.sessionId,
2306
2292
  sessionKey: agentSessionKey,
2307
2293
  agentId,
@@ -2317,6 +2303,8 @@ async function runCronIsolatedAgentTurn(params) {
2317
2303
  model: modelOverride,
2318
2304
  thinkLevel,
2319
2305
  verboseLevel: resolvedVerboseLevel,
2306
+ execSecurity: cronSession.sessionEntry.execSecurity,
2307
+ cliSessionId: getCliSessionId(cronSession.sessionEntry, providerOverride),
2320
2308
  timeoutMs,
2321
2309
  runId: cronSession.sessionEntry.sessionId,
2322
2310
  requireExplicitMessageTarget: true,
@@ -2373,7 +2361,7 @@ async function runCronIsolatedAgentTurn(params) {
2373
2361
  const deliveryBestEffort = resolveCronDeliveryBestEffort(params.job);
2374
2362
  const ackMaxChars = resolveHeartbeatAckMaxChars(agentCfg);
2375
2363
  const skipHeartbeatDelivery = deliveryRequested && isHeartbeatOnlyResponse(payloads, ackMaxChars);
2376
- const skipMessagingToolDelivery = deliveryRequested && runResult.didSendViaMessagingTool === true && (runResult.messagingToolSentTargets ?? []).some((target) => matchesMessagingToolDeliveryTarget(target, {
2364
+ const skipMessagingToolDelivery = deliveryRequested && (runResult.messagingToolSentTargets ?? []).some((target) => matchesMessagingToolDeliveryTarget(target, {
2377
2365
  channel: resolvedDelivery.channel,
2378
2366
  to: resolvedDelivery.to,
2379
2367
  accountId: resolvedDelivery.accountId
@@ -4281,7 +4269,7 @@ async function startGatewayBonjourAdvertiser(opts) {
4281
4269
  await svc.destroy();
4282
4270
  } catch {}
4283
4271
  try {
4284
- await responder.shutdown();
4272
+ await responder.shutdown?.();
4285
4273
  } catch {} finally {
4286
4274
  ciaoCancellationRejectionHandler?.();
4287
4275
  }
@@ -5292,7 +5280,7 @@ function timestampOptsFromConfig(cfg) {
5292
5280
 
5293
5281
  //#endregion
5294
5282
  //#region src/gateway/sessions-patch.ts
5295
- function invalid$1(message) {
5283
+ function invalid$2(message) {
5296
5284
  return {
5297
5285
  ok: false,
5298
5286
  error: errorShape(ErrorCodes.INVALID_REQUEST, message)
@@ -5328,25 +5316,25 @@ async function applySessionsPatchToStore(params) {
5328
5316
  if ("spawnedBy" in patch) {
5329
5317
  const raw = patch.spawnedBy;
5330
5318
  if (raw === null) {
5331
- if (existing?.spawnedBy) return invalid$1("spawnedBy cannot be cleared once set");
5319
+ if (existing?.spawnedBy) return invalid$2("spawnedBy cannot be cleared once set");
5332
5320
  } else if (raw !== void 0) {
5333
5321
  const trimmed = String(raw).trim();
5334
- if (!trimmed) return invalid$1("invalid spawnedBy: empty");
5335
- if (!isSubagentSessionKey(storeKey)) return invalid$1("spawnedBy is only supported for subagent:* sessions");
5336
- if (existing?.spawnedBy && existing.spawnedBy !== trimmed) return invalid$1("spawnedBy cannot be changed once set");
5322
+ if (!trimmed) return invalid$2("invalid spawnedBy: empty");
5323
+ if (!isSubagentSessionKey(storeKey)) return invalid$2("spawnedBy is only supported for subagent:* sessions");
5324
+ if (existing?.spawnedBy && existing.spawnedBy !== trimmed) return invalid$2("spawnedBy cannot be changed once set");
5337
5325
  next.spawnedBy = trimmed;
5338
5326
  }
5339
5327
  }
5340
5328
  if ("spawnDepth" in patch) {
5341
5329
  const raw = patch.spawnDepth;
5342
5330
  if (raw === null) {
5343
- if (typeof existing?.spawnDepth === "number") return invalid$1("spawnDepth cannot be cleared once set");
5331
+ if (typeof existing?.spawnDepth === "number") return invalid$2("spawnDepth cannot be cleared once set");
5344
5332
  } else if (raw !== void 0) {
5345
- if (!isSubagentSessionKey(storeKey)) return invalid$1("spawnDepth is only supported for subagent:* sessions");
5333
+ if (!isSubagentSessionKey(storeKey)) return invalid$2("spawnDepth is only supported for subagent:* sessions");
5346
5334
  const numeric = Number(raw);
5347
- if (!Number.isInteger(numeric) || numeric < 0) return invalid$1("invalid spawnDepth (use an integer >= 0)");
5335
+ if (!Number.isInteger(numeric) || numeric < 0) return invalid$2("invalid spawnDepth (use an integer >= 0)");
5348
5336
  const normalized = numeric;
5349
- if (typeof existing?.spawnDepth === "number" && existing.spawnDepth !== normalized) return invalid$1("spawnDepth cannot be changed once set");
5337
+ if (typeof existing?.spawnDepth === "number" && existing.spawnDepth !== normalized) return invalid$2("spawnDepth cannot be changed once set");
5350
5338
  next.spawnDepth = normalized;
5351
5339
  }
5352
5340
  }
@@ -5355,10 +5343,10 @@ async function applySessionsPatchToStore(params) {
5355
5343
  if (raw === null) delete next.label;
5356
5344
  else if (raw !== void 0) {
5357
5345
  const parsed = parseSessionLabel(raw);
5358
- if (!parsed.ok) return invalid$1(parsed.error);
5346
+ if (!parsed.ok) return invalid$2(parsed.error);
5359
5347
  for (const [key, entry] of Object.entries(store)) {
5360
5348
  if (key === storeKey) continue;
5361
- if (entry?.label === parsed.label) return invalid$1(`label already in use: ${parsed.label}`);
5349
+ if (entry?.label === parsed.label) return invalid$2(`label already in use: ${parsed.label}`);
5362
5350
  }
5363
5351
  next.label = parsed.label;
5364
5352
  }
@@ -5368,14 +5356,14 @@ async function applySessionsPatchToStore(params) {
5368
5356
  if (raw === null) delete next.thinkingLevel;
5369
5357
  else if (raw !== void 0) {
5370
5358
  const normalized = normalizeThinkLevel(String(raw));
5371
- if (!normalized) return invalid$1(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
5359
+ if (!normalized) return invalid$2(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
5372
5360
  next.thinkingLevel = normalized;
5373
5361
  }
5374
5362
  }
5375
5363
  if ("verboseLevel" in patch) {
5376
5364
  const raw = patch.verboseLevel;
5377
5365
  const parsed = parseVerboseOverride(raw);
5378
- if (!parsed.ok) return invalid$1(parsed.error);
5366
+ if (!parsed.ok) return invalid$2(parsed.error);
5379
5367
  applyVerboseOverride(next, parsed.value);
5380
5368
  }
5381
5369
  if ("reasoningLevel" in patch) {
@@ -5383,7 +5371,7 @@ async function applySessionsPatchToStore(params) {
5383
5371
  if (raw === null) delete next.reasoningLevel;
5384
5372
  else if (raw !== void 0) {
5385
5373
  const normalized = normalizeReasoningLevel(String(raw));
5386
- if (!normalized) return invalid$1("invalid reasoningLevel (use \"on\"|\"off\"|\"stream\")");
5374
+ if (!normalized) return invalid$2("invalid reasoningLevel (use \"on\"|\"off\"|\"stream\")");
5387
5375
  if (normalized === "off") delete next.reasoningLevel;
5388
5376
  else next.reasoningLevel = normalized;
5389
5377
  }
@@ -5393,7 +5381,7 @@ async function applySessionsPatchToStore(params) {
5393
5381
  if (raw === null) delete next.responseUsage;
5394
5382
  else if (raw !== void 0) {
5395
5383
  const normalized = normalizeUsageDisplay(String(raw));
5396
- if (!normalized) return invalid$1("invalid responseUsage (use \"off\"|\"tokens\"|\"full\")");
5384
+ if (!normalized) return invalid$2("invalid responseUsage (use \"off\"|\"tokens\"|\"full\")");
5397
5385
  if (normalized === "off") delete next.responseUsage;
5398
5386
  else next.responseUsage = normalized;
5399
5387
  }
@@ -5403,7 +5391,7 @@ async function applySessionsPatchToStore(params) {
5403
5391
  if (raw === null) delete next.elevatedLevel;
5404
5392
  else if (raw !== void 0) {
5405
5393
  const normalized = normalizeElevatedLevel(String(raw));
5406
- if (!normalized) return invalid$1("invalid elevatedLevel (use \"on\"|\"off\"|\"ask\"|\"full\")");
5394
+ if (!normalized) return invalid$2("invalid elevatedLevel (use \"on\"|\"off\"|\"ask\"|\"full\")");
5407
5395
  next.elevatedLevel = normalized;
5408
5396
  }
5409
5397
  }
@@ -5412,7 +5400,7 @@ async function applySessionsPatchToStore(params) {
5412
5400
  if (raw === null) delete next.execHost;
5413
5401
  else if (raw !== void 0) {
5414
5402
  const normalized = normalizeExecHost(String(raw));
5415
- if (!normalized) return invalid$1("invalid execHost (use \"sandbox\"|\"gateway\"|\"node\")");
5403
+ if (!normalized) return invalid$2("invalid execHost (use \"sandbox\"|\"gateway\"|\"node\")");
5416
5404
  next.execHost = normalized;
5417
5405
  }
5418
5406
  }
@@ -5421,7 +5409,7 @@ async function applySessionsPatchToStore(params) {
5421
5409
  if (raw === null) delete next.execSecurity;
5422
5410
  else if (raw !== void 0) {
5423
5411
  const normalized = normalizeExecSecurity(String(raw));
5424
- if (!normalized) return invalid$1("invalid execSecurity (use \"deny\"|\"allowlist\"|\"full\")");
5412
+ if (!normalized) return invalid$2("invalid execSecurity (use \"deny\"|\"allowlist\"|\"full\")");
5425
5413
  next.execSecurity = normalized;
5426
5414
  }
5427
5415
  }
@@ -5430,7 +5418,7 @@ async function applySessionsPatchToStore(params) {
5430
5418
  if (raw === null) delete next.execAsk;
5431
5419
  else if (raw !== void 0) {
5432
5420
  const normalized = normalizeExecAsk(String(raw));
5433
- if (!normalized) return invalid$1("invalid execAsk (use \"off\"|\"on-miss\"|\"always\")");
5421
+ if (!normalized) return invalid$2("invalid execAsk (use \"off\"|\"on-miss\"|\"always\")");
5434
5422
  next.execAsk = normalized;
5435
5423
  }
5436
5424
  }
@@ -5439,7 +5427,7 @@ async function applySessionsPatchToStore(params) {
5439
5427
  if (raw === null) delete next.execNode;
5440
5428
  else if (raw !== void 0) {
5441
5429
  const trimmed = String(raw).trim();
5442
- if (!trimmed) return invalid$1("invalid execNode: empty");
5430
+ if (!trimmed) return invalid$2("invalid execNode: empty");
5443
5431
  next.execNode = trimmed;
5444
5432
  }
5445
5433
  }
@@ -5455,7 +5443,7 @@ async function applySessionsPatchToStore(params) {
5455
5443
  });
5456
5444
  else if (raw !== void 0) {
5457
5445
  const trimmed = String(raw).trim();
5458
- if (!trimmed) return invalid$1("invalid model: empty");
5446
+ if (!trimmed) return invalid$2("invalid model: empty");
5459
5447
  if (!params.loadGatewayModelCatalog) return {
5460
5448
  ok: false,
5461
5449
  error: errorShape(ErrorCodes.UNAVAILABLE, "model catalog unavailable")
@@ -5467,7 +5455,7 @@ async function applySessionsPatchToStore(params) {
5467
5455
  defaultProvider: resolvedDefault.provider,
5468
5456
  defaultModel: resolvedDefault.model
5469
5457
  });
5470
- if ("error" in resolved) return invalid$1(resolved.error);
5458
+ if ("error" in resolved) return invalid$2(resolved.error);
5471
5459
  const isDefault = resolved.ref.provider === resolvedDefault.provider && resolved.ref.model === resolvedDefault.model;
5472
5460
  applyModelOverrideToSessionEntry({
5473
5461
  entry: next,
@@ -5481,7 +5469,7 @@ async function applySessionsPatchToStore(params) {
5481
5469
  }
5482
5470
  if (next.thinkingLevel === "xhigh") {
5483
5471
  if (!supportsXHighThinking(next.providerOverride ?? resolvedDefault.provider, next.modelOverride ?? resolvedDefault.model)) {
5484
- if ("thinkingLevel" in patch) return invalid$1(`thinkingLevel "xhigh" is only supported for ${formatXHighModelHint()}`);
5472
+ if ("thinkingLevel" in patch) return invalid$2(`thinkingLevel "xhigh" is only supported for ${formatXHighModelHint()}`);
5485
5473
  next.thinkingLevel = "high";
5486
5474
  }
5487
5475
  }
@@ -5490,7 +5478,7 @@ async function applySessionsPatchToStore(params) {
5490
5478
  if (raw === null) delete next.sendPolicy;
5491
5479
  else if (raw !== void 0) {
5492
5480
  const normalized = normalizeSendPolicy(String(raw));
5493
- if (!normalized) return invalid$1("invalid sendPolicy (use \"allow\"|\"deny\")");
5481
+ if (!normalized) return invalid$2("invalid sendPolicy (use \"allow\"|\"deny\")");
5494
5482
  next.sendPolicy = normalized;
5495
5483
  }
5496
5484
  }
@@ -5499,7 +5487,7 @@ async function applySessionsPatchToStore(params) {
5499
5487
  if (raw === null) delete next.groupActivation;
5500
5488
  else if (raw !== void 0) {
5501
5489
  const normalized = normalizeGroupActivation(String(raw));
5502
- if (!normalized) return invalid$1("invalid groupActivation (use \"mention\"|\"always\")");
5490
+ if (!normalized) return invalid$2("invalid groupActivation (use \"mention\"|\"always\")");
5503
5491
  next.groupActivation = normalized;
5504
5492
  }
5505
5493
  }
@@ -6345,6 +6333,7 @@ const agentHandlers = {
6345
6333
  agentCommand({
6346
6334
  message,
6347
6335
  images,
6336
+ model: request.model,
6348
6337
  to: resolvedTo,
6349
6338
  sessionId: resolvedSessionId,
6350
6339
  sessionKey: resolvedSessionKey,
@@ -6859,6 +6848,249 @@ async function listMemoryEntries(params) {
6859
6848
  }))).filter((row) => Boolean(row)).toSorted((a, b) => (b.updatedAt ?? 0) - (a.updatedAt ?? 0)).slice(0, Math.max(1, Math.min(params.limit ?? 120, 200)));
6860
6849
  }
6861
6850
 
6851
+ //#endregion
6852
+ //#region src/anima6/ontology.ts
6853
+ const ANIMA_NODE_KINDS = [
6854
+ "goal",
6855
+ "feature",
6856
+ "person",
6857
+ "chronos",
6858
+ "affect",
6859
+ "agent",
6860
+ "role",
6861
+ "task"
6862
+ ];
6863
+ const ANIMA_RELATIONS = [
6864
+ "owns",
6865
+ "supports",
6866
+ "focuses_on",
6867
+ "tracks",
6868
+ "influences",
6869
+ "reports_to",
6870
+ "specializes_in",
6871
+ "delegates",
6872
+ "executes",
6873
+ "escalates_to"
6874
+ ];
6875
+ function isAnimaNodeKind(value) {
6876
+ return ANIMA_NODE_KINDS.includes(value);
6877
+ }
6878
+ function isAnimaRelation(value) {
6879
+ return ANIMA_RELATIONS.includes(value);
6880
+ }
6881
+ function missionGoalNodeId(goalId) {
6882
+ return `goal:${goalId}`;
6883
+ }
6884
+ function missionFeatureNodeId(featureId) {
6885
+ return `feature:${featureId}`;
6886
+ }
6887
+ function missionPersonNodeId(personId) {
6888
+ return `person:${personId}`;
6889
+ }
6890
+ const ANIMA_CHRONOS_NODE_ID = "chronos:state";
6891
+ const ANIMA_AFFECT_NODE_ID = "affect:state";
6892
+
6893
+ //#endregion
6894
+ //#region src/memory/brain-graph.ts
6895
+ const DEFAULT_NODE_META = {
6896
+ provenance: [],
6897
+ confidence: .5,
6898
+ salience: .5,
6899
+ recency: .5,
6900
+ sensitivity: "internal",
6901
+ state: "active"
6902
+ };
6903
+ const DEFAULT_EDGE_META = {
6904
+ ...DEFAULT_NODE_META,
6905
+ strength: .5,
6906
+ direction: "forward"
6907
+ };
6908
+ function clampUnit$1(value, fallback) {
6909
+ if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
6910
+ return Math.max(0, Math.min(1, value));
6911
+ }
6912
+ function normalizeAliases(label, aliases) {
6913
+ const seen = /* @__PURE__ */ new Set();
6914
+ const normalized = [];
6915
+ for (const value of [label, ...aliases ?? []]) {
6916
+ const trimmed = value.trim();
6917
+ if (!trimmed) continue;
6918
+ const key = trimmed.toLowerCase();
6919
+ if (seen.has(key)) continue;
6920
+ seen.add(key);
6921
+ normalized.push(trimmed);
6922
+ }
6923
+ return normalized;
6924
+ }
6925
+ function normalizeNodeKind(value) {
6926
+ const normalized = value.trim().toLowerCase();
6927
+ if (!isAnimaNodeKind(normalized)) throw new Error(`invalid brain node kind: ${value}`);
6928
+ return normalized;
6929
+ }
6930
+ function normalizeRelation(value) {
6931
+ const normalized = value.trim().toLowerCase();
6932
+ if (!isAnimaRelation(normalized)) throw new Error(`invalid brain edge relation: ${value}`);
6933
+ return normalized;
6934
+ }
6935
+ function normalizeEvidence(evidence) {
6936
+ const seen = /* @__PURE__ */ new Set();
6937
+ const normalized = [];
6938
+ for (const item of evidence ?? []) {
6939
+ const source = item.source.trim();
6940
+ if (!source) continue;
6941
+ const key = `${source}:${item.sourceId ?? ""}:${item.excerpt ?? ""}`;
6942
+ if (seen.has(key)) continue;
6943
+ seen.add(key);
6944
+ normalized.push({
6945
+ source,
6946
+ sourceId: item.sourceId?.trim() || void 0,
6947
+ excerpt: item.excerpt?.trim() || void 0,
6948
+ recordedAt: item.recordedAt
6949
+ });
6950
+ }
6951
+ return normalized;
6952
+ }
6953
+ function normalizeNodeMeta(meta) {
6954
+ return {
6955
+ provenance: Array.from(new Set((meta?.provenance ?? []).map((value) => value.trim()).filter(Boolean))),
6956
+ confidence: clampUnit$1(meta?.confidence, DEFAULT_NODE_META.confidence),
6957
+ salience: clampUnit$1(meta?.salience, DEFAULT_NODE_META.salience),
6958
+ recency: clampUnit$1(meta?.recency, DEFAULT_NODE_META.recency),
6959
+ sensitivity: meta?.sensitivity ?? DEFAULT_NODE_META.sensitivity,
6960
+ lastReviewedAt: meta?.lastReviewedAt,
6961
+ state: meta?.state ?? DEFAULT_NODE_META.state
6962
+ };
6963
+ }
6964
+ function normalizeEdgeMeta(meta) {
6965
+ return {
6966
+ ...normalizeNodeMeta(meta),
6967
+ strength: clampUnit$1(meta?.strength, DEFAULT_EDGE_META.strength),
6968
+ direction: meta?.direction ?? DEFAULT_EDGE_META.direction
6969
+ };
6970
+ }
6971
+ function mergeUnique(left, right, key) {
6972
+ const seen = /* @__PURE__ */ new Set();
6973
+ const merged = [];
6974
+ for (const item of [...left, ...right]) {
6975
+ const identity = key(item);
6976
+ if (seen.has(identity)) continue;
6977
+ seen.add(identity);
6978
+ merged.push(item);
6979
+ }
6980
+ return merged;
6981
+ }
6982
+ var BrainGraph = class {
6983
+ constructor() {
6984
+ this.nodes = /* @__PURE__ */ new Map();
6985
+ this.edges = /* @__PURE__ */ new Map();
6986
+ this.aliases = /* @__PURE__ */ new Map();
6987
+ }
6988
+ addNode(node) {
6989
+ const existing = this.nodes.get(node.id);
6990
+ const next = {
6991
+ id: node.id,
6992
+ type: normalizeNodeKind(node.type),
6993
+ label: node.label.trim(),
6994
+ aliases: normalizeAliases(node.label, [...existing?.aliases ?? [], ...node.aliases ?? []]).filter((alias) => alias.toLowerCase() !== node.label.trim().toLowerCase()),
6995
+ properties: {
6996
+ ...existing?.properties,
6997
+ ...node.properties
6998
+ },
6999
+ evidence: mergeUnique(existing?.evidence ?? [], normalizeEvidence(node.evidence), (item) => `${item.source}:${item.sourceId ?? ""}:${item.excerpt ?? ""}`),
7000
+ meta: normalizeNodeMeta({
7001
+ ...existing?.meta,
7002
+ ...node.meta,
7003
+ provenance: [...existing?.meta.provenance ?? [], ...node.meta?.provenance ?? []]
7004
+ })
7005
+ };
7006
+ this.nodes.set(next.id, next);
7007
+ this.rebuildAliasesForNode(next);
7008
+ return next;
7009
+ }
7010
+ addEdge(edge) {
7011
+ const existing = this.edges.get(edge.id);
7012
+ const next = {
7013
+ id: edge.id,
7014
+ source: edge.source,
7015
+ target: edge.target,
7016
+ relation: normalizeRelation(edge.relation),
7017
+ evidence: mergeUnique(existing?.evidence ?? [], normalizeEvidence(edge.evidence), (item) => `${item.source}:${item.sourceId ?? ""}:${item.excerpt ?? ""}`),
7018
+ meta: normalizeEdgeMeta({
7019
+ ...existing?.meta,
7020
+ ...edge.meta,
7021
+ provenance: [...existing?.meta.provenance ?? [], ...edge.meta?.provenance ?? []]
7022
+ })
7023
+ };
7024
+ this.edges.set(next.id, next);
7025
+ return next;
7026
+ }
7027
+ getNode(idOrAlias) {
7028
+ const trimmed = idOrAlias.trim();
7029
+ if (!trimmed) return;
7030
+ const id = this.aliases.get(trimmed.toLowerCase()) ?? trimmed;
7031
+ return this.nodes.get(id);
7032
+ }
7033
+ getEdge(id) {
7034
+ return this.edges.get(id);
7035
+ }
7036
+ getEdges(nodeId) {
7037
+ return [...this.edges.values()].filter((edge) => edge.source === nodeId || edge.target === nodeId);
7038
+ }
7039
+ listNodes() {
7040
+ return [...this.nodes.values()];
7041
+ }
7042
+ listEdges() {
7043
+ return [...this.edges.values()];
7044
+ }
7045
+ listNodesByType(type) {
7046
+ return this.listNodes().filter((node) => node.type === type);
7047
+ }
7048
+ getNeighbors(nodeId, relation) {
7049
+ const ids = /* @__PURE__ */ new Set();
7050
+ for (const edge of this.getEdges(nodeId)) {
7051
+ if (relation && edge.relation !== relation) continue;
7052
+ ids.add(edge.source === nodeId ? edge.target : edge.source);
7053
+ }
7054
+ return [...ids].map((id) => this.nodes.get(id)).filter((node) => Boolean(node));
7055
+ }
7056
+ addEvidenceToNode(id, evidence) {
7057
+ const node = this.nodes.get(id);
7058
+ if (!node) return;
7059
+ node.evidence = mergeUnique(node.evidence, normalizeEvidence([evidence]), (item) => {
7060
+ return `${item.source}:${item.sourceId ?? ""}:${item.excerpt ?? ""}`;
7061
+ });
7062
+ }
7063
+ addEvidenceToEdge(id, evidence) {
7064
+ const edge = this.edges.get(id);
7065
+ if (!edge) return;
7066
+ edge.evidence = mergeUnique(edge.evidence, normalizeEvidence([evidence]), (item) => {
7067
+ return `${item.source}:${item.sourceId ?? ""}:${item.excerpt ?? ""}`;
7068
+ });
7069
+ }
7070
+ touchNodeReview(id, reviewedAt = Date.now()) {
7071
+ const node = this.nodes.get(id);
7072
+ if (!node) return;
7073
+ node.meta.lastReviewedAt = reviewedAt;
7074
+ }
7075
+ toJSON() {
7076
+ return {
7077
+ nodes: this.listNodes(),
7078
+ edges: this.listEdges()
7079
+ };
7080
+ }
7081
+ fromJSON(data) {
7082
+ this.nodes.clear();
7083
+ this.edges.clear();
7084
+ this.aliases.clear();
7085
+ for (const node of data.nodes) this.addNode(node);
7086
+ for (const edge of data.edges) this.addEdge(edge);
7087
+ }
7088
+ rebuildAliasesForNode(node) {
7089
+ for (const [alias, id] of this.aliases.entries()) if (id === node.id) this.aliases.delete(alias);
7090
+ for (const alias of normalizeAliases(node.label, node.aliases)) this.aliases.set(alias.toLowerCase(), node.id);
7091
+ }
7092
+ };
7093
+
6862
7094
  //#endregion
6863
7095
  //#region src/mission-control/local-store.ts
6864
7096
  const execFileAsync = promisify(execFile);
@@ -6967,8 +7199,161 @@ const DEFAULT_STATE = {
6967
7199
  lang: "en-US",
6968
7200
  rate: 1,
6969
7201
  pitch: 1
7202
+ },
7203
+ goals: [{
7204
+ id: "keep-anima-coherent",
7205
+ title: "Keep ANIMA coherent across sessions",
7206
+ status: "active",
7207
+ priority: "critical",
7208
+ summary: "Protect continuity, state quality, and operator trust.",
7209
+ owner: "ANIMA",
7210
+ updatedAt: 0
7211
+ }],
7212
+ features: [{
7213
+ id: "anima-6-foundation",
7214
+ title: "ANIMA 6 foundation",
7215
+ status: "in_progress",
7216
+ risk: "medium",
7217
+ testStatus: "partial",
7218
+ area: "memory+orchestration",
7219
+ lastTouchedAt: 0
7220
+ }],
7221
+ people: [{
7222
+ id: "operator",
7223
+ name: "Operator",
7224
+ relationship: "operator",
7225
+ trust: 1,
7226
+ notes: "Primary human counterpart."
7227
+ }],
7228
+ chronos: {
7229
+ heartbeatMinutes: 30,
7230
+ focusBlockMinutes: 45,
7231
+ checkpointIntervalMinutes: 15,
7232
+ contractTargetMinutes: 45,
7233
+ contractElapsedMinutes: 0,
7234
+ checkpointCount: 0,
7235
+ driftMinutes: 0,
7236
+ updatedAt: 0
7237
+ },
7238
+ affect: {
7239
+ joy: .6,
7240
+ frustration: .1,
7241
+ curiosity: .9,
7242
+ confidence: .6,
7243
+ care: .9,
7244
+ fatigue: .2,
7245
+ updatedAt: 0
7246
+ },
7247
+ autoToggle: {
7248
+ workingMode: false,
7249
+ speech: false,
7250
+ voiceWake: false,
7251
+ heartbeat: true,
7252
+ providers: false,
7253
+ missionRepo: false,
7254
+ missionState: true,
7255
+ memory: true,
7256
+ rawConfig: false
6970
7257
  }
6971
7258
  };
7259
+ function clampUnit(value, fallback) {
7260
+ if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
7261
+ return Math.max(0, Math.min(1, value));
7262
+ }
7263
+ function normalizeMinuteValue(value, fallback) {
7264
+ if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
7265
+ return Math.max(1, Math.floor(value));
7266
+ }
7267
+ function normalizeGoal(goal) {
7268
+ return {
7269
+ ...goal,
7270
+ id: goal.id.trim(),
7271
+ title: goal.title.trim(),
7272
+ summary: goal.summary?.trim() || void 0,
7273
+ owner: goal.owner?.trim() || void 0,
7274
+ updatedAt: Number.isFinite(goal.updatedAt) ? goal.updatedAt : Date.now()
7275
+ };
7276
+ }
7277
+ function normalizeFeature(feature) {
7278
+ return {
7279
+ ...feature,
7280
+ id: feature.id.trim(),
7281
+ title: feature.title.trim(),
7282
+ area: feature.area?.trim() || void 0,
7283
+ lastTouchedAt: Number.isFinite(feature.lastTouchedAt) ? feature.lastTouchedAt : Date.now()
7284
+ };
7285
+ }
7286
+ function normalizePerson(person) {
7287
+ return {
7288
+ ...person,
7289
+ id: person.id.trim(),
7290
+ name: person.name.trim(),
7291
+ notes: person.notes?.trim() || void 0,
7292
+ trust: clampUnit(person.trust, .5),
7293
+ lastInteractedAt: Number.isFinite(person.lastInteractedAt) ? person.lastInteractedAt : void 0
7294
+ };
7295
+ }
7296
+ function normalizeChronosState(current, patch) {
7297
+ const contractTargetMinutes = normalizeMinuteValue(patch?.contractTargetMinutes, patch?.focusBlockMinutes ?? current.contractTargetMinutes);
7298
+ const contractElapsedMinutes = Math.max(0, Math.floor(typeof patch?.contractElapsedMinutes === "number" && Number.isFinite(patch.contractElapsedMinutes) ? patch.contractElapsedMinutes : current.contractElapsedMinutes));
7299
+ const checkpointCount = Math.max(0, Math.floor(typeof patch?.checkpointCount === "number" && Number.isFinite(patch.checkpointCount) ? patch.checkpointCount : current.checkpointCount));
7300
+ const driftMinutes = Math.trunc(typeof patch?.driftMinutes === "number" && Number.isFinite(patch.driftMinutes) ? patch.driftMinutes : contractElapsedMinutes - contractTargetMinutes);
7301
+ return {
7302
+ heartbeatMinutes: normalizeMinuteValue(patch?.heartbeatMinutes, current.heartbeatMinutes),
7303
+ focusBlockMinutes: normalizeMinuteValue(patch?.focusBlockMinutes, current.focusBlockMinutes),
7304
+ checkpointIntervalMinutes: normalizeMinuteValue(patch?.checkpointIntervalMinutes, current.checkpointIntervalMinutes),
7305
+ activeWorkstream: patch?.activeWorkstream?.trim() || current.activeWorkstream,
7306
+ contractStartedAt: typeof patch?.contractStartedAt === "number" && Number.isFinite(patch.contractStartedAt) ? patch.contractStartedAt : patch?.contractStartedAt === void 0 ? current.contractStartedAt : void 0,
7307
+ contractTargetMinutes,
7308
+ contractElapsedMinutes,
7309
+ checkpointCount,
7310
+ lastCheckpointAt: typeof patch?.lastCheckpointAt === "number" && Number.isFinite(patch.lastCheckpointAt) ? patch.lastCheckpointAt : patch?.lastCheckpointAt === void 0 ? current.lastCheckpointAt : void 0,
7311
+ driftMinutes,
7312
+ updatedAt: typeof patch?.updatedAt === "number" && Number.isFinite(patch.updatedAt) ? patch.updatedAt : Date.now()
7313
+ };
7314
+ }
7315
+ function normalizeAffectState(current, patch) {
7316
+ return {
7317
+ joy: clampUnit(patch?.joy, current.joy),
7318
+ frustration: clampUnit(patch?.frustration, current.frustration),
7319
+ curiosity: clampUnit(patch?.curiosity, current.curiosity),
7320
+ confidence: clampUnit(patch?.confidence, current.confidence),
7321
+ care: clampUnit(patch?.care, current.care),
7322
+ fatigue: clampUnit(patch?.fatigue, current.fatigue),
7323
+ updatedAt: typeof patch?.updatedAt === "number" && Number.isFinite(patch.updatedAt) ? patch.updatedAt : Date.now()
7324
+ };
7325
+ }
7326
+ function normalizeAutoTogglePolicy(current, patch) {
7327
+ return {
7328
+ workingMode: patch?.workingMode ?? current.workingMode,
7329
+ speech: patch?.speech ?? current.speech,
7330
+ voiceWake: patch?.voiceWake ?? current.voiceWake,
7331
+ heartbeat: patch?.heartbeat ?? current.heartbeat,
7332
+ providers: patch?.providers ?? current.providers,
7333
+ missionRepo: patch?.missionRepo ?? current.missionRepo,
7334
+ missionState: patch?.missionState ?? current.missionState,
7335
+ memory: patch?.memory ?? current.memory,
7336
+ rawConfig: patch?.rawConfig ?? current.rawConfig
7337
+ };
7338
+ }
7339
+ function normalizeIdSet(ids) {
7340
+ return new Set((ids ?? []).map((value) => value.trim()).filter(Boolean));
7341
+ }
7342
+ function shouldReplaceCollection(patch, collection) {
7343
+ return (patch.replaceCollections ?? []).includes(collection);
7344
+ }
7345
+ function mergeEntityCollection(current, incoming, opts) {
7346
+ const removals = normalizeIdSet(opts.removeIds);
7347
+ const filteredIncoming = (incoming ?? []).map(opts.normalize).filter((value) => !removals.has(value.id));
7348
+ if (opts.replace) return filteredIncoming;
7349
+ if (!incoming) return current.filter((value) => !removals.has(value.id));
7350
+ const next = /* @__PURE__ */ new Map();
7351
+ for (const value of current) if (!removals.has(value.id)) next.set(value.id, value);
7352
+ for (const value of filteredIncoming) next.set(value.id, value);
7353
+ const preservedOrder = current.map((value) => value.id).filter((id) => next.has(id)).map((id) => next.get(id));
7354
+ const appended = filteredIncoming.filter((value) => !current.some((currentValue) => currentValue.id === value.id));
7355
+ return [...preservedOrder, ...appended];
7356
+ }
6972
7357
  function mergeState(current, patch) {
6973
7358
  return {
6974
7359
  version: 1,
@@ -6980,9 +7365,212 @@ function mergeState(current, patch) {
6980
7365
  speech: {
6981
7366
  ...current.speech,
6982
7367
  ...patch.speech
6983
- }
7368
+ },
7369
+ goals: mergeEntityCollection(current.goals, patch.goals, {
7370
+ removeIds: patch.goalIdsToRemove,
7371
+ replace: shouldReplaceCollection(patch, "goals"),
7372
+ normalize: normalizeGoal
7373
+ }),
7374
+ features: mergeEntityCollection(current.features, patch.features, {
7375
+ removeIds: patch.featureIdsToRemove,
7376
+ replace: shouldReplaceCollection(patch, "features"),
7377
+ normalize: normalizeFeature
7378
+ }),
7379
+ people: mergeEntityCollection(current.people, patch.people, {
7380
+ removeIds: patch.personIdsToRemove,
7381
+ replace: shouldReplaceCollection(patch, "people"),
7382
+ normalize: normalizePerson
7383
+ }),
7384
+ chronos: normalizeChronosState(current.chronos, patch.chronos),
7385
+ affect: normalizeAffectState(current.affect, patch.affect),
7386
+ autoToggle: normalizeAutoTogglePolicy(current.autoToggle, patch.autoToggle)
6984
7387
  };
6985
7388
  }
7389
+ function buildMissionControlBrainGraph(state) {
7390
+ const graph = new BrainGraph();
7391
+ for (const goal of state.goals) graph.addNode({
7392
+ id: missionGoalNodeId(goal.id),
7393
+ type: "goal",
7394
+ label: goal.title,
7395
+ aliases: [goal.id],
7396
+ properties: {
7397
+ id: goal.id,
7398
+ status: goal.status,
7399
+ priority: goal.priority,
7400
+ summary: goal.summary ?? null,
7401
+ owner: goal.owner ?? null,
7402
+ updatedAt: goal.updatedAt
7403
+ },
7404
+ meta: {
7405
+ confidence: .85,
7406
+ salience: goal.priority === "critical" ? 1 : goal.priority === "high" ? .85 : .6,
7407
+ recency: .7,
7408
+ provenance: ["mission-control.state.goals"]
7409
+ }
7410
+ });
7411
+ for (const feature of state.features) graph.addNode({
7412
+ id: missionFeatureNodeId(feature.id),
7413
+ type: "feature",
7414
+ label: feature.title,
7415
+ aliases: [feature.id],
7416
+ properties: {
7417
+ id: feature.id,
7418
+ status: feature.status,
7419
+ risk: feature.risk,
7420
+ testStatus: feature.testStatus,
7421
+ area: feature.area ?? null,
7422
+ lastTouchedAt: feature.lastTouchedAt
7423
+ },
7424
+ meta: {
7425
+ confidence: .8,
7426
+ salience: feature.status === "blocked" ? .95 : feature.status === "in_progress" ? .85 : .6,
7427
+ recency: .75,
7428
+ provenance: ["mission-control.state.features"]
7429
+ }
7430
+ });
7431
+ for (const person of state.people) graph.addNode({
7432
+ id: missionPersonNodeId(person.id),
7433
+ type: "person",
7434
+ label: person.name,
7435
+ aliases: [person.id],
7436
+ properties: {
7437
+ id: person.id,
7438
+ relationship: person.relationship,
7439
+ trust: person.trust,
7440
+ notes: person.notes ?? null,
7441
+ lastInteractedAt: person.lastInteractedAt ?? null
7442
+ },
7443
+ meta: {
7444
+ confidence: .9,
7445
+ salience: .8,
7446
+ recency: person.lastInteractedAt ? .8 : .5,
7447
+ provenance: ["mission-control.state.people"]
7448
+ }
7449
+ });
7450
+ graph.addNode({
7451
+ id: ANIMA_CHRONOS_NODE_ID,
7452
+ type: "chronos",
7453
+ label: "Chronos",
7454
+ properties: {
7455
+ heartbeatMinutes: state.chronos.heartbeatMinutes,
7456
+ focusBlockMinutes: state.chronos.focusBlockMinutes,
7457
+ checkpointIntervalMinutes: state.chronos.checkpointIntervalMinutes,
7458
+ activeWorkstream: state.chronos.activeWorkstream ?? null,
7459
+ contractStartedAt: state.chronos.contractStartedAt ?? null,
7460
+ contractTargetMinutes: state.chronos.contractTargetMinutes,
7461
+ contractElapsedMinutes: state.chronos.contractElapsedMinutes,
7462
+ checkpointCount: state.chronos.checkpointCount,
7463
+ lastCheckpointAt: state.chronos.lastCheckpointAt ?? null,
7464
+ driftMinutes: state.chronos.driftMinutes,
7465
+ updatedAt: state.chronos.updatedAt
7466
+ },
7467
+ meta: {
7468
+ confidence: .95,
7469
+ salience: .9,
7470
+ recency: .85,
7471
+ provenance: ["mission-control.state.chronos"]
7472
+ }
7473
+ });
7474
+ graph.addNode({
7475
+ id: ANIMA_AFFECT_NODE_ID,
7476
+ type: "affect",
7477
+ label: "Affect",
7478
+ properties: {
7479
+ joy: state.affect.joy,
7480
+ frustration: state.affect.frustration,
7481
+ curiosity: state.affect.curiosity,
7482
+ confidence: state.affect.confidence,
7483
+ care: state.affect.care,
7484
+ fatigue: state.affect.fatigue,
7485
+ updatedAt: state.affect.updatedAt
7486
+ },
7487
+ meta: {
7488
+ confidence: .75,
7489
+ salience: .7,
7490
+ recency: .75,
7491
+ provenance: ["mission-control.state.affect"]
7492
+ }
7493
+ });
7494
+ for (const goal of state.goals) {
7495
+ if (!goal.owner) continue;
7496
+ const normalizedOwner = goal.owner.trim().toLowerCase();
7497
+ const owner = state.people.find((person) => person.id.trim().toLowerCase() === normalizedOwner || person.name.trim().toLowerCase() === normalizedOwner);
7498
+ if (!owner) continue;
7499
+ graph.addEdge({
7500
+ id: `owns:${owner.id}:${goal.id}`,
7501
+ source: missionPersonNodeId(owner.id),
7502
+ target: missionGoalNodeId(goal.id),
7503
+ relation: "owns",
7504
+ meta: {
7505
+ confidence: .9,
7506
+ salience: .8,
7507
+ recency: .7,
7508
+ strength: owner.trust,
7509
+ provenance: ["mission-control.state.goals.owner"]
7510
+ }
7511
+ });
7512
+ }
7513
+ const activeGoal = state.goals.find((goal) => goal.status === "active") ?? state.goals[0];
7514
+ if (activeGoal) for (const feature of state.features.filter((entry) => entry.status !== "done")) graph.addEdge({
7515
+ id: `supports:${feature.id}:${activeGoal.id}`,
7516
+ source: missionFeatureNodeId(feature.id),
7517
+ target: missionGoalNodeId(activeGoal.id),
7518
+ relation: "supports",
7519
+ meta: {
7520
+ confidence: .55,
7521
+ salience: feature.status === "blocked" ? .9 : .7,
7522
+ recency: .7,
7523
+ strength: feature.testStatus === "passing" ? .8 : .6,
7524
+ provenance: ["mission-control.derived.active-goal"]
7525
+ }
7526
+ });
7527
+ const activeWorkstream = state.chronos.activeWorkstream?.trim().toLowerCase();
7528
+ if (activeWorkstream) {
7529
+ const feature = state.features.find((entry) => entry.id.trim().toLowerCase() === activeWorkstream || entry.title.trim().toLowerCase() === activeWorkstream);
7530
+ const goal = state.goals.find((entry) => entry.id.trim().toLowerCase() === activeWorkstream || entry.title.trim().toLowerCase() === activeWorkstream);
7531
+ const targetId = feature ? missionFeatureNodeId(feature.id) : goal ? missionGoalNodeId(goal.id) : void 0;
7532
+ if (targetId) graph.addEdge({
7533
+ id: `focuses_on:${targetId}`,
7534
+ source: ANIMA_CHRONOS_NODE_ID,
7535
+ target: targetId,
7536
+ relation: "focuses_on",
7537
+ meta: {
7538
+ confidence: .95,
7539
+ salience: .95,
7540
+ recency: .9,
7541
+ strength: .9,
7542
+ provenance: ["mission-control.state.chronos.activeWorkstream"]
7543
+ }
7544
+ });
7545
+ }
7546
+ for (const goal of state.goals.filter((entry) => entry.status === "active")) graph.addEdge({
7547
+ id: `tracks:${goal.id}`,
7548
+ source: ANIMA_CHRONOS_NODE_ID,
7549
+ target: missionGoalNodeId(goal.id),
7550
+ relation: "tracks",
7551
+ meta: {
7552
+ confidence: .7,
7553
+ salience: .8,
7554
+ recency: .8,
7555
+ strength: .7,
7556
+ provenance: ["mission-control.derived.active-goals"]
7557
+ }
7558
+ });
7559
+ for (const feature of state.features.filter((entry) => entry.status !== "done")) graph.addEdge({
7560
+ id: `influences:${feature.id}`,
7561
+ source: ANIMA_AFFECT_NODE_ID,
7562
+ target: missionFeatureNodeId(feature.id),
7563
+ relation: "influences",
7564
+ meta: {
7565
+ confidence: .45,
7566
+ salience: .6,
7567
+ recency: .7,
7568
+ strength: Math.max(state.affect.care, state.affect.curiosity),
7569
+ provenance: ["mission-control.derived.affect"]
7570
+ }
7571
+ });
7572
+ return graph.toJSON();
7573
+ }
6986
7574
  function getMissionFileTitle(fileName) {
6987
7575
  const known = DEFAULT_MISSION_FILES.find((entry) => entry.fileName === fileName);
6988
7576
  if (known) return known.title;
@@ -7161,6 +7749,10 @@ async function ensureMissionControlScaffold(stateDir = resolveStateDir()) {
7161
7749
  async function readMissionControlState(stateDir = resolveStateDir()) {
7162
7750
  await ensureMissionControlScaffold(stateDir);
7163
7751
  const stored = await readJsonFile(missionStatePath(stateDir));
7752
+ const replaceCollections = [];
7753
+ if (Array.isArray(stored?.goals)) replaceCollections.push("goals");
7754
+ if (Array.isArray(stored?.features)) replaceCollections.push("features");
7755
+ if (Array.isArray(stored?.people)) replaceCollections.push("people");
7164
7756
  return mergeState(DEFAULT_STATE, {
7165
7757
  ...stored,
7166
7758
  repo: {
@@ -7170,7 +7762,23 @@ async function readMissionControlState(stateDir = resolveStateDir()) {
7170
7762
  speech: {
7171
7763
  ...DEFAULT_STATE.speech,
7172
7764
  ...stored?.speech
7173
- }
7765
+ },
7766
+ goals: Array.isArray(stored?.goals) ? stored.goals : DEFAULT_STATE.goals,
7767
+ features: Array.isArray(stored?.features) ? stored.features : DEFAULT_STATE.features,
7768
+ people: Array.isArray(stored?.people) ? stored.people : DEFAULT_STATE.people,
7769
+ chronos: {
7770
+ ...DEFAULT_STATE.chronos,
7771
+ ...stored?.chronos
7772
+ },
7773
+ affect: {
7774
+ ...DEFAULT_STATE.affect,
7775
+ ...stored?.affect
7776
+ },
7777
+ autoToggle: {
7778
+ ...DEFAULT_STATE.autoToggle,
7779
+ ...stored?.autoToggle
7780
+ },
7781
+ replaceCollections
7174
7782
  });
7175
7783
  }
7176
7784
  async function patchMissionControlState(patch, stateDir = resolveStateDir()) {
@@ -7221,6 +7829,8 @@ async function readMissionControlSnapshot(stateDir = resolveStateDir()) {
7221
7829
  directory,
7222
7830
  statePath: missionStatePath(stateDir),
7223
7831
  state,
7832
+ brainGraph: buildMissionControlBrainGraph(state),
7833
+ trustGraph: await readTrustGraphSnapshot(stateDir),
7224
7834
  files,
7225
7835
  innerWorld: innerWorldEntries.filter((entry) => Boolean(entry)),
7226
7836
  importantHistory: await listImportantHistoryEntries(stateDir)
@@ -7305,7 +7915,7 @@ async function connectMissionRepo(params) {
7305
7915
 
7306
7916
  //#endregion
7307
7917
  //#region src/gateway/server-methods/anima.ts
7308
- function invalid(message) {
7918
+ function invalid$1(message) {
7309
7919
  return errorShape(ErrorCodes.INVALID_REQUEST, message);
7310
7920
  }
7311
7921
  function asRecord$1(value) {
@@ -7325,7 +7935,20 @@ function normalizeMemoryKind(value) {
7325
7935
  }
7326
7936
  async function setMainWorkingMode(mode) {
7327
7937
  const cfg = loadConfig();
7328
- const { storePath, canonicalKey } = loadSessionEntry(resolveMainSessionKey(cfg));
7938
+ const mainKey = resolveMainSessionKey(cfg);
7939
+ const defaultModel = resolveDefaultModelForAgent({
7940
+ cfg,
7941
+ agentId: resolveSessionAgentId({
7942
+ sessionKey: mainKey,
7943
+ config: cfg
7944
+ })
7945
+ });
7946
+ const autoModeSelection = resolveWorkingModeModelSelection({
7947
+ cfg,
7948
+ workingMode: mode,
7949
+ defaultProvider: defaultModel.provider
7950
+ });
7951
+ const { storePath, canonicalKey } = loadSessionEntry(mainKey);
7329
7952
  const execSecurity = mode === "read" ? "deny" : "full";
7330
7953
  const execAsk = mode === "read" ? "off" : "on-miss";
7331
7954
  const elevatedLevel = mode === "read" ? "off" : "ask";
@@ -7343,6 +7966,19 @@ async function setMainWorkingMode(mode) {
7343
7966
  }
7344
7967
  });
7345
7968
  if (!applied.ok) throw new Error(applied.error.message);
7969
+ applyModelOverrideToSessionEntry({
7970
+ entry: applied.entry,
7971
+ selection: autoModeSelection ? {
7972
+ provider: autoModeSelection.provider,
7973
+ model: autoModeSelection.model,
7974
+ isDefault: autoModeSelection.provider === defaultModel.provider && autoModeSelection.model === defaultModel.model
7975
+ } : {
7976
+ provider: defaultModel.provider,
7977
+ model: defaultModel.model,
7978
+ isDefault: true
7979
+ }
7980
+ });
7981
+ store[canonicalKey] = applied.entry;
7346
7982
  return applied.entry;
7347
7983
  });
7348
7984
  await patchMissionControlState({ workingMode: mode });
@@ -7350,7 +7986,9 @@ async function setMainWorkingMode(mode) {
7350
7986
  mode,
7351
7987
  execSecurity,
7352
7988
  execAsk,
7353
- elevatedLevel
7989
+ elevatedLevel,
7990
+ modelProvider: autoModeSelection?.provider ?? defaultModel.provider,
7991
+ model: autoModeSelection?.model ?? defaultModel.model
7354
7992
  };
7355
7993
  }
7356
7994
  const animaHandlers = {
@@ -7402,7 +8040,7 @@ const animaHandlers = {
7402
8040
  "anima.runtime.set-working-mode": async ({ params, respond }) => {
7403
8041
  const mode = normalizeWorkingMode(params?.mode);
7404
8042
  if (!mode) {
7405
- respond(false, void 0, invalid("mode must be \"read\" or \"write\""));
8043
+ respond(false, void 0, invalid$1("mode must be \"read\" or \"write\""));
7406
8044
  return;
7407
8045
  }
7408
8046
  try {
@@ -7417,7 +8055,7 @@ const animaHandlers = {
7417
8055
  "anima.memory.list": async ({ params, respond }) => {
7418
8056
  const kind = normalizeMemoryKind(params?.kind);
7419
8057
  if (!kind) {
7420
- respond(false, void 0, invalid("kind must be one of: \"episodic\", \"semantic\", \"procedural\""));
8058
+ respond(false, void 0, invalid$1("kind must be one of: \"episodic\", \"semantic\", \"procedural\""));
7421
8059
  return;
7422
8060
  }
7423
8061
  const query = typeof params?.query === "string" ? params.query?.trim() || void 0 : void 0;
@@ -7447,7 +8085,7 @@ const animaHandlers = {
7447
8085
  const fileName = typeof params?.fileName === "string" ? params.fileName?.trim() || "" : "";
7448
8086
  const content = typeof params?.content === "string" ? params.content ?? "" : "";
7449
8087
  if (!fileName) {
7450
- respond(false, void 0, invalid("fileName is required"));
8088
+ respond(false, void 0, invalid$1("fileName is required"));
7451
8089
  return;
7452
8090
  }
7453
8091
  try {
@@ -7465,7 +8103,7 @@ const animaHandlers = {
7465
8103
  "anima.mission.patch": async ({ params, respond }) => {
7466
8104
  const patch = asRecord$1(params?.patch);
7467
8105
  if (!patch) {
7468
- respond(false, void 0, invalid("patch object required"));
8106
+ respond(false, void 0, invalid$1("patch object required"));
7469
8107
  return;
7470
8108
  }
7471
8109
  try {
@@ -7480,7 +8118,7 @@ const animaHandlers = {
7480
8118
  "anima.mission.connect-repo": async ({ params, respond }) => {
7481
8119
  const url = typeof params?.url === "string" ? params.url?.trim() || "" : "";
7482
8120
  if (!url) {
7483
- respond(false, void 0, invalid("url is required"));
8121
+ respond(false, void 0, invalid$1("url is required"));
7484
8122
  return;
7485
8123
  }
7486
8124
  const branch = typeof params?.branch === "string" ? params.branch?.trim() || void 0 : void 0;
@@ -7499,6 +8137,22 @@ const animaHandlers = {
7499
8137
  respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
7500
8138
  }
7501
8139
  },
8140
+ "anima.trust.set": async ({ params, respond }) => {
8141
+ const people = Array.isArray(params?.people) ? params.people : null;
8142
+ if (!people) {
8143
+ respond(false, void 0, invalid$1("people array is required"));
8144
+ return;
8145
+ }
8146
+ try {
8147
+ await saveTrustGraph({
8148
+ version: 1,
8149
+ people
8150
+ });
8151
+ respond(true, { ok: true }, void 0);
8152
+ } catch (error) {
8153
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
8154
+ }
8155
+ },
7502
8156
  "anima.mission.import": async ({ params, respond }) => {
7503
8157
  const source = typeof params?.source === "string" ? params.source?.trim() || void 0 : void 0;
7504
8158
  const preset = typeof params?.preset === "string" ? params.preset?.trim() || void 0 : void 0;
@@ -7531,7 +8185,7 @@ const animaHandlers = {
7531
8185
  "anima.registration.set-token": async ({ params, respond }) => {
7532
8186
  const token = typeof params?.token === "string" ? params.token?.trim() || "" : "";
7533
8187
  if (!token) {
7534
- respond(false, void 0, invalid("token is required"));
8188
+ respond(false, void 0, invalid$1("token is required"));
7535
8189
  return;
7536
8190
  }
7537
8191
  try {
@@ -7539,7 +8193,7 @@ const animaHandlers = {
7539
8193
  const agent = await whoami();
7540
8194
  if (!agent) {
7541
8195
  clearToken();
7542
- respond(false, void 0, invalid("token could not be verified"));
8196
+ respond(false, void 0, invalid$1("token could not be verified"));
7543
8197
  return;
7544
8198
  }
7545
8199
  respond(true, {
@@ -7553,7 +8207,7 @@ const animaHandlers = {
7553
8207
  "anima.registration.register-invite": async ({ params, respond }) => {
7554
8208
  const code = typeof params?.code === "string" ? params.code?.trim() || "" : "";
7555
8209
  if (!code) {
7556
- respond(false, void 0, invalid("code is required"));
8210
+ respond(false, void 0, invalid$1("code is required"));
7557
8211
  return;
7558
8212
  }
7559
8213
  const suggested = resolveSuggestedIdentity();
@@ -8955,7 +9609,7 @@ const FIELD_LABELS = {
8955
9609
 
8956
9610
  //#endregion
8957
9611
  //#region src/config/schema.hints.ts
8958
- const log$4 = createSubsystemLogger("config/schema");
9612
+ const log$5 = createSubsystemLogger("config/schema");
8959
9613
  const GROUP_LABELS = {
8960
9614
  wizard: "Wizard",
8961
9615
  update: "Update",
@@ -9103,7 +9757,7 @@ function mapSensitivePaths(schema, path, hints) {
9103
9757
  ...next[path],
9104
9758
  sensitive: true
9105
9759
  };
9106
- else if (isSensitiveConfigPath(path) && !next[path]?.sensitive) log$4.warn(`possibly sensitive key found: (${path})`);
9760
+ else if (isSensitiveConfigPath(path) && !next[path]?.sensitive) log$5.warn(`possibly sensitive key found: (${path})`);
9107
9761
  if (currentSchema instanceof z.ZodObject) {
9108
9762
  const shape = currentSchema.shape;
9109
9763
  for (const key in shape) {
@@ -9126,7 +9780,7 @@ function mapSensitivePaths(schema, path, hints) {
9126
9780
 
9127
9781
  //#endregion
9128
9782
  //#region src/config/redact-snapshot.ts
9129
- const log$3 = createSubsystemLogger("config/redaction");
9783
+ const log$4 = createSubsystemLogger("config/redaction");
9130
9784
  const ENV_VAR_PLACEHOLDER_PATTERN = /^\$\{[^}]*\}$/;
9131
9785
  function isSensitivePath(path) {
9132
9786
  if (path.endsWith("[]")) return isSensitiveConfigPath(path.slice(0, -2));
@@ -9377,7 +10031,7 @@ function restoreRedactedValuesWithLookup(incoming, original, lookup, prefix, hin
9377
10031
  return restoreRedactedValuesGuessing(incoming, original, prefix, hints);
9378
10032
  }
9379
10033
  const origArr = Array.isArray(original) ? original : [];
9380
- if (incoming.length < origArr.length) log$3.warn(`Redacted config array key ${path} has been truncated`);
10034
+ if (incoming.length < origArr.length) log$4.warn(`Redacted config array key ${path} has been truncated`);
9381
10035
  return incoming.map((item, i) => {
9382
10036
  if (item === REDACTED_SENTINEL) return origArr[i];
9383
10037
  return restoreRedactedValuesWithLookup(item, origArr[i], lookup, path, hints);
@@ -9394,7 +10048,7 @@ function restoreRedactedValuesWithLookup(incoming, original, lookup, prefix, hin
9394
10048
  matched = true;
9395
10049
  if (value === REDACTED_SENTINEL) if (key in orig) result[key] = orig[key];
9396
10050
  else {
9397
- log$3.warn(`Cannot un-redact config key ${candidate} as it doesn't have any value`);
10051
+ log$4.warn(`Cannot un-redact config key ${candidate} as it doesn't have any value`);
9398
10052
  throw new RedactionError(candidate);
9399
10053
  }
9400
10054
  else if (typeof value === "object" && value !== null) result[key] = restoreRedactedValuesWithLookup(value, orig[key], lookup, candidate, hints);
@@ -9403,7 +10057,7 @@ function restoreRedactedValuesWithLookup(incoming, original, lookup, prefix, hin
9403
10057
  if (!matched && isExtensionPath(path)) {
9404
10058
  if (!isExplicitlyNonSensitivePath(hints, [path, wildcardPath]) && isSensitivePath(path) && value === REDACTED_SENTINEL) if (key in orig) result[key] = orig[key];
9405
10059
  else {
9406
- log$3.warn(`Cannot un-redact config key ${path} as it doesn't have any value`);
10060
+ log$4.warn(`Cannot un-redact config key ${path} as it doesn't have any value`);
9407
10061
  throw new RedactionError(path);
9408
10062
  }
9409
10063
  else if (typeof value === "object" && value !== null) result[key] = restoreRedactedValuesGuessing(value, orig[key], path, hints);
@@ -9422,7 +10076,7 @@ function restoreRedactedValuesGuessing(incoming, original, prefix, hints) {
9422
10076
  const origArr = Array.isArray(original) ? original : [];
9423
10077
  return incoming.map((item, i) => {
9424
10078
  const path = `${prefix}[]`;
9425
- if (incoming.length < origArr.length) log$3.warn(`Redacted config array key ${path} has been truncated`);
10079
+ if (incoming.length < origArr.length) log$4.warn(`Redacted config array key ${path} has been truncated`);
9426
10080
  if (!isExplicitlyNonSensitivePath(hints, [path]) && isSensitivePath(path) && item === REDACTED_SENTINEL) return origArr[i];
9427
10081
  return restoreRedactedValuesGuessing(item, origArr[i], path, hints);
9428
10082
  });
@@ -9433,7 +10087,7 @@ function restoreRedactedValuesGuessing(incoming, original, prefix, hints) {
9433
10087
  const path = prefix ? `${prefix}.${key}` : key;
9434
10088
  if (!isExplicitlyNonSensitivePath(hints, [path, prefix ? `${prefix}.*` : "*"]) && isSensitivePath(path) && value === REDACTED_SENTINEL) if (key in orig) result[key] = orig[key];
9435
10089
  else {
9436
- log$3.warn(`Cannot un-redact config key ${path} as it doesn't have any value`);
10090
+ log$4.warn(`Cannot un-redact config key ${path} as it doesn't have any value`);
9437
10091
  throw new RedactionError(path);
9438
10092
  }
9439
10093
  else if (typeof value === "object" && value !== null) result[key] = restoreRedactedValuesGuessing(value, orig[key], path, hints);
@@ -10780,10 +11434,10 @@ const logsHandlers = { "logs.tail": async ({ params, respond }) => {
10780
11434
  const mcpHandlers = {
10781
11435
  "mcp.list": async ({ respond }) => {
10782
11436
  try {
10783
- const { listServers } = await import("./registry-Cv8RtADU.js").then((n) => n.n);
11437
+ const { listServers } = await import("./registry-DwaHkd_j.js").then((n) => n.n);
10784
11438
  respond(true, { servers: await listServers() });
10785
11439
  } catch (err) {
10786
- respond(false, void 0, errorShape(ErrorCodes.INTERNAL, String(err)));
11440
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
10787
11441
  }
10788
11442
  },
10789
11443
  "mcp.add": async ({ params, respond }) => {
@@ -10793,8 +11447,8 @@ const mcpHandlers = {
10793
11447
  return;
10794
11448
  }
10795
11449
  try {
10796
- const { addServer } = await import("./registry-Cv8RtADU.js").then((n) => n.n);
10797
- const { syncConfig } = await import("./config-sync-CDUhjDom.js");
11450
+ const { addServer } = await import("./registry-DwaHkd_j.js").then((n) => n.n);
11451
+ const { syncConfig } = await import("./config-sync-CMO_5lyl.js");
10798
11452
  const registry = await addServer({
10799
11453
  name: p.name,
10800
11454
  command: p.command,
@@ -10809,7 +11463,7 @@ const mcpHandlers = {
10809
11463
  await syncConfig();
10810
11464
  respond(true, { servers: registry.servers });
10811
11465
  } catch (err) {
10812
- respond(false, void 0, errorShape(ErrorCodes.INTERNAL, String(err)));
11466
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
10813
11467
  }
10814
11468
  },
10815
11469
  "mcp.remove": async ({ params, respond }) => {
@@ -10819,21 +11473,21 @@ const mcpHandlers = {
10819
11473
  return;
10820
11474
  }
10821
11475
  try {
10822
- const { removeServer } = await import("./registry-Cv8RtADU.js").then((n) => n.n);
10823
- const { syncConfig } = await import("./config-sync-CDUhjDom.js");
11476
+ const { removeServer } = await import("./registry-DwaHkd_j.js").then((n) => n.n);
11477
+ const { syncConfig } = await import("./config-sync-CMO_5lyl.js");
10824
11478
  const registry = await removeServer(p.name);
10825
11479
  await syncConfig();
10826
11480
  respond(true, { servers: registry.servers });
10827
11481
  } catch (err) {
10828
- respond(false, void 0, errorShape(ErrorCodes.INTERNAL, String(err)));
11482
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
10829
11483
  }
10830
11484
  },
10831
11485
  "mcp.sync": async ({ respond }) => {
10832
11486
  try {
10833
- const { syncConfig } = await import("./config-sync-CDUhjDom.js");
11487
+ const { syncConfig } = await import("./config-sync-CMO_5lyl.js");
10834
11488
  respond(true, await syncConfig());
10835
11489
  } catch (err) {
10836
- respond(false, void 0, errorShape(ErrorCodes.INTERNAL, String(err)));
11490
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(err)));
10837
11491
  }
10838
11492
  }
10839
11493
  };
@@ -11418,7 +12072,7 @@ const nodeHandlers = {
11418
12072
  const p = params;
11419
12073
  const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
11420
12074
  await respondUnavailableOnThrow(respond, async () => {
11421
- const { handleNodeEvent } = await import("./server-node-events-CmZXzWcd.js");
12075
+ const { handleNodeEvent } = await import("./server-node-events-Ca797E1d.js");
11422
12076
  const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
11423
12077
  await handleNodeEvent({
11424
12078
  deps: context.deps,
@@ -11448,6 +12102,441 @@ const nodeHandlers = {
11448
12102
  }
11449
12103
  };
11450
12104
 
12105
+ //#endregion
12106
+ //#region src/org/types.ts
12107
+ const DEFAULT_ROLE_PERMISSIONS = {
12108
+ owner: {
12109
+ canCreateTasks: true,
12110
+ canDelegateTasks: true,
12111
+ canManageMembers: true,
12112
+ canEditOrg: true,
12113
+ canAccessRepos: ["*"],
12114
+ canEscalate: true,
12115
+ canViewBrain: true,
12116
+ canSyncBrain: true
12117
+ },
12118
+ operator: {
12119
+ canCreateTasks: true,
12120
+ canDelegateTasks: true,
12121
+ canManageMembers: true,
12122
+ canEditOrg: false,
12123
+ canAccessRepos: ["*"],
12124
+ canEscalate: true,
12125
+ canViewBrain: true,
12126
+ canSyncBrain: true
12127
+ },
12128
+ coordinator: {
12129
+ canCreateTasks: true,
12130
+ canDelegateTasks: true,
12131
+ canManageMembers: false,
12132
+ canEditOrg: false,
12133
+ canAccessRepos: [],
12134
+ canEscalate: true,
12135
+ canViewBrain: true,
12136
+ canSyncBrain: true
12137
+ },
12138
+ worker: {
12139
+ canCreateTasks: false,
12140
+ canDelegateTasks: false,
12141
+ canManageMembers: false,
12142
+ canEditOrg: false,
12143
+ canAccessRepos: [],
12144
+ canEscalate: true,
12145
+ canViewBrain: true,
12146
+ canSyncBrain: false
12147
+ },
12148
+ observer: {
12149
+ canCreateTasks: false,
12150
+ canDelegateTasks: false,
12151
+ canManageMembers: false,
12152
+ canEditOrg: false,
12153
+ canAccessRepos: [],
12154
+ canEscalate: false,
12155
+ canViewBrain: true,
12156
+ canSyncBrain: false
12157
+ }
12158
+ };
12159
+
12160
+ //#endregion
12161
+ //#region src/org/store.ts
12162
+ /**
12163
+ * ANIMA 6 Organization Store
12164
+ *
12165
+ * Persists organization state to ~/.anima/org/
12166
+ * Supports CRUD operations for orgs, members, and roles.
12167
+ */
12168
+ const log$3 = createSubsystemLogger("org-store");
12169
+ function resolveOrgDir() {
12170
+ return path.join(resolveStateDir(), "org");
12171
+ }
12172
+ function resolveOrgFile(orgId) {
12173
+ return path.join(resolveOrgDir(), `${orgId}.json`);
12174
+ }
12175
+ function readOrgFile(orgId) {
12176
+ const filePath = resolveOrgFile(orgId);
12177
+ try {
12178
+ if (!fs.existsSync(filePath)) return null;
12179
+ const raw = fs.readFileSync(filePath, "utf8");
12180
+ const parsed = JSON.parse(raw);
12181
+ if (parsed?.version !== 1) return null;
12182
+ return parsed;
12183
+ } catch {
12184
+ return null;
12185
+ }
12186
+ }
12187
+ function writeOrgFile(orgId, data) {
12188
+ const filePath = resolveOrgFile(orgId);
12189
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
12190
+ fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`, { mode: 384 });
12191
+ }
12192
+ function createOrganization(name, description, ownerId, ownerName, ownerKind, settings) {
12193
+ const orgId = crypto.randomUUID();
12194
+ const now = Date.now();
12195
+ const org = {
12196
+ id: orgId,
12197
+ name,
12198
+ description,
12199
+ createdAt: now,
12200
+ updatedAt: now,
12201
+ ownerId,
12202
+ settings: {
12203
+ maxAgents: 50,
12204
+ maxHumans: 20,
12205
+ autoSpecialization: true,
12206
+ securityLevel: "standard",
12207
+ syncIntervalMs: 6e4,
12208
+ backupIntervalMs: 300 * 60 * 1e3,
12209
+ peerPort: 9876,
12210
+ ...settings
12211
+ }
12212
+ };
12213
+ writeOrgFile(orgId, {
12214
+ version: 1,
12215
+ org,
12216
+ members: [{
12217
+ id: crypto.randomUUID(),
12218
+ kind: ownerKind,
12219
+ displayName: ownerName,
12220
+ role: "owner",
12221
+ description: "Organization owner",
12222
+ specializations: [],
12223
+ joinedAt: now,
12224
+ lastActiveAt: now,
12225
+ status: "active",
12226
+ permissions: DEFAULT_ROLE_PERMISSIONS.owner
12227
+ }]
12228
+ });
12229
+ log$3.info(`created organization: ${name} (${orgId})`);
12230
+ return org;
12231
+ }
12232
+ function getOrganization(orgId) {
12233
+ return readOrgFile(orgId)?.org ?? null;
12234
+ }
12235
+ function updateOrganization(orgId, updates) {
12236
+ const data = readOrgFile(orgId);
12237
+ if (!data) return null;
12238
+ if (updates.name) data.org.name = updates.name;
12239
+ if (updates.description) data.org.description = updates.description;
12240
+ if (updates.settings) data.org.settings = {
12241
+ ...data.org.settings,
12242
+ ...updates.settings
12243
+ };
12244
+ data.org.updatedAt = Date.now();
12245
+ writeOrgFile(orgId, data);
12246
+ log$3.info(`updated organization: ${orgId}`);
12247
+ return data.org;
12248
+ }
12249
+ function listOrganizations() {
12250
+ const dir = resolveOrgDir();
12251
+ try {
12252
+ if (!fs.existsSync(dir)) return [];
12253
+ return fs.readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => {
12254
+ return readOrgFile(f.replace(".json", ""))?.org;
12255
+ }).filter((o) => o != null);
12256
+ } catch {
12257
+ return [];
12258
+ }
12259
+ }
12260
+ function addMember(orgId, member) {
12261
+ const data = readOrgFile(orgId);
12262
+ if (!data) return null;
12263
+ const newMember = {
12264
+ ...member,
12265
+ id: crypto.randomUUID(),
12266
+ joinedAt: Date.now(),
12267
+ lastActiveAt: Date.now(),
12268
+ permissions: DEFAULT_ROLE_PERMISSIONS[member.role]
12269
+ };
12270
+ data.members.push(newMember);
12271
+ data.org.updatedAt = Date.now();
12272
+ writeOrgFile(orgId, data);
12273
+ log$3.info(`added member ${newMember.displayName} to org ${orgId}`);
12274
+ return newMember;
12275
+ }
12276
+ function removeMember(orgId, memberId) {
12277
+ const data = readOrgFile(orgId);
12278
+ if (!data) return false;
12279
+ const idx = data.members.findIndex((m) => m.id === memberId);
12280
+ if (idx === -1) return false;
12281
+ data.members.splice(idx, 1);
12282
+ data.org.updatedAt = Date.now();
12283
+ writeOrgFile(orgId, data);
12284
+ log$3.info(`removed member ${memberId} from org ${orgId}`);
12285
+ return true;
12286
+ }
12287
+ function updateMember(orgId, memberId, updates) {
12288
+ const data = readOrgFile(orgId);
12289
+ if (!data) return null;
12290
+ const member = data.members.find((m) => m.id === memberId);
12291
+ if (!member) return null;
12292
+ if (updates.displayName) member.displayName = updates.displayName;
12293
+ if (updates.role) {
12294
+ member.role = updates.role;
12295
+ member.permissions = {
12296
+ ...DEFAULT_ROLE_PERMISSIONS[updates.role],
12297
+ ...updates.permissions
12298
+ };
12299
+ }
12300
+ if (updates.description !== void 0) member.description = updates.description;
12301
+ if (updates.specializations) member.specializations = updates.specializations;
12302
+ if (updates.status) member.status = updates.status;
12303
+ if (updates.reportsTo !== void 0) member.reportsTo = updates.reportsTo;
12304
+ if (updates.permissions && !updates.role) member.permissions = {
12305
+ ...member.permissions,
12306
+ ...updates.permissions
12307
+ };
12308
+ member.lastActiveAt = Date.now();
12309
+ data.org.updatedAt = Date.now();
12310
+ writeOrgFile(orgId, data);
12311
+ return member;
12312
+ }
12313
+ function getMembers(orgId) {
12314
+ return readOrgFile(orgId)?.members ?? [];
12315
+ }
12316
+ function buildHierarchy(orgId) {
12317
+ const members = getMembers(orgId);
12318
+ if (members.length === 0) return [];
12319
+ const memberMap = new Map(members.map((m) => [m.id, m]));
12320
+ function buildNode(member) {
12321
+ const children = members.filter((m) => m.reportsTo === member.id).map((m) => buildNode(m));
12322
+ return {
12323
+ memberId: member.id,
12324
+ displayName: member.displayName,
12325
+ kind: member.kind,
12326
+ role: member.role,
12327
+ specializations: member.specializations,
12328
+ status: member.status,
12329
+ children
12330
+ };
12331
+ }
12332
+ return members.filter((m) => !m.reportsTo || !memberMap.has(m.reportsTo)).map((r) => buildNode(r));
12333
+ }
12334
+
12335
+ //#endregion
12336
+ //#region src/gateway/server-methods/org.ts
12337
+ function invalid(message) {
12338
+ return errorShape(ErrorCodes.INVALID_REQUEST, message);
12339
+ }
12340
+ function requireString(params, key) {
12341
+ const val = params[key];
12342
+ return typeof val === "string" ? val.trim() || null : null;
12343
+ }
12344
+ const orgHandlers = {
12345
+ "org.list": async ({ respond }) => {
12346
+ try {
12347
+ respond(true, { orgs: listOrganizations() }, void 0);
12348
+ } catch (error) {
12349
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12350
+ }
12351
+ },
12352
+ "org.get": async ({ params, respond }) => {
12353
+ const orgId = requireString(params, "orgId");
12354
+ if (!orgId) {
12355
+ respond(false, void 0, invalid("orgId is required"));
12356
+ return;
12357
+ }
12358
+ try {
12359
+ const org = getOrganization(orgId);
12360
+ if (!org) {
12361
+ respond(false, void 0, invalid("Organization not found"));
12362
+ return;
12363
+ }
12364
+ respond(true, {
12365
+ org,
12366
+ members: getMembers(orgId)
12367
+ }, void 0);
12368
+ } catch (error) {
12369
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12370
+ }
12371
+ },
12372
+ "org.create": async ({ params, respond }) => {
12373
+ const name = requireString(params, "name");
12374
+ const description = requireString(params, "description") ?? "";
12375
+ const ownerId = requireString(params, "ownerId");
12376
+ const ownerName = requireString(params, "ownerName");
12377
+ const ownerKind = requireString(params, "ownerKind");
12378
+ if (!name) {
12379
+ respond(false, void 0, invalid("name is required"));
12380
+ return;
12381
+ }
12382
+ if (!ownerId) {
12383
+ respond(false, void 0, invalid("ownerId is required"));
12384
+ return;
12385
+ }
12386
+ if (!ownerName) {
12387
+ respond(false, void 0, invalid("ownerName is required"));
12388
+ return;
12389
+ }
12390
+ if (!ownerKind || ownerKind !== "human" && ownerKind !== "agent") {
12391
+ respond(false, void 0, invalid("ownerKind must be \"human\" or \"agent\""));
12392
+ return;
12393
+ }
12394
+ const settings = params.settings && typeof params.settings === "object" && !Array.isArray(params.settings) ? params.settings : void 0;
12395
+ try {
12396
+ const org = createOrganization(name, description, ownerId, ownerName, ownerKind, settings);
12397
+ respond(true, {
12398
+ org,
12399
+ members: getMembers(org.id)
12400
+ }, void 0);
12401
+ } catch (error) {
12402
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12403
+ }
12404
+ },
12405
+ "org.update": async ({ params, respond }) => {
12406
+ const orgId = requireString(params, "orgId");
12407
+ if (!orgId) {
12408
+ respond(false, void 0, invalid("orgId is required"));
12409
+ return;
12410
+ }
12411
+ const updates = {};
12412
+ const name = requireString(params, "name");
12413
+ if (name) updates.name = name;
12414
+ const description = requireString(params, "description");
12415
+ if (description) updates.description = description;
12416
+ if (params.settings && typeof params.settings === "object" && !Array.isArray(params.settings)) updates.settings = params.settings;
12417
+ try {
12418
+ const org = updateOrganization(orgId, updates);
12419
+ if (!org) {
12420
+ respond(false, void 0, invalid("Organization not found"));
12421
+ return;
12422
+ }
12423
+ respond(true, { org }, void 0);
12424
+ } catch (error) {
12425
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12426
+ }
12427
+ },
12428
+ "org.addMember": async ({ params, respond }) => {
12429
+ const orgId = requireString(params, "orgId");
12430
+ if (!orgId) {
12431
+ respond(false, void 0, invalid("orgId is required"));
12432
+ return;
12433
+ }
12434
+ const displayName = requireString(params, "displayName");
12435
+ if (!displayName) {
12436
+ respond(false, void 0, invalid("displayName is required"));
12437
+ return;
12438
+ }
12439
+ const kind = requireString(params, "kind");
12440
+ if (!kind || kind !== "human" && kind !== "agent") {
12441
+ respond(false, void 0, invalid("kind must be \"human\" or \"agent\""));
12442
+ return;
12443
+ }
12444
+ const role = requireString(params, "role") ?? "worker";
12445
+ const description = requireString(params, "description") ?? "";
12446
+ const specializations = Array.isArray(params.specializations) ? params.specializations : [];
12447
+ const status = requireString(params, "status") ?? "active";
12448
+ const reportsTo = requireString(params, "reportsTo") ?? void 0;
12449
+ try {
12450
+ const member = addMember(orgId, {
12451
+ kind,
12452
+ displayName,
12453
+ role,
12454
+ description,
12455
+ specializations,
12456
+ status,
12457
+ reportsTo
12458
+ });
12459
+ if (!member) {
12460
+ respond(false, void 0, invalid("Organization not found"));
12461
+ return;
12462
+ }
12463
+ respond(true, { member }, void 0);
12464
+ } catch (error) {
12465
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12466
+ }
12467
+ },
12468
+ "org.updateMember": async ({ params, respond }) => {
12469
+ const orgId = requireString(params, "orgId");
12470
+ const memberId = requireString(params, "memberId");
12471
+ if (!orgId) {
12472
+ respond(false, void 0, invalid("orgId is required"));
12473
+ return;
12474
+ }
12475
+ if (!memberId) {
12476
+ respond(false, void 0, invalid("memberId is required"));
12477
+ return;
12478
+ }
12479
+ const updates = {};
12480
+ const displayName = requireString(params, "displayName");
12481
+ if (displayName) updates.displayName = displayName;
12482
+ const role = requireString(params, "role");
12483
+ if (role) updates.role = role;
12484
+ const description = params.description;
12485
+ if (typeof description === "string") updates.description = description;
12486
+ if (Array.isArray(params.specializations)) updates.specializations = params.specializations;
12487
+ const status = requireString(params, "status");
12488
+ if (status) updates.status = status;
12489
+ if (params.reportsTo !== void 0) updates.reportsTo = typeof params.reportsTo === "string" ? params.reportsTo : void 0;
12490
+ try {
12491
+ const member = updateMember(orgId, memberId, updates);
12492
+ if (!member) {
12493
+ respond(false, void 0, invalid("Member not found"));
12494
+ return;
12495
+ }
12496
+ respond(true, { member }, void 0);
12497
+ } catch (error) {
12498
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12499
+ }
12500
+ },
12501
+ "org.removeMember": async ({ params, respond }) => {
12502
+ const orgId = requireString(params, "orgId");
12503
+ const memberId = requireString(params, "memberId");
12504
+ if (!orgId) {
12505
+ respond(false, void 0, invalid("orgId is required"));
12506
+ return;
12507
+ }
12508
+ if (!memberId) {
12509
+ respond(false, void 0, invalid("memberId is required"));
12510
+ return;
12511
+ }
12512
+ try {
12513
+ if (!removeMember(orgId, memberId)) {
12514
+ respond(false, void 0, invalid("Member not found"));
12515
+ return;
12516
+ }
12517
+ respond(true, { ok: true }, void 0);
12518
+ } catch (error) {
12519
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12520
+ }
12521
+ },
12522
+ "org.hierarchy": async ({ params, respond }) => {
12523
+ const orgId = requireString(params, "orgId");
12524
+ if (!orgId) {
12525
+ respond(false, void 0, invalid("orgId is required"));
12526
+ return;
12527
+ }
12528
+ try {
12529
+ if (!getOrganization(orgId)) {
12530
+ respond(false, void 0, invalid("Organization not found"));
12531
+ return;
12532
+ }
12533
+ respond(true, { hierarchy: buildHierarchy(orgId) }, void 0);
12534
+ } catch (error) {
12535
+ respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, String(error)));
12536
+ }
12537
+ }
12538
+ };
12539
+
11451
12540
  //#endregion
11452
12541
  //#region src/gateway/server-methods/providers.ts
11453
12542
  function isValidProviderArray(value) {
@@ -13359,6 +14448,7 @@ const coreGatewayHandlers = {
13359
14448
  ...systemHandlers,
13360
14449
  ...updateHandlers,
13361
14450
  ...nodeHandlers,
14451
+ ...orgHandlers,
13362
14452
  ...sendHandlers,
13363
14453
  ...usageHandlers,
13364
14454
  ...agentHandlers,
@@ -14304,7 +15394,7 @@ function normalizeAgentPayload(payload) {
14304
15394
  async function startBrowserControlServerIfEnabled() {
14305
15395
  if (isTruthyEnvValue(process.env.ANIMA_SKIP_BROWSER_CONTROL_SERVER)) return null;
14306
15396
  const override = process.env.ANIMA_BROWSER_CONTROL_MODULE?.trim();
14307
- const mod = override ? await import(override) : await import("./control-service-D1oxSXVg.js").then((n) => n.t);
15397
+ const mod = override ? await import(override) : await import("./control-service-3CI4vt1h.js").then((n) => n.t);
14308
15398
  const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
14309
15399
  const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
14310
15400
  if (!start) return null;
@@ -17974,7 +19064,7 @@ async function startGatewaySidecars(params) {
17974
19064
  params.log.warn(`ANIMA Gateway plugin services failed to start: ${String(err)}`);
17975
19065
  }
17976
19066
  try {
17977
- const { syncConfig } = await import("./config-sync-CDUhjDom.js");
19067
+ const { syncConfig } = await import("./config-sync-CMO_5lyl.js");
17978
19068
  const syncResult = await syncConfig();
17979
19069
  const formatRes = (res) => `${res.added.length} added, ${res.updated.length} updated, ${res.removed.length} removed`;
17980
19070
  if (syncResult.added.length + syncResult.updated.length + syncResult.removed.length > 0) params.log.warn(`MCP config synced: Claude (${formatRes(syncResult.claude)}); Codex (${formatRes(syncResult.codex)})`);
@@ -19340,8 +20430,8 @@ async function startGatewayServer(port = 18789, opts = {}) {
19340
20430
  } : startHeartbeatRunner({ cfg: cfgAtStart });
19341
20431
  if (!minimalTestGateway) cron.start().catch((err) => logCron.error(`failed to start: ${String(err)}`));
19342
20432
  if (!minimalTestGateway) (async () => {
19343
- const { recoverPendingDeliveries } = await import("./delivery-queue-DGnDKL02.js").then((n) => n.n);
19344
- const { deliverOutboundPayloads } = await import("./deliver-DVt8TbK9.js").then((n) => n.n);
20433
+ const { recoverPendingDeliveries } = await import("./delivery-queue-BKQk1j0k.js").then((n) => n.n);
20434
+ const { deliverOutboundPayloads } = await import("./deliver-C1L5nO0K.js").then((n) => n.n);
19345
20435
  await recoverPendingDeliveries({
19346
20436
  deliver: deliverOutboundPayloads,
19347
20437
  log: log.child("delivery-recovery"),