@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,197 @@
1
+ /**
2
+ * Flags: feature flags declared in module manifests (`flags`), each with a default, targeted per
3
+ * organisation by its administrators, evaluated in handlers (`ctx.flags.isEnabled`) and on clients from their
4
+ * replica with the same function (`evaluateFlag`). Documented in docs/contracts/flags.md; conformance kit
5
+ * `@eloxiv/testing/conformance/Flags`.
6
+ *
7
+ * Targeting is a set of rules per organisation and flag. Precedence, most specific first: a rule for the
8
+ * person (`user`), for one of their groups (`group`), for one of their roles (`role`), for the whole
9
+ * organisation (`org`), then a percentage rollout (`rollout`), then the declared default. Within one level an
10
+ * `off` rule wins over an `on` rule, so a conflict fails closed.
11
+ */
12
+ import { Schema } from "effect";
13
+ import { Forbidden, InvalidInput, Unauthenticated } from "../Errors.js";
14
+ import { defineOperation, defineServiceContract } from "../Service.js";
15
+ /** The permission organisation administrators need to change their organisation's targeting. */
16
+ export const FLAGS_MANAGE = "eloxiv.flags.manage";
17
+ /** Rule kinds, in precedence order. */
18
+ export const FLAG_RULE_KINDS = ["user", "group", "role", "org", "rollout"];
19
+ export const FlagRuleKind = Schema.Literals(FLAG_RULE_KINDS);
20
+ /** One targeting rule, as the replica holds it (table `eloxiv_flags.rule`). */
21
+ export const FlagRule = Schema.Struct({
22
+ id: Schema.String,
23
+ orgId: Schema.String,
24
+ flag: Schema.String,
25
+ kind: FlagRuleKind,
26
+ /** The person, group or role the rule targets (`user`, `group`, `role`); `null` for `org` and `rollout`. */
27
+ subject: Schema.NullOr(Schema.String),
28
+ /** On or off for whoever the rule targets (a rollout's `enabled` applies inside its percentage). */
29
+ enabled: Schema.Boolean,
30
+ /** A rollout's share of people, 0 to 100 (two decimals); `null` for other kinds. */
31
+ percentage: Schema.NullOr(Schema.Number),
32
+ updatedBy: Schema.String,
33
+ updatedAt: Schema.Number,
34
+ });
35
+ /** The id of a rule: one per organisation, flag, kind and subject. */
36
+ export const flagRuleId = (orgId, flag, kind, subject) => `${orgId}:${flag}:${kind}:${subject ?? ""}`;
37
+ /** How many buckets a rollout divides people into (a percentage has two decimals). */
38
+ export const FLAG_BUCKETS = 10_000;
39
+ /**
40
+ * A person's bucket for a flag, 0 to 9999: FNV-1a (32-bit) of `<flag>:<userId>`, modulo the bucket count.
41
+ * Deterministic, the same on every runtime and client, independent per flag; a rollout of p percent enables
42
+ * buckets below p × 100, so raising the percentage only ever adds people.
43
+ */
44
+ export const flagBucket = (flag, userId) => {
45
+ const text = `${flag}:${userId}`;
46
+ let hash = 0x811c9dc5;
47
+ for (let i = 0; i < text.length; i++) {
48
+ hash ^= text.charCodeAt(i);
49
+ hash = Math.imul(hash, 0x01000193) >>> 0;
50
+ }
51
+ // Mix the high bits down: FNV's low bits alone are weak for sequential ids.
52
+ // `>>> 0` after every step: JavaScript's `^` yields a signed 32-bit integer, which would make buckets negative.
53
+ hash = Math.imul((hash ^ (hash >>> 16)) >>> 0, 0x85ebca6b) >>> 0;
54
+ hash = (hash ^ (hash >>> 13)) >>> 0;
55
+ return hash % FLAG_BUCKETS;
56
+ };
57
+ /**
58
+ * The level that decided a flag: a rule's kind, the declared default, or an external provider the app scoped the flag
59
+ * to (`provider`), which could not be asked (`provider-unavailable`: the flag is off, failing closed).
60
+ */
61
+ export const FlagReason = Schema.Literals([...FLAG_RULE_KINDS, "default", "provider", "provider-unavailable"]);
62
+ /**
63
+ * Evaluate a flag for one person from their organisation's rules for it. The kernel and clients use this one
64
+ * function: the kernel with the person's groups and roles, a client with the rules its replica holds (the
65
+ * kernel syncs a person only the user rules about them and the group rules of their own groups, so
66
+ * `groups: "given"`) and the roles it was told.
67
+ */
68
+ export const evaluateFlag = (flag, declaration, rules, subject) => {
69
+ const mine = rules.filter((rule) => rule.flag === flag);
70
+ const decide = (applies) => applies.length === 0 ? undefined : applies.every((rule) => rule.enabled);
71
+ const levels = [
72
+ ["user", mine.filter((r) => r.kind === "user" && r.subject === subject.userId)],
73
+ [
74
+ "group",
75
+ mine.filter((r) => r.kind === "group" &&
76
+ r.subject !== null &&
77
+ (subject.groups === "given" || subject.groups.includes(r.subject))),
78
+ ],
79
+ ["role", mine.filter((r) => r.kind === "role" && r.subject !== null && subject.roles.includes(r.subject))],
80
+ ["org", mine.filter((r) => r.kind === "org")],
81
+ ];
82
+ for (const [reason, applies] of levels) {
83
+ const enabled = decide(applies);
84
+ if (enabled !== undefined)
85
+ return { enabled, reason };
86
+ }
87
+ const rollouts = mine.filter((r) => r.kind === "rollout");
88
+ if (rollouts.length > 0) {
89
+ const bucket = flagBucket(flag, subject.userId);
90
+ // Inside every rollout's share it takes the rollouts' value (off wins); outside it, the opposite.
91
+ const inside = rollouts.every((r) => bucket < Math.round((r.percentage ?? 0) * 100));
92
+ const on = rollouts.every((r) => r.enabled);
93
+ return { enabled: inside ? on : !on, reason: "rollout" };
94
+ }
95
+ return { enabled: declaration.default, reason: "default" };
96
+ };
97
+ export const FlagKey = Schema.Struct({ flag: Schema.String });
98
+ export const FlagEvaluation = Schema.Struct({
99
+ flag: Schema.String,
100
+ enabled: Schema.Boolean,
101
+ /** The level that decided it. */
102
+ reason: FlagReason,
103
+ });
104
+ const Percentage = Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 100 }));
105
+ export const FlagRuleWrite = Schema.Struct({
106
+ flag: Schema.String,
107
+ kind: FlagRuleKind,
108
+ /** The person's user id, the group's or the role's id; omitted for `org` and `rollout`. */
109
+ subject: Schema.optionalKey(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(200))),
110
+ enabled: Schema.Boolean,
111
+ /** Required for `rollout`, refused for the other kinds. */
112
+ percentage: Schema.optionalKey(Percentage),
113
+ });
114
+ export const FlagRuleRef = Schema.Struct({ id: Schema.String });
115
+ export const FlagRules = Schema.Struct({ rules: Schema.Array(FlagRule) });
116
+ /** A person's own choice for a lab flag (`lab: true` in its declaration). */
117
+ export const LabOptIn = Schema.Struct({ flag: Schema.String, enabled: Schema.Boolean });
118
+ /** One lab flag as a person sees it: what it is, what they get now and why, and their own choice if they made one. */
119
+ export const Lab = Schema.Struct({
120
+ flag: Schema.String,
121
+ description: Schema.String,
122
+ default: Schema.Boolean,
123
+ enabled: Schema.Boolean,
124
+ reason: FlagReason,
125
+ /** Their own choice (a user rule about them), or null: they get what their organisation decided. */
126
+ mine: Schema.NullOr(Schema.Struct({ id: Schema.String, enabled: Schema.Boolean })),
127
+ });
128
+ export const Labs = Schema.Struct({ labs: Schema.Array(Lab) });
129
+ /** The kernel actions (module `flags`). */
130
+ export const FLAGS_ACTIONS = {
131
+ evaluate: "flags.evaluate",
132
+ set: "flags.set",
133
+ remove: "flags.remove",
134
+ rules: "flags.rules",
135
+ optIn: "flags.optIn",
136
+ clearOptIn: "flags.clearOptIn",
137
+ labs: "flags.labs",
138
+ };
139
+ const Errors = Schema.Union([Unauthenticated, Forbidden, InvalidInput]);
140
+ export const FlagsContract = defineServiceContract({
141
+ name: "Flags",
142
+ kind: "kernel",
143
+ version: "1.2.0",
144
+ description: "Feature flags declared in module manifests with a default, targeted per organisation by person, group, " +
145
+ "role, the whole organisation and a percentage rollout with deterministic bucketing, in that order of " +
146
+ "precedence (off wins within a level). Evaluated in handlers (ctx.flags.isEnabled), through flags.evaluate, " +
147
+ "and on clients from the rules synced to their replica with the same function. Changing targeting needs " +
148
+ "eloxiv.flags.manage in the organisation and is audited. Labs (flags declared `lab: true`) each person turns on " +
149
+ "or off for themselves, over their organisation's targeting, and back.",
150
+ operations: {
151
+ evaluate: defineOperation({
152
+ description: "Whether a declared flag is on for the caller, and the level that decided it.",
153
+ input: FlagKey,
154
+ output: FlagEvaluation,
155
+ errors: Errors,
156
+ }),
157
+ set: defineOperation({
158
+ description: "Create or replace one targeting rule of the caller's organisation for a declared flag (administrators). " +
159
+ "Audited with the rule before and after.",
160
+ input: FlagRuleWrite,
161
+ output: FlagRuleRef,
162
+ errors: Errors,
163
+ }),
164
+ remove: defineOperation({
165
+ description: "Remove one targeting rule of the caller's organisation (administrators). Audited.",
166
+ input: FlagRuleRef,
167
+ output: FlagRuleRef,
168
+ errors: Errors,
169
+ }),
170
+ rules: defineOperation({
171
+ description: "Every targeting rule of the caller's organisation for one flag (administrators), for managing it.",
172
+ input: FlagKey,
173
+ output: FlagRules,
174
+ errors: Errors,
175
+ }),
176
+ optIn: defineOperation({
177
+ description: "Turn a lab flag on or off for yourself (a user rule about you, over your organisation's targeting). Refused for a flag that is not a lab. Audited.",
178
+ input: LabOptIn,
179
+ output: FlagRuleRef,
180
+ errors: Errors,
181
+ }),
182
+ clearOptIn: defineOperation({
183
+ description: "Drop your own choice for a lab flag (by its rule id, from `labs`): you get your organisation's again.",
184
+ input: FlagRuleRef,
185
+ output: FlagRuleRef,
186
+ errors: Errors,
187
+ }),
188
+ labs: defineOperation({
189
+ description: "The lab flags of the installed modules, each with what you get now, why, and your own choice.",
190
+ input: Schema.Struct({}),
191
+ output: Labs,
192
+ errors: Errors,
193
+ }),
194
+ },
195
+ types: { FlagRule, FlagRuleWrite, FlagEvaluation, FlagRuleKind, FlagReason, Lab },
196
+ });
197
+ //# sourceMappingURL=Flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flags.js","sourceRoot":"","sources":["../../src/contracts/Flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAEtE,gGAAgG;AAChG,MAAM,CAAC,MAAM,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e,CAAC;YAC1B,WAAW,EACT,uGAAuG;YACzG,KAAK,EAAE,WAAW;YAClB,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE,MAAM;SACf,CAAC;QACF,IAAI,EAAE,eAAe,CAAC;YACpB,WAAW,EAAE,+FAA+F;YAC5G,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YACxB,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,MAAM;SACf,CAAC;KACH;IACD,KAAK,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE;CAClF,CAAC,CAAA"}
@@ -0,0 +1,320 @@
1
+ /**
2
+ * Host (a shell contract, decision 7): what the shell needs from wherever it runs (a browser tab, the Tauri
3
+ * desktop host, later a mobile host): deep links, push, secure storage, updates and file access. The kernel
4
+ * defines the contract; a host implements it, and says per capability whether it supports it, so the shell
5
+ * asks rather than guesses. A host that lacks a capability reports `unsupported` and every operation of it
6
+ * fails with `HostUnsupported`; it never pretends.
7
+ *
8
+ * - **Deep links:** the URL the app was opened with, and URLs it is asked to open while running, only on the
9
+ * app's own origin or custom scheme (the View contract parses them; a link only navigates).
10
+ * - **Secure storage:** small secrets (a session token) kept where the platform keeps secrets (the OS keychain;
11
+ * on the web, values encrypted with a non-extractable key). Keys are namespaced per app.
12
+ * - **Push:** a subscription a NotificationChannel can deliver to (Web Push, APNs or FCM), after the person's
13
+ * permission. A native host also gives its native device token (`pushToken`), which the app registers as an
14
+ * installation (`notifications.registerInstallation`), and tells the app of notification responses
15
+ * (`onNotificationResponse`: a tap, or a decision button, decided only for the person and installation the
16
+ * notification was sent to: with its token on iOS, through the person's session on Android, which gets none).
17
+ * - **Updates:** whether a newer build of the app is available, and applying it (on the web: reloading onto the
18
+ * deployed build; on desktop and mobile: the platform's updater).
19
+ * - **Files:** opening files the person picks and saving bytes to a file they choose.
20
+ *
21
+ * Documented in docs/contracts/host.md; conformance kit `@eloxiv/testing/conformance/Host`; implemented by
22
+ * `@eloxiv/shell-core/web` (`webHost`) and the registry's desktop template (`desktop/host.ts`).
23
+ */
24
+ import { Schema } from "effect";
25
+ export declare const CapabilitySupport: Schema.Literals<readonly ["supported", "unsupported"]>;
26
+ export type CapabilitySupport = typeof CapabilitySupport.Type;
27
+ export declare const HostCapabilities: Schema.Struct<{
28
+ /** The host's kind: `web`, `tauri`, `expo`, or another host's name. */
29
+ readonly host: Schema.String;
30
+ readonly deepLinks: Schema.Literals<readonly ["supported", "unsupported"]>;
31
+ readonly push: Schema.Literals<readonly ["supported", "unsupported"]>;
32
+ readonly secureStorage: Schema.Literals<readonly ["supported", "unsupported"]>;
33
+ readonly updates: Schema.Literals<readonly ["supported", "unsupported"]>;
34
+ readonly files: Schema.Literals<readonly ["supported", "unsupported"]>;
35
+ }>;
36
+ export type HostCapabilities = typeof HostCapabilities.Type;
37
+ /** A secure-storage key: short, namespaced by the caller (`session`, `device.credential`). */
38
+ export declare const SecretKey: Schema.String;
39
+ export declare const PushPermission: Schema.Literals<readonly ["granted", "denied", "prompt"]>;
40
+ export type PushPermission = typeof PushPermission.Type;
41
+ /** Where pushes for this installation go: a Web Push endpoint with its keys, or an APNs or FCM device token. */
42
+ export declare const PushSubscriptionInfo: Schema.Union<readonly [Schema.Struct<{
43
+ readonly kind: Schema.Literal<"web-push">;
44
+ readonly endpoint: Schema.String;
45
+ readonly keys: Schema.Struct<{
46
+ readonly p256dh: Schema.String;
47
+ readonly auth: Schema.String;
48
+ }>;
49
+ }>, Schema.Struct<{
50
+ readonly kind: Schema.Literals<readonly ["apns", "fcm"]>;
51
+ readonly token: Schema.String;
52
+ }>]>;
53
+ export type PushSubscriptionInfo = typeof PushSubscriptionInfo.Type;
54
+ /**
55
+ * A native host's push token: what the app registers with `notifications.registerInstallation` (with its own
56
+ * installation id). `appId` is the APNs topic (bundle id) or the Android package; `environment` is APNs only.
57
+ */
58
+ export declare const PushToken: Schema.Struct<{
59
+ readonly provider: Schema.Literals<readonly ["apns", "fcm"]>;
60
+ readonly token: Schema.String;
61
+ readonly appId: Schema.String;
62
+ readonly environment: Schema.optionalKey<Schema.Literals<readonly ["production", "sandbox"]>>;
63
+ }>;
64
+ export type PushToken = typeof PushToken.Type;
65
+ /**
66
+ * The person responded to a push notification: a tap (no `action`: open `link`) or a decision button (`action`). A
67
+ * button is decided once the app shows its request to the person the notification was sent to, on the installation it
68
+ * was sent to: with the payload's decision token on iOS, through the person's own session on Android (FCM payloads
69
+ * carry no token). From the payload's `eloxiv` key.
70
+ */
71
+ export declare const NotificationResponse: Schema.Struct<{
72
+ readonly notificationId: Schema.String;
73
+ readonly link: Schema.NullOr<Schema.Struct<{
74
+ readonly view: Schema.String;
75
+ readonly record: Schema.optionalKey<Schema.String>;
76
+ readonly org: Schema.optionalKey<Schema.String>;
77
+ readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
78
+ }>>;
79
+ readonly action: Schema.optionalKey<Schema.Literals<readonly ["approve", "reject"]>>;
80
+ }>;
81
+ export type NotificationResponse = typeof NotificationResponse.Type;
82
+ export declare const UpdateStatus: Schema.Struct<{
83
+ readonly current: Schema.String;
84
+ /** The newer build's version, or `null` when this one is current. */
85
+ readonly available: Schema.NullOr<Schema.String>;
86
+ }>;
87
+ export type UpdateStatus = typeof UpdateStatus.Type;
88
+ /** A file the person picked. */
89
+ export declare const PickedFile: Schema.Struct<{
90
+ readonly name: Schema.String;
91
+ readonly mediaType: Schema.String;
92
+ readonly size: Schema.Number;
93
+ readonly bytes: Schema.Uint8Array;
94
+ }>;
95
+ export type PickedFile = typeof PickedFile.Type;
96
+ declare const HostUnsupported_base: Schema.Class<HostUnsupported, Schema.TaggedStruct<"HostUnsupported", {
97
+ readonly message: Schema.String;
98
+ readonly capability: Schema.Literals<readonly ["deepLinks", "push", "secureStorage", "updates", "files"]>;
99
+ }>, import("effect/Cause").YieldableError>;
100
+ export declare class HostUnsupported extends HostUnsupported_base {
101
+ }
102
+ declare const HostPermissionDenied_base: Schema.Class<HostPermissionDenied, Schema.TaggedStruct<"HostPermissionDenied", {
103
+ readonly message: Schema.String;
104
+ }>, import("effect/Cause").YieldableError>;
105
+ export declare class HostPermissionDenied extends HostPermissionDenied_base {
106
+ }
107
+ declare const HostCancelled_base: Schema.Class<HostCancelled, Schema.TaggedStruct<"HostCancelled", {
108
+ readonly message: Schema.String;
109
+ }>, import("effect/Cause").YieldableError>;
110
+ /** The person dismissed a picker or prompt. */
111
+ export declare class HostCancelled extends HostCancelled_base {
112
+ }
113
+ declare const HostFailure_base: Schema.Class<HostFailure, Schema.TaggedStruct<"HostFailure", {
114
+ readonly message: Schema.String;
115
+ }>, import("effect/Cause").YieldableError>;
116
+ export declare class HostFailure extends HostFailure_base {
117
+ }
118
+ export declare const HostContract: import("../Service.ts").ServiceContract<"Host", {
119
+ readonly capabilities: {
120
+ readonly description: "Which capabilities this host supports.";
121
+ readonly input: Schema.Struct<{}>;
122
+ readonly output: Schema.Struct<{
123
+ /** The host's kind: `web`, `tauri`, `expo`, or another host's name. */
124
+ readonly host: Schema.String;
125
+ readonly deepLinks: Schema.Literals<readonly ["supported", "unsupported"]>;
126
+ readonly push: Schema.Literals<readonly ["supported", "unsupported"]>;
127
+ readonly secureStorage: Schema.Literals<readonly ["supported", "unsupported"]>;
128
+ readonly updates: Schema.Literals<readonly ["supported", "unsupported"]>;
129
+ readonly files: Schema.Literals<readonly ["supported", "unsupported"]>;
130
+ }>;
131
+ readonly errors: Schema.Never;
132
+ };
133
+ readonly initialLink: {
134
+ readonly description: "The deep link the app was opened with, or `null` (only links on the app's own origin or scheme).";
135
+ readonly input: Schema.Struct<{}>;
136
+ readonly output: Schema.NullOr<Schema.String>;
137
+ readonly errors: typeof HostUnsupported;
138
+ };
139
+ readonly onLink: {
140
+ description: string;
141
+ input: Schema.Struct<{}>;
142
+ output: Schema.Struct<{}>;
143
+ errors: typeof HostUnsupported;
144
+ };
145
+ readonly secretGet: {
146
+ readonly description: "A stored secret, or `null` when none is stored under the key.";
147
+ readonly input: Schema.Struct<{
148
+ readonly key: Schema.String;
149
+ }>;
150
+ readonly output: Schema.NullOr<Schema.String>;
151
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
152
+ };
153
+ readonly secretSet: {
154
+ readonly description: "Store a secret under a key (replacing any), kept across restarts and never in plain storage.";
155
+ readonly input: Schema.Struct<{
156
+ readonly key: Schema.String;
157
+ readonly value: Schema.String;
158
+ }>;
159
+ readonly output: Schema.Struct<{}>;
160
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
161
+ };
162
+ readonly secretDelete: {
163
+ readonly description: "Delete the secret under a key (nothing if none).";
164
+ readonly input: Schema.Struct<{
165
+ readonly key: Schema.String;
166
+ }>;
167
+ readonly output: Schema.Struct<{}>;
168
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
169
+ };
170
+ readonly pushPermission: {
171
+ readonly description: "Whether the person allowed notifications, denied them, or has not been asked.";
172
+ readonly input: Schema.Struct<{}>;
173
+ readonly output: Schema.Literals<readonly ["granted", "denied", "prompt"]>;
174
+ readonly errors: typeof HostUnsupported;
175
+ };
176
+ readonly pushSubscribe: {
177
+ readonly description: "Ask the person's permission if needed, and subscribe this installation for push.";
178
+ readonly input: Schema.Struct<{
179
+ readonly applicationServerKey: Schema.optionalKey<Schema.String>;
180
+ }>;
181
+ readonly output: Schema.Union<readonly [Schema.Struct<{
182
+ readonly kind: Schema.Literal<"web-push">;
183
+ readonly endpoint: Schema.String;
184
+ readonly keys: Schema.Struct<{
185
+ readonly p256dh: Schema.String;
186
+ readonly auth: Schema.String;
187
+ }>;
188
+ }>, Schema.Struct<{
189
+ readonly kind: Schema.Literals<readonly ["apns", "fcm"]>;
190
+ readonly token: Schema.String;
191
+ }>]>;
192
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostPermissionDenied, typeof HostFailure]>;
193
+ };
194
+ readonly pushUnsubscribe: {
195
+ readonly description: "Remove this installation's push subscription (nothing if none).";
196
+ readonly input: Schema.Struct<{}>;
197
+ readonly output: Schema.Struct<{}>;
198
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
199
+ };
200
+ readonly pushToken: {
201
+ description: string;
202
+ input: Schema.Struct<{}>;
203
+ output: Schema.Struct<{
204
+ readonly provider: Schema.Literals<readonly ["apns", "fcm"]>;
205
+ readonly token: Schema.String;
206
+ readonly appId: Schema.String;
207
+ readonly environment: Schema.optionalKey<Schema.Literals<readonly ["production", "sandbox"]>>;
208
+ }>;
209
+ errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostPermissionDenied, typeof HostFailure]>;
210
+ };
211
+ readonly onNotificationResponse: {
212
+ description: string;
213
+ input: Schema.Struct<{}>;
214
+ output: Schema.Struct<{
215
+ readonly notificationId: Schema.String;
216
+ readonly link: Schema.NullOr<Schema.Struct<{
217
+ readonly view: Schema.String;
218
+ readonly record: Schema.optionalKey<Schema.String>;
219
+ readonly org: Schema.optionalKey<Schema.String>;
220
+ readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
221
+ }>>;
222
+ readonly action: Schema.optionalKey<Schema.Literals<readonly ["approve", "reject"]>>;
223
+ }>;
224
+ errors: typeof HostUnsupported;
225
+ };
226
+ readonly checkUpdate: {
227
+ readonly description: "Whether a newer build of the app is available.";
228
+ readonly input: Schema.Struct<{}>;
229
+ readonly output: Schema.Struct<{
230
+ readonly current: Schema.String;
231
+ /** The newer build's version, or `null` when this one is current. */
232
+ readonly available: Schema.NullOr<Schema.String>;
233
+ }>;
234
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
235
+ };
236
+ readonly applyUpdate: {
237
+ readonly description: "Move onto the newer build (reload or install and restart).";
238
+ readonly input: Schema.Struct<{}>;
239
+ readonly output: Schema.Struct<{}>;
240
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostFailure]>;
241
+ };
242
+ readonly openFiles: {
243
+ readonly description: "Let the person pick files to open; their names, media types and bytes.";
244
+ readonly input: Schema.Struct<{
245
+ readonly accept: Schema.optionalKey<Schema.$Array<Schema.String>>;
246
+ readonly multiple: Schema.optionalKey<Schema.Boolean>;
247
+ }>;
248
+ readonly output: Schema.$Array<Schema.Struct<{
249
+ readonly name: Schema.String;
250
+ readonly mediaType: Schema.String;
251
+ readonly size: Schema.Number;
252
+ readonly bytes: Schema.Uint8Array;
253
+ }>>;
254
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostCancelled, typeof HostFailure]>;
255
+ };
256
+ readonly saveFile: {
257
+ readonly description: "Save bytes to a file the person chooses (or the platform's downloads).";
258
+ readonly input: Schema.Struct<{
259
+ readonly name: Schema.String;
260
+ readonly mediaType: Schema.String;
261
+ readonly bytes: Schema.Uint8Array;
262
+ }>;
263
+ readonly output: Schema.Struct<{}>;
264
+ readonly errors: Schema.Union<readonly [typeof HostUnsupported, typeof HostCancelled, typeof HostFailure]>;
265
+ };
266
+ }, {
267
+ readonly HostCapabilities: Schema.Struct<{
268
+ /** The host's kind: `web`, `tauri`, `expo`, or another host's name. */
269
+ readonly host: Schema.String;
270
+ readonly deepLinks: Schema.Literals<readonly ["supported", "unsupported"]>;
271
+ readonly push: Schema.Literals<readonly ["supported", "unsupported"]>;
272
+ readonly secureStorage: Schema.Literals<readonly ["supported", "unsupported"]>;
273
+ readonly updates: Schema.Literals<readonly ["supported", "unsupported"]>;
274
+ readonly files: Schema.Literals<readonly ["supported", "unsupported"]>;
275
+ }>;
276
+ readonly PushSubscriptionInfo: Schema.Union<readonly [Schema.Struct<{
277
+ readonly kind: Schema.Literal<"web-push">;
278
+ readonly endpoint: Schema.String;
279
+ readonly keys: Schema.Struct<{
280
+ readonly p256dh: Schema.String;
281
+ readonly auth: Schema.String;
282
+ }>;
283
+ }>, Schema.Struct<{
284
+ readonly kind: Schema.Literals<readonly ["apns", "fcm"]>;
285
+ readonly token: Schema.String;
286
+ }>]>;
287
+ readonly PushToken: Schema.Struct<{
288
+ readonly provider: Schema.Literals<readonly ["apns", "fcm"]>;
289
+ readonly token: Schema.String;
290
+ readonly appId: Schema.String;
291
+ readonly environment: Schema.optionalKey<Schema.Literals<readonly ["production", "sandbox"]>>;
292
+ }>;
293
+ readonly NotificationResponse: Schema.Struct<{
294
+ readonly notificationId: Schema.String;
295
+ readonly link: Schema.NullOr<Schema.Struct<{
296
+ readonly view: Schema.String;
297
+ readonly record: Schema.optionalKey<Schema.String>;
298
+ readonly org: Schema.optionalKey<Schema.String>;
299
+ readonly params: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
300
+ }>>;
301
+ readonly action: Schema.optionalKey<Schema.Literals<readonly ["approve", "reject"]>>;
302
+ }>;
303
+ readonly UpdateStatus: Schema.Struct<{
304
+ readonly current: Schema.String;
305
+ /** The newer build's version, or `null` when this one is current. */
306
+ readonly available: Schema.NullOr<Schema.String>;
307
+ }>;
308
+ readonly PickedFile: Schema.Struct<{
309
+ readonly name: Schema.String;
310
+ readonly mediaType: Schema.String;
311
+ readonly size: Schema.Number;
312
+ readonly bytes: Schema.Uint8Array;
313
+ }>;
314
+ readonly HostUnsupported: typeof HostUnsupported;
315
+ readonly HostPermissionDenied: typeof HostPermissionDenied;
316
+ readonly HostCancelled: typeof HostCancelled;
317
+ readonly HostFailure: typeof HostFailure;
318
+ }>;
319
+ export {};
320
+ //# sourceMappingURL=Host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Host.d.ts","sourceRoot":"","sources":["../../src/contracts/Host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAM/B,eAAO,MAAM,iBAAiB,wDAAgD,CAAA;AAC9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,iBAAiB,CAAC,IAAI,CAAA;AAE7D,eAAO,MAAM,gBAAgB;IAC3B,uEAAuE;;;;;;;EAOv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