@eloxiv/testing 0.0.0-stage → 0.1.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 (1006) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/Admin.d.ts +20 -0
  4. package/dist/Admin.d.ts.map +1 -0
  5. package/dist/Admin.js +61 -0
  6. package/dist/Admin.js.map +1 -0
  7. package/dist/Agent.d.ts +97 -0
  8. package/dist/Agent.d.ts.map +1 -0
  9. package/dist/Agent.js +210 -0
  10. package/dist/Agent.js.map +1 -0
  11. package/dist/AgentSurface.d.ts +20 -0
  12. package/dist/AgentSurface.d.ts.map +1 -0
  13. package/dist/AgentSurface.js +36 -0
  14. package/dist/AgentSurface.js.map +1 -0
  15. package/dist/Embedder.d.ts +21 -0
  16. package/dist/Embedder.d.ts.map +1 -0
  17. package/dist/Embedder.js +54 -0
  18. package/dist/Embedder.js.map +1 -0
  19. package/dist/EvalMain.d.ts +2 -0
  20. package/dist/EvalMain.d.ts.map +1 -0
  21. package/dist/EvalMain.js +80 -0
  22. package/dist/EvalMain.js.map +1 -0
  23. package/dist/Evals.d.ts +95 -0
  24. package/dist/Evals.d.ts.map +1 -0
  25. package/dist/Evals.js +389 -0
  26. package/dist/Evals.js.map +1 -0
  27. package/dist/Kernel.d.ts +88 -0
  28. package/dist/Kernel.d.ts.map +1 -0
  29. package/dist/Kernel.js +108 -0
  30. package/dist/Kernel.js.map +1 -0
  31. package/dist/Launch.d.ts +86 -0
  32. package/dist/Launch.d.ts.map +1 -0
  33. package/dist/Launch.js +370 -0
  34. package/dist/Launch.js.map +1 -0
  35. package/dist/Locks.d.ts +39 -0
  36. package/dist/Locks.d.ts.map +1 -0
  37. package/dist/Locks.js +94 -0
  38. package/dist/Locks.js.map +1 -0
  39. package/dist/Routes.d.ts +19 -0
  40. package/dist/Routes.d.ts.map +1 -0
  41. package/dist/Routes.js +38 -0
  42. package/dist/Routes.js.map +1 -0
  43. package/dist/ScriptedChatModel.d.ts +51 -0
  44. package/dist/ScriptedChatModel.d.ts.map +1 -0
  45. package/dist/ScriptedChatModel.js +135 -0
  46. package/dist/ScriptedChatModel.js.map +1 -0
  47. package/dist/SmtpSink.d.ts +36 -0
  48. package/dist/SmtpSink.d.ts.map +1 -0
  49. package/dist/SmtpSink.js +185 -0
  50. package/dist/SmtpSink.js.map +1 -0
  51. package/dist/System.d.ts +271 -0
  52. package/dist/System.d.ts.map +1 -0
  53. package/dist/System.js +905 -0
  54. package/dist/System.js.map +1 -0
  55. package/dist/TcpProxy.d.ts +17 -0
  56. package/dist/TcpProxy.d.ts.map +1 -0
  57. package/dist/TcpProxy.js +100 -0
  58. package/dist/TcpProxy.js.map +1 -0
  59. package/dist/auth/TrustedProxyAuth.d.ts +28 -0
  60. package/dist/auth/TrustedProxyAuth.d.ts.map +1 -0
  61. package/dist/auth/TrustedProxyAuth.js +128 -0
  62. package/dist/auth/TrustedProxyAuth.js.map +1 -0
  63. package/dist/conformance/ActionConsent.d.ts +3 -0
  64. package/dist/conformance/ActionConsent.d.ts.map +1 -0
  65. package/dist/conformance/ActionConsent.js +347 -0
  66. package/dist/conformance/ActionConsent.js.map +1 -0
  67. package/dist/conformance/ActionRegistry.d.ts +64 -0
  68. package/dist/conformance/ActionRegistry.d.ts.map +1 -0
  69. package/dist/conformance/ActionRegistry.js +136 -0
  70. package/dist/conformance/ActionRegistry.js.map +1 -0
  71. package/dist/conformance/Actor.d.ts +43 -0
  72. package/dist/conformance/Actor.d.ts.map +1 -0
  73. package/dist/conformance/Actor.js +171 -0
  74. package/dist/conformance/Actor.js.map +1 -0
  75. package/dist/conformance/AgentReference.d.ts +30 -0
  76. package/dist/conformance/AgentReference.d.ts.map +1 -0
  77. package/dist/conformance/AgentReference.js +137 -0
  78. package/dist/conformance/AgentReference.js.map +1 -0
  79. package/dist/conformance/AgentResources.d.ts +3 -0
  80. package/dist/conformance/AgentResources.d.ts.map +1 -0
  81. package/dist/conformance/AgentResources.js +454 -0
  82. package/dist/conformance/AgentResources.js.map +1 -0
  83. package/dist/conformance/AgentRuntime.d.ts +3 -0
  84. package/dist/conformance/AgentRuntime.d.ts.map +1 -0
  85. package/dist/conformance/AgentRuntime.js +302 -0
  86. package/dist/conformance/AgentRuntime.js.map +1 -0
  87. package/dist/conformance/AgentSubject.d.ts +87 -0
  88. package/dist/conformance/AgentSubject.d.ts.map +1 -0
  89. package/dist/conformance/AgentSubject.js +18 -0
  90. package/dist/conformance/AgentSubject.js.map +1 -0
  91. package/dist/conformance/Approvals.d.ts +3 -0
  92. package/dist/conformance/Approvals.d.ts.map +1 -0
  93. package/dist/conformance/Approvals.js +258 -0
  94. package/dist/conformance/Approvals.js.map +1 -0
  95. package/dist/conformance/Audit.d.ts +3 -0
  96. package/dist/conformance/Audit.d.ts.map +1 -0
  97. package/dist/conformance/Audit.js +221 -0
  98. package/dist/conformance/Audit.js.map +1 -0
  99. package/dist/conformance/CalendarProvider.d.ts +4 -0
  100. package/dist/conformance/CalendarProvider.d.ts.map +1 -0
  101. package/dist/conformance/CalendarProvider.js +108 -0
  102. package/dist/conformance/CalendarProvider.js.map +1 -0
  103. package/dist/conformance/CapabilityKit.d.ts +191 -0
  104. package/dist/conformance/CapabilityKit.d.ts.map +1 -0
  105. package/dist/conformance/CapabilityKit.js +375 -0
  106. package/dist/conformance/CapabilityKit.js.map +1 -0
  107. package/dist/conformance/ClientSDK.d.ts +78 -0
  108. package/dist/conformance/ClientSDK.d.ts.map +1 -0
  109. package/dist/conformance/ClientSDK.js +163 -0
  110. package/dist/conformance/ClientSDK.js.map +1 -0
  111. package/dist/conformance/CollabDocument.d.ts +3 -0
  112. package/dist/conformance/CollabDocument.d.ts.map +1 -0
  113. package/dist/conformance/CollabDocument.js +934 -0
  114. package/dist/conformance/CollabDocument.js.map +1 -0
  115. package/dist/conformance/CollabReference.d.ts +8 -0
  116. package/dist/conformance/CollabReference.d.ts.map +1 -0
  117. package/dist/conformance/CollabReference.js +138 -0
  118. package/dist/conformance/CollabReference.js.map +1 -0
  119. package/dist/conformance/CollabSubject.d.ts +68 -0
  120. package/dist/conformance/CollabSubject.d.ts.map +1 -0
  121. package/dist/conformance/CollabSubject.js +2 -0
  122. package/dist/conformance/CollabSubject.js.map +1 -0
  123. package/dist/conformance/Command.d.ts +3 -0
  124. package/dist/conformance/Command.d.ts.map +1 -0
  125. package/dist/conformance/Command.js +73 -0
  126. package/dist/conformance/Command.js.map +1 -0
  127. package/dist/conformance/Connections.d.ts +4 -0
  128. package/dist/conformance/Connections.d.ts.map +1 -0
  129. package/dist/conformance/Connections.js +308 -0
  130. package/dist/conformance/Connections.js.map +1 -0
  131. package/dist/conformance/ConnectionsReference.d.ts +56 -0
  132. package/dist/conformance/ConnectionsReference.d.ts.map +1 -0
  133. package/dist/conformance/ConnectionsReference.js +74 -0
  134. package/dist/conformance/ConnectionsReference.js.map +1 -0
  135. package/dist/conformance/ConnectorReference.d.ts +86 -0
  136. package/dist/conformance/ConnectorReference.d.ts.map +1 -0
  137. package/dist/conformance/ConnectorReference.js +185 -0
  138. package/dist/conformance/ConnectorReference.js.map +1 -0
  139. package/dist/conformance/ContextAccounting.d.ts +8 -0
  140. package/dist/conformance/ContextAccounting.d.ts.map +1 -0
  141. package/dist/conformance/ContextAccounting.js +125 -0
  142. package/dist/conformance/ContextAccounting.js.map +1 -0
  143. package/dist/conformance/Daemon.d.ts +150 -0
  144. package/dist/conformance/Daemon.d.ts.map +1 -0
  145. package/dist/conformance/Daemon.js +718 -0
  146. package/dist/conformance/Daemon.js.map +1 -0
  147. package/dist/conformance/DaemonReference.d.ts +15 -0
  148. package/dist/conformance/DaemonReference.d.ts.map +1 -0
  149. package/dist/conformance/DaemonReference.js +163 -0
  150. package/dist/conformance/DaemonReference.js.map +1 -0
  151. package/dist/conformance/DbTx.d.ts +17 -0
  152. package/dist/conformance/DbTx.d.ts.map +1 -0
  153. package/dist/conformance/DbTx.js +184 -0
  154. package/dist/conformance/DbTx.js.map +1 -0
  155. package/dist/conformance/DecisionTokens.d.ts +3 -0
  156. package/dist/conformance/DecisionTokens.d.ts.map +1 -0
  157. package/dist/conformance/DecisionTokens.js +551 -0
  158. package/dist/conformance/DecisionTokens.js.map +1 -0
  159. package/dist/conformance/Delegation.d.ts +3 -0
  160. package/dist/conformance/Delegation.d.ts.map +1 -0
  161. package/dist/conformance/Delegation.js +149 -0
  162. package/dist/conformance/Delegation.js.map +1 -0
  163. package/dist/conformance/DeskReference.d.ts +21 -0
  164. package/dist/conformance/DeskReference.d.ts.map +1 -0
  165. package/dist/conformance/DeskReference.js +47 -0
  166. package/dist/conformance/DeskReference.js.map +1 -0
  167. package/dist/conformance/DeviceControl.d.ts +3 -0
  168. package/dist/conformance/DeviceControl.d.ts.map +1 -0
  169. package/dist/conformance/DeviceControl.js +579 -0
  170. package/dist/conformance/DeviceControl.js.map +1 -0
  171. package/dist/conformance/Directory.d.ts +36 -0
  172. package/dist/conformance/Directory.d.ts.map +1 -0
  173. package/dist/conformance/Directory.js +253 -0
  174. package/dist/conformance/Directory.js.map +1 -0
  175. package/dist/conformance/DirectoryProvider.d.ts +4 -0
  176. package/dist/conformance/DirectoryProvider.d.ts.map +1 -0
  177. package/dist/conformance/DirectoryProvider.js +58 -0
  178. package/dist/conformance/DirectoryProvider.js.map +1 -0
  179. package/dist/conformance/DocumentSource.d.ts +4 -0
  180. package/dist/conformance/DocumentSource.d.ts.map +1 -0
  181. package/dist/conformance/DocumentSource.js +43 -0
  182. package/dist/conformance/DocumentSource.js.map +1 -0
  183. package/dist/conformance/EndpointReference.d.ts +40 -0
  184. package/dist/conformance/EndpointReference.d.ts.map +1 -0
  185. package/dist/conformance/EndpointReference.js +67 -0
  186. package/dist/conformance/EndpointReference.js.map +1 -0
  187. package/dist/conformance/Files.d.ts +40 -0
  188. package/dist/conformance/Files.d.ts.map +1 -0
  189. package/dist/conformance/Files.js +592 -0
  190. package/dist/conformance/Files.js.map +1 -0
  191. package/dist/conformance/FilesReference.d.ts +31 -0
  192. package/dist/conformance/FilesReference.d.ts.map +1 -0
  193. package/dist/conformance/FilesReference.js +116 -0
  194. package/dist/conformance/FilesReference.js.map +1 -0
  195. package/dist/conformance/FilesSubject.d.ts +46 -0
  196. package/dist/conformance/FilesSubject.d.ts.map +1 -0
  197. package/dist/conformance/FilesSubject.js +3 -0
  198. package/dist/conformance/FilesSubject.js.map +1 -0
  199. package/dist/conformance/Flags.d.ts +3 -0
  200. package/dist/conformance/Flags.d.ts.map +1 -0
  201. package/dist/conformance/Flags.js +183 -0
  202. package/dist/conformance/Flags.js.map +1 -0
  203. package/dist/conformance/Host.d.ts +64 -0
  204. package/dist/conformance/Host.d.ts.map +1 -0
  205. package/dist/conformance/Host.js +152 -0
  206. package/dist/conformance/Host.js.map +1 -0
  207. package/dist/conformance/HttpApi.d.ts +5 -0
  208. package/dist/conformance/HttpApi.d.ts.map +1 -0
  209. package/dist/conformance/HttpApi.js +131 -0
  210. package/dist/conformance/HttpApi.js.map +1 -0
  211. package/dist/conformance/InboxReference.d.ts +28 -0
  212. package/dist/conformance/InboxReference.d.ts.map +1 -0
  213. package/dist/conformance/InboxReference.js +331 -0
  214. package/dist/conformance/InboxReference.js.map +1 -0
  215. package/dist/conformance/InboxSubject.d.ts +92 -0
  216. package/dist/conformance/InboxSubject.d.ts.map +1 -0
  217. package/dist/conformance/InboxSubject.js +16 -0
  218. package/dist/conformance/InboxSubject.js.map +1 -0
  219. package/dist/conformance/Ingestion.d.ts +10 -0
  220. package/dist/conformance/Ingestion.d.ts.map +1 -0
  221. package/dist/conformance/Ingestion.js +335 -0
  222. package/dist/conformance/Ingestion.js.map +1 -0
  223. package/dist/conformance/Ingress.d.ts +62 -0
  224. package/dist/conformance/Ingress.d.ts.map +1 -0
  225. package/dist/conformance/Ingress.js +346 -0
  226. package/dist/conformance/Ingress.js.map +1 -0
  227. package/dist/conformance/Invocation.d.ts +3 -0
  228. package/dist/conformance/Invocation.d.ts.map +1 -0
  229. package/dist/conformance/Invocation.js +665 -0
  230. package/dist/conformance/Invocation.js.map +1 -0
  231. package/dist/conformance/IsolationMatrix.d.ts +60 -0
  232. package/dist/conformance/IsolationMatrix.d.ts.map +1 -0
  233. package/dist/conformance/IsolationMatrix.js +196 -0
  234. package/dist/conformance/IsolationMatrix.js.map +1 -0
  235. package/dist/conformance/LiveConnection.d.ts +72 -0
  236. package/dist/conformance/LiveConnection.d.ts.map +1 -0
  237. package/dist/conformance/LiveConnection.js +125 -0
  238. package/dist/conformance/LiveConnection.js.map +1 -0
  239. package/dist/conformance/LocalClient.d.ts +62 -0
  240. package/dist/conformance/LocalClient.d.ts.map +1 -0
  241. package/dist/conformance/LocalClient.js +526 -0
  242. package/dist/conformance/LocalClient.js.map +1 -0
  243. package/dist/conformance/Locale.d.ts +28 -0
  244. package/dist/conformance/Locale.d.ts.map +1 -0
  245. package/dist/conformance/Locale.js +115 -0
  246. package/dist/conformance/Locale.js.map +1 -0
  247. package/dist/conformance/MachineIdentity.d.ts +39 -0
  248. package/dist/conformance/MachineIdentity.d.ts.map +1 -0
  249. package/dist/conformance/MachineIdentity.js +595 -0
  250. package/dist/conformance/MachineIdentity.js.map +1 -0
  251. package/dist/conformance/MailProvider.d.ts +4 -0
  252. package/dist/conformance/MailProvider.d.ts.map +1 -0
  253. package/dist/conformance/MailProvider.js +167 -0
  254. package/dist/conformance/MailProvider.js.map +1 -0
  255. package/dist/conformance/Memory.d.ts +10 -0
  256. package/dist/conformance/Memory.d.ts.map +1 -0
  257. package/dist/conformance/Memory.js +179 -0
  258. package/dist/conformance/Memory.js.map +1 -0
  259. package/dist/conformance/Messaging.d.ts +49 -0
  260. package/dist/conformance/Messaging.d.ts.map +1 -0
  261. package/dist/conformance/Messaging.js +117 -0
  262. package/dist/conformance/Messaging.js.map +1 -0
  263. package/dist/conformance/Metering.d.ts +26 -0
  264. package/dist/conformance/Metering.d.ts.map +1 -0
  265. package/dist/conformance/Metering.js +236 -0
  266. package/dist/conformance/Metering.js.map +1 -0
  267. package/dist/conformance/ModelProvider.d.ts +32 -0
  268. package/dist/conformance/ModelProvider.d.ts.map +1 -0
  269. package/dist/conformance/ModelProvider.js +100 -0
  270. package/dist/conformance/ModelProvider.js.map +1 -0
  271. package/dist/conformance/ModuleManifest.d.ts +9 -0
  272. package/dist/conformance/ModuleManifest.d.ts.map +1 -0
  273. package/dist/conformance/ModuleManifest.js +542 -0
  274. package/dist/conformance/ModuleManifest.js.map +1 -0
  275. package/dist/conformance/NotebookAgent.d.ts +32 -0
  276. package/dist/conformance/NotebookAgent.d.ts.map +1 -0
  277. package/dist/conformance/NotebookAgent.js +31 -0
  278. package/dist/conformance/NotebookAgent.js.map +1 -0
  279. package/dist/conformance/NotificationChannel.d.ts +40 -0
  280. package/dist/conformance/NotificationChannel.d.ts.map +1 -0
  281. package/dist/conformance/NotificationChannel.js +78 -0
  282. package/dist/conformance/NotificationChannel.js.map +1 -0
  283. package/dist/conformance/Notifications.d.ts +3 -0
  284. package/dist/conformance/Notifications.d.ts.map +1 -0
  285. package/dist/conformance/Notifications.js +240 -0
  286. package/dist/conformance/Notifications.js.map +1 -0
  287. package/dist/conformance/OAuthClient.d.ts +123 -0
  288. package/dist/conformance/OAuthClient.d.ts.map +1 -0
  289. package/dist/conformance/OAuthClient.js +204 -0
  290. package/dist/conformance/OAuthClient.js.map +1 -0
  291. package/dist/conformance/Outbox.d.ts +3 -0
  292. package/dist/conformance/Outbox.d.ts.map +1 -0
  293. package/dist/conformance/Outbox.js +266 -0
  294. package/dist/conformance/Outbox.js.map +1 -0
  295. package/dist/conformance/PlatformReference.d.ts +5 -0
  296. package/dist/conformance/PlatformReference.d.ts.map +1 -0
  297. package/dist/conformance/PlatformReference.js +66 -0
  298. package/dist/conformance/PlatformReference.js.map +1 -0
  299. package/dist/conformance/PlatformSubject.d.ts +45 -0
  300. package/dist/conformance/PlatformSubject.d.ts.map +1 -0
  301. package/dist/conformance/PlatformSubject.js +3 -0
  302. package/dist/conformance/PlatformSubject.js.map +1 -0
  303. package/dist/conformance/Privacy.d.ts +3 -0
  304. package/dist/conformance/Privacy.d.ts.map +1 -0
  305. package/dist/conformance/Privacy.js +437 -0
  306. package/dist/conformance/Privacy.js.map +1 -0
  307. package/dist/conformance/Progress.d.ts +3 -0
  308. package/dist/conformance/Progress.d.ts.map +1 -0
  309. package/dist/conformance/Progress.js +153 -0
  310. package/dist/conformance/Progress.js.map +1 -0
  311. package/dist/conformance/Push.d.ts +38 -0
  312. package/dist/conformance/Push.d.ts.map +1 -0
  313. package/dist/conformance/Push.js +649 -0
  314. package/dist/conformance/Push.js.map +1 -0
  315. package/dist/conformance/PushReference.d.ts +3 -0
  316. package/dist/conformance/PushReference.d.ts.map +1 -0
  317. package/dist/conformance/PushReference.js +97 -0
  318. package/dist/conformance/PushReference.js.map +1 -0
  319. package/dist/conformance/QuerySurface.d.ts +9 -0
  320. package/dist/conformance/QuerySurface.d.ts.map +1 -0
  321. package/dist/conformance/QuerySurface.js +349 -0
  322. package/dist/conformance/QuerySurface.js.map +1 -0
  323. package/dist/conformance/Readiness.d.ts +23 -0
  324. package/dist/conformance/Readiness.d.ts.map +1 -0
  325. package/dist/conformance/Readiness.js +110 -0
  326. package/dist/conformance/Readiness.js.map +1 -0
  327. package/dist/conformance/Reference.d.ts +17 -0
  328. package/dist/conformance/Reference.d.ts.map +1 -0
  329. package/dist/conformance/Reference.js +246 -0
  330. package/dist/conformance/Reference.js.map +1 -0
  331. package/dist/conformance/Release.d.ts +73 -0
  332. package/dist/conformance/Release.d.ts.map +1 -0
  333. package/dist/conformance/Release.js +556 -0
  334. package/dist/conformance/Release.js.map +1 -0
  335. package/dist/conformance/ReleaseReference.d.ts +5 -0
  336. package/dist/conformance/ReleaseReference.d.ts.map +1 -0
  337. package/dist/conformance/ReleaseReference.js +124 -0
  338. package/dist/conformance/ReleaseReference.js.map +1 -0
  339. package/dist/conformance/ResultRendering.d.ts +3 -0
  340. package/dist/conformance/ResultRendering.d.ts.map +1 -0
  341. package/dist/conformance/ResultRendering.js +120 -0
  342. package/dist/conformance/ResultRendering.js.map +1 -0
  343. package/dist/conformance/Sandbox.d.ts +58 -0
  344. package/dist/conformance/Sandbox.d.ts.map +1 -0
  345. package/dist/conformance/Sandbox.js +213 -0
  346. package/dist/conformance/Sandbox.js.map +1 -0
  347. package/dist/conformance/SandboxReference.d.ts +3 -0
  348. package/dist/conformance/SandboxReference.d.ts.map +1 -0
  349. package/dist/conformance/SandboxReference.js +44 -0
  350. package/dist/conformance/SandboxReference.js.map +1 -0
  351. package/dist/conformance/Scheduler.d.ts +106 -0
  352. package/dist/conformance/Scheduler.d.ts.map +1 -0
  353. package/dist/conformance/Scheduler.js +576 -0
  354. package/dist/conformance/Scheduler.js.map +1 -0
  355. package/dist/conformance/ScreenContext.d.ts +84 -0
  356. package/dist/conformance/ScreenContext.d.ts.map +1 -0
  357. package/dist/conformance/ScreenContext.js +290 -0
  358. package/dist/conformance/ScreenContext.js.map +1 -0
  359. package/dist/conformance/Search.d.ts +3 -0
  360. package/dist/conformance/Search.d.ts.map +1 -0
  361. package/dist/conformance/Search.js +333 -0
  362. package/dist/conformance/Search.js.map +1 -0
  363. package/dist/conformance/Secrets.d.ts +8 -0
  364. package/dist/conformance/Secrets.d.ts.map +1 -0
  365. package/dist/conformance/Secrets.js +231 -0
  366. package/dist/conformance/Secrets.js.map +1 -0
  367. package/dist/conformance/SecretsReference.d.ts +44 -0
  368. package/dist/conformance/SecretsReference.d.ts.map +1 -0
  369. package/dist/conformance/SecretsReference.js +73 -0
  370. package/dist/conformance/SecretsReference.js.map +1 -0
  371. package/dist/conformance/ServicesReference.d.ts +8 -0
  372. package/dist/conformance/ServicesReference.d.ts.map +1 -0
  373. package/dist/conformance/ServicesReference.js +273 -0
  374. package/dist/conformance/ServicesReference.js.map +1 -0
  375. package/dist/conformance/ServicesSubject.d.ts +104 -0
  376. package/dist/conformance/ServicesSubject.d.ts.map +1 -0
  377. package/dist/conformance/ServicesSubject.js +2 -0
  378. package/dist/conformance/ServicesSubject.js.map +1 -0
  379. package/dist/conformance/Settings.d.ts +3 -0
  380. package/dist/conformance/Settings.d.ts.map +1 -0
  381. package/dist/conformance/Settings.js +177 -0
  382. package/dist/conformance/Settings.js.map +1 -0
  383. package/dist/conformance/Sharing.d.ts +3 -0
  384. package/dist/conformance/Sharing.d.ts.map +1 -0
  385. package/dist/conformance/Sharing.js +368 -0
  386. package/dist/conformance/Sharing.js.map +1 -0
  387. package/dist/conformance/ShellSubject.d.ts +29 -0
  388. package/dist/conformance/ShellSubject.d.ts.map +1 -0
  389. package/dist/conformance/ShellSubject.js +13 -0
  390. package/dist/conformance/ShellSubject.js.map +1 -0
  391. package/dist/conformance/SignOutRace.d.ts +23 -0
  392. package/dist/conformance/SignOutRace.d.ts.map +1 -0
  393. package/dist/conformance/SignOutRace.js +49 -0
  394. package/dist/conformance/SignOutRace.js.map +1 -0
  395. package/dist/conformance/Slot.d.ts +3 -0
  396. package/dist/conformance/Slot.d.ts.map +1 -0
  397. package/dist/conformance/Slot.js +79 -0
  398. package/dist/conformance/Slot.js.map +1 -0
  399. package/dist/conformance/Space.d.ts +63 -0
  400. package/dist/conformance/Space.d.ts.map +1 -0
  401. package/dist/conformance/Space.js +294 -0
  402. package/dist/conformance/Space.js.map +1 -0
  403. package/dist/conformance/StorageAdapter.d.ts +76 -0
  404. package/dist/conformance/StorageAdapter.d.ts.map +1 -0
  405. package/dist/conformance/StorageAdapter.js +181 -0
  406. package/dist/conformance/StorageAdapter.js.map +1 -0
  407. package/dist/conformance/StorageBackend.d.ts +23 -0
  408. package/dist/conformance/StorageBackend.d.ts.map +1 -0
  409. package/dist/conformance/StorageBackend.js +274 -0
  410. package/dist/conformance/StorageBackend.js.map +1 -0
  411. package/dist/conformance/Subject.d.ts +198 -0
  412. package/dist/conformance/Subject.d.ts.map +1 -0
  413. package/dist/conformance/Subject.js +26 -0
  414. package/dist/conformance/Subject.js.map +1 -0
  415. package/dist/conformance/Sync.d.ts +3 -0
  416. package/dist/conformance/Sync.d.ts.map +1 -0
  417. package/dist/conformance/Sync.js +190 -0
  418. package/dist/conformance/Sync.js.map +1 -0
  419. package/dist/conformance/Telemetry.d.ts +3 -0
  420. package/dist/conformance/Telemetry.d.ts.map +1 -0
  421. package/dist/conformance/Telemetry.js +218 -0
  422. package/dist/conformance/Telemetry.js.map +1 -0
  423. package/dist/conformance/ThemeTokens.d.ts +22 -0
  424. package/dist/conformance/ThemeTokens.d.ts.map +1 -0
  425. package/dist/conformance/ThemeTokens.js +121 -0
  426. package/dist/conformance/ThemeTokens.js.map +1 -0
  427. package/dist/conformance/ToolSource.d.ts +5 -0
  428. package/dist/conformance/ToolSource.d.ts.map +1 -0
  429. package/dist/conformance/ToolSource.js +520 -0
  430. package/dist/conformance/ToolSource.js.map +1 -0
  431. package/dist/conformance/Versioning.d.ts +3 -0
  432. package/dist/conformance/Versioning.d.ts.map +1 -0
  433. package/dist/conformance/Versioning.js +160 -0
  434. package/dist/conformance/Versioning.js.map +1 -0
  435. package/dist/conformance/View.d.ts +3 -0
  436. package/dist/conformance/View.d.ts.map +1 -0
  437. package/dist/conformance/View.js +121 -0
  438. package/dist/conformance/View.js.map +1 -0
  439. package/dist/conformance/WorkItems.d.ts +3 -0
  440. package/dist/conformance/WorkItems.d.ts.map +1 -0
  441. package/dist/conformance/WorkItems.js +152 -0
  442. package/dist/conformance/WorkItems.js.map +1 -0
  443. package/dist/conformance/Workflow.d.ts +63 -0
  444. package/dist/conformance/Workflow.d.ts.map +1 -0
  445. package/dist/conformance/Workflow.js +235 -0
  446. package/dist/conformance/Workflow.js.map +1 -0
  447. package/dist/conformance/acme/chatlog.d.ts +591 -0
  448. package/dist/conformance/acme/chatlog.d.ts.map +1 -0
  449. package/dist/conformance/acme/chatlog.js +101 -0
  450. package/dist/conformance/acme/chatlog.js.map +1 -0
  451. package/dist/conformance/acme/connector.d.ts +12 -0
  452. package/dist/conformance/acme/connector.d.ts.map +1 -0
  453. package/dist/conformance/acme/connector.js +123 -0
  454. package/dist/conformance/acme/connector.js.map +1 -0
  455. package/dist/conformance/acme/migrations/0000_messages.sql +8 -0
  456. package/dist/conformance/archive/app.d.ts +728 -0
  457. package/dist/conformance/archive/app.d.ts.map +1 -0
  458. package/dist/conformance/archive/app.js +30 -0
  459. package/dist/conformance/archive/app.js.map +1 -0
  460. package/dist/conformance/archive/contract.d.ts +467 -0
  461. package/dist/conformance/archive/contract.d.ts.map +1 -0
  462. package/dist/conformance/archive/contract.js +187 -0
  463. package/dist/conformance/archive/contract.js.map +1 -0
  464. package/dist/conformance/archive/memo.sync.gen.d.ts +148 -0
  465. package/dist/conformance/archive/memo.sync.gen.d.ts.map +1 -0
  466. package/dist/conformance/archive/memo.sync.gen.js +23 -0
  467. package/dist/conformance/archive/memo.sync.gen.js.map +1 -0
  468. package/dist/conformance/archive/migrations/archive/0000_archive.sql +9 -0
  469. package/dist/conformance/archive/migrations/memo/0000_memo.sql +6 -0
  470. package/dist/conformance/archive/schema.d.ts +185 -0
  471. package/dist/conformance/archive/schema.d.ts.map +1 -0
  472. package/dist/conformance/archive/schema.js +22 -0
  473. package/dist/conformance/archive/schema.js.map +1 -0
  474. package/dist/conformance/archive/server.d.ts +273 -0
  475. package/dist/conformance/archive/server.d.ts.map +1 -0
  476. package/dist/conformance/archive/server.js +127 -0
  477. package/dist/conformance/archive/server.js.map +1 -0
  478. package/dist/conformance/archive/sync.gen.d.ts +319 -0
  479. package/dist/conformance/archive/sync.gen.d.ts.map +1 -0
  480. package/dist/conformance/archive/sync.gen.js +29 -0
  481. package/dist/conformance/archive/sync.gen.js.map +1 -0
  482. package/dist/conformance/atlas/app.d.ts +3 -0
  483. package/dist/conformance/atlas/app.d.ts.map +1 -0
  484. package/dist/conformance/atlas/app.js +15 -0
  485. package/dist/conformance/atlas/app.js.map +1 -0
  486. package/dist/conformance/atlas/contract.d.ts +489 -0
  487. package/dist/conformance/atlas/contract.d.ts.map +1 -0
  488. package/dist/conformance/atlas/contract.js +114 -0
  489. package/dist/conformance/atlas/contract.js.map +1 -0
  490. package/dist/conformance/crm/app.d.ts +304 -0
  491. package/dist/conformance/crm/app.d.ts.map +1 -0
  492. package/dist/conformance/crm/app.js +95 -0
  493. package/dist/conformance/crm/app.js.map +1 -0
  494. package/dist/conformance/crm/contract.d.ts +586 -0
  495. package/dist/conformance/crm/contract.d.ts.map +1 -0
  496. package/dist/conformance/crm/contract.js +153 -0
  497. package/dist/conformance/crm/contract.js.map +1 -0
  498. package/dist/conformance/crm/migrations/crm/0000_crm.sql +18 -0
  499. package/dist/conformance/crm/migrations/team/0000_team.sql +6 -0
  500. package/dist/conformance/crm/schema.d.ts +261 -0
  501. package/dist/conformance/crm/schema.d.ts.map +1 -0
  502. package/dist/conformance/crm/schema.js +25 -0
  503. package/dist/conformance/crm/schema.js.map +1 -0
  504. package/dist/conformance/crm/sync.gen.d.ts +188 -0
  505. package/dist/conformance/crm/sync.gen.d.ts.map +1 -0
  506. package/dist/conformance/crm/sync.gen.js +25 -0
  507. package/dist/conformance/crm/sync.gen.js.map +1 -0
  508. package/dist/conformance/desk/contract.d.ts +306 -0
  509. package/dist/conformance/desk/contract.d.ts.map +1 -0
  510. package/dist/conformance/desk/contract.js +56 -0
  511. package/dist/conformance/desk/contract.js.map +1 -0
  512. package/dist/conformance/desk/migrations/0000_notes.sql +7 -0
  513. package/dist/conformance/desk/server.d.ts +231 -0
  514. package/dist/conformance/desk/server.d.ts.map +1 -0
  515. package/dist/conformance/desk/server.js +123 -0
  516. package/dist/conformance/desk/server.js.map +1 -0
  517. package/dist/conformance/drafts/migrations/0000_drafts.sql +8 -0
  518. package/dist/conformance/drafts/module.d.ts +571 -0
  519. package/dist/conformance/drafts/module.d.ts.map +1 -0
  520. package/dist/conformance/drafts/module.js +190 -0
  521. package/dist/conformance/drafts/module.js.map +1 -0
  522. package/dist/conformance/fixture/app.d.ts +24 -0
  523. package/dist/conformance/fixture/app.d.ts.map +1 -0
  524. package/dist/conformance/fixture/app.js +26 -0
  525. package/dist/conformance/fixture/app.js.map +1 -0
  526. package/dist/conformance/fixture/docs/bad-sync.d.ts +105 -0
  527. package/dist/conformance/fixture/docs/bad-sync.d.ts.map +1 -0
  528. package/dist/conformance/fixture/docs/bad-sync.js +22 -0
  529. package/dist/conformance/fixture/docs/bad-sync.js.map +1 -0
  530. package/dist/conformance/fixture/docs/contract.d.ts +1091 -0
  531. package/dist/conformance/fixture/docs/contract.d.ts.map +1 -0
  532. package/dist/conformance/fixture/docs/contract.js +277 -0
  533. package/dist/conformance/fixture/docs/contract.js.map +1 -0
  534. package/dist/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
  535. package/dist/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
  536. package/dist/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
  537. package/dist/conformance/fixture/docs/policy.cedar +110 -0
  538. package/dist/conformance/fixture/docs/schema.d.ts +308 -0
  539. package/dist/conformance/fixture/docs/schema.d.ts.map +1 -0
  540. package/dist/conformance/fixture/docs/schema.js +36 -0
  541. package/dist/conformance/fixture/docs/schema.js.map +1 -0
  542. package/dist/conformance/fixture/docs/server.d.ts +552 -0
  543. package/dist/conformance/fixture/docs/server.d.ts.map +1 -0
  544. package/dist/conformance/fixture/docs/server.js +192 -0
  545. package/dist/conformance/fixture/docs/server.js.map +1 -0
  546. package/dist/conformance/fixture/docs/sync.d.ts +402 -0
  547. package/dist/conformance/fixture/docs/sync.d.ts.map +1 -0
  548. package/dist/conformance/fixture/docs/sync.gen.d.ts +574 -0
  549. package/dist/conformance/fixture/docs/sync.gen.d.ts.map +1 -0
  550. package/dist/conformance/fixture/docs/sync.gen.js +48 -0
  551. package/dist/conformance/fixture/docs/sync.gen.js.map +1 -0
  552. package/dist/conformance/fixture/docs/sync.js +23 -0
  553. package/dist/conformance/fixture/docs/sync.js.map +1 -0
  554. package/dist/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
  555. package/dist/conformance/fixture/peer/module.d.ts +306 -0
  556. package/dist/conformance/fixture/peer/module.d.ts.map +1 -0
  557. package/dist/conformance/fixture/peer/module.js +44 -0
  558. package/dist/conformance/fixture/peer/module.js.map +1 -0
  559. package/dist/conformance/fixture/release/blocking/0000_item.sql +3 -0
  560. package/dist/conformance/fixture/release/blocking/0001_wait.sql +2 -0
  561. package/dist/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
  562. package/dist/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
  563. package/dist/conformance/fixture/release/broken/0000_item.sql +3 -0
  564. package/dist/conformance/fixture/release/broken/0001_extra.sql +3 -0
  565. package/dist/conformance/fixture/release/broken/0002_label.sql +3 -0
  566. package/dist/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
  567. package/dist/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
  568. package/dist/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
  569. package/dist/conformance/fixture/release/escape/0000_item.sql +3 -0
  570. package/dist/conformance/fixture/release/escape/0001_escape.sql +5 -0
  571. package/dist/conformance/fixture/release/misnamed/0000_item.sql +3 -0
  572. package/dist/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
  573. package/dist/conformance/fixture/release/module.d.ts +1878 -0
  574. package/dist/conformance/fixture/release/module.d.ts.map +1 -0
  575. package/dist/conformance/fixture/release/module.js +102 -0
  576. package/dist/conformance/fixture/release/module.js.map +1 -0
  577. package/dist/conformance/fixture/release/outside/0000_item.sql +3 -0
  578. package/dist/conformance/fixture/release/outside/0001_extra.sql +3 -0
  579. package/dist/conformance/fixture/release/outside/0002_index.sql +4 -0
  580. package/dist/conformance/fixture/release/outside/0003_later.sql +1 -0
  581. package/dist/conformance/fixture/release/renamed/0000_item.sql +3 -0
  582. package/dist/conformance/fixture/release/renamed/0001_misname.sql +10 -0
  583. package/dist/conformance/fixture/release/renamed/0002_restore.sql +1 -0
  584. package/dist/conformance/fixture/release/rogue/0000_item.sql +3 -0
  585. package/dist/conformance/fixture/release/rogue/0001_extra.sql +3 -0
  586. package/dist/conformance/fixture/release/rogue/0002_definer.sql +1 -0
  587. package/dist/conformance/fixture/release/slow/0000_item.sql +5 -0
  588. package/dist/conformance/fixture/release/undeclared/0000_item.sql +3 -0
  589. package/dist/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
  590. package/dist/conformance/fixture/release/undeclared/0002_index.sql +1 -0
  591. package/dist/conformance/fixture/release/v1/0000_item.sql +3 -0
  592. package/dist/conformance/fixture/release/v2/0000_item.sql +3 -0
  593. package/dist/conformance/fixture/release/v2/0001_extra.sql +3 -0
  594. package/dist/conformance/fixture/release/v2/0002_label.sql +3 -0
  595. package/dist/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
  596. package/dist/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
  597. package/dist/conformance/kit-hash.d.ts +8 -0
  598. package/dist/conformance/kit-hash.d.ts.map +1 -0
  599. package/dist/conformance/kit-hash.js +20 -0
  600. package/dist/conformance/kit-hash.js.map +1 -0
  601. package/dist/conformance/ledger/contract.d.ts +380 -0
  602. package/dist/conformance/ledger/contract.d.ts.map +1 -0
  603. package/dist/conformance/ledger/contract.js +81 -0
  604. package/dist/conformance/ledger/contract.js.map +1 -0
  605. package/dist/conformance/ledger/migrations/0000_entries.sql +8 -0
  606. package/dist/conformance/ledger/server.d.ts +312 -0
  607. package/dist/conformance/ledger/server.d.ts.map +1 -0
  608. package/dist/conformance/ledger/server.js +152 -0
  609. package/dist/conformance/ledger/server.js.map +1 -0
  610. package/dist/conformance/library/app.d.ts +616 -0
  611. package/dist/conformance/library/app.d.ts.map +1 -0
  612. package/dist/conformance/library/app.js +35 -0
  613. package/dist/conformance/library/app.js.map +1 -0
  614. package/dist/conformance/library/contract.d.ts +377 -0
  615. package/dist/conformance/library/contract.d.ts.map +1 -0
  616. package/dist/conformance/library/contract.js +63 -0
  617. package/dist/conformance/library/contract.js.map +1 -0
  618. package/dist/conformance/library/migrations/0000_library.sql +14 -0
  619. package/dist/conformance/library/schema.d.ts +174 -0
  620. package/dist/conformance/library/schema.d.ts.map +1 -0
  621. package/dist/conformance/library/schema.js +24 -0
  622. package/dist/conformance/library/schema.js.map +1 -0
  623. package/dist/conformance/library/server.d.ts +191 -0
  624. package/dist/conformance/library/server.d.ts.map +1 -0
  625. package/dist/conformance/library/server.js +52 -0
  626. package/dist/conformance/library/server.js.map +1 -0
  627. package/dist/conformance/library/sync.gen.d.ts +519 -0
  628. package/dist/conformance/library/sync.gen.d.ts.map +1 -0
  629. package/dist/conformance/library/sync.gen.js +42 -0
  630. package/dist/conformance/library/sync.gen.js.map +1 -0
  631. package/dist/conformance/locale/catalog.d.ts +93 -0
  632. package/dist/conformance/locale/catalog.d.ts.map +1 -0
  633. package/dist/conformance/locale/catalog.js +104 -0
  634. package/dist/conformance/locale/catalog.js.map +1 -0
  635. package/dist/conformance/notebook/app.d.ts +1039 -0
  636. package/dist/conformance/notebook/app.d.ts.map +1 -0
  637. package/dist/conformance/notebook/app.js +88 -0
  638. package/dist/conformance/notebook/app.js.map +1 -0
  639. package/dist/conformance/notebook/evals/pages.evals.json +94 -0
  640. package/dist/conformance/notebook/migrations/0000_notebook.sql +10 -0
  641. package/dist/conformance/notebook/module.d.ts +717 -0
  642. package/dist/conformance/notebook/module.d.ts.map +1 -0
  643. package/dist/conformance/notebook/module.js +188 -0
  644. package/dist/conformance/notebook/module.js.map +1 -0
  645. package/dist/conformance/pad/app.d.ts +9 -0
  646. package/dist/conformance/pad/app.d.ts.map +1 -0
  647. package/dist/conformance/pad/app.js +13 -0
  648. package/dist/conformance/pad/app.js.map +1 -0
  649. package/dist/conformance/pad/contract.d.ts +281 -0
  650. package/dist/conformance/pad/contract.d.ts.map +1 -0
  651. package/dist/conformance/pad/contract.js +66 -0
  652. package/dist/conformance/pad/contract.js.map +1 -0
  653. package/dist/conformance/pad/migrations/pad/0000_pad.sql +8 -0
  654. package/dist/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
  655. package/dist/conformance/pad/schema.d.ts +127 -0
  656. package/dist/conformance/pad/schema.d.ts.map +1 -0
  657. package/dist/conformance/pad/schema.js +17 -0
  658. package/dist/conformance/pad/schema.js.map +1 -0
  659. package/dist/conformance/pad/server.d.ts +149 -0
  660. package/dist/conformance/pad/server.d.ts.map +1 -0
  661. package/dist/conformance/pad/server.js +81 -0
  662. package/dist/conformance/pad/server.js.map +1 -0
  663. package/dist/conformance/purchases/app.d.ts +480 -0
  664. package/dist/conformance/purchases/app.d.ts.map +1 -0
  665. package/dist/conformance/purchases/app.js +32 -0
  666. package/dist/conformance/purchases/app.js.map +1 -0
  667. package/dist/conformance/purchases/contract.d.ts +720 -0
  668. package/dist/conformance/purchases/contract.d.ts.map +1 -0
  669. package/dist/conformance/purchases/contract.js +148 -0
  670. package/dist/conformance/purchases/contract.js.map +1 -0
  671. package/dist/conformance/purchases/migrations/0000_purchases.sql +17 -0
  672. package/dist/conformance/purchases/server.d.ts +250 -0
  673. package/dist/conformance/purchases/server.d.ts.map +1 -0
  674. package/dist/conformance/purchases/server.js +85 -0
  675. package/dist/conformance/purchases/server.js.map +1 -0
  676. package/dist/conformance/studio/app.d.ts +996 -0
  677. package/dist/conformance/studio/app.d.ts.map +1 -0
  678. package/dist/conformance/studio/app.js +251 -0
  679. package/dist/conformance/studio/app.js.map +1 -0
  680. package/dist/conformance/studio/contract.d.ts +1318 -0
  681. package/dist/conformance/studio/contract.d.ts.map +1 -0
  682. package/dist/conformance/studio/contract.js +280 -0
  683. package/dist/conformance/studio/contract.js.map +1 -0
  684. package/dist/conformance/studio/migrations/billing/0000_billing.sql +6 -0
  685. package/dist/conformance/studio/migrations/journal/0000_journal.sql +9 -0
  686. package/dist/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
  687. package/dist/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
  688. package/dist/conformance/workshop/app.d.ts +8 -0
  689. package/dist/conformance/workshop/app.d.ts.map +1 -0
  690. package/dist/conformance/workshop/app.js +13 -0
  691. package/dist/conformance/workshop/app.js.map +1 -0
  692. package/dist/conformance/workshop/migrations/0000_notes.sql +7 -0
  693. package/dist/conformance/workshop/module.d.ts +407 -0
  694. package/dist/conformance/workshop/module.d.ts.map +1 -0
  695. package/dist/conformance/workshop/module.js +71 -0
  696. package/dist/conformance/workshop/module.js.map +1 -0
  697. package/dist/fakes/AcmeFake.d.ts +46 -0
  698. package/dist/fakes/AcmeFake.d.ts.map +1 -0
  699. package/dist/fakes/AcmeFake.js +131 -0
  700. package/dist/fakes/AcmeFake.js.map +1 -0
  701. package/dist/fakes/ApnsFake.d.ts +79 -0
  702. package/dist/fakes/ApnsFake.d.ts.map +1 -0
  703. package/dist/fakes/ApnsFake.js +220 -0
  704. package/dist/fakes/ApnsFake.js.map +1 -0
  705. package/dist/fakes/FcmFake.d.ts +46 -0
  706. package/dist/fakes/FcmFake.d.ts.map +1 -0
  707. package/dist/fakes/FcmFake.js +185 -0
  708. package/dist/fakes/FcmFake.js.map +1 -0
  709. package/dist/fakes/GoogleFake.d.ts +221 -0
  710. package/dist/fakes/GoogleFake.d.ts.map +1 -0
  711. package/dist/fakes/GoogleFake.js +1035 -0
  712. package/dist/fakes/GoogleFake.js.map +1 -0
  713. package/dist/fakes/HttpApiFake.d.ts +22 -0
  714. package/dist/fakes/HttpApiFake.d.ts.map +1 -0
  715. package/dist/fakes/HttpApiFake.js +74 -0
  716. package/dist/fakes/HttpApiFake.js.map +1 -0
  717. package/dist/fakes/McpFake.d.ts +80 -0
  718. package/dist/fakes/McpFake.d.ts.map +1 -0
  719. package/dist/fakes/McpFake.js +312 -0
  720. package/dist/fakes/McpFake.js.map +1 -0
  721. package/dist/fakes/MicrosoftGraphFake.d.ts +254 -0
  722. package/dist/fakes/MicrosoftGraphFake.d.ts.map +1 -0
  723. package/dist/fakes/MicrosoftGraphFake.js +850 -0
  724. package/dist/fakes/MicrosoftGraphFake.js.map +1 -0
  725. package/dist/fakes/S3Fake.d.ts +29 -0
  726. package/dist/fakes/S3Fake.d.ts.map +1 -0
  727. package/dist/fakes/S3Fake.js +347 -0
  728. package/dist/fakes/S3Fake.js.map +1 -0
  729. package/dist/fakes/Server.d.ts +137 -0
  730. package/dist/fakes/Server.d.ts.map +1 -0
  731. package/dist/fakes/Server.js +357 -0
  732. package/dist/fakes/Server.js.map +1 -0
  733. package/dist/fakes/SignInProviderFake.d.ts +21 -0
  734. package/dist/fakes/SignInProviderFake.d.ts.map +1 -0
  735. package/dist/fakes/SignInProviderFake.js +56 -0
  736. package/dist/fakes/SignInProviderFake.js.map +1 -0
  737. package/dist/fakes/SlackFake.d.ts +136 -0
  738. package/dist/fakes/SlackFake.d.ts.map +1 -0
  739. package/dist/fakes/SlackFake.js +787 -0
  740. package/dist/fakes/SlackFake.js.map +1 -0
  741. package/dist/fakes/Store.d.ts +40 -0
  742. package/dist/fakes/Store.d.ts.map +1 -0
  743. package/dist/fakes/Store.js +82 -0
  744. package/dist/fakes/Store.js.map +1 -0
  745. package/dist/fakes/TelemetryFakes.d.ts +77 -0
  746. package/dist/fakes/TelemetryFakes.d.ts.map +1 -0
  747. package/dist/fakes/TelemetryFakes.js +121 -0
  748. package/dist/fakes/TelemetryFakes.js.map +1 -0
  749. package/dist/fakes/TestCa.d.ts +11 -0
  750. package/dist/fakes/TestCa.d.ts.map +1 -0
  751. package/dist/fakes/TestCa.js +115 -0
  752. package/dist/fakes/TestCa.js.map +1 -0
  753. package/dist/fakes/WorkOsFake.d.ts +40 -0
  754. package/dist/fakes/WorkOsFake.d.ts.map +1 -0
  755. package/dist/fakes/WorkOsFake.js +103 -0
  756. package/dist/fakes/WorkOsFake.js.map +1 -0
  757. package/dist/index.d.ts +10 -0
  758. package/dist/index.d.ts.map +1 -0
  759. package/dist/index.js +10 -0
  760. package/dist/index.js.map +1 -0
  761. package/dist/make/reference.d.ts +520 -0
  762. package/dist/make/reference.d.ts.map +1 -0
  763. package/dist/make/reference.js +182 -0
  764. package/dist/make/reference.js.map +1 -0
  765. package/dist/make/sources.d.ts +48 -0
  766. package/dist/make/sources.d.ts.map +1 -0
  767. package/dist/make/sources.js +806 -0
  768. package/dist/make/sources.js.map +1 -0
  769. package/package.json +77 -3
  770. package/src/Admin.ts +82 -0
  771. package/src/Agent.ts +289 -0
  772. package/src/AgentSurface.ts +51 -0
  773. package/src/Embedder.ts +69 -0
  774. package/src/EvalMain.ts +81 -0
  775. package/src/Evals.ts +490 -0
  776. package/src/Kernel.ts +228 -0
  777. package/src/Launch.ts +428 -0
  778. package/src/Locks.ts +123 -0
  779. package/src/Routes.ts +65 -0
  780. package/src/ScriptedChatModel.ts +189 -0
  781. package/src/SmtpSink.ts +205 -0
  782. package/src/System.ts +1072 -0
  783. package/src/TcpProxy.ts +102 -0
  784. package/src/auth/TrustedProxyAuth.ts +173 -0
  785. package/src/conformance/ActionConsent.ts +437 -0
  786. package/src/conformance/ActionRegistry.ts +174 -0
  787. package/src/conformance/Actor.ts +216 -0
  788. package/src/conformance/AgentReference.ts +171 -0
  789. package/src/conformance/AgentResources.ts +548 -0
  790. package/src/conformance/AgentRuntime.ts +388 -0
  791. package/src/conformance/AgentSubject.ts +103 -0
  792. package/src/conformance/Approvals.ts +363 -0
  793. package/src/conformance/Audit.ts +257 -0
  794. package/src/conformance/CalendarProvider.ts +156 -0
  795. package/src/conformance/CapabilityKit.ts +564 -0
  796. package/src/conformance/ClientSDK.ts +233 -0
  797. package/src/conformance/CollabDocument.ts +1203 -0
  798. package/src/conformance/CollabReference.ts +152 -0
  799. package/src/conformance/CollabSubject.ts +64 -0
  800. package/src/conformance/Command.ts +75 -0
  801. package/src/conformance/Connections.ts +357 -0
  802. package/src/conformance/ConnectionsReference.ts +172 -0
  803. package/src/conformance/ConnectorReference.ts +280 -0
  804. package/src/conformance/ContextAccounting.ts +169 -0
  805. package/src/conformance/Daemon.ts +936 -0
  806. package/src/conformance/DaemonReference.ts +189 -0
  807. package/src/conformance/DbTx.ts +253 -0
  808. package/src/conformance/DecisionTokens.ts +652 -0
  809. package/src/conformance/Delegation.ts +177 -0
  810. package/src/conformance/DeskReference.ts +73 -0
  811. package/src/conformance/DeviceControl.ts +700 -0
  812. package/src/conformance/Directory.ts +315 -0
  813. package/src/conformance/DirectoryProvider.ts +72 -0
  814. package/src/conformance/DocumentSource.ts +62 -0
  815. package/src/conformance/EndpointReference.ts +117 -0
  816. package/src/conformance/Files.ts +685 -0
  817. package/src/conformance/FilesReference.ts +154 -0
  818. package/src/conformance/FilesSubject.ts +50 -0
  819. package/src/conformance/Flags.ts +215 -0
  820. package/src/conformance/Host.ts +197 -0
  821. package/src/conformance/HttpApi.ts +169 -0
  822. package/src/conformance/InboxReference.ts +401 -0
  823. package/src/conformance/InboxSubject.ts +101 -0
  824. package/src/conformance/Ingestion.ts +425 -0
  825. package/src/conformance/Ingress.ts +498 -0
  826. package/src/conformance/Invocation.ts +780 -0
  827. package/src/conformance/IsolationMatrix.ts +215 -0
  828. package/src/conformance/LiveConnection.ts +197 -0
  829. package/src/conformance/LocalClient.ts +651 -0
  830. package/src/conformance/Locale.ts +141 -0
  831. package/src/conformance/MachineIdentity.ts +828 -0
  832. package/src/conformance/MailProvider.ts +217 -0
  833. package/src/conformance/Memory.ts +223 -0
  834. package/src/conformance/Messaging.ts +185 -0
  835. package/src/conformance/Metering.ts +293 -0
  836. package/src/conformance/ModelProvider.ts +139 -0
  837. package/src/conformance/ModuleManifest.ts +630 -0
  838. package/src/conformance/NotebookAgent.ts +41 -0
  839. package/src/conformance/NotificationChannel.ts +122 -0
  840. package/src/conformance/Notifications.ts +316 -0
  841. package/src/conformance/OAuthClient.ts +240 -0
  842. package/src/conformance/Outbox.ts +342 -0
  843. package/src/conformance/PlatformReference.ts +73 -0
  844. package/src/conformance/PlatformSubject.ts +50 -0
  845. package/src/conformance/Privacy.ts +577 -0
  846. package/src/conformance/Progress.ts +244 -0
  847. package/src/conformance/Push.ts +820 -0
  848. package/src/conformance/PushReference.ts +101 -0
  849. package/src/conformance/QuerySurface.ts +408 -0
  850. package/src/conformance/Readiness.ts +157 -0
  851. package/src/conformance/Reference.ts +326 -0
  852. package/src/conformance/Release.ts +690 -0
  853. package/src/conformance/ReleaseReference.ts +179 -0
  854. package/src/conformance/ResultRendering.ts +149 -0
  855. package/src/conformance/Sandbox.ts +313 -0
  856. package/src/conformance/SandboxReference.ts +52 -0
  857. package/src/conformance/Scheduler.ts +764 -0
  858. package/src/conformance/ScreenContext.ts +402 -0
  859. package/src/conformance/Search.ts +419 -0
  860. package/src/conformance/Secrets.ts +277 -0
  861. package/src/conformance/SecretsReference.ts +131 -0
  862. package/src/conformance/ServicesReference.ts +330 -0
  863. package/src/conformance/ServicesSubject.ts +105 -0
  864. package/src/conformance/Settings.ts +204 -0
  865. package/src/conformance/Sharing.ts +486 -0
  866. package/src/conformance/ShellSubject.ts +47 -0
  867. package/src/conformance/SignOutRace.ts +77 -0
  868. package/src/conformance/Slot.ts +84 -0
  869. package/src/conformance/Space.ts +432 -0
  870. package/src/conformance/StorageAdapter.ts +253 -0
  871. package/src/conformance/StorageBackend.ts +327 -0
  872. package/src/conformance/Subject.ts +208 -0
  873. package/src/conformance/Sync.ts +215 -0
  874. package/src/conformance/Telemetry.ts +287 -0
  875. package/src/conformance/ThemeTokens.ts +163 -0
  876. package/src/conformance/ToolSource.ts +632 -0
  877. package/src/conformance/Versioning.ts +199 -0
  878. package/src/conformance/View.ts +143 -0
  879. package/src/conformance/WorkItems.ts +186 -0
  880. package/src/conformance/Workflow.ts +304 -0
  881. package/src/conformance/acme/chatlog.ts +115 -0
  882. package/src/conformance/acme/connector.ts +151 -0
  883. package/src/conformance/acme/migrations/0000_messages.sql +8 -0
  884. package/src/conformance/archive/app.ts +33 -0
  885. package/src/conformance/archive/contract.ts +191 -0
  886. package/src/conformance/archive/memo.sync.gen.ts +25 -0
  887. package/src/conformance/archive/migrations/archive/0000_archive.sql +9 -0
  888. package/src/conformance/archive/migrations/memo/0000_memo.sql +6 -0
  889. package/src/conformance/archive/schema.ts +25 -0
  890. package/src/conformance/archive/server.ts +146 -0
  891. package/src/conformance/archive/sync.gen.ts +32 -0
  892. package/src/conformance/atlas/app.ts +16 -0
  893. package/src/conformance/atlas/contract.ts +118 -0
  894. package/src/conformance/crm/app.ts +107 -0
  895. package/src/conformance/crm/contract.ts +163 -0
  896. package/src/conformance/crm/migrations/crm/0000_crm.sql +18 -0
  897. package/src/conformance/crm/migrations/team/0000_team.sql +6 -0
  898. package/src/conformance/crm/schema.ts +28 -0
  899. package/src/conformance/crm/sync.gen.ts +27 -0
  900. package/src/conformance/desk/contract.ts +61 -0
  901. package/src/conformance/desk/migrations/0000_notes.sql +7 -0
  902. package/src/conformance/desk/server.ts +131 -0
  903. package/src/conformance/drafts/migrations/0000_drafts.sql +8 -0
  904. package/src/conformance/drafts/module.ts +211 -0
  905. package/src/conformance/fixture/app.ts +37 -0
  906. package/src/conformance/fixture/docs/bad-sync.ts +34 -0
  907. package/src/conformance/fixture/docs/contract.ts +297 -0
  908. package/src/conformance/fixture/docs/migrations/0000_docs.sql +9 -0
  909. package/src/conformance/fixture/docs/migrations/0001_seen.sql +12 -0
  910. package/src/conformance/fixture/docs/migrations/0002_attachment.sql +6 -0
  911. package/src/conformance/fixture/docs/policy.cedar +110 -0
  912. package/src/conformance/fixture/docs/schema.ts +41 -0
  913. package/src/conformance/fixture/docs/server.ts +292 -0
  914. package/src/conformance/fixture/docs/sync.gen.ts +54 -0
  915. package/src/conformance/fixture/docs/sync.ts +24 -0
  916. package/src/conformance/fixture/peer/migrations/0000_peer.sql +8 -0
  917. package/src/conformance/fixture/peer/module.ts +51 -0
  918. package/src/conformance/fixture/release/blocking/0000_item.sql +3 -0
  919. package/src/conformance/fixture/release/blocking/0001_wait.sql +2 -0
  920. package/src/conformance/fixture/release/blocking-renamed/0000_item.sql +3 -0
  921. package/src/conformance/fixture/release/blocking-renamed/0001_wait.sql +5 -0
  922. package/src/conformance/fixture/release/broken/0000_item.sql +3 -0
  923. package/src/conformance/fixture/release/broken/0001_extra.sql +3 -0
  924. package/src/conformance/fixture/release/broken/0002_label.sql +3 -0
  925. package/src/conformance/fixture/release/drift/escalate/0000_item.sql +5 -0
  926. package/src/conformance/fixture/release/drift/escalate/0001_escalate.sql +8 -0
  927. package/src/conformance/fixture/release/drift/v1/0000_item.sql +5 -0
  928. package/src/conformance/fixture/release/escape/0000_item.sql +3 -0
  929. package/src/conformance/fixture/release/escape/0001_escape.sql +5 -0
  930. package/src/conformance/fixture/release/misnamed/0000_item.sql +3 -0
  931. package/src/conformance/fixture/release/misnamed/0001_misname.sql +10 -0
  932. package/src/conformance/fixture/release/module.ts +119 -0
  933. package/src/conformance/fixture/release/outside/0000_item.sql +3 -0
  934. package/src/conformance/fixture/release/outside/0001_extra.sql +3 -0
  935. package/src/conformance/fixture/release/outside/0002_index.sql +4 -0
  936. package/src/conformance/fixture/release/outside/0003_later.sql +1 -0
  937. package/src/conformance/fixture/release/renamed/0000_item.sql +3 -0
  938. package/src/conformance/fixture/release/renamed/0001_misname.sql +10 -0
  939. package/src/conformance/fixture/release/renamed/0002_restore.sql +1 -0
  940. package/src/conformance/fixture/release/rogue/0000_item.sql +3 -0
  941. package/src/conformance/fixture/release/rogue/0001_extra.sql +3 -0
  942. package/src/conformance/fixture/release/rogue/0002_definer.sql +1 -0
  943. package/src/conformance/fixture/release/slow/0000_item.sql +5 -0
  944. package/src/conformance/fixture/release/undeclared/0000_item.sql +3 -0
  945. package/src/conformance/fixture/release/undeclared/0001_extra.sql +3 -0
  946. package/src/conformance/fixture/release/undeclared/0002_index.sql +1 -0
  947. package/src/conformance/fixture/release/v1/0000_item.sql +3 -0
  948. package/src/conformance/fixture/release/v2/0000_item.sql +3 -0
  949. package/src/conformance/fixture/release/v2/0001_extra.sql +3 -0
  950. package/src/conformance/fixture/release/v2/0002_label.sql +3 -0
  951. package/src/conformance/fixture/release/viewed-retyped/0000_item.sql +3 -0
  952. package/src/conformance/fixture/release/viewed-retyped/0001_retype.sql +1 -0
  953. package/src/conformance/kit-hash.ts +18 -0
  954. package/src/conformance/ledger/contract.ts +92 -0
  955. package/src/conformance/ledger/migrations/0000_entries.sql +8 -0
  956. package/src/conformance/ledger/server.ts +174 -0
  957. package/src/conformance/library/app.ts +38 -0
  958. package/src/conformance/library/contract.ts +66 -0
  959. package/src/conformance/library/migrations/0000_library.sql +14 -0
  960. package/src/conformance/library/schema.ts +27 -0
  961. package/src/conformance/library/server.ts +65 -0
  962. package/src/conformance/library/sync.gen.ts +47 -0
  963. package/src/conformance/locale/catalog.ts +111 -0
  964. package/src/conformance/notebook/app.ts +115 -0
  965. package/src/conformance/notebook/evals/pages.evals.json +94 -0
  966. package/src/conformance/notebook/migrations/0000_notebook.sql +10 -0
  967. package/src/conformance/notebook/module.ts +215 -0
  968. package/src/conformance/notebook/skills/meeting-notes.md +4 -0
  969. package/src/conformance/pad/app.ts +21 -0
  970. package/src/conformance/pad/contract.ts +69 -0
  971. package/src/conformance/pad/migrations/pad/0000_pad.sql +8 -0
  972. package/src/conformance/pad/migrations/pad/0001_live_copy.sql +2 -0
  973. package/src/conformance/pad/schema.ts +18 -0
  974. package/src/conformance/pad/server.ts +102 -0
  975. package/src/conformance/purchases/app.ts +34 -0
  976. package/src/conformance/purchases/contract.ts +161 -0
  977. package/src/conformance/purchases/migrations/0000_purchases.sql +17 -0
  978. package/src/conformance/purchases/server.ts +95 -0
  979. package/src/conformance/replica-search.mjs +22 -0
  980. package/src/conformance/studio/app.ts +298 -0
  981. package/src/conformance/studio/contract.ts +319 -0
  982. package/src/conformance/studio/migrations/billing/0000_billing.sql +6 -0
  983. package/src/conformance/studio/migrations/journal/0000_journal.sql +9 -0
  984. package/src/conformance/studio/migrations/mailbox/0000_mailbox.sql +7 -0
  985. package/src/conformance/studio/migrations/tasks/0000_tasks.sql +7 -0
  986. package/src/conformance/workshop/app.ts +14 -0
  987. package/src/conformance/workshop/migrations/0000_notes.sql +7 -0
  988. package/src/conformance/workshop/module.ts +79 -0
  989. package/src/fakes/AcmeFake.ts +182 -0
  990. package/src/fakes/ApnsFake.ts +245 -0
  991. package/src/fakes/FcmFake.ts +231 -0
  992. package/src/fakes/GoogleFake.ts +1346 -0
  993. package/src/fakes/HttpApiFake.ts +116 -0
  994. package/src/fakes/McpFake.ts +355 -0
  995. package/src/fakes/MicrosoftGraphFake.ts +1191 -0
  996. package/src/fakes/S3Fake.ts +376 -0
  997. package/src/fakes/Server.ts +445 -0
  998. package/src/fakes/SignInProviderFake.ts +70 -0
  999. package/src/fakes/SlackFake.ts +893 -0
  1000. package/src/fakes/Store.ts +96 -0
  1001. package/src/fakes/TelemetryFakes.ts +197 -0
  1002. package/src/fakes/TestCa.ts +166 -0
  1003. package/src/fakes/WorkOsFake.ts +136 -0
  1004. package/src/index.ts +9 -0
  1005. package/src/make/reference.ts +259 -0
  1006. package/src/make/sources.ts +836 -0
