@eloxiv/contracts 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 (537) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/Agent.d.ts +792 -0
  4. package/dist/Agent.d.ts.map +1 -0
  5. package/dist/Agent.js +610 -0
  6. package/dist/Agent.js.map +1 -0
  7. package/dist/Analytics.d.ts +46 -0
  8. package/dist/Analytics.d.ts.map +1 -0
  9. package/dist/Analytics.js +89 -0
  10. package/dist/Analytics.js.map +1 -0
  11. package/dist/Approval.d.ts +70 -0
  12. package/dist/Approval.d.ts.map +1 -0
  13. package/dist/Approval.js +127 -0
  14. package/dist/Approval.js.map +1 -0
  15. package/dist/Catalog.d.ts +238 -0
  16. package/dist/Catalog.d.ts.map +1 -0
  17. package/dist/Catalog.js +169 -0
  18. package/dist/Catalog.js.map +1 -0
  19. package/dist/Checklist.d.ts +99 -0
  20. package/dist/Checklist.d.ts.map +1 -0
  21. package/dist/Checklist.js +105 -0
  22. package/dist/Checklist.js.map +1 -0
  23. package/dist/Data.d.ts +107 -0
  24. package/dist/Data.d.ts.map +1 -0
  25. package/dist/Data.js +93 -0
  26. package/dist/Data.js.map +1 -0
  27. package/dist/Devices.d.ts +857 -0
  28. package/dist/Devices.d.ts.map +1 -0
  29. package/dist/Devices.js +590 -0
  30. package/dist/Devices.js.map +1 -0
  31. package/dist/Durable.d.ts +406 -0
  32. package/dist/Durable.d.ts.map +1 -0
  33. package/dist/Durable.js +203 -0
  34. package/dist/Durable.js.map +1 -0
  35. package/dist/Errors.d.ts +95 -0
  36. package/dist/Errors.d.ts.map +1 -0
  37. package/dist/Errors.js +72 -0
  38. package/dist/Errors.js.map +1 -0
  39. package/dist/JsonSchema.d.ts +355 -0
  40. package/dist/JsonSchema.d.ts.map +1 -0
  41. package/dist/JsonSchema.js +151 -0
  42. package/dist/JsonSchema.js.map +1 -0
  43. package/dist/Manifest.d.ts +353 -0
  44. package/dist/Manifest.d.ts.map +1 -0
  45. package/dist/Manifest.js +894 -0
  46. package/dist/Manifest.js.map +1 -0
  47. package/dist/Module.d.ts +447 -0
  48. package/dist/Module.d.ts.map +1 -0
  49. package/dist/Module.js +221 -0
  50. package/dist/Module.js.map +1 -0
  51. package/dist/Optimistic.d.ts +192 -0
  52. package/dist/Optimistic.d.ts.map +1 -0
  53. package/dist/Optimistic.js +319 -0
  54. package/dist/Optimistic.js.map +1 -0
  55. package/dist/Projection.d.ts +163 -0
  56. package/dist/Projection.d.ts.map +1 -0
  57. package/dist/Projection.js +158 -0
  58. package/dist/Projection.js.map +1 -0
  59. package/dist/Proposals.d.ts +103 -0
  60. package/dist/Proposals.d.ts.map +1 -0
  61. package/dist/Proposals.js +72 -0
  62. package/dist/Proposals.js.map +1 -0
  63. package/dist/Receipt.d.ts +243 -0
  64. package/dist/Receipt.d.ts.map +1 -0
  65. package/dist/Receipt.js +108 -0
  66. package/dist/Receipt.js.map +1 -0
  67. package/dist/Records.d.ts +297 -0
  68. package/dist/Records.d.ts.map +1 -0
  69. package/dist/Records.js +171 -0
  70. package/dist/Records.js.map +1 -0
  71. package/dist/Render.d.ts +207 -0
  72. package/dist/Render.d.ts.map +1 -0
  73. package/dist/Render.js +502 -0
  74. package/dist/Render.js.map +1 -0
  75. package/dist/Rpc.d.ts +115 -0
  76. package/dist/Rpc.d.ts.map +1 -0
  77. package/dist/Rpc.js +68 -0
  78. package/dist/Rpc.js.map +1 -0
  79. package/dist/SearchLanguages.d.ts +4 -0
  80. package/dist/SearchLanguages.d.ts.map +1 -0
  81. package/dist/SearchLanguages.js +33 -0
  82. package/dist/SearchLanguages.js.map +1 -0
  83. package/dist/Service.d.ts +59 -0
  84. package/dist/Service.d.ts.map +1 -0
  85. package/dist/Service.js +38 -0
  86. package/dist/Service.js.map +1 -0
  87. package/dist/Versions.d.ts +9 -0
  88. package/dist/Versions.d.ts.map +1 -0
  89. package/dist/Versions.js +78 -0
  90. package/dist/Versions.js.map +1 -0
  91. package/dist/contracts/ActionConsent.d.ts +189 -0
  92. package/dist/contracts/ActionConsent.d.ts.map +1 -0
  93. package/dist/contracts/ActionConsent.js +129 -0
  94. package/dist/contracts/ActionConsent.js.map +1 -0
  95. package/dist/contracts/ActionRegistry.d.ts +149 -0
  96. package/dist/contracts/ActionRegistry.d.ts.map +1 -0
  97. package/dist/contracts/ActionRegistry.js +37 -0
  98. package/dist/contracts/ActionRegistry.js.map +1 -0
  99. package/dist/contracts/Actor.d.ts +129 -0
  100. package/dist/contracts/Actor.d.ts.map +1 -0
  101. package/dist/contracts/Actor.js +47 -0
  102. package/dist/contracts/Actor.js.map +1 -0
  103. package/dist/contracts/AgentResources.d.ts +248 -0
  104. package/dist/contracts/AgentResources.d.ts.map +1 -0
  105. package/dist/contracts/AgentResources.js +158 -0
  106. package/dist/contracts/AgentResources.js.map +1 -0
  107. package/dist/contracts/AgentRuntime.d.ts +453 -0
  108. package/dist/contracts/AgentRuntime.d.ts.map +1 -0
  109. package/dist/contracts/AgentRuntime.js +117 -0
  110. package/dist/contracts/AgentRuntime.js.map +1 -0
  111. package/dist/contracts/Approvals.d.ts +303 -0
  112. package/dist/contracts/Approvals.d.ts.map +1 -0
  113. package/dist/contracts/Approvals.js +117 -0
  114. package/dist/contracts/Approvals.js.map +1 -0
  115. package/dist/contracts/Audit.d.ts +510 -0
  116. package/dist/contracts/Audit.d.ts.map +1 -0
  117. package/dist/contracts/Audit.js +139 -0
  118. package/dist/contracts/Audit.js.map +1 -0
  119. package/dist/contracts/CalendarProvider.d.ts +572 -0
  120. package/dist/contracts/CalendarProvider.d.ts.map +1 -0
  121. package/dist/contracts/CalendarProvider.js +203 -0
  122. package/dist/contracts/CalendarProvider.js.map +1 -0
  123. package/dist/contracts/Capability.d.ts +197 -0
  124. package/dist/contracts/Capability.d.ts.map +1 -0
  125. package/dist/contracts/Capability.js +189 -0
  126. package/dist/contracts/Capability.js.map +1 -0
  127. package/dist/contracts/ClientSDK.d.ts +250 -0
  128. package/dist/contracts/ClientSDK.d.ts.map +1 -0
  129. package/dist/contracts/ClientSDK.js +184 -0
  130. package/dist/contracts/ClientSDK.js.map +1 -0
  131. package/dist/contracts/CollabDocument.d.ts +781 -0
  132. package/dist/contracts/CollabDocument.d.ts.map +1 -0
  133. package/dist/contracts/CollabDocument.js +364 -0
  134. package/dist/contracts/CollabDocument.js.map +1 -0
  135. package/dist/contracts/Command.d.ts +183 -0
  136. package/dist/contracts/Command.d.ts.map +1 -0
  137. package/dist/contracts/Command.js +66 -0
  138. package/dist/contracts/Command.js.map +1 -0
  139. package/dist/contracts/Connections.d.ts +612 -0
  140. package/dist/contracts/Connections.d.ts.map +1 -0
  141. package/dist/contracts/Connections.js +323 -0
  142. package/dist/contracts/Connections.js.map +1 -0
  143. package/dist/contracts/ContextAccounting.d.ts +79 -0
  144. package/dist/contracts/ContextAccounting.d.ts.map +1 -0
  145. package/dist/contracts/ContextAccounting.js +32 -0
  146. package/dist/contracts/ContextAccounting.js.map +1 -0
  147. package/dist/contracts/Daemon.d.ts +486 -0
  148. package/dist/contracts/Daemon.d.ts.map +1 -0
  149. package/dist/contracts/Daemon.js +192 -0
  150. package/dist/contracts/Daemon.js.map +1 -0
  151. package/dist/contracts/DbTx.d.ts +149 -0
  152. package/dist/contracts/DbTx.d.ts.map +1 -0
  153. package/dist/contracts/DbTx.js +94 -0
  154. package/dist/contracts/DbTx.js.map +1 -0
  155. package/dist/contracts/Delegation.d.ts +121 -0
  156. package/dist/contracts/Delegation.d.ts.map +1 -0
  157. package/dist/contracts/Delegation.js +76 -0
  158. package/dist/contracts/Delegation.js.map +1 -0
  159. package/dist/contracts/DeviceControl.d.ts +293 -0
  160. package/dist/contracts/DeviceControl.d.ts.map +1 -0
  161. package/dist/contracts/DeviceControl.js +107 -0
  162. package/dist/contracts/DeviceControl.js.map +1 -0
  163. package/dist/contracts/Directory.d.ts +492 -0
  164. package/dist/contracts/Directory.d.ts.map +1 -0
  165. package/dist/contracts/Directory.js +225 -0
  166. package/dist/contracts/Directory.js.map +1 -0
  167. package/dist/contracts/DirectoryProvider.d.ts +214 -0
  168. package/dist/contracts/DirectoryProvider.d.ts.map +1 -0
  169. package/dist/contracts/DirectoryProvider.js +73 -0
  170. package/dist/contracts/DirectoryProvider.js.map +1 -0
  171. package/dist/contracts/DocumentSource.d.ts +190 -0
  172. package/dist/contracts/DocumentSource.d.ts.map +1 -0
  173. package/dist/contracts/DocumentSource.js +64 -0
  174. package/dist/contracts/DocumentSource.js.map +1 -0
  175. package/dist/contracts/Files.d.ts +762 -0
  176. package/dist/contracts/Files.d.ts.map +1 -0
  177. package/dist/contracts/Files.js +339 -0
  178. package/dist/contracts/Files.js.map +1 -0
  179. package/dist/contracts/Flags.d.ts +265 -0
  180. package/dist/contracts/Flags.d.ts.map +1 -0
  181. package/dist/contracts/Flags.js +197 -0
  182. package/dist/contracts/Flags.js.map +1 -0
  183. package/dist/contracts/Host.d.ts +320 -0
  184. package/dist/contracts/Host.d.ts.map +1 -0
  185. package/dist/contracts/Host.js +224 -0
  186. package/dist/contracts/Host.js.map +1 -0
  187. package/dist/contracts/HttpApi.d.ts +102 -0
  188. package/dist/contracts/HttpApi.d.ts.map +1 -0
  189. package/dist/contracts/HttpApi.js +89 -0
  190. package/dist/contracts/HttpApi.js.map +1 -0
  191. package/dist/contracts/Ingestion.d.ts +522 -0
  192. package/dist/contracts/Ingestion.d.ts.map +1 -0
  193. package/dist/contracts/Ingestion.js +275 -0
  194. package/dist/contracts/Ingestion.js.map +1 -0
  195. package/dist/contracts/Ingress.d.ts +132 -0
  196. package/dist/contracts/Ingress.d.ts.map +1 -0
  197. package/dist/contracts/Ingress.js +102 -0
  198. package/dist/contracts/Ingress.js.map +1 -0
  199. package/dist/contracts/Invocation.d.ts +361 -0
  200. package/dist/contracts/Invocation.d.ts.map +1 -0
  201. package/dist/contracts/Invocation.js +104 -0
  202. package/dist/contracts/Invocation.js.map +1 -0
  203. package/dist/contracts/LocalClient.d.ts +878 -0
  204. package/dist/contracts/LocalClient.d.ts.map +1 -0
  205. package/dist/contracts/LocalClient.js +423 -0
  206. package/dist/contracts/LocalClient.js.map +1 -0
  207. package/dist/contracts/Locale.d.ts +162 -0
  208. package/dist/contracts/Locale.d.ts.map +1 -0
  209. package/dist/contracts/Locale.js +123 -0
  210. package/dist/contracts/Locale.js.map +1 -0
  211. package/dist/contracts/MachineIdentity.d.ts +434 -0
  212. package/dist/contracts/MachineIdentity.d.ts.map +1 -0
  213. package/dist/contracts/MachineIdentity.js +223 -0
  214. package/dist/contracts/MachineIdentity.js.map +1 -0
  215. package/dist/contracts/MailProvider.d.ts +791 -0
  216. package/dist/contracts/MailProvider.d.ts.map +1 -0
  217. package/dist/contracts/MailProvider.js +237 -0
  218. package/dist/contracts/MailProvider.js.map +1 -0
  219. package/dist/contracts/Memory.d.ts +62 -0
  220. package/dist/contracts/Memory.d.ts.map +1 -0
  221. package/dist/contracts/Memory.js +43 -0
  222. package/dist/contracts/Memory.js.map +1 -0
  223. package/dist/contracts/Messaging.d.ts +154 -0
  224. package/dist/contracts/Messaging.d.ts.map +1 -0
  225. package/dist/contracts/Messaging.js +97 -0
  226. package/dist/contracts/Messaging.js.map +1 -0
  227. package/dist/contracts/Metering.d.ts +334 -0
  228. package/dist/contracts/Metering.d.ts.map +1 -0
  229. package/dist/contracts/Metering.js +202 -0
  230. package/dist/contracts/Metering.js.map +1 -0
  231. package/dist/contracts/ModelProvider.d.ts +142 -0
  232. package/dist/contracts/ModelProvider.d.ts.map +1 -0
  233. package/dist/contracts/ModelProvider.js +72 -0
  234. package/dist/contracts/ModelProvider.js.map +1 -0
  235. package/dist/contracts/ModuleManifest.d.ts +2519 -0
  236. package/dist/contracts/ModuleManifest.d.ts.map +1 -0
  237. package/dist/contracts/ModuleManifest.js +272 -0
  238. package/dist/contracts/ModuleManifest.js.map +1 -0
  239. package/dist/contracts/NotificationChannel.d.ts +378 -0
  240. package/dist/contracts/NotificationChannel.d.ts.map +1 -0
  241. package/dist/contracts/NotificationChannel.js +136 -0
  242. package/dist/contracts/NotificationChannel.js.map +1 -0
  243. package/dist/contracts/Notifications.d.ts +417 -0
  244. package/dist/contracts/Notifications.d.ts.map +1 -0
  245. package/dist/contracts/Notifications.js +267 -0
  246. package/dist/contracts/Notifications.js.map +1 -0
  247. package/dist/contracts/Outbox.d.ts +469 -0
  248. package/dist/contracts/Outbox.d.ts.map +1 -0
  249. package/dist/contracts/Outbox.js +215 -0
  250. package/dist/contracts/Outbox.js.map +1 -0
  251. package/dist/contracts/Privacy.d.ts +1029 -0
  252. package/dist/contracts/Privacy.d.ts.map +1 -0
  253. package/dist/contracts/Privacy.js +437 -0
  254. package/dist/contracts/Privacy.js.map +1 -0
  255. package/dist/contracts/Progress.d.ts +305 -0
  256. package/dist/contracts/Progress.d.ts.map +1 -0
  257. package/dist/contracts/Progress.js +174 -0
  258. package/dist/contracts/Progress.js.map +1 -0
  259. package/dist/contracts/QuerySurface.d.ts +231 -0
  260. package/dist/contracts/QuerySurface.d.ts.map +1 -0
  261. package/dist/contracts/QuerySurface.js +113 -0
  262. package/dist/contracts/QuerySurface.js.map +1 -0
  263. package/dist/contracts/Readiness.d.ts +105 -0
  264. package/dist/contracts/Readiness.d.ts.map +1 -0
  265. package/dist/contracts/Readiness.js +57 -0
  266. package/dist/contracts/Readiness.js.map +1 -0
  267. package/dist/contracts/Release.d.ts +295 -0
  268. package/dist/contracts/Release.d.ts.map +1 -0
  269. package/dist/contracts/Release.js +175 -0
  270. package/dist/contracts/Release.js.map +1 -0
  271. package/dist/contracts/ResultRendering.d.ts +533 -0
  272. package/dist/contracts/ResultRendering.d.ts.map +1 -0
  273. package/dist/contracts/ResultRendering.js +59 -0
  274. package/dist/contracts/ResultRendering.js.map +1 -0
  275. package/dist/contracts/Sandbox.d.ts +1164 -0
  276. package/dist/contracts/Sandbox.d.ts.map +1 -0
  277. package/dist/contracts/Sandbox.js +550 -0
  278. package/dist/contracts/Sandbox.js.map +1 -0
  279. package/dist/contracts/Scheduler.d.ts +814 -0
  280. package/dist/contracts/Scheduler.d.ts.map +1 -0
  281. package/dist/contracts/Scheduler.js +202 -0
  282. package/dist/contracts/Scheduler.js.map +1 -0
  283. package/dist/contracts/ScreenContext.d.ts +514 -0
  284. package/dist/contracts/ScreenContext.d.ts.map +1 -0
  285. package/dist/contracts/ScreenContext.js +272 -0
  286. package/dist/contracts/ScreenContext.js.map +1 -0
  287. package/dist/contracts/Search.d.ts +308 -0
  288. package/dist/contracts/Search.d.ts.map +1 -0
  289. package/dist/contracts/Search.js +107 -0
  290. package/dist/contracts/Search.js.map +1 -0
  291. package/dist/contracts/Secrets.d.ts +483 -0
  292. package/dist/contracts/Secrets.d.ts.map +1 -0
  293. package/dist/contracts/Secrets.js +136 -0
  294. package/dist/contracts/Secrets.js.map +1 -0
  295. package/dist/contracts/Settings.d.ts +221 -0
  296. package/dist/contracts/Settings.d.ts.map +1 -0
  297. package/dist/contracts/Settings.js +163 -0
  298. package/dist/contracts/Settings.js.map +1 -0
  299. package/dist/contracts/Sharing.d.ts +319 -0
  300. package/dist/contracts/Sharing.d.ts.map +1 -0
  301. package/dist/contracts/Sharing.js +172 -0
  302. package/dist/contracts/Sharing.js.map +1 -0
  303. package/dist/contracts/Slot.d.ts +162 -0
  304. package/dist/contracts/Slot.d.ts.map +1 -0
  305. package/dist/contracts/Slot.js +56 -0
  306. package/dist/contracts/Slot.js.map +1 -0
  307. package/dist/contracts/Space.d.ts +256 -0
  308. package/dist/contracts/Space.d.ts.map +1 -0
  309. package/dist/contracts/Space.js +133 -0
  310. package/dist/contracts/Space.js.map +1 -0
  311. package/dist/contracts/StorageAdapter.d.ts +124 -0
  312. package/dist/contracts/StorageAdapter.d.ts.map +1 -0
  313. package/dist/contracts/StorageAdapter.js +96 -0
  314. package/dist/contracts/StorageAdapter.js.map +1 -0
  315. package/dist/contracts/StorageBackend.d.ts +310 -0
  316. package/dist/contracts/StorageBackend.d.ts.map +1 -0
  317. package/dist/contracts/StorageBackend.js +196 -0
  318. package/dist/contracts/StorageBackend.js.map +1 -0
  319. package/dist/contracts/Sync.d.ts +286 -0
  320. package/dist/contracts/Sync.d.ts.map +1 -0
  321. package/dist/contracts/Sync.js +157 -0
  322. package/dist/contracts/Sync.js.map +1 -0
  323. package/dist/contracts/Telemetry.d.ts +183 -0
  324. package/dist/contracts/Telemetry.d.ts.map +1 -0
  325. package/dist/contracts/Telemetry.js +153 -0
  326. package/dist/contracts/Telemetry.js.map +1 -0
  327. package/dist/contracts/ThemeTokens.d.ts +212 -0
  328. package/dist/contracts/ThemeTokens.d.ts.map +1 -0
  329. package/dist/contracts/ThemeTokens.js +111 -0
  330. package/dist/contracts/ThemeTokens.js.map +1 -0
  331. package/dist/contracts/ToolSource.d.ts +135 -0
  332. package/dist/contracts/ToolSource.d.ts.map +1 -0
  333. package/dist/contracts/ToolSource.js +81 -0
  334. package/dist/contracts/ToolSource.js.map +1 -0
  335. package/dist/contracts/Versioning.d.ts +363 -0
  336. package/dist/contracts/Versioning.d.ts.map +1 -0
  337. package/dist/contracts/Versioning.js +201 -0
  338. package/dist/contracts/Versioning.js.map +1 -0
  339. package/dist/contracts/View.d.ts +232 -0
  340. package/dist/contracts/View.d.ts.map +1 -0
  341. package/dist/contracts/View.js +102 -0
  342. package/dist/contracts/View.js.map +1 -0
  343. package/dist/contracts/WorkItems.d.ts +242 -0
  344. package/dist/contracts/WorkItems.d.ts.map +1 -0
  345. package/dist/contracts/WorkItems.js +126 -0
  346. package/dist/contracts/WorkItems.js.map +1 -0
  347. package/dist/contracts/Workflow.d.ts +191 -0
  348. package/dist/contracts/Workflow.d.ts.map +1 -0
  349. package/dist/contracts/Workflow.js +63 -0
  350. package/dist/contracts/Workflow.js.map +1 -0
  351. package/dist/contracts/index.d.ts +75 -0
  352. package/dist/contracts/index.d.ts.map +1 -0
  353. package/dist/contracts/index.js +196 -0
  354. package/dist/contracts/index.js.map +1 -0
  355. package/dist/devices/module.d.ts +3777 -0
  356. package/dist/devices/module.d.ts.map +1 -0
  357. package/dist/devices/module.js +179 -0
  358. package/dist/devices/module.js.map +1 -0
  359. package/dist/drizzle/Entity.d.ts +148 -0
  360. package/dist/drizzle/Entity.d.ts.map +1 -0
  361. package/dist/drizzle/Entity.js +396 -0
  362. package/dist/drizzle/Entity.js.map +1 -0
  363. package/dist/index.d.ts +20 -0
  364. package/dist/index.d.ts.map +1 -0
  365. package/dist/index.js +20 -0
  366. package/dist/index.js.map +1 -0
  367. package/package.json +48 -3
  368. package/schema/Actor.json +46 -0
  369. package/schema/AuditRecord.json +403 -0
  370. package/schema/DaemonHealth.json +29 -0
  371. package/schema/InvocationError.json +257 -0
  372. package/schema/InvocationReceipt.json +253 -0
  373. package/schema/Lockfile.json +129 -0
  374. package/schema/OutboxEvent.json +36 -0
  375. package/schema/PairingConfirm.json +33 -0
  376. package/schema/PairingResult.json +18 -0
  377. package/schema/PairingStart.json +18 -0
  378. package/schema/ProvenanceEntry.json +110 -0
  379. package/schema/ReplayEnvelope.json +269 -0
  380. package/schema/Surface.json +17 -0
  381. package/schema/codegen/LocalClient.json +1295 -0
  382. package/schema/codegen/Sandbox.json +320 -0
  383. package/schema/contracts/ActionConsent.json +1930 -0
  384. package/schema/contracts/ActionRegistry.json +722 -0
  385. package/schema/contracts/Actor.json +451 -0
  386. package/schema/contracts/AgentResources.json +1400 -0
  387. package/schema/contracts/AgentRuntime.json +4017 -0
  388. package/schema/contracts/Approvals.json +2916 -0
  389. package/schema/contracts/Audit.json +3268 -0
  390. package/schema/contracts/CalendarProvider.json +5557 -0
  391. package/schema/contracts/ClientSDK.json +1400 -0
  392. package/schema/contracts/CollabDocument.json +4012 -0
  393. package/schema/contracts/Command.json +616 -0
  394. package/schema/contracts/Connections.json +6687 -0
  395. package/schema/contracts/ContextAccounting.json +685 -0
  396. package/schema/contracts/Daemon.json +4555 -0
  397. package/schema/contracts/DbTx.json +321 -0
  398. package/schema/contracts/Delegation.json +949 -0
  399. package/schema/contracts/DeviceControl.json +2626 -0
  400. package/schema/contracts/Directory.json +5168 -0
  401. package/schema/contracts/DirectoryProvider.json +2090 -0
  402. package/schema/contracts/DocumentSource.json +2044 -0
  403. package/schema/contracts/Files.json +4122 -0
  404. package/schema/contracts/Flags.json +1202 -0
  405. package/schema/contracts/Host.json +1769 -0
  406. package/schema/contracts/HttpApi.json +1615 -0
  407. package/schema/contracts/Ingestion.json +3211 -0
  408. package/schema/contracts/Ingress.json +819 -0
  409. package/schema/contracts/Invocation.json +2044 -0
  410. package/schema/contracts/LocalClient.json +6642 -0
  411. package/schema/contracts/Locale.json +654 -0
  412. package/schema/contracts/MachineIdentity.json +2303 -0
  413. package/schema/contracts/MailProvider.json +6663 -0
  414. package/schema/contracts/Memory.json +579 -0
  415. package/schema/contracts/Messaging.json +1764 -0
  416. package/schema/contracts/Metering.json +3060 -0
  417. package/schema/contracts/ModelProvider.json +1127 -0
  418. package/schema/contracts/ModuleManifest.json +9449 -0
  419. package/schema/contracts/NotificationChannel.json +986 -0
  420. package/schema/contracts/Notifications.json +4280 -0
  421. package/schema/contracts/Outbox.json +1451 -0
  422. package/schema/contracts/Privacy.json +4354 -0
  423. package/schema/contracts/Progress.json +1524 -0
  424. package/schema/contracts/QuerySurface.json +661 -0
  425. package/schema/contracts/Readiness.json +209 -0
  426. package/schema/contracts/Release.json +805 -0
  427. package/schema/contracts/ResultRendering.json +2859 -0
  428. package/schema/contracts/Sandbox.json +2286 -0
  429. package/schema/contracts/Scheduler.json +6138 -0
  430. package/schema/contracts/ScreenContext.json +1238 -0
  431. package/schema/contracts/Search.json +1058 -0
  432. package/schema/contracts/Secrets.json +2444 -0
  433. package/schema/contracts/Settings.json +654 -0
  434. package/schema/contracts/Sharing.json +2854 -0
  435. package/schema/contracts/Slot.json +537 -0
  436. package/schema/contracts/Space.json +892 -0
  437. package/schema/contracts/StorageAdapter.json +623 -0
  438. package/schema/contracts/StorageBackend.json +2421 -0
  439. package/schema/contracts/Sync.json +894 -0
  440. package/schema/contracts/Telemetry.json +696 -0
  441. package/schema/contracts/ThemeTokens.json +547 -0
  442. package/schema/contracts/ToolSource.json +1333 -0
  443. package/schema/contracts/Versioning.json +1481 -0
  444. package/schema/contracts/View.json +750 -0
  445. package/schema/contracts/WorkItems.json +1731 -0
  446. package/schema/contracts/Workflow.json +1242 -0
  447. package/src/Agent.ts +758 -0
  448. package/src/Analytics.ts +110 -0
  449. package/src/Approval.ts +131 -0
  450. package/src/Catalog.ts +192 -0
  451. package/src/Checklist.ts +162 -0
  452. package/src/Data.ts +109 -0
  453. package/src/Devices.ts +721 -0
  454. package/src/Durable.ts +240 -0
  455. package/src/Errors.ts +111 -0
  456. package/src/JsonSchema.ts +166 -0
  457. package/src/Manifest.ts +1147 -0
  458. package/src/Module.ts +640 -0
  459. package/src/Optimistic.ts +332 -0
  460. package/src/Projection.ts +207 -0
  461. package/src/Proposals.ts +89 -0
  462. package/src/Receipt.ts +125 -0
  463. package/src/Records.ts +197 -0
  464. package/src/Render.ts +515 -0
  465. package/src/Rpc.ts +113 -0
  466. package/src/SearchLanguages.ts +33 -0
  467. package/src/Service.ts +102 -0
  468. package/src/Versions.ts +69 -0
  469. package/src/contracts/ActionConsent.ts +150 -0
  470. package/src/contracts/ActionRegistry.ts +39 -0
  471. package/src/contracts/Actor.ts +53 -0
  472. package/src/contracts/AgentResources.ts +167 -0
  473. package/src/contracts/AgentRuntime.ts +154 -0
  474. package/src/contracts/Approvals.ts +133 -0
  475. package/src/contracts/Audit.ts +160 -0
  476. package/src/contracts/CalendarProvider.ts +241 -0
  477. package/src/contracts/Capability.ts +246 -0
  478. package/src/contracts/ClientSDK.ts +199 -0
  479. package/src/contracts/CollabDocument.ts +420 -0
  480. package/src/contracts/Command.ts +74 -0
  481. package/src/contracts/Connections.ts +360 -0
  482. package/src/contracts/ContextAccounting.ts +35 -0
  483. package/src/contracts/Daemon.ts +247 -0
  484. package/src/contracts/DbTx.ts +110 -0
  485. package/src/contracts/Delegation.ts +91 -0
  486. package/src/contracts/DeviceControl.ts +143 -0
  487. package/src/contracts/Directory.ts +384 -0
  488. package/src/contracts/DirectoryProvider.ts +82 -0
  489. package/src/contracts/DocumentSource.ts +71 -0
  490. package/src/contracts/Files.ts +395 -0
  491. package/src/contracts/Flags.ts +241 -0
  492. package/src/contracts/Host.ts +245 -0
  493. package/src/contracts/HttpApi.ts +100 -0
  494. package/src/contracts/Ingestion.ts +315 -0
  495. package/src/contracts/Ingress.ts +132 -0
  496. package/src/contracts/Invocation.ts +122 -0
  497. package/src/contracts/LocalClient.ts +614 -0
  498. package/src/contracts/Locale.ts +133 -0
  499. package/src/contracts/MachineIdentity.ts +305 -0
  500. package/src/contracts/MailProvider.ts +272 -0
  501. package/src/contracts/Memory.ts +47 -0
  502. package/src/contracts/Messaging.ts +108 -0
  503. package/src/contracts/Metering.ts +231 -0
  504. package/src/contracts/ModelProvider.ts +87 -0
  505. package/src/contracts/ModuleManifest.ts +310 -0
  506. package/src/contracts/NotificationChannel.ts +158 -0
  507. package/src/contracts/Notifications.ts +309 -0
  508. package/src/contracts/Outbox.ts +246 -0
  509. package/src/contracts/Privacy.ts +502 -0
  510. package/src/contracts/Progress.ts +196 -0
  511. package/src/contracts/QuerySurface.ts +134 -0
  512. package/src/contracts/Readiness.ts +67 -0
  513. package/src/contracts/Release.ts +199 -0
  514. package/src/contracts/ResultRendering.ts +65 -0
  515. package/src/contracts/Sandbox.ts +648 -0
  516. package/src/contracts/Scheduler.ts +237 -0
  517. package/src/contracts/ScreenContext.ts +316 -0
  518. package/src/contracts/Search.ts +126 -0
  519. package/src/contracts/Secrets.ts +162 -0
  520. package/src/contracts/Settings.ts +207 -0
  521. package/src/contracts/Sharing.ts +205 -0
  522. package/src/contracts/Slot.ts +61 -0
  523. package/src/contracts/Space.ts +157 -0
  524. package/src/contracts/StorageAdapter.ts +104 -0
  525. package/src/contracts/StorageBackend.ts +220 -0
  526. package/src/contracts/Sync.ts +180 -0
  527. package/src/contracts/Telemetry.ts +177 -0
  528. package/src/contracts/ThemeTokens.ts +136 -0
  529. package/src/contracts/ToolSource.ts +94 -0
  530. package/src/contracts/Versioning.ts +237 -0
  531. package/src/contracts/View.ts +116 -0
  532. package/src/contracts/WorkItems.ts +144 -0
  533. package/src/contracts/Workflow.ts +67 -0
  534. package/src/contracts/index.ts +205 -0
  535. package/src/devices/module.ts +201 -0
  536. package/src/drizzle/Entity.ts +524 -0
  537. package/src/index.ts +19 -0
