@qlever-llc/trellis 0.10.22 → 0.11.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (406) hide show
  1. package/esm/auth/mod.d.ts +1 -1
  2. package/esm/auth/mod.d.ts.map +1 -1
  3. package/esm/auth/mod.js +1 -1
  4. package/esm/auth/protocol.d.ts +55 -0
  5. package/esm/auth/protocol.d.ts.map +1 -1
  6. package/esm/browser.d.ts +3 -3
  7. package/esm/browser.d.ts.map +1 -1
  8. package/esm/browser.js +1 -1
  9. package/esm/client_connect.d.ts +12 -3
  10. package/esm/client_connect.d.ts.map +1 -1
  11. package/esm/client_connect.js +112 -7
  12. package/esm/codec.d.ts +7 -6
  13. package/esm/codec.d.ts.map +1 -1
  14. package/esm/codec.js +125 -6
  15. package/esm/contract_support/canonical.d.ts +3 -0
  16. package/esm/contract_support/canonical.d.ts.map +1 -1
  17. package/esm/contract_support/canonical.js +3 -0
  18. package/esm/contract_support/mod.d.ts +125 -10
  19. package/esm/contract_support/mod.d.ts.map +1 -1
  20. package/esm/contract_support/mod.js +159 -5
  21. package/esm/contract_support/protocol.d.ts +92 -7
  22. package/esm/contract_support/protocol.d.ts.map +1 -1
  23. package/esm/contract_support/protocol.js +41 -7
  24. package/esm/contract_support/runtime.d.ts +4 -1
  25. package/esm/contract_support/runtime.d.ts.map +1 -1
  26. package/esm/errors/SchemaValidationError.d.ts +49 -0
  27. package/esm/errors/SchemaValidationError.d.ts.map +1 -0
  28. package/esm/errors/SchemaValidationError.js +67 -0
  29. package/esm/errors/index.d.ts +38 -9
  30. package/esm/errors/index.d.ts.map +1 -1
  31. package/esm/errors/index.js +16 -0
  32. package/esm/generated-sdk/auth/api.d.ts +33 -605
  33. package/esm/generated-sdk/auth/api.d.ts.map +1 -1
  34. package/esm/generated-sdk/auth/api.js +6 -1
  35. package/esm/generated-sdk/auth/client.d.ts +129 -134
  36. package/esm/generated-sdk/auth/client.d.ts.map +1 -1
  37. package/esm/generated-sdk/auth/contract.d.ts +2 -601
  38. package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
  39. package/esm/generated-sdk/auth/contract.js +310 -93
  40. package/esm/generated-sdk/auth/mod.d.ts +1 -1
  41. package/esm/generated-sdk/auth/mod.d.ts.map +1 -1
  42. package/esm/generated-sdk/auth/owned_api.d.ts +88 -86
  43. package/esm/generated-sdk/auth/owned_api.d.ts.map +1 -1
  44. package/esm/generated-sdk/auth/owned_api.js +6 -0
  45. package/esm/generated-sdk/auth/schemas.d.ts +284 -136
  46. package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
  47. package/esm/generated-sdk/auth/schemas.js +231 -92
  48. package/esm/generated-sdk/auth/types.d.ts +565 -89
  49. package/esm/generated-sdk/auth/types.d.ts.map +1 -1
  50. package/esm/generated-sdk/auth/types.js +1 -1
  51. package/esm/generated-sdk/health/api.d.ts +29 -18
  52. package/esm/generated-sdk/health/api.d.ts.map +1 -1
  53. package/esm/generated-sdk/health/client.d.ts +7 -21
  54. package/esm/generated-sdk/health/client.d.ts.map +1 -1
  55. package/esm/generated-sdk/health/contract.d.ts +2 -15
  56. package/esm/generated-sdk/health/contract.d.ts.map +1 -1
  57. package/esm/generated-sdk/health/contract.js +2 -10
  58. package/esm/generated-sdk/health/mod.d.ts +1 -1
  59. package/esm/generated-sdk/health/mod.d.ts.map +1 -1
  60. package/esm/generated-sdk/health/owned_api.d.ts +2 -2
  61. package/esm/generated-sdk/health/schemas.d.ts +1 -14
  62. package/esm/generated-sdk/health/schemas.d.ts.map +1 -1
  63. package/esm/generated-sdk/health/schemas.js +1 -9
  64. package/esm/generated-sdk/health/types.d.ts +10 -5
  65. package/esm/generated-sdk/health/types.d.ts.map +1 -1
  66. package/esm/generated-sdk/health/types.js +1 -2
  67. package/esm/generated-sdk/jobs/api.d.ts +29 -109
  68. package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
  69. package/esm/generated-sdk/jobs/client.d.ts +21 -33
  70. package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
  71. package/esm/generated-sdk/jobs/contract.d.ts +2 -106
  72. package/esm/generated-sdk/jobs/contract.d.ts.map +1 -1
  73. package/esm/generated-sdk/jobs/contract.js +268 -1
  74. package/esm/generated-sdk/jobs/mod.d.ts +1 -1
  75. package/esm/generated-sdk/jobs/mod.d.ts.map +1 -1
  76. package/esm/generated-sdk/jobs/owned_api.d.ts +22 -9
  77. package/esm/generated-sdk/jobs/owned_api.d.ts.map +1 -1
  78. package/esm/generated-sdk/jobs/owned_api.js +20 -1
  79. package/esm/generated-sdk/jobs/schemas.d.ts +437 -0
  80. package/esm/generated-sdk/jobs/schemas.d.ts.map +1 -1
  81. package/esm/generated-sdk/jobs/schemas.js +211 -0
  82. package/esm/generated-sdk/jobs/types.d.ts +195 -12
  83. package/esm/generated-sdk/jobs/types.d.ts.map +1 -1
  84. package/esm/generated-sdk/jobs/types.js +1 -1
  85. package/esm/generated-sdk/state/api.d.ts +29 -68
  86. package/esm/generated-sdk/state/api.d.ts.map +1 -1
  87. package/esm/generated-sdk/state/client.d.ts +17 -31
  88. package/esm/generated-sdk/state/client.d.ts.map +1 -1
  89. package/esm/generated-sdk/state/contract.d.ts +1 -64
  90. package/esm/generated-sdk/state/contract.d.ts.map +1 -1
  91. package/esm/generated-sdk/state/mod.d.ts +1 -1
  92. package/esm/generated-sdk/state/mod.d.ts.map +1 -1
  93. package/esm/generated-sdk/state/owned_api.d.ts +7 -7
  94. package/esm/generated-sdk/state/types.d.ts +52 -9
  95. package/esm/generated-sdk/state/types.d.ts.map +1 -1
  96. package/esm/generated-sdk/trellis-core/api.d.ts +33 -45
  97. package/esm/generated-sdk/trellis-core/api.d.ts.map +1 -1
  98. package/esm/generated-sdk/trellis-core/api.js +6 -1
  99. package/esm/generated-sdk/trellis-core/client.d.ts +31 -20
  100. package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
  101. package/esm/generated-sdk/trellis-core/contract.d.ts +2 -41
  102. package/esm/generated-sdk/trellis-core/contract.d.ts.map +1 -1
  103. package/esm/generated-sdk/trellis-core/contract.js +91 -1
  104. package/esm/generated-sdk/trellis-core/mod.d.ts +1 -1
  105. package/esm/generated-sdk/trellis-core/mod.d.ts.map +1 -1
  106. package/esm/generated-sdk/trellis-core/owned_api.d.ts +4 -4
  107. package/esm/generated-sdk/trellis-core/schemas.d.ts +113 -0
  108. package/esm/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
  109. package/esm/generated-sdk/trellis-core/schemas.js +81 -0
  110. package/esm/generated-sdk/trellis-core/types.d.ts +54 -7
  111. package/esm/generated-sdk/trellis-core/types.d.ts.map +1 -1
  112. package/esm/generated-sdk/trellis-core/types.js +1 -1
  113. package/esm/health.d.ts +1 -1
  114. package/esm/health.d.ts.map +1 -1
  115. package/esm/health.js +1 -1
  116. package/esm/index.d.ts +4 -4
  117. package/esm/index.d.ts.map +1 -1
  118. package/esm/index.js +2 -2
  119. package/esm/jobs.d.ts +69 -3
  120. package/esm/jobs.d.ts.map +1 -1
  121. package/esm/jobs.js +92 -3
  122. package/esm/server/health.d.ts +2 -6
  123. package/esm/server/health.d.ts.map +1 -1
  124. package/esm/server/health_schemas.d.ts +0 -8
  125. package/esm/server/health_schemas.d.ts.map +1 -1
  126. package/esm/server/health_schemas.js +0 -5
  127. package/esm/server/internal_jobs/bindings.d.ts +11 -0
  128. package/esm/server/internal_jobs/bindings.d.ts.map +1 -1
  129. package/esm/server/internal_jobs/job-manager.d.ts +58 -2
  130. package/esm/server/internal_jobs/job-manager.d.ts.map +1 -1
  131. package/esm/server/internal_jobs/job-manager.js +429 -55
  132. package/esm/server/internal_jobs/key-coordinator.d.ts +269 -0
  133. package/esm/server/internal_jobs/key-coordinator.d.ts.map +1 -0
  134. package/esm/server/internal_jobs/key-coordinator.js +677 -0
  135. package/esm/server/internal_jobs/projection.d.ts.map +1 -1
  136. package/esm/server/internal_jobs/projection.js +2 -0
  137. package/esm/server/internal_jobs/runtime-worker.d.ts +5 -1
  138. package/esm/server/internal_jobs/runtime-worker.d.ts.map +1 -1
  139. package/esm/server/internal_jobs/runtime-worker.js +14 -2
  140. package/esm/server/internal_jobs/types.d.ts +5 -5
  141. package/esm/server/internal_jobs/types.d.ts.map +1 -1
  142. package/esm/server/internal_jobs/types.js +6 -0
  143. package/esm/server/runtime.d.ts.map +1 -1
  144. package/esm/server/service.d.ts +81 -112
  145. package/esm/server/service.d.ts.map +1 -1
  146. package/esm/server/service.js +372 -130
  147. package/esm/server.d.ts +3 -3
  148. package/esm/server.d.ts.map +1 -1
  149. package/esm/service/deno.d.ts +1 -1
  150. package/esm/service/deno.d.ts.map +1 -1
  151. package/esm/service/drizzle.d.ts +52 -0
  152. package/esm/service/drizzle.d.ts.map +1 -0
  153. package/esm/service/drizzle.js +108 -0
  154. package/esm/service/mod.d.ts +3 -3
  155. package/esm/service/mod.d.ts.map +1 -1
  156. package/esm/service/mod.js +2 -2
  157. package/esm/service/node.d.ts +1 -1
  158. package/esm/service/node.d.ts.map +1 -1
  159. package/esm/service/outbox_inbox.d.ts +76 -22
  160. package/esm/service/outbox_inbox.d.ts.map +1 -1
  161. package/esm/service/outbox_inbox.js +231 -70
  162. package/esm/telemetry/metrics.d.ts +55 -0
  163. package/esm/telemetry/metrics.d.ts.map +1 -1
  164. package/esm/telemetry/metrics.js +86 -0
  165. package/esm/telemetry/mod.d.ts +2 -1
  166. package/esm/telemetry/mod.d.ts.map +1 -1
  167. package/esm/telemetry/mod.js +1 -1
  168. package/esm/trellis.d.ts +62 -30
  169. package/esm/trellis.d.ts.map +1 -1
  170. package/esm/trellis.js +125 -42
  171. package/package.json +14 -2
  172. package/script/auth/mod.d.ts +1 -1
  173. package/script/auth/mod.d.ts.map +1 -1
  174. package/script/auth/mod.js +11 -4
  175. package/script/auth/protocol.d.ts +55 -0
  176. package/script/auth/protocol.d.ts.map +1 -1
  177. package/script/browser.d.ts +3 -3
  178. package/script/browser.d.ts.map +1 -1
  179. package/script/browser.js +3 -2
  180. package/script/client_connect.d.ts +12 -3
  181. package/script/client_connect.d.ts.map +1 -1
  182. package/script/client_connect.js +111 -6
  183. package/script/codec.d.ts +7 -6
  184. package/script/codec.d.ts.map +1 -1
  185. package/script/codec.js +124 -5
  186. package/script/contract_support/canonical.d.ts +3 -0
  187. package/script/contract_support/canonical.d.ts.map +1 -1
  188. package/script/contract_support/canonical.js +3 -0
  189. package/script/contract_support/mod.d.ts +125 -10
  190. package/script/contract_support/mod.d.ts.map +1 -1
  191. package/script/contract_support/mod.js +165 -5
  192. package/script/contract_support/protocol.d.ts +92 -7
  193. package/script/contract_support/protocol.d.ts.map +1 -1
  194. package/script/contract_support/protocol.js +42 -8
  195. package/script/contract_support/runtime.d.ts +4 -1
  196. package/script/contract_support/runtime.d.ts.map +1 -1
  197. package/script/errors/SchemaValidationError.d.ts +49 -0
  198. package/script/errors/SchemaValidationError.d.ts.map +1 -0
  199. package/script/errors/SchemaValidationError.js +74 -0
  200. package/script/errors/index.d.ts +38 -9
  201. package/script/errors/index.d.ts.map +1 -1
  202. package/script/errors/index.js +20 -1
  203. package/script/generated-sdk/auth/api.d.ts +33 -605
  204. package/script/generated-sdk/auth/api.d.ts.map +1 -1
  205. package/script/generated-sdk/auth/api.js +6 -1
  206. package/script/generated-sdk/auth/client.d.ts +129 -134
  207. package/script/generated-sdk/auth/client.d.ts.map +1 -1
  208. package/script/generated-sdk/auth/contract.d.ts +2 -601
  209. package/script/generated-sdk/auth/contract.d.ts.map +1 -1
  210. package/script/generated-sdk/auth/contract.js +310 -93
  211. package/script/generated-sdk/auth/mod.d.ts +1 -1
  212. package/script/generated-sdk/auth/mod.d.ts.map +1 -1
  213. package/script/generated-sdk/auth/owned_api.d.ts +88 -86
  214. package/script/generated-sdk/auth/owned_api.d.ts.map +1 -1
  215. package/script/generated-sdk/auth/owned_api.js +6 -0
  216. package/script/generated-sdk/auth/schemas.d.ts +284 -136
  217. package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
  218. package/script/generated-sdk/auth/schemas.js +231 -92
  219. package/script/generated-sdk/auth/types.d.ts +565 -89
  220. package/script/generated-sdk/auth/types.d.ts.map +1 -1
  221. package/script/generated-sdk/auth/types.js +1 -1
  222. package/script/generated-sdk/health/api.d.ts +29 -18
  223. package/script/generated-sdk/health/api.d.ts.map +1 -1
  224. package/script/generated-sdk/health/client.d.ts +7 -21
  225. package/script/generated-sdk/health/client.d.ts.map +1 -1
  226. package/script/generated-sdk/health/contract.d.ts +2 -15
  227. package/script/generated-sdk/health/contract.d.ts.map +1 -1
  228. package/script/generated-sdk/health/contract.js +2 -10
  229. package/script/generated-sdk/health/mod.d.ts +1 -1
  230. package/script/generated-sdk/health/mod.d.ts.map +1 -1
  231. package/script/generated-sdk/health/owned_api.d.ts +2 -2
  232. package/script/generated-sdk/health/schemas.d.ts +1 -14
  233. package/script/generated-sdk/health/schemas.d.ts.map +1 -1
  234. package/script/generated-sdk/health/schemas.js +1 -9
  235. package/script/generated-sdk/health/types.d.ts +10 -5
  236. package/script/generated-sdk/health/types.d.ts.map +1 -1
  237. package/script/generated-sdk/health/types.js +1 -2
  238. package/script/generated-sdk/jobs/api.d.ts +29 -109
  239. package/script/generated-sdk/jobs/api.d.ts.map +1 -1
  240. package/script/generated-sdk/jobs/client.d.ts +21 -33
  241. package/script/generated-sdk/jobs/client.d.ts.map +1 -1
  242. package/script/generated-sdk/jobs/contract.d.ts +2 -106
  243. package/script/generated-sdk/jobs/contract.d.ts.map +1 -1
  244. package/script/generated-sdk/jobs/contract.js +268 -1
  245. package/script/generated-sdk/jobs/mod.d.ts +1 -1
  246. package/script/generated-sdk/jobs/mod.d.ts.map +1 -1
  247. package/script/generated-sdk/jobs/owned_api.d.ts +22 -9
  248. package/script/generated-sdk/jobs/owned_api.d.ts.map +1 -1
  249. package/script/generated-sdk/jobs/owned_api.js +19 -0
  250. package/script/generated-sdk/jobs/schemas.d.ts +437 -0
  251. package/script/generated-sdk/jobs/schemas.d.ts.map +1 -1
  252. package/script/generated-sdk/jobs/schemas.js +212 -1
  253. package/script/generated-sdk/jobs/types.d.ts +195 -12
  254. package/script/generated-sdk/jobs/types.d.ts.map +1 -1
  255. package/script/generated-sdk/jobs/types.js +1 -1
  256. package/script/generated-sdk/state/api.d.ts +29 -68
  257. package/script/generated-sdk/state/api.d.ts.map +1 -1
  258. package/script/generated-sdk/state/client.d.ts +17 -31
  259. package/script/generated-sdk/state/client.d.ts.map +1 -1
  260. package/script/generated-sdk/state/contract.d.ts +1 -64
  261. package/script/generated-sdk/state/contract.d.ts.map +1 -1
  262. package/script/generated-sdk/state/mod.d.ts +1 -1
  263. package/script/generated-sdk/state/mod.d.ts.map +1 -1
  264. package/script/generated-sdk/state/owned_api.d.ts +7 -7
  265. package/script/generated-sdk/state/types.d.ts +52 -9
  266. package/script/generated-sdk/state/types.d.ts.map +1 -1
  267. package/script/generated-sdk/trellis-core/api.d.ts +33 -45
  268. package/script/generated-sdk/trellis-core/api.d.ts.map +1 -1
  269. package/script/generated-sdk/trellis-core/api.js +6 -1
  270. package/script/generated-sdk/trellis-core/client.d.ts +31 -20
  271. package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
  272. package/script/generated-sdk/trellis-core/contract.d.ts +2 -41
  273. package/script/generated-sdk/trellis-core/contract.d.ts.map +1 -1
  274. package/script/generated-sdk/trellis-core/contract.js +91 -1
  275. package/script/generated-sdk/trellis-core/mod.d.ts +1 -1
  276. package/script/generated-sdk/trellis-core/mod.d.ts.map +1 -1
  277. package/script/generated-sdk/trellis-core/owned_api.d.ts +4 -4
  278. package/script/generated-sdk/trellis-core/schemas.d.ts +113 -0
  279. package/script/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
  280. package/script/generated-sdk/trellis-core/schemas.js +81 -0
  281. package/script/generated-sdk/trellis-core/types.d.ts +54 -7
  282. package/script/generated-sdk/trellis-core/types.d.ts.map +1 -1
  283. package/script/generated-sdk/trellis-core/types.js +1 -1
  284. package/script/health.d.ts +1 -1
  285. package/script/health.d.ts.map +1 -1
  286. package/script/health.js +1 -2
  287. package/script/index.d.ts +4 -4
  288. package/script/index.d.ts.map +1 -1
  289. package/script/index.js +2 -2
  290. package/script/jobs.d.ts +69 -3
  291. package/script/jobs.d.ts.map +1 -1
  292. package/script/jobs.js +93 -3
  293. package/script/server/health.d.ts +2 -6
  294. package/script/server/health.d.ts.map +1 -1
  295. package/script/server/health_schemas.d.ts +0 -8
  296. package/script/server/health_schemas.d.ts.map +1 -1
  297. package/script/server/health_schemas.js +1 -6
  298. package/script/server/internal_jobs/bindings.d.ts +11 -0
  299. package/script/server/internal_jobs/bindings.d.ts.map +1 -1
  300. package/script/server/internal_jobs/job-manager.d.ts +58 -2
  301. package/script/server/internal_jobs/job-manager.d.ts.map +1 -1
  302. package/script/server/internal_jobs/job-manager.js +429 -54
  303. package/script/server/internal_jobs/key-coordinator.d.ts +269 -0
  304. package/script/server/internal_jobs/key-coordinator.d.ts.map +1 -0
  305. package/script/server/internal_jobs/key-coordinator.js +690 -0
  306. package/script/server/internal_jobs/projection.d.ts.map +1 -1
  307. package/script/server/internal_jobs/projection.js +2 -0
  308. package/script/server/internal_jobs/runtime-worker.d.ts +5 -1
  309. package/script/server/internal_jobs/runtime-worker.d.ts.map +1 -1
  310. package/script/server/internal_jobs/runtime-worker.js +14 -2
  311. package/script/server/internal_jobs/types.d.ts +5 -5
  312. package/script/server/internal_jobs/types.d.ts.map +1 -1
  313. package/script/server/internal_jobs/types.js +6 -0
  314. package/script/server/runtime.d.ts.map +1 -1
  315. package/script/server/service.d.ts +81 -112
  316. package/script/server/service.d.ts.map +1 -1
  317. package/script/server/service.js +369 -127
  318. package/script/server.d.ts +3 -3
  319. package/script/server.d.ts.map +1 -1
  320. package/script/service/deno.d.ts +1 -1
  321. package/script/service/deno.d.ts.map +1 -1
  322. package/script/service/drizzle.d.ts +52 -0
  323. package/script/service/drizzle.d.ts.map +1 -0
  324. package/script/service/drizzle.js +113 -0
  325. package/script/service/mod.d.ts +3 -3
  326. package/script/service/mod.d.ts.map +1 -1
  327. package/script/service/mod.js +4 -3
  328. package/script/service/node.d.ts +1 -1
  329. package/script/service/node.d.ts.map +1 -1
  330. package/script/service/outbox_inbox.d.ts +76 -22
  331. package/script/service/outbox_inbox.d.ts.map +1 -1
  332. package/script/service/outbox_inbox.js +233 -70
  333. package/script/telemetry/metrics.d.ts +55 -0
  334. package/script/telemetry/metrics.d.ts.map +1 -1
  335. package/script/telemetry/metrics.js +88 -0
  336. package/script/telemetry/mod.d.ts +2 -1
  337. package/script/telemetry/mod.d.ts.map +1 -1
  338. package/script/telemetry/mod.js +3 -1
  339. package/script/trellis.d.ts +62 -30
  340. package/script/trellis.d.ts.map +1 -1
  341. package/script/trellis.js +124 -41
  342. package/src/auth/mod.ts +7 -0
  343. package/src/browser.ts +5 -7
  344. package/src/client_connect.ts +200 -12
  345. package/src/codec.ts +186 -11
  346. package/src/contract_support/canonical.ts +3 -0
  347. package/src/contract_support/mod.ts +380 -9
  348. package/src/contract_support/protocol.ts +57 -10
  349. package/src/contract_support/runtime.ts +7 -0
  350. package/src/errors/SchemaValidationError.ts +67 -0
  351. package/src/errors/index.ts +28 -0
  352. package/src/health.ts +0 -1
  353. package/src/index.ts +7 -8
  354. package/src/jobs.ts +138 -1
  355. package/src/sdk/_generated/auth/api.ts +38 -7
  356. package/src/sdk/_generated/auth/client.ts +168 -530
  357. package/src/sdk/_generated/auth/contract.ts +310 -93
  358. package/src/sdk/_generated/auth/mod.ts +0 -1
  359. package/src/sdk/_generated/auth/owned_api.ts +92 -86
  360. package/src/sdk/_generated/auth/schemas.ts +231 -92
  361. package/src/sdk/_generated/auth/types.ts +1069 -273
  362. package/src/sdk/_generated/core/api.ts +38 -7
  363. package/src/sdk/_generated/core/client.ts +47 -73
  364. package/src/sdk/_generated/core/contract.ts +91 -1
  365. package/src/sdk/_generated/core/mod.ts +0 -1
  366. package/src/sdk/_generated/core/owned_api.ts +4 -4
  367. package/src/sdk/_generated/core/schemas.ts +81 -0
  368. package/src/sdk/_generated/core/types.ts +79 -15
  369. package/src/sdk/_generated/health/api.ts +29 -5
  370. package/src/sdk/_generated/health/client.ts +11 -58
  371. package/src/sdk/_generated/health/contract.ts +2 -10
  372. package/src/sdk/_generated/health/mod.ts +0 -1
  373. package/src/sdk/_generated/health/owned_api.ts +2 -2
  374. package/src/sdk/_generated/health/schemas.ts +1 -9
  375. package/src/sdk/_generated/health/types.ts +23 -2
  376. package/src/sdk/_generated/jobs/api.ts +29 -5
  377. package/src/sdk/_generated/jobs/client.ts +25 -109
  378. package/src/sdk/_generated/jobs/contract.ts +269 -1
  379. package/src/sdk/_generated/jobs/mod.ts +0 -1
  380. package/src/sdk/_generated/jobs/owned_api.ts +30 -9
  381. package/src/sdk/_generated/jobs/schemas.ts +213 -0
  382. package/src/sdk/_generated/jobs/types.ts +252 -18
  383. package/src/sdk/_generated/state/api.ts +29 -5
  384. package/src/sdk/_generated/state/client.ts +18 -95
  385. package/src/sdk/_generated/state/mod.ts +0 -1
  386. package/src/sdk/_generated/state/owned_api.ts +7 -7
  387. package/src/sdk/_generated/state/types.ts +91 -15
  388. package/src/server/health.ts +2 -6
  389. package/src/server/health_schemas.ts +0 -6
  390. package/src/server/internal_jobs/bindings.ts +11 -0
  391. package/src/server/internal_jobs/job-manager.ts +553 -24
  392. package/src/server/internal_jobs/key-coordinator.ts +1080 -0
  393. package/src/server/internal_jobs/projection.ts +2 -0
  394. package/src/server/internal_jobs/runtime-worker.ts +17 -1
  395. package/src/server/internal_jobs/types.ts +6 -0
  396. package/src/server/runtime.ts +4 -0
  397. package/src/server/service.ts +645 -625
  398. package/src/server.ts +14 -7
  399. package/src/service/deno.ts +0 -5
  400. package/src/service/drizzle.ts +184 -0
  401. package/src/service/mod.ts +17 -7
  402. package/src/service/node.ts +0 -5
  403. package/src/service/outbox_inbox.ts +354 -88
  404. package/src/telemetry/metrics.ts +198 -1
  405. package/src/telemetry/mod.ts +6 -0
  406. package/src/trellis.ts +286 -105
