@aeolus-fleet/gateway 0.30.0 → 0.32.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 (384) hide show
  1. package/dist/adapters/fleet/core-version.d.ts +1 -1
  2. package/dist/adapters/fleet/core-version.js +1 -1
  3. package/dist/adapters/fleet/proxy-ships-as-actor.js +5 -1
  4. package/dist/adapters/fleet/proxy-ships-as-actor.js.map +1 -1
  5. package/dist/adapters/fleet/rest-fleet-door.d.ts +2 -0
  6. package/dist/adapters/fleet/rest-fleet-door.js +51 -7
  7. package/dist/adapters/fleet/rest-fleet-door.js.map +1 -1
  8. package/dist/adapters/http/mcp-endpoint.js +1 -1
  9. package/dist/adapters/http/mcp-endpoint.js.map +1 -1
  10. package/dist/adapters/http/person-tools.d.ts +4 -7
  11. package/dist/adapters/http/person-tools.js +76 -11
  12. package/dist/adapters/http/person-tools.js.map +1 -1
  13. package/dist/adapters/pagasae/email-channel.js +4 -2
  14. package/dist/adapters/pagasae/email-channel.js.map +1 -1
  15. package/dist/adapters/prisma/generated/commonInputTypes.d.ts +50 -50
  16. package/dist/adapters/prisma/generated/internal/class.js +4 -4
  17. package/dist/adapters/prisma/generated/internal/class.js.map +1 -1
  18. package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +2 -0
  19. package/dist/adapters/prisma/generated/internal/prismaNamespace.js +2 -0
  20. package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -1
  21. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +2 -0
  22. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +2 -0
  23. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -1
  24. package/dist/adapters/prisma/generated/models/A2aPush.d.ts +0 -7
  25. package/dist/adapters/prisma/generated/models/Party.d.ts +70 -1
  26. package/dist/adapters/prisma/scope-requirements.d.ts +10 -0
  27. package/dist/adapters/prisma/scope-requirements.js +37 -0
  28. package/dist/adapters/prisma/scope-requirements.js.map +1 -0
  29. package/dist/adapters/trpc/router.d.ts +154 -8
  30. package/dist/adapters/trpc/router.js +130 -11
  31. package/dist/adapters/trpc/router.js.map +1 -1
  32. package/dist/app.js +38 -9
  33. package/dist/app.js.map +1 -1
  34. package/dist/core/a2a-out/agent-event.d.ts +1 -1
  35. package/dist/core/a2a-out/agent-event.js +2 -2
  36. package/dist/core/a2a-out/agent-event.js.map +1 -1
  37. package/dist/core/a2a-out/agent-statement.d.ts +2 -1
  38. package/dist/core/a2a-out/agent-statement.js +5 -2
  39. package/dist/core/a2a-out/agent-statement.js.map +1 -1
  40. package/dist/core/a2a-out/hand-a2a-message.d.ts +7 -2
  41. package/dist/core/a2a-out/hand-a2a-message.js +15 -1
  42. package/dist/core/a2a-out/hand-a2a-message.js.map +1 -1
  43. package/dist/core/a2a-out/read-agent-statement.d.ts +1 -0
  44. package/dist/core/a2a-out/read-agent-statement.js +1 -1
  45. package/dist/core/a2a-out/read-agent-statement.js.map +1 -1
  46. package/dist/core/a2a-out/state-a2a-agent.d.ts +3 -2
  47. package/dist/core/a2a-out/state-a2a-agent.js +3 -2
  48. package/dist/core/a2a-out/state-a2a-agent.js.map +1 -1
  49. package/dist/core/account-sign-in/account-in-view.d.ts +10 -1
  50. package/dist/core/account-sign-in/account-in-view.js +17 -4
  51. package/dist/core/account-sign-in/account-in-view.js.map +1 -1
  52. package/dist/core/connection/ports.d.ts +8 -0
  53. package/dist/core/mcp-out/hand-call.d.ts +6 -2
  54. package/dist/core/mcp-out/hand-call.js +14 -1
  55. package/dist/core/mcp-out/hand-call.js.map +1 -1
  56. package/dist/core/mcp-out/state-party.d.ts +3 -2
  57. package/dist/core/mcp-out/state-party.js +2 -2
  58. package/dist/core/mcp-out/state-party.js.map +1 -1
  59. package/dist/core/mcp-out/statement.d.ts +16 -0
  60. package/dist/core/mcp-out/statement.js +10 -3
  61. package/dist/core/mcp-out/statement.js.map +1 -1
  62. package/dist/core/meetings/change-own-mic.d.ts +24 -0
  63. package/dist/core/meetings/change-own-mic.js +21 -0
  64. package/dist/core/meetings/change-own-mic.js.map +1 -0
  65. package/dist/core/meetings/mic-standing.d.ts +18 -0
  66. package/dist/core/meetings/mic-standing.js +11 -0
  67. package/dist/core/meetings/mic-standing.js.map +1 -0
  68. package/dist/core/meetings/ports.d.ts +70 -0
  69. package/dist/core/meetings/ports.js +2 -0
  70. package/dist/core/meetings/ports.js.map +1 -0
  71. package/dist/core/meetings/read-meeting.d.ts +30 -0
  72. package/dist/core/meetings/read-meeting.js +26 -0
  73. package/dist/core/meetings/read-meeting.js.map +1 -0
  74. package/dist/core/operator/ports.d.ts +4 -4
  75. package/dist/core/parties/add-a2a-agent.js +1 -1
  76. package/dist/core/parties/add-a2a-agent.js.map +1 -1
  77. package/dist/core/parties/check-approving.d.ts +36 -0
  78. package/dist/core/parties/check-approving.js +48 -0
  79. package/dist/core/parties/check-approving.js.map +1 -0
  80. package/dist/core/parties/check-required-scopes.d.ts +34 -0
  81. package/dist/core/parties/check-required-scopes.js +27 -0
  82. package/dist/core/parties/check-required-scopes.js.map +1 -0
  83. package/dist/core/parties/ports.d.ts +21 -0
  84. package/dist/core/parties/read-listed-scopes.d.ts +17 -0
  85. package/dist/core/parties/read-listed-scopes.js +23 -0
  86. package/dist/core/parties/read-listed-scopes.js.map +1 -0
  87. package/dist/core/parties/read-scope-requirements.d.ts +18 -0
  88. package/dist/core/parties/read-scope-requirements.js +17 -0
  89. package/dist/core/parties/read-scope-requirements.js.map +1 -0
  90. package/dist/core/parties/scope-requirements.d.ts +34 -0
  91. package/dist/core/parties/scope-requirements.js +37 -0
  92. package/dist/core/parties/scope-requirements.js.map +1 -0
  93. package/dist/core/parties/set-scope-requirements.d.ts +45 -0
  94. package/dist/core/parties/set-scope-requirements.js +48 -0
  95. package/dist/core/parties/set-scope-requirements.js.map +1 -0
  96. package/dist/core/parties/switch-tools.d.ts +39 -0
  97. package/dist/core/parties/switch-tools.js +38 -0
  98. package/dist/core/parties/switch-tools.js.map +1 -0
  99. package/dist/core/parties/tool-switches.d.ts +4 -2
  100. package/dist/core/parties/tool-switches.js +2 -1
  101. package/dist/core/parties/tool-switches.js.map +1 -1
  102. package/dist/core/people/inbox-entry.d.ts +2 -2
  103. package/dist/core/people/inbox-entry.js +9 -2
  104. package/dist/core/people/inbox-entry.js.map +1 -1
  105. package/dist/core/people/open-delivery.d.ts +3 -1
  106. package/dist/core/people/open-delivery.js +1 -1
  107. package/dist/core/people/open-delivery.js.map +1 -1
  108. package/dist/core/people/ports.d.ts +11 -4
  109. package/dist/core/people/wake-person.d.ts +22 -10
  110. package/dist/core/people/wake-person.js +88 -20
  111. package/dist/core/people/wake-person.js.map +1 -1
  112. package/dist/core/people/web-push-channel.js +1 -1
  113. package/dist/core/people/web-push-channel.js.map +1 -1
  114. package/dist/core/shared/errors.d.ts +1 -1
  115. package/dist/core/shared/errors.js.map +1 -1
  116. package/package.json +3 -3
  117. package/src/adapters/prisma/migrations/20261025140000_scope_requirements/migration.sql +3 -0
  118. package/src/adapters/prisma/schema.prisma +69 -65
  119. package/web/.next/BUILD_ID +1 -1
  120. package/web/.next/app-path-routes-manifest.json +2 -0
  121. package/web/.next/build-manifest.json +27 -3
  122. package/web/.next/diagnostics/route-bundle-stats.json +122 -70
  123. package/web/.next/fallback-build-manifest.json +3 -3
  124. package/web/.next/prerender-manifest.json +3 -3
  125. package/web/.next/routes-manifest.json +14 -0
  126. package/web/.next/server/app/(console)/gateway-off/page/app-paths-manifest.json +3 -0
  127. package/web/.next/server/app/(console)/gateway-off/page/build-manifest.json +23 -0
  128. package/web/.next/server/app/(console)/gateway-off/page/next-font-manifest.json +11 -0
  129. package/web/.next/server/app/(console)/gateway-off/page/react-loadable-manifest.json +1 -0
  130. package/web/.next/server/app/(console)/gateway-off/page/server-reference-manifest.json +15 -0
  131. package/web/.next/server/app/(console)/gateway-off/page.js +19 -0
  132. package/web/.next/server/app/(console)/gateway-off/page.js.map +5 -0
  133. package/web/.next/server/app/(console)/gateway-off/page.js.nft.json +1 -0
  134. package/web/.next/server/app/(console)/gateway-off/page_client-reference-manifest.js +3 -0
  135. package/web/.next/server/app/(console)/meetings/[meetingId]/page/app-paths-manifest.json +3 -0
  136. package/web/.next/server/app/(console)/meetings/[meetingId]/page/build-manifest.json +23 -0
  137. package/web/.next/server/app/(console)/meetings/[meetingId]/page/next-font-manifest.json +11 -0
  138. package/web/.next/server/app/(console)/meetings/[meetingId]/page/react-loadable-manifest.json +1 -0
  139. package/web/.next/server/app/(console)/meetings/[meetingId]/page/server-reference-manifest.json +35 -0
  140. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js +21 -0
  141. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.map +5 -0
  142. package/web/.next/server/app/(console)/meetings/[meetingId]/page.js.nft.json +1 -0
  143. package/web/.next/server/app/(console)/meetings/[meetingId]/page_client-reference-manifest.js +3 -0
  144. package/web/.next/server/app/(console)/outside-parties/[name]/change/page/server-reference-manifest.json +17 -7
  145. package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js +4 -4
  146. package/web/.next/server/app/(console)/outside-parties/[name]/change/page.js.nft.json +1 -1
  147. package/web/.next/server/app/(console)/outside-parties/[name]/change/page_client-reference-manifest.js +1 -1
  148. package/web/.next/server/app/(console)/outside-parties/[name]/page/server-reference-manifest.json +15 -5
  149. package/web/.next/server/app/(console)/outside-parties/[name]/page.js +4 -4
  150. package/web/.next/server/app/(console)/outside-parties/[name]/page.js.nft.json +1 -1
  151. package/web/.next/server/app/(console)/outside-parties/[name]/page_client-reference-manifest.js +1 -1
  152. package/web/.next/server/app/(console)/outside-parties/[name]/retire/page/server-reference-manifest.json +17 -7
  153. package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js +4 -4
  154. package/web/.next/server/app/(console)/outside-parties/[name]/retire/page.js.nft.json +1 -1
  155. package/web/.next/server/app/(console)/outside-parties/[name]/retire/page_client-reference-manifest.js +1 -1
  156. package/web/.next/server/app/(console)/outside-parties/add/page/server-reference-manifest.json +17 -7
  157. package/web/.next/server/app/(console)/outside-parties/add/page.js +3 -4
  158. package/web/.next/server/app/(console)/outside-parties/add/page.js.nft.json +1 -1
  159. package/web/.next/server/app/(console)/outside-parties/add/page_client-reference-manifest.js +1 -1
  160. package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page/server-reference-manifest.json +2 -2
  161. package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page.js.nft.json +1 -1
  162. package/web/.next/server/app/(console)/outside-parties/add-a2a-agent/page_client-reference-manifest.js +1 -1
  163. package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page/server-reference-manifest.json +2 -2
  164. package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page.js.nft.json +1 -1
  165. package/web/.next/server/app/(console)/outside-parties/add-a2a-client/page_client-reference-manifest.js +1 -1
  166. package/web/.next/server/app/(console)/outside-parties/page/server-reference-manifest.json +2 -2
  167. package/web/.next/server/app/(console)/outside-parties/page.js.nft.json +1 -1
  168. package/web/.next/server/app/(console)/outside-parties/page_client-reference-manifest.js +1 -1
  169. package/web/.next/server/app/(console)/overview/changes/route.js.nft.json +1 -1
  170. package/web/.next/server/app/(console)/overview/focus/route.js.nft.json +1 -1
  171. package/web/.next/server/app/(console)/overview/page/server-reference-manifest.json +7 -7
  172. package/web/.next/server/app/(console)/overview/page.js +3 -3
  173. package/web/.next/server/app/(console)/overview/page.js.nft.json +1 -1
  174. package/web/.next/server/app/(console)/overview/page_client-reference-manifest.js +1 -1
  175. package/web/.next/server/app/(console)/overview/requests/[requestId]/page/server-reference-manifest.json +2 -2
  176. package/web/.next/server/app/(console)/overview/requests/[requestId]/page.js.nft.json +1 -1
  177. package/web/.next/server/app/(console)/overview/requests/[requestId]/page_client-reference-manifest.js +1 -1
  178. package/web/.next/server/app/(console)/parties/page/server-reference-manifest.json +7 -7
  179. package/web/.next/server/app/(console)/parties/page.js.nft.json +1 -1
  180. package/web/.next/server/app/(console)/parties/page_client-reference-manifest.js +1 -1
  181. package/web/.next/server/app/(console)/sign-in/failed/page/server-reference-manifest.json +1 -1
  182. package/web/.next/server/app/(console)/sign-in/failed/page.js.nft.json +1 -1
  183. package/web/.next/server/app/(console)/sign-in/failed/page_client-reference-manifest.js +1 -1
  184. package/web/.next/server/app/_global-error.html +1 -1
  185. package/web/.next/server/app/_global-error.rsc +1 -1
  186. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  187. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  188. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  189. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  190. package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  191. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  192. package/web/.next/server/app/authorize/failed/page/server-reference-manifest.json +1 -1
  193. package/web/.next/server/app/authorize/failed/page.js.nft.json +1 -1
  194. package/web/.next/server/app/authorize/failed/page_client-reference-manifest.js +1 -1
  195. package/web/.next/server/app/authorize/pick/page/server-reference-manifest.json +1 -1
  196. package/web/.next/server/app/authorize/pick/page.js.nft.json +1 -1
  197. package/web/.next/server/app/authorize/pick/page_client-reference-manifest.js +1 -1
  198. package/web/.next/server/app/authorize/waiting/approval/page/server-reference-manifest.json +1 -1
  199. package/web/.next/server/app/authorize/waiting/approval/page.js.nft.json +1 -1
  200. package/web/.next/server/app/authorize/waiting/approval/page_client-reference-manifest.js +1 -1
  201. package/web/.next/server/app-paths-manifest.json +2 -0
  202. package/web/.next/server/chunks/[root-of-the-server]__0ykc8bq_c06a1._.js +10 -10
  203. package/web/.next/server/chunks/[root-of-the-server]__0ykc8bq_c06a1._.js.map +1 -1
  204. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js +1 -1
  205. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_change_page_actions_04td11fxohsfm.js.map +1 -1
  206. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js +1 -1
  207. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_page_actions_0u-45itza1ls7.js.map +1 -1
  208. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js +1 -1
  209. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_[name]_retire_page_actions_0s7ps6i0ts7v5.js.map +1 -1
  210. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js +1 -1
  211. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add-a2a-client_page_actions_0d_wgiu94c32e.js.map +1 -1
  212. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js +1 -1
  213. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_outside-parties_add_page_actions_0yfz_dfn-8uo7.js.map +1 -1
  214. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js +1 -1
  215. package/web/.next/server/chunks/ssr/0vkm_server_app_(console)_overview_requests_[requestId]_page_actions_0uki9j3mtuz9e.js.map +1 -1
  216. package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js +1 -1
  217. package/web/.next/server/chunks/ssr/[root-of-the-server]__0-og0bl8lr2xq._.js.map +1 -1
  218. package/web/.next/server/chunks/ssr/[root-of-the-server]__00erqdm9cmhh7._.js +3 -0
  219. package/web/.next/server/chunks/ssr/[root-of-the-server]__00erqdm9cmhh7._.js.map +1 -0
  220. package/web/.next/server/chunks/ssr/[root-of-the-server]__00q22dte1g2ww._.js +3 -0
  221. package/web/.next/server/chunks/ssr/[root-of-the-server]__00q22dte1g2ww._.js.map +1 -0
  222. package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js +1 -1
  223. package/web/.next/server/chunks/ssr/[root-of-the-server]__0k3g0p3t9t0c-._.js.map +1 -1
  224. package/web/.next/server/chunks/ssr/[root-of-the-server]__0n2us07jk-78w._.js +1 -1
  225. package/web/.next/server/chunks/ssr/[root-of-the-server]__0rr5u24i9tjyc._.js +1 -1
  226. package/web/.next/server/chunks/ssr/[root-of-the-server]__1-c9wugbbwsp3._.js +4 -0
  227. package/web/.next/server/chunks/ssr/[root-of-the-server]__1-c9wugbbwsp3._.js.map +1 -0
  228. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js +4 -0
  229. package/web/.next/server/chunks/ssr/[root-of-the-server]__18-8taiduk1jn._.js.map +1 -0
  230. package/web/.next/server/chunks/ssr/{[root-of-the-server]__11w36a4le04vy._.js → [root-of-the-server]__1dc6okf5os70a._.js} +2 -2
  231. package/web/.next/server/chunks/ssr/[root-of-the-server]__1dc6okf5os70a._.js.map +1 -0
  232. package/web/.next/server/chunks/ssr/[root-of-the-server]__1dtyycvqa6uht._.js +1 -1
  233. package/web/.next/server/chunks/ssr/_0-lfpqqlgfhzj._.js.map +1 -1
  234. package/web/.next/server/chunks/ssr/_00dg5cvqofspn._.js +3 -0
  235. package/web/.next/server/chunks/ssr/_00dg5cvqofspn._.js.map +1 -0
  236. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js +1 -1
  237. package/web/.next/server/chunks/ssr/_00hfzlqn1og18._.js.map +1 -1
  238. package/web/.next/server/chunks/ssr/_03lk54yp-yhw3._.js +2 -2
  239. package/web/.next/server/chunks/ssr/_03lk54yp-yhw3._.js.map +1 -1
  240. package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js +3 -0
  241. package/web/.next/server/chunks/ssr/_0_kakdt7lb6z-._.js.map +1 -0
  242. package/web/.next/server/chunks/ssr/_0bhvvyz0q_0ja._.js +1 -1
  243. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js +4 -0
  244. package/web/.next/server/chunks/ssr/_0ka_9elusb800._.js.map +1 -0
  245. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js +1 -1
  246. package/web/.next/server/chunks/ssr/_0pyd1_y7w8ngp._.js.map +1 -1
  247. package/web/.next/server/chunks/ssr/_0w2ptjht34s6t._.js +3 -0
  248. package/web/.next/server/chunks/ssr/_0w2ptjht34s6t._.js.map +1 -0
  249. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js +1 -1
  250. package/web/.next/server/chunks/ssr/_0xickgbbju_9-._.js.map +1 -1
  251. package/web/.next/server/chunks/ssr/_1_wav28san6dm._.js +1 -1
  252. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js +1 -1
  253. package/web/.next/server/chunks/ssr/_1pjtire7rqla0._.js.map +1 -1
  254. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js +1 -1
  255. package/web/.next/server/chunks/ssr/_1qbsmlji34yph._.js.map +1 -1
  256. package/web/.next/server/chunks/ssr/_1uuy6gkkhq6bx._.js +3 -0
  257. package/web/.next/server/chunks/ssr/_1uuy6gkkhq6bx._.js.map +1 -0
  258. package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js +3 -0
  259. package/web/.next/server/chunks/ssr/_1y1ovmdhl9_ml._.js.map +1 -0
  260. package/web/.next/server/chunks/ssr/node_modules_07sxnbglqc5q9._.js +3 -0
  261. package/web/.next/server/chunks/ssr/node_modules_07sxnbglqc5q9._.js.map +1 -0
  262. package/web/.next/server/chunks/ssr/node_modules_0_cxkn6vujxay._.js +3 -0
  263. package/web/.next/server/chunks/ssr/node_modules_0_cxkn6vujxay._.js.map +1 -0
  264. package/web/.next/server/chunks/ssr/node_modules_0qlo87g8tugr4._.js +3 -0
  265. package/web/.next/server/chunks/ssr/node_modules_0qlo87g8tugr4._.js.map +1 -0
  266. package/web/.next/server/chunks/ssr/node_modules_15ceu3jhtifcw._.js +3 -0
  267. package/web/.next/server/chunks/ssr/node_modules_15ceu3jhtifcw._.js.map +1 -0
  268. package/web/.next/server/chunks/ssr/node_modules_@aeolus-fleet_common_dist_header_1jvz31plyg2f-._.js +1 -1
  269. package/web/.next/server/chunks/ssr/node_modules_@aeolus-fleet_common_dist_header_1jvz31plyg2f-._.js.map +1 -1
  270. package/web/.next/server/chunks/ssr/node_modules_@base-ui_react_utils_FloatingPortalLite_mjs_1uzc1ezeugtex._.js +3 -0
  271. package/web/.next/server/chunks/ssr/node_modules_@base-ui_react_utils_FloatingPortalLite_mjs_1uzc1ezeugtex._.js.map +1 -0
  272. package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1s46s8vlfx01v.js +3 -0
  273. package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1s46s8vlfx01v.js.map +1 -0
  274. package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_20d8hq6wsqwh_.js +3 -0
  275. package/web/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_20d8hq6wsqwh_.js.map +1 -0
  276. package/web/.next/server/chunks/ssr/web_0-ufi2al5ubig._.js +1 -1
  277. package/web/.next/server/chunks/ssr/web_0-ufi2al5ubig._.js.map +1 -1
  278. package/web/.next/server/chunks/ssr/web_09zipglxee7tv._.js +3 -0
  279. package/web/.next/server/chunks/ssr/web_09zipglxee7tv._.js.map +1 -0
  280. package/web/.next/server/chunks/ssr/web_0v-7sowo0hupw._.js +1 -1
  281. package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js +1 -1
  282. package/web/.next/server/chunks/ssr/web_0wys4l6za8umr._.js.map +1 -1
  283. package/web/.next/server/chunks/ssr/web_1wcpaty_bz55q._.js +3 -0
  284. package/web/.next/server/chunks/ssr/web_1wcpaty_bz55q._.js.map +1 -0
  285. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js +1 -1
  286. package/web/.next/server/chunks/ssr/web__next-internal_server_app_(console)_overview_page_actions_18on1ziyg1nzy.js.map +1 -1
  287. package/web/.next/server/chunks/ssr/{web_features_0ahlkugj7fu3n._.js → web_features_0xbnkk4hfgr9v._.js} +2 -2
  288. package/web/.next/server/chunks/ssr/{web_features_0ahlkugj7fu3n._.js.map → web_features_0xbnkk4hfgr9v._.js.map} +1 -1
  289. package/web/.next/server/chunks/ssr/web_features_0xnlgtw8bfqaa._.js +1 -1
  290. package/web/.next/server/chunks/ssr/web_features_10xz3ojtvfi7h._.js +3 -0
  291. package/web/.next/server/chunks/ssr/web_features_10xz3ojtvfi7h._.js.map +1 -0
  292. package/web/.next/server/chunks/ssr/web_features_1_2m6l73qk7qw._.js +1 -1
  293. package/web/.next/server/chunks/ssr/web_features_1k6q2m0sl54-8._.js +3 -0
  294. package/web/.next/server/chunks/ssr/web_features_1k6q2m0sl54-8._.js.map +1 -0
  295. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js +1 -1
  296. package/web/.next/server/chunks/ssr/web_features_add-a2a-agent_ui_a2a-agent-form_tsx_0z8t1aalwzyl7._.js.map +1 -1
  297. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js +1 -1
  298. package/web/.next/server/chunks/ssr/web_features_add-a2a-client_ui_a2a-client-form_tsx_1anv88g385nwe._.js.map +1 -1
  299. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js +1 -1
  300. package/web/.next/server/chunks/ssr/web_features_add-server_ui_add-server_tsx_1jnmar5xju49k._.js.map +1 -1
  301. package/web/.next/server/chunks/ssr/web_features_forms_1u0akr22eh_x_._.js +3 -0
  302. package/web/.next/server/chunks/ssr/web_features_forms_1u0akr22eh_x_._.js.map +1 -0
  303. package/web/.next/server/chunks/ssr/web_features_frame_0pe8cwpxe1egb._.js +1 -1
  304. package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js +1 -1
  305. package/web/.next/server/chunks/ssr/web_features_frame_ui_gateway-header_tsx_0e9tekx4jf7ng._.js.map +1 -1
  306. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js +3 -0
  307. package/web/.next/server/chunks/ssr/web_features_meeting_state_meeting-controls_tsx_12g4kzk2mbvvz._.js.map +1 -0
  308. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js +1 -1
  309. package/web/.next/server/chunks/ssr/web_features_outside-parties_ui_switch-card_tsx_1_xnu9bm4tc-_._.js.map +1 -1
  310. package/web/.next/server/chunks/ssr/web_features_outside-party_0_9c27knfvw7u._.js +3 -0
  311. package/web/.next/server/chunks/ssr/web_features_outside-party_0_9c27knfvw7u._.js.map +1 -0
  312. package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js +1 -1
  313. package/web/.next/server/chunks/ssr/web_features_outside-party_actions_ts_102ar5pdowf8s._.js.map +1 -1
  314. package/web/.next/server/chunks/ssr/web_features_overview_0udx5lm8igils._.js +3 -0
  315. package/web/.next/server/chunks/ssr/{web_features_overview_16dyz2ngvs14b._.js.map → web_features_overview_0udx5lm8igils._.js.map} +1 -1
  316. package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js +1 -1
  317. package/web/.next/server/chunks/ssr/web_features_overview_hooks_overview-actions_ts_0-wrat07d1y5g._.js.map +1 -1
  318. package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js +1 -1
  319. package/web/.next/server/chunks/ssr/web_features_overview_state_1wuk95dw2_whp._.js.map +1 -1
  320. package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js +1 -1
  321. package/web/.next/server/chunks/ssr/web_features_overview_state_decision-panel_tsx_0kpd26ggtr6h_._.js.map +1 -1
  322. package/web/.next/server/chunks/ssr/web_features_overview_ui_10mb24kjiffea._.js +3 -0
  323. package/web/.next/server/chunks/ssr/web_features_overview_ui_10mb24kjiffea._.js.map +1 -0
  324. package/web/.next/server/chunks/ssr/web_features_parties_actions_ts_0r-tbfsig2ty-._.js +1 -1
  325. package/web/.next/server/middleware-build-manifest.js +27 -3
  326. package/web/.next/server/next-font-manifest.js +1 -1
  327. package/web/.next/server/next-font-manifest.json +8 -0
  328. package/web/.next/server/pages/500.html +1 -1
  329. package/web/.next/server/preview-props.json +3 -3
  330. package/web/.next/server/server-reference-manifest.js +1 -1
  331. package/web/.next/server/server-reference-manifest.json +76 -26
  332. package/web/.next/static/chunks/10wzmy096av_5.css +3 -0
  333. package/web/.next/static/chunks/{2_41h3v090ur9.js → 1ffk4chq_kmie.js} +1 -1
  334. package/web/.next/static/chunks/1nyfzf-d7kj96.js +1 -0
  335. package/web/.next/static/chunks/202avng4-d5jq.js +1 -0
  336. package/web/.next/static/chunks/{00njqo86bx2kb.js → 26kio8jl2dc6u.js} +1 -1
  337. package/web/.next/static/chunks/2cd4e71s711ad.js +1 -0
  338. package/web/.next/static/chunks/2i3ydqqupow_x.js +1 -0
  339. package/web/.next/static/chunks/2jvq5fses35mf.js +1 -0
  340. package/web/.next/static/chunks/2riya89_i0je8.js +1 -0
  341. package/web/.next/static/chunks/{31vy122d9fvme.js → 2sx1mxv2u71xx.js} +1 -1
  342. package/web/.next/static/chunks/3_pwm8b3mf4mf.js +1 -0
  343. package/web/.next/static/chunks/3f3s544ovqebz.js +1 -0
  344. package/web/.next/static/chunks/{2x00o45pdbkok.js → 3x_8doukmdfpu.js} +1 -1
  345. package/web/.next/static/chunks/{3apnqdh48__yw.js → 3yunex2p9do7t.js} +1 -1
  346. package/web/.next/static/chunks/{1aa1d23q1vokr.js → 40sj32h7okqjq.js} +1 -1
  347. package/web/.next/trace +1 -1
  348. package/web/.next/trace-build +1 -1
  349. package/web/.next/types/routes.d.ts +3 -1
  350. package/web/.next/types/validator.ts +34 -0
  351. package/dist/core/parties/switch-tool.d.ts +0 -29
  352. package/dist/core/parties/switch-tool.js +0 -33
  353. package/dist/core/parties/switch-tool.js.map +0 -1
  354. package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js +0 -3
  355. package/web/.next/server/chunks/ssr/[root-of-the-server]__0m57jyae0dn_7._.js.map +0 -1
  356. package/web/.next/server/chunks/ssr/[root-of-the-server]__11w36a4le04vy._.js.map +0 -1
  357. package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js +0 -3
  358. package/web/.next/server/chunks/ssr/[root-of-the-server]__1k25lo5ka4mgd._.js.map +0 -1
  359. package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js +0 -3
  360. package/web/.next/server/chunks/ssr/[root-of-the-server]__1yjb00o7x58xv._.js.map +0 -1
  361. package/web/.next/server/chunks/ssr/node_modules_0cyjln1rocvt5._.js +0 -3
  362. package/web/.next/server/chunks/ssr/node_modules_0cyjln1rocvt5._.js.map +0 -1
  363. package/web/.next/server/chunks/ssr/node_modules_1ins1z8o_qrka._.js +0 -3
  364. package/web/.next/server/chunks/ssr/node_modules_1ins1z8o_qrka._.js.map +0 -1
  365. package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js +0 -3
  366. package/web/.next/server/chunks/ssr/web_features_0i_kwiszuiqcp._.js.map +0 -1
  367. package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js +0 -3
  368. package/web/.next/server/chunks/ssr/web_features_1--8ungjj--ht._.js.map +0 -1
  369. package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js +0 -3
  370. package/web/.next/server/chunks/ssr/web_features_1qq_ruz59ldc9._.js.map +0 -1
  371. package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js +0 -3
  372. package/web/.next/server/chunks/ssr/web_features_forms_form-state_ts_2142hiopykfk1._.js.map +0 -1
  373. package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js +0 -3
  374. package/web/.next/server/chunks/ssr/web_features_outside-party_ui_20x5u9bhxeehi._.js.map +0 -1
  375. package/web/.next/server/chunks/ssr/web_features_overview_16dyz2ngvs14b._.js +0 -3
  376. package/web/.next/static/chunks/047i2x2j--shk.css +0 -3
  377. package/web/.next/static/chunks/0g4cpamshfwmn.js +0 -1
  378. package/web/.next/static/chunks/0j84uiid6fsim.js +0 -1
  379. package/web/.next/static/chunks/1ca21kggixrjz.js +0 -1
  380. package/web/.next/static/chunks/23ud2e13dn8f4.js +0 -1
  381. package/web/.next/static/chunks/3okm5g88ig1l3.js +0 -1
  382. /package/web/.next/static/{Az1CqrzgGHMZVR4nw9717 → JmnMsO8U6uK0nukLKdccI}/_buildManifest.js +0 -0
  383. /package/web/.next/static/{Az1CqrzgGHMZVR4nw9717 → JmnMsO8U6uK0nukLKdccI}/_clientMiddlewareManifest.js +0 -0
  384. /package/web/.next/static/{Az1CqrzgGHMZVR4nw9717 → JmnMsO8U6uK0nukLKdccI}/_ssgManifest.js +0 -0
