@astrale-os/sdk 0.4.19 → 0.5.0-beta.2

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 (1048) hide show
  1. package/README.md +5 -3
  2. package/dist/auth/exchange.d.ts +11 -0
  3. package/dist/auth/exchange.d.ts.map +1 -0
  4. package/dist/auth/exchange.js +8 -0
  5. package/dist/auth/exchange.js.map +1 -0
  6. package/dist/auth/index.d.ts +4 -15
  7. package/dist/auth/index.d.ts.map +1 -1
  8. package/dist/auth/index.js +3 -10
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/capability/client.d.ts +25 -0
  11. package/dist/capability/client.d.ts.map +1 -0
  12. package/dist/capability/client.js +147 -0
  13. package/dist/capability/client.js.map +1 -0
  14. package/dist/capability/contract.d.ts +70 -0
  15. package/dist/capability/contract.d.ts.map +1 -0
  16. package/dist/capability/contract.js +3 -0
  17. package/dist/capability/contract.js.map +1 -0
  18. package/dist/capability/define.d.ts +14 -0
  19. package/dist/capability/define.d.ts.map +1 -0
  20. package/dist/capability/define.js +145 -0
  21. package/dist/capability/define.js.map +1 -0
  22. package/dist/capability/index.d.ts +3 -0
  23. package/dist/capability/index.d.ts.map +1 -0
  24. package/dist/capability/index.js +2 -0
  25. package/dist/capability/index.js.map +1 -0
  26. package/dist/cli/arguments.d.ts +21 -0
  27. package/dist/cli/arguments.d.ts.map +1 -0
  28. package/dist/cli/arguments.js +220 -0
  29. package/dist/cli/arguments.js.map +1 -0
  30. package/dist/cli/dotenv.d.ts +1 -4
  31. package/dist/cli/dotenv.d.ts.map +1 -1
  32. package/dist/cli/dotenv.js +6 -15
  33. package/dist/cli/dotenv.js.map +1 -1
  34. package/dist/cli/index.d.ts +4 -5
  35. package/dist/cli/index.d.ts.map +1 -1
  36. package/dist/cli/index.js +4 -5
  37. package/dist/cli/index.js.map +1 -1
  38. package/dist/cli/run.d.ts +4 -79
  39. package/dist/cli/run.d.ts.map +1 -1
  40. package/dist/cli/run.js +47 -326
  41. package/dist/cli/run.js.map +1 -1
  42. package/dist/deployment/artifact/bindings.d.ts +7 -0
  43. package/dist/deployment/artifact/bindings.d.ts.map +1 -0
  44. package/dist/deployment/artifact/bindings.js +44 -0
  45. package/dist/deployment/artifact/bindings.js.map +1 -0
  46. package/dist/deployment/artifact/deployment.d.ts +35 -0
  47. package/dist/deployment/artifact/deployment.d.ts.map +1 -0
  48. package/dist/deployment/artifact/deployment.js +91 -0
  49. package/dist/deployment/artifact/deployment.js.map +1 -0
  50. package/dist/deployment/artifact/index.d.ts +5 -0
  51. package/dist/deployment/artifact/index.d.ts.map +1 -0
  52. package/dist/deployment/artifact/index.js +4 -0
  53. package/dist/deployment/artifact/index.js.map +1 -0
  54. package/dist/deployment/check/check.d.ts +8 -0
  55. package/dist/deployment/check/check.d.ts.map +1 -0
  56. package/dist/deployment/check/check.js +94 -0
  57. package/dist/deployment/check/check.js.map +1 -0
  58. package/dist/deployment/check/contract.d.ts +29 -0
  59. package/dist/deployment/check/contract.d.ts.map +1 -0
  60. package/dist/deployment/check/contract.js +2 -0
  61. package/dist/deployment/check/contract.js.map +1 -0
  62. package/dist/deployment/check/index.d.ts +3 -0
  63. package/dist/deployment/check/index.d.ts.map +1 -0
  64. package/dist/deployment/check/index.js +2 -0
  65. package/dist/deployment/check/index.js.map +1 -0
  66. package/dist/deployment/index.d.ts +7 -0
  67. package/dist/deployment/index.d.ts.map +1 -0
  68. package/dist/deployment/index.js +4 -0
  69. package/dist/deployment/index.js.map +1 -0
  70. package/dist/deployment/provider/adapter.d.ts +56 -0
  71. package/dist/deployment/provider/adapter.d.ts.map +1 -0
  72. package/dist/deployment/provider/adapter.js +84 -0
  73. package/dist/deployment/provider/adapter.js.map +1 -0
  74. package/dist/deployment/provider/config.d.ts +10 -0
  75. package/dist/deployment/provider/config.d.ts.map +1 -0
  76. package/dist/deployment/provider/config.js +8 -0
  77. package/dist/deployment/provider/config.js.map +1 -0
  78. package/dist/deployment/provider/index.d.ts +5 -0
  79. package/dist/deployment/provider/index.d.ts.map +1 -0
  80. package/dist/deployment/provider/index.js +3 -0
  81. package/dist/deployment/provider/index.js.map +1 -0
  82. package/dist/domain/app.d.ts +34 -0
  83. package/dist/domain/app.d.ts.map +1 -0
  84. package/dist/domain/app.js +2 -0
  85. package/dist/domain/app.js.map +1 -0
  86. package/dist/domain/context.d.ts +68 -0
  87. package/dist/domain/context.d.ts.map +1 -0
  88. package/dist/domain/context.js +2 -0
  89. package/dist/domain/context.js.map +1 -0
  90. package/dist/domain/define.d.ts +99 -65
  91. package/dist/domain/define.d.ts.map +1 -1
  92. package/dist/domain/define.js +78 -60
  93. package/dist/domain/define.js.map +1 -1
  94. package/dist/domain/handlers.d.ts +53 -0
  95. package/dist/domain/handlers.d.ts.map +1 -0
  96. package/dist/domain/handlers.js +88 -0
  97. package/dist/domain/handlers.js.map +1 -0
  98. package/dist/domain/implement.d.ts +5 -0
  99. package/dist/domain/implement.d.ts.map +1 -0
  100. package/dist/domain/implement.js +23 -0
  101. package/dist/domain/implement.js.map +1 -0
  102. package/dist/domain/index.d.ts +13 -4
  103. package/dist/domain/index.d.ts.map +1 -1
  104. package/dist/domain/index.js +7 -3
  105. package/dist/domain/index.js.map +1 -1
  106. package/dist/domain/requirements.d.ts +26 -0
  107. package/dist/domain/requirements.d.ts.map +1 -0
  108. package/dist/domain/requirements.js +98 -0
  109. package/dist/domain/requirements.js.map +1 -0
  110. package/dist/graph/class/index.d.ts +3 -0
  111. package/dist/graph/class/index.d.ts.map +1 -0
  112. package/dist/graph/class/index.js +3 -0
  113. package/dist/graph/class/index.js.map +1 -0
  114. package/dist/graph/edge/index.d.ts +3 -0
  115. package/dist/graph/edge/index.d.ts.map +1 -0
  116. package/dist/graph/edge/index.js +3 -0
  117. package/dist/graph/edge/index.js.map +1 -0
  118. package/dist/graph/index.d.ts +10 -0
  119. package/dist/graph/index.d.ts.map +1 -0
  120. package/dist/graph/index.js +9 -0
  121. package/dist/graph/index.js.map +1 -0
  122. package/dist/graph/model/index.d.ts +3 -0
  123. package/dist/graph/model/index.d.ts.map +1 -0
  124. package/dist/graph/model/index.js +3 -0
  125. package/dist/graph/model/index.js.map +1 -0
  126. package/dist/graph/node/index.d.ts +3 -0
  127. package/dist/graph/node/index.d.ts.map +1 -0
  128. package/dist/graph/node/index.js +3 -0
  129. package/dist/graph/node/index.js.map +1 -0
  130. package/dist/graph/path/index.d.ts +3 -0
  131. package/dist/graph/path/index.d.ts.map +1 -0
  132. package/dist/graph/path/index.js +3 -0
  133. package/dist/graph/path/index.js.map +1 -0
  134. package/dist/graph/properties/index.d.ts +3 -0
  135. package/dist/graph/properties/index.d.ts.map +1 -0
  136. package/dist/graph/properties/index.js +3 -0
  137. package/dist/graph/properties/index.js.map +1 -0
  138. package/dist/index.d.ts +20 -27
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +10 -47
  141. package/dist/index.js.map +1 -1
  142. package/dist/invocation/handler.d.ts +51 -0
  143. package/dist/invocation/handler.d.ts.map +1 -0
  144. package/dist/invocation/handler.js +289 -0
  145. package/dist/invocation/handler.js.map +1 -0
  146. package/dist/invocation/index.d.ts +3 -0
  147. package/dist/invocation/index.d.ts.map +1 -0
  148. package/dist/invocation/index.js +2 -0
  149. package/dist/invocation/index.js.map +1 -0
  150. package/dist/invocation/receiver.d.ts +5 -0
  151. package/dist/invocation/receiver.d.ts.map +1 -0
  152. package/dist/invocation/receiver.js +70 -0
  153. package/dist/invocation/receiver.js.map +1 -0
  154. package/dist/invocation/result.d.ts +5 -0
  155. package/dist/invocation/result.d.ts.map +1 -0
  156. package/dist/invocation/result.js +146 -0
  157. package/dist/invocation/result.js.map +1 -0
  158. package/dist/invocation/selection.d.ts +21 -0
  159. package/dist/invocation/selection.d.ts.map +1 -0
  160. package/dist/invocation/selection.js +107 -0
  161. package/dist/invocation/selection.js.map +1 -0
  162. package/dist/linter/adapters/typescript/discover.d.ts +4 -0
  163. package/dist/linter/adapters/typescript/discover.d.ts.map +1 -0
  164. package/dist/linter/adapters/typescript/discover.js +412 -0
  165. package/dist/linter/adapters/typescript/discover.js.map +1 -0
  166. package/dist/linter/adapters/typescript/evidence-admission.d.ts +5 -0
  167. package/dist/linter/adapters/typescript/evidence-admission.d.ts.map +1 -0
  168. package/dist/linter/adapters/typescript/evidence-admission.js +22 -0
  169. package/dist/linter/adapters/typescript/evidence-admission.js.map +1 -0
  170. package/dist/linter/adapters/typescript/imports.d.ts +7 -0
  171. package/dist/linter/adapters/typescript/imports.d.ts.map +1 -0
  172. package/dist/linter/adapters/typescript/imports.js +171 -0
  173. package/dist/linter/adapters/typescript/imports.js.map +1 -0
  174. package/dist/linter/adapters/typescript/index.d.ts +48 -0
  175. package/dist/linter/adapters/typescript/index.d.ts.map +1 -0
  176. package/dist/linter/adapters/typescript/index.js +8 -0
  177. package/dist/linter/adapters/typescript/index.js.map +1 -0
  178. package/dist/linter/adapters/typescript/query-observation.d.ts +4 -0
  179. package/dist/linter/adapters/typescript/query-observation.d.ts.map +1 -0
  180. package/dist/linter/adapters/typescript/query-observation.js +172 -0
  181. package/dist/linter/adapters/typescript/query-observation.js.map +1 -0
  182. package/dist/linter/adapters/typescript/suppression-directives.d.ts +5 -0
  183. package/dist/linter/adapters/typescript/suppression-directives.d.ts.map +1 -0
  184. package/dist/linter/adapters/typescript/suppression-directives.js +85 -0
  185. package/dist/linter/adapters/typescript/suppression-directives.js.map +1 -0
  186. package/dist/linter/adapters/typescript/syntax.d.ts +39 -0
  187. package/dist/linter/adapters/typescript/syntax.d.ts.map +1 -0
  188. package/dist/linter/adapters/typescript/syntax.js +183 -0
  189. package/dist/linter/adapters/typescript/syntax.js.map +1 -0
  190. package/dist/linter/adapters/typescript/type-universe.d.ts +2 -0
  191. package/dist/linter/adapters/typescript/type-universe.d.ts.map +1 -0
  192. package/dist/linter/adapters/typescript/type-universe.js +265 -0
  193. package/dist/linter/adapters/typescript/type-universe.js.map +1 -0
  194. package/dist/linter/catalog/compile.d.ts +3 -0
  195. package/dist/linter/catalog/compile.d.ts.map +1 -0
  196. package/dist/linter/catalog/compile.js +111 -0
  197. package/dist/linter/catalog/compile.js.map +1 -0
  198. package/dist/linter/catalog/index.d.ts +19 -0
  199. package/dist/linter/catalog/index.d.ts.map +1 -0
  200. package/dist/linter/catalog/index.js +3 -0
  201. package/dist/linter/catalog/index.js.map +1 -0
  202. package/dist/linter/catalog/revision.d.ts +7 -0
  203. package/dist/linter/catalog/revision.d.ts.map +1 -0
  204. package/dist/linter/catalog/revision.js +13 -0
  205. package/dist/linter/catalog/revision.js.map +1 -0
  206. package/dist/linter/diagnostics/error.d.ts +10 -0
  207. package/dist/linter/diagnostics/error.d.ts.map +1 -0
  208. package/dist/linter/diagnostics/error.js +10 -0
  209. package/dist/linter/diagnostics/error.js.map +1 -0
  210. package/dist/linter/diagnostics/index.d.ts +29 -0
  211. package/dist/linter/diagnostics/index.d.ts.map +1 -0
  212. package/dist/linter/diagnostics/index.js +3 -0
  213. package/dist/linter/diagnostics/index.js.map +1 -0
  214. package/dist/linter/diagnostics/sort.d.ts +3 -0
  215. package/dist/linter/diagnostics/sort.d.ts.map +1 -0
  216. package/dist/linter/diagnostics/sort.js +27 -0
  217. package/dist/linter/diagnostics/sort.js.map +1 -0
  218. package/dist/linter/evaluation/binding/bind.d.ts +5 -0
  219. package/dist/linter/evaluation/binding/bind.d.ts.map +1 -0
  220. package/dist/linter/evaluation/binding/bind.js +356 -0
  221. package/dist/linter/evaluation/binding/bind.js.map +1 -0
  222. package/dist/linter/evaluation/binding/diagnostic.d.ts +5 -0
  223. package/dist/linter/evaluation/binding/diagnostic.d.ts.map +1 -0
  224. package/dist/linter/evaluation/binding/diagnostic.js +17 -0
  225. package/dist/linter/evaluation/binding/diagnostic.js.map +1 -0
  226. package/dist/linter/evaluation/binding/index.d.ts +2 -0
  227. package/dist/linter/evaluation/binding/index.d.ts.map +1 -0
  228. package/dist/linter/evaluation/binding/index.js +2 -0
  229. package/dist/linter/evaluation/binding/index.js.map +1 -0
  230. package/dist/linter/evaluation/contract/availability.d.ts +28 -0
  231. package/dist/linter/evaluation/contract/availability.d.ts.map +1 -0
  232. package/dist/linter/evaluation/contract/availability.js +2 -0
  233. package/dist/linter/evaluation/contract/availability.js.map +1 -0
  234. package/dist/linter/evaluation/contract/decision.d.ts +26 -0
  235. package/dist/linter/evaluation/contract/decision.d.ts.map +1 -0
  236. package/dist/linter/evaluation/contract/decision.js +2 -0
  237. package/dist/linter/evaluation/contract/decision.js.map +1 -0
  238. package/dist/linter/evaluation/contract/evidence.d.ts +12 -0
  239. package/dist/linter/evaluation/contract/evidence.d.ts.map +1 -0
  240. package/dist/linter/evaluation/contract/evidence.js +2 -0
  241. package/dist/linter/evaluation/contract/evidence.js.map +1 -0
  242. package/dist/linter/evaluation/contract/implementation.d.ts +22 -0
  243. package/dist/linter/evaluation/contract/implementation.d.ts.map +1 -0
  244. package/dist/linter/evaluation/contract/implementation.js +2 -0
  245. package/dist/linter/evaluation/contract/implementation.js.map +1 -0
  246. package/dist/linter/evaluation/contract/index.d.ts +5 -0
  247. package/dist/linter/evaluation/contract/index.d.ts.map +1 -0
  248. package/dist/linter/evaluation/contract/index.js +2 -0
  249. package/dist/linter/evaluation/contract/index.js.map +1 -0
  250. package/dist/linter/evaluation/index.d.ts +3 -0
  251. package/dist/linter/evaluation/index.d.ts.map +1 -0
  252. package/dist/linter/evaluation/index.js +2 -0
  253. package/dist/linter/evaluation/index.js.map +1 -0
  254. package/dist/linter/implementations/source/capabilities.d.ts +3 -0
  255. package/dist/linter/implementations/source/capabilities.d.ts.map +1 -0
  256. package/dist/linter/implementations/source/capabilities.js +41 -0
  257. package/dist/linter/implementations/source/capabilities.js.map +1 -0
  258. package/dist/linter/implementations/source/contract.d.ts +17 -0
  259. package/dist/linter/implementations/source/contract.d.ts.map +1 -0
  260. package/dist/linter/implementations/source/contract.js +53 -0
  261. package/dist/linter/implementations/source/contract.js.map +1 -0
  262. package/dist/linter/implementations/source/functions.d.ts +3 -0
  263. package/dist/linter/implementations/source/functions.d.ts.map +1 -0
  264. package/dist/linter/implementations/source/functions.js +102 -0
  265. package/dist/linter/implementations/source/functions.js.map +1 -0
  266. package/dist/linter/implementations/source/global.d.ts +3 -0
  267. package/dist/linter/implementations/source/global.d.ts.map +1 -0
  268. package/dist/linter/implementations/source/global.js +812 -0
  269. package/dist/linter/implementations/source/global.js.map +1 -0
  270. package/dist/linter/implementations/source/index.d.ts +4 -0
  271. package/dist/linter/implementations/source/index.d.ts.map +1 -0
  272. package/dist/linter/implementations/source/index.js +4 -0
  273. package/dist/linter/implementations/source/index.js.map +1 -0
  274. package/dist/linter/implementations/source/integrations.d.ts +3 -0
  275. package/dist/linter/implementations/source/integrations.d.ts.map +1 -0
  276. package/dist/linter/implementations/source/integrations.js +186 -0
  277. package/dist/linter/implementations/source/integrations.js.map +1 -0
  278. package/dist/linter/implementations/source/migrations.d.ts +3 -0
  279. package/dist/linter/implementations/source/migrations.d.ts.map +1 -0
  280. package/dist/linter/implementations/source/migrations.js +115 -0
  281. package/dist/linter/implementations/source/migrations.js.map +1 -0
  282. package/dist/linter/implementations/source/mutations.d.ts +3 -0
  283. package/dist/linter/implementations/source/mutations.d.ts.map +1 -0
  284. package/dist/linter/implementations/source/mutations.js +185 -0
  285. package/dist/linter/implementations/source/mutations.js.map +1 -0
  286. package/dist/linter/implementations/source/queries.d.ts +3 -0
  287. package/dist/linter/implementations/source/queries.d.ts.map +1 -0
  288. package/dist/linter/implementations/source/queries.js +1000 -0
  289. package/dist/linter/implementations/source/queries.js.map +1 -0
  290. package/dist/linter/implementations/source/rules.d.ts +3 -0
  291. package/dist/linter/implementations/source/rules.d.ts.map +1 -0
  292. package/dist/linter/implementations/source/rules.js +141 -0
  293. package/dist/linter/implementations/source/rules.js.map +1 -0
  294. package/dist/linter/implementations/source/schema.d.ts +3 -0
  295. package/dist/linter/implementations/source/schema.d.ts.map +1 -0
  296. package/dist/linter/implementations/source/schema.js +105 -0
  297. package/dist/linter/implementations/source/schema.js.map +1 -0
  298. package/dist/linter/implementations/source/shared.d.ts +42 -0
  299. package/dist/linter/implementations/source/shared.d.ts.map +1 -0
  300. package/dist/linter/implementations/source/shared.js +239 -0
  301. package/dist/linter/implementations/source/shared.js.map +1 -0
  302. package/dist/linter/implementations/source/states.d.ts +3 -0
  303. package/dist/linter/implementations/source/states.d.ts.map +1 -0
  304. package/dist/linter/implementations/source/states.js +2 -0
  305. package/dist/linter/implementations/source/states.js.map +1 -0
  306. package/dist/linter/implementations/source/tests.d.ts +3 -0
  307. package/dist/linter/implementations/source/tests.d.ts.map +1 -0
  308. package/dist/linter/implementations/source/tests.js +28 -0
  309. package/dist/linter/implementations/source/tests.js.map +1 -0
  310. package/dist/linter/implementations/source/ui.d.ts +3 -0
  311. package/dist/linter/implementations/source/ui.d.ts.map +1 -0
  312. package/dist/linter/implementations/source/ui.js +21 -0
  313. package/dist/linter/implementations/source/ui.js.map +1 -0
  314. package/dist/linter/implementations/source/utils.d.ts +3 -0
  315. package/dist/linter/implementations/source/utils.d.ts.map +1 -0
  316. package/dist/linter/implementations/source/utils.js +29 -0
  317. package/dist/linter/implementations/source/utils.js.map +1 -0
  318. package/dist/linter/implementations/source/verifiers.d.ts +3 -0
  319. package/dist/linter/implementations/source/verifiers.d.ts.map +1 -0
  320. package/dist/linter/implementations/source/verifiers.js +33 -0
  321. package/dist/linter/implementations/source/verifiers.js.map +1 -0
  322. package/dist/linter/implementations/source/views.d.ts +3 -0
  323. package/dist/linter/implementations/source/views.d.ts.map +1 -0
  324. package/dist/linter/implementations/source/views.js +36 -0
  325. package/dist/linter/implementations/source/views.js.map +1 -0
  326. package/dist/linter/implementations/source/workflows.d.ts +3 -0
  327. package/dist/linter/implementations/source/workflows.d.ts.map +1 -0
  328. package/dist/linter/implementations/source/workflows.js +308 -0
  329. package/dist/linter/implementations/source/workflows.js.map +1 -0
  330. package/dist/linter/index.d.ts +7 -8
  331. package/dist/linter/index.d.ts.map +1 -1
  332. package/dist/linter/index.js +2 -4
  333. package/dist/linter/index.js.map +1 -1
  334. package/dist/linter/lint.d.ts +22 -8
  335. package/dist/linter/lint.d.ts.map +1 -1
  336. package/dist/linter/lint.js +58 -15
  337. package/dist/linter/lint.js.map +1 -1
  338. package/dist/linter/oxlint/index.d.ts +4 -0
  339. package/dist/linter/oxlint/index.d.ts.map +1 -0
  340. package/dist/linter/oxlint/index.js +2 -0
  341. package/dist/linter/oxlint/index.js.map +1 -0
  342. package/dist/linter/oxlint/process.d.ts +6 -6
  343. package/dist/linter/oxlint/process.d.ts.map +1 -1
  344. package/dist/linter/oxlint/process.js +1 -1
  345. package/dist/linter/oxlint/process.js.map +1 -1
  346. package/dist/linter/oxlint/run.d.ts +5 -5
  347. package/dist/linter/oxlint/run.d.ts.map +1 -1
  348. package/dist/linter/oxlint/run.js +140 -20
  349. package/dist/linter/oxlint/run.js.map +1 -1
  350. package/dist/linter/oxlint-config/ignore-patterns.d.ts +6 -0
  351. package/dist/linter/oxlint-config/ignore-patterns.d.ts.map +1 -0
  352. package/dist/linter/oxlint-config/ignore-patterns.js +10 -0
  353. package/dist/linter/oxlint-config/ignore-patterns.js.map +1 -0
  354. package/dist/linter/oxlint-config/index.d.ts +5 -0
  355. package/dist/linter/oxlint-config/index.d.ts.map +1 -0
  356. package/dist/linter/oxlint-config/index.js +18 -0
  357. package/dist/linter/oxlint-config/index.js.map +1 -0
  358. package/dist/linter/packs/domain.d.ts +3 -0
  359. package/dist/linter/packs/domain.d.ts.map +1 -0
  360. package/dist/linter/packs/domain.js +8 -0
  361. package/dist/linter/packs/domain.js.map +1 -0
  362. package/dist/linter/packs/index.d.ts +9 -0
  363. package/dist/linter/packs/index.d.ts.map +1 -0
  364. package/dist/linter/packs/index.js +2 -0
  365. package/dist/linter/packs/index.js.map +1 -0
  366. package/dist/linter/policy/compile.d.ts +3 -0
  367. package/dist/linter/policy/compile.d.ts.map +1 -0
  368. package/dist/linter/policy/compile.js +256 -0
  369. package/dist/linter/policy/compile.js.map +1 -0
  370. package/dist/linter/policy/generated.d.ts +5 -0
  371. package/dist/linter/policy/generated.d.ts.map +1 -0
  372. package/dist/linter/policy/generated.js +764 -0
  373. package/dist/linter/policy/generated.js.map +1 -0
  374. package/dist/linter/policy/index.d.ts +43 -0
  375. package/dist/linter/policy/index.d.ts.map +1 -0
  376. package/dist/linter/policy/index.js +3 -0
  377. package/dist/linter/policy/index.js.map +1 -0
  378. package/dist/linter/qualification/index.d.ts +11 -0
  379. package/dist/linter/qualification/index.d.ts.map +1 -0
  380. package/dist/linter/qualification/index.js +3 -0
  381. package/dist/linter/qualification/index.js.map +1 -0
  382. package/dist/linter/qualification/query-fixtures.d.ts +3 -0
  383. package/dist/linter/qualification/query-fixtures.d.ts.map +1 -0
  384. package/dist/linter/qualification/query-fixtures.js +69 -0
  385. package/dist/linter/qualification/query-fixtures.js.map +1 -0
  386. package/dist/linter/qualification/runner.d.ts +4 -0
  387. package/dist/linter/qualification/runner.d.ts.map +1 -0
  388. package/dist/linter/qualification/runner.js +7 -0
  389. package/dist/linter/qualification/runner.js.map +1 -0
  390. package/dist/linter/report/format.d.ts +4 -0
  391. package/dist/linter/report/format.d.ts.map +1 -0
  392. package/dist/linter/report/format.js +33 -0
  393. package/dist/linter/report/format.js.map +1 -0
  394. package/dist/linter/report/index.d.ts +3 -0
  395. package/dist/linter/report/index.d.ts.map +1 -0
  396. package/dist/linter/report/index.js +2 -0
  397. package/dist/linter/report/index.js.map +1 -0
  398. package/dist/linter/requirements/index.d.ts +3 -0
  399. package/dist/linter/requirements/index.d.ts.map +1 -0
  400. package/dist/linter/requirements/index.js +2 -0
  401. package/dist/linter/requirements/index.js.map +1 -0
  402. package/dist/linter/requirements/model.d.ts +9 -0
  403. package/dist/linter/requirements/model.d.ts.map +1 -0
  404. package/dist/linter/requirements/model.js +2 -0
  405. package/dist/linter/requirements/model.js.map +1 -0
  406. package/dist/linter/requirements/registry.d.ts +4 -0
  407. package/dist/linter/requirements/registry.d.ts.map +1 -0
  408. package/dist/linter/requirements/registry.js +188 -0
  409. package/dist/linter/requirements/registry.js.map +1 -0
  410. package/dist/linter/semantics/query/decision.d.ts +5 -0
  411. package/dist/linter/semantics/query/decision.d.ts.map +1 -0
  412. package/dist/linter/semantics/query/decision.js +74 -0
  413. package/dist/linter/semantics/query/decision.js.map +1 -0
  414. package/dist/linter/semantics/query/index.d.ts +4 -0
  415. package/dist/linter/semantics/query/index.d.ts.map +1 -0
  416. package/dist/linter/semantics/query/index.js +3 -0
  417. package/dist/linter/semantics/query/index.js.map +1 -0
  418. package/dist/linter/semantics/query/observation.d.ts +36 -0
  419. package/dist/linter/semantics/query/observation.d.ts.map +1 -0
  420. package/dist/linter/semantics/query/observation.js +13 -0
  421. package/dist/linter/semantics/query/observation.js.map +1 -0
  422. package/dist/linter/suppression/apply.d.ts +4 -0
  423. package/dist/linter/suppression/apply.d.ts.map +1 -0
  424. package/dist/linter/suppression/apply.js +48 -0
  425. package/dist/linter/suppression/apply.js.map +1 -0
  426. package/dist/linter/suppression/directive.d.ts +11 -0
  427. package/dist/linter/suppression/directive.d.ts.map +1 -0
  428. package/dist/linter/suppression/directive.js +2 -0
  429. package/dist/linter/suppression/directive.js.map +1 -0
  430. package/dist/linter/suppression/index.d.ts +14 -0
  431. package/dist/linter/suppression/index.d.ts.map +1 -0
  432. package/dist/linter/suppression/index.js +2 -0
  433. package/dist/linter/suppression/index.js.map +1 -0
  434. package/dist/mutation/contract.d.ts +134 -0
  435. package/dist/mutation/contract.d.ts.map +1 -0
  436. package/dist/mutation/contract.js +2 -0
  437. package/dist/mutation/contract.js.map +1 -0
  438. package/dist/mutation/define.d.ts +9 -0
  439. package/dist/mutation/define.d.ts.map +1 -0
  440. package/dist/mutation/define.js +24 -0
  441. package/dist/mutation/define.js.map +1 -0
  442. package/dist/mutation/errors.d.ts +3 -0
  443. package/dist/mutation/errors.d.ts.map +1 -0
  444. package/dist/mutation/errors.js +30 -0
  445. package/dist/mutation/errors.js.map +1 -0
  446. package/dist/mutation/execute.d.ts +11 -0
  447. package/dist/mutation/execute.d.ts.map +1 -0
  448. package/dist/mutation/execute.js +24 -0
  449. package/dist/mutation/execute.js.map +1 -0
  450. package/dist/mutation/index.d.ts +8 -0
  451. package/dist/mutation/index.d.ts.map +1 -0
  452. package/dist/mutation/index.js +5 -0
  453. package/dist/mutation/index.js.map +1 -0
  454. package/dist/mutation/rich.d.ts +4 -0
  455. package/dist/mutation/rich.d.ts.map +1 -0
  456. package/dist/mutation/rich.js +147 -0
  457. package/dist/mutation/rich.js.map +1 -0
  458. package/dist/query/composite/contract.d.ts +37 -0
  459. package/dist/query/composite/contract.d.ts.map +1 -0
  460. package/dist/query/composite/contract.js +2 -0
  461. package/dist/query/composite/contract.js.map +1 -0
  462. package/dist/query/composite/errors.d.ts +8 -0
  463. package/dist/query/composite/errors.d.ts.map +1 -0
  464. package/dist/query/composite/errors.js +9 -0
  465. package/dist/query/composite/errors.js.map +1 -0
  466. package/dist/query/composite/index.d.ts +6 -0
  467. package/dist/query/composite/index.d.ts.map +1 -0
  468. package/dist/query/composite/index.js +3 -0
  469. package/dist/query/composite/index.js.map +1 -0
  470. package/dist/query/composite/plan.d.ts +38 -0
  471. package/dist/query/composite/plan.d.ts.map +1 -0
  472. package/dist/query/composite/plan.js +225 -0
  473. package/dist/query/composite/plan.js.map +1 -0
  474. package/dist/query/contract.d.ts +58 -0
  475. package/dist/query/contract.d.ts.map +1 -0
  476. package/dist/query/contract.js +2 -0
  477. package/dist/query/contract.js.map +1 -0
  478. package/dist/query/define.d.ts +3 -0
  479. package/dist/query/define.d.ts.map +1 -0
  480. package/dist/query/define.js +90 -0
  481. package/dist/query/define.js.map +1 -0
  482. package/dist/query/definition.d.ts +29 -0
  483. package/dist/query/definition.d.ts.map +1 -0
  484. package/dist/query/definition.js +2 -0
  485. package/dist/query/definition.js.map +1 -0
  486. package/dist/query/errors.d.ts +9 -0
  487. package/dist/query/errors.d.ts.map +1 -0
  488. package/dist/query/errors.js +15 -0
  489. package/dist/query/errors.js.map +1 -0
  490. package/dist/query/execute.d.ts +20 -0
  491. package/dist/query/execute.d.ts.map +1 -0
  492. package/dist/query/execute.js +97 -0
  493. package/dist/query/execute.js.map +1 -0
  494. package/dist/query/index.d.ts +15 -0
  495. package/dist/query/index.d.ts.map +1 -0
  496. package/dist/query/index.js +8 -0
  497. package/dist/query/index.js.map +1 -0
  498. package/dist/query/node.d.ts +109 -0
  499. package/dist/query/node.d.ts.map +1 -0
  500. package/dist/query/node.js +164 -0
  501. package/dist/query/node.js.map +1 -0
  502. package/dist/query/result/contract.d.ts +23 -0
  503. package/dist/query/result/contract.d.ts.map +1 -0
  504. package/dist/query/result/contract.js +2 -0
  505. package/dist/query/result/contract.js.map +1 -0
  506. package/dist/query/result/index.d.ts +3 -0
  507. package/dist/query/result/index.d.ts.map +1 -0
  508. package/dist/query/result/index.js +2 -0
  509. package/dist/query/result/index.js.map +1 -0
  510. package/dist/query/result/projection.d.ts +3 -0
  511. package/dist/query/result/projection.d.ts.map +1 -0
  512. package/dist/query/result/projection.js +100 -0
  513. package/dist/query/result/projection.js.map +1 -0
  514. package/dist/query/selection.d.ts +4 -0
  515. package/dist/query/selection.d.ts.map +1 -0
  516. package/dist/query/selection.js +25 -0
  517. package/dist/query/selection.js.map +1 -0
  518. package/dist/react/compile.d.ts +9 -0
  519. package/dist/react/compile.d.ts.map +1 -0
  520. package/dist/react/compile.js +64 -0
  521. package/dist/react/compile.js.map +1 -0
  522. package/dist/react/define.d.ts +8 -0
  523. package/dist/react/define.d.ts.map +1 -0
  524. package/dist/react/define.js +89 -0
  525. package/dist/react/define.js.map +1 -0
  526. package/dist/react/definition.d.ts +69 -0
  527. package/dist/react/definition.d.ts.map +1 -0
  528. package/dist/react/definition.js +2 -0
  529. package/dist/react/definition.js.map +1 -0
  530. package/dist/react/index.d.ts +4 -0
  531. package/dist/react/index.d.ts.map +1 -0
  532. package/dist/react/index.js +3 -0
  533. package/dist/react/index.js.map +1 -0
  534. package/dist/result/index.d.ts +3 -0
  535. package/dist/result/index.d.ts.map +1 -0
  536. package/dist/result/index.js +2 -0
  537. package/dist/result/index.js.map +1 -0
  538. package/dist/result/result.d.ts +10 -0
  539. package/dist/result/result.d.ts.map +1 -0
  540. package/dist/result/result.js +7 -0
  541. package/dist/result/result.js.map +1 -0
  542. package/dist/schema/index.d.ts +3 -0
  543. package/dist/schema/index.d.ts.map +1 -0
  544. package/dist/schema/index.js +3 -0
  545. package/dist/schema/index.js.map +1 -0
  546. package/dist/schema/kernel/index.d.ts +3 -0
  547. package/dist/schema/kernel/index.d.ts.map +1 -0
  548. package/dist/schema/kernel/index.js +3 -0
  549. package/dist/schema/kernel/index.js.map +1 -0
  550. package/dist/schema/v1/index.d.ts +3 -0
  551. package/dist/schema/v1/index.d.ts.map +1 -0
  552. package/dist/schema/v1/index.js +3 -0
  553. package/dist/schema/v1/index.js.map +1 -0
  554. package/dist/server/application.d.ts +36 -0
  555. package/dist/server/application.d.ts.map +1 -0
  556. package/dist/server/application.js +126 -0
  557. package/dist/server/application.js.map +1 -0
  558. package/dist/server/index.d.ts +4 -13
  559. package/dist/server/index.d.ts.map +1 -1
  560. package/dist/server/index.js +2 -8
  561. package/dist/server/index.js.map +1 -1
  562. package/dist/server/node/index.d.ts +3 -0
  563. package/dist/server/node/index.d.ts.map +1 -0
  564. package/dist/server/node/index.js +2 -0
  565. package/dist/server/node/index.js.map +1 -0
  566. package/dist/server/node/server.d.ts +14 -0
  567. package/dist/server/node/server.d.ts.map +1 -0
  568. package/dist/server/node/server.js +71 -0
  569. package/dist/server/node/server.js.map +1 -0
  570. package/dist/server/remote.d.ts +56 -0
  571. package/dist/server/remote.d.ts.map +1 -0
  572. package/dist/server/remote.js +798 -0
  573. package/dist/server/remote.js.map +1 -0
  574. package/dist/server/source.d.ts +13 -0
  575. package/dist/server/source.d.ts.map +1 -0
  576. package/dist/server/source.js +38 -0
  577. package/dist/server/source.js.map +1 -0
  578. package/dist/state/index.d.ts +4 -0
  579. package/dist/state/index.d.ts.map +1 -0
  580. package/dist/state/index.js +2 -0
  581. package/dist/state/index.js.map +1 -0
  582. package/dist/state/machine.d.ts +28 -0
  583. package/dist/state/machine.d.ts.map +1 -0
  584. package/dist/state/machine.js +32 -0
  585. package/dist/state/machine.js.map +1 -0
  586. package/dist/state/relation.d.ts +28 -0
  587. package/dist/state/relation.d.ts.map +1 -0
  588. package/dist/state/relation.js +48 -0
  589. package/dist/state/relation.js.map +1 -0
  590. package/dist/value/index.d.ts +3 -0
  591. package/dist/value/index.d.ts.map +1 -0
  592. package/dist/value/index.js +3 -0
  593. package/dist/value/index.js.map +1 -0
  594. package/dist/view/admission.d.ts +6 -0
  595. package/dist/view/admission.d.ts.map +1 -0
  596. package/dist/view/admission.js +43 -0
  597. package/dist/view/admission.js.map +1 -0
  598. package/dist/view/compile.d.ts +15 -0
  599. package/dist/view/compile.d.ts.map +1 -0
  600. package/dist/view/compile.js +189 -0
  601. package/dist/view/compile.js.map +1 -0
  602. package/dist/view/define.d.ts +20 -0
  603. package/dist/view/define.d.ts.map +1 -0
  604. package/dist/view/define.js +236 -0
  605. package/dist/view/define.js.map +1 -0
  606. package/dist/view/definition.d.ts +96 -0
  607. package/dist/view/definition.d.ts.map +1 -0
  608. package/dist/view/definition.js +2 -0
  609. package/dist/view/definition.js.map +1 -0
  610. package/dist/view/index.d.ts +4 -0
  611. package/dist/view/index.d.ts.map +1 -0
  612. package/dist/view/index.js +3 -0
  613. package/dist/view/index.js.map +1 -0
  614. package/dist/workflow/binding.d.ts +43 -0
  615. package/dist/workflow/binding.d.ts.map +1 -0
  616. package/dist/workflow/binding.js +32 -0
  617. package/dist/workflow/binding.js.map +1 -0
  618. package/dist/workflow/contract.d.ts +57 -0
  619. package/dist/workflow/contract.d.ts.map +1 -0
  620. package/dist/workflow/contract.js +2 -0
  621. package/dist/workflow/contract.js.map +1 -0
  622. package/dist/workflow/define.d.ts +4 -0
  623. package/dist/workflow/define.d.ts.map +1 -0
  624. package/dist/workflow/define.js +57 -0
  625. package/dist/workflow/define.js.map +1 -0
  626. package/dist/workflow/index.d.ts +7 -0
  627. package/dist/workflow/index.d.ts.map +1 -0
  628. package/dist/workflow/index.js +4 -0
  629. package/dist/workflow/index.js.map +1 -0
  630. package/dist/workflow/runner.d.ts +4 -0
  631. package/dist/workflow/runner.d.ts.map +1 -0
  632. package/dist/workflow/runner.js +24 -0
  633. package/dist/workflow/runner.js.map +1 -0
  634. package/dist/workflow/step/index.d.ts +3 -0
  635. package/dist/workflow/step/index.d.ts.map +1 -0
  636. package/dist/workflow/step/index.js +2 -0
  637. package/dist/workflow/step/index.js.map +1 -0
  638. package/dist/workflow/step/inline.d.ts +6 -0
  639. package/dist/workflow/step/inline.d.ts.map +1 -0
  640. package/dist/workflow/step/inline.js +44 -0
  641. package/dist/workflow/step/inline.js.map +1 -0
  642. package/dist/workflow/step/step.d.ts +5 -0
  643. package/dist/workflow/step/step.d.ts.map +1 -0
  644. package/dist/workflow/step/step.js +2 -0
  645. package/dist/workflow/step/step.js.map +1 -0
  646. package/package.json +117 -24
  647. package/dist/auth/authenticate.d.ts +0 -24
  648. package/dist/auth/authenticate.d.ts.map +0 -1
  649. package/dist/auth/authenticate.js +0 -29
  650. package/dist/auth/authenticate.js.map +0 -1
  651. package/dist/auth/check.d.ts +0 -38
  652. package/dist/auth/check.d.ts.map +0 -1
  653. package/dist/auth/check.js +0 -50
  654. package/dist/auth/check.js.map +0 -1
  655. package/dist/auth/compose.d.ts +0 -41
  656. package/dist/auth/compose.d.ts.map +0 -1
  657. package/dist/auth/compose.js +0 -45
  658. package/dist/auth/compose.js.map +0 -1
  659. package/dist/auth/errors.d.ts +0 -16
  660. package/dist/auth/errors.d.ts.map +0 -1
  661. package/dist/auth/errors.js +0 -26
  662. package/dist/auth/errors.js.map +0 -1
  663. package/dist/auth/function-context.d.ts +0 -28
  664. package/dist/auth/function-context.d.ts.map +0 -1
  665. package/dist/auth/function-context.js +0 -47
  666. package/dist/auth/function-context.js.map +0 -1
  667. package/dist/auth/identity.d.ts +0 -18
  668. package/dist/auth/identity.d.ts.map +0 -1
  669. package/dist/auth/identity.js +0 -2
  670. package/dist/auth/identity.js.map +0 -1
  671. package/dist/auth/issuer-mint.d.ts +0 -53
  672. package/dist/auth/issuer-mint.d.ts.map +0 -1
  673. package/dist/auth/issuer-mint.js +0 -35
  674. package/dist/auth/issuer-mint.js.map +0 -1
  675. package/dist/auth/kernel-client.d.ts +0 -37
  676. package/dist/auth/kernel-client.d.ts.map +0 -1
  677. package/dist/auth/kernel-client.js +0 -111
  678. package/dist/auth/kernel-client.js.map +0 -1
  679. package/dist/auth/resolve.d.ts +0 -19
  680. package/dist/auth/resolve.d.ts.map +0 -1
  681. package/dist/auth/resolve.js +0 -43
  682. package/dist/auth/resolve.js.map +0 -1
  683. package/dist/auth/sign.d.ts +0 -15
  684. package/dist/auth/sign.d.ts.map +0 -1
  685. package/dist/auth/sign.js +0 -24
  686. package/dist/auth/sign.js.map +0 -1
  687. package/dist/auth/verify.d.ts +0 -28
  688. package/dist/auth/verify.d.ts.map +0 -1
  689. package/dist/auth/verify.js +0 -151
  690. package/dist/auth/verify.js.map +0 -1
  691. package/dist/cli/spec.d.ts +0 -19
  692. package/dist/cli/spec.d.ts.map +0 -1
  693. package/dist/cli/spec.js +0 -33
  694. package/dist/cli/spec.js.map +0 -1
  695. package/dist/config/adapter.d.ts +0 -148
  696. package/dist/config/adapter.d.ts.map +0 -1
  697. package/dist/config/adapter.js +0 -40
  698. package/dist/config/adapter.js.map +0 -1
  699. package/dist/config/define-domain.d.ts +0 -177
  700. package/dist/config/define-domain.d.ts.map +0 -1
  701. package/dist/config/define-domain.js +0 -145
  702. package/dist/config/define-domain.js.map +0 -1
  703. package/dist/config/deploy.d.ts +0 -28
  704. package/dist/config/deploy.d.ts.map +0 -1
  705. package/dist/config/deploy.js +0 -24
  706. package/dist/config/deploy.js.map +0 -1
  707. package/dist/config/index.d.ts +0 -21
  708. package/dist/config/index.d.ts.map +0 -1
  709. package/dist/config/index.js +0 -18
  710. package/dist/config/index.js.map +0 -1
  711. package/dist/define/index.d.ts +0 -5
  712. package/dist/define/index.d.ts.map +0 -1
  713. package/dist/define/index.js +0 -3
  714. package/dist/define/index.js.map +0 -1
  715. package/dist/define/remote-function.d.ts +0 -120
  716. package/dist/define/remote-function.d.ts.map +0 -1
  717. package/dist/define/remote-function.js +0 -26
  718. package/dist/define/remote-function.js.map +0 -1
  719. package/dist/define/view.d.ts +0 -104
  720. package/dist/define/view.d.ts.map +0 -1
  721. package/dist/define/view.js +0 -30
  722. package/dist/define/view.js.map +0 -1
  723. package/dist/deploy/check.d.ts +0 -30
  724. package/dist/deploy/check.d.ts.map +0 -1
  725. package/dist/deploy/check.js +0 -82
  726. package/dist/deploy/check.js.map +0 -1
  727. package/dist/deploy/index.d.ts +0 -3
  728. package/dist/deploy/index.d.ts.map +0 -1
  729. package/dist/deploy/index.js +0 -3
  730. package/dist/deploy/index.js.map +0 -1
  731. package/dist/deploy/meta.d.ts +0 -29
  732. package/dist/deploy/meta.d.ts.map +0 -1
  733. package/dist/deploy/meta.js +0 -45
  734. package/dist/deploy/meta.js.map +0 -1
  735. package/dist/dispatch/authorize.d.ts +0 -14
  736. package/dist/dispatch/authorize.d.ts.map +0 -1
  737. package/dist/dispatch/authorize.js +0 -24
  738. package/dist/dispatch/authorize.js.map +0 -1
  739. package/dist/dispatch/dispatcher.d.ts +0 -59
  740. package/dist/dispatch/dispatcher.d.ts.map +0 -1
  741. package/dist/dispatch/dispatcher.js +0 -237
  742. package/dist/dispatch/dispatcher.js.map +0 -1
  743. package/dist/dispatch/errors.d.ts +0 -47
  744. package/dist/dispatch/errors.d.ts.map +0 -1
  745. package/dist/dispatch/errors.js +0 -76
  746. package/dist/dispatch/errors.js.map +0 -1
  747. package/dist/dispatch/execute.d.ts +0 -44
  748. package/dist/dispatch/execute.d.ts.map +0 -1
  749. package/dist/dispatch/execute.js +0 -29
  750. package/dist/dispatch/execute.js.map +0 -1
  751. package/dist/dispatch/identity.d.ts +0 -75
  752. package/dist/dispatch/identity.d.ts.map +0 -1
  753. package/dist/dispatch/identity.js +0 -101
  754. package/dist/dispatch/identity.js.map +0 -1
  755. package/dist/dispatch/index.d.ts +0 -7
  756. package/dist/dispatch/index.d.ts.map +0 -1
  757. package/dist/dispatch/index.js +0 -7
  758. package/dist/dispatch/index.js.map +0 -1
  759. package/dist/dispatch/resolve.d.ts +0 -27
  760. package/dist/dispatch/resolve.d.ts.map +0 -1
  761. package/dist/dispatch/resolve.js +0 -65
  762. package/dist/dispatch/resolve.js.map +0 -1
  763. package/dist/dispatch/self.d.ts +0 -51
  764. package/dist/dispatch/self.d.ts.map +0 -1
  765. package/dist/dispatch/self.js +0 -116
  766. package/dist/dispatch/self.js.map +0 -1
  767. package/dist/dispatch/validate.d.ts +0 -35
  768. package/dist/dispatch/validate.d.ts.map +0 -1
  769. package/dist/dispatch/validate.js +0 -27
  770. package/dist/dispatch/validate.js.map +0 -1
  771. package/dist/domain/binding.d.ts +0 -18
  772. package/dist/domain/binding.d.ts.map +0 -1
  773. package/dist/domain/binding.js +0 -29
  774. package/dist/domain/binding.js.map +0 -1
  775. package/dist/domain/build-spec.d.ts +0 -37
  776. package/dist/domain/build-spec.d.ts.map +0 -1
  777. package/dist/domain/build-spec.js +0 -114
  778. package/dist/domain/build-spec.js.map +0 -1
  779. package/dist/domain/contract.d.ts +0 -17
  780. package/dist/domain/contract.d.ts.map +0 -1
  781. package/dist/domain/contract.js +0 -26
  782. package/dist/domain/contract.js.map +0 -1
  783. package/dist/domain/extend-functions.d.ts +0 -48
  784. package/dist/domain/extend-functions.d.ts.map +0 -1
  785. package/dist/domain/extend-functions.js +0 -85
  786. package/dist/domain/extend-functions.js.map +0 -1
  787. package/dist/domain/extend-views.d.ts +0 -45
  788. package/dist/domain/extend-views.d.ts.map +0 -1
  789. package/dist/domain/extend-views.js +0 -116
  790. package/dist/domain/extend-views.js.map +0 -1
  791. package/dist/linter/analyze.d.ts +0 -6
  792. package/dist/linter/analyze.d.ts.map +0 -1
  793. package/dist/linter/analyze.js +0 -12
  794. package/dist/linter/analyze.js.map +0 -1
  795. package/dist/linter/diagnostic.d.ts +0 -38
  796. package/dist/linter/diagnostic.d.ts.map +0 -1
  797. package/dist/linter/diagnostic.js +0 -37
  798. package/dist/linter/diagnostic.js.map +0 -1
  799. package/dist/linter/oxlint/config.d.ts +0 -15
  800. package/dist/linter/oxlint/config.d.ts.map +0 -1
  801. package/dist/linter/oxlint/config.js +0 -23
  802. package/dist/linter/oxlint/config.js.map +0 -1
  803. package/dist/linter/oxlint/ignore-patterns.d.ts +0 -9
  804. package/dist/linter/oxlint/ignore-patterns.d.ts.map +0 -1
  805. package/dist/linter/oxlint/ignore-patterns.js +0 -18
  806. package/dist/linter/oxlint/ignore-patterns.js.map +0 -1
  807. package/dist/linter/oxlint/plugin.d.ts +0 -13
  808. package/dist/linter/oxlint/plugin.d.ts.map +0 -1
  809. package/dist/linter/oxlint/plugin.js +0 -14
  810. package/dist/linter/oxlint/plugin.js.map +0 -1
  811. package/dist/linter/preflight.d.ts +0 -2
  812. package/dist/linter/preflight.d.ts.map +0 -1
  813. package/dist/linter/preflight.js +0 -162
  814. package/dist/linter/preflight.js.map +0 -1
  815. package/dist/linter/project.d.ts +0 -18
  816. package/dist/linter/project.d.ts.map +0 -1
  817. package/dist/linter/project.js +0 -150
  818. package/dist/linter/project.js.map +0 -1
  819. package/dist/linter/report.d.ts +0 -4
  820. package/dist/linter/report.d.ts.map +0 -1
  821. package/dist/linter/report.js +0 -22
  822. package/dist/linter/report.js.map +0 -1
  823. package/dist/linter/rules/catalog.d.ts +0 -56
  824. package/dist/linter/rules/catalog.d.ts.map +0 -1
  825. package/dist/linter/rules/catalog.js +0 -53
  826. package/dist/linter/rules/catalog.js.map +0 -1
  827. package/dist/linter/rules/core-has-no-async.d.ts +0 -3
  828. package/dist/linter/rules/core-has-no-async.d.ts.map +0 -1
  829. package/dist/linter/rules/core-has-no-async.js +0 -43
  830. package/dist/linter/rules/core-has-no-async.js.map +0 -1
  831. package/dist/linter/rules/core-is-pure.d.ts +0 -3
  832. package/dist/linter/rules/core-is-pure.d.ts.map +0 -1
  833. package/dist/linter/rules/core-is-pure.js +0 -74
  834. package/dist/linter/rules/core-is-pure.js.map +0 -1
  835. package/dist/linter/rules/no-nested-steps.d.ts +0 -3
  836. package/dist/linter/rules/no-nested-steps.d.ts.map +0 -1
  837. package/dist/linter/rules/no-nested-steps.js +0 -32
  838. package/dist/linter/rules/no-nested-steps.js.map +0 -1
  839. package/dist/linter/rules/no-read-inside-mutate.d.ts +0 -3
  840. package/dist/linter/rules/no-read-inside-mutate.d.ts.map +0 -1
  841. package/dist/linter/rules/no-read-inside-mutate.js +0 -64
  842. package/dist/linter/rules/no-read-inside-mutate.js.map +0 -1
  843. package/dist/linter/rules/one-remote-definition-per-file.d.ts +0 -3
  844. package/dist/linter/rules/one-remote-definition-per-file.d.ts.map +0 -1
  845. package/dist/linter/rules/one-remote-definition-per-file.js +0 -23
  846. package/dist/linter/rules/one-remote-definition-per-file.js.map +0 -1
  847. package/dist/linter/rules/oxlint-ast.d.ts +0 -30
  848. package/dist/linter/rules/oxlint-ast.d.ts.map +0 -1
  849. package/dist/linter/rules/oxlint-ast.js +0 -104
  850. package/dist/linter/rules/oxlint-ast.js.map +0 -1
  851. package/dist/linter/rules/oxlint-rule.d.ts +0 -45
  852. package/dist/linter/rules/oxlint-rule.d.ts.map +0 -1
  853. package/dist/linter/rules/oxlint-rule.js +0 -2
  854. package/dist/linter/rules/oxlint-rule.js.map +0 -1
  855. package/dist/linter/rules/project-rule.d.ts +0 -10
  856. package/dist/linter/rules/project-rule.d.ts.map +0 -1
  857. package/dist/linter/rules/project-rule.js +0 -24
  858. package/dist/linter/rules/project-rule.js.map +0 -1
  859. package/dist/linter/rules/thin-schema-composition-root.d.ts +0 -3
  860. package/dist/linter/rules/thin-schema-composition-root.d.ts.map +0 -1
  861. package/dist/linter/rules/thin-schema-composition-root.js +0 -23
  862. package/dist/linter/rules/thin-schema-composition-root.js.map +0 -1
  863. package/dist/linter/source.d.ts +0 -24
  864. package/dist/linter/source.d.ts.map +0 -1
  865. package/dist/linter/source.js +0 -279
  866. package/dist/linter/source.js.map +0 -1
  867. package/dist/linter/suppression.d.ts +0 -3
  868. package/dist/linter/suppression.d.ts.map +0 -1
  869. package/dist/linter/suppression.js +0 -11
  870. package/dist/linter/suppression.js.map +0 -1
  871. package/dist/method/class.d.ts +0 -71
  872. package/dist/method/class.d.ts.map +0 -1
  873. package/dist/method/class.js +0 -26
  874. package/dist/method/class.js.map +0 -1
  875. package/dist/method/context.d.ts +0 -99
  876. package/dist/method/context.d.ts.map +0 -1
  877. package/dist/method/context.js +0 -11
  878. package/dist/method/context.js.map +0 -1
  879. package/dist/method/index.d.ts +0 -6
  880. package/dist/method/index.d.ts.map +0 -1
  881. package/dist/method/index.js +0 -3
  882. package/dist/method/index.js.map +0 -1
  883. package/dist/method/single.d.ts +0 -81
  884. package/dist/method/single.d.ts.map +0 -1
  885. package/dist/method/single.js +0 -8
  886. package/dist/method/single.js.map +0 -1
  887. package/dist/server/auxiliary-routes.d.ts +0 -48
  888. package/dist/server/auxiliary-routes.d.ts.map +0 -1
  889. package/dist/server/auxiliary-routes.js +0 -322
  890. package/dist/server/auxiliary-routes.js.map +0 -1
  891. package/dist/server/config.d.ts +0 -83
  892. package/dist/server/config.d.ts.map +0 -1
  893. package/dist/server/config.js +0 -8
  894. package/dist/server/config.js.map +0 -1
  895. package/dist/server/create.d.ts +0 -8
  896. package/dist/server/create.d.ts.map +0 -1
  897. package/dist/server/create.js +0 -171
  898. package/dist/server/create.js.map +0 -1
  899. package/dist/server/domain-entry.d.ts +0 -77
  900. package/dist/server/domain-entry.d.ts.map +0 -1
  901. package/dist/server/domain-entry.js +0 -60
  902. package/dist/server/domain-entry.js.map +0 -1
  903. package/dist/server/handle.d.ts +0 -35
  904. package/dist/server/handle.d.ts.map +0 -1
  905. package/dist/server/handle.js +0 -9
  906. package/dist/server/handle.js.map +0 -1
  907. package/dist/server/jwks.d.ts +0 -11
  908. package/dist/server/jwks.d.ts.map +0 -1
  909. package/dist/server/jwks.js +0 -15
  910. package/dist/server/jwks.js.map +0 -1
  911. package/dist/server/require-env.d.ts +0 -15
  912. package/dist/server/require-env.d.ts.map +0 -1
  913. package/dist/server/require-env.js +0 -21
  914. package/dist/server/require-env.js.map +0 -1
  915. package/dist/server/service-entry.d.ts +0 -32
  916. package/dist/server/service-entry.d.ts.map +0 -1
  917. package/dist/server/service-entry.js +0 -150
  918. package/dist/server/service-entry.js.map +0 -1
  919. package/dist/server/serving-url.d.ts +0 -14
  920. package/dist/server/serving-url.d.ts.map +0 -1
  921. package/dist/server/serving-url.js +0 -28
  922. package/dist/server/serving-url.js.map +0 -1
  923. package/dist/server/start.d.ts +0 -11
  924. package/dist/server/start.d.ts.map +0 -1
  925. package/dist/server/start.js +0 -34
  926. package/dist/server/start.js.map +0 -1
  927. package/dist/server/worker-entry.d.ts +0 -157
  928. package/dist/server/worker-entry.d.ts.map +0 -1
  929. package/dist/server/worker-entry.js +0 -201
  930. package/dist/server/worker-entry.js.map +0 -1
  931. package/dist/service/functions.d.ts +0 -148
  932. package/dist/service/functions.d.ts.map +0 -1
  933. package/dist/service/functions.js +0 -115
  934. package/dist/service/functions.js.map +0 -1
  935. package/dist/service/index.d.ts +0 -3
  936. package/dist/service/index.d.ts.map +0 -1
  937. package/dist/service/index.js +0 -2
  938. package/dist/service/index.js.map +0 -1
  939. package/dist/step/index.d.ts +0 -5
  940. package/dist/step/index.d.ts.map +0 -1
  941. package/dist/step/index.js +0 -3
  942. package/dist/step/index.js.map +0 -1
  943. package/dist/step/inline.d.ts +0 -8
  944. package/dist/step/inline.d.ts.map +0 -1
  945. package/dist/step/inline.js +0 -22
  946. package/dist/step/inline.js.map +0 -1
  947. package/dist/step/step.d.ts +0 -28
  948. package/dist/step/step.d.ts.map +0 -1
  949. package/dist/step/step.js +0 -53
  950. package/dist/step/step.js.map +0 -1
  951. package/src/auth/authenticate.ts +0 -51
  952. package/src/auth/check.ts +0 -69
  953. package/src/auth/compose.ts +0 -56
  954. package/src/auth/errors.ts +0 -32
  955. package/src/auth/function-context.ts +0 -108
  956. package/src/auth/identity.ts +0 -17
  957. package/src/auth/index.ts +0 -19
  958. package/src/auth/issuer-mint.ts +0 -76
  959. package/src/auth/kernel-client.ts +0 -153
  960. package/src/auth/resolve.ts +0 -63
  961. package/src/auth/sign.ts +0 -36
  962. package/src/auth/verify.ts +0 -199
  963. package/src/cli/bin.ts +0 -15
  964. package/src/cli/dotenv.ts +0 -65
  965. package/src/cli/index.ts +0 -15
  966. package/src/cli/log.ts +0 -18
  967. package/src/cli/publish.ts +0 -341
  968. package/src/cli/run.ts +0 -769
  969. package/src/cli/spec.ts +0 -44
  970. package/src/config/adapter.ts +0 -177
  971. package/src/config/define-domain.ts +0 -354
  972. package/src/config/deploy.ts +0 -35
  973. package/src/config/index.ts +0 -31
  974. package/src/define/index.ts +0 -10
  975. package/src/define/remote-function.ts +0 -184
  976. package/src/define/view.ts +0 -112
  977. package/src/deploy/check.ts +0 -124
  978. package/src/deploy/index.ts +0 -2
  979. package/src/deploy/meta.ts +0 -50
  980. package/src/dispatch/authorize.ts +0 -29
  981. package/src/dispatch/dispatcher.ts +0 -321
  982. package/src/dispatch/errors.ts +0 -94
  983. package/src/dispatch/execute.ts +0 -67
  984. package/src/dispatch/identity.ts +0 -143
  985. package/src/dispatch/index.ts +0 -16
  986. package/src/dispatch/resolve.ts +0 -78
  987. package/src/dispatch/self.ts +0 -198
  988. package/src/dispatch/validate.ts +0 -41
  989. package/src/domain/binding.ts +0 -37
  990. package/src/domain/build-spec.ts +0 -156
  991. package/src/domain/contract.ts +0 -41
  992. package/src/domain/define.ts +0 -162
  993. package/src/domain/extend-functions.ts +0 -110
  994. package/src/domain/extend-views.ts +0 -151
  995. package/src/domain/index.ts +0 -4
  996. package/src/index.ts +0 -165
  997. package/src/linter/analyze.ts +0 -17
  998. package/src/linter/diagnostic.ts +0 -85
  999. package/src/linter/docs/DIAGNOSTICS.md +0 -47
  1000. package/src/linter/docs/JUDGMENT.md +0 -81
  1001. package/src/linter/docs/PRINCIPLES.md +0 -97
  1002. package/src/linter/docs/README.md +0 -38
  1003. package/src/linter/docs/RULE-AUTHORING.md +0 -144
  1004. package/src/linter/docs/RULES.md +0 -153
  1005. package/src/linter/index.ts +0 -15
  1006. package/src/linter/lint.ts +0 -34
  1007. package/src/linter/oxlint/astrale-ox.d.ts +0 -5
  1008. package/src/linter/oxlint/config.ts +0 -24
  1009. package/src/linter/oxlint/ignore-patterns.ts +0 -17
  1010. package/src/linter/oxlint/plugin.js +0 -16
  1011. package/src/linter/oxlint/process.ts +0 -219
  1012. package/src/linter/oxlint/run.ts +0 -175
  1013. package/src/linter/preflight.ts +0 -182
  1014. package/src/linter/project.ts +0 -190
  1015. package/src/linter/report.ts +0 -25
  1016. package/src/linter/rules/catalog.ts +0 -67
  1017. package/src/linter/rules/core-has-no-async.js +0 -43
  1018. package/src/linter/rules/core-is-pure.ts +0 -103
  1019. package/src/linter/rules/no-nested-steps.js +0 -37
  1020. package/src/linter/rules/no-read-inside-mutate.js +0 -72
  1021. package/src/linter/rules/one-remote-definition-per-file.ts +0 -29
  1022. package/src/linter/rules/oxlint-ast.js +0 -110
  1023. package/src/linter/rules/oxlint-rule.ts +0 -35
  1024. package/src/linter/rules/project-rule.ts +0 -37
  1025. package/src/linter/rules/thin-schema-composition-root.ts +0 -26
  1026. package/src/linter/source.ts +0 -323
  1027. package/src/linter/suppression.ts +0 -11
  1028. package/src/method/class.ts +0 -163
  1029. package/src/method/context.ts +0 -135
  1030. package/src/method/index.ts +0 -19
  1031. package/src/method/single.ts +0 -166
  1032. package/src/server/auxiliary-routes.ts +0 -456
  1033. package/src/server/config.ts +0 -85
  1034. package/src/server/create.ts +0 -210
  1035. package/src/server/domain-entry.ts +0 -125
  1036. package/src/server/handle.ts +0 -37
  1037. package/src/server/index.ts +0 -19
  1038. package/src/server/jwks.ts +0 -18
  1039. package/src/server/require-env.ts +0 -19
  1040. package/src/server/service-entry.ts +0 -209
  1041. package/src/server/serving-url.ts +0 -28
  1042. package/src/server/start.ts +0 -42
  1043. package/src/server/worker-entry.ts +0 -286
  1044. package/src/service/functions.ts +0 -164
  1045. package/src/service/index.ts +0 -18
  1046. package/src/step/index.ts +0 -4
  1047. package/src/step/inline.ts +0 -38
  1048. package/src/step/step.ts +0 -95
@@ -1,42 +0,0 @@
1
- /**
2
- * Node HTTP convenience starter.
3
- *
4
- * Dynamically imports `@hono/node-server` so the SDK stays runtime-agnostic
5
- * — only Node consumers actually pull in the dep. For Bun / Deno /
6
- * Cloudflare, consumers go through `server.app.fetch` directly.
7
- */
8
-
9
- import type { serve as nodeServe } from '@hono/node-server'
10
- import type { Hono } from 'hono'
11
-
12
- import type { RemoteServerHandle } from './handle.js'
13
-
14
- export async function startNodeServer(app: Hono, port = 3000): Promise<RemoteServerHandle> {
15
- // Opaque specifier: the `./server` barrel re-exports this module, so worker
16
- // bundles (wrangler/esbuild) traverse it even though they never call it. A
17
- // literal import() would make them resolve the optional peer and fail.
18
- const nodeServerModule = '@hono/node-server'
19
- const { serve } = (await import(nodeServerModule)) as { serve: typeof nodeServe }
20
- // oxlint-disable-next-line no-explicit-any
21
- const server = serve({ fetch: app.fetch, port }) as any
22
-
23
- await new Promise<void>((resolve, reject) => {
24
- if (server.listening) return resolve()
25
- server.once('listening', () => resolve())
26
- // Without this, a bind failure (e.g. EADDRINUSE on a busy port) emits
27
- // `'error'` and never `'listening'`, leaving the Promise — and startup —
28
- // hung forever with no diagnostic.
29
- server.once('error', (err: Error) => reject(err))
30
- })
31
-
32
- const address = server.address() as { port: number; address: string } | null
33
- const actualPort = address?.port ?? port
34
-
35
- return {
36
- port: actualPort,
37
- close: () =>
38
- new Promise<void>((resolve, reject) => {
39
- server.close((err: Error | null) => (err ? reject(err) : resolve()))
40
- }),
41
- }
42
- }
@@ -1,286 +0,0 @@
1
- /**
2
- * `createWorkerEntry` — the shared worker `fetch` plumbing every Astrale domain
3
- * worker (and the cloudflare adapter's codegen) needs, so it lives in ONE place
4
- * instead of being copy-pasted per worker:
5
- *
6
- * • resolve the serving URL (== `iss`), canonicalize it (so the value matches
7
- * what `createRemoteServer` signs with and the kernel pins), and cache the
8
- * built app per distinct URL;
9
- * • optional subrequest routing: a `globalThis.fetch` override (installed ONLY
10
- * when `selfBinding` and/or `routeSubrequest` is configured) redirects
11
- * certain outbound fetches through a caller-supplied binding — `selfBinding`
12
- * for same-host fetches (a Worker can't fetch its own hostname), and the
13
- * vendor-neutral `routeSubrequest` for any caller policy (e.g. instance
14
- * hostnames a same-zone Worker→Worker fetch would 522 on). The SDK names no
15
- * backend or topology; the caller owns the predicate + the fetcher;
16
- * • optional SPA hook (e.g. `/ui/*` served from an `ASSETS` binding).
17
- *
18
- * The worker's OWN JWKS (`<url>/.well-known/jwks.json`) is served as a normal
19
- * route by `createRemoteServer`; the verifier resolves a self-issued credential
20
- * from the in-memory key (see `auth/verify.ts`), so no self-fetch shim is needed.
21
- *
22
- * The worker file is then just schema + methods + a `build(url, env)` callback.
23
- */
24
-
25
- import type { ExecutionContext } from 'hono'
26
-
27
- import type { RemoteServerConfig } from './config.js'
28
-
29
- import { createRemoteServer } from './create.js'
30
- import { requireEnv } from './require-env.js'
31
- import { canonicalizeServingUrl } from './serving-url.js'
32
-
33
- export type Fetcher = { fetch(request: Request): Response | Promise<Response> }
34
- export type WorkerApp = {
35
- fetch(
36
- request: Request,
37
- env?: unknown,
38
- executionCtx?: ExecutionContext,
39
- ): Response | Promise<Response>
40
- }
41
-
42
- /** A built app cached by its serving URL: `origin` for same-origin matching,
43
- * `app` for in-process self-dispatch. */
44
- type CachedApp = { origin: string; app: WorkerApp }
45
-
46
- /**
47
- * Choose where an OUTBOUND subrequest to `u` is routed — or `null` to let the
48
- * real `fetch` handle it. Order matters and same-origin wins FIRST: a call to
49
- * this worker's OWN serving origin is a self-dispatch, not an edge fetch — and
50
- * the caller's `routeSubrequest` policy may itself match our own host (e.g. an
51
- * `isInstanceHost` predicate matches every `*.svc.astrale.ai`, ours included),
52
- * so it must never get first look at a same-origin call.
53
- *
54
- * • same-origin + SELF binding present → the SELF fetcher: a fresh same-script
55
- * invocation. The normal Cloudflare path — a Worker can't fetch its own
56
- * hostname over the edge, so it re-enters itself through the binding.
57
- * • same-origin + NO SELF binding → the cached app, dispatched IN-PROCESS. A
58
- * Workers-for-Platforms dispatch-namespace tenant can't service-bind to
59
- * itself (its script name is platform-renamed), so it has no SELF binding; an
60
- * in-process dispatch reaches the same script with no edge hop and no binding.
61
- * `App` and the SELF `Fetcher` share the `{ fetch(request) }` shape, so the
62
- * caller drives both identically.
63
- * • else, the caller's `routeSubrequest` policy matched → its fetcher.
64
- * • else → `null`: passthrough to the real network fetch.
65
- *
66
- * Pure (no closure over instance state) so the routing decision is unit-testable
67
- * without standing up a real app.
68
- */
69
- export function selectSubrequestTarget<TDeps>(
70
- u: URL,
71
- ctx: {
72
- self: Fetcher | null
73
- apps: Iterable<CachedApp>
74
- routeEnv: TDeps | null
75
- routeSubrequest?: (url: URL, env: TDeps) => Fetcher | null | undefined
76
- },
77
- ): { fetch(request: Request): Response | Promise<Response> } | null {
78
- // Same-origin self-subrequest → the same script (SELF binding, else in-process).
79
- for (const cached of ctx.apps) {
80
- if (cached.origin === u.origin) return ctx.self ?? cached.app
81
- }
82
- // Caller policy (e.g. a platform router on the same zone) → its fetcher.
83
- if (ctx.routeSubrequest && ctx.routeEnv) {
84
- const via = ctx.routeSubrequest(u, ctx.routeEnv)
85
- if (via) return via
86
- }
87
- return null
88
- }
89
-
90
- export interface WorkerEntryConfig<TDeps> {
91
- /**
92
- * Build the `createRemoteServer` config for the resolved serving `url`. Called
93
- * once per distinct URL (the resulting app is cached), with the same `env` the
94
- * request carries — so it can read additional bindings (e.g. a base domain).
95
- */
96
- build: (url: string, env: TDeps) => RemoteServerConfig<TDeps>
97
- /**
98
- * Resolve the raw serving URL from `env` (+ the per-request origin, for workers
99
- * that fall back to the request host). Defaults to the `WORKER_URL` env var.
100
- * The result is always canonicalized before use.
101
- *
102
- * The `requestOrigin` honors an `X-Forwarded-Proto: https` upgrade (see
103
- * `clientOrigin`), so a dev worker behind a TLS-terminating proxy (cloudflared
104
- * tunnel, reverse proxy) resolves its public `https://` origin, not the raw
105
- * `http://` one workerd sees.
106
- */
107
- resolveUrl?: (env: TDeps, requestOrigin: string) => string
108
- /** Optional: the `SELF` service binding used to route same-host subrequests. */
109
- selfBinding?: (env: TDeps) => Fetcher | null | undefined
110
- /**
111
- * Optional, vendor-neutral: route an OUTBOUND subrequest through a
112
- * caller-supplied fetcher instead of the network — for hosts a Worker can't
113
- * reach directly over the edge (e.g. a platform router on the SAME zone:
114
- * Cloudflare 522s a same-zone Worker→Worker public `fetch`). Return a `Fetcher`
115
- * to route the request through, or null/undefined to fall through to the normal
116
- * fetch. The SDK names no backend or topology — the CALLER owns BOTH the
117
- * predicate (which hosts) and the fetcher (the binding). This generalizes
118
- * `selfBinding` (same-origin → SELF) to any caller policy; both are honored.
119
- */
120
- routeSubrequest?: (url: URL, env: TDeps) => Fetcher | null | undefined
121
- /**
122
- * Optional: handle a request before it reaches the kernel app — e.g. serve a
123
- * SPA under `/ui/*` or a same-origin `/api/*` endpoint the view calls. Return
124
- * a `Response` to short-circuit, or `undefined` to fall through to the domain
125
- * dispatch.
126
- */
127
- before?: (
128
- env: TDeps,
129
- url: URL,
130
- request: Request,
131
- ) => Response | undefined | Promise<Response | undefined>
132
- /**
133
- * Optional: transform the request on the fall-through path, just before it
134
- * reaches the kernel app (e.g. rewrite the hostname for wildcard-subdomain
135
- * routing). Not applied when `before` short-circuits.
136
- */
137
- rewriteRequest?: (env: TDeps, request: Request) => Request
138
- }
139
-
140
- export interface AppWorkerEntryConfig<TDeps> extends Omit<WorkerEntryConfig<TDeps>, 'build'> {
141
- buildApp: (url: string, env: TDeps) => WorkerApp
142
- }
143
-
144
- export interface WorkerEntry<TDeps> {
145
- fetch(request: Request, env: TDeps, executionCtx?: ExecutionContext): Response | Promise<Response>
146
- }
147
-
148
- /**
149
- * The request origin as the CLIENT reached it — i.e. the origin a fallback
150
- * serving URL (and therefore the `iss`) may be derived from. Behind a
151
- * TLS-terminating proxy (a cloudflared tunnel in front of `wrangler dev`, any
152
- * reverse proxy) the worker sees plain HTTP, so `request.url` says `http://…`
153
- * while the public URL is `https://…`; the proxy advertises the original
154
- * scheme via `X-Forwarded-Proto`. Honoring it is restricted to the http→https
155
- * UPGRADE of the SAME host (never a downgrade, never a host change), so a
156
- * spoofed header can at worst derive an `iss` the kernel's JWKS check then
157
- * fails — it can never make this worker speak for another origin.
158
- */
159
- export function clientOrigin(url: URL, request: Request): string {
160
- if (url.protocol !== 'http:') return url.origin
161
- const forwarded = request.headers.get('x-forwarded-proto')
162
- // Multiple proxies append: "https, http" — the first hop is the client-facing one.
163
- const scheme = forwarded?.split(',')[0]?.trim().toLowerCase()
164
- return scheme === 'https' ? `https://${url.host}` : url.origin
165
- }
166
-
167
- /**
168
- * Build a `before` hook that serves a static-asset `binding` (e.g. a Workers
169
- * Assets binding) mounted under `base` (default `/ui`) — the runtime half of an
170
- * adapter env's client-asset config. Returns `undefined` for non-matching paths
171
- * (and when no binding is present) so the request falls through to domain dispatch.
172
- *
173
- * Asset URLs are rooted at `base` (a client bundler sets `base: '<base>/'`);
174
- * this hook strips that prefix before delegating to the binding, so
175
- * `<base>/x.js` resolves from the binding's root. When `devProxy` yields a URL
176
- * (local dev), requests are proxied there instead — the seam for a bundler's
177
- * HMR dev server. Whether unknown sub-paths fall back to `index.html` is the
178
- * binding's own concern (e.g. wrangler's `not_found_handling`), not baked in
179
- * here.
180
- *
181
- * Lives here, type-checked and testable, instead of being emitted as a string
182
- * by every adapter's worker codegen.
183
- */
184
- export function assets<TDeps>(opts: {
185
- base?: string
186
- binding: (env: TDeps) => Fetcher | null | undefined
187
- devProxy?: (env: TDeps) => string | null | undefined
188
- }): (env: TDeps, url: URL, request: Request) => Response | Promise<Response> | undefined {
189
- const base = (opts.base ?? '/ui').replace(/\/+$/, '')
190
- const prefix = `${base}/`
191
- return (env, url, request) => {
192
- const binding = opts.binding(env)
193
- if (!binding) return undefined
194
- if (url.pathname !== base && !url.pathname.startsWith(prefix)) return undefined
195
- const devUrl = opts.devProxy?.(env)
196
- if (devUrl) {
197
- const devBase = devUrl.replace(/\/+$/, '')
198
- return fetch(new Request(`${devBase}${url.pathname}${url.search}`, request))
199
- }
200
- // `<base>` → `/`, `<base>/x` → `/x`: serve from the binding's root.
201
- const stripped = url.pathname.slice(base.length) || '/'
202
- const rewritten = new URL(stripped + url.search, url.origin)
203
- return binding.fetch(new Request(rewritten, request))
204
- }
205
- }
206
-
207
- export function createWorkerEntry<TDeps>(config: WorkerEntryConfig<TDeps>): WorkerEntry<TDeps> {
208
- return createAppWorkerEntry({
209
- ...config,
210
- buildApp: (url, env) => createRemoteServer<TDeps>(config.build(url, env)).app,
211
- })
212
- }
213
-
214
- export function createAppWorkerEntry<TDeps>(
215
- config: AppWorkerEntryConfig<TDeps>,
216
- ): WorkerEntry<TDeps> {
217
- // Cache the built app per distinct resolved URL — plural and bounded. On the
218
- // request-origin fallback the URL legitimately alternates for one worker
219
- // (direct http hits vs https-upgraded tunnel hits, workers.dev + custom
220
- // domain), and a single slot would tear down and rebuild the whole app on
221
- // every alternation. The bound caps abuse via attacker-minted Host /
222
- // X-Forwarded-Proto values on that same fallback path.
223
- const MAX_CACHED_APPS = 4
224
- const apps = new Map<string, CachedApp>()
225
- let self: Fetcher | null = null
226
- let routeEnv: TDeps | null = null
227
-
228
- function getApp(url: string, env: TDeps): WorkerApp {
229
- const cached = apps.get(url)
230
- if (cached) return cached.app
231
- const app = config.buildApp(url, env)
232
- if (apps.size >= MAX_CACHED_APPS) {
233
- const oldest = apps.keys().next().value
234
- if (oldest !== undefined) apps.delete(oldest)
235
- }
236
- apps.set(url, { origin: new URL(url).origin, app })
237
- return app
238
- }
239
-
240
- // A Worker can't fetch its own hostname over the edge, nor — on Cloudflare — a
241
- // same-zone hostname routed to another Worker (the `routeSubrequest` case).
242
- // When either is configured, override `globalThis.fetch` to redirect those
243
- // subrequests through the right target (see `selectSubrequestTarget`). Workers
244
- // with neither selfBinding nor routeSubrequest get no global mutation. (A
245
- // self-issued credential's JWKS is resolved in-memory by the verifier, not
246
- // fetched — see `auth/verify.ts` — so no self-JWKS shim is needed.)
247
- if (config.selfBinding || config.routeSubrequest) {
248
- const originalFetch = globalThis.fetch
249
- globalThis.fetch = (async (input: RequestInfo | URL, init?: RequestInit) => {
250
- const href = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url
251
- try {
252
- const target = selectSubrequestTarget(new URL(href), {
253
- self,
254
- apps: apps.values(),
255
- routeEnv,
256
- routeSubrequest: config.routeSubrequest,
257
- })
258
- if (target) return target.fetch(new Request(input, init))
259
- } catch {
260
- // non-absolute URL — fall through to the original fetch
261
- }
262
- return originalFetch(input, init)
263
- }) as typeof fetch
264
- }
265
-
266
- return {
267
- async fetch(request: Request, env: TDeps, executionCtx?: ExecutionContext): Promise<Response> {
268
- if (config.selfBinding) self ??= config.selfBinding(env) ?? null
269
- if (config.routeSubrequest) routeEnv = env
270
- // Only parse the request URL when a hook actually needs it.
271
- const requestUrl = config.before || config.resolveUrl ? new URL(request.url) : null
272
- if (config.before && requestUrl) {
273
- // Await so an async `before` that resolves to `undefined` falls through
274
- // (a returned Promise<undefined> would otherwise be sent as the response).
275
- const handled = await config.before(env, requestUrl, request)
276
- if (handled !== undefined) return handled
277
- }
278
- const raw = config.resolveUrl
279
- ? config.resolveUrl(env, clientOrigin(requestUrl!, request))
280
- : requireEnv(env, 'WORKER_URL', "the worker's public serving URL (its iss identity)")
281
- const url = canonicalizeServingUrl(raw)
282
- const dispatched = config.rewriteRequest ? config.rewriteRequest(env, request) : request
283
- return getApp(url, env).fetch(dispatched, env, executionCtx)
284
- },
285
- }
286
- }
@@ -1,164 +0,0 @@
1
- import type { FunctionBinding } from '@astrale-os/kernel-api/routed'
2
- import type { FunctionSchema } from '@astrale-os/kernel-core/domain'
3
-
4
- import { deriveAllowedAlgorithms } from '@astrale-os/kernel-core'
5
- import { functionBindingSchema, functionOutputSchema } from '@astrale-os/kernel-core/domain'
6
- import { importJWK, jwtVerify } from 'jose'
7
- import { z } from 'zod'
8
-
9
- import type { RemoteIdentityConfig } from '../auth/identity.js'
10
-
11
- import { signCredential } from '../auth/sign.js'
12
-
13
- export const SERVICE_FUNCTIONS_PATH = '/_astrale/functions'
14
- export const SERVICE_FUNCTIONS_PURPOSE = 'astrale.service-functions.v1'
15
-
16
- const JsonSchema = z.record(z.string(), z.unknown())
17
-
18
- export const ServiceFunctionManifestEntrySchema = z.object({
19
- slug: z.string().regex(/^[a-z][a-z0-9-]*$/),
20
- ref: z.string().regex(/^function\.[a-z][a-z0-9-]*$/),
21
- inputSchema: JsonSchema,
22
- outputSchema: JsonSchema,
23
- output: functionOutputSchema.default('value'),
24
- binding: functionBindingSchema.unwrap(),
25
- })
26
-
27
- export const ServiceFunctionManifestSchema = z.object({
28
- version: z.literal(1),
29
- service: z.object({ issuer: z.string().min(1), subject: z.string().min(1) }),
30
- functions: z.array(ServiceFunctionManifestEntrySchema).max(500),
31
- })
32
-
33
- export const ServiceFunctionDiscoveryRequestSchema = z.object({
34
- kernelIssuer: z.string().url(),
35
- nonce: z.string().min(16).max(256),
36
- })
37
-
38
- export const ServiceFunctionDiscoveryResponseSchema = ServiceFunctionManifestSchema.extend({
39
- identity: z.object({ credential: z.string().min(1) }),
40
- })
41
-
42
- export type ServiceFunctionManifestEntry = z.infer<typeof ServiceFunctionManifestEntrySchema>
43
- export type ServiceFunctionManifest = z.infer<typeof ServiceFunctionManifestSchema>
44
- export type ServiceFunctionDiscoveryRequest = z.infer<typeof ServiceFunctionDiscoveryRequestSchema>
45
- export type ServiceFunctionDiscoveryResponse = z.infer<
46
- typeof ServiceFunctionDiscoveryResponseSchema
47
- >
48
-
49
- export function toServiceFunctionManifestEntries(
50
- schemas: readonly FunctionSchema[],
51
- ): ServiceFunctionManifestEntry[] {
52
- return schemas
53
- .map((schema) => {
54
- const slug = schema.ref.slice('function.'.length)
55
- return ServiceFunctionManifestEntrySchema.parse({
56
- slug,
57
- ref: schema.ref,
58
- inputSchema: schema.inputSchema,
59
- outputSchema: schema.outputSchema,
60
- output: schema.output ?? 'value',
61
- binding: schema.binding,
62
- })
63
- })
64
- .sort((a, b) => a.slug.localeCompare(b.slug))
65
- }
66
-
67
- export async function signServiceFunctionManifest(
68
- manifest: ServiceFunctionManifest,
69
- request: ServiceFunctionDiscoveryRequest,
70
- identity: RemoteIdentityConfig,
71
- ): Promise<ServiceFunctionDiscoveryResponse> {
72
- const parsedManifest = ServiceFunctionManifestSchema.parse(manifest)
73
- const manifestHash = await hashServiceFunctionManifest(parsedManifest)
74
- const credential = await signCredential(
75
- { purpose: SERVICE_FUNCTIONS_PURPOSE, nonce: request.nonce, manifestHash },
76
- {
77
- issuer: identity.issuer,
78
- subject: identity.subject,
79
- audience: request.kernelIssuer,
80
- privateKey: identity.privateKey,
81
- ttl: '2m',
82
- },
83
- )
84
- return { ...parsedManifest, identity: { credential } }
85
- }
86
-
87
- export async function verifyServiceFunctionManifest(
88
- input: unknown,
89
- expected: {
90
- kernelIssuer: string
91
- nonce: string
92
- serviceIssuer: string
93
- serviceSubject: string
94
- publicKey: JsonWebKey
95
- },
96
- ): Promise<ServiceFunctionDiscoveryResponse> {
97
- const response = ServiceFunctionDiscoveryResponseSchema.parse(input)
98
- if (
99
- response.service.issuer !== expected.serviceIssuer ||
100
- response.service.subject !== expected.serviceSubject
101
- ) {
102
- throw new Error('service function manifest identity does not match the deployed Service')
103
- }
104
-
105
- const algorithms = deriveAllowedAlgorithms(expected.publicKey)
106
- const algorithm = algorithms[0]
107
- if (!algorithm) throw new Error('service function manifest public key has no supported algorithm')
108
- const key = await importJWK(expected.publicKey, algorithm)
109
- const verified = await jwtVerify(response.identity.credential, key, {
110
- algorithms,
111
- issuer: expected.serviceIssuer,
112
- subject: expected.serviceSubject,
113
- audience: expected.kernelIssuer,
114
- })
115
- const expectedHash = await hashServiceFunctionManifest({
116
- version: response.version,
117
- service: response.service,
118
- functions: response.functions,
119
- })
120
- if (verified.payload.purpose !== SERVICE_FUNCTIONS_PURPOSE) {
121
- throw new Error('service function manifest credential has the wrong purpose')
122
- }
123
- if (verified.payload.nonce !== expected.nonce) {
124
- throw new Error('service function manifest credential has the wrong nonce')
125
- }
126
- if (verified.payload.manifestHash !== expectedHash) {
127
- throw new Error('service function manifest credential does not cover the returned manifest')
128
- }
129
- return response
130
- }
131
-
132
- export async function hashServiceFunctionManifest(
133
- manifest: ServiceFunctionManifest,
134
- ): Promise<string> {
135
- const bytes = new TextEncoder().encode(
136
- canonicalJson(ServiceFunctionManifestSchema.parse(manifest)),
137
- )
138
- const digest = await crypto.subtle.digest('SHA-256', bytes)
139
- return `sha256:${hex(new Uint8Array(digest))}`
140
- }
141
-
142
- export function functionBindingForManifest(
143
- binding: FunctionBinding,
144
- auth: 'required' | 'optional' | 'public' | undefined,
145
- ): FunctionBinding {
146
- return { ...binding, auth: auth ?? 'required' }
147
- }
148
-
149
- function canonicalJson(value: unknown): string {
150
- if (value === null || typeof value !== 'object') return JSON.stringify(value)
151
- if (Array.isArray(value)) return `[${value.map(canonicalJson).join(',')}]`
152
- const entries = Object.entries(value as Record<string, unknown>)
153
- .filter(([, item]) => item !== undefined)
154
- .sort(([a], [b]) => a.localeCompare(b))
155
- return `{${entries
156
- .map(([key, item]) => `${JSON.stringify(key)}:${canonicalJson(item)}`)
157
- .join(',')}}`
158
- }
159
-
160
- function hex(bytes: Uint8Array): string {
161
- let value = ''
162
- for (const byte of bytes) value += byte.toString(16).padStart(2, '0')
163
- return value
164
- }
@@ -1,18 +0,0 @@
1
- export {
2
- SERVICE_FUNCTIONS_PATH,
3
- SERVICE_FUNCTIONS_PURPOSE,
4
- ServiceFunctionDiscoveryRequestSchema,
5
- ServiceFunctionDiscoveryResponseSchema,
6
- ServiceFunctionManifestEntrySchema,
7
- ServiceFunctionManifestSchema,
8
- hashServiceFunctionManifest,
9
- signServiceFunctionManifest,
10
- toServiceFunctionManifestEntries,
11
- verifyServiceFunctionManifest,
12
- } from './functions.js'
13
- export type {
14
- ServiceFunctionDiscoveryRequest,
15
- ServiceFunctionDiscoveryResponse,
16
- ServiceFunctionManifest,
17
- ServiceFunctionManifestEntry,
18
- } from './functions.js'
package/src/step/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export { createInlineStep } from './inline.js'
2
- export type { InlineStepOptions, StepExecutor } from './inline.js'
3
- export { buildStepRun } from './step.js'
4
- export type { FunctionStepScope, MethodStepScope, Step, StepRun, StepScope } from './step.js'
@@ -1,38 +0,0 @@
1
- import type { Step, StepRun, StepScope } from './step.js'
2
-
3
- import { buildStepRun, roundTripStepResult } from './step.js'
4
-
5
- export type StepExecutor = <T>(run: StepRun, handler: () => T | Promise<T>) => Promise<T>
6
-
7
- export type InlineStepOptions = {
8
- scope?: StepScope
9
- execute?: StepExecutor
10
- }
11
-
12
- export function createInlineStep(options: InlineStepOptions = {}): Step {
13
- const occurrences = new Map<string, number>()
14
- const execute = options.execute ?? inlineExecute
15
-
16
- return {
17
- async run(id, handler) {
18
- const run = buildStepRun(id, options.scope, nextOccurrence(id, options.scope, occurrences))
19
- return execute(run, handler)
20
- },
21
- }
22
- }
23
-
24
- async function inlineExecute<T>(run: StepRun, handler: () => T | Promise<T>): Promise<T> {
25
- const result = await handler()
26
- return roundTripStepResult(run.key, result)
27
- }
28
-
29
- function nextOccurrence(
30
- id: string,
31
- scope: StepScope | undefined,
32
- occurrences: Map<string, number>,
33
- ): number {
34
- const run = buildStepRun(id, scope, 0)
35
- const occurrence = occurrences.get(run.key) ?? 0
36
- occurrences.set(run.key, occurrence + 1)
37
- return occurrence
38
- }
package/src/step/step.ts DELETED
@@ -1,95 +0,0 @@
1
- export type Step = {
2
- run<T>(id: string, handler: () => T | Promise<T>): Promise<T>
3
- }
4
-
5
- export type MethodStepScope = {
6
- kind: 'method'
7
- ref: string
8
- owner: string
9
- method: string
10
- }
11
-
12
- export type FunctionStepScope = {
13
- kind: 'function'
14
- ref: string
15
- slug: string
16
- }
17
-
18
- export type StepScope = MethodStepScope | FunctionStepScope
19
-
20
- export type StepRun = {
21
- /** The author-provided id, normalized to the local id inside this scope. */
22
- id: string
23
- /** Backend-facing durable key, qualified by the method/function scope. */
24
- key: string
25
- /** Zero-based occurrence for repeated ids in one execution. */
26
- occurrence: number
27
- scope?: StepScope
28
- }
29
-
30
- export function requireStepId(id: string): string {
31
- if (typeof id !== 'string' || id.trim() === '') {
32
- throw new TypeError('step.run: id must be a non-empty string')
33
- }
34
- return id
35
- }
36
-
37
- export function buildStepRun(
38
- id: string,
39
- scope: StepScope | undefined,
40
- occurrence: number,
41
- ): StepRun {
42
- const stepId = requireStepId(localStepId(id, scope))
43
- const key = scope ? `${canonicalScope(scope)}.${stepId}` : stepId
44
- return {
45
- id: stepId,
46
- key,
47
- occurrence,
48
- ...(scope ? { scope } : {}),
49
- }
50
- }
51
-
52
- export function roundTripStepResult<T>(id: string, value: T): T {
53
- if (value === undefined) return value
54
-
55
- let serialized: string | undefined
56
- try {
57
- serialized = JSON.stringify(value)
58
- } catch (err) {
59
- throw new TypeError(
60
- `step.run("${id}"): result must be JSON-serializable: ${
61
- err instanceof Error ? err.message : String(err)
62
- }`,
63
- )
64
- }
65
-
66
- if (serialized === undefined) {
67
- throw new TypeError(`step.run("${id}"): result must be JSON-serializable`)
68
- }
69
-
70
- return JSON.parse(serialized) as T
71
- }
72
-
73
- function localStepId(id: string, scope: StepScope | undefined): string {
74
- if (!scope) return id
75
-
76
- for (const prefix of scopePrefixes(scope)) {
77
- const scoped = `${prefix}.`
78
- if (id.startsWith(scoped) && id.length > scoped.length) return id.slice(scoped.length)
79
- }
80
-
81
- return id
82
- }
83
-
84
- function scopePrefixes(scope: StepScope): string[] {
85
- switch (scope.kind) {
86
- case 'method':
87
- return [scope.ref, `${scope.owner}.${scope.method}`]
88
- case 'function':
89
- return [scope.ref, `function.${scope.slug}`]
90
- }
91
- }
92
-
93
- function canonicalScope(scope: StepScope): string {
94
- return scope.ref
95
- }