@@ -1,19 +1,35 @@
1
1
  // Generated from ./generated/contracts/manifests/trellis.jobs@v1.json
2
- import type { RpcHandlerFn } from "../../../index.js";
3
- import type { API } from "./api.js";
2
+ import type {
3
+ BaseError,
4
+ HandlerTrellis,
5
+ Result,
6
+ RpcHandlerContext,
7
+ TrellisErrorInstance,
8
+ } from "../../../index.js";
9
+
10
+ import type { Api } from "./api.js";
4
11
 
5
12
  import { type SerializableErrorData, TrellisError } from "../../../index.js";
6
13
 
7
14
  import { NotFoundErrorDataSchema } from "./schemas.js";
8
15
 
16
+ export type HandlerClient = HandlerTrellis<Api>;
17
+
9
18
  export const CONTRACT_ID = "trellis.jobs@v1" as const;
10
19
  export const CONTRACT_DIGEST =
11
- "jSB8nKGOQqIxdFDdUqO-gOTt3Dijg--SOXJtJ1ChpoY" as const;
20
+ "xDigtrlrF3n3ZNgHVdwDJFcwi0PEJBiDyBG6FnzFzM8" as const;
12
21
 
13
22
  export type JobsCancelInput = { id: string };
14
23
  export type JobsCancelOutput = {
15
24
  job: {
16
25
  completedAt?: string;
26
+ concurrency?: {
27
+ heartbeatAt?: string;
28
+ key: string;
29
+ keyHash: string;
30
+ leaseExpiresAt?: string;
31
+ staleTakeoverCount?: number;
32
+ };
17
33
  context: {
18
34
  requestId: string;
19
35
  traceId: string;
@@ -35,6 +51,12 @@ export type JobsCancelOutput = {
35
51
  step?: string;
36
52
  total?: number;
37
53
  };
54
+ queuePolicy?: {
55
+ existingJobId?: string;
56
+ outcome: string;
57
+ reason?: string;
58
+ replacedJobId?: string;
59
+ };
38
60
  result?: unknown;
39
61
  service: string;
40
62
  startedAt?: string;
@@ -58,6 +80,13 @@ export type JobsDismissDLQInput = { id: string };
58
80
  export type JobsDismissDLQOutput = {
59
81
  job: {
60
82
  completedAt?: string;
83
+ concurrency?: {
84
+ heartbeatAt?: string;
85
+ key: string;
86
+ keyHash: string;
87
+ leaseExpiresAt?: string;
88
+ staleTakeoverCount?: number;
89
+ };
61
90
  context: {
62
91
  requestId: string;
63
92
  traceId: string;
@@ -79,6 +108,12 @@ export type JobsDismissDLQOutput = {
79
108
  step?: string;
80
109
  total?: number;
81
110
  };
111
+ queuePolicy?: {
112
+ existingJobId?: string;
113
+ outcome: string;
114
+ reason?: string;
115
+ replacedJobId?: string;
116
+ };
82
117
  result?: unknown;
83
118
  service: string;
84
119
  startedAt?: string;
@@ -102,6 +137,13 @@ export type JobsGetInput = { id: string };
102
137
  export type JobsGetOutput = {
103
138
  job: {
104
139
  completedAt?: string;
140
+ concurrency?: {
141
+ heartbeatAt?: string;
142
+ key: string;
143
+ keyHash: string;
144
+ leaseExpiresAt?: string;
145
+ staleTakeoverCount?: number;
146
+ };
105
147
  context: {
106
148
  requestId: string;
107
149
  traceId: string;
@@ -123,6 +165,12 @@ export type JobsGetOutput = {
123
165
  step?: string;
124
166
  total?: number;
125
167
  };
168
+ queuePolicy?: {
169
+ existingJobId?: string;
170
+ outcome: string;
171
+ reason?: string;
172
+ replacedJobId?: string;
173
+ };
126
174
  result?: unknown;
127
175
  service: string;
128
176
  startedAt?: string;
@@ -142,6 +190,28 @@ export type JobsGetOutput = {
142
190
  };
143
191
  };
144
192
 
193
+ export type JobsGetKeyInput = { key: string; service: string; type: string };
194
+ export type JobsGetKeyOutput = {
195
+ active: Array<
196
+ {
197
+ heartbeatAgeMs: number;
198
+ heartbeatAt: string;
199
+ instanceId: string;
200
+ jobId: string;
201
+ leaseExpiresAt: string;
202
+ startedAt: string;
203
+ }
204
+ >;
205
+ key: string;
206
+ keyHash: string;
207
+ latestPolicyReason?: string;
208
+ queued: Array<{ createdAt: string; jobId: string }>;
209
+ queuedDepth: number;
210
+ service: string;
211
+ staleTakeoverCount: number;
212
+ type: string;
213
+ };
214
+
145
215
  export type JobsHealthInput = {};
146
216
  export type JobsHealthOutput = {
147
217
  checks: Array<{ [k: string]: unknown }>;
@@ -175,6 +245,13 @@ export type JobsListOutput = {
175
245
  entries: Array<
176
246
  {
177
247
  completedAt?: string;
248
+ concurrency?: {
249
+ heartbeatAt?: string;
250
+ key: string;
251
+ keyHash: string;
252
+ leaseExpiresAt?: string;
253
+ staleTakeoverCount?: number;
254
+ };
178
255
  context: {
179
256
  requestId: string;
180
257
  traceId: string;
@@ -196,6 +273,12 @@ export type JobsListOutput = {
196
273
  step?: string;
197
274
  total?: number;
198
275
  };
276
+ queuePolicy?: {
277
+ existingJobId?: string;
278
+ outcome: string;
279
+ reason?: string;
280
+ replacedJobId?: string;
281
+ };
199
282
  result?: unknown;
200
283
  service: string;
201
284
  startedAt?: string;
@@ -231,6 +314,13 @@ export type JobsListDLQOutput = {
231
314
  entries: Array<
232
315
  {
233
316
  completedAt?: string;
317
+ concurrency?: {
318
+ heartbeatAt?: string;
319
+ key: string;
320
+ keyHash: string;
321
+ leaseExpiresAt?: string;
322
+ staleTakeoverCount?: number;
323
+ };
234
324
  context: {
235
325
  requestId: string;
236
326
  traceId: string;
@@ -252,6 +342,12 @@ export type JobsListDLQOutput = {
252
342
  step?: string;
253
343
  total?: number;
254
344
  };
345
+ queuePolicy?: {
346
+ existingJobId?: string;
347
+ outcome: string;
348
+ reason?: string;
349
+ replacedJobId?: string;
350
+ };
255
351
  result?: unknown;
256
352
  service: string;
257
353
  startedAt?: string;
@@ -303,6 +399,13 @@ export type JobsReplayDLQInput = { id: string };
303
399
  export type JobsReplayDLQOutput = {
304
400
  job: {
305
401
  completedAt?: string;
402
+ concurrency?: {
403
+ heartbeatAt?: string;
404
+ key: string;
405
+ keyHash: string;
406
+ leaseExpiresAt?: string;
407
+ staleTakeoverCount?: number;
408
+ };
306
409
  context: {
307
410
  requestId: string;
308
411
  traceId: string;
@@ -324,6 +427,12 @@ export type JobsReplayDLQOutput = {
324
427
  step?: string;
325
428
  total?: number;
326
429
  };
430
+ queuePolicy?: {
431
+ existingJobId?: string;
432
+ outcome: string;
433
+ reason?: string;
434
+ replacedJobId?: string;
435
+ };
327
436
  result?: unknown;
328
437
  service: string;
329
438
  startedAt?: string;
@@ -347,6 +456,13 @@ export type JobsRetryInput = { id: string };
347
456
  export type JobsRetryOutput = {
348
457
  job: {
349
458
  completedAt?: string;
459
+ concurrency?: {
460
+ heartbeatAt?: string;
461
+ key: string;
462
+ keyHash: string;
463
+ leaseExpiresAt?: string;
464
+ staleTakeoverCount?: number;
465
+ };
350
466
  context: {
351
467
  requestId: string;
352
468
  traceId: string;
@@ -368,6 +484,12 @@ export type JobsRetryOutput = {
368
484
  step?: string;
369
485
  total?: number;
370
486
  };
487
+ queuePolicy?: {
488
+ existingJobId?: string;
489
+ outcome: string;
490
+ reason?: string;
491
+ replacedJobId?: string;
492
+ };
371
493
  result?: unknown;
372
494
  service: string;
373
495
  startedAt?: string;
@@ -425,6 +547,7 @@ export interface RpcMap {
425
547
  output: JobsDismissDLQOutput;
426
548
  };
427
549
  "Jobs.Get": { input: JobsGetInput; output: JobsGetOutput };
550
+ "Jobs.GetKey": { input: JobsGetKeyInput; output: JobsGetKeyOutput };
428
551
  "Jobs.Health": { input: JobsHealthInput; output: JobsHealthOutput };
429
552
  "Jobs.List": { input: JobsListInput; output: JobsListOutput };
430
553
  "Jobs.ListDLQ": { input: JobsListDLQInput; output: JobsListDLQOutput };
@@ -436,24 +559,135 @@ export interface RpcMap {
436
559
  "Jobs.Retry": { input: JobsRetryInput; output: JobsRetryOutput };
437
560
  }
438
561
 
439
- export type JobsCancelHandler = RpcHandlerFn<typeof API.owned, "Jobs.Cancel">;
440
- export type JobsDismissDLQHandler = RpcHandlerFn<
441
- typeof API.owned,
442
- "Jobs.DismissDLQ"
562
+ export type JobsCancelHandlerError =
563
+ | TrellisErrorInstance
564
+ | BaseError<NotFoundErrorData>;
565
+ export type JobsCancelHandlerResult = Result<
566
+ JobsCancelOutput,
567
+ JobsCancelHandlerError
568
+ >;
569
+ export type JobsCancelHandler = (
570
+ args: {
571
+ input: JobsCancelInput;
572
+ context: RpcHandlerContext;
573
+ client: HandlerClient;
574
+ },
575
+ ) => JobsCancelHandlerResult | Promise<JobsCancelHandlerResult>;
576
+ export type JobsDismissDLQHandlerError =
577
+ | TrellisErrorInstance
578
+ | BaseError<NotFoundErrorData>;
579
+ export type JobsDismissDLQHandlerResult = Result<
580
+ JobsDismissDLQOutput,
581
+ JobsDismissDLQHandlerError
443
582
  >;
444
- export type JobsGetHandler = RpcHandlerFn<typeof API.owned, "Jobs.Get">;
445
- export type JobsHealthHandler = RpcHandlerFn<typeof API.owned, "Jobs.Health">;
446
- export type JobsListHandler = RpcHandlerFn<typeof API.owned, "Jobs.List">;
447
- export type JobsListDLQHandler = RpcHandlerFn<typeof API.owned, "Jobs.ListDLQ">;
448
- export type JobsListServicesHandler = RpcHandlerFn<
449
- typeof API.owned,
450
- "Jobs.ListServices"
583
+ export type JobsDismissDLQHandler = (
584
+ args: {
585
+ input: JobsDismissDLQInput;
586
+ context: RpcHandlerContext;
587
+ client: HandlerClient;
588
+ },
589
+ ) => JobsDismissDLQHandlerResult | Promise<JobsDismissDLQHandlerResult>;
590
+ export type JobsGetHandlerError =
591
+ | TrellisErrorInstance
592
+ | BaseError<NotFoundErrorData>;
593
+ export type JobsGetHandlerResult = Result<JobsGetOutput, JobsGetHandlerError>;
594
+ export type JobsGetHandler = (
595
+ args: {
596
+ input: JobsGetInput;
597
+ context: RpcHandlerContext;
598
+ client: HandlerClient;
599
+ },
600
+ ) => JobsGetHandlerResult | Promise<JobsGetHandlerResult>;
601
+ export type JobsGetKeyHandlerError =
602
+ | TrellisErrorInstance
603
+ | BaseError<NotFoundErrorData>;
604
+ export type JobsGetKeyHandlerResult = Result<
605
+ JobsGetKeyOutput,
606
+ JobsGetKeyHandlerError
607
+ >;
608
+ export type JobsGetKeyHandler = (
609
+ args: {
610
+ input: JobsGetKeyInput;
611
+ context: RpcHandlerContext;
612
+ client: HandlerClient;
613
+ },
614
+ ) => JobsGetKeyHandlerResult | Promise<JobsGetKeyHandlerResult>;
615
+ export type JobsHealthHandlerError = TrellisErrorInstance;
616
+ export type JobsHealthHandlerResult = Result<
617
+ JobsHealthOutput,
618
+ JobsHealthHandlerError
619
+ >;
620
+ export type JobsHealthHandler = (
621
+ args: {
622
+ input: JobsHealthInput;
623
+ context: RpcHandlerContext;
624
+ client: HandlerClient;
625
+ },
626
+ ) => JobsHealthHandlerResult | Promise<JobsHealthHandlerResult>;
627
+ export type JobsListHandlerError = TrellisErrorInstance;
628
+ export type JobsListHandlerResult = Result<
629
+ JobsListOutput,
630
+ JobsListHandlerError
631
+ >;
632
+ export type JobsListHandler = (
633
+ args: {
634
+ input: JobsListInput;
635
+ context: RpcHandlerContext;
636
+ client: HandlerClient;
637
+ },
638
+ ) => JobsListHandlerResult | Promise<JobsListHandlerResult>;
639
+ export type JobsListDLQHandlerError = TrellisErrorInstance;
640
+ export type JobsListDLQHandlerResult = Result<
641
+ JobsListDLQOutput,
642
+ JobsListDLQHandlerError
643
+ >;
644
+ export type JobsListDLQHandler = (
645
+ args: {
646
+ input: JobsListDLQInput;
647
+ context: RpcHandlerContext;
648
+ client: HandlerClient;
649
+ },
650
+ ) => JobsListDLQHandlerResult | Promise<JobsListDLQHandlerResult>;
651
+ export type JobsListServicesHandlerError = TrellisErrorInstance;
652
+ export type JobsListServicesHandlerResult = Result<
653
+ JobsListServicesOutput,
654
+ JobsListServicesHandlerError
655
+ >;
656
+ export type JobsListServicesHandler = (
657
+ args: {
658
+ input: JobsListServicesInput;
659
+ context: RpcHandlerContext;
660
+ client: HandlerClient;
661
+ },
662
+ ) => JobsListServicesHandlerResult | Promise<JobsListServicesHandlerResult>;
663
+ export type JobsReplayDLQHandlerError =
664
+ | TrellisErrorInstance
665
+ | BaseError<NotFoundErrorData>;
666
+ export type JobsReplayDLQHandlerResult = Result<
667
+ JobsReplayDLQOutput,
668
+ JobsReplayDLQHandlerError
451
669
  >;
452
- export type JobsReplayDLQHandler = RpcHandlerFn<
453
- typeof API.owned,
454
- "Jobs.ReplayDLQ"
670
+ export type JobsReplayDLQHandler = (
671
+ args: {
672
+ input: JobsReplayDLQInput;
673
+ context: RpcHandlerContext;
674
+ client: HandlerClient;
675
+ },
676
+ ) => JobsReplayDLQHandlerResult | Promise<JobsReplayDLQHandlerResult>;
677
+ export type JobsRetryHandlerError =
678
+ | TrellisErrorInstance
679
+ | BaseError<NotFoundErrorData>;
680
+ export type JobsRetryHandlerResult = Result<
681
+ JobsRetryOutput,
682
+ JobsRetryHandlerError
455
683
  >;
456
- export type JobsRetryHandler = RpcHandlerFn<typeof API.owned, "Jobs.Retry">;
684
+ export type JobsRetryHandler = (
685
+ args: {
686
+ input: JobsRetryInput;
687
+ context: RpcHandlerContext;
688
+ client: HandlerClient;
689
+ },
690
+ ) => JobsRetryHandlerResult | Promise<JobsRetryHandlerResult>;
457
691
 
458
692
  export interface EventMap {
459
693
  }
@@ -4,6 +4,25 @@ import { OWNED_API as HealthApi } from "../health/mod.js";
4
4
 
5
5
  export { OWNED_API };
6
6
 
7
+ type __TrellisGeneratedOptionalOperationProgress<TDesc> = TDesc extends
8
+ { progress: infer TProgress } ? { progress?: TProgress }
9
+ : { progress?: undefined };
10
+ type __TrellisGeneratedOptionalOperationOutput<TDesc> = TDesc extends
11
+ { output: infer TOutput } ? { output?: TOutput }
12
+ : { output?: undefined };
13
+ type __TrellisGeneratedOptionalOperationIO<TDesc> = TDesc extends
14
+ { input: infer TInput } ?
15
+ & Omit<TDesc, "input" | "progress" | "output">
16
+ & {
17
+ input: TInput;
18
+ }
19
+ & __TrellisGeneratedOptionalOperationProgress<TDesc>
20
+ & __TrellisGeneratedOptionalOperationOutput<TDesc>
21
+ : TDesc;
22
+ type __TrellisGeneratedOperationApi<TApi> = {
23
+ readonly [K in keyof TApi]: __TrellisGeneratedOptionalOperationIO<TApi[K]>;
24
+ };
25
+
7
26
  export type UsedApi = {
8
27
  rpc: {};
9
28
  operations: {};
@@ -26,7 +45,9 @@ export const USED_API: UsedApi = {
26
45
  subjects: {},
27
46
  };
28
47
 
29
- export type OwnedApi = typeof OWNED_API;
48
+ export type OwnedApi = Omit<typeof OWNED_API, "operations"> & {
49
+ operations: __TrellisGeneratedOperationApi<typeof OWNED_API["operations"]>;
50
+ };
30
51
  export type Api = {
31
52
  rpc: OwnedApi["rpc"] & UsedApi["rpc"];
32
53
  operations: OwnedApi["operations"] & UsedApi["operations"];
@@ -35,9 +56,12 @@ export type Api = {
35
56
  subjects: OwnedApi["subjects"] & UsedApi["subjects"];
36
57
  };
37
58
 
38
- export const API = {
59
+ export type ApiViews = {
60
+ owned: OwnedApi;
61
+ used: UsedApi;
62
+ };
63
+
64
+ export const API: ApiViews = {
39
65
  owned: OWNED_API,
40
66
  used: USED_API,
41
- } as const;
42
-
43
- export type ApiViews = typeof API;
67
+ };
@@ -15,13 +15,11 @@ import type {
15
15
  OperationRef,
16
16
  OperationRefData,
17
17
  OperationRuntimeHandle,
18
- OperationTransferHandle,
19
18
  PreparedTrellisEvent,
20
19
  ReceiveTransferGrant,
21
20
  ReceiveTransferHandle,
22
21
  RequestOpts,
23
22
  Result,
24
- RpcHandlerContext,
25
23
  SendTransferGrant,
26
24
  SendTransferHandle,
27
25
  TerminalOperation,
@@ -35,8 +33,6 @@ import type { API, Api } from "./api.js";
35
33
  import type * as Types from "./types.js";
36
34
  import type * as HealthSdk from "../health/mod.js";
37
35
 
38
- type WithDeps<TDeps> = [TDeps] extends [undefined] ? {} : { deps: TDeps };
39
-
40
36
  type EventCallback<TMessage> = {
41
37
  bivarianceHack(
42
38
  message: TMessage,
@@ -44,46 +40,10 @@ type EventCallback<TMessage> = {
44
40
  ): MaybeAsync<void, BaseError>;
45
41
  }["bivarianceHack"];
46
42
 
47
- type ServiceEventHandler<TEvent, TDeps = undefined> = (
48
- args:
49
- & { event: TEvent; context: EventListenerContext; client: HandlerClient }
50
- & WithDeps<TDeps>,
43
+ type DependencyServiceEventHandler<TEvent> = (
44
+ args: { event: TEvent; context: EventListenerContext; client: HandlerClient },
51
45
  ) => MaybeAsync<void, BaseError>;
52
46
 
53
- type RpcHandler<TInput, TOutput, TDeps = undefined> = (
54
- args:
55
- & { input: TInput; context: RpcHandlerContext; client: HandlerClient }
56
- & WithDeps<TDeps>,
57
- ) => MaybeAsync<TOutput, BaseError>;
58
-
59
- type FeedHandler<TInput, TEvent, TDeps = undefined> = (
60
- context: {
61
- input: TInput;
62
- caller: unknown;
63
- signal: AbortSignal;
64
- emit(event: TEvent): AsyncResult<void, ValidationError | UnexpectedError>;
65
- client: HandlerClient;
66
- } & WithDeps<TDeps>,
67
- ) => unknown | Promise<unknown>;
68
-
69
- type OperationHandler<
70
- TInput,
71
- TProgress,
72
- TOutput,
73
- TTransfer,
74
- TDeps = undefined,
75
- > = (
76
- context:
77
- & {
78
- input: TInput;
79
- op: OperationRuntimeHandle<TProgress, TOutput>;
80
- caller: unknown;
81
- client: HandlerClient;
82
- }
83
- & TTransfer
84
- & WithDeps<TDeps>,
85
- ) => unknown | Promise<unknown>;
86
-
87
47
  export type TrellisStateState = {};
88
48
 
89
49
  export interface TrellisStateClient {
@@ -131,12 +91,12 @@ export interface TrellisStateClient {
131
91
  readonly health: {
132
92
  heartbeat: {
133
93
  publish(
134
- event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
94
+ event: HealthSdk.HealthHeartbeatEvent,
135
95
  ): AsyncResult<void, ValidationError | UnexpectedError>;
136
96
  prepare(
137
- event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
97
+ event: HealthSdk.HealthHeartbeatEvent,
138
98
  ): Result<
139
- PreparedTrellisEvent<Omit<HealthSdk.HealthHeartbeatEvent, "header">>,
99
+ PreparedTrellisEvent<HealthSdk.HealthHeartbeatEvent>,
140
100
  ValidationError | UnexpectedError
141
101
  >;
142
102
  listen(
@@ -154,29 +114,22 @@ export interface TrellisStateClient {
154
114
 
155
115
  export interface Service extends TrellisStateClient {
156
116
  readonly handle: ServiceHandle;
157
- with<TDeps>(deps: TDeps): ServiceWithDeps<TDeps>;
158
117
  }
159
118
 
160
- export type ServiceWithDeps<TDeps> = Omit<TrellisStateClient, "event"> & {
161
- readonly event: ServiceEventSurface<TDeps>;
162
- readonly handle: ServiceHandle<TDeps>;
163
- with<TNextDeps>(deps: TNextDeps): ServiceWithDeps<TNextDeps>;
164
- };
165
-
166
- export interface ServiceEventSurface<TDeps> {
119
+ export interface ServiceEventSurface {
167
120
  readonly health: {
168
121
  heartbeat: {
169
122
  publish(
170
- event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
123
+ event: HealthSdk.HealthHeartbeatEvent,
171
124
  ): AsyncResult<void, ValidationError | UnexpectedError>;
172
125
  prepare(
173
- event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
126
+ event: HealthSdk.HealthHeartbeatEvent,
174
127
  ): Result<
175
- PreparedTrellisEvent<Omit<HealthSdk.HealthHeartbeatEvent, "header">>,
128
+ PreparedTrellisEvent<HealthSdk.HealthHeartbeatEvent>,
176
129
  ValidationError | UnexpectedError
177
130
  >;
178
131
  listen(
179
- handler: ServiceEventHandler<HealthSdk.HealthHeartbeatEvent, TDeps>,
132
+ handler: DependencyServiceEventHandler<HealthSdk.HealthHeartbeatEvent>,
180
133
  subjectData?: Record<string, unknown>,
181
134
  opts?: EventOpts,
182
135
  ): AsyncResult<void, ValidationError | UnexpectedError>;
@@ -184,46 +137,16 @@ export interface ServiceEventSurface<TDeps> {
184
137
  };
185
138
  }
186
139
 
187
- export interface ServiceHandle<TDeps = undefined> {
140
+ export interface ServiceHandle {
188
141
  readonly rpc: {
189
142
  readonly state: {
190
- adminDelete(
191
- handler: RpcHandler<
192
- Types.StateAdminDeleteInput,
193
- Types.StateAdminDeleteOutput,
194
- TDeps
195
- >,
196
- ): Promise<void>;
197
- adminGet(
198
- handler: RpcHandler<
199
- Types.StateAdminGetInput,
200
- Types.StateAdminGetOutput,
201
- TDeps
202
- >,
203
- ): Promise<void>;
204
- adminList(
205
- handler: RpcHandler<
206
- Types.StateAdminListInput,
207
- Types.StateAdminListOutput,
208
- TDeps
209
- >,
210
- ): Promise<void>;
211
- delete(
212
- handler: RpcHandler<
213
- Types.StateDeleteInput,
214
- Types.StateDeleteOutput,
215
- TDeps
216
- >,
217
- ): Promise<void>;
218
- get(
219
- handler: RpcHandler<Types.StateGetInput, Types.StateGetOutput, TDeps>,
220
- ): Promise<void>;
221
- list(
222
- handler: RpcHandler<Types.StateListInput, Types.StateListOutput, TDeps>,
223
- ): Promise<void>;
224
- put(
225
- handler: RpcHandler<Types.StatePutInput, Types.StatePutOutput, TDeps>,
226
- ): Promise<void>;
143
+ adminDelete(handler: Types.StateAdminDeleteHandler): Promise<void>;
144
+ adminGet(handler: Types.StateAdminGetHandler): Promise<void>;
145
+ adminList(handler: Types.StateAdminListHandler): Promise<void>;
146
+ delete(handler: Types.StateDeleteHandler): Promise<void>;
147
+ get(handler: Types.StateGetHandler): Promise<void>;
148
+ list(handler: Types.StateListHandler): Promise<void>;
149
+ put(handler: Types.StatePutHandler): Promise<void>;
227
150
  };
228
151
  };
229
152
  readonly feed: {};
@@ -8,7 +8,6 @@ export type {
8
8
  Service,
9
9
  ServiceEventSurface,
10
10
  ServiceHandle,
11
- ServiceWithDeps,
12
11
  TrellisStateClient,
13
12
  TrellisStateState,
14
13
  } from "./client.js";
@@ -27,7 +27,7 @@ export const OWNED_API = {
27
27
  output: schema<Types.StateAdminDeleteOutput>(
28
28
  StateAdminDeleteResponseSchema,
29
29
  ),
30
- callerCapabilities: ["admin"],
30
+ callerCapabilities: ["admin"] as const,
31
31
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
32
32
  declaredErrorTypes: [
33
33
  "AuthError",
@@ -39,7 +39,7 @@ export const OWNED_API = {
39
39
  subject: "rpc.v1.State.Admin.Get",
40
40
  input: schema<Types.StateAdminGetInput>(StateAdminGetRequestSchema),
41
41
  output: schema<Types.StateAdminGetOutput>(StateAdminGetResponseSchema),
42
- callerCapabilities: ["admin"],
42
+ callerCapabilities: ["admin"] as const,
43
43
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
44
44
  declaredErrorTypes: [
45
45
  "AuthError",
@@ -51,7 +51,7 @@ export const OWNED_API = {
51
51
  subject: "rpc.v1.State.Admin.List",
52
52
  input: schema<Types.StateAdminListInput>(StateAdminListRequestSchema),
53
53
  output: schema<Types.StateAdminListOutput>(StateAdminListResponseSchema),
54
- callerCapabilities: ["admin"],
54
+ callerCapabilities: ["admin"] as const,
55
55
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
56
56
  declaredErrorTypes: [
57
57
  "AuthError",
@@ -63,7 +63,7 @@ export const OWNED_API = {
63
63
  subject: "rpc.v1.State.Delete",
64
64
  input: schema<Types.StateDeleteInput>(StateDeleteRequestSchema),
65
65
  output: schema<Types.StateDeleteOutput>(StateDeleteResponseSchema),
66
- callerCapabilities: [],
66
+ callerCapabilities: [] as const,
67
67
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
68
68
  declaredErrorTypes: [
69
69
  "AuthError",
@@ -75,7 +75,7 @@ export const OWNED_API = {
75
75
  subject: "rpc.v1.State.Get",
76
76
  input: schema<Types.StateGetInput>(StateGetRequestSchema),
77
77
  output: schema<Types.StateGetOutput>(StateGetResponseSchema),
78
- callerCapabilities: [],
78
+ callerCapabilities: [] as const,
79
79
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
80
80
  declaredErrorTypes: [
81
81
  "AuthError",
@@ -87,7 +87,7 @@ export const OWNED_API = {
87
87
  subject: "rpc.v1.State.List",
88
88
  input: schema<Types.StateListInput>(StateListRequestSchema),
89
89
  output: schema<Types.StateListOutput>(StateListResponseSchema),
90
- callerCapabilities: [],
90
+ callerCapabilities: [] as const,
91
91
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
92
92
  declaredErrorTypes: [
93
93
  "AuthError",
@@ -99,7 +99,7 @@ export const OWNED_API = {
99
99
  subject: "rpc.v1.State.Put",
100
100
  input: schema<Types.StatePutInput>(StatePutRequestSchema),
101
101
  output: schema<Types.StatePutOutput>(StatePutResponseSchema),
102
- callerCapabilities: [],
102
+ callerCapabilities: [] as const,
103
103
  errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
104
104
  declaredErrorTypes: [
105
105
  "AuthError",