@@ -0,0 +1,11 @@
1
+ export function micStandingOf(meeting, shipId) {
2
+ if (meeting.moderator.shipId === shipId) {
3
+ return { kind: 'moderating' };
4
+ }
5
+ if (meeting.mic.holder?.shipId === shipId) {
6
+ return { kind: 'holding' };
7
+ }
8
+ const index = meeting.mic.requests.findIndex(({ ship }) => ship.shipId === shipId);
9
+ return index < 0 ? { kind: 'none' } : { kind: 'requested', place: index + 1 };
10
+ }
11
+ //# sourceMappingURL=mic-standing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mic-standing.js","sourceRoot":"","sources":["../../../src/core/meetings/mic-standing.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,aAAa,CAAC,OAAoB,EAAE,MAAc;IAChE,IAAI,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;IAChC,CAAC;IACD,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;IACnF,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;AAChF,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * The meetings a person takes part in as their person ship (decision 0061,
3
+ * M19): the fleet's meeting calls the gateway makes as the ship's crew. Core
4
+ * holds the meeting and decides every call; the gateway reads and asks.
5
+ */
6
+ import type { MeetingId, MessageId, ShipId, ShipKind, ShipStatus } from '@aeolus-fleet/common';
7
+ import type { FleetRefusal } from '../connection/ports.js';
8
+ import type { Result } from '../shared/result.js';
9
+ /** A ship as a meeting names it. */
10
+ export interface MeetingShip {
11
+ readonly shipId: ShipId;
12
+ readonly name: string;
13
+ }
14
+ /** Whether a participant is in the meeting now, left it keeping its right to rejoin, or was revoked by the owner (M13). */
15
+ export type ParticipantState = 'present' | 'left' | 'revoked';
16
+ /** A participant: who it is, whether it is crewed now (M14), and whether it is in the meeting now. */
17
+ export interface MeetingParticipant extends MeetingShip {
18
+ readonly kind: ShipKind;
19
+ readonly status: ShipStatus;
20
+ readonly state: ParticipantState;
21
+ }
22
+ /** How the mic passes when it is free (M9): by the moderator's pick, or to the oldest request. */
23
+ export type MicPattern = 'moderator' | 'fifo';
24
+ /** The mic: who holds it, none while free; its pattern; and the requests, oldest first (M8). */
25
+ export interface MeetingMic {
26
+ readonly holder: MeetingShip | null;
27
+ readonly pattern: MicPattern;
28
+ readonly requests: readonly {
29
+ readonly ship: MeetingShip;
30
+ readonly requestedAt: Date;
31
+ }[];
32
+ }
33
+ /** One contribution, whole. */
34
+ export interface Contribution {
35
+ readonly messageId: MessageId;
36
+ readonly sender: MeetingShip;
37
+ readonly contentType: string;
38
+ readonly payload: string;
39
+ readonly sentAt: Date;
40
+ }
41
+ /** A meeting as the fleet reads it to a participant, with a page of its contributions, newest first. */
42
+ export interface MeetingRead {
43
+ readonly meetingId: MeetingId;
44
+ readonly title: string | null;
45
+ readonly owner: MeetingShip;
46
+ readonly moderator: MeetingShip;
47
+ readonly openedAt: Date;
48
+ readonly endedAt: Date | null;
49
+ readonly participants: readonly MeetingParticipant[];
50
+ readonly mic: MeetingMic;
51
+ readonly contributions: {
52
+ readonly items: readonly Contribution[];
53
+ readonly nextCursor: MessageId | null;
54
+ };
55
+ }
56
+ /** A participant's own mic calls (M8, M10): to request it, withdraw its request, and release the mic it holds. */
57
+ export type OwnMicChange = 'request' | 'withdraw' | 'release';
58
+ /** Outbound port: the fleet's meeting calls as the crew of a person ship. */
59
+ export interface PersonMeetingDoor {
60
+ /** The meeting and a page of its contributions after the cursor, newest first; refused for a meeting the ship takes no part in. */
61
+ meeting(crewToken: string, asked: {
62
+ meetingId: MeetingId;
63
+ cursor?: MessageId;
64
+ }): Promise<Result<MeetingRead, FleetRefusal>>;
65
+ /** Makes one of the ship's own mic calls; the fleet refuses one the meeting does not allow now and says why. */
66
+ changeMic(crewToken: string, asked: {
67
+ meetingId: MeetingId;
68
+ change: OwnMicChange;
69
+ }): Promise<Result<undefined, FleetRefusal>>;
70
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.js","sourceRoot":"","sources":["../../../src/core/meetings/ports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ import type { MeetingId, MessageId } from '@aeolus-fleet/common';
2
+ import type { CrewPersonShip } from '../people/crew-person-ship.js';
3
+ import { type PersonCaller, type PersonCrewError } from '../people/person-crew.js';
4
+ import type { PersonCrews } from '../people/ports.js';
5
+ import { type DomainError } from '../shared/errors.js';
6
+ import { type Result } from '../shared/result.js';
7
+ import { type MicStanding } from './mic-standing.js';
8
+ import type { MeetingRead, PersonMeetingDoor } from './ports.js';
9
+ /** A meeting as a person reads it: the fleet's read, and where they stand on its mic. */
10
+ export interface PersonMeeting {
11
+ readonly meeting: MeetingRead;
12
+ readonly mic: MicStanding;
13
+ }
14
+ export type ReadMeeting = (input: {
15
+ caller: PersonCaller;
16
+ meetingId: MeetingId;
17
+ cursor?: MessageId;
18
+ }) => Promise<Result<PersonMeeting, PersonCrewError | DomainError<'NO_SUCH_MEETING'>>>;
19
+ /**
20
+ * Use case: a person reads a meeting they take part in, as their person ship
21
+ * (decision 0061, M12, M19), with a page of its contributions, newest first.
22
+ * The fleet decides who reads it, so its refusal is passed on in its words.
23
+ * Reading acknowledges nothing: a contribution waits in the inbox until the
24
+ * person opens it.
25
+ */
26
+ export declare function createReadMeeting(deps: {
27
+ crewPersonShip: CrewPersonShip;
28
+ crews: PersonCrews;
29
+ door: PersonMeetingDoor;
30
+ }): ReadMeeting;
@@ -0,0 +1,26 @@
1
+ import { asPersonCrew, withOwnRefusal } from '../people/person-crew.js';
2
+ import { refuse } from '../shared/errors.js';
3
+ import { ok } from '../shared/result.js';
4
+ import { micStandingOf } from './mic-standing.js';
5
+ /**
6
+ * Use case: a person reads a meeting they take part in, as their person ship
7
+ * (decision 0061, M12, M19), with a page of its contributions, newest first.
8
+ * The fleet decides who reads it, so its refusal is passed on in its words.
9
+ * Reading acknowledges nothing: a contribution waits in the inbox until the
10
+ * person opens it.
11
+ */
12
+ export function createReadMeeting(deps) {
13
+ return async ({ caller, meetingId, cursor }) => {
14
+ const asked = cursor === undefined ? { meetingId } : { meetingId, cursor };
15
+ const read = await asPersonCrew(deps, { caller, run: (crew) => withOwnRefusal(deps.door.meeting(crew.crewToken, asked)) });
16
+ if (!read.isOk) {
17
+ return read;
18
+ }
19
+ const meeting = read.value.value;
20
+ if (!meeting.isOk) {
21
+ return refuse('NO_SUCH_MEETING', `The fleet did not read the meeting to you: ${meeting.error.message}`);
22
+ }
23
+ return ok({ meeting: meeting.value, mic: micStandingOf(meeting.value, read.value.crew.shipId) });
24
+ };
25
+ }
26
+ //# sourceMappingURL=read-meeting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-meeting.js","sourceRoot":"","sources":["../../../src/core/meetings/read-meeting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,cAAc,EAA2C,MAAM,0BAA0B,CAAC;AAEjH,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAe,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AAWpE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAqF;IACrH,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE;QAC7C,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QAC3E,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3H,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC,iBAAiB,EAAE,8CAA8C,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnG,CAAC,CAAC;AACJ,CAAC"}
@@ -1,16 +1,16 @@
1
- import type { FleetId, Scope } from '@aeolus-fleet/common';
1
+ import type { FleetId, ScopeName } from '@aeolus-fleet/common';
2
2
  import type { FleetRefusal } from '../connection/ports.js';
3
3
  import type { Result } from '../shared/result.js';
4
- /** A signed-in console session: argo's or a viewer's, with its ship's scopes, or an account's, with its account token's. */
4
+ /** A signed-in console session: argo's or a viewer's, with its ship's scopes, or an account's, with its account token's; the fleet's own scopes among them (gateway scopes 4.1). */
5
5
  export type ConsoleSession = {
6
6
  fleetId: FleetId;
7
7
  kind: 'operator' | 'viewer';
8
- scopes: readonly Scope[];
8
+ scopes: readonly ScopeName[];
9
9
  } | {
10
10
  fleetId: FleetId;
11
11
  kind: 'account';
12
12
  accountId: string;
13
- scopes: readonly Scope[];
13
+ scopes: readonly ScopeName[];
14
14
  };
15
15
  /**
16
16
  * Outbound port: asks the fleet whose a forwarded console session cookie is
@@ -25,7 +25,7 @@ export function createAddA2aAgent(deps) {
25
25
  if (!(await deps.servesOutsideParties(fleetId))) {
26
26
  return refuse('OUTSIDE_PARTIES_OFF', "This fleet's outside parties are off: turn them on first");
27
27
  }
28
- const statement = await readAgentStatement(deps, { name, cardUrl, isRepeatable: true });
28
+ const statement = await readAgentStatement(deps, { name, cardUrl, isRepeatable: true, scopes: [] });
29
29
  if (!statement.isOk) {
30
30
  return statement;
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"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AC,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;QACrI,OAAO,QAAQ,CAAgB,IAAI,EAAE;YACnC,OAAO;YACP,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE,OAAO;YACf,WAAW;YACX,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,YAAY,EAAE,IAAI,EAAE,GAAG,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;YAClL,KAAK,EAAE,CAAC,OAAO,EAA4B,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,UAAU;SAC1E,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { Actor } from '../actors/authenticate-actor.js';
2
+ import type { ActorCredential, CredentialOf } from '../actors/credential-of.js';
3
+ import type { ConnectionStore, GatewayCrew } from '../connection/ports.js';
4
+ import { type DomainError } from '../shared/errors.js';
5
+ import { type Result } from '../shared/result.js';
6
+ import type { A2aAgentParty, McpServerParty } from './party.js';
7
+ import type { PartyStore, ProxyShipsAsActor } from './ports.js';
8
+ export type ApprovingRefusal = DomainError<'NOT_AN_APPROVER' | 'NO_SUCH_PARTY' | 'PARTY_NOT_COMMISSIONED' | 'NOT_CONNECTED' | 'FLEET_UNAVAILABLE' | 'NOT_REACHABLE'>;
9
+ export type CheckApproving = (input: {
10
+ actor: Actor;
11
+ as: ActorCredential;
12
+ name: string;
13
+ }) => Promise<Result<undefined, ApprovingRefusal>>;
14
+ interface ApprovingDeps {
15
+ parties: PartyStore;
16
+ connections: Pick<ConnectionStore, 'find'>;
17
+ fleet: Pick<ProxyShipsAsActor, 'checkManage'>;
18
+ credentialOf: CredentialOf;
19
+ }
20
+ /**
21
+ * The outside MCP server or A2A agent an actor approves, with the gateway's
22
+ * connection: the actor holds gateway:approve, and the fleet, asked as the
23
+ * actor, answers that it manages the party's proxy ship (A2). The fleet
24
+ * records a refusal.
25
+ */
26
+ export declare function approvedParty(deps: ApprovingDeps, { actor, as, name }: Parameters<CheckApproving>[0]): Promise<Result<{
27
+ party: McpServerParty | A2aAgentParty;
28
+ gateway: GatewayCrew;
29
+ }, ApprovingRefusal>>;
30
+ /**
31
+ * Use case: whether an actor approves an outside MCP server or A2A agent
32
+ * (gateway scopes 4.3): the party's page shows its controls only then, and
33
+ * the same table read-only otherwise.
34
+ */
35
+ export declare function createCheckApproving(deps: ApprovingDeps): CheckApproving;
36
+ export {};
@@ -0,0 +1,48 @@
1
+ import { refuse } from '../shared/errors.js';
2
+ import { ok } from '../shared/result.js';
3
+ import { APPROVING_SCOPE } from './approver.js';
4
+ /**
5
+ * The outside MCP server or A2A agent an actor approves, with the gateway's
6
+ * connection: the actor holds gateway:approve, and the fleet, asked as the
7
+ * actor, answers that it manages the party's proxy ship (A2). The fleet
8
+ * records a refusal.
9
+ */
10
+ export async function approvedParty(deps, { actor, as, name }) {
11
+ if (!actor.scopes.includes(APPROVING_SCOPE)) {
12
+ return refuse('NOT_AN_APPROVER', `Setting the scopes an outside party needs takes ${APPROVING_SCOPE}`);
13
+ }
14
+ const party = await deps.parties.find(actor.fleetId, name);
15
+ if (party?.kind !== 'mcpServer' && party?.kind !== 'a2aAgent') {
16
+ return refuse('NO_SUCH_PARTY', `There is no outside MCP server or A2A agent ${name}`);
17
+ }
18
+ if (party.proxyShipId === null) {
19
+ return refuse('PARTY_NOT_COMMISSIONED', `${name}'s proxy ship is not commissioned yet`);
20
+ }
21
+ const gateway = await deps.connections.find(actor.fleetId);
22
+ if (gateway === undefined) {
23
+ return refuse('NOT_CONNECTED', 'The gateway is not connected to the fleet');
24
+ }
25
+ const credential = await deps.credentialOf(actor, as);
26
+ if (!credential.isOk) {
27
+ return credential;
28
+ }
29
+ const managed = await deps.fleet.checkManage(credential.value, { shipId: party.proxyShipId });
30
+ if (!managed.isOk) {
31
+ return managed.error.code === 'UNAVAILABLE'
32
+ ? refuse('FLEET_UNAVAILABLE', `The fleet did not say whether you manage ${name}: ${managed.error.message}`)
33
+ : refuse('NOT_REACHABLE', managed.error.message);
34
+ }
35
+ return ok({ party, gateway });
36
+ }
37
+ /**
38
+ * Use case: whether an actor approves an outside MCP server or A2A agent
39
+ * (gateway scopes 4.3): the party's page shows its controls only then, and
40
+ * the same table read-only otherwise.
41
+ */
42
+ export function createCheckApproving(deps) {
43
+ return async (input) => {
44
+ const approved = await approvedParty(deps, input);
45
+ return approved.isOk ? ok(undefined) : approved;
46
+ };
47
+ }
48
+ //# sourceMappingURL=check-approving.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-approving.js","sourceRoot":"","sources":["../../../src/core/parties/check-approving.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAe,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAehD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAmB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAiC;IACzG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QAC5C,OAAO,MAAM,CAAC,iBAAiB,EAAE,mDAAmD,eAAe,EAAE,CAAC,CAAC;IACzG,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3D,IAAI,KAAK,EAAE,IAAI,KAAK,WAAW,IAAI,KAAK,EAAE,IAAI,KAAK,UAAU,E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ACrB,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { FleetId, ShipId } from '@aeolus-fleet/common';
2
+ import type { ConnectionStore, FleetDoor } from '../connection/ports.js';
3
+ /**
4
+ * How checking a call's scopes ended:
5
+ * - holds: the calling ship holds every needed scope, so the call goes on;
6
+ * - lacks: it does not, and the message names what is missing (P2);
7
+ * - unread: core did not answer the read, so the call waits and is tried again, never made unchecked.
8
+ */
9
+ export type ScopeCheck = {
10
+ readonly kind: 'holds';
11
+ } | {
12
+ readonly kind: 'lacks';
13
+ readonly message: string;
14
+ } | {
15
+ readonly kind: 'unread';
16
+ };
17
+ export type CheckRequiredScopes = (call: {
18
+ fleetId: FleetId;
19
+ senderShipId: ShipId;
20
+ needing: string;
21
+ needed: readonly string[];
22
+ }) => Promise<ScopeCheck>;
23
+ /**
24
+ * Use case: whether the ship calling an outside party holds every scope the
25
+ * call needs (design gateway-scopes, 4.2). The gateway reads the ship's
26
+ * scopes from core as its own ship, on the calling ship's behalf so its read
27
+ * reach holds it, on every call and never from the message (decision 0057):
28
+ * a scope revoked holds at the next call (0046). A call that needs nothing
29
+ * reads nothing.
30
+ */
31
+ export declare function createCheckRequiredScopes(deps: {
32
+ connections: Pick<ConnectionStore, 'find'>;
33
+ door: Pick<FleetDoor, 'getShip'>;
34
+ }): CheckRequiredScopes;
@@ -0,0 +1,27 @@
1
+ import { lackingScopesMessage, scopesLacking } from './scope-requirements.js';
2
+ /**
3
+ * Use case: whether the ship calling an outside party holds every scope the
4
+ * call needs (design gateway-scopes, 4.2). The gateway reads the ship's
5
+ * scopes from core as its own ship, on the calling ship's behalf so its read
6
+ * reach holds it, on every call and never from the message (decision 0057):
7
+ * a scope revoked holds at the next call (0046). A call that needs nothing
8
+ * reads nothing.
9
+ */
10
+ export function createCheckRequiredScopes(deps) {
11
+ return async ({ fleetId, senderShipId, needing, needed }) => {
12
+ if (needed.length === 0) {
13
+ return { kind: 'holds' };
14
+ }
15
+ const gateway = await deps.connections.find(fleetId);
16
+ if (gateway === undefined) {
17
+ return { kind: 'unread' };
18
+ }
19
+ const ship = await deps.door.getShip(gateway.crewToken, { shipId: senderShipId, onBehalfOf: senderShipId });
20
+ if (!ship.isOk) {
21
+ return { kind: 'unread' };
22
+ }
23
+ const lacking = scopesLacking(needed, ship.value.scopes);
24
+ return lacking.length === 0 ? { kind: 'holds' } : { kind: 'lacks', message: lackingScopesMessage({ needing, lacking, shipName: ship.value.name }) };
25
+ };
26
+ }
27
+ //# sourceMappingURL=check-required-scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-required-scopes.js","sourceRoot":"","sources":["../../../src/core/parties/check-required-scopes.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAY9E;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAsF;IAC9H,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC1D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC5B,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC5B,CAAC;QACD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;IACtJ,CAAC,CAAC;AACJ,CAAC"}
@@ -3,6 +3,7 @@ import type { ActorCredential } from '../actors/credential-of.js';
3
3
  import type { FleetRefusal } from '../connection/ports.js';
4
4
  import type { Result } from '../shared/result.js';
5
5
  import type { Party } from './party.js';
6
+ import type { ScopeRequirements, ScopeRequirementsChange } from './scope-requirements.js';
6
7
  import type { FromFleet } from './shown-party.js';
7
8
  import type { ToolSwitches } from './tool-switches.js';
8
9
  /** Outbound port: the parties argo approved, one per proxy ship name in a fleet. */
@@ -29,6 +30,22 @@ export interface PartyStore {
29
30
  }): Promise<void>;