@@ -0,0 +1,169 @@
1
+ /**
2
+ * The HttpApi conformance kit (docs/contracts/http-api.md): any HTTP API over a kernel endpoint Connection, against the
3
+ * HTTP API protocol fake (an OpenAPI document, paged items, a reading POST, a write, a large answer, a redirect away).
4
+ * Run it with a subject whose kernel installs an endpoint connector providing `api` (the registry's `http-openapi`)
5
+ * and allows only the fakes' hosts as private destinations; the fake's second server ("elsewhere") is allowed too, so
6
+ * what keeps a credential from it is the Connection's origin, not the destination policy.
7
+ */
8
+ import type { Connection } from "@eloxiv/contracts"
9
+ import { afterAll, beforeAll, describe, expect, it } from "vitest"
10
+ import { startHttpApiFake, type HttpApiFake } from "../fakes/HttpApiFake.ts"
11
+ import type { CallResult } from "./CapabilityKit.ts"
12
+ import type { EndpointSubject } from "./EndpointReference.ts"
13
+
14
+ const ok = (result: CallResult): any => {
15
+ if (!result.ok) throw new Error(`Expected success, got ${JSON.stringify(result.error)}`)
16
+ return result.value
17
+ }
18
+ const failed = (result: CallResult): any => {
19
+ if (result.ok) throw new Error(`Expected a failure, got ${JSON.stringify(result.value)}`)
20
+ return result.error
21
+ }
22
+
23
+ export const httpApiConformance = (
24
+ start: (allow: ReadonlyArray<string>) => Promise<EndpointSubject>,
25
+ options: { readonly provider?: string } = {},
26
+ ) => {
27
+ const provider = options.provider ?? "http-openapi"
28
+ describe("HttpApi contract", () => {
29
+ let s: EndpointSubject
30
+ let api: HttpApiFake
31
+ let connection: Connection
32
+ const KEY = "api-key-value-0123456789abcdef"
33
+
34
+ beforeAll(async () => {
35
+ api = await startHttpApiFake({ key: KEY })
36
+ s = await start([api.host, api.otherHost])
37
+ const put = await s.secrets(s.owner, "put", {
38
+ scope: { kind: "user", orgId: s.owner.org, userId: s.owner.id },
39
+ name: "items-key",
40
+ value: KEY,
41
+ })
42
+ if (put.status !== 200) throw new Error(JSON.stringify(put.body))
43
+ connection = ok(
44
+ await s.action(s.owner, "connections.add", {
45
+ provider,
46
+ endpoint: api.endpoint,
47
+ auth: { kind: "secret", scope: "user", name: "items-key", header: "x-api-key" },
48
+ options: { openapi: "/openapi.json", readOnlyPosts: ["/search"] },
49
+ }),
50
+ ).connection
51
+ }, 120_000)
52
+ afterAll(async () => {
53
+ await s?.dispose()
54
+ await api?.close()
55
+ })
56
+
57
+ const read = (input: Record<string, unknown>) =>
58
+ s.action(s.owner, "connections.apiRead", { connectionId: connection.id, method: "GET", ...input })
59
+
60
+ it("lists the OpenAPI document's operations and tells reads from writes", async () => {
61
+ const catalog = ok(await s.action(s.owner, "connections.apiCatalog", { connectionId: connection.id }))
62
+ expect(catalog.title).toBe("Items API")
63
+ expect(catalog.operations).toEqual([
64
+ { id: "listItems", method: "GET", path: "/items", summary: "List items", readOnly: true },
65
+ { id: "createItem", method: "POST", path: "/items", summary: "Create an item", readOnly: false },
66
+ { id: "search", method: "POST", path: "/search", summary: "Search items", readOnly: true },
67
+ { id: "deleteItem", method: "DELETE", path: "/items/{id}", summary: null, readOnly: false },
68
+ ])
69
+ const described = ok(
70
+ await s.action(s.owner, "connections.apiDescribe", { connectionId: connection.id, operationId: "listItems" }),
71
+ )
72
+ expect(described.parameters).toEqual([{ name: "page", in: "query" }])
73
+ })
74
+
75
+ it("reads with the secret in its header, following next links only on the same API, up to the pages asked", async () => {
76
+ const elsewhere = api.elsewhere.length
77
+ const { pages } = ok(await read({ path: "/items", maxPages: 10 }))
78
+ // Pages 1 to 3; page 3's next link is another origin, which is not followed.
79
+ expect(pages.map((p: any) => p.body.page)).toEqual([1, 2, 3])
80
+ expect(api.elsewhere.length).toBe(elsewhere)
81
+ expect(ok(await read({ path: "/items", maxPages: 2 })).pages).toHaveLength(2)
82
+ expect(api.requests.filter((r) => r.path === "/api/items").every((r) => r.headers["x-api-key"] === KEY)).toBe(
83
+ true,
84
+ )
85
+ })
86
+
87
+ it("keeps every request under the base URL and refuses credential headers, sending nothing", async () => {
88
+ const before = api.requests.length
89
+ for (const path of [
90
+ "../private",
91
+ "/../private",
92
+ "%2e%2e/private",
93
+ "https://evil.example/x",
94
+ "//evil.example/x",
95
+ ]) {
96
+ expect(failed(await read({ path })), path).toMatchObject({ _tag: "InvalidInput" })
97
+ }
98
+ for (const header of ["authorization", "cookie", "x-forwarded-for", "Proxy-Authorization"]) {
99
+ expect(failed(await read({ path: "/items", headers: { [header]: "x" } })), header).toMatchObject({
100
+ _tag: "InvalidInput",
101
+ })
102
+ }
103
+ expect(api.requests.length).toBe(before)
104
+ expect(api.requests.some((r) => r.path === "/private")).toBe(false)
105
+ })
106
+
107
+ it("follows a redirect to another origin without the secret", async () => {
108
+ const { pages } = ok(await read({ path: "/away" }))
109
+ expect(pages[0]).toMatchObject({ status: 200, body: { landed: true } })
110
+ const landed = api.elsewhere.findLast((r) => r.path === "/landing")!
111
+ expect(landed.headers["x-api-key"]).toBeUndefined()
112
+ })
113
+
114
+ it("follows a redirect without reading its body", async () => {
115
+ const started = Date.now()
116
+ const { pages } = ok(await read({ path: "/endless-redirect" }))
117
+ expect(pages[0]).toMatchObject({ status: 200, body: { page: 1 } })
118
+ expect(Date.now() - started).toBeLessThan(5_000)
119
+ })
120
+
121
+ it("refuses a redirect to an address that is not public", async () => {
122
+ expect(failed(await read({ path: "/metadata" }))).toMatchObject({ _tag: "InvalidInput" })
123
+ })
124
+
125
+ it("reads with a POST only where the Connection names it, and writes only through apiWrite", async () => {
126
+ expect(ok(await read({ method: "POST", path: "/search", json: { q: "a" } })).pages[0]).toMatchObject({
127
+ body: { hits: 1 },
128
+ })
129
+ const writes = api.writes.length
130
+ expect(failed(await read({ method: "POST", path: "/items", json: { name: "x" } }))).toMatchObject({
131
+ _tag: "InvalidInput",
132
+ })
133
+ expect(api.writes.length).toBe(writes)
134
+ const written = ok(
135
+ await s.action(s.owner, "connections.apiWrite", {
136
+ connectionId: connection.id,
137
+ method: "POST",
138
+ path: "/items",
139
+ json: { name: "x" },
140
+ }),
141
+ )
142
+ expect(written).toMatchObject({ status: 201, body: { created: { name: "x" } } })
143
+ expect(api.writes.length).toBe(writes + 1)
144
+ })
145
+
146
+ it("holds every agent's write for the person's consent", async () => {
147
+ const writes = api.writes.length
148
+ for (const name of ["one", "two"]) {
149
+ const held = failed(
150
+ await s.action(
151
+ s.owner,
152
+ "connections.apiWrite",
153
+ { connectionId: connection.id, method: "POST", path: "/items", json: { name } },
154
+ "agent",
155
+ ),
156
+ )
157
+ expect(held).toMatchObject({ _tag: "ConsentRequired" })
158
+ }
159
+ expect(api.writes.length).toBe(writes)
160
+ })
161
+
162
+ it("cuts an answer past the bound and says so", async () => {
163
+ const [page] = ok(await read({ path: "/big" })).pages
164
+ expect(page.truncated).toBe(true)
165
+ expect(typeof page.body).toBe("string")
166
+ expect((page.body as string).length).toBeLessThanOrEqual(256 * 1024)
167
+ })
168
+ })
169
+ }
@@ -0,0 +1,401 @@
1
+ /**
2
+ * The Eloxiv kernel as an inbox conformance subject: an in-process kernel on a fresh database serving the
3
+ * inbox conformance app, with system email going to an SMTP server this process runs (`../SmtpSink.ts`).
4
+ * Calls reach the kernel on the surface each check names: the typed RPC client, HTTP, an MCP client, the
5
+ * agent tools (driven by a mock model), or in process.
6
+ */
7
+ import { makeClient, signIn } from "@eloxiv/client"
8
+ import type { AuditFilter } from "@eloxiv/contracts"
9
+ import { Audit, Directory, Identity, Invocation, Notifications, PolicyCompiler, type KernelApp } from "@eloxiv/kernel"
10
+ import { Client as McpClient } from "@modelcontextprotocol/sdk/client/index.js"
11
+ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
12
+ import { Effect, Exit } from "effect"
13
+ import { resolve } from "node:path"
14
+ import { callAgentTool } from "../AgentSurface.ts"
15
+ import { adminQuery } from "../Admin.ts"
16
+ import { startKernel } from "../Kernel.ts"
17
+ import { startSmtpSink } from "../SmtpSink.ts"
18
+ import { defaultRuntime, dropDatabase } from "../System.ts"
19
+ import type { InboxCall, InboxOutcome, InboxSubject } from "./InboxSubject.ts"
20
+ import { inboxApp } from "./purchases/app.ts"
21
+ import type { SyncAnswer } from "./Subject.ts"
22
+
23
+ const root = resolve(import.meta.dirname, "../../../..")
24
+ /** The password of every user the reference makes. */
25
+ export const INBOX_PASSWORD = "inbox-password"
26
+ const PASSWORD = INBOX_PASSWORD
27
+
28
+ const failed = (error: unknown): InboxOutcome => {
29
+ const value = (error ?? {}) as { _tag?: string }
30
+ return {
31
+ ok: false,
32
+ error: {
33
+ ...(value as object),
34
+ ...(typeof (value as { message?: unknown }).message === "string"
35
+ ? { message: (value as { message: string }).message }
36
+ : {}),
37
+ _tag: value._tag ?? "defect",
38
+ ...(value._tag === undefined ? { cause: JSON.stringify(error)?.slice(0, 2000) } : {}),
39
+ },
40
+ }
41
+ }
42
+
43
+ // ---------------------------------------------------------------------------
44
+ // Evaluating a sync answer: the scoped query's `where` (Zero's AST) over the table's rows
45
+
46
+ type Ast = Record<string, any>
47
+
48
+ const literal = (value: Ast): unknown => (value["type"] === "literal" ? value["value"] : undefined)
49
+
50
+ type Rows = ReadonlyArray<Record<string, unknown>>
51
+
52
+ /** The kernel tables a scoped query's subqueries read (server names), as zero-cache's replica holds them. */
53
+ export const KERNEL_SYNC_TABLES = [
54
+ "eloxiv.share_grant",
55
+ "eloxiv.share_redemption",
56
+ "eloxiv.sync_fact",
57
+ "eloxiv.sync_org",
58
+ ] as const
59
+
60
+ export const evaluate = (
61
+ condition: Ast | undefined,
62
+ row: Record<string, unknown>,
63
+ tables: Readonly<Record<string, Rows>>,
64
+ ): boolean => {
65
+ if (condition === undefined) return true
66
+ switch (condition["type"]) {
67
+ case "and":
68
+ return (condition["conditions"] as Array<Ast>).every((c) => evaluate(c, row, tables))
69
+ case "or":
70
+ return (condition["conditions"] as Array<Ast>).some((c) => evaluate(c, row, tables))
71
+ case "simple": {
72
+ const left = row[condition["left"]["name"]]
73
+ const right = literal(condition["right"])
74
+ switch (condition["op"]) {
75
+ case "=":
76
+ return left !== null && left !== undefined && left === right
77
+ case "!=":
78
+ return left !== null && left !== undefined && left !== right
79
+ case "IN":
80
+ return Array.isArray(right) && right.includes(left)
81
+ case "IS":
82
+ return left === right || (right === null && left === undefined)
83
+ case "IS NOT":
84
+ return !(left === right || (right === null && left === undefined))
85
+ case "<":
86
+ return left !== null && left !== undefined && (left as number) < (right as number)
87
+ case "<=":
88
+ return left !== null && left !== undefined && (left as number) <= (right as number)
89
+ case ">":
90
+ return left !== null && left !== undefined && (left as number) > (right as number)
91
+ case ">=":
92
+ return left !== null && left !== undefined && (left as number) >= (right as number)
93
+ case "LIKE":
94
+ return typeof left === "string" && PolicyCompiler.likeMatches(left, String(right))
95
+ case "NOT LIKE":
96
+ return typeof left === "string" && !PolicyCompiler.likeMatches(left, String(right))
97
+ default:
98
+ throw new Error(`Unsupported operator ${condition["op"]}`)
99
+ }
100
+ }
101
+ case "correlatedSubquery": {
102
+ // The kernel's subqueries (sharing grants, live directory facts): EXISTS a row of the subquery's table
103
+ // correlated with this record and matching the subquery's where.
104
+ const related = condition["related"]
105
+ const sub = related["subquery"]
106
+ const rows = tables[sub["table"] as string]
107
+ if (rows === undefined) throw new Error(`Unexpected subquery table ${String(sub["table"])}`)
108
+ const parents = related["correlation"]["parentField"] as ReadonlyArray<string>
109
+ const children = related["correlation"]["childField"] as ReadonlyArray<string>
110
+ const exists = rows.some(
111
+ (child) =>
112
+ parents.every((field, i) => child[children[i]!] === row[field]) && evaluate(sub["where"], child, tables),
113
+ )
114
+ return condition["op"] === "NOT EXISTS" ? !exists : exists
115
+ }
116
+ default:
117
+ throw new Error(`Unsupported condition ${JSON.stringify(condition).slice(0, 200)}`)
118
+ }
119
+ }
120
+
121
+ export type InboxReference = InboxSubject & {
122
+ /** Run an effect against the kernel's services (for this kernel's own tests). */
123
+ readonly run: <A, E>(effect: Effect.Effect<A, E, any>) => Promise<A>
124
+ /** The kernel's base URL. */
125
+ readonly url: string
126
+ }
127
+
128
+ export const startInboxReference = async (options: {
129
+ readonly name: string
130
+ /** The inbox conformance app, or a variant of it (extra workflows, say). */
131
+ readonly app?: KernelApp | undefined
132
+ /** Kernel settings to override (the query surface's, say). */
133
+ readonly config?: Parameters<typeof startKernel>[0]["config"]
134
+ /** Kernel options beyond the defaults (a storage backend, a file scanner, further privacy sources). */
135
+ readonly options?: Parameters<typeof startKernel>[0]["options"]
136
+ }): Promise<InboxReference> => {
137
+ const database = `eloxiv_t_${options.name}_${defaultRuntime()}`
138
+ await dropDatabase(database, root)
139
+ const sink = await startSmtpSink()
140
+ const kernel = await startKernel({
141
+ app: options.app ?? inboxApp,
142
+ database,
143
+ email: { smtpUrl: sink.url, from: "Eloxiv <noreply@eloxiv.test>" },
144
+ config: options.config,
145
+ options: options.options,
146
+ })
147
+ const admin = adminQuery(database)
148
+
149
+ const run = <A, E>(effect: Effect.Effect<A, E, any>) => kernel.run(effect)
150
+
151
+ const headersFor = (call: InboxCall) => {
152
+ const headers: Record<string, string> = { authorization: `Bearer ${call.token}`, ...call.headers }
153
+ if (call.org !== undefined) headers["x-eloxiv-org"] = call.org
154
+ return headers
155
+ }
156
+
157
+ const invoke = async (call: InboxCall): Promise<InboxOutcome> => {
158
+ const headers = headersFor(call)
159
+ const keyHeader: Record<string, string> =
160
+ call.idempotencyKey === undefined ? {} : { "idempotency-key": call.idempotencyKey }
161
+ switch (call.surface ?? "internal") {
162
+ case "internal": {
163
+ const exit = await kernel.run(
164
+ Effect.gen(function* () {
165
+ const invocation = yield* Invocation
166
+ return yield* invocation.invoke({
167
+ action: call.action,
168
+ input: { encoded: call.input },
169
+ surface: "internal",
170
+ headers: new Headers(headers),
171
+ idempotencyKey: call.idempotencyKey,
172
+ })
173
+ }).pipe(Effect.exit),
174
+ )
175
+ if (Exit.isSuccess(exit)) return { ok: true, result: exit.value.encoded }
176
+ return failed(
177
+ exit.cause.reasons.find((r) => r._tag === "Fail")?.error ?? { _tag: "defect", cause: String(exit.cause) },
178
+ )
179
+ }
180
+ case "rpc": {
181
+ const client = makeClient({
182
+ baseUrl: kernel.url,
183
+ modules: (options.app ?? inboxApp).modules.map((m) => m.contract),
184
+ token: () => call.token,
185
+ ...(call.org === undefined ? {} : { orgId: call.org }),
186
+ } as Parameters<typeof makeClient>[0])
187
+ try {
188
+ return {
189
+ ok: true,
190
+ result: await client.call(call.action as never, call.input as never, {
191
+ idempotencyKey: call.idempotencyKey,
192
+ }),
193
+ }
194
+ } catch (error) {
195
+ return failed(error)
196
+ } finally {
197
+ await client.dispose()
198
+ }
199
+ }
200
+ case "http": {
201
+ const response = await fetch(`${kernel.url}/api/actions/${call.action}`, {
202
+ method: "POST",
203
+ headers: { ...headers, ...keyHeader, "content-type": "application/json" },
204
+ body: JSON.stringify(call.input),
205
+ })
206
+ const text = await response.text()
207
+ const body = (text.length > 0 ? JSON.parse(text) : {}) as Record<string, unknown>
208
+ return response.ok ? { ok: true, result: body } : failed(body)
209
+ }
210
+ case "mcp": {
211
+ const mcp = new McpClient({ name: "eloxiv-inbox-kit", version: "0.0.0" })
212
+ await mcp.connect(
213
+ new StreamableHTTPClientTransport(new URL(`${kernel.url}/mcp`), {
214
+ requestInit: { headers: { ...headers, ...keyHeader } },
215
+ }),
216
+ )
217
+ try {
218
+ const result = await mcp.callTool({
219
+ name: call.action.replaceAll(".", "_"),
220
+ arguments: call.input as Record<string, unknown>,
221
+ })
222
+ const text = (result.content as Array<{ type: string; text?: string }>)[0]?.text
223
+ const value = result.structuredContent ?? (text === undefined ? undefined : JSON.parse(text))
224
+ return result.isError ? failed(value) : { ok: true, result: value }
225
+ } finally {
226
+ await mcp.close()
227
+ }
228
+ }
229
+ case "agent": {
230
+ const { result } = await callAgentTool(
231
+ kernel,
232
+ new Headers(headers),
233
+ call.action,
234
+ call.input,
235
+ call.idempotencyKey,
236
+ )
237
+ return result.ok ? { ok: true, result: result.output } : failed(result.error)
238
+ }
239
+ }
240
+ }
241
+
242
+ const ensureOrg = (org: string) =>
243
+ run(
244
+ Effect.gen(function* () {
245
+ const directory = yield* Directory
246
+ yield* directory.createOrganization({ id: org, name: org })
247
+ }),
248
+ )
249
+
250
+ const subject: InboxReference = {
251
+ url: kernel.url,
252
+ run,
253
+ user: async (name, org, options = {}) => {
254
+ const email = `${name}@example.com`
255
+ await ensureOrg(org)
256
+ const id = await run(
257
+ Effect.gen(function* () {
258
+ const directory = yield* Directory
259
+ const userId = yield* directory.ensureUser({ email, name, password: PASSWORD })
260
+ yield* directory.addMember({ orgId: org, userId, roles: ["member", ...(options.roles ?? [])] })
261
+ return userId
262
+ }),
263
+ )
264
+ return { id, email, token: (await signIn(kernel.url, { email, password: PASSWORD })).token }
265
+ },
266
+ role: async (org, role, permissions) => {
267
+ await ensureOrg(org)
268
+ await admin(`INSERT INTO eloxiv.role (org_id, id, name) VALUES ($1, $2, $2) ON CONFLICT DO NOTHING`, [org, role])
269
+ await admin(`DELETE FROM eloxiv.role_permission WHERE org_id = $1 AND role_id = $2`, [org, role])
270
+ for (const permission of permissions) {
271
+ await admin(`INSERT INTO eloxiv.role_permission (org_id, role_id, permission) VALUES ($1, $2, $3)`, [
272
+ org,
273
+ role,
274
+ permission,
275
+ ])
276
+ }
277
+ },
278
+ assignRole: async (userId, org, role) =>
279
+ void (await admin(
280
+ `INSERT INTO eloxiv.membership_role (org_id, user_id, role_id) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`,
281
+ [org, userId, role],
282
+ )),
283
+ unassignRole: async (userId, org, role) =>
284
+ void (await admin(`DELETE FROM eloxiv.membership_role WHERE org_id = $1 AND user_id = $2 AND role_id = $3`, [
285
+ org,
286
+ userId,
287
+ role,
288
+ ])),
289
+ joinGroup: async (userId, org, group) => {
290
+ await admin(`INSERT INTO eloxiv.org_group (org_id, id, name) VALUES ($1, $2, $2) ON CONFLICT DO NOTHING`, [
291
+ org,
292
+ group,
293
+ ])
294
+ await admin(
295
+ `INSERT INTO eloxiv.group_member (org_id, group_id, user_id) VALUES ($1, $2, $3) ON CONFLICT DO NOTHING`,
296
+ [org, group, userId],
297
+ )
298
+ },
299
+ leave: async (userId, org) =>
300
+ void (await admin(`DELETE FROM eloxiv.membership WHERE user_id = $1 AND org_id = $2`, [userId, org])),
301
+ invoke,
302
+ agentSession: (user, org) =>
303
+ run(
304
+ Effect.gen(function* () {
305
+ const identity = yield* Identity
306
+ const issued = yield* identity.issueAgentSession({
307
+ userId: user.id,
308
+ orgId: org,
309
+ label: "conformance agent",
310
+ authority: { scope: null, chain: [] },
311
+ })
312
+ return { id: issued.id, token: issued.token }
313
+ }),
314
+ ),
315
+ revokeAgentSession: (id) =>
316
+ run(
317
+ Effect.gen(function* () {
318
+ const identity = yield* Identity
319
+ yield* identity.revokeAgentSession(id)
320
+ }),
321
+ ),
322
+ sql: (text, params = []) => admin(text, params),
323
+ audit: (filter: AuditFilter) =>
324
+ run(
325
+ Effect.gen(function* () {
326
+ const audit = yield* Audit
327
+ return yield* audit.list(filter)
328
+ }),
329
+ ),
330
+ query: async (token, name, org) => {
331
+ const headers: Record<string, string> = { authorization: `Bearer ${token}`, "content-type": "application/json" }
332
+ if (org !== undefined) headers["x-eloxiv-org"] = org
333
+ const response = await fetch(`${kernel.url}/zero/query`, {
334
+ method: "POST",
335
+ headers,
336
+ body: JSON.stringify(["transform", [{ id: "q1", name, args: [] }]]),
337
+ })
338
+ if (response.status === 401) {
339
+ await response.body?.cancel()
340
+ return { status: 401 } satisfies SyncAnswer
341
+ }
342
+ if (response.status !== 200)
343
+ throw new Error(`Unexpected sync response ${response.status}: ${await response.text()}`)
344
+ const body = (await response.json()) as { queries: Array<Record<string, unknown>> }
345
+ return { status: 200, answer: body.queries[0] ?? {} } satisfies SyncAnswer
346
+ },
347
+ selected: async (answer, table) => {
348
+ if (answer.status !== 200) return []
349
+ const ast = answer.answer["ast"] as Ast | undefined
350
+ if (ast === undefined) throw new Error(`The query was refused: ${JSON.stringify(answer.answer)}`)
351
+ // The scoped AST names database columns (Zero maps them back for the client).
352
+ if (!/^[a-z_]+\.[a-z_]+$/.test(table)) throw new Error(`Not a table name: ${table}`)
353
+ const rows = await admin<Record<string, unknown>>(`SELECT * FROM ${table}`)
354
+ const tables: Record<string, Rows> = {}
355
+ // Every table the filter's subqueries read: the kernel's live tables, and any entity table a related()
356
+ // or whereExists() child, or a one-hop reference, reaches.
357
+ const reached = new Set<string>(KERNEL_SYNC_TABLES)
358
+ const visit = (node: unknown): void => {
359
+ if (Array.isArray(node)) return node.forEach(visit)
360
+ if (node === null || typeof node !== "object") return
361
+ const record = node as Ast
362
+ if (typeof record["table"] === "string" && /^[a-z_]+\.[a-z_]+$/.test(record["table"]))
363
+ reached.add(record["table"])
364
+ Object.values(record).forEach(visit)
365
+ }
366
+ visit(ast["where"])
367
+ for (const name of reached) tables[name] = await admin<Record<string, unknown>>(`SELECT * FROM ${name}`)
368
+ return rows.filter((row) => evaluate(ast["where"], row, tables)).map((row) => String(row["id"]))
369
+ },
370
+ mail: { messages: sink.messages, failNext: sink.failNext, refuse: sink.refuse },
371
+ preview: (org, template, variables) =>
372
+ run(
373
+ Effect.gen(function* () {
374
+ const notifications = yield* Notifications
375
+ return yield* notifications.preview({ orgId: org, template, variables })
376
+ }),
377
+ ),
378
+ deliveries: (org, notificationId) =>
379
+ run(
380
+ Effect.gen(function* () {
381
+ const notifications = yield* Notifications
382
+ return yield* notifications.deliveries({ orgId: org, notificationId })
383
+ }),
384
+ ),
385
+ unsubscribe: async (url) => {
386
+ const response = await fetch(url, {
387
+ method: "POST",
388
+ headers: { "content-type": "application/x-www-form-urlencoded" },
389
+ body: "List-Unsubscribe=One-Click",
390
+ })
391
+ await response.body?.cancel()
392
+ return { status: response.status }
393
+ },
394
+ dispose: async () => {
395
+ await admin.dispose()
396
+ await kernel.dispose()
397
+ await sink.close()
398
+ },
399
+ }
400
+ return subject
401
+ }
@@ -0,0 +1,101 @@
1
+ /**
2
+ * What a kernel implementation supplies to run the inbox kits (Approvals, ActionConsent, WorkItems,
3
+ * Notifications): a running kernel serving the inbox conformance app (`./purchases/app.ts`: the purchases
4
+ * fixture with the kernel's inbox modules), delivering system email to an SMTP server the subject runs, and
5
+ * a handful of controls. Nothing here reaches into the Eloxiv kernel's internals; `./InboxReference.ts` is
6
+ * the Eloxiv kernel's own subject.
7
+ */
8
+ import type { AuditFilter, AuditRecord } from "@eloxiv/contracts"
9
+ import type { ReceivedMail } from "../SmtpSink.ts"
10
+ import type { SyncAnswer } from "./Subject.ts"
11
+
12
+ /** The surfaces a call can arrive on. `internal` is the in-process path (a person's call, not an agent's). */
13
+ export type InboxSurface = "rpc" | "http" | "mcp" | "agent" | "internal"
14
+
15
+ export interface InboxUser {
16
+ readonly id: string
17
+ readonly email: string
18
+ /** The person's own session credential. */
19
+ readonly token: string
20
+ }
21
+
22
+ export interface InboxCall {
23
+ readonly action: string
24
+ readonly input: unknown
25
+ /** A bearer credential: a person's session token or an agent session token. */
26
+ readonly token: string
27
+ readonly org?: string | undefined
28
+ readonly idempotencyKey?: string | undefined
29
+ /** Default `internal`. */
30
+ readonly surface?: InboxSurface | undefined
31
+ /** Extra request headers (a client trying to claim an origin or a session, say). */
32
+ readonly headers?: Readonly<Record<string, string>> | undefined
33
+ }
34
+
35
+ /** A call's outcome: the JSON result envelope, or the error with all its fields (`approvalId`, `consentId`). */
36
+ export type InboxOutcome =
37
+ | { readonly ok: true; readonly result: unknown }
38
+ | { readonly ok: false; readonly error: { readonly _tag: string; readonly [field: string]: unknown } }
39
+
40
+ export interface InboxSubject {
41
+ /** A password user `<name>@example.com`, a member of `org` (created if missing) with `roles`, signed in. */
42
+ readonly user: (name: string, org: string, options?: { readonly roles?: ReadonlyArray<string> }) => Promise<InboxUser>
43
+ /** Create (or replace) a role of `org` that grants `permissions`. */
44
+ readonly role: (org: string, role: string, permissions: ReadonlyArray<string>) => Promise<void>
45
+ readonly assignRole: (userId: string, org: string, role: string) => Promise<void>
46
+ readonly unassignRole: (userId: string, org: string, role: string) => Promise<void>
47
+ /** Create a group of `org` (if missing) and add the member. */
48
+ readonly joinGroup: (userId: string, org: string, group: string) => Promise<void>
49
+ readonly leave: (userId: string, org: string) => Promise<void>
50
+ readonly invoke: (call: InboxCall) => Promise<InboxOutcome>
51
+ /** Issue an agent session for the user in `org` (ActionConsent `issueAgentSession`); returns its token. */
52
+ readonly agentSession: (user: InboxUser, org: string) => Promise<{ readonly id: string; readonly token: string }>
53
+ readonly revokeAgentSession: (id: string) => Promise<void>
54
+ /** Superuser SQL on the app's database (the kernel modules' and the fixture's tables). */
55
+ readonly sql: <A extends object = Record<string, unknown>>(
56
+ text: string,
57
+ params?: ReadonlyArray<unknown>,
58
+ ) => Promise<ReadonlyArray<A>>
59
+ readonly audit: (filter: AuditFilter) => Promise<ReadonlyArray<AuditRecord>>
60
+ /** The sync query endpoint, as a caller (the query's scoped AST, or 401). */
61
+ readonly query: (token: string, name: string, org?: string) => Promise<SyncAnswer>
62
+ /** Run the sync answer's filter: the ids of the rows of `table` (schema-qualified) it selects. */
63
+ readonly selected: (answer: SyncAnswer, table: string) => Promise<ReadonlyArray<string>>
64
+ /** System email the kernel sent, as the subject's SMTP server received it. */
65
+ readonly mail: {
66
+ readonly messages: () => ReadonlyArray<ReceivedMail>
67
+ readonly failNext: (count: number) => void
68
+ readonly refuse: (address: string) => void
69
+ }
70
+ /** Notifications.preview and deliveries. */
71
+ readonly preview: (org: string, template: string, variables: Readonly<Record<string, unknown>>) => Promise<unknown>
72
+ readonly deliveries: (
73
+ org: string,
74
+ notificationId: string,
75
+ ) => Promise<ReadonlyArray<{ readonly status: string; readonly channel: string; readonly attempts: number }>>
76
+ /** Follow an unsubscribe link (as a mail client would, with one-click `POST`). */
77
+ readonly unsubscribe: (url: string) => Promise<{ readonly status: number }>
78
+ readonly dispose: () => Promise<void>
79
+ }
80
+
81
+ export type StartInboxSubject = () => Promise<InboxSubject>
82
+
83
+ /** Poll until `check` returns a value `done` accepts, or fail after `timeoutMs`. */
84
+ export const until = async <A>(
85
+ what: string,
86
+ check: () => Promise<A>,
87
+ done: (value: A) => boolean,
88
+ timeoutMs = 20_000,
89
+ ): Promise<A> => {
90
+ const deadline = Date.now() + timeoutMs
91
+ let last: A | undefined
92
+ for (;;) {
93
+ last = await check()
94
+ if (done(last)) return last
95
+ if (Date.now() > deadline) throw new Error(`Timed out waiting for ${what}; last value: ${JSON.stringify(last)}`)
96
+ await new Promise((resolve) => setTimeout(resolve, 50))
97
+ }
98
+ }
99
+
100
+ /** A short unique suffix, so checks sharing a database never see each other's rows. */
101
+ export const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`