@eloxiv/testing 0.0.0-stage → 0.1.1

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 +908 -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 +70 -0
  240. package/dist/conformance/LocalClient.d.ts.map +1 -0
  241. package/dist/conformance/LocalClient.js +576 -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 +1075 -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 +707 -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,764 @@
1
+ /**
2
+ * Conformance kit for the Scheduler contract (docs/contracts/scheduler.md).
3
+ *
4
+ * The harness drives a kernel with the ledger fixture installed (with its `minutely` job) and the runtime
5
+ * `scheduler` module, whose own scheduling loop is off, so every sweep happens at a time the check chooses.
6
+ * Its grace period is 30 s. The kernel runs the kit in `packages/testing/test/scheduler.test.ts`; restart
7
+ * guarantees (missed runs after a real outage, a run killed mid-step) are in
8
+ * `packages/testing/test/durable-restart.test.ts`.
9
+ */
10
+ import type {
11
+ AutomationCatalog,
12
+ CatchUp,
13
+ ExecutionStatus,
14
+ RunRecord,
15
+ RuntimeScheduleSpec,
16
+ ScheduledRun,
17
+ ScheduleRecord,
18
+ SchedulerHealth,
19
+ ScheduleSpec,
20
+ ScheduleSummary,
21
+ ScheduleTarget,
22
+ } from "@eloxiv/contracts"
23
+ import assert from "node:assert/strict"
24
+ import { eventually, type Check } from "./Workflow.ts"
25
+
26
+ export interface SchedulerHarness {
27
+ /** The schedule actions, as a member (`as: "owner"`) or another member of the same organisation. */
28
+ readonly create: (
29
+ input: {
30
+ readonly name: string
31
+ readonly schedule: RuntimeScheduleSpec
32
+ readonly target: ScheduleTarget
33
+ readonly catchUp?: CatchUp
34
+ readonly share?: ReadonlyArray<{
35
+ readonly grantee: { readonly user: string }
36
+ readonly permission: "view" | "operate"
37
+ }>
38
+ },
39
+ as?: "owner" | "other",
40
+ ) => Promise<{ readonly id: string }>
41
+ readonly pause: (id: string, as?: "owner" | "other") => Promise<{ readonly id: string }>
42
+ readonly resume: (id: string, as?: "owner" | "other") => Promise<{ readonly id: string }>
43
+ readonly delete: (id: string, as?: "owner" | "other") => Promise<{ readonly id: string }>
44
+ readonly schedules: () => Promise<ReadonlyArray<ScheduleRecord>>
45
+ readonly sweep: (now: Date) => Promise<ReadonlyArray<ScheduledRun>>
46
+ readonly preview: (schedule: ScheduleSpec, after: Date, count: number) => Promise<ReadonlyArray<string>>
47
+ readonly status: (executionId: string) => Promise<ExecutionStatus>
48
+ /** The owner's user id and organisation. */
49
+ readonly owner: { readonly userId: string; readonly orgId: string }
50
+ readonly entries: (ref: string) => Promise<ReadonlyArray<{ readonly ownerId: string }>>
51
+ /** Audit outcomes of `action` by `actor`, oldest first. */
52
+ readonly auditOutcomes: (action: string, actor: string) => Promise<ReadonlyArray<string>>
53
+ /** Deliver an outbox event again, as after a crash between the delivery and its record. */
54
+ readonly redeliver: (eventId: string) => Promise<void>
55
+ /** The outbox event that recording the entry with this ref emitted. */
56
+ readonly eventFor: (ref: string) => Promise<{ readonly id: string; readonly delivered: boolean } | undefined>
57
+ /** The execution id the trigger started for an event. */
58
+ readonly triggered: (trigger: string, eventId: string) => Promise<string>
59
+ /** `scheduler.runNow`, `scheduler.run`, `scheduler.list`, `scheduler.runs` and `scheduler.health`, as a member. */
60
+ readonly runNow: (id: string, as?: "owner" | "other") => Promise<{ readonly id: string; readonly key: string }>
61
+ readonly run: (
62
+ target: ScheduleTarget,
63
+ as?: "owner" | "other",
64
+ ) => Promise<{ readonly id: string; readonly key: string }>
65
+ readonly list: (as?: "owner" | "other") => Promise<ReadonlyArray<ScheduleSummary>>
66
+ readonly runs: (id: string, as?: "owner" | "other") => Promise<ReadonlyArray<RunRecord>>
67
+ readonly health: () => Promise<SchedulerHealth>
68
+ readonly catalog: () => Promise<AutomationCatalog>
69
+ /** Share one of the owner's schedules with the other member, for `view` or `operate` (a trusted grant). */
70
+ readonly share: (id: string, permission: "view" | "operate") => Promise<void>
71
+ /** The other member's user id. */
72
+ readonly other: { readonly userId: string }
73
+ /** Titles of the owner's notifications in `category`, oldest first. */
74
+ readonly notifications: (category: string) => Promise<ReadonlyArray<string>>
75
+ /** How many due runs of a schedule fail in a row before the kernel pauses it. */
76
+ readonly pauseAfter: number
77
+ /** `ledger.record` as the owner or the other member (an entry of `kind`, emitting `ledger.recorded`). */
78
+ readonly recordAs: (entry: { readonly kind: string; readonly ref: string }, as: "owner" | "other") => Promise<void>
79
+ /**
80
+ * What the organisation's (scripted) model was asked so far, oldest first; it answers `holds` for an event whose
81
+ * payload is a `note` entry mentioning "urgent".
82
+ */
83
+ readonly modelPrompts: () => Promise<ReadonlyArray<string>>
84
+ /**
85
+ * The agent runs whose person's message contains `text`: kind, status, stop reason, result, and how the run's
86
+ * execution ended. The model ends a run asked to "Check the queue" with its `no_op` tool when it is offered.
87
+ */
88
+ readonly agentRuns: (text: string) => Promise<
89
+ ReadonlyArray<{
90
+ readonly kind: string
91
+ readonly status: string
92
+ readonly stopReason: string | null
93
+ readonly result: string | null
94
+ readonly executionState: string | null
95
+ }>
96
+ >
97
+ }
98
+
99
+ /**
100
+ * Each check sweeps at times of its own, a day after the previous check's, because a sweep moves every
101
+ * schedule's cursor forward and a later sweep at an earlier time would find nothing due.
102
+ */
103
+ let clock = Date.now()
104
+ const nextBase = () => new Date((clock += 86_400_000))
105
+
106
+ const unique = (prefix: string) => `${prefix}-${crypto.randomUUID().slice(0, 8)}`
107
+ const minutes = (n: number) => n * 60_000
108
+ const at = (base: Date, ms: number) => new Date(base.getTime() + ms)
109
+ const record = (ref: string): ScheduleTarget => ({
110
+ kind: "action",
111
+ action: "ledger.record",
112
+ input: { kind: "sched", ref },
113
+ })
114
+
115
+ const rejectsWith = async (promise: Promise<unknown>, tag: string) => {
116
+ try {
117
+ await promise
118
+ } catch (error) {
119
+ assert.equal((error as { _tag?: string })._tag, tag)
120
+ return
121
+ }
122
+ assert.fail(`expected a ${tag} failure`)
123
+ }
124
+
125
+ const runsOf = (runs: ReadonlyArray<ScheduledRun>, key: string) =>
126
+ runs
127
+ .filter((r) => r.key === key)
128
+ .map((r) => [r.scheduledAt, r.missed] as const)
129
+ .sort((x, y) => x[0].localeCompare(y[0]))
130
+
131
+ /** The runs of `id` once none is pending or running any more. */
132
+ const settledRuns = (h: SchedulerHarness, id: string, count: number, as?: "owner" | "other") =>
133
+ eventually(
134
+ `${count} finished run(s)`,
135
+ () => h.runs(id, as),
136
+ (runs) => runs.length >= count && runs.every((r) => r.state !== "pending" && r.state !== "running"),
137
+ )
138
+
139
+ /** Sweep at `now` until the runs it starts have finished, then once more, so the scheduler settles them. */
140
+ const sweepAndSettle = async (h: SchedulerHarness, id: string, now: Date, count: number) => {
141
+ await h.sweep(now)
142
+ const runs = await settledRuns(h, id, count)
143
+ await h.sweep(now)
144
+ return runs
145
+ }
146
+
147
+ /** Sweep (starting what event deliveries recorded) until `count` runs of `id` have finished. */
148
+ const automated = (h: SchedulerHarness, id: string, count: number) =>
149
+ eventually(
150
+ `${count} finished run(s) of ${id}`,
151
+ async () => {
152
+ await h.sweep(new Date())
153
+ return h.runs(id)
154
+ },
155
+ (runs) => runs.length >= count && runs.every((r) => r.state !== "pending" && r.state !== "running"),
156
+ )
157
+
158
+ export const schedulerChecks: ReadonlyArray<Check<SchedulerHarness>> = [
159
+ {
160
+ name: "previews cron times in the schedule's time zone, across DST changes",
161
+ run: async (h) => {
162
+ const berlin: ScheduleSpec = { kind: "cron", expression: "30 2 * * *", timeZone: "Europe/Berlin" }
163
+ // 29 March 2026: 02:00 jumps to 03:00, so 02:30 does not exist: it runs as late as the gap is long, at
164
+ // 03:30 CEST (the wall time an hour on), once.
165
+ assert.deepEqual(await h.preview(berlin, new Date("2026-03-27T12:00:00Z"), 4), [
166
+ "2026-03-28T01:30:00.000Z",
167
+ "2026-03-29T01:30:00.000Z",
168
+ "2026-03-30T00:30:00.000Z",
169
+ "2026-03-31T00:30:00.000Z",
170
+ ])
171
+ // 25 October 2026: 03:00 falls back to 02:00, so 02:30 happens twice and runs once (the earlier).
172
+ assert.deepEqual(await h.preview(berlin, new Date("2026-10-23T12:00:00Z"), 4), [
173
+ "2026-10-24T00:30:00.000Z",
174
+ "2026-10-25T00:30:00.000Z",
175
+ "2026-10-26T01:30:00.000Z",
176
+ "2026-10-27T01:30:00.000Z",
177
+ ])
178
+ await rejectsWith(
179
+ h.preview({ kind: "cron", expression: "61 * * * *", timeZone: "UTC" }, new Date(), 1),
180
+ "InvalidInput",
181
+ )
182
+ await rejectsWith(
183
+ h.preview({ kind: "cron", expression: "* * * * *", timeZone: "Mars/Olympus" }, new Date(), 1),
184
+ "InvalidInput",
185
+ )
186
+ },
187
+ },
188
+ {
189
+ name: "starts one workflow execution per due time, keyed by (schedule, time), and never twice",
190
+ run: async (h) => {
191
+ const ref = unique("due")
192
+ const { id } = await h.create({
193
+ name: ref,
194
+ schedule: { kind: "interval", everyMs: minutes(1) },
195
+ target: record(ref),
196
+ })
197
+ const key = `schedule:${id}`
198
+ const t0 = nextBase()
199
+ assert.deepEqual(runsOf(await h.sweep(t0), key), [])
200
+ const runs = await h.sweep(at(t0, minutes(1) + 1_000))
201
+ assert.deepEqual(runsOf(runs, key), [[at(t0, minutes(1)).toISOString(), false]])
202
+ // The same sweep again, or a later one before the next due time, starts nothing.
203
+ assert.deepEqual(runsOf(await h.sweep(at(t0, minutes(1) + 2_000)), key), [])
204
+ const run = runs.find((r) => r.key === key)!
205
+ await eventually(
206
+ "the run to finish",
207
+ () => h.status(run.executionId),
208
+ (s) => s.state === "succeeded",
209
+ )
210
+ const entries = await h.entries(ref)
211
+ assert.equal(entries.length, 1)
212
+ // A runtime schedule runs as its owner.
213
+ assert.equal(entries[0]!.ownerId, h.owner.userId)
214
+ await h.delete(id)
215
+ },
216
+ },
217
+ {
218
+ name: "applies each schedule's catch-up policy to runs missed while no sweep ran",
219
+ run: async (h) => {
220
+ const make = async (catchUp: CatchUp) => {
221
+ const ref = unique(catchUp)
222
+ const { id } = await h.create({
223
+ name: ref,
224
+ schedule: { kind: "interval", everyMs: minutes(1) },
225
+ target: record(ref),
226
+ catchUp,
227
+ })
228
+ return `schedule:${id}`
229
+ }
230
+ const keys = { all: await make("all"), once: await make("once"), skip: await make("skip") }
231
+ const t0 = nextBase()
232
+ await h.sweep(t0)
233
+ // Ten due times later: the last is on time (within the grace period), the nine before it were missed.
234
+ const runs = await h.sweep(at(t0, minutes(10) + 5_000))
235
+ const time = (n: number) => at(t0, minutes(n)).toISOString()
236
+ assert.deepEqual(
237
+ runsOf(runs, keys.all),
238
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((n) => [time(n), n < 10]),
239
+ )
240
+ assert.deepEqual(runsOf(runs, keys.once), [
241
+ [time(9), true],
242
+ [time(10), false],
243
+ ])
244
+ assert.deepEqual(runsOf(runs, keys.skip), [[time(10), false]])
245
+ for (const key of Object.values(keys)) await h.delete(key.slice("schedule:".length))
246
+ },
247
+ },
248
+ {
249
+ name: "catch-up all starts every missed run of a long backlog, oldest first, over several sweeps",
250
+ run: async (h) => {
251
+ const ref = unique("backlog")
252
+ const { id } = await h.create({
253
+ name: ref,
254
+ schedule: { kind: "interval", everyMs: minutes(1) },
255
+ target: record(ref),
256
+ catchUp: "all",
257
+ })
258
+ const key = `schedule:${id}`
259
+ const t0 = nextBase()
260
+ await h.sweep(t0)
261
+ // 250 due times, more than one sweep starts: the rest start in the following sweeps, none is dropped.
262
+ const now = at(t0, minutes(250) + 5_000)
263
+ const started: Array<string> = []
264
+ for (let sweeps = 0; sweeps < 10; sweeps++) {
265
+ const runs = runsOf(await h.sweep(now), key)
266
+ if (runs.length === 0) break
267
+ started.push(...runs.map(([time]) => time))
268
+ }
269
+ assert.deepEqual(
270
+ started,
271
+ Array.from({ length: 250 }, (_, i) => at(t0, minutes(i + 1)).toISOString()),
272
+ )
273
+ assert.deepEqual(runsOf(await h.sweep(at(now, 1_000)), key), [])
274
+ await h.delete(id)
275
+ },
276
+ },
277
+ {
278
+ name: "a schedule paused and resumed between two sweeps runs none of the time it was paused",
279
+ run: async (h) => {
280
+ const ref = unique("paused-briefly")
281
+ const { id } = await h.create({
282
+ name: ref,
283
+ schedule: { kind: "interval", everyMs: 100 },
284
+ target: record(ref),
285
+ catchUp: "all",
286
+ })
287
+ const key = `schedule:${id}`
288
+ // Real time: pausing and resuming happen now, so the sweeps must too.
289
+ await h.sweep(new Date())
290
+ await h.pause(id)
291
+ await new Promise((resolve) => setTimeout(resolve, 550))
292
+ const resumedAfter = Date.now()
293
+ await h.resume(id)
294
+ const paused = runsOf(await h.sweep(new Date()), key).filter(([time]) => Date.parse(time) <= resumedAfter)
295
+ assert.deepEqual(paused, [])
296
+ // It runs again after the resume.
297
+ await new Promise((resolve) => setTimeout(resolve, 350))
298
+ const after = runsOf(await h.sweep(new Date()), key)
299
+ assert.ok(after.length >= 1, "the resumed schedule runs again")
300
+ assert.ok(after.every(([time]) => Date.parse(time) > resumedAfter))
301
+ await h.delete(id)
302
+ },
303
+ },
304
+ {
305
+ name: "a paused schedule starts nothing and is not caught up when resumed",
306
+ run: async (h) => {
307
+ const ref = unique("paused")
308
+ const { id } = await h.create({
309
+ name: ref,
310
+ schedule: { kind: "interval", everyMs: minutes(1) },
311
+ target: record(ref),
312
+ catchUp: "all",
313
+ })
314
+ const key = `schedule:${id}`
315
+ const t0 = nextBase()
316
+ await h.sweep(t0)
317
+ await h.pause(id)
318
+ assert.equal((await h.schedules()).find((s) => s.key === key)?.paused, true)
319
+ assert.deepEqual(runsOf(await h.sweep(at(t0, minutes(5) + 1_000)), key), [])
320
+ await h.resume(id)
321
+ assert.deepEqual(runsOf(await h.sweep(at(t0, minutes(6) + 1_000)), key), [
322
+ [at(t0, minutes(6)).toISOString(), false],
323
+ ])
324
+ await h.delete(id)
325
+ assert.equal(
326
+ (await h.schedules()).some((s) => s.key === key),
327
+ false,
328
+ )
329
+ assert.deepEqual(runsOf(await h.sweep(at(t0, minutes(8) + 1_000)), key), [])
330
+ },
331
+ },
332
+ {
333
+ name: "only a schedule's owner may change it, and every change is audited",
334
+ run: async (h) => {
335
+ const ref = unique("owned")
336
+ const { id } = await h.create({
337
+ name: ref,
338
+ schedule: { kind: "interval", everyMs: minutes(1) },
339
+ target: record(ref),
340
+ })
341
+ await rejectsWith(h.pause(id, "other"), "Forbidden")
342
+ await rejectsWith(h.delete(id, "other"), "Forbidden")
343
+ await h.pause(id)
344
+ assert.equal((await h.auditOutcomes("scheduler.pause", h.owner.userId)).at(-1), "succeeded")
345
+ await rejectsWith(
346
+ h.create({ name: ref, schedule: { kind: "cron", expression: "nope", timeZone: "UTC" }, target: record(ref) }),
347
+ "InvalidInput",
348
+ )
349
+ await h.delete(id)
350
+ },
351
+ },
352
+ {
353
+ name: "starts a workflow target from a runtime schedule only when the workflow is schedulable",
354
+ run: async (h) => {
355
+ const label = unique("sleepy")
356
+ const allowed = await h.create({
357
+ name: label,
358
+ schedule: { kind: "interval", everyMs: minutes(1) },
359
+ target: { kind: "workflow", workflow: "ledger.sleeper", input: { label, ms: 0 } },
360
+ })
361
+ const refused = await h.create({
362
+ name: label,
363
+ schedule: { kind: "interval", everyMs: minutes(1) },
364
+ target: { kind: "workflow", workflow: "ledger.doomed", input: { reason: "not schedulable" } },
365
+ })
366
+ const t0 = nextBase()
367
+ await h.sweep(t0)
368
+ const runs = await h.sweep(at(t0, minutes(1)))
369
+ assert.deepEqual(runsOf(runs, `schedule:${refused.id}`), [])
370
+ const run = runs.find((r) => r.key === `schedule:${allowed.id}`)
371
+ assert.ok(run, "the schedulable workflow was started")
372
+ await eventually(
373
+ "the workflow run to finish",
374
+ () => h.status(run.executionId),
375
+ (s) => s.state === "succeeded",
376
+ )
377
+ assert.equal((await h.entries(`${label}/after`))[0]?.ownerId, h.owner.userId)
378
+ await h.delete(allowed.id)
379
+ await h.delete(refused.id)
380
+ },
381
+ },
382
+ {
383
+ name: "runs manifest jobs for every organisation, as its system actor",
384
+ run: async (h) => {
385
+ const job = (await h.schedules()).find((s) => s.key === `job:ledger.minutely:${h.owner.orgId}`)
386
+ assert.ok(job, "the ledger's minutely job is scheduled for the owner's organisation")
387
+ assert.deepEqual(job.identity, { kind: "system", orgId: h.owner.orgId })
388
+ assert.equal(job.source, "manifest")
389
+ const t0 = nextBase()
390
+ await h.sweep(t0)
391
+ const runs = (await h.sweep(at(t0, minutes(1)))).filter((r) => r.key === job.key)
392
+ assert.equal(runs.length, 1)
393
+ await eventually(
394
+ "the job run to finish",
395
+ () => h.status(runs[0]!.executionId),
396
+ (s) => s.state === "succeeded",
397
+ )
398
+ const entries = await h.entries("minutely")
399
+ assert.ok(entries.length >= 1)
400
+ assert.ok(entries.every((e) => e.ownerId === "$system"))
401
+ },
402
+ },
403
+ {
404
+ name: "an event trigger starts its workflow once per event, also when the event is delivered again",
405
+ run: async (h) => {
406
+ const ref = unique("evt")
407
+ const target: ScheduleTarget = { kind: "action", action: "ledger.record", input: { kind: "evt", ref } }
408
+ const { id } = await h.create({ name: ref, schedule: { kind: "interval", everyMs: minutes(1) }, target })
409
+ const t0 = nextBase()
410
+ await h.sweep(t0)
411
+ const run = (await h.sweep(at(t0, minutes(1) + 1_000))).find((r) => r.key === `schedule:${id}`)
412
+ await eventually(
413
+ "the run to finish",
414
+ () => h.status(run!.executionId),
415
+ (s) => s.state === "succeeded",
416
+ )
417
+ await h.delete(id)
418
+ const event = await eventually(
419
+ "the event's delivery",
420
+ () => h.eventFor(ref),
421
+ (e) => e?.delivered === true,
422
+ )
423
+ const execution = await h.triggered("ledger.echo", event!.id)
424
+ await eventually(
425
+ "the echo",
426
+ () => h.entries(ref),
427
+ (e) => e.length === 2,
428
+ )
429
+ await h.redeliver(event!.id)
430
+ await eventually(
431
+ "the redelivery",
432
+ () => h.eventFor(ref),
433
+ (e) => e?.delivered === true,
434
+ )
435
+ assert.equal(await h.triggered("ledger.echo", event!.id), execution)
436
+ await eventually(
437
+ "the echo execution",
438
+ () => h.status(execution),
439
+ (s) => s.state === "succeeded",
440
+ )
441
+ assert.equal((await h.entries(ref)).length, 2)
442
+ },
443
+ },
444
+ {
445
+ name: "records each run's outcome in its schedule's history: succeeded, a no-op with its reason, failed with its error tag",
446
+ run: async (h) => {
447
+ const ref = unique("outcomes")
448
+ const every = { kind: "interval", everyMs: minutes(1) } as const
449
+ const ok = await h.create({ name: `${ref}-ok`, schedule: every, target: record(ref) })
450
+ const idleAction = await h.create({
451
+ name: `${ref}-idle`,
452
+ schedule: every,
453
+ target: { kind: "action", action: "ledger.idle", input: { reason: "nothing waiting" } },
454
+ })
455
+ const idleFlow = await h.create({
456
+ name: `${ref}-flow`,
457
+ schedule: every,
458
+ target: { kind: "workflow", workflow: "ledger.idle-flow", input: { reason: "inbox empty" } },
459
+ })
460
+ // The action refuses this input (`kind` must be a string): the run fails.
461
+ const broken = await h.create({
462
+ name: `${ref}-broken`,
463
+ schedule: every,
464
+ target: { kind: "action", action: "ledger.record", input: { kind: 1, ref } },
465
+ })
466
+ const t0 = nextBase()
467
+ await h.sweep(t0)
468
+ await h.sweep(at(t0, minutes(1)))
469
+ const [okRun] = await settledRuns(h, ok.id, 1)
470
+ assert.equal(okRun!.state, "succeeded")
471
+ assert.equal(okRun!.requestedBy, null)
472
+ assert.equal(okRun!.scheduledAt, at(t0, minutes(1)).toISOString())
473
+ const [idleRun] = await settledRuns(h, idleAction.id, 1)
474
+ assert.deepEqual(
475
+ [idleRun!.state, idleRun!.reason, idleRun!.evidence],
476
+ ["noop", "nothing waiting", ["no entries waiting"]],
477
+ )
478
+ const [flowRun] = await settledRuns(h, idleFlow.id, 1)
479
+ assert.deepEqual([flowRun!.state, flowRun!.reason, flowRun!.evidence], ["noop", "inbox empty", ["queue empty"]])
480
+ assert.equal((await h.status(flowRun!.executionId)).noop?.reason, "inbox empty")
481
+ const [brokenRun] = await settledRuns(h, broken.id, 1)
482
+ assert.deepEqual([brokenRun!.state, brokenRun!.error], ["failed", "InvalidInput"])
483
+ // A no-op is not a failure: only the broken schedule has a streak.
484
+ const listed = new Map((await h.list()).map((s) => [s.id, s]))
485
+ assert.equal(listed.get(idleAction.id)?.failureStreak, 0)
486
+ assert.equal(listed.get(broken.id)?.failureStreak, 1)
487
+ assert.equal(listed.get(ok.id)?.lastRun?.state, "succeeded")
488
+ for (const { id } of [ok, idleAction, idleFlow, broken]) await h.delete(id)
489
+ },
490
+ },
491
+ {
492
+ name: "alerts the owner once when a schedule starts failing, and pauses it when its due runs keep failing",
493
+ run: async (h) => {
494
+ const ref = unique("failing")
495
+ const { id } = await h.create({
496
+ name: ref,
497
+ schedule: { kind: "interval", everyMs: minutes(1) },
498
+ target: { kind: "action", action: "ledger.record", input: { kind: 1, ref } },
499
+ })
500
+ const t0 = nextBase()
501
+ await h.sweep(t0)
502
+ for (let n = 1; n <= h.pauseAfter; n++) await sweepAndSettle(h, id, at(t0, minutes(n)), n)
503
+ // A run by hand that fails never counts.
504
+ await h.runNow(id)
505
+ await sweepAndSettle(h, id, at(t0, minutes(h.pauseAfter) + 1_000), h.pauseAfter + 1)
506
+ const schedule = (await h.list()).find((s) => s.id === id)
507
+ assert.deepEqual(
508
+ [schedule?.paused, schedule?.pausedReason, schedule?.failureStreak],
509
+ [true, "failures", h.pauseAfter],
510
+ )
511
+ // Once when the streak started, once when the kernel paused it; never for the runs between.
512
+ const alerts = (await h.notifications("scheduler.failures")).filter((t) => t.includes(ref))
513
+ assert.deepEqual(alerts, [
514
+ `Schedule ${ref} started failing`,
515
+ `Schedule ${ref} was paused after ${h.pauseAfter} failed runs in a row`,
516
+ ])
517
+ // Paused: no due run starts; resumed, its streak starts again.
518
+ assert.deepEqual(runsOf(await h.sweep(at(t0, minutes(h.pauseAfter + 3))), `schedule:${id}`), [])
519
+ await h.resume(id)
520
+ assert.equal((await h.list()).find((s) => s.id === id)?.failureStreak, 0)
521
+ await h.delete(id)
522
+ },
523
+ },
524
+ {
525
+ name: "runs a schedule by hand once, as the schedule's own identity, also while it is paused",
526
+ run: async (h) => {
527
+ const ref = unique("by-hand")
528
+ const { id } = await h.create({
529
+ name: ref,
530
+ schedule: { kind: "interval", everyMs: minutes(1) },
531
+ target: record(ref),
532
+ })
533
+ await h.pause(id)
534
+ const asked = await h.runNow(id)
535
+ assert.equal(asked.key, `schedule:${id}#manual:${asked.id}`)
536
+ await h.sweep(new Date())
537
+ // Another sweep records nothing more: the request is recorded once.
538
+ await h.sweep(new Date())
539
+ const runs = await settledRuns(h, id, 1)
540
+ assert.equal(runs.length, 1)
541
+ assert.deepEqual([runs[0]!.state, runs[0]!.requestedBy], ["succeeded", h.owner.userId])
542
+ const entries = await h.entries(ref)
543
+ assert.deepEqual(
544
+ entries.map((e) => e.ownerId),
545
+ [h.owner.userId],
546
+ )
547
+ assert.equal((await h.auditOutcomes("scheduler.runNow", h.owner.userId)).at(-1), "succeeded")
548
+ await h.delete(id)
549
+ },
550
+ },
551
+ {
552
+ name: "a schedule is seen by whom it is shared with and operated only by its operators, and always runs as its owner",
553
+ run: async (h) => {
554
+ const ref = unique("shared")
555
+ const { id } = await h.create({
556
+ name: ref,
557
+ schedule: { kind: "interval", everyMs: minutes(1) },
558
+ target: record(ref),
559
+ })
560
+ const seen = async (as: "owner" | "other") => (await h.list(as)).some((s) => s.id === id)
561
+ // Not shared: another member neither sees nor operates it, nor reads its runs.
562
+ assert.equal(await seen("other"), false)
563
+ await rejectsWith(h.runNow(id, "other"), "Forbidden")
564
+ await rejectsWith(h.runs(id, "other"), "Forbidden")
565
+ // Shared to view: seen, its runs readable, not operated.
566
+ await h.share(id, "view")
567
+ assert.equal(await seen("other"), true)
568
+ assert.deepEqual(await h.runs(id, "other"), [])
569
+ await rejectsWith(h.pause(id, "other"), "Forbidden")
570
+ await rejectsWith(h.runNow(id, "other"), "Forbidden")
571
+ // Shared to operate: paused and run by hand, still never resumed or deleted by the operator.
572
+ await h.share(id, "operate")
573
+ await h.pause(id, "other")
574
+ await rejectsWith(h.resume(id, "other"), "Forbidden")
575
+ await rejectsWith(h.delete(id, "other"), "Forbidden")
576
+ await h.runNow(id, "other")
577
+ await h.sweep(new Date())
578
+ const [run] = await settledRuns(h, id, 1, "other")
579
+ assert.deepEqual([run!.state, run!.requestedBy], ["succeeded", h.other.userId])
580
+ // The operator asked; the owner's authority ran it.
581
+ assert.deepEqual(
582
+ (await h.entries(ref)).map((e) => e.ownerId),
583
+ [h.owner.userId],
584
+ )
585
+ await h.delete(id)
586
+ // Created and shared in one call: both, or (a grantee outside the organisation) neither.
587
+ const shared = await h.create({
588
+ name: `${ref}-at-once`,
589
+ schedule: { kind: "interval", everyMs: minutes(1) },
590
+ target: record(ref),
591
+ share: [{ grantee: { user: h.other.userId }, permission: "operate" }],
592
+ })
593
+ assert.ok((await h.list("other")).some((s) => s.id === shared.id))
594
+ await h.pause(shared.id, "other")
595
+ const before = (await h.list()).length
596
+ await rejectsWith(
597
+ h.create({
598
+ name: `${ref}-refused`,
599
+ schedule: { kind: "interval", everyMs: minutes(1) },
600
+ target: record(ref),
601
+ share: [{ grantee: { user: "not-a-member" }, permission: "view" }],
602
+ }),
603
+ "InvalidInput",
604
+ )
605
+ assert.equal((await h.list()).length, before)
606
+ await h.delete(shared.id)
607
+ },
608
+ },
609
+ {
610
+ name: "runs an action or a schedulable workflow once, now, as the caller, and refuses a workflow members may not start",
611
+ run: async (h) => {
612
+ const ref = unique("once")
613
+ const asked = await h.run(record(ref), "other")
614
+ assert.equal(asked.key, `run:${asked.id}`)
615
+ const refused = await h.run({ kind: "workflow", workflow: "ledger.doomed", input: { reason: "x" } }, "other")
616
+ await h.sweep(new Date())
617
+ const [ran] = await settledRuns(h, asked.id, 1, "other")
618
+ assert.deepEqual([ran!.state, ran!.requestedBy], ["succeeded", h.other.userId])
619
+ assert.deepEqual(
620
+ (await h.entries(ref)).map((e) => e.ownerId),
621
+ [h.other.userId],
622
+ )
623
+ const [no] = await settledRuns(h, refused.id, 1, "other")
624
+ assert.equal(no!.state, "refused")
625
+ assert.match(no!.reason ?? "", /not schedulable/)
626
+ // Someone else's one-off run is not theirs to read.
627
+ await rejectsWith(h.runs(asked.id, "owner"), "Forbidden")
628
+ },
629
+ },
630
+ {
631
+ name: "reports the scheduler as healthy while a kernel sweeps",
632
+ run: async (h) => {
633
+ const before = Date.now()
634
+ await new Promise((resolve) => setTimeout(resolve, 2_100))
635
+ await h.sweep(new Date())
636
+ const health = await h.health()
637
+ assert.equal(health.status, "ok")
638
+ assert.ok(health.lastSweepAt !== null && Date.parse(health.lastSweepAt) >= before - 1_000)
639
+ },
640
+ },
641
+ {
642
+ name: "lists what members can automate: actions, the workflows they may schedule, and event types",
643
+ run: async (h) => {
644
+ const catalog = await h.catalog()
645
+ assert.ok(catalog.actions.some((a) => a.name === "ledger.record" && a.module === "ledger"))
646
+ const workflows = new Set(catalog.workflows.map((w) => w.name))
647
+ assert.ok(workflows.has("ledger.sleeper"))
648
+ // A workflow members may not start is not offered.
649
+ assert.ok(!workflows.has("ledger.doomed"))
650
+ assert.ok(catalog.events.some((e) => e.type === "ledger.recorded" && e.module === "ledger"))
651
+ },
652
+ },
653
+ {
654
+ name: "an event automation runs its action once per event its owner may read and whose condition holds, as its owner",
655
+ run: async (h) => {
656
+ const ref = unique("auto")
657
+ const { id } = await h.create({
658
+ name: ref,
659
+ schedule: {
660
+ kind: "event",
661
+ event: "ledger.recorded",
662
+ condition: { kind: "match", all: [{ field: "kind", op: "in", value: ["auto-src", "secret"] }] },
663
+ },
664
+ target: { kind: "action", action: "ledger.record", input: { kind: "auto", ref: "{{event.ref}}" } },
665
+ })
666
+ // Another member's entry the owner may read, one that fails the condition, and a secret the owner may not read.
667
+ await h.recordAs({ kind: "auto-src", ref: `${ref}-seen` }, "other")
668
+ await h.recordAs({ kind: "other", ref: `${ref}-skipped` }, "other")
669
+ await h.recordAs({ kind: "secret", ref: `${ref}-hidden` }, "other")
670
+ // The automation's own entry is an event too: its condition does not hold for it.
671
+ const runs = await automated(h, id, 4)
672
+ const states = runs.map((r) => `${r.state}: ${r.reason}`).sort((a, b) => a.localeCompare(b))
673
+ assert.deepEqual(states, [
674
+ "noop: Its owner may not read the event's record",
675
+ "noop: The condition does not hold",
676
+ "noop: The condition does not hold",
677
+ "succeeded: null",
678
+ ])
679
+ // The action ran once, as the owner, with the event's field in its input; the secret's ref never reached it.
680
+ assert.deepEqual(
681
+ (await h.entries(`${ref}-seen`)).map((e) => e.ownerId).sort(),
682
+ [h.owner.userId, h.other.userId].sort(),
683
+ )
684
+ assert.equal((await h.entries(`${ref}-hidden`)).length, 1)
685
+ // Sweeping again starts nothing more; a paused automation records nothing for new events.
686
+ await h.sweep(new Date())
687
+ assert.equal((await h.runs(id)).length, 4)
688
+ await h.pause(id)
689
+ await h.recordAs({ kind: "auto-src", ref: `${ref}-paused` }, "other")
690
+ await new Promise((resolve) => setTimeout(resolve, 1_500))
691
+ await h.sweep(new Date())
692
+ assert.equal((await h.runs(id)).length, 4)
693
+ await h.delete(id)
694
+ },
695
+ },
696
+ {
697
+ name: "a natural-language condition asks the organisation's model about that one event, for the automation's owner",
698
+ run: async (h) => {
699
+ const ref = unique("nl")
700
+ const { id } = await h.create({
701
+ name: ref,
702
+ schedule: {
703
+ kind: "event",
704
+ event: "ledger.recorded",
705
+ condition: { kind: "prompt", prompt: `Is this entry (${ref}) urgent?` },
706
+ },
707
+ target: { kind: "action", action: "ledger.record", input: { kind: "handled", ref: "{{event.ref}}" } },
708
+ })
709
+ const before = (await h.modelPrompts()).length
710
+ await h.recordAs({ kind: "note", ref: `${ref}-urgent` }, "other")
711
+ await h.recordAs({ kind: "note", ref: `${ref}-later` }, "other")
712
+ await h.recordAs({ kind: "secret", ref: `${ref}-urgent-secret` }, "other")
713
+ // The urgent note, the later one, the secret, and the automation's own entry (not a note).
714
+ const runs = await automated(h, id, 4)
715
+ assert.deepEqual(runs.map((r) => r.state).sort(), ["noop", "noop", "noop", "succeeded"])
716
+ // History, which the automation's viewers read, keeps the verdict only, never the model's explanation of it.
717
+ assert.deepEqual(
718
+ runs
719
+ .filter((r) => r.state === "noop")
720
+ .map((r) => r.reason ?? "")
721
+ .sort((a, b) => a.localeCompare(b)),
722
+ ["Its owner may not read the event's record", "The condition does not hold", "The condition does not hold"],
723
+ )
724
+ // The urgent note, and the automation's own entry for it.
725
+ assert.equal((await h.entries(`${ref}-urgent`)).length, 2)
726
+ // The model saw each event the owner may read once, never the secret one.
727
+ const asked = (await h.modelPrompts()).slice(before).filter((p) => p.includes(ref))
728
+ assert.equal(asked.length, 3)
729
+ assert.ok(asked.every((p) => !p.includes("secret")))
730
+ await h.delete(id)
731
+ },
732
+ },
733
+ {
734
+ name: "an agent run a schedule starts can end as a no-op with its reason, distinct from work done",
735
+ run: async (h) => {
736
+ const ref = unique("queue")
737
+ const { id } = await h.create({
738
+ name: ref,
739
+ schedule: { kind: "interval", everyMs: minutes(1) },
740
+ target: { kind: "action", action: "agent.send", input: { text: `Check the queue ${ref}` } },
741
+ })
742
+ await h.runNow(id)
743
+ await h.sweep(new Date())
744
+ const [run] = await eventually(
745
+ "the job's agent run to end",
746
+ () => h.agentRuns(ref),
747
+ (runs) =>
748
+ runs.length === 1 &&
749
+ runs[0]!.status !== "queued" &&
750
+ runs[0]!.status !== "running" &&
751
+ runs[0]!.executionState !== null,
752
+ 30_000,
753
+ )
754
+ assert.deepEqual(run, {
755
+ kind: "job",
756
+ status: "succeeded",
757
+ stopReason: "noop",
758
+ result: "The queue is empty",
759
+ executionState: "noop",
760
+ })
761
+ await h.delete(id)
762
+ },
763
+ },
764
+ ]