30
31
  remove(fleetId: FleetId, name: string): Promise<void>;
31
32
  }
33
+ /** Outbound port: each party's required scopes (design gateway-scopes, 4.2), kept with the party and gone with it. */
34
+ export interface ScopeRequirementsStore {
35
+ /** The party's requirements as they are now; none set yet is version 0, needing nothing. */
36
+ find(fleetId: FleetId, party: string): Promise<ScopeRequirements>;
37
+ /**
38
+ * Makes the change, all at once and only while the requirements are still
39
+ * at the version named: the requirements after, at the next version; none
40
+ * once another change moved them on.
41
+ */
42
+ change(party: {
43
+ fleetId: FleetId;
44
+ name: string;
45
+ }, change: ScopeRequirementsChange & {
46
+ version: number;
47
+ }): Promise<ScopeRequirements | undefined>;
48
+ }
32
49
  /** Outbound port: the fleet's calls the gateway makes for a party's proxy ship. */
33
50
  export interface ProxyShipDoor {
34
51
  /**
@@ -79,6 +96,10 @@ export interface ProxyShipsAsActor {
79
96
  }): Promise<Result<{
80
97
  scopes: string[];
81
98
  }, FleetRefusal>>;
99
+ /** Whether the actor manages the proxy ship now (fleet.checkManage, no scope): OK, or the fleet's refusal, which it records. */
100
+ checkManage(as: ActorCredential, ship: {
101
+ shipId: ShipId;
102
+ }): Promise<Result<undefined, FleetRefusal>>;
82
103
  }