@@ -0,0 +1,158 @@
1
+ /**
2
+ * The action registry's projection: one action definition becomes the schema
3
+ * every surface publishes (decisions.md "One action registry is the source of
4
+ * truth"). Surfaces take the action's input as raw JSON documented with this
5
+ * input schema (the invocation path decodes it), and return the result
6
+ * envelope `{ kind: "output", output } | { kind: "replay", receipt }`.
7
+ */
8
+ import { Schema } from "effect";
9
+ import { InvocationError } from "./Errors.js";
10
+ import { toJsonSchema } from "./JsonSchema.js";
11
+ import { toolName } from "./Module.js";
12
+ import { actionResult } from "./Receipt.js";
13
+ /** Where the HTTP surface serves each action: `POST <prefix>/<action>`. */
14
+ export const HTTP_ACTIONS_PREFIX = "/api/actions";
15
+ /**
16
+ * The read batch (`POST /api/batch`): up to `READ_BATCH_MAX_ITEMS` read-only actions in one request, each run
17
+ * through the invocation path on its own (its own identity, policy, audit and failure), answered in order. It is a
18
+ * transport, not an action: it is no tool and appears in no catalogue.
19
+ */
20
+ export const READ_BATCH_PATH = "/api/batch";
21
+ export const READ_BATCH_MAX_ITEMS = 25;
22
+ export const ReadBatchRequest = Schema.Struct({
23
+ items: Schema.Array(Schema.Struct({ action: Schema.String, input: Schema.Unknown })),
24
+ });
25
+ /**
26
+ * WebMCP (browser agents, `navigator.modelContext`): a person's own session asks for a short-lived agent session for
27
+ * the browser agent (`session`), every call of which is the agent's on the kernel (consent, agent tool groups and
28
+ * person-only actions apply); the agent session lists the tools it reaches (`tools`, the compatibility manifest),
29
+ * each called on its HTTP route; `revoke` ends it.
30
+ */
31
+ export const WEBMCP_PATHS = {
32
+ session: "/api/webmcp/session",
33
+ revoke: "/api/webmcp/session/revoke",
34
+ tools: "/api/webmcp/tools",
35
+ };
36
+ /**
37
+ * The kernel's MCP server identity (`GET /.well-known/mcp.json`, public): its canonical name (what MCP hosts, the
38
+ * CLI and a settings page list it as), its endpoint and OAuth resource, and where to discover how to sign in. Every
39
+ * client that connects an MCP host reads the name from here rather than making one up.
40
+ */
41
+ export const MCP_IDENTITY_PATH = "/.well-known/mcp.json";
42
+ /** An app's MCP server name: its name with anything but letters, digits and `._-` as `-`. */
43
+ export const mcpServerName = (appName) => appName.replace(/[^A-Za-z0-9._-]/g, "-");
44
+ /** The HTTP status each invocation error is answered with, on its own or as a batch item. */
45
+ export const INVOCATION_ERROR_STATUS = {
46
+ Unauthenticated: 401,
47
+ Forbidden: 403,
48
+ ApprovalRequired: 409,
49
+ ConsentRequired: 409,
50
+ IdempotencyConflict: 422,
51
+ InvalidInput: 400,
52
+ UnknownAction: 404,
53
+ ActionFailed: 500,
54
+ ClientOutdated: 426,
55
+ };
56
+ /** A JSON Schema document (draft 2020-12). */
57
+ export const JsonSchemaObject = Schema.Record(Schema.String, Schema.Unknown);
58
+ /** One registered action, as the registry lists it. */
59
+ export const ActionDescriptor = Schema.Struct({
60
+ name: Schema.String,
61
+ module: Schema.String,
62
+ /** What people see the action called (`ActionContract.title`). */
63
+ title: Schema.String,
64
+ description: Schema.String,
65
+ /** The action's id in its module's Cedar namespace (`<Namespace>::Action::"<id>"`). */
66
+ cedarAction: Schema.String,
67
+ /** The name MCP and agent tools use (`hello.greet` -> `hello_greet`). */
68
+ toolName: Schema.String,
69
+ writes: Schema.NullOr(Schema.String),
70
+ target: Schema.NullOr(Schema.Struct({ entity: Schema.String, field: Schema.String })),
71
+ bestEffort: Schema.Boolean,
72
+ hints: Schema.Struct({ readOnly: Schema.Boolean, destructive: Schema.Boolean, idempotent: Schema.Boolean }),
73
+ /** An agent acting for a person needs the person's consent for each call (ActionConsent). */
74
+ consent: Schema.Boolean,
75
+ /** Which surfaces offer the action: the app's agent, MCP, the API (typed client, HTTP, CLI, sync). */
76
+ exposure: Schema.Struct({ agent: Schema.Boolean, mcp: Schema.Boolean, api: Schema.Boolean }),
77
+ input: JsonSchemaObject,
78
+ output: JsonSchemaObject,
79
+ /** What every surface returns: the output envelope or a replay receipt. */
80
+ result: JsonSchemaObject,
81
+ });
82
+ /**
83
+ * What each surface publishes for one action. Every input schema is the action's input (MCP's wrapped in an
84
+ * object root when it has none, see `mcpToolInput`); every result the envelope.
85
+ */
86
+ export const SurfaceProjection = Schema.Struct({
87
+ rpc: Schema.Struct({
88
+ tag: Schema.String,
89
+ payload: JsonSchemaObject,
90
+ success: JsonSchemaObject,
91
+ error: JsonSchemaObject,
92
+ }),
93
+ http: Schema.Struct({
94
+ method: Schema.Literal("POST"),
95
+ path: Schema.String,
96
+ requestBody: JsonSchemaObject,
97
+ response: JsonSchemaObject,
98
+ }),
99
+ mcp: Schema.Struct({
100
+ name: Schema.String,
101
+ description: Schema.String,
102
+ inputSchema: JsonSchemaObject,
103
+ outputSchema: JsonSchemaObject,
104
+ }),
105
+ agent: Schema.Struct({ name: Schema.String, description: Schema.String, inputSchema: JsonSchemaObject }),
106
+ });
107
+ export const describeAction = (action, module) => ({
108
+ name: action.name,
109
+ module,
110
+ title: action.title,
111
+ description: action.description,
112
+ cedarAction: action.cedarAction,
113
+ toolName: toolName(action.name),
114
+ writes: action.writes ?? null,
115
+ target: action.target === undefined ? null : { entity: action.target.entity, field: action.target.field },
116
+ bestEffort: action.bestEffort,
117
+ hints: { ...action.hints },
118
+ consent: action.consent,
119
+ exposure: { ...action.exposure },
120
+ input: toJsonSchema(action.input),
121
+ output: toJsonSchema(action.output),
122
+ result: toJsonSchema(actionResult(action)),
123
+ });
124
+ /**
125
+ * An action's input schema as MCP tool parameters. MCP requires an object-rooted JSON Schema (tool arguments
126
+ * are always an object); an input whose schema is not (`Schema.Struct({})` emits `{ not: { type: "null" } }`)
127
+ * is wrapped as `{ type: "object", allOf: [schema] }`, so its constraints are still documented. Object-rooted
128
+ * inputs are returned unchanged.
129
+ */
130
+ export const mcpToolInput = (input) => {
131
+ if (input["type"] === "object")
132
+ return input;
133
+ const { $schema: dialect, $defs: definitions, ...schema } = input;
134
+ return {
135
+ ...(dialect === undefined ? {} : { $schema: dialect }),
136
+ type: "object",
137
+ allOf: [schema],
138
+ ...(definitions === undefined ? {} : { $defs: definitions }),
139
+ };
140
+ };
141
+ /** The schema each surface publishes for `action`, derived only from its definition. */
142
+ export const projectAction = (action) => {
143
+ const input = toJsonSchema(action.input);
144
+ const result = toJsonSchema(actionResult(action));
145
+ return {
146
+ rpc: { tag: action.name, payload: input, success: result, error: toJsonSchema(InvocationError) },
147
+ http: { method: "POST", path: `${HTTP_ACTIONS_PREFIX}/${action.name}`, requestBody: input, response: result },
148
+ mcp: {
149
+ name: toolName(action.name),
150
+ description: action.description,
151
+ inputSchema: mcpToolInput(input),
152
+ outputSchema: result,
153
+ },
154
+ // Object-rooted as MCP's: model providers refuse a function whose parameters are not an object.
155
+ agent: { name: toolName(action.name), description: action.description, inputSchema: mcpToolInput(input) },
156
+ };
157
+ };
158
+ //# sourceMappingURL=Projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Projection.js","sourceRoot":"","sources":["../src/Projection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAkB,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAA;AAEjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAA;AAC3C,MAAM,CAAC,MAAM,o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AAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE;QAC7G,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC;YAChC,YAAY,EAAE,MAAM;SACrB;QACD,gGAAgG;QAChG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE;KAC1G,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Proposals (the Approvals contract, "Proposals"; ledger A-110): grouped edits someone (a person, or their agent)
3
+ * proposes for others to review. Each item is a proposed call of one action with its input (the edit), decided on
4
+ * its own (accepted or rejected); a decision is made on an exact observed set of items at once, all or none; an
5
+ * accepted item is applied by its decider making the proposed call through the invocation path (as themselves, so
6
+ * the policy decides whether they may), under the item's key, and recorded applied only once the kernel finds that
7
+ * call's committed receipt. The review screens that present proposals are deferred (decision 12).
8
+ */
9
+ import { Schema } from "effect";
10
+ export declare const PROPOSALS_ACTIONS: {
11
+ readonly create: "proposals.create";
12
+ readonly revise: "proposals.revise";
13
+ readonly withdraw: "proposals.withdraw";
14
+ readonly get: "proposals.get";
15
+ readonly decide: "proposals.decide";
16
+ readonly applied: "proposals.applied";
17
+ };
18
+ export declare const ProposalItemStatus: Schema.Literals<readonly ["pending", "accepted", "rejected", "applied", "withdrawn"]>;
19
+ export type ProposalItemStatus = typeof ProposalItemStatus.Type;
20
+ export declare const ProposalItemInput: Schema.Struct<{
21
+ readonly summary: Schema.String;
22
+ /** The action the edit is a call of (`notes.rename`). */
23
+ readonly action: Schema.String;
24
+ /** Its input, as the action takes it (JSON). */
25
+ readonly input: Schema.Unknown;
26
+ }>;
27
+ export type ProposalItemInput = typeof ProposalItemInput.Type;
28
+ export declare const ProposalCreate: Schema.Struct<{
29
+ readonly summary: Schema.String;
30
+ readonly items: Schema.$Array<Schema.Struct<{
31
+ readonly summary: Schema.String;
32
+ /** The action the edit is a call of (`notes.rename`). */
33
+ readonly action: Schema.String;
34
+ /** Its input, as the action takes it (JSON). */
35
+ readonly input: Schema.Unknown;
36
+ }>>;
37
+ /** The same key from the same person in the same organisation gives back the proposal it first made. */
38
+ readonly creationKey: Schema.optionalKey<Schema.String>;
39
+ }>;
40
+ export declare const ProposalItem: Schema.Struct<{
41
+ readonly id: Schema.String;
42
+ readonly ordinal: Schema.Number;
43
+ readonly summary: Schema.String;
44
+ readonly action: Schema.String;
45
+ readonly input: Schema.Unknown;
46
+ /** Raised by every revision: a decision names the revision it saw. */
47
+ readonly revision: Schema.Number;
48
+ readonly status: Schema.Literals<readonly ["pending", "accepted", "rejected", "applied", "withdrawn"]>;
49
+ readonly decidedBy: Schema.NullOr<Schema.String>;
50
+ /** The invocation that applied it (`applied` only). */
51
+ readonly appliedInvocation: Schema.NullOr<Schema.String>;
52
+ /** The idempotency key its decider applies it under (`proposal-item:<id>:<revision>`). */
53
+ readonly applyKey: Schema.String;
54
+ }>;
55
+ export type ProposalItem = typeof ProposalItem.Type;
56
+ export declare const Proposal: Schema.Struct<{
57
+ readonly id: Schema.String;
58
+ readonly authorId: Schema.String;
59
+ readonly summary: Schema.String;
60
+ readonly status: Schema.Literals<readonly ["open", "withdrawn"]>;
61
+ readonly items: Schema.$Array<Schema.Struct<{
62
+ readonly id: Schema.String;
63
+ readonly ordinal: Schema.Number;
64
+ readonly summary: Schema.String;
65
+ readonly action: Schema.String;
66
+ readonly input: Schema.Unknown;
67
+ /** Raised by every revision: a decision names the revision it saw. */
68
+ readonly revision: Schema.Number;
69
+ readonly status: Schema.Literals<readonly ["pending", "accepted", "rejected", "applied", "withdrawn"]>;
70
+ readonly decidedBy: Schema.NullOr<Schema.String>;
71
+ /** The invocation that applied it (`applied` only). */
72
+ readonly appliedInvocation: Schema.NullOr<Schema.String>;
73
+ /** The idempotency key its decider applies it under (`proposal-item:<id>:<revision>`). */
74
+ readonly applyKey: Schema.String;
75
+ }>>;
76
+ }>;
77
+ export type Proposal = typeof Proposal.Type;
78
+ export declare const ProposalRef: Schema.Struct<{
79
+ readonly id: Schema.String;
80
+ }>;
81
+ export declare const ProposalRevise: Schema.Struct<{
82
+ readonly item: Schema.String;
83
+ readonly input: Schema.Unknown;
84
+ readonly summary: Schema.optionalKey<Schema.String>;
85
+ }>;
86
+ export declare const ProposalDecide: Schema.Struct<{
87
+ readonly proposal: Schema.String;
88
+ /** The exact set decided: each item with the revision the decider saw. All are decided, or none. */
89
+ readonly decisions: Schema.$Array<Schema.Struct<{
90
+ readonly item: Schema.String;
91
+ readonly decision: Schema.Literals<readonly ["accept", "reject"]>;
92
+ readonly observedRevision: Schema.Number;
93
+ }>>;
94
+ }>;
95
+ export declare const ProposalApplied: Schema.Struct<{
96
+ readonly item: Schema.String;
97
+ }>;
98
+ /** The idempotency key an accepted item is applied under. */
99
+ export declare const proposalApplyKey: (item: {
100
+ readonly id: string;
101
+ readonly revision: number;
102
+ }) => string;
103
+ //# sourceMappingURL=Proposals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Proposals.d.ts","sourceRoot":"","sources":["../src/Proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,eAAO,MAAM,iBAAiB;aAC5B,MAAM,EAAE,kBAAkB;aAC1B,MAAM,EAAE,kBAAkB;aAC1B,QAAQ,EAAE,oBAAoB;aAC9B,GAAG,EAAE,eAAe;aACpB,MAAM,EAAE,kBAAkB;aAC1B,OAAO,EAAE,mBAAmB;CACpB,CAAA;AAEV,eAAO,MAAM,kBAAkB,uFAA+E,CAAA;AAC9G,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAA;AAE/D,eAAO,MAAM,iBAAiB;;IAE5B,yDAAyD;;IAEzD,gDAAgD;;EAEhD,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,eAAO,MAAM,cAAc;;;;QAPzB,yDAAyD;;QAEzD,gDAAgD;;;IAQhD,wGAAwG;;EAExG,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;IAMvB,sEAAsE;;;;IAItE,uDAAuD;;IAEvD,0FAA0F;;EAE1F,CAAA;AACF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAA;AAEnD,eAAO,MAAM,QAAQ;;;;;;;;;;;QAXnB,sEAAsE;;;;QAItE,uDAAuD;;QAEvD,0FAA0F;;;EAW1F,CAAA;AACF,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAA;AAE3C,eAAO,MAAM,WAAW;;EAAuC,CAAA;AAE/D,eAAO,MAAM,cAAc;;;;EAIzB,CAAA;AAEF,eAAO,MAAM,cAAc;;IAEzB,oGAAoG;;;;;;EAQpG,CAAA;AAEF,eAAO,MAAM,eAAe;;EAAyC,CAAA;AAErE,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,SAAU;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,WAC5C,CAAA"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Proposals (the Approvals contract, "Proposals"; ledger A-110): grouped edits someone (a person, or their agent)
3
+ * proposes for others to review. Each item is a proposed call of one action with its input (the edit), decided on
4
+ * its own (accepted or rejected); a decision is made on an exact observed set of items at once, all or none; an
5
+ * accepted item is applied by its decider making the proposed call through the invocation path (as themselves, so
6
+ * the policy decides whether they may), under the item's key, and recorded applied only once the kernel finds that
7
+ * call's committed receipt. The review screens that present proposals are deferred (decision 12).
8
+ */
9
+ import { Schema } from "effect";
10
+ export const PROPOSALS_ACTIONS = {
11
+ create: "proposals.create",
12
+ revise: "proposals.revise",
13
+ withdraw: "proposals.withdraw",
14
+ get: "proposals.get",
15
+ decide: "proposals.decide",
16
+ applied: "proposals.applied",
17
+ };
18
+ export const ProposalItemStatus = Schema.Literals(["pending", "accepted", "rejected", "applied", "withdrawn"]);
19
+ export const ProposalItemInput = Schema.Struct({
20
+ summary: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(500)),
21
+ /** The action the edit is a call of (`notes.rename`). */
22
+ action: Schema.String,
23
+ /** Its input, as the action takes it (JSON). */
24
+ input: Schema.Unknown,
25
+ });
26
+ export const ProposalCreate = Schema.Struct({
27
+ summary: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(500)),
28
+ items: Schema.Array(ProposalItemInput).check(Schema.isMinLength(1), Schema.isMaxLength(100)),
29
+ /** The same key from the same person in the same organisation gives back the proposal it first made. */
30
+ creationKey: Schema.optionalKey(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(200))),
31
+ });
32
+ export const ProposalItem = Schema.Struct({
33
+ id: Schema.String,
34
+ ordinal: Schema.Number,
35
+ summary: Schema.String,
36
+ action: Schema.String,
37
+ input: Schema.Unknown,
38
+ /** Raised by every revision: a decision names the revision it saw. */
39
+ revision: Schema.Number,
40
+ status: ProposalItemStatus,
41
+ decidedBy: Schema.NullOr(Schema.String),
42
+ /** The invocation that applied it (`applied` only). */
43
+ appliedInvocation: Schema.NullOr(Schema.String),
44
+ /** The idempotency key its decider applies it under (`proposal-item:<id>:<revision>`). */
45
+ applyKey: Schema.String,
46
+ });
47
+ export const Proposal = Schema.Struct({
48
+ id: Schema.String,
49
+ authorId: Schema.String,
50
+ summary: Schema.String,
51
+ status: Schema.Literals(["open", "withdrawn"]),
52
+ items: Schema.Array(ProposalItem),
53
+ });
54
+ export const ProposalRef = Schema.Struct({ id: Schema.String });
55
+ export const ProposalRevise = Schema.Struct({
56
+ item: Schema.String,
57
+ input: Schema.Unknown,
58
+ summary: Schema.optionalKey(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(500))),
59
+ });
60
+ export const ProposalDecide = Schema.Struct({
61
+ proposal: Schema.String,
62
+ /** The exact set decided: each item with the revision the decider saw. All are decided, or none. */
63
+ decisions: Schema.Array(Schema.Struct({
64
+ item: Schema.String,
65
+ decision: Schema.Literals(["accept", "reject"]),
66
+ observedRevision: Schema.Number,
67
+ })).check(Schema.isMinLength(1)),
68
+ });
69
+ export const ProposalApplied = Schema.Struct({ item: Schema.String });
70
+ /** The idempotency key an accepted item is applied under. */
71
+ export const proposalApplyKey = (item) => `proposal-item:${item.id}:${item.revision}`;
72
+ //# sourceMappingURL=Proposals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Proposals.js","sourceRoot":"","sources":["../src/Proposals.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,oBAAoB;IAC9B,GAAG,EAAE,eAAe;IACpB,MAAM,EAAE,kBAAkB;IAC1B,OAAO,EAAE,mBAAmB;CACpB,CAAA;AAEV,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,CAAA;AAG9G,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC1E,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC,O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D,EAAE,EAAE,CAC3F,iBAAiB,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,243 @@
1
+ /**
2
+ * Action results and idempotent replay receipts.
3
+ *
4
+ * Every surface returns an envelope, so an action's output and a replay are
5
+ * structurally exclusive whatever the output schema allows:
6
+ *
7
+ * { kind: "output", output } the first execution's output
8
+ * { kind: "replay", receipt } an idempotent replay (same actor, organisation,
9
+ * action, key and input)
10
+ *
11
+ * A receipt holds facts the caller already had, never entity field values,
12
+ * nothing the call read, and no record ids the caller was not given: the
13
+ * declared target ids the caller supplied, the ids of records the call inserted
14
+ * that its output named, for best-effort actions only counts, and the no-op the
15
+ * output was, when it was one (its reason and evidence, the output itself). Clients that
16
+ * need current data re-read it through the normal read path.
17
+ */
18
+ import { Schema } from "effect";
19
+ import { NoOpOutcome } from "./Durable.ts";
20
+ import type { AnyAction } from "./Module.ts";
21
+ /** The receipt format a call commits now (`InvocationReceipt.version`); earlier receipts have none. */
22
+ export declare const RECEIPT_VERSION = 2;
23
+ /**
24
+ * One event the call committed with it, by its CloudEvents identity (`specversion`, `id`, `source`, `type`): never its
25
+ * payload. The event itself is the outbox's, written in the call's transaction; delivery reads it there.
26
+ */
27
+ export declare const ReceiptEventRef: Schema.Struct<{
28
+ readonly specversion: Schema.Literal<"1.0">;
29
+ /** The outbox event's id. */
30
+ readonly id: Schema.String;
31
+ /** `/modules/<module>`: the module that emitted it. */
32
+ readonly source: Schema.String;
33
+ readonly type: Schema.String;
34
+ }>;
35
+ export type ReceiptEventRef = typeof ReceiptEventRef.Type;
36
+ /**
37
+ * Where the call came from: ids only, never a value. `correlationId` groups the work one cause started (the durable
38
+ * execution, the agent run, the approval; else the call itself), `causationId` is what directly caused this call
39
+ * (null for a call a person or a client made), `runId` the agent run it was made from.
40
+ */
41
+ export declare const ReceiptProvenance: Schema.Struct<{
42
+ readonly correlationId: Schema.String;
43
+ readonly causationId: Schema.NullOr<Schema.String>;
44
+ readonly runId: Schema.NullOr<Schema.String>;
45
+ readonly idempotencyKey: Schema.String;
46
+ readonly origin: Schema.Literals<readonly ["person", "agent", "system"]>;
47
+ }>;
48
+ export type ReceiptProvenance = typeof ReceiptProvenance.Type;
49
+ /**
50
+ * What an untargeted writing call (an action that `writes` with no `target`) changed: how many records of its
51
+ * declared entities it inserted and updated. Only what it wrote: a row row-level security kept it from is never
52
+ * counted or named.
53
+ */
54
+ export declare const WrittenCounts: Schema.Struct<{
55
+ readonly inserted: Schema.Number;
56
+ readonly updated: Schema.Number;
57
+ }>;
58
+ export type WrittenCounts = typeof WrittenCounts.Type;
59
+ export declare const InvocationReceipt: Schema.Struct<{
60
+ /** The receipt's format (`RECEIPT_VERSION`); absent on receipts committed before it. */
61
+ readonly version: Schema.optionalKey<Schema.Literal<2>>;
62
+ readonly action: Schema.String;
63
+ /** The original call's invocation id (its audit record). */
64
+ readonly invocationId: Schema.String;
65
+ readonly outcome: Schema.Literal<"succeeded">;
66
+ /** The declared target ids exactly as the caller supplied them (never which of them were affected). */
67
+ readonly targets: Schema.$Array<Schema.String>;
68
+ /** Ids of records of the action's entity that the call inserted and that its original output named. */
69
+ readonly created: Schema.$Array<Schema.String>;
70
+ /** Best-effort actions only: how many declared targets the call affected, never which. */
71
+ /**
72
+ * The external effects the call scheduled (`ctx.connections.schedule`), in order: their ids, derived from the
73
+ * idempotency key, so a caller who retries finds the outcome of what the first call scheduled.
74
+ */
75
+ readonly effects: Schema.optionalKey<Schema.$Array<Schema.String>>;
76
+ /** The events the call committed, by reference (in the order it emitted them). */
77
+ readonly events: Schema.optionalKey<Schema.$Array<Schema.Struct<{
78
+ readonly specversion: Schema.Literal<"1.0">;
79
+ /** The outbox event's id. */
80
+ readonly id: Schema.String;
81
+ /** `/modules/<module>`: the module that emitted it. */
82
+ readonly source: Schema.String;
83
+ readonly type: Schema.String;
84
+ }>>>;
85
+ readonly provenance: Schema.optionalKey<Schema.Struct<{
86
+ readonly correlationId: Schema.String;
87
+ readonly causationId: Schema.NullOr<Schema.String>;
88
+ readonly runId: Schema.NullOr<Schema.String>;
89
+ readonly idempotencyKey: Schema.String;
90
+ readonly origin: Schema.Literals<readonly ["person", "agent", "system"]>;
91
+ }>>;
92
+ /** Untargeted writing actions: what the call wrote. */
93
+ readonly written: Schema.optionalKey<Schema.Struct<{
94
+ readonly inserted: Schema.Number;
95
+ readonly updated: Schema.Number;
96
+ }>>;
97
+ /**
98
+ * When the original output was a no-op outcome (`noOp(...)`): that outcome, which the caller had, so work that runs
99
+ * again (a scheduled run's step after a crash) still knows the call did nothing on purpose.
100
+ */
101
+ readonly noop: Schema.optionalKey<Schema.Struct<{
102
+ readonly "eloxiv/outcome": Schema.Literal<"noop">;
103
+ readonly reason: Schema.String;
104
+ readonly evidence: Schema.optionalKey<Schema.$Array<Schema.String>>;
105
+ }>>;
106
+ readonly completion: Schema.NullOr<Schema.Struct<{
107
+ readonly affected: Schema.Number;
108
+ readonly requested: Schema.Number;
109
+ readonly completion: Schema.Literals<readonly ["complete", "partial"]>;
110
+ }>>;
111
+ }>;
112
+ export type InvocationReceipt = typeof InvocationReceipt.Type;
113
+ /** The result of an idempotent replay, on every surface. */
114
+ export declare const ReplayEnvelope: Schema.Struct<{
115
+ readonly kind: Schema.Literal<"replay">;
116
+ readonly receipt: Schema.Struct<{
117
+ /** The receipt's format (`RECEIPT_VERSION`); absent on receipts committed before it. */
118
+ readonly version: Schema.optionalKey<Schema.Literal<2>>;
119
+ readonly action: Schema.String;
120
+ /** The original call's invocation id (its audit record). */
121
+ readonly invocationId: Schema.String;
122
+ readonly outcome: Schema.Literal<"succeeded">;
123
+ /** The declared target ids exactly as the caller supplied them (never which of them were affected). */
124
+ readonly targets: Schema.$Array<Schema.String>;
125
+ /** Ids of records of the action's entity that the call inserted and that its original output named. */
126
+ readonly created: Schema.$Array<Schema.String>;
127
+ /** Best-effort actions only: how many declared targets the call affected, never which. */
128
+ /**
129
+ * The external effects the call scheduled (`ctx.connections.schedule`), in order: their ids, derived from the
130
+ * idempotency key, so a caller who retries finds the outcome of what the first call scheduled.
131
+ */
132
+ readonly effects: Schema.optionalKey<Schema.$Array<Schema.String>>;
133
+ /** The events the call committed, by reference (in the order it emitted them). */
134
+ readonly events: Schema.optionalKey<Schema.$Array<Schema.Struct<{
135
+ readonly specversion: Schema.Literal<"1.0">;
136
+ /** The outbox event's id. */
137
+ readonly id: Schema.String;
138
+ /** `/modules/<module>`: the module that emitted it. */
139
+ readonly source: Schema.String;
140
+ readonly type: Schema.String;
141
+ }>>>;
142
+ readonly provenance: Schema.optionalKey<Schema.Struct<{
143
+ readonly correlationId: Schema.String;
144
+ readonly causationId: Schema.NullOr<Schema.String>;
145
+ readonly runId: Schema.NullOr<Schema.String>;
146
+ readonly idempotencyKey: Schema.String;
147
+ readonly origin: Schema.Literals<readonly ["person", "agent", "system"]>;
148
+ }>>;
149
+ /** Untargeted writing actions: what the call wrote. */
150
+ readonly written: Schema.optionalKey<Schema.Struct<{
151
+ readonly inserted: Schema.Number;
152
+ readonly updated: Schema.Number;
153
+ }>>;
154
+ /**
155
+ * When the original output was a no-op outcome (`noOp(...)`): that outcome, which the caller had, so work that runs
156
+ * again (a scheduled run's step after a crash) still knows the call did nothing on purpose.
157
+ */
158
+ readonly noop: Schema.optionalKey<Schema.Struct<{
159
+ readonly "eloxiv/outcome": Schema.Literal<"noop">;
160
+ readonly reason: Schema.String;
161
+ readonly evidence: Schema.optionalKey<Schema.$Array<Schema.String>>;
162
+ }>>;
163
+ readonly completion: Schema.NullOr<Schema.Struct<{
164
+ readonly affected: Schema.Number;
165
+ readonly requested: Schema.Number;
166
+ readonly completion: Schema.Literals<readonly ["complete", "partial"]>;
167
+ }>>;
168
+ }>;
169
+ }>;
170
+ export type ReplayEnvelope = typeof ReplayEnvelope.Type;
171
+ /** The result of a first execution, on every surface. */
172
+ export declare const outputEnvelope: <Output extends Schema.Top>(output: Output) => Schema.Struct<{
173
+ readonly kind: Schema.Literal<"output">;
174
+ readonly output: Output;
175
+ }>;
176
+ /** An action's result on every surface: its output, or a replay receipt, told apart by `kind`. */
177
+ export declare const actionResult: (action: AnyAction) => Schema.Union<readonly [Schema.Struct<{
178
+ readonly kind: Schema.Literal<"output">;
179
+ readonly output: Schema.Top;
180
+ }>, Schema.Struct<{
181
+ readonly kind: Schema.Literal<"replay">;
182
+ readonly receipt: Schema.Struct<{
183
+ /** The receipt's format (`RECEIPT_VERSION`); absent on receipts committed before it. */
184
+ readonly version: Schema.optionalKey<Schema.Literal<2>>;
185
+ readonly action: Schema.String;
186
+ /** The original call's invocation id (its audit record). */
187
+ readonly invocationId: Schema.String;
188
+ readonly outcome: Schema.Literal<"succeeded">;
189
+ /** The declared target ids exactly as the caller supplied them (never which of them were affected). */
190
+ readonly targets: Schema.$Array<Schema.String>;
191
+ /** Ids of records of the action's entity that the call inserted and that its original output named. */
192
+ readonly created: Schema.$Array<Schema.String>;
193
+ /** Best-effort actions only: how many declared targets the call affected, never which. */
194
+ /**
195
+ * The external effects the call scheduled (`ctx.connections.schedule`), in order: their ids, derived from the
196
+ * idempotency key, so a caller who retries finds the outcome of what the first call scheduled.
197
+ */
198
+ readonly effects: Schema.optionalKey<Schema.$Array<Schema.String>>;
199
+ /** The events the call committed, by reference (in the order it emitted them). */
200
+ readonly events: Schema.optionalKey<Schema.$Array<Schema.Struct<{
201
+ readonly specversion: Schema.Literal<"1.0">;
202
+ /** The outbox event's id. */
203
+ readonly id: Schema.String;
204
+ /** `/modules/<module>`: the module that emitted it. */
205
+ readonly source: Schema.String;
206
+ readonly type: Schema.String;
207
+ }>>>;
208
+ readonly provenance: Schema.optionalKey<Schema.Struct<{
209
+ readonly correlationId: Schema.String;
210
+ readonly causationId: Schema.NullOr<Schema.String>;
211
+ readonly runId: Schema.NullOr<Schema.String>;
212
+ readonly idempotencyKey: Schema.String;
213
+ readonly origin: Schema.Literals<readonly ["person", "agent", "system"]>;
214
+ }>>;
215
+ /** Untargeted writing actions: what the call wrote. */
216
+ readonly written: Schema.optionalKey<Schema.Struct<{
217
+ readonly inserted: Schema.Number;
218
+ readonly updated: Schema.Number;
219
+ }>>;
220
+ /**
221
+ * When the original output was a no-op outcome (`noOp(...)`): that outcome, which the caller had, so work that runs
222
+ * again (a scheduled run's step after a crash) still knows the call did nothing on purpose.
223
+ */
224
+ readonly noop: Schema.optionalKey<Schema.Struct<{
225
+ readonly "eloxiv/outcome": Schema.Literal<"noop">;
226
+ readonly reason: Schema.String;
227
+ readonly evidence: Schema.optionalKey<Schema.$Array<Schema.String>>;
228
+ }>>;
229
+ readonly completion: Schema.NullOr<Schema.Struct<{
230
+ readonly affected: Schema.Number;
231
+ readonly requested: Schema.Number;
232
+ readonly completion: Schema.Literals<readonly ["complete", "partial"]>;
233
+ }>>;
234
+ }>;
235
+ }>]>;
236
+ /** Is this result a replay? Validates the whole envelope and receipt, not just the tag. */
237
+ export declare const isReplay: (result: unknown) => result is ReplayEnvelope;
238
+ /**
239
+ * The no-op an action's result says the call was: its output, on a first execution, or its receipt's, on a replay
240
+ * (the call ran before, and did nothing on purpose).
241
+ */
242
+ export declare const noOpOf: (result: unknown) => NoOpOutcome | undefined;
243
+ //# sourceMappingURL=Receipt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Receipt.d.ts","sourceRoot":"","sources":["../src/Receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C,uGAAuG;AACvG,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC;;;GAGG;AACH,eAAO,MAAM,eAAe;;IAE1B,6BAA6B;;IAE7B,uDAAuD;;;EAGvD,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAEzD;;;;GAIG;AACH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