@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,204 @@
1
+ import { createHash, randomBytes } from "node:crypto";
2
+ export const pkcePair = () => {
3
+ const verifier = randomBytes(32).toString("base64url");
4
+ return { verifier, challenge: createHash("sha256").update(verifier).digest("base64url") };
5
+ };
6
+ export const REDIRECT = "http://127.0.0.1:7/callback";
7
+ /** A browser: cookies kept across requests, redirects not followed (the caller follows what it must). */
8
+ export const browser = (base) => {
9
+ const cookies = new Map();
10
+ const absorb = (response) => {
11
+ for (const cookie of response.headers.getSetCookie()) {
12
+ const [pair] = cookie.split(";");
13
+ const eq = pair.indexOf("=");
14
+ cookies.set(pair.slice(0, eq).trim(), pair.slice(eq + 1).trim());
15
+ }
16
+ };
17
+ const request = async (path, init = {}) => {
18
+ const url = path.startsWith("http") ? path : `${base}${path}`;
19
+ const headers = new Headers(init.headers);
20
+ if (cookies.size > 0)
21
+ headers.set("cookie", [...cookies].map(([k, v]) => `${k}=${v}`).join("; "));
22
+ const response = await fetch(url, { ...init, headers, redirect: "manual" });
23
+ absorb(response);
24
+ return response;
25
+ };
26
+ const post = (path, form, extra = {}) => request(path, {
27
+ method: "POST",
28
+ headers: { "content-type": "application/x-www-form-urlencoded", origin: new URL(base).origin, ...extra },
29
+ body: new URLSearchParams(form).toString(),
30
+ });
31
+ return { request, post, cookies };
32
+ };
33
+ /** A hidden or named input's value in a page. */
34
+ export const field = (html, name) => new RegExp(`name="${name}" value="([^"]*)"`, "u").exec(html)?.[1]?.replaceAll("&", "&");
35
+ /** The first option of the organisation select whose value is `org`, if the page offers it. */
36
+ export const offersOrg = (html, org) => html.includes(`<option value="${org}">`);
37
+ export const signInThroughPage = async (b, page, email, password) => {
38
+ const returnTo = field(page, "return_to");
39
+ if (returnTo === undefined)
40
+ throw new Error(`Not a sign-in page:\n${page}`);
41
+ const response = await b.post("/oauth/sign-in", { email, password, return_to: returnTo });
42
+ if (response.status !== 303)
43
+ throw new Error(`Sign-in failed with ${response.status}: ${await response.text()}`);
44
+ return response.headers.get("location");
45
+ };
46
+ /**
47
+ * Drive the authorisation page as `email`: open the authorisation URL, sign in if asked, pick `org` and
48
+ * answer. Returns the final redirect (to the client's redirect URI) or the page the kernel showed instead.
49
+ */
50
+ export const authorizeInBrowser = async (b, authorizationUrl, user, org, decision = "approve") => {
51
+ let response = await b.request(authorizationUrl);
52
+ if (response.status !== 303)
53
+ return { status: response.status, page: await response.text() };
54
+ const target = response.headers.get("location");
55
+ if (!target.startsWith("/"))
56
+ return { redirect: new URL(target) };
57
+ response = await b.request(target);
58
+ let page = await response.text();
59
+ if (field(page, "return_to") !== undefined) {
60
+ const back = await signInThroughPage(b, page, user.email, user.password);
61
+ response = await b.request(back);
62
+ page = await response.text();
63
+ }
64
+ const request = field(page, "request");
65
+ const csrf = field(page, "csrf");
66
+ if (request === undefined || csrf === undefined)
67
+ return { status: response.status, page };
68
+ const answer = await b.post("/oauth/consent", { request, csrf, org, decision });
69
+ if (answer.status !== 303)
70
+ return { status: answer.status, page: await answer.text() };
71
+ return { redirect: new URL(answer.headers.get("location")) };
72
+ };
73
+ export const oauthClient = (base) => {
74
+ const form = async (path, params, basic) => {
75
+ const body = new URLSearchParams();
76
+ for (const [key, value] of Object.entries(params))
77
+ if (value !== undefined)
78
+ body.set(key, value);
79
+ const headers = { "content-type": "application/x-www-form-urlencoded" };
80
+ if (basic !== undefined)
81
+ headers["authorization"] = `Basic ${basic}`;
82
+ return fetch(`${base}${path}`, { method: "POST", headers, body });
83
+ };
84
+ const register = async (metadata) => {
85
+ const response = await fetch(`${base}/oauth/register`, {
86
+ method: "POST",
87
+ headers: { "content-type": "application/json" },
88
+ body: JSON.stringify(metadata),
89
+ });
90
+ return { status: response.status, body: (await response.json()) };
91
+ };
92
+ const registerPublic = async (grantTypes = ["authorization_code", "refresh_token"], redirect = REDIRECT) => {
93
+ const { status, body } = await register({
94
+ client_name: "Conformance client",
95
+ redirect_uris: grantTypes.includes("authorization_code") ? [redirect] : [],
96
+ grant_types: grantTypes,
97
+ token_endpoint_auth_method: "none",
98
+ });
99
+ if (status !== 201)
100
+ throw new Error(`Registration failed with ${status}: ${JSON.stringify(body)}`);
101
+ return body;
102
+ };
103
+ const token = async (params, basic) => {
104
+ const response = await form("/oauth/token", params, basic);
105
+ const body = (await response.json());
106
+ if (response.ok)
107
+ return { ok: true, tokens: body };
108
+ return {
109
+ ok: false,
110
+ status: response.status,
111
+ error: body["error"] ?? "",
112
+ description: body["error_description"] ?? "",
113
+ };
114
+ };
115
+ const authorizationUrl = (params) => {
116
+ const url = new URL(`${base}/oauth/authorize`);
117
+ for (const [key, value] of Object.entries(params))
118
+ if (value !== undefined)
119
+ url.searchParams.set(key, value);
120
+ return url.toString();
121
+ };
122
+ const revoke = (params) => form("/oauth/revoke", params);
123
+ const deviceAuthorization = async (params) => {
124
+ const response = await form("/oauth/device_authorization", params);
125
+ return { status: response.status, body: (await response.json()) };
126
+ };
127
+ return { register, registerPublic, token, authorizationUrl, revoke, deviceAuthorization, form };
128
+ };
129
+ /** Call an action over HTTP with a bearer token; the envelope, or the error's tag and status. */
130
+ export const callAction = async (base, token, action, input, headers = {}) => {
131
+ const response = await fetch(`${base}/api/actions/${action}`, {
132
+ method: "POST",
133
+ headers: { authorization: `Bearer ${token}`, "content-type": "application/json", ...headers },
134
+ body: JSON.stringify(input),
135
+ });
136
+ const text = await response.text();
137
+ return { status: response.status, body: text.length > 0 ? JSON.parse(text) : {} };
138
+ };
139
+ /** A JSON-RPC `tools/call` to `/mcp` in one request (no session), with a bearer token. */
140
+ export const callMcpTool = async (base, token, tool, args) => {
141
+ const response = await fetch(`${base}/mcp`, {
142
+ method: "POST",
143
+ headers: {
144
+ authorization: `Bearer ${token}`,
145
+ "content-type": "application/json",
146
+ accept: "application/json, text/event-stream",
147
+ "mcp-protocol-version": "2025-06-18",
148
+ },
149
+ body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: tool, arguments: args } }),
150
+ });
151
+ const text = await response.text();
152
+ return { status: response.status, challenge: response.headers.get("www-authenticate"), text };
153
+ };
154
+ /**
155
+ * The OAuth side of an MCP host (`@modelcontextprotocol/sdk`'s `OAuthClientProvider`), as Claude Code or another
156
+ * host implements it: it registers dynamically as a public client, keeps the PKCE verifier and the tokens, and
157
+ * records where it was sent to authorise (a host opens that URL in the person's browser; tests drive the pages
158
+ * with `authorizeInBrowser`). `scope` asks for a narrower scope than the default `actions`.
159
+ */
160
+ export class McpOAuthProvider {
161
+ authorization;
162
+ info;
163
+ saved;
164
+ verifier = "";
165
+ options;
166
+ constructor(options = {}) {
167
+ this.options = options;
168
+ }
169
+ get redirectUrl() {
170
+ return this.options.redirect ?? REDIRECT;
171
+ }
172
+ get clientMetadata() {
173
+ return {
174
+ client_name: this.options.name ?? "Conformance agent",
175
+ redirect_uris: [this.redirectUrl],
176
+ grant_types: ["authorization_code", "refresh_token"],
177
+ response_types: ["code"],
178
+ token_endpoint_auth_method: "none",
179
+ ...(this.options.scope === undefined ? {} : { scope: this.options.scope }),
180
+ };
181
+ }
182
+ clientInformation() {
183
+ return this.info;
184
+ }
185
+ saveClientInformation(info) {
186
+ this.info = info;
187
+ }
188
+ tokens() {
189
+ return this.saved;
190
+ }
191
+ saveTokens(tokens) {
192
+ this.saved = tokens;
193
+ }
194
+ redirectToAuthorization(url) {
195
+ this.authorization = url;
196
+ }
197
+ saveCodeVerifier(verifier) {
198
+ this.verifier = verifier;
199
+ }
200
+ codeVerifier() {
201
+ return this.verifier;
202
+ }
203
+ }
204
+ //# sourceMappingURL=OAuthClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuthClient.js","sourceRoot":"","sources":["../../src/conformance/OAuthClient.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACtD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAA;AAC3F,CAAC,CAAA;AAoBD,MAAM,CAAC,MAAM,QAAQ,GAAG,6BAA6B,CAAA;AAErD,yGAAyG;AACzG,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAA;IACzC,MAAM,MAAM,GAAG,CAAC,QAAkB,EAAE,EAAE;QACpC,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;YACrD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAChC,MAAM,EAAE,GAAG,IAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7B,OAAO,CAAC,GAAG,CAAC,IAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAK,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAA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B,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import { type StartSubject } from "./Subject.ts";
2
+ export declare const outboxConformance: (start: StartSubject) => import("vitest").SuiteCollector<object>;
3
+ //# sourceMappingURL=Outbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Outbox.d.ts","sourceRoot":"","sources":["../../src/conformance/Outbox.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAoD,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAKlG,eAAO,MAAM,iBAAiB,UAAW,YAAY,4CAuTjD,CAAA"}
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Conformance kit for the Outbox contract (docs/contracts/outbox.md): events
3
+ * written in the call's transaction, at-least-once delivery to every
4
+ * subscriber in its own savepoint as its module's role, retries with backoff
5
+ * that hold up no other event, no re-run of subscribers that succeeded,
6
+ * subscribers confined to the event's organisation, and dead letters: a
7
+ * delivery whose policy is exhausted is kept, stops being retried, blocks
8
+ * nothing, and an organisation's administrator lists, retries and discards it
9
+ * (authorised and audited).
10
+ *
11
+ * Usage: `outboxConformance(() => startMyKernel())`; the subject's dispatcher
12
+ * must be running (see `./Subject.ts`).
13
+ */
14
+ import { DeadLetter, OutboxContract } from "@eloxiv/contracts";
15
+ import { Schema } from "effect";
16
+ import { afterAll, beforeAll, describe, expect, it } from "vitest";
17
+ import { FAIL_AT_COMMIT, failAtCommit, faultOff, faultOn, POISON_ATTEMPTS, poisonOff, poisonOn, } from "./fixture/docs/server.js";
18
+ import { eventually } from "./Subject.js";
19
+ /** Every subscriber of `docs.created` in the fixture app. */
20
+ const SUBSCRIBERS = ["docs.count", "docs.flaky", "docs.meddle", "docs.poison", "peer.record"];
21
+ export const outboxConformance = (start) => describe("Outbox contract", () => {
22
+ let subject;
23
+ let olive;
24
+ let gus;
25
+ let ada;
26
+ let gia;
27
+ beforeAll(async () => {
28
+ subject = await start();
29
+ olive = await subject.user("olive", ["acme"]);
30
+ gus = await subject.user("gus", ["globex"]);
31
+ ada = await subject.user("ada", ["acme"], ["admin"]);
32
+ gia = await subject.user("gia", ["globex"], ["admin"]);
33
+ });
34
+ afterAll(() => subject?.dispose());
35
+ const create = async (title, as = olive, action = "docs.create") => {
36
+ const result = await subject.invoke({ action, input: { title }, token: as.token });
37
+ return result.ok ? result.result.output.id : undefined;
38
+ };
39
+ const eventFor = async (title) => (await subject.outbox.events({ type: "docs.created" })).find((event) => event.payload.title === title);
40
+ const delivered = (title) => eventually(`delivery of ${title}`, () => eventFor(title), (event) => event?.deliveredAt != null);
41
+ const seenRows = async (title, subscriber) => (await subject.sql(`SELECT count(*)::int AS n FROM docs.seen WHERE title = $1 AND subscriber = $2`, [title, subscriber]))[0].n;
42
+ const sql = (statement) => subject.sql(statement[0], statement[1]);
43
+ it("writes a call's events in its transaction: with its invocation id, module and organisation", async () => {
44
+ const title = `Same transaction ${Date.now()}`;
45
+ const id = await create(title);
46
+ const event = await eventFor(title);
47
+ expect(event).toMatchObject({ type: "docs.created", module: "docs", orgId: "acme", payload: { id, title } });
48
+ const [record] = await subject.audit({ invocationId: event.invocationId });
49
+ expect(record).toMatchObject({ action: "docs.create", outcome: "succeeded", actorUserId: olive.id });
50
+ });
51
+ it("writes no event for a call that fails after emitting, or never runs", async () => {
52
+ expect(await create("Emitted then crashed", olive, "docs.crash")).toBeUndefined();
53
+ expect(await create("Blocked for approval", olive, "docs.signOff")).toBeUndefined();
54
+ expect(await eventFor("Emitted then crashed")).toBeUndefined();
55
+ expect(await eventFor("Blocked for approval")).toBeUndefined();
56
+ });
57
+ it("writes no event for a call whose transaction fails at commit, after its events were written", async () => {
58
+ for (const statement of failAtCommit)
59
+ await subject.sql(statement);
60
+ const title = `${FAIL_AT_COMMIT} ${crypto.randomUUID()}`;
61
+ expect(await create(title)).toBeUndefined();
62
+ expect(await eventFor(title)).toBeUndefined();
63
+ // Nor was anything delivered from it: no subscriber saw it.
64
+ expect(await subject.sql(`SELECT 1 FROM docs.seen WHERE title = $1`, [title])).toEqual([]);
65
+ });
66
+ it("reports each delivery pass in the contract's dispatch output", async () => {
67
+ const output = OutboxContract.operations.dispatch.output;
68
+ const title = `Dispatched ${Date.now()}`;
69
+ await create(title);
70
+ // The kernel's own dispatcher may deliver it first; either way every pass reports in the contract's shape.
71
+ const passes = [];
72
+ await eventually(`delivery of ${title} through dispatch`, async () => {
73
+ passes.push(await subject.outbox.dispatch());
74
+ return eventFor(title);
75
+ }, (event) => event?.deliveredAt != null);
76
+ expect(passes.length).toBeGreaterThan(0);
77
+ for (const pass of passes) {
78
+ expect(Schema.is(output)(pass), JSON.stringify(pass)).toBe(true);
79
+ expect(Number.isInteger(pass.delivered)).toBe(true);
80
+ expect(pass.delivered).toBeGreaterThanOrEqual(0);
81
+ }
82
+ });
83
+ it("delivers each event to every subscriber, in other modules too, as each subscriber's module role", async () => {
84
+ const title = `Fan out ${Date.now()}`;
85
+ const id = await create(title);
86
+ const event = await delivered(title);
87
+ expect([...event.deliveredTo].sort()).toEqual(SUBSCRIBERS);
88
+ expect(await seenRows(title, "count")).toBe(1);
89
+ expect(await subject.sql(`SELECT id, org_id AS "orgId", role FROM peer.item WHERE doc_id = $1`, [id])).toEqual([
90
+ { id: event.id, orgId: "acme", role: "eloxiv_mod_peer" },
91
+ ]);
92
+ });
93
+ it("keeps delivering other events while a failing event is retried with backoff (no ordering between events)", async () => {
94
+ await sql(faultOn("acme"));
95
+ await create("poison-1");
96
+ await create("good-1");
97
+ await create("good-2");
98
+ await delivered("good-2");
99
+ const good = await eventFor("good-1");
100
+ expect(good, "the event of good-1").toBeDefined();
101
+ expect(good.deliveredAt).toEqual(expect.any(String));
102
+ const poison = await eventually("a failed attempt", () => eventFor("poison-1"), (event) => (event?.attempts ?? 0) > 0);
103
+ expect(poison).toMatchObject({ deliveredAt: null });
104
+ expect(poison.lastError).toContain("flaky subscriber crashed on poison-1");
105
+ // The subscribers that succeeded are recorded; only the failing one is outstanding.
106
+ expect(poison.deliveredTo).not.toContain("docs.flaky");
107
+ expect(poison.deliveredTo).toContain("docs.count");
108
+ expect(Date.parse(poison.nextAttemptAt)).toBeGreaterThan(Date.now() - 1_000);
109
+ });
110
+ it("backs off between attempts instead of retrying on every pass", async () => {
111
+ const before = (await eventFor("poison-1")).attempts;
112
+ await new Promise((r) => setTimeout(r, 1_500));
113
+ const after = (await eventFor("poison-1")).attempts;
114
+ // Doubling from 100 ms, at most a handful of attempts fit in 1.5 s; every pass would be dozens.
115
+ expect(after - before).toBeLessThanOrEqual(5);
116
+ });
117
+ it("recovers once the subscriber is fixed, without re-running subscribers that already succeeded", async () => {
118
+ await sql(faultOff("acme"));
119
+ await subject.outbox.retry((await eventFor("poison-1")).id);
120
+ const event = await delivered("poison-1");
121
+ expect([...event.deliveredTo].sort()).toEqual(SUBSCRIBERS);
122
+ expect(await seenRows("poison-1", "count")).toBe(1);
123
+ // The flaky subscriber's failed attempts rolled back with their savepoints; only the successful one remains.
124
+ expect(await seenRows("poison-1", "flaky")).toBe(1);
125
+ expect(await seenRows("good-1", "count")).toBe(1);
126
+ });
127
+ it("runs subscribers as a system actor confined to the event's organisation", async () => {
128
+ const globexDoc = await create("Globex plan", gus);
129
+ const acmeDoc = await create("Acme plan");
130
+ await create(`meddle:${globexDoc}`);
131
+ await create(`meddle:${acmeDoc}`);
132
+ await delivered(`meddle:${acmeDoc}`);
133
+ await delivered(`meddle:${globexDoc}`);
134
+ const titles = await subject.sql(`SELECT id, title FROM docs.doc WHERE id = ANY($1)`, [[globexDoc, acmeDoc]]);
135
+ expect(Object.fromEntries(titles.map((t) => [t.id, t.title]))).toEqual({
136
+ [globexDoc]: "Globex plan",
137
+ [acmeDoc]: "meddled",
138
+ });
139
+ });
140
+ describe("dead letters", () => {
141
+ const deadLetter = (title) => eventually(`the dead letter of ${title}`, async () => {
142
+ const event = await eventFor(title);
143
+ if (event === undefined)
144
+ return undefined;
145
+ return (await subject.outbox.deadLetters({ eventId: event.id }))[0];
146
+ }, (letter) => letter !== undefined);
147
+ const manage = (as, operation, input) => subject.outbox.manage(as.token, operation, input);
148
+ const listedBy = async (as, input = {}) => {
149
+ const listed = await manage(as, "listDeadLetters", input);
150
+ if (!listed.ok)
151
+ throw new Error(`listDeadLetters failed: ${listed.error._tag}`);
152
+ return listed.result;
153
+ };
154
+ it("dead-letters a poison delivery after its policy's attempts, without blocking other events or subscribers", async () => {
155
+ await sql(poisonOn("acme"));
156
+ await create("deadly-1");
157
+ await create("after-deadly");
158
+ await delivered("after-deadly");
159
+ const letter = await deadLetter("deadly-1");
160
+ expect(Schema.is(DeadLetter)(letter), JSON.stringify(letter)).toBe(true);
161
+ expect(letter).toMatchObject({
162
+ subscriber: "docs.poison",
163
+ type: "docs.created",
164
+ orgId: "acme",
165
+ state: "dead",
166
+ attempts: POISON_ATTEMPTS,
167
+ closedBy: null,
168
+ });
169
+ expect(letter.lastError).toContain("poison subscriber crashed on deadly-1");
170
+ // Every other subscriber of the same event succeeded; the event is settled, but not delivered.
171
+ const event = await eventually("the poisoned event to settle", () => eventFor("deadly-1"), (e) => e?.settledAt != null);
172
+ expect(event.deliveredAt).toBeNull();
173
+ expect([...event.deliveredTo].sort()).toEqual(SUBSCRIBERS.filter((s) => s !== "docs.poison"));
174
+ expect(event.failures).toEqual([
175
+ expect.objectContaining({ subscriber: "docs.poison", state: "dead", attempts: POISON_ATTEMPTS }),
176
+ ]);
177
+ // Each failed attempt rolled back with its savepoint.
178
+ expect(await seenRows("deadly-1", "poison")).toBe(0);
179
+ });
180
+ it("stops retrying a dead letter", async () => {
181
+ const before = (await deadLetter("deadly-1"));
182
+ for (let i = 0; i < 5; i++)
183
+ await subject.outbox.dispatch();
184
+ await new Promise((r) => setTimeout(r, 300));
185
+ const after = (await subject.outbox.deadLetters({ eventId: before.eventId }))[0];
186
+ expect(after).toMatchObject({ state: "dead", attempts: POISON_ATTEMPTS, deadAt: before.deadAt });
187
+ });
188
+ it("lets only an administrator of the event's organisation list, retry or discard it, and audits each call", async () => {
189
+ const letter = (await deadLetter("deadly-1"));
190
+ const ref = { eventId: letter.eventId, subscriber: letter.subscriber };
191
+ // A member without the permission, and an administrator of another organisation.
192
+ for (const [operation, input] of [
193
+ ["listDeadLetters", {}],
194
+ ["retryDeadLetter", ref],
195
+ ["discardDeadLetter", ref],
196
+ ]) {
197
+ expect(await manage(olive, operation, input)).toMatchObject({ ok: false, error: { _tag: "Forbidden" } });
198
+ }
199
+ expect((await listedBy(gia)).map((l) => l.eventId)).not.toContain(letter.eventId);
200
+ expect(await manage(gia, "discardDeadLetter", ref)).toMatchObject({
201
+ ok: false,
202
+ error: { _tag: "InvalidInput" },
203
+ });
204
+ expect(await manage({ ...olive, token: "not-a-session" }, "listDeadLetters", {})).toMatchObject({
205
+ ok: false,
206
+ error: { _tag: "Unauthenticated" },
207
+ });
208
+ // The administrator of acme sees it.
209
+ expect(await listedBy(ada)).toContainEqual(expect.objectContaining({ eventId: letter.eventId, subscriber: "docs.poison", state: "dead" }));
210
+ // The refused calls changed nothing.
211
+ expect((await subject.outbox.deadLetters({ eventId: letter.eventId }))[0]).toMatchObject({
212
+ state: "dead",
213
+ deadAt: letter.deadAt,
214
+ });
215
+ expect(await subject.audit({ action: "eloxiv.outbox.retryDeadLetter", outcome: "denied" })).toContainEqual(expect.objectContaining({ actorUserId: olive.id, orgId: "acme", errorTag: "Forbidden" }));
216
+ expect(await subject.audit({ action: "eloxiv.outbox.discardDeadLetter", outcome: "failed" })).toContainEqual(expect.objectContaining({ actorUserId: gia.id, orgId: "globex", errorTag: "InvalidInput" }));
217
+ expect(await subject.audit({ action: "eloxiv.outbox.listDeadLetters", outcome: "succeeded" })).toContainEqual(expect.objectContaining({ actorUserId: ada.id, orgId: "acme" }));
218
+ });
219
+ it("re-runs a retried dead letter with a fresh budget, and delivers it once the fault is fixed", async () => {
220
+ const letter = (await deadLetter("deadly-1"));
221
+ const ref = { eventId: letter.eventId, subscriber: letter.subscriber };
222
+ // Still failing: the retry runs it again, and it dead-letters again after a fresh set of attempts.
223
+ expect(await manage(ada, "retryDeadLetter", ref)).toMatchObject({ ok: true });
224
+ const again = await eventually("the retried delivery to dead-letter again", async () => (await subject.outbox.deadLetters({ eventId: letter.eventId }))[0], (l) => l !== undefined && l.deadAt !== letter.deadAt);
225
+ expect(again).toMatchObject({ state: "dead", attempts: POISON_ATTEMPTS });
226
+ // Fixed and retried: it is delivered, the dead letter is gone and the event reached every subscriber.
227
+ await sql(poisonOff("acme"));
228
+ expect(await manage(ada, "retryDeadLetter", ref)).toMatchObject({ ok: true });
229
+ const event = await delivered("deadly-1");
230
+ expect([...event.deliveredTo].sort()).toEqual(SUBSCRIBERS);
231
+ expect(event.failures).toEqual([]);
232
+ expect(await subject.outbox.deadLetters({ eventId: letter.eventId })).toEqual([]);
233
+ expect(await seenRows("deadly-1", "poison")).toBe(1);
234
+ // Subscribers that had succeeded were not run again.
235
+ expect(await seenRows("deadly-1", "count")).toBe(1);
236
+ const retried = await subject.audit({ action: "eloxiv.outbox.retryDeadLetter", outcome: "succeeded" });
237
+ expect(retried.filter((r) => r.actorUserId === ada.id).length).toBe(2);
238
+ // Retrying what is no longer a dead letter is refused.
239
+ expect(await manage(ada, "retryDeadLetter", ref)).toMatchObject({ ok: false, error: { _tag: "InvalidInput" } });
240
+ });
241
+ it("closes a discarded dead letter: kept as discarded, never run again, its event settled", async () => {
242
+ await sql(poisonOn("acme"));
243
+ await create("deadly-2");
244
+ const letter = (await deadLetter("deadly-2"));
245
+ const ref = { eventId: letter.eventId, subscriber: letter.subscriber };
246
+ expect(await manage(ada, "discardDeadLetter", ref)).toMatchObject({ ok: true });
247
+ expect(await subject.outbox.deadLetters({ eventId: letter.eventId })).toEqual([]);
248
+ const [closed] = await subject.outbox.deadLetters({ eventId: letter.eventId, state: "discarded" });
249
+ expect(closed).toMatchObject({ state: "discarded", closedBy: ada.id, attempts: POISON_ATTEMPTS });
250
+ expect(closed.closedAt).toEqual(expect.any(String));
251
+ expect(await listedBy(ada, { state: "discarded" })).toContainEqual(expect.objectContaining({ eventId: letter.eventId, state: "discarded" }));
252
+ // A discarded letter cannot be retried, and is never run again, even once the fault is gone.
253
+ await sql(poisonOff("acme"));
254
+ expect(await manage(ada, "retryDeadLetter", ref)).toMatchObject({ ok: false, error: { _tag: "InvalidInput" } });
255
+ await subject.outbox.retry(letter.eventId);
256
+ for (let i = 0; i < 3; i++)
257
+ await subject.outbox.dispatch();
258
+ expect(await seenRows("deadly-2", "poison")).toBe(0);
259
+ const event = await eventFor("deadly-2");
260
+ expect(event.settledAt).toEqual(expect.any(String));
261
+ expect(event.deliveredTo).not.toContain("docs.poison");
262
+ expect(await subject.audit({ action: "eloxiv.outbox.discardDeadLetter", outcome: "succeeded" })).toContainEqual(expect.objectContaining({ actorUserId: ada.id, orgId: "acme" }));
263
+ });
264
+ });
265
+ });
266
+ //# sourceMappingURL=Outbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Outbox.js","sourceRoot":"","sources":["../../src/conformance/Outbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,cAAc,EAA0B,MAAM,mBAAmB,CAAA;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAClE,OAAO,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,eAAe,EACf,SAAS,EACT,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,UAAU,EAA2D,MAAM,cAAc,CAAA;AAElG,6DAA6D;AAC7D,MAAM,WAAW,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAA;AAE7F,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAmB,EAAE,EAAE,CACvD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,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AAM,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACpD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAA;YACxC,MAAM,CAAC,KAAM,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;YACpD,MAAM,CAAC,KAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,aAAa,CAAC,CAAA;YACvD,MAAM,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,iCAAiC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,cAAc,CAC7G,MAAM,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAChE,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { type PlatformSubject } from "./PlatformSubject.ts";
2
+ export declare const startPlatformReference: (name: string) => Promise<PlatformSubject & {
3
+ readonly url: string;
4
+ }>;
5
+ //# sourceMappingURL=PlatformReference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformReference.d.ts","sourceRoot":"","sources":["../../src/conformance/PlatformReference.ts"],"names":[],"mappings":"AAWA,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAG7E,eAAO,MAAM,sBAAsB,SAAgB,MAAM,KAAG,OAAO,CAAC,eAAe,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CA0D7G,CAAA"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * The Eloxiv kernel as a platform conformance subject (QuerySurface, Settings, Flags): an in-process kernel
3
+ * on a fresh database serving the platform conformance app. It builds on the inbox reference's controls
4
+ * (users, roles, groups, the five surfaces, the sync endpoint), with keyed sync queries and the settings
5
+ * operator call added.
6
+ */
7
+ import { appProblems, Settings } from "@eloxiv/kernel";
8
+ import { defineModuleContract } from "@eloxiv/contracts";
9
+ import { Effect } from "effect";
10
+ import { platformApp, crmModule } from "./crm/app.js";
11
+ import { startInboxReference } from "./InboxReference.js";
12
+ import { QUERY_TIMEOUT_MS } from "./PlatformSubject.js";
13
+ export const startPlatformReference = async (name) => {
14
+ const inbox = await startInboxReference({
15
+ name,
16
+ app: platformApp,
17
+ config: { query: { timeoutMs: QUERY_TIMEOUT_MS } },
18
+ });
19
+ return {
20
+ url: inbox.url,
21
+ user: inbox.user,
22
+ role: inbox.role,
23
+ assignRole: inbox.assignRole,
24
+ joinGroup: inbox.joinGroup,
25
+ leaveGroup: async (userId, org, group) => void (await inbox.sql(`DELETE FROM eloxiv.group_member WHERE org_id = $1 AND group_id = $2 AND user_id = $3`, [
26
+ org,
27
+ group,
28
+ userId,
29
+ ])),
30
+ invoke: inbox.invoke,
31
+ sql: inbox.sql,
32
+ audit: inbox.audit,
33
+ query: async (token, query, args, org) => {
34
+ const headers = { authorization: `Bearer ${token}`, "content-type": "application/json" };
35
+ if (org !== undefined)
36
+ headers["x-eloxiv-org"] = org;
37
+ const response = await fetch(`${inbox.url}/zero/query`, {
38
+ method: "POST",
39
+ headers,
40
+ body: JSON.stringify(["transform", [{ id: "q1", name: query, args }]]),
41
+ });
42
+ if (response.status === 401) {
43
+ await response.body?.cancel();
44
+ return { status: 401 };
45
+ }
46
+ if (response.status !== 200)
47
+ throw new Error(`Unexpected sync response ${response.status}: ${await response.text()}`);
48
+ const body = (await response.json());
49
+ return { status: 200, answer: body.queries[0] ?? {} };
50
+ },
51
+ selected: inbox.selected,
52
+ configure: (key, level, value) => inbox.run(Effect.gen(function* () {
53
+ const settings = yield* Settings;
54
+ return yield* settings.configure({ key, level, value, operator: "conformance" }).pipe(Effect.map(() => ({ ok: true })), Effect.catchTag("InvalidInput", (e) => Effect.succeed({ ok: false, error: e.message })));
55
+ })),
56
+ settingProblems: async (settings) => {
57
+ const contract = defineModuleContract({
58
+ ...crmModule.contract,
59
+ settings: { ...crmModule.contract.settings, ...settings },
60
+ });
61
+ return appProblems({ ...platformApp, modules: [{ ...crmModule, contract }, ...platformApp.modules.slice(1)] });
62
+ },
63
+ dispose: inbox.dispose,
64
+ };
65
+ };
66
+ //# sourceMappingURL=PlatformReference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformReference.js","sourceRoot":"","sources":["../../src/conformance/PlatformReference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,sBAAsB,CAAA;AAG7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EAAE,IAAY,EAAuD,EAAE;IAChH,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC;QACtC,IAAI;QACJ,GAAG,EAAE,WAAW;QAChB,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE;KACnD,CAAC,CAAA;IACF,OAAO;QACL,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG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