@aeolus-fleet/gateway 0.0.0-stage → 0.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 (474) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +104 -2
  3. package/dist/adapters/crypto/call-keys.d.ts +7 -0
  4. package/dist/adapters/crypto/call-keys.js +18 -0
  5. package/dist/adapters/crypto/call-keys.js.map +1 -0
  6. package/dist/adapters/crypto/oauth-secrets.d.ts +3 -0
  7. package/dist/adapters/crypto/oauth-secrets.js +10 -0
  8. package/dist/adapters/crypto/oauth-secrets.js.map +1 -0
  9. package/dist/adapters/crypto/request-hasher.d.ts +3 -0
  10. package/dist/adapters/crypto/request-hasher.js +4 -0
  11. package/dist/adapters/crypto/request-hasher.js.map +1 -0
  12. package/dist/adapters/crypto/request-ids.d.ts +4 -0
  13. package/dist/adapters/crypto/request-ids.js +14 -0
  14. package/dist/adapters/crypto/request-ids.js.map +1 -0
  15. package/dist/adapters/crypto/sealer.d.ts +14 -0
  16. package/dist/adapters/crypto/sealer.js +41 -0
  17. package/dist/adapters/crypto/sealer.js.map +1 -0
  18. package/dist/adapters/crypto/ship-aliases.d.ts +7 -0
  19. package/dist/adapters/crypto/ship-aliases.js +19 -0
  20. package/dist/adapters/crypto/ship-aliases.js.map +1 -0
  21. package/dist/adapters/crypto/sign-in-seals.d.ts +7 -0
  22. package/dist/adapters/crypto/sign-in-seals.js +27 -0
  23. package/dist/adapters/crypto/sign-in-seals.js.map +1 -0
  24. package/dist/adapters/crypto/waiting-seals.d.ts +3 -0
  25. package/dist/adapters/crypto/waiting-seals.js +24 -0
  26. package/dist/adapters/crypto/waiting-seals.js.map +1 -0
  27. package/dist/adapters/fleet/console-sessions.d.ts +2 -0
  28. package/dist/adapters/fleet/console-sessions.js +23 -0
  29. package/dist/adapters/fleet/console-sessions.js.map +1 -0
  30. package/dist/adapters/fleet/core-version.d.ts +11 -0
  31. package/dist/adapters/fleet/core-version.js +59 -0
  32. package/dist/adapters/fleet/core-version.js.map +1 -0
  33. package/dist/adapters/fleet/fleet-network.d.ts +2 -0
  34. package/dist/adapters/fleet/fleet-network.js +44 -0
  35. package/dist/adapters/fleet/fleet-network.js.map +1 -0
  36. package/dist/adapters/fleet/rest-fleet-door.d.ts +14 -0
  37. package/dist/adapters/fleet/rest-fleet-door.js +189 -0
  38. package/dist/adapters/fleet/rest-fleet-door.js.map +1 -0
  39. package/dist/adapters/http/html.d.ts +15 -0
  40. package/dist/adapters/http/html.js +53 -0
  41. package/dist/adapters/http/html.js.map +1 -0
  42. package/dist/adapters/http/live.d.ts +29 -0
  43. package/dist/adapters/http/live.js +100 -0
  44. package/dist/adapters/http/live.js.map +1 -0
  45. package/dist/adapters/http/mcp-endpoint.d.ts +20 -0
  46. package/dist/adapters/http/mcp-endpoint.js +164 -0
  47. package/dist/adapters/http/mcp-endpoint.js.map +1 -0
  48. package/dist/adapters/http/mcp-task.d.ts +45 -0
  49. package/dist/adapters/http/mcp-task.js +35 -0
  50. package/dist/adapters/http/mcp-task.js.map +1 -0
  51. package/dist/adapters/http/oauth-routes.d.ts +35 -0
  52. package/dist/adapters/http/oauth-routes.js +305 -0
  53. package/dist/adapters/http/oauth-routes.js.map +1 -0
  54. package/dist/adapters/http/outside-parties-page.d.ts +6 -0
  55. package/dist/adapters/http/outside-parties-page.js +149 -0
  56. package/dist/adapters/http/outside-parties-page.js.map +1 -0
  57. package/dist/adapters/http/overview-page.d.ts +16 -0
  58. package/dist/adapters/http/overview-page.js +255 -0
  59. package/dist/adapters/http/overview-page.js.map +1 -0
  60. package/dist/adapters/http/parties-page.d.ts +6 -0
  61. package/dist/adapters/http/parties-page.js +141 -0
  62. package/dist/adapters/http/parties-page.js.map +1 -0
  63. package/dist/adapters/http/person-tools.d.ts +22 -0
  64. package/dist/adapters/http/person-tools.js +98 -0
  65. package/dist/adapters/http/person-tools.js.map +1 -0
  66. package/dist/adapters/http/signal.d.ts +52 -0
  67. package/dist/adapters/http/signal.js +220 -0
  68. package/dist/adapters/http/signal.js.map +1 -0
  69. package/dist/adapters/http/version.d.ts +6 -0
  70. package/dist/adapters/http/version.js +12 -0
  71. package/dist/adapters/http/version.js.map +1 -0
  72. package/dist/adapters/mcp/mcp-servers.d.ts +2 -0
  73. package/dist/adapters/mcp/mcp-servers.js +154 -0
  74. package/dist/adapters/mcp/mcp-servers.js.map +1 -0
  75. package/dist/adapters/oauth/client-metadata-documents.d.ts +9 -0
  76. package/dist/adapters/oauth/client-metadata-documents.js +25 -0
  77. package/dist/adapters/oauth/client-metadata-documents.js.map +1 -0
  78. package/dist/adapters/pagasae/pagasae-client.d.ts +8 -0
  79. package/dist/adapters/pagasae/pagasae-client.js +90 -0
  80. package/dist/adapters/pagasae/pagasae-client.js.map +1 -0
  81. package/dist/adapters/prisma/account-grants.d.ts +4 -0
  82. package/dist/adapters/prisma/account-grants.js +27 -0
  83. package/dist/adapters/prisma/account-grants.js.map +1 -0
  84. package/dist/adapters/prisma/calls.d.ts +4 -0
  85. package/dist/adapters/prisma/calls.js +35 -0
  86. package/dist/adapters/prisma/calls.js.map +1 -0
  87. package/dist/adapters/prisma/changes.d.ts +21 -0
  88. package/dist/adapters/prisma/changes.js +86 -0
  89. package/dist/adapters/prisma/changes.js.map +1 -0
  90. package/dist/adapters/prisma/client-calls.d.ts +4 -0
  91. package/dist/adapters/prisma/client-calls.js +50 -0
  92. package/dist/adapters/prisma/client-calls.js.map +1 -0
  93. package/dist/adapters/prisma/client.d.ts +8 -0
  94. package/dist/adapters/prisma/client.js +11 -0
  95. package/dist/adapters/prisma/client.js.map +1 -0
  96. package/dist/adapters/prisma/connection-store.d.ts +4 -0
  97. package/dist/adapters/prisma/connection-store.js +28 -0
  98. package/dist/adapters/prisma/connection-store.js.map +1 -0
  99. package/dist/adapters/prisma/fleet-forgetter.d.ts +4 -0
  100. package/dist/adapters/prisma/fleet-forgetter.js +10 -0
  101. package/dist/adapters/prisma/fleet-forgetter.js.map +1 -0
  102. package/dist/adapters/prisma/fleet-switches.d.ts +4 -0
  103. package/dist/adapters/prisma/fleet-switches.js +10 -0
  104. package/dist/adapters/prisma/fleet-switches.js.map +1 -0
  105. package/dist/adapters/prisma/generated/browser.d.ts +108 -0
  106. package/dist/adapters/prisma/generated/browser.js +18 -0
  107. package/dist/adapters/prisma/generated/browser.js.map +1 -0
  108. package/dist/adapters/prisma/generated/client.d.ts +127 -0
  109. package/dist/adapters/prisma/generated/client.js +38 -0
  110. package/dist/adapters/prisma/generated/client.js.map +1 -0
  111. package/dist/adapters/prisma/generated/commonInputTypes.d.ts +490 -0
  112. package/dist/adapters/prisma/generated/commonInputTypes.js +11 -0
  113. package/dist/adapters/prisma/generated/commonInputTypes.js.map +1 -0
  114. package/dist/adapters/prisma/generated/enums.d.ts +1 -0
  115. package/dist/adapters/prisma/generated/enums.js +12 -0
  116. package/dist/adapters/prisma/generated/enums.js.map +1 -0
  117. package/dist/adapters/prisma/generated/internal/class.d.ts +319 -0
  118. package/dist/adapters/prisma/generated/internal/class.js +50 -0
  119. package/dist/adapters/prisma/generated/internal/class.js.map +1 -0
  120. package/dist/adapters/prisma/generated/internal/prismaNamespace.d.ts +2102 -0
  121. package/dist/adapters/prisma/generated/internal/prismaNamespace.js +294 -0
  122. package/dist/adapters/prisma/generated/internal/prismaNamespace.js.map +1 -0
  123. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.d.ts +273 -0
  124. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js +264 -0
  125. package/dist/adapters/prisma/generated/internal/prismaNamespaceBrowser.js.map +1 -0
  126. package/dist/adapters/prisma/generated/models/AccountGrant.d.ts +1056 -0
  127. package/dist/adapters/prisma/generated/models/AccountGrant.js +2 -0
  128. package/dist/adapters/prisma/generated/models/AccountGrant.js.map +1 -0
  129. package/dist/adapters/prisma/generated/models/AuthorizationCode.d.ts +1171 -0
  130. package/dist/adapters/prisma/generated/models/AuthorizationCode.js +2 -0
  131. package/dist/adapters/prisma/generated/models/AuthorizationCode.js.map +1 -0
  132. package/dist/adapters/prisma/generated/models/Call.d.ts +994 -0
  133. package/dist/adapters/prisma/generated/models/Call.js +2 -0
  134. package/dist/adapters/prisma/generated/models/Call.js.map +1 -0
  135. package/dist/adapters/prisma/generated/models/ClientCall.d.ts +1119 -0
  136. package/dist/adapters/prisma/generated/models/ClientCall.js +2 -0
  137. package/dist/adapters/prisma/generated/models/ClientCall.js.map +1 -0
  138. package/dist/adapters/prisma/generated/models/ClientCallReply.d.ts +1129 -0
  139. package/dist/adapters/prisma/generated/models/ClientCallReply.js +2 -0
  140. package/dist/adapters/prisma/generated/models/ClientCallReply.js.map +1 -0
  141. package/dist/adapters/prisma/generated/models/Connection.d.ts +1011 -0
  142. package/dist/adapters/prisma/generated/models/Connection.js +2 -0
  143. package/dist/adapters/prisma/generated/models/Connection.js.map +1 -0
  144. package/dist/adapters/prisma/generated/models/FleetSwitch.d.ts +945 -0
  145. package/dist/adapters/prisma/generated/models/FleetSwitch.js +2 -0
  146. package/dist/adapters/prisma/generated/models/FleetSwitch.js.map +1 -0
  147. package/dist/adapters/prisma/generated/models/InstallationRequest.d.ts +1030 -0
  148. package/dist/adapters/prisma/generated/models/InstallationRequest.js +2 -0
  149. package/dist/adapters/prisma/generated/models/InstallationRequest.js.map +1 -0
  150. package/dist/adapters/prisma/generated/models/IssuedToken.d.ts +1224 -0
  151. package/dist/adapters/prisma/generated/models/IssuedToken.js +2 -0
  152. package/dist/adapters/prisma/generated/models/IssuedToken.js.map +1 -0
  153. package/dist/adapters/prisma/generated/models/OAuthClient.d.ts +1005 -0
  154. package/dist/adapters/prisma/generated/models/OAuthClient.js +2 -0
  155. package/dist/adapters/prisma/generated/models/OAuthClient.js.map +1 -0
  156. package/dist/adapters/prisma/generated/models/OpenedDelivery.d.ts +1087 -0
  157. package/dist/adapters/prisma/generated/models/OpenedDelivery.js +2 -0
  158. package/dist/adapters/prisma/generated/models/OpenedDelivery.js.map +1 -0
  159. package/dist/adapters/prisma/generated/models/OutsidePartySwitch.d.ts +942 -0
  160. package/dist/adapters/prisma/generated/models/OutsidePartySwitch.js +2 -0
  161. package/dist/adapters/prisma/generated/models/OutsidePartySwitch.js.map +1 -0
  162. package/dist/adapters/prisma/generated/models/OwnerQuestion.d.ts +1035 -0
  163. package/dist/adapters/prisma/generated/models/OwnerQuestion.js +2 -0
  164. package/dist/adapters/prisma/generated/models/OwnerQuestion.js.map +1 -0
  165. package/dist/adapters/prisma/generated/models/Party.d.ts +1338 -0
  166. package/dist/adapters/prisma/generated/models/Party.js +2 -0
  167. package/dist/adapters/prisma/generated/models/Party.js.map +1 -0
  168. package/dist/adapters/prisma/generated/models/PendingRequest.d.ts +1252 -0
  169. package/dist/adapters/prisma/generated/models/PendingRequest.js +2 -0
  170. package/dist/adapters/prisma/generated/models/PendingRequest.js.map +1 -0
  171. package/dist/adapters/prisma/generated/models/PersonCrew.d.ts +974 -0
  172. package/dist/adapters/prisma/generated/models/PersonCrew.js +2 -0
  173. package/dist/adapters/prisma/generated/models/PersonCrew.js.map +1 -0
  174. package/dist/adapters/prisma/generated/models/RequestOutcomeNotice.d.ts +1120 -0
  175. package/dist/adapters/prisma/generated/models/RequestOutcomeNotice.js +2 -0
  176. package/dist/adapters/prisma/generated/models/RequestOutcomeNotice.js.map +1 -0
  177. package/dist/adapters/prisma/generated/models/ToolMark.d.ts +947 -0
  178. package/dist/adapters/prisma/generated/models/ToolMark.js +2 -0
  179. package/dist/adapters/prisma/generated/models/ToolMark.js.map +1 -0
  180. package/dist/adapters/prisma/generated/models.d.ts +19 -0
  181. package/dist/adapters/prisma/generated/models.js +2 -0
  182. package/dist/adapters/prisma/generated/models.js.map +1 -0
  183. package/dist/adapters/prisma/installation-requests.d.ts +4 -0
  184. package/dist/adapters/prisma/installation-requests.js +25 -0
  185. package/dist/adapters/prisma/installation-requests.js.map +1 -0
  186. package/dist/adapters/prisma/migrate.d.ts +5 -0
  187. package/dist/adapters/prisma/migrate.js +53 -0
  188. package/dist/adapters/prisma/migrate.js.map +1 -0
  189. package/dist/adapters/prisma/oauth-stores.d.ts +5 -0
  190. package/dist/adapters/prisma/oauth-stores.js +82 -0
  191. package/dist/adapters/prisma/oauth-stores.js.map +1 -0
  192. package/dist/adapters/prisma/opened-deliveries.d.ts +4 -0
  193. package/dist/adapters/prisma/opened-deliveries.js +29 -0
  194. package/dist/adapters/prisma/opened-deliveries.js.map +1 -0
  195. package/dist/adapters/prisma/outcome-notices.d.ts +4 -0
  196. package/dist/adapters/prisma/outcome-notices.js +24 -0
  197. package/dist/adapters/prisma/outcome-notices.js.map +1 -0
  198. package/dist/adapters/prisma/outside-party-switches.d.ts +4 -0
  199. package/dist/adapters/prisma/outside-party-switches.js +10 -0
  200. package/dist/adapters/prisma/outside-party-switches.js.map +1 -0
  201. package/dist/adapters/prisma/owner-questions.d.ts +8 -0
  202. package/dist/adapters/prisma/owner-questions.js +54 -0
  203. package/dist/adapters/prisma/owner-questions.js.map +1 -0
  204. package/dist/adapters/prisma/party-store.d.ts +7 -0
  205. package/dist/adapters/prisma/party-store.js +73 -0
  206. package/dist/adapters/prisma/party-store.js.map +1 -0
  207. package/dist/adapters/prisma/pending-requests.d.ts +11 -0
  208. package/dist/adapters/prisma/pending-requests.js +122 -0
  209. package/dist/adapters/prisma/pending-requests.js.map +1 -0
  210. package/dist/adapters/prisma/person-crews.d.ts +4 -0
  211. package/dist/adapters/prisma/person-crews.js +18 -0
  212. package/dist/adapters/prisma/person-crews.js.map +1 -0
  213. package/dist/adapters/prisma/tool-marks.d.ts +4 -0
  214. package/dist/adapters/prisma/tool-marks.js +15 -0
  215. package/dist/adapters/prisma/tool-marks.js.map +1 -0
  216. package/dist/adapters/timers/sleep.d.ts +3 -0
  217. package/dist/adapters/timers/sleep.js +11 -0
  218. package/dist/adapters/timers/sleep.js.map +1 -0
  219. package/dist/adapters/trpc/router.d.ts +408 -0
  220. package/dist/adapters/trpc/router.js +367 -0
  221. package/dist/adapters/trpc/router.js.map +1 -0
  222. package/dist/app.d.ts +43 -0
  223. package/dist/app.js +400 -0
  224. package/dist/app.js.map +1 -0
  225. package/dist/bin/aeolus-gateway.d.ts +2 -0
  226. package/dist/bin/aeolus-gateway.js +65 -0
  227. package/dist/bin/aeolus-gateway.js.map +1 -0
  228. package/dist/config.d.ts +41 -0
  229. package/dist/config.js +65 -0
  230. package/dist/config.js.map +1 -0
  231. package/dist/core/actors/authenticate-actor.d.ts +38 -0
  232. package/dist/core/actors/authenticate-actor.js +30 -0
  233. package/dist/core/actors/authenticate-actor.js.map +1 -0
  234. package/dist/core/connection/connect.d.ts +26 -0
  235. package/dist/core/connection/connect.js +57 -0
  236. package/dist/core/connection/connect.js.map +1 -0
  237. package/dist/core/connection/ports.d.ts +87 -0
  238. package/dist/core/connection/ports.js +2 -0
  239. package/dist/core/connection/ports.js.map +1 -0
  240. package/dist/core/connection/read-connection.d.ts +14 -0
  241. package/dist/core/connection/read-connection.js +24 -0
  242. package/dist/core/connection/read-connection.js.map +1 -0
  243. package/dist/core/installation/delete-fleet.d.ts +21 -0
  244. package/dist/core/installation/delete-fleet.js +21 -0
  245. package/dist/core/installation/delete-fleet.js.map +1 -0
  246. package/dist/core/installation/ports.d.ts +43 -0
  247. package/dist/core/installation/ports.js +2 -0
  248. package/dist/core/installation/ports.js.map +1 -0
  249. package/dist/core/installation/read-fleet.d.ts +18 -0
  250. package/dist/core/installation/read-fleet.js +9 -0
  251. package/dist/core/installation/read-fleet.js.map +1 -0
  252. package/dist/core/installation/request-id.d.ts +8 -0
  253. package/dist/core/installation/request-id.js +10 -0
  254. package/dist/core/installation/request-id.js.map +1 -0
  255. package/dist/core/installation/served.d.ts +12 -0
  256. package/dist/core/installation/served.js +8 -0
  257. package/dist/core/installation/served.js.map +1 -0
  258. package/dist/core/installation/set-fleet-enabled.d.ts +25 -0
  259. package/dist/core/installation/set-fleet-enabled.js +22 -0
  260. package/dist/core/installation/set-fleet-enabled.js.map +1 -0
  261. package/dist/core/mcp-in/call-tool.d.ts +42 -0
  262. package/dist/core/mcp-in/call-tool.js +82 -0
  263. package/dist/core/mcp-in/call-tool.js.map +1 -0
  264. package/dist/core/mcp-in/client-call.d.ts +51 -0
  265. package/dist/core/mcp-in/client-call.js +39 -0
  266. package/dist/core/mcp-in/client-call.js.map +1 -0
  267. package/dist/core/mcp-in/collect-replies.d.ts +29 -0
  268. package/dist/core/mcp-in/collect-replies.js +44 -0
  269. package/dist/core/mcp-in/collect-replies.js.map +1 -0
  270. package/dist/core/mcp-in/list-tools.d.ts +44 -0
  271. package/dist/core/mcp-in/list-tools.js +70 -0
  272. package/dist/core/mcp-in/list-tools.js.map +1 -0
  273. package/dist/core/mcp-in/ports.d.ts +85 -0
  274. package/dist/core/mcp-in/ports.js +2 -0
  275. package/dist/core/mcp-in/ports.js.map +1 -0
  276. package/dist/core/mcp-in/read-client-call.d.ts +23 -0
  277. package/dist/core/mcp-in/read-client-call.js +15 -0
  278. package/dist/core/mcp-in/read-client-call.js.map +1 -0
  279. package/dist/core/mcp-out/content-types.d.ts +12 -0
  280. package/dist/core/mcp-out/content-types.js +28 -0
  281. package/dist/core/mcp-out/content-types.js.map +1 -0
  282. package/dist/core/mcp-out/hand-call.d.ts +103 -0
  283. package/dist/core/mcp-out/hand-call.js +116 -0
  284. package/dist/core/mcp-out/hand-call.js.map +1 -0
  285. package/dist/core/mcp-out/mark-tool.d.ts +20 -0
  286. package/dist/core/mcp-out/mark-tool.js +17 -0
  287. package/dist/core/mcp-out/mark-tool.js.map +1 -0
  288. package/dist/core/mcp-out/ports.d.ts +66 -0
  289. package/dist/core/mcp-out/ports.js +2 -0
  290. package/dist/core/mcp-out/ports.js.map +1 -0
  291. package/dist/core/mcp-out/run-party.d.ts +26 -0
  292. package/dist/core/mcp-out/run-party.js +62 -0
  293. package/dist/core/mcp-out/run-party.js.map +1 -0
  294. package/dist/core/mcp-out/state-party.d.ts +38 -0
  295. package/dist/core/mcp-out/state-party.js +30 -0
  296. package/dist/core/mcp-out/state-party.js.map +1 -0
  297. package/dist/core/mcp-out/statement.d.ts +26 -0
  298. package/dist/core/mcp-out/statement.js +32 -0
  299. package/dist/core/mcp-out/statement.js.map +1 -0
  300. package/dist/core/oauth/authenticate-access-token.d.ts +25 -0
  301. package/dist/core/oauth/authenticate-access-token.js +19 -0
  302. package/dist/core/oauth/authenticate-access-token.js.map +1 -0
  303. package/dist/core/oauth/exchange-token.d.ts +32 -0
  304. package/dist/core/oauth/exchange-token.js +98 -0
  305. package/dist/core/oauth/exchange-token.js.map +1 -0
  306. package/dist/core/oauth/issue-code.d.ts +23 -0
  307. package/dist/core/oauth/issue-code.js +34 -0
  308. package/dist/core/oauth/issue-code.js.map +1 -0
  309. package/dist/core/oauth/ports.d.ts +103 -0
  310. package/dist/core/oauth/ports.js +2 -0
  311. package/dist/core/oauth/ports.js.map +1 -0
  312. package/dist/core/oauth/read-authorization.d.ts +43 -0
  313. package/dist/core/oauth/read-authorization.js +74 -0
  314. package/dist/core/oauth/read-authorization.js.map +1 -0
  315. package/dist/core/oauth/redirect-uri.d.ts +6 -0
  316. package/dist/core/oauth/redirect-uri.js +20 -0
  317. package/dist/core/oauth/redirect-uri.js.map +1 -0
  318. package/dist/core/oauth/register-client.d.ts +22 -0
  319. package/dist/core/oauth/register-client.js +20 -0
  320. package/dist/core/oauth/register-client.js.map +1 -0
  321. package/dist/core/operator/authenticate-operator.d.ts +22 -0
  322. package/dist/core/operator/authenticate-operator.js +26 -0
  323. package/dist/core/operator/authenticate-operator.js.map +1 -0
  324. package/dist/core/operator/ports.d.ts +15 -0
  325. package/dist/core/operator/ports.js +2 -0
  326. package/dist/core/operator/ports.js.map +1 -0
  327. package/dist/core/outside-parties/ports.d.ts +21 -0
  328. package/dist/core/outside-parties/ports.js +2 -0
  329. package/dist/core/outside-parties/ports.js.map +1 -0
  330. package/dist/core/outside-parties/set-outside-parties.d.ts +34 -0
  331. package/dist/core/outside-parties/set-outside-parties.js +34 -0
  332. package/dist/core/outside-parties/set-outside-parties.js.map +1 -0
  333. package/dist/core/parties/approve-party.d.ts +55 -0
  334. package/dist/core/parties/approve-party.js +111 -0
  335. package/dist/core/parties/approve-party.js.map +1 -0
  336. package/dist/core/parties/crew-party.d.ts +21 -0
  337. package/dist/core/parties/crew-party.js +29 -0
  338. package/dist/core/parties/crew-party.js.map +1 -0
  339. package/dist/core/parties/list-parties.d.ts +8 -0
  340. package/dist/core/parties/list-parties.js +8 -0
  341. package/dist/core/parties/list-parties.js.map +1 -0
  342. package/dist/core/parties/party.d.ts +46 -0
  343. package/dist/core/parties/party.js +2 -0
  344. package/dist/core/parties/party.js.map +1 -0
  345. package/dist/core/parties/ports.d.ts +39 -0
  346. package/dist/core/parties/ports.js +2 -0
  347. package/dist/core/parties/ports.js.map +1 -0
  348. package/dist/core/parties/shown-party.d.ts +21 -0
  349. package/dist/core/parties/shown-party.js +10 -0
  350. package/dist/core/parties/shown-party.js.map +1 -0
  351. package/dist/core/people/answer-delivery.d.ts +24 -0
  352. package/dist/core/people/answer-delivery.js +28 -0
  353. package/dist/core/people/answer-delivery.js.map +1 -0
  354. package/dist/core/people/crew-person-ship.d.ts +42 -0
  355. package/dist/core/people/crew-person-ship.js +59 -0
  356. package/dist/core/people/crew-person-ship.js.map +1 -0
  357. package/dist/core/people/done-delivery.d.ts +16 -0
  358. package/dist/core/people/done-delivery.js +9 -0
  359. package/dist/core/people/done-delivery.js.map +1 -0
  360. package/dist/core/people/inbox-entry.d.ts +14 -0
  361. package/dist/core/people/inbox-entry.js +11 -0
  362. package/dist/core/people/inbox-entry.js.map +1 -0
  363. package/dist/core/people/open-delivery.d.ts +30 -0
  364. package/dist/core/people/open-delivery.js +40 -0
  365. package/dist/core/people/open-delivery.js.map +1 -0
  366. package/dist/core/people/opened-of.d.ts +29 -0
  367. package/dist/core/people/opened-of.js +30 -0
  368. package/dist/core/people/opened-of.js.map +1 -0
  369. package/dist/core/people/person-crew.d.ts +39 -0
  370. package/dist/core/people/person-crew.js +61 -0
  371. package/dist/core/people/person-crew.js.map +1 -0
  372. package/dist/core/people/ports.d.ts +102 -0
  373. package/dist/core/people/ports.js +2 -0
  374. package/dist/core/people/ports.js.map +1 -0
  375. package/dist/core/people/read-inbox.d.ts +37 -0
  376. package/dist/core/people/read-inbox.js +36 -0
  377. package/dist/core/people/read-inbox.js.map +1 -0
  378. package/dist/core/requests/ask-for-client.d.ts +45 -0
  379. package/dist/core/requests/ask-for-client.js +33 -0
  380. package/dist/core/requests/ask-for-client.js.map +1 -0
  381. package/dist/core/requests/ask-for-server.d.ts +32 -0
  382. package/dist/core/requests/ask-for-server.js +42 -0
  383. package/dist/core/requests/ask-for-server.js.map +1 -0
  384. package/dist/core/requests/ask-owners.d.ts +28 -0
  385. package/dist/core/requests/ask-owners.js +85 -0
  386. package/dist/core/requests/ask-owners.js.map +1 -0
  387. package/dist/core/requests/decide-request.d.ts +53 -0
  388. package/dist/core/requests/decide-request.js +75 -0
  389. package/dist/core/requests/decide-request.js.map +1 -0
  390. package/dist/core/requests/expire-requests.d.ts +14 -0
  391. package/dist/core/requests/expire-requests.js +21 -0
  392. package/dist/core/requests/expire-requests.js.map +1 -0
  393. package/dist/core/requests/list-to-decide.d.ts +11 -0
  394. package/dist/core/requests/list-to-decide.js +13 -0
  395. package/dist/core/requests/list-to-decide.js.map +1 -0
  396. package/dist/core/requests/open-request.d.ts +21 -0
  397. package/dist/core/requests/open-request.js +26 -0
  398. package/dist/core/requests/open-request.js.map +1 -0
  399. package/dist/core/requests/outcome-notice.d.ts +13 -0
  400. package/dist/core/requests/outcome-notice.js +26 -0
  401. package/dist/core/requests/outcome-notice.js.map +1 -0
  402. package/dist/core/requests/ports.d.ts +186 -0
  403. package/dist/core/requests/ports.js +2 -0
  404. package/dist/core/requests/ports.js.map +1 -0
  405. package/dist/core/requests/read-waiting.d.ts +46 -0
  406. package/dist/core/requests/read-waiting.js +41 -0
  407. package/dist/core/requests/read-waiting.js.map +1 -0
  408. package/dist/core/requests/request-state.d.ts +5 -0
  409. package/dist/core/requests/request-state.js +10 -0
  410. package/dist/core/requests/request-state.js.map +1 -0
  411. package/dist/core/requests/tell-outcomes.d.ts +24 -0
  412. package/dist/core/requests/tell-outcomes.js +39 -0
  413. package/dist/core/requests/tell-outcomes.js.map +1 -0
  414. package/dist/core/requests/watch-waiting.d.ts +32 -0
  415. package/dist/core/requests/watch-waiting.js +31 -0
  416. package/dist/core/requests/watch-waiting.js.map +1 -0
  417. package/dist/core/shared/clock.d.ts +4 -0
  418. package/dist/core/shared/clock.js +2 -0
  419. package/dist/core/shared/clock.js.map +1 -0
  420. package/dist/core/shared/errors.d.ts +10 -0
  421. package/dist/core/shared/errors.js +6 -0
  422. package/dist/core/shared/errors.js.map +1 -0
  423. package/dist/core/shared/result.d.ts +16 -0
  424. package/dist/core/shared/result.js +7 -0
  425. package/dist/core/shared/result.js.map +1 -0
  426. package/dist/core/sign-in/account-token.d.ts +38 -0
  427. package/dist/core/sign-in/account-token.js +46 -0
  428. package/dist/core/sign-in/account-token.js.map +1 -0
  429. package/dist/core/sign-in/complete-sign-in.d.ts +55 -0
  430. package/dist/core/sign-in/complete-sign-in.js +50 -0
  431. package/dist/core/sign-in/complete-sign-in.js.map +1 -0
  432. package/dist/core/sign-in/end-sign-ins.d.ts +19 -0
  433. package/dist/core/sign-in/end-sign-ins.js +17 -0
  434. package/dist/core/sign-in/end-sign-ins.js.map +1 -0
  435. package/dist/core/sign-in/ports.d.ts +85 -0
  436. package/dist/core/sign-in/ports.js +2 -0
  437. package/dist/core/sign-in/ports.js.map +1 -0
  438. package/dist/core/sign-in/start-sign-in.d.ts +30 -0
  439. package/dist/core/sign-in/start-sign-in.js +25 -0
  440. package/dist/core/sign-in/start-sign-in.js.map +1 -0
  441. package/dist/core/vault/credential.d.ts +18 -0
  442. package/dist/core/vault/credential.js +2 -0
  443. package/dist/core/vault/credential.js.map +1 -0
  444. package/dist/outcome-worker.d.ts +29 -0
  445. package/dist/outcome-worker.js +60 -0
  446. package/dist/outcome-worker.js.map +1 -0
  447. package/dist/party-workers.d.ts +32 -0
  448. package/dist/party-workers.js +57 -0
  449. package/dist/party-workers.js.map +1 -0
  450. package/package.json +70 -4
  451. package/prisma.config.ts +18 -0
  452. package/src/adapters/prisma/migrations/20261018200000_init/migration.sql +35 -0
  453. package/src/adapters/prisma/migrations/20261018210000_parties/migration.sql +19 -0
  454. package/src/adapters/prisma/migrations/20261018220000_tool_marks/migration.sql +8 -0
  455. package/src/adapters/prisma/migrations/20261018230000_calls/migration.sql +13 -0
  456. package/src/adapters/prisma/migrations/20261019090000_oauth/migration.sql +60 -0
  457. package/src/adapters/prisma/migrations/20261019100000_client_parties/migration.sql +8 -0
  458. package/src/adapters/prisma/migrations/20261019110000_oauth_parties/migration.sql +5 -0
  459. package/src/adapters/prisma/migrations/20261019120000_client_calls/migration.sql +15 -0
  460. package/src/adapters/prisma/migrations/20261019130000_client_call_replies/migration.sql +20 -0
  461. package/src/adapters/prisma/migrations/20261019140000_identity_providers/migration.sql +10 -0
  462. package/src/adapters/prisma/migrations/20261020090000_no_identity_providers/migration.sql +2 -0
  463. package/src/adapters/prisma/migrations/20261020100000_account_grants_in_tokens/migration.sql +5 -0
  464. package/src/adapters/prisma/migrations/20261020110000_account_grants/migration.sql +15 -0
  465. package/src/adapters/prisma/migrations/20261020120000_person_crews/migration.sql +9 -0
  466. package/src/adapters/prisma/migrations/20261020130000_opened_deliveries/migration.sql +13 -0
  467. package/src/adapters/prisma/migrations/20261020140000_pending_requests/migration.sql +26 -0
  468. package/src/adapters/prisma/migrations/20261020150000_outside_party_switches/migration.sql +8 -0
  469. package/src/adapters/prisma/migrations/20261020160000_pending_requests_told/migration.sql +2 -0
  470. package/src/adapters/prisma/migrations/20261020170000_request_outcome_notices/migration.sql +17 -0
  471. package/src/adapters/prisma/migrations/20261020180000_owner_questions/migration.sql +11 -0
  472. package/src/adapters/prisma/migrations/20261020190000_request_changes/migration.sql +12 -0
  473. package/src/adapters/prisma/migrations/migration_lock.toml +3 -0
  474. package/src/adapters/prisma/schema.prisma +311 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,105 @@
1
- # Temporary Holding Version
1
+ # Aeolus gateway
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@aeolus-fleet/gateway`: outside MCP servers and clients join an [Aeolus](https://github.com/ThomasHendrickx/aeolus-fleet) fleet as ships, through one gateway beside core. Its design is aeolus-fleet's docs/design/interop/interop.md.
4
+
5
+ ## Run
6
+
7
+ ```sh
8
+ npm install && npm run build
9
+ DATABASE_URL=postgresql://... FLEET_URL=https://fleet.example.com npm start
10
+ ```
11
+
12
+ | Variable | Default | Meaning |
13
+ | --- | --- | --- |
14
+ | `DATABASE_URL` | required | The gateway's own Postgres 16 or newer database, with a direct connection |
15
+ | `FLEET_URL` | required | The fleet's public URL (`http://` or `https://`) |
16
+ | `HOST` | `127.0.0.1` | Interface to listen on |
17
+ | `PORT` | `4200` | Port to listen on |
18
+ | `GATEWAY_PUBLIC_URL` | `http://127.0.0.1:<PORT>` | Where outside MCP clients reach the gateway: the OAuth issuer, with the MCP endpoint at `/mcp` |
19
+ | `GATEWAY_SECRET` | required | At least 32 characters. Keys the ship aliases outside MCP clients see: the same secret keeps every alias across restarts, a new one renames every ship to them |
20
+ | `MCP_WAIT_MAX_MS` | `10000` | How long an outside MCP client's tool call waits for its answer before it is answered its handle; `0` answers the handle at once |
21
+ | `INSTALLATION_TOKEN` | unset | The token a hosting service presents to the installation procedures (at least 32 characters, decision 0021). Unset: they are off and every fleet is served, as a self-hosted gateway needs; set: a fleet is served once switched on |
22
+ | `PAGASAE_URL`, `PAGASAE_CLIENT_ID`, `PAGASAE_CLIENT_SECRET` | unset | pagasae, where people sign in (decision 0054), and the gateway's client there, registered with the redirect URI `<GATEWAY_PUBLIC_URL>/pagasae/callback`. All three or none; unset, nobody signs in, so no MCP client connects (only an account asks for one) |
23
+ | `LOG_LEVEL` | `info` | `fatal`, `error`, `warn`, `info`, `debug`, `trace` or `silent` |
24
+
25
+ | Command | Does |
26
+ | --- | --- |
27
+ | `aeolus-gateway start` | Reads core's version and exits 1 when core is older than it needs (core 0.27.0 or later), saying both versions; migrates its database; serves |
28
+ | `aeolus-gateway migrate` | Migrates its database, and nothing else. Needs `DATABASE_URL` alone |
29
+
30
+ `GET /api/version` answers the version it runs, and `GET /api/health` answers `{ "status": "ok" }` while its database answers, else 503.
31
+
32
+ ## Connect
33
+
34
+ argo commissions the gateway's ship in the console as an app ship (decision 0044: it is software, so its messages state no model), with `fleet:read`, `fleet:commission`, `fleet:on-behalf` and `scopes:declare`, and connects the gateway with it; the gateway registers with the ship's secret, keeps only the crew token, and declares its own scope, `gateway:approve` (decision 0056): any actor the fleet grants it approves outside parties. A fleet that does not take the declaration, as when another ship holds the `gateway` namespace, is refused (CONFLICT). The gateway connects and is switched on whatever network the fleet has (interop I-3): the fleet decides its network. A fleet's outside parties (its outside MCP servers and clients) are a switch, off by default: while off, the gateway approves no party, takes no party's calls and refuses a client party's token at `/mcp` (403). `outsideParties.status` reads it; `outsideParties.set` needs `fleet:network`. Turning it on while the fleet applies no network rules (`fleet.networkRules`, read as the actor) answers PRECONDITION_FAILED with a warning until the call confirms it with `isOpenNetworkConfirmed`.
35
+
36
+ The API is tRPC at `/trpc`. Its procedures take an actor (decision 0057): argo's or a viewer's console session cookie, checked with the fleet's `console.session`, or any ship's own crew token as a bearer token, for a fleet the gateway is connected to. What an actor may call is the scopes the fleet holds for it, read by the gateway's ship; a change needs `fleet:manage`. `requests.toDecide` and `requests.decide` need `gateway:approve` (decision 0056): every open pending request of the fleet, and a decision on one. Approving names the proxy ship's name, its owner (a person ship) and its scopes, only scopes the approver holds beside `messages:send` and `messages:receive`, and for an outside MCP server its credential and concurrency; the gateway commissions and crews the proxy ship as its own ship, and the fleet refuses a scope the gateway's ship does not hold. The first decision counts. A request is kept 7 days, then expires; a refused proxy ship leaves it pending. The outcome of a request for an outside MCP server is told to each requester with a person ship, as a text message from the gateway's ship: written with the decision or the expiry in one transaction, sent at once, and sent again every minute under the same idempotency key until the fleet stores it. One the fleet refuses is left for the gateway's page. Due requests expire in the same round. When a request opens, the gateway's ship asks its owner (read from the fleet; argo when argo owns it) a question (decision 0038) pointing to the gateway's `/overview`, where any holder of `gateway:approve` decides; it withdraws the question once the request is decided or expired. Both are kept and sent again under the same key until the fleet stores them. `installation.setEnabled`, `installation.get` and `installation.delete` take the installation token in `x-aeolus-installation-token`.
37
+
38
+ ## Parties
39
+
40
+ argo approves an outside MCP server as a party with `parties.approve` (argo's console session): its name, its Streamable HTTP URL, the credential the gateway calls it with (a static bearer, or OAuth client credentials with their issuer), the owner argo picks for it (a person's ship or argo) and how many calls it takes at once (1 to 10, the most core's pushReceive hands at once; 4 by default). The gateway, as its own ship, commissions the party's app proxy ship of type `mcp-server` with that owner, crews it, and keeps its crew token. argo labels the proxy ship in the console, as any ship, for the network rules to select it. `parties.list` shows each party without its credential or crew token. A proxy ship left awaiting crew (the commission's answer was lost, and its secret with it) takes a new secret from a new starting prompt with `parties.crew`.
41
+
42
+ The gateway keeps outside credentials and crew tokens as they are in its own database, as squadrons keeps crew tokens: a key on the same server would protect only backups. Guard the database and its backups accordingly.
43
+
44
+ `parties.state` states the proxy ship anew from the server's `tools/list`: each tool is one capability with its MCP fields and annotations, called with `application/vnd.aeolus.mcp-tool+json; name=<tool>` (the tool arguments as a JSON object) and answered with `application/vnd.aeolus.mcp-result+json; name=<tool>` (the tool result). The summary names the party only, never its URL or credential. `parties.markTool` marks a tool repeatable, or takes the mark off, and states it at once: only argo's mark lets the gateway hand a call that died unanswered again; the server's hints never do.
45
+
46
+ Commissioning an app ship with a named owner needs core 0.28 (aeolus-fleet#959), and so do the statement's `annotations` and `repeatable` fields (aeolus-fleet#956): core 0.27 refuses a statement that holds them.
47
+
48
+ ## The page of parties
49
+
50
+ `/parties` is the gateway's own page for argo: the parties with their state, a form to approve an MCP server, and per party the forms to hand over a new secret, state its tools and mark a tool repeatable. The page knows argo by the console session cookie the browser sends, so the gateway must be served where that cookie reaches it (on localhost, any port). A viewer session sees the parties without the forms. Each form calls the API as the session's ship, and the page refuses a form sent from another origin.
51
+
52
+ ## MCP out
53
+
54
+ From its start, and as soon as a party is crewed, the gateway takes the calls of each crewed party's proxy ship as its crew (interop 5.2). A ship of the fleet calls a tool by sending the proxy ship the tool's input type, `application/vnd.aeolus.mcp-tool+json; name=<tool>`, with the tool arguments as a JSON object. The gateway reports it handed, makes the `tools/call` with the vault's credential, and replies with the result (an error result included) naming the request, then acknowledges and reports it handled. It keeps each call in its database, so a restart replies again and never calls again what may have run.
55
+
56
+ - A call the server never got (it was unreachable, or refused the credential) is handed again after a wait, and the fleet stops it at the fifth attempt.
57
+ - A call sent with no answer (a broken stream, no answer within 5 minutes) is handed again only when argo marked its tool repeatable. Otherwise the gateway reports it not handled: it may have run, and a human who can check the outside system resends or dismisses it.
58
+ - A party takes at most its concurrency limit of calls at once.
59
+
60
+ With core 0.27 the not handled report is refused (aeolus-fleet#955): the call is never made again, and its delivery stays handed until argo resends or dismisses it.
61
+
62
+ ## MCP clients sign in
63
+
64
+ The gateway is an OAuth 2.1 authorization server for outside MCP clients, such as Claude, ChatGPT or Cursor (MCP 2026-07-28):
65
+
66
+ - `/.well-known/oauth-protected-resource` (RFC 9728) names the gateway as the authorization server of its MCP endpoint, `<GATEWAY_PUBLIC_URL>/mcp`; `/.well-known/oauth-authorization-server` (RFC 8414) states what it serves.
67
+ - A client is pre-registered by argo with `oauth.registerClient` (its name, its redirect URIs, and whether it keeps a secret, answered once), or known by its client metadata document (CIMD): its client id is the https URL of that document. There is no dynamic registration.
68
+ - `/authorize` shows the client and two picks (decision 0056, Q1 a): sign in as yourself, or ask for access for this client. Either sends the person to pagasae to sign in. Only the authorization code flow with PKCE S256 is served, and the `resource` must be the gateway's MCP endpoint (RFC 8707).
69
+ - A person signs in through pagasae (decision 0054). pagasae answers their only fleet, or asks which, and sends them back to `/pagasae/callback`; signed in as themselves, the gateway keeps their account's grant (the account, its fleet, its person ship and pagasae's tokens) and sends their client back with its code, with no approval. The sign-in under way travels sealed in pagasae's `state`, so nothing is stored before the fleet is known. The browser that starts it holds a secret sealed with it, in an HttpOnly cookie sent only to `/pagasae/callback` for its 10 minutes, so no other browser finishes it (login CSRF). A fleet the gateway does not serve is refused. A person's client is served their person ship's tools: `aeolus_inbox` (what waits, by titles only, at most 10), `aeolus_open` (one delivery whole; opening it acknowledges it), `aeolus_answer` (a reply to its sender, then it is handled) and `aeolus_done` (handled with no answer). The gateway makes these calls as the crew of the account's own person ship, with the account's token (decision 0057): it crews the ship once, shared by every client of the person, and crews it again when its lease ended. An account with no person ship is told so, and the fleet is asked nothing. `aeolus_ask_for_server` asks for an outside MCP server by its http or https address, as the account (decision 0056): it opens a pending request, or joins the one pending for the same server, and an approver adds the server with its credential. A server that is a party already is said so. While the fleet's outside parties are off, nobody asks.
70
+ - A person who asks for access for the client asks as their account. A client that is a party already is sent back with its party's code at once. Otherwise the account opens a pending request for the client, or joins the one pending, and its browser waits at `/authorize/waiting`, which reloads itself: approved and its proxy ship crewed, the client gets its party's code; denied or expired, `access_denied`. Closed meanwhile, the next try after a deny or expiry ends with `access_denied` once, and a later try asks anew. The waiting travels sealed in the page's address, and the browser holds the sign-in's secret in an HttpOnly cookie sent only to the waiting page, for the request's 7 days. While the fleet's outside parties are off, nobody asks. Each client party has its own app proxy ship, of type `mcp-client`; every token of a client party names its party, so every fleet call the client makes is its proxy ship's, within its reach; a person's token names their account's grant. `parties.list` shows client parties beside server parties.
71
+ - `/token` takes a code once, within its minute, for an access token (one hour) and a refresh token (30 days). Refreshing rotates the pair; a code or a refresh token used twice revokes what it gave.
72
+
73
+ Codes and tokens are kept only as hashes, and so are client secrets.
74
+
75
+ Serve the gateway at its own origin, such as `https://gateway.example.com`, with `GATEWAY_PUBLIC_URL` set to it: RFC 8414 and RFC 9728 put the metadata at the origin's root, and `/authorize` and `/token` are served there.
76
+
77
+ ## MCP clients list and call tools
78
+
79
+ `<GATEWAY_PUBLIC_URL>/mcp` is the gateway's MCP endpoint (Streamable HTTP, stateless). A call without a token, or with one the gateway did not issue for it, gets 401 with `resource_metadata` naming where to sign in (RFC 9728).
80
+
81
+ - `tools/list` answers the capabilities of the ships the client's proxy ship may send to now, as the fleet's `discover` answers it: the gateway adds no reach of its own.
82
+ - A tool is named `<alias>__<capability>`. The alias is 8 letters and digits derived from the ship under `GATEWAY_SECRET`: the client never sees a ship's name or id.
83
+ - Its description is the capability's, then the ship's summary. A capability that takes plain text first gets one `text` argument. Every tool takes an optional `aeolus_idempotency_key`.
84
+ - Left out: argo, ships with no statement by their crew, capabilities whose first input type is neither JSON nor plain text or whose input schema is not an object, and tool names over 128 characters.
85
+ - No tool states an output schema: a call may answer a handle, and MCP clients check every answer against it.
86
+ - `tools/call` sends the arguments, without `aeolus_idempotency_key`, as a message from the client's proxy ship to the tool's ship, under the capability's first input type. The client is answered only once the fleet answered the send. The call then waits up to `MCP_WAIT_MAX_MS` for its answer: answered within it, the client gets the answer itself; else `{"handle": "...", "state": "submitted"}` (or `working`). A fleet that refuses the send gets a tool error, and one that cannot be reached gives no reason why.
87
+ - The same `aeolus_idempotency_key` again sends no second message. The send's key is derived from it under `GATEWAY_SECRET`, and the handle from the message, so the client never sees a `msg_` id.
88
+ - `aeolus_result({ handle })` reads the client's own call: `submitted`, `working` once a reply of another type came, its answer once completed, or a tool error once it failed (interop 3.4).
89
+ - MCP Tasks (`io.modelcontextprotocol/tasks`, stated at `server/discover`): a client that declares the extension on its `tools/call` is answered a task in place of the handle, its `taskId` the handle. `tasks/get` reads it: `working` while submitted or working, `completed` with the answer as its `result`, or `failed` once its deadline passed. A task never expires (`ttlMs` null), as the gateway keeps every call. `tasks/cancel` and `tasks/update` are acknowledged and change nothing: a sent call cannot be unsent, and no call asks for input yet.
90
+ - The first reply of the capability's first output type completes it; plain text completes a call to a ship that states no output type. An outside tool's result, as MCP out replies one, is answered as that result.
91
+ - A call fails 10 minutes after it was sent without its answer: the gateway's default while statements state no deadline. A reply after that is kept and changes nothing.
92
+ - Each client party's worker takes the replies of its proxy ship, keeps each on its call, then acknowledges and handles its delivery. With core 0.27 a message to the proxy ship that replies to no call stays unacknowledged, for a later slice's inbox. Ten of them would take every pushReceive answer and keep replies out, until core 0.28's `receiveReply` (aeolus-fleet#953) takes replies by message.
93
+
94
+ ## Develop
95
+
96
+ ```sh
97
+ npm install
98
+ npm run typecheck && npm run lint && npm test
99
+ ```
100
+
101
+ The integration tests need Docker or Podman: they start Postgres in Testcontainers and a real core from the `@aeolus-fleet/core` devDependency.
102
+
103
+ ## Licence
104
+
105
+ Apache-2.0.
@@ -0,0 +1,7 @@
1
+ import type { CallKeys } from '../../core/mcp-in/ports.js';
2
+ /**
3
+ * Keys as an HMAC under the gateway's secret, of the parts as a JSON array so
4
+ * no part's colon or comma runs into the next. A client's key is never sent
5
+ * as it is, and a handle tells nothing of the message id.
6
+ */
7
+ export declare function createCallKeys(secret: string): CallKeys;
@@ -0,0 +1,18 @@
1
+ import { createHmac, randomUUID } from 'node:crypto';
2
+ /** Each derivation under its own label, so a key is never also a handle. */
3
+ const IDEMPOTENCY_LABEL = 'idempotency-key';
4
+ const HANDLE_LABEL = 'handle';
5
+ /**
6
+ * Keys as an HMAC under the gateway's secret, of the parts as a JSON array so
7
+ * no part's colon or comma runs into the next. A client's key is never sent
8
+ * as it is, and a handle tells nothing of the message id.
9
+ */
10
+ export function createCallKeys(secret) {
11
+ const derived = (parts) => createHmac('sha256', secret).update(JSON.stringify(parts)).digest('base64url');
12
+ return {
13
+ idempotencyKeyOf: ({ fleetId, party, key }) => derived([IDEMPOTENCY_LABEL, fleetId, party, key]),
14
+ newIdempotencyKey: () => randomUUID(),
15
+ handleOf: (fleetId, messageId) => derived([HANDLE_LABEL, fleetId, messageId]),
16
+ };
17
+ }
18
+ //# sourceMappingURL=call-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call-keys.js","sourceRoot":"","sources":["../../../src/adapters/crypto/call-keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIrD,4EAA4E;AAC5E,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,OAAO,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACpH,OAAO;QACL,gBAAgB,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAChG,iBAAiB,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE;QACrC,QAAQ,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { OAuthSecrets } from '../../core/oauth/ports.js';
2
+ /** Secrets drawn from the system's random source, kept as SHA-256 in hex; S256 as RFC 7636 defines it. */
3
+ export declare const oauthSecrets: OAuthSecrets;
@@ -0,0 +1,10 @@
1
+ import { createHash, randomBytes } from 'node:crypto';
2
+ /** 256 bits for each code, token and client secret. */
3
+ const SECRET_BYTES = 32;
4
+ /** Secrets drawn from the system's random source, kept as SHA-256 in hex; S256 as RFC 7636 defines it. */
5
+ export const oauthSecrets = {
6
+ newSecret: () => randomBytes(SECRET_BYTES).toString('base64url'),
7
+ hashOf: (secret) => createHash('sha256').update(secret).digest('hex'),
8
+ challengeOf: (verifier) => createHash('sha256').update(verifier, 'ascii').digest('base64url'),
9
+ };
10
+ //# sourceMappingURL=oauth-secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-secrets.js","sourceRoot":"","sources":["../../../src/adapters/crypto/oauth-secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAItD,uDAAuD;AACvD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,0GAA0G;AAC1G,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC;IAChE,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACrE,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;CAC9F,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { RequestHasher } from '../../core/installation/ports.js';
2
+ /** A request's text as its SHA-256, in hex: what the installation keeps instead of the request. */
3
+ export declare const sha256RequestHasher: RequestHasher;
@@ -0,0 +1,4 @@
1
+ import { createHash } from 'node:crypto';
2
+ /** A request's text as its SHA-256, in hex: what the installation keeps instead of the request. */
3
+ export const sha256RequestHasher = { hash: (text) => createHash('sha256').update(text).digest('hex') };
4
+ //# sourceMappingURL=request-hasher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-hasher.js","sourceRoot":"","sources":["../../../src/adapters/crypto/request-hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAkB,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { createIdGenerator } from '@aeolus-fleet/common';
2
+ import type { RequestIds } from '../../core/requests/ports.js';
3
+ /** New request ids: a common id's time-ordered body under the request prefix. */
4
+ export declare function createRequestIds(options?: Parameters<typeof createIdGenerator>[0]): RequestIds;
@@ -0,0 +1,14 @@
1
+ import { createIdGenerator } from '@aeolus-fleet/common';
2
+ /** The prefix common gives a pending request from 0.28.0 (`ID_PREFIXES.request`); until then its time-ordered body is drawn here (aeolus-fleet#991). */
3
+ const REQUEST_PREFIX = 'req_';
4
+ /** New request ids: a common id's time-ordered body under the request prefix. */
5
+ export function createRequestIds(options = {}) {
6
+ const generate = createIdGenerator(options);
7
+ return {
8
+ newRequestId: () => {
9
+ const id = generate('event');
10
+ return `${REQUEST_PREFIX}${id.slice(id.indexOf('_') + 1)}`;
11
+ },
12
+ };
13
+ }
14
+ //# sourceMappingURL=request-ids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-ids.js","sourceRoot":"","sources":["../../../src/adapters/crypto/request-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,wJAAwJ;AACxJ,MAAM,cAAc,GAAG,MAAM,CAAC;AAE9B,iFAAiF;AACjF,MAAM,UAAU,gBAAgB,CAAC,UAAmD,EAAE;IACpF,MAAM,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO;QACL,YAAY,EAAE,GAAG,EAAE;YACjB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7B,OAAO,GAAG,cAAc,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAC7D,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** Seals JSON into URL-safe text, and opens it again; what it opens is unknown until its schema parses it. */
2
+ export interface Sealer {
3
+ seal(value: unknown): string;
4
+ open(sealed: string): unknown;
5
+ }
6
+ /**
7
+ * Seals with AES-256-GCM under a key derived from the gateway's secret and
8
+ * the label: the sealed text is the nonce, the sealed JSON and its tag,
9
+ * base64url. Text changed on the way, sealed under another secret or
10
+ * another label, opens to undefined.
11
+ */
12
+ export declare function createSealer(secret: string, label: string): Sealer;
13
+ /** The request's parameters that are set, as a sealed request keeps them. */
14
+ export declare function setParameters(request: Readonly<Record<string, string | undefined>>): Record<string, string>;
@@ -0,0 +1,41 @@
1
+ import { createCipheriv, createDecipheriv, createHmac, randomBytes } from 'node:crypto';
2
+ const CIPHER = 'aes-256-gcm';
3
+ const NONCE_BYTES = 12;
4
+ const TAG_BYTES = 16;
5
+ /**
6
+ * Seals with AES-256-GCM under a key derived from the gateway's secret and
7
+ * the label: the sealed text is the nonce, the sealed JSON and its tag,
8
+ * base64url. Text changed on the way, sealed under another secret or
9
+ * another label, opens to undefined.
10
+ */
11
+ export function createSealer(secret, label) {
12
+ const key = createHmac('sha256', secret).update(label).digest();
13
+ return {
14
+ seal: (value) => {
15
+ const nonce = randomBytes(NONCE_BYTES);
16
+ const cipher = createCipheriv(CIPHER, key, nonce);
17
+ const sealed = Buffer.concat([cipher.update(JSON.stringify(value), 'utf8'), cipher.final()]);
18
+ return Buffer.concat([nonce, sealed, cipher.getAuthTag()]).toString('base64url');
19
+ },
20
+ open: (sealed) => {
21
+ const bytes = Buffer.from(sealed, 'base64url');
22
+ if (bytes.length <= NONCE_BYTES + TAG_BYTES) {
23
+ return undefined;
24
+ }
25
+ const decipher = createDecipheriv(CIPHER, key, bytes.subarray(0, NONCE_BYTES));
26
+ decipher.setAuthTag(bytes.subarray(bytes.length - TAG_BYTES));
27
+ try {
28
+ const opened = JSON.parse(Buffer.concat([decipher.update(bytes.subarray(NONCE_BYTES, bytes.length - TAG_BYTES)), decipher.final()]).toString('utf8'));
29
+ return opened;
30
+ }
31
+ catch {
32
+ return undefined;
33
+ }
34
+ },
35
+ };
36
+ }
37
+ /** The request's parameters that are set, as a sealed request keeps them. */
38
+ export function setParameters(request) {
39
+ return Object.fromEntries(Object.entries(request).filter((entry) => entry[1] !== undefined));
40
+ }
41
+ //# sourceMappingURL=sealer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sealer.js","sourceRoot":"","sources":["../../../src/adapters/crypto/sealer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExF,MAAM,MAAM,GAAG,aAAa,CAAC;AAC7B,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,SAAS,GAAG,EAAE,CAAC;AAQrB;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,KAAa;IACxD,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;IAChE,OAAO;QACL,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACd,MAAM,KAAK,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;YAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7F,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACnF,CAAC;QACD,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE;YACf,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAC/C,IAAI,KAAK,CAAC,MAAM,IAAI,WAAW,GAAG,SAAS,EAAE,CAAC;gBAC5C,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;YAC/E,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC;gBACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC/J,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,OAAqD;IACjF,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAA6B,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC;AAC1H,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ShipAliases } from '../../core/mcp-in/ports.js';
2
+ /**
3
+ * Aliases as an HMAC of the fleet and ship under the gateway's secret: the
4
+ * same ship has the same alias across restarts, and nobody without the secret
5
+ * learns its id from it. It starts with a letter, as a tool name may need.
6
+ */
7
+ export declare function createShipAliases(secret: string): ShipAliases;
@@ -0,0 +1,19 @@
1
+ import { createHmac } from 'node:crypto';
2
+ const ALIAS_LENGTH = 8;
3
+ const LETTERS = 'abcdefghijklmnopqrstuvwxyz';
4
+ /** Lowercase base32 (RFC 4648's alphabet): 32 divides 256, so each byte draws a character evenly. */
5
+ const BASE32 = `${LETTERS}234567`;
6
+ /**
7
+ * Aliases as an HMAC of the fleet and ship under the gateway's secret: the
8
+ * same ship has the same alias across restarts, and nobody without the secret
9
+ * learns its id from it. It starts with a letter, as a tool name may need.
10
+ */
11
+ export function createShipAliases(secret) {
12
+ return {
13
+ aliasOf: (fleetId, shipId) => {
14
+ const bytes = createHmac('sha256', secret).update(`${fleetId}:${shipId}`).digest();
15
+ return [...bytes.subarray(0, ALIAS_LENGTH)].map((byte, index) => (index === 0 ? LETTERS.charAt(byte % LETTERS.length) : BASE32.charAt(byte % BASE32.length))).join('');
16
+ },
17
+ };
18
+ }
19
+ //# sourceMappingURL=ship-aliases.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ship-aliases.js","sourceRoot":"","sources":["../../../src/adapters/crypto/ship-aliases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,OAAO,GAAG,4BAA4B,CAAC;AAC7C,qGAAqG;AACrG,MAAM,MAAM,GAAG,GAAG,OAAO,QAAQ,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,OAAO;QACL,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3B,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,IAAI,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;YACnF,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzK,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { SignInSeals } from '../../core/sign-in/ports.js';
2
+ /**
3
+ * Seals a sign-in under way into the state pagasae carries back, under a key
4
+ * derived from the gateway's secret. A state changed on the way, or sealed
5
+ * under another secret, opens to nothing.
6
+ */
7
+ export declare function createSignInSeals(secret: string): SignInSeals;
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { createSealer, setParameters } from './sealer.js';
3
+ /** Its own label, so the sealing key is never also a key the gateway derives elsewhere. */
4
+ const SEAL_LABEL = 'sign-in-seal';
5
+ const sealedSchema = z.object({
6
+ verifier: z.string(),
7
+ browserSecret: z.string(),
8
+ request: z.record(z.string(), z.string()),
9
+ holder: z.enum(['account', 'party']),
10
+ expiresAt: z.iso.datetime(),
11
+ });
12
+ /**
13
+ * Seals a sign-in under way into the state pagasae carries back, under a key
14
+ * derived from the gateway's secret. A state changed on the way, or sealed
15
+ * under another secret, opens to nothing.
16
+ */
17
+ export function createSignInSeals(secret) {
18
+ const sealer = createSealer(secret, SEAL_LABEL);
19
+ return {
20
+ seal: ({ verifier, browserSecret, request, holder, expiresAt }) => sealer.seal({ verifier, browserSecret, request: setParameters(request), holder, expiresAt: expiresAt.toISOString() }),
21
+ open: (state) => {
22
+ const signIn = sealedSchema.safeParse(sealer.open(state));
23
+ return signIn.success ? { ...signIn.data, expiresAt: new Date(signIn.data.expiresAt) } : undefined;
24
+ },
25
+ };
26
+ }
27
+ //# sourceMappingURL=sign-in-seals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sign-in-seals.js","sourceRoot":"","sources":["../../../src/adapters/crypto/sign-in-seals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1D,2FAA2F;AAC3F,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;QACxL,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;YACd,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACrG,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { WaitingSeals } from '../../core/requests/ports.js';
2
+ /** Seals a browser's waiting into the waiting page's address, under a key derived from the gateway's secret. */
3
+ export declare function createWaitingSeals(secret: string): WaitingSeals;
@@ -0,0 +1,24 @@
1
+ import { idSchema } from '@aeolus-fleet/common';
2
+ import { z } from 'zod';
3
+ import { createSealer, setParameters } from './sealer.js';
4
+ /** Its own label, so a sign-in's state never opens as a waiting, nor a waiting as a sign-in. */
5
+ const SEAL_LABEL = 'waiting-seal';
6
+ const sealedSchema = z.object({
7
+ fleetId: idSchema('fleet'),
8
+ requestId: z.string(),
9
+ accountId: z.string(),
10
+ browserSecret: z.string(),
11
+ request: z.record(z.string(), z.string()),
12
+ });
13
+ /** Seals a browser's waiting into the waiting page's address, under a key derived from the gateway's secret. */
14
+ export function createWaitingSeals(secret) {
15
+ const sealer = createSealer(secret, SEAL_LABEL);
16
+ return {
17
+ seal: (waiting) => sealer.seal({ ...waiting, request: setParameters(waiting.request) }),
18
+ open: (sealed) => {
19
+ const waiting = sealedSchema.safeParse(sealer.open(sealed));
20
+ return waiting.success ? waiting.data : undefined;
21
+ },
22
+ };
23
+ }
24
+ //# sourceMappingURL=waiting-seals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waiting-seals.js","sourceRoot":"","sources":["../../../src/adapters/crypto/waiting-seals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1D,gGAAgG;AAChG,MAAM,UAAU,GAAG,cAAc,CAAC;AAElC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1C,CAAC,CAAC;AAEH,gHAAgH;AAChH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACvF,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE;YACf,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YAC5D,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ConsoleSessions } from '../../core/operator/ports.js';
2
+ export declare function createFleetConsoleSessions(fleetUrl: string): ConsoleSessions;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Asks the fleet whether a forwarded console session cookie is a signed-in
3
+ * operator's or a viewer's, with its scopes, with `console.session`
4
+ * (decisions 0012, 0022 and 0043): the cookie travels from the console's server,
5
+ * server to server.
6
+ */
7
+ import { consoleSessionOutputSchema } from '@aeolus-fleet/common';
8
+ import { z } from 'zod';
9
+ import { err, ok } from '../../core/shared/result.js';
10
+ const sessionAnswer = z.object({ result: z.object({ data: consoleSessionOutputSchema }) });
11
+ export function createFleetConsoleSessions(fleetUrl) {
12
+ return {
13
+ check: async (cookie) => {
14
+ const response = await fetch(`${fleetUrl}/trpc/console.session`, { headers: { cookie } });
15
+ if (!response.ok) {
16
+ return err({ code: 'UNAUTHORIZED', message: 'No signed-in console session' });
17
+ }
18
+ const { fleetId, kind, scopes } = sessionAnswer.parse(await response.json()).result.data;
19
+ return ok({ fleetId, kind, scopes });
20
+ },
21
+ };
22
+ }
23
+ //# sourceMappingURL=console-sessions.js.map