83
104
  /** Outbound port: what the fleet holds for a proxy ship, read as the actor (fleet:read): its name, owner and scopes, only its name outside the actor's read reach. */
84
105
  export interface ProxyShipReads {
@@ -0,0 +1,17 @@
1
+ import type { Actor } from '../actors/authenticate-actor.js';
2
+ import type { ConnectionStore, FleetDoor, ListedScope } from '../connection/ports.js';
3
+ import { type DomainError } from '../shared/errors.js';
4
+ import { type Result } from '../shared/result.js';
5
+ export type ReadListedScopes = (input: {
6
+ actor: Actor;
7
+ }) => Promise<Result<ListedScope[], DomainError<'NOT_AN_APPROVER' | 'NOT_CONNECTED' | 'FLEET_UNAVAILABLE'>>>;
8
+ /**
9
+ * Use case: the scopes an approver may require of a calling ship (gateway
10
+ * scopes 4.3), every one the fleet lists now with its description, read as
11
+ * the gateway's ship as the change itself checks them. Only an approver
12
+ * picks them, so only an approver reads them.
13
+ */
14
+ export declare function createReadListedScopes(deps: {
15
+ connections: Pick<ConnectionStore, 'find'>;
16
+ door: Pick<FleetDoor, 'listScopes'>;
17
+ }): ReadListedScopes;
@@ -0,0 +1,23 @@
1
+ import { refuse } from '../shared/errors.js';
2
+ import { ok } from '../shared/result.js';
3
+ import { APPROVING_SCOPE } from './approver.js';
4
+ /**
5
+ * Use case: the scopes an approver may require of a calling ship (gateway
6
+ * scopes 4.3), every one the fleet lists now with its description, read as
7
+ * the gateway's ship as the change itself checks them. Only an approver
8
+ * picks them, so only an approver reads them.
9
+ */
10
+ export function createReadListedScopes(deps) {
11
+ return async ({ actor }) => {
12
+ if (!actor.scopes.includes(APPROVING_SCOPE)) {
13
+ return refuse('NOT_AN_APPROVER', `Reading the scopes to require takes ${APPROVING_SCOPE}`);
14
+ }
15
+ const gateway = await deps.connections.find(actor.fleetId);
16
+ if (gateway === undefined) {
17
+ return refuse('NOT_CONNECTED', 'The gateway is not connected to the fleet');
18
+ }
19
+ const listed = await deps.door.listScopes(gateway.crewToken);
20
+ return listed.isOk ? ok(listed.value) : refuse('FLEET_UNAVAILABLE', `The fleet did not say which scopes it lists: ${listed.error.message}`);
21
+ };
22
+ }
23
+ //# sourceMappingURL=read-listed-scopes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-listed-scopes.js","sourceRoot":"","sources":["../../../src/core/parties/read-listed-scopes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAe,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAyF;IAC9H,OAAO,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACzB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;YAC5C,OAAO,MAAM,CAAC,iBAAiB,EAAE,uCAAuC,eAAe,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,eAAe,EAAE,2CAA2C,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE,gDAAgD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9I,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { FleetId } from '@aeolus-fleet/common';
2
+ import { type DomainError } from '../shared/errors.js';
3
+ import { type Result } from '../shared/result.js';
4
+ import type { PartyStore, ScopeRequirementsStore } from './ports.js';
5
+ import type { ScopeRequirements } from './scope-requirements.js';
6
+ export type ReadScopeRequirements = (input: {
7
+ fleetId: FleetId;
8
+ name: string;
9
+ }) => Promise<Result<ScopeRequirements, DomainError<'NO_SUCH_PARTY'>>>;
10
+ /**
11
+ * Use case: which scopes an outside MCP server or A2A agent needs, and the
12
+ * version an approver changes them on (design gateway-scopes, 4.2). Anyone
13
+ * in the fleet reads them, as its tools are read.
14
+ */
15
+ export declare function createReadScopeRequirements(deps: {
16
+ parties: PartyStore;
17
+ requirements: ScopeRequirementsStore;
18
+ }): ReadScopeRequirements;
@@ -0,0 +1,17 @@
1
+ import { refuse } from '../shared/errors.js';
2
+ import { ok } from '../shared/result.js';
3
+ /**
4
+ * Use case: which scopes an outside MCP server or A2A agent needs, and the
5
+ * version an approver changes them on (design gateway-scopes, 4.2). Anyone
6
+ * in the fleet reads them, as its tools are read.
7
+ */
8
+ export function createReadScopeRequirements(deps) {
9
+ return async ({ fleetId, name }) => {
10
+ const party = await deps.parties.find(fleetId, name);
11
+ if (party?.kind !== 'mcpServer' && party?.kind !== 'a2aAgent') {
12
+ return refuse('NO_SUCH_PARTY', `There is no outside MCP server or A2A agent ${name}`);
13
+ }
14
+ return ok(await deps.requirements.find(fleetId, name));
15
+ };
16
+ }
17
+ //# sourceMappingURL=read-scope-requirements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-scope-requirements.js","sourceRoot":"","sources":["../../../src/core/parties/read-scope-requirements.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAoB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAe,MAAM,qBAAqB,CAAC;AAMtD;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,IAAmE;IAC7G,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrD,IAAI,KAAK,EAAE,IAAI,KAAK,WAAW,IAAI,KAAK,EAAE,IAAI,KAAK,UAAU,EAAE,CAAC;YAC9D,OAAO,MAAM,CAAC,eAAe,EAAE,+CAA+C,IAAI,EAAE,CAAC,CAAC;QACxF,CAAC;QACD,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACzD,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Which scopes a calling ship must hold to use an outside party (design
3
+ * gateway-scopes, 4.2): a set for the party as a whole, and for an outside
4
+ * MCP server a set per tool. A tool needs both sets, every scope in them
5
+ * (A5). A scope says what a ship may do; which party it reaches stays the
6
+ * network rules' (L1). Kept by scope text and tool name, never by a ship.
7
+ */
8
+ /** A party's required scopes, and the version they were changed to last, so two approvers never overwrite each other unseen. */
9
+ export interface ScopeRequirements {
10
+ readonly version: number;
11
+ /** What every call to the party needs; an A2A agent has only this set, as its messages name no tool (L26). */
12
+ readonly party: readonly string[];
13
+ /** What each tool needs beside the party's set, by tool name; a tool not named needs only the party's. */
14
+ readonly tools: ReadonlyMap<string, readonly string[]>;
15
+ }
16
+ /** A party with nothing required: every call needs only to reach it. */
17
+ export declare const NO_SCOPE_REQUIREMENTS: ScopeRequirements;
18
+ /** A change to a party's requirements: its own set when given, and each tool's set given, an empty one dropping the tool's. */
19
+ export interface ScopeRequirementsChange {
20
+ readonly party?: readonly string[];
21
+ readonly tools: ReadonlyMap<string, readonly string[]>;
22
+ }
23
+ /** The requirements after a change, at the next version. */
24
+ export declare function changedRequirements(kept: ScopeRequirements, change: ScopeRequirementsChange): ScopeRequirements;
25
+ /** Every scope a call needs: the party's set and the tool's own, each once; a party called as a whole (no tool) needs its set alone. */
26
+ export declare function scopesNeeded(requirements: ScopeRequirements, tool: string | null): string[];
27
+ /** The needed scopes the calling ship does not hold. */
28
+ export declare function scopesLacking(needed: readonly string[], held: readonly string[]): string[];
29
+ /** A refusal naming what is missing (P2): "update_lead needs crm:write-leads, which lead-scout does not hold". */
30
+ export declare function lackingScopesMessage(refused: {
31
+ needing: string;
32
+ lacking: readonly string[];
33
+ shipName: string;
34
+ }): string;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Which scopes a calling ship must hold to use an outside party (design
3
+ * gateway-scopes, 4.2): a set for the party as a whole, and for an outside
4
+ * MCP server a set per tool. A tool needs both sets, every scope in them
5
+ * (A5). A scope says what a ship may do; which party it reaches stays the
6
+ * network rules' (L1). Kept by scope text and tool name, never by a ship.
7
+ */
8
+ /** A party with nothing required: every call needs only to reach it. */
9
+ export const NO_SCOPE_REQUIREMENTS = { version: 0, party: [], tools: new Map() };
10
+ /** The requirements after a change, at the next version. */
11
+ export function changedRequirements(kept, change) {
12
+ const tools = new Map(kept.tools);
13
+ for (const [tool, scopes] of change.tools) {
14
+ if (scopes.length === 0) {
15
+ tools.delete(tool);
16
+ }
17
+ else {
18
+ tools.set(tool, scopes);
19
+ }
20
+ }
21
+ return { version: kept.version + 1, party: change.party ?? kept.party, tools };
22
+ }
23
+ /** Every scope a call needs: the party's set and the tool's own, each once; a party called as a whole (no tool) needs its set alone. */
24
+ export function scopesNeeded(requirements, tool) {
25
+ const own = tool === null ? [] : (requirements.tools.get(tool) ?? []);
26
+ return [...new Set([...requirements.party, ...own])];
27
+ }
28
+ /** The needed scopes the calling ship does not hold. */
29
+ export function scopesLacking(needed, held) {
30
+ return needed.filter((scope) => !held.includes(scope));
31
+ }
32
+ /** A refusal naming what is missing (P2): "update_lead needs crm:write-leads, which lead-scout does not hold". */
33
+ export function lackingScopesMessage(refused) {
34
+ const scopes = refused.lacking.length === 1 ? refused.lacking.join('') : `${refused.lacking.slice(0, -1).join(', ')} and ${refused.lacking.at(-1) ?? ''}`;
35
+ return `${refused.needing} needs ${scopes}, which ${refused.shipName} does not hold`;
36
+ }
37
+ //# sourceMappingURL=scope-requirements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope-requirements.js","sourceRoot":"","sources":["../../../src/core/parties/scope-requirements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,wEAAwE;AACxE,MAAM,CAAC,MAAM,qBAAqB,GAAsB,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;AAQpG,4DAA4D;AAC5D,MAAM,UAAU,mBAAmB,CAAC,IAAuB,EAAE,MAA+B;IAC1F,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;AACjF,CAAC;AAED,wIAAwI;AACxI,MAAM,UAAU,YAAY,CAAC,YAA+B,EAAE,IAAmB;IAC/E,MAAM,GAAG,GAAG,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,aAAa,CAAC,MAAyB,EAAE,IAAuB;IAC9E,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,kHAAkH;AAClH,MAAM,UAAU,oBAAoB,CAAC,OAA0E;IAC7G,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAC1J,OAAO,GAAG,OAAO,CAAC,OAAO,UAAU,MAAM,WAAW,OAAO,CAAC,QAAQ,gBAAgB,CAAC;AACvF,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { StateA2aAgent } from '../a2a-out/state-a2a-agent.js';
2
+ import type { Actor } from '../actors/authenticate-actor.js';
3
+ import type { ActorCredential, CredentialOf } from '../actors/credential-of.js';
4
+ import type { ConnectionStore, FleetDoor } from '../connection/ports.js';
5
+ import type { StateParty } from '../mcp-out/state-party.js';
6
+ import { type DomainError } from '../shared/errors.js';
7
+ import { type Result } from '../shared/result.js';
8
+ import type { PartyStore, ProxyShipsAsActor, ScopeRequirementsStore } from './ports.js';
9
+ import type { ScopeRequirements } from './scope-requirements.js';
10
+ export type SetScopeRequirementsRefusal = DomainError<'NOT_AN_APPROVER' | 'NO_SUCH_PARTY' | 'PARTY_NOT_COMMISSIONED' | 'NOT_REACHABLE' | 'NO_SUCH_TOOL' | 'NOT_CONNECTED' | 'FLEET_UNAVAILABLE' | 'SCOPE_NOT_LISTED' | 'CONFLICT'>;
11
+ export type SetScopeRequirements = (input: {
12
+ actor: Actor;
13
+ as: ActorCredential;
14
+ name: string;
15
+ /** The requirements' version the change was made on, as the approver read them. */
16
+ version: number;
17
+ party?: readonly string[];
18
+ tools: ReadonlyMap<string, readonly string[]>;
19
+ }) => Promise<Result<{
20
+ requirements: ScopeRequirements; /** Why the proxy ship's statement waits for its next one; none when the fleet sees the change now. */
21
+ statementRefusal: string | null;
22
+ }, SetScopeRequirementsRefusal>>;
23
+ /**
24
+ * Use case: an approver sets which scopes a calling ship needs (design
25
+ * gateway-scopes, 4.2, A2): for an outside MCP server the party's set and
26
+ * any tool's, for an outside A2A agent its set as a whole. The fleet, asked
27
+ * as the approver, must answer that it manages the proxy ship before
28
+ * anything changes, clearing included; it records a refusal. Every scope must
29
+ * be one the fleet lists now, core's, a plugin's or the fleet's own: any may
30
+ * be required (0016). The change is made only on the version the approver
31
+ * read, so two approvers never overwrite each other unseen. The change is
32
+ * kept first, so the check holds at once, then the proxy ship is stated
33
+ * anew with what each capability needs (P1); while it cannot be, the
34
+ * statement waits for its next one.
35
+ */
36
+ export declare function createSetScopeRequirements(deps: {
37
+ parties: PartyStore;
38
+ requirements: ScopeRequirementsStore;
39
+ connections: Pick<ConnectionStore, 'find'>;
40
+ door: Pick<FleetDoor, 'listScopes'>;
41
+ stateParty: StateParty;
42
+ stateA2aAgent: StateA2aAgent;
43
+ fleet: Pick<ProxyShipsAsActor, 'checkManage'>;
44
+ credentialOf: CredentialOf;
45
+ }): SetScopeRequirements;