@astrale-os/sdk 0.4.11 → 0.4.13

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 (331) hide show
  1. package/dist/auth/authenticate.d.ts +1 -1
  2. package/dist/auth/authenticate.d.ts.map +1 -1
  3. package/dist/auth/authenticate.js +2 -2
  4. package/dist/auth/authenticate.js.map +1 -1
  5. package/dist/auth/check.js +1 -1
  6. package/dist/auth/check.js.map +1 -1
  7. package/dist/auth/function-context.d.ts +1 -1
  8. package/dist/auth/function-context.d.ts.map +1 -1
  9. package/dist/auth/function-context.js +3 -3
  10. package/dist/auth/function-context.js.map +1 -1
  11. package/dist/auth/index.d.ts +15 -15
  12. package/dist/auth/index.d.ts.map +1 -1
  13. package/dist/auth/index.js +10 -10
  14. package/dist/auth/index.js.map +1 -1
  15. package/dist/auth/issuer-mint.d.ts +1 -1
  16. package/dist/auth/issuer-mint.d.ts.map +1 -1
  17. package/dist/auth/issuer-mint.js +2 -2
  18. package/dist/auth/issuer-mint.js.map +1 -1
  19. package/dist/auth/kernel-client.d.ts +1 -1
  20. package/dist/auth/kernel-client.d.ts.map +1 -1
  21. package/dist/auth/kernel-client.js +2 -2
  22. package/dist/auth/kernel-client.js.map +1 -1
  23. package/dist/auth/resolve.d.ts +2 -2
  24. package/dist/auth/resolve.d.ts.map +1 -1
  25. package/dist/auth/resolve.js +2 -2
  26. package/dist/auth/resolve.js.map +1 -1
  27. package/dist/auth/verify.d.ts +1 -1
  28. package/dist/auth/verify.d.ts.map +1 -1
  29. package/dist/auth/verify.js +2 -2
  30. package/dist/auth/verify.js.map +1 -1
  31. package/dist/cli/bin.js +1 -1
  32. package/dist/cli/bin.js.map +1 -1
  33. package/dist/cli/index.d.ts +2 -2
  34. package/dist/cli/index.d.ts.map +1 -1
  35. package/dist/cli/index.js +2 -2
  36. package/dist/cli/index.js.map +1 -1
  37. package/dist/cli/publish.js +1 -1
  38. package/dist/cli/publish.js.map +1 -1
  39. package/dist/cli/run.d.ts +9 -3
  40. package/dist/cli/run.d.ts.map +1 -1
  41. package/dist/cli/run.js +55 -5
  42. package/dist/cli/run.js.map +1 -1
  43. package/dist/cli/spec.d.ts +1 -1
  44. package/dist/cli/spec.d.ts.map +1 -1
  45. package/dist/cli/spec.js +1 -1
  46. package/dist/cli/spec.js.map +1 -1
  47. package/dist/config/define-domain.d.ts +2 -2
  48. package/dist/config/define-domain.d.ts.map +1 -1
  49. package/dist/config/deploy.d.ts +2 -2
  50. package/dist/config/deploy.d.ts.map +1 -1
  51. package/dist/config/index.d.ts +6 -6
  52. package/dist/config/index.d.ts.map +1 -1
  53. package/dist/config/index.js +3 -3
  54. package/dist/config/index.js.map +1 -1
  55. package/dist/define/index.d.ts +4 -4
  56. package/dist/define/index.d.ts.map +1 -1
  57. package/dist/define/index.js +2 -2
  58. package/dist/define/index.js.map +1 -1
  59. package/dist/define/remote-function.d.ts +7 -5
  60. package/dist/define/remote-function.d.ts.map +1 -1
  61. package/dist/define/remote-function.js.map +1 -1
  62. package/dist/define/view.d.ts +3 -3
  63. package/dist/define/view.d.ts.map +1 -1
  64. package/dist/deploy/check.d.ts +1 -1
  65. package/dist/deploy/check.d.ts.map +1 -1
  66. package/dist/deploy/check.js +1 -1
  67. package/dist/deploy/check.js.map +1 -1
  68. package/dist/deploy/index.d.ts +2 -2
  69. package/dist/deploy/index.d.ts.map +1 -1
  70. package/dist/deploy/index.js +2 -2
  71. package/dist/deploy/index.js.map +1 -1
  72. package/dist/dispatch/authorize.js +1 -1
  73. package/dist/dispatch/authorize.js.map +1 -1
  74. package/dist/dispatch/dispatcher.d.ts +11 -21
  75. package/dist/dispatch/dispatcher.d.ts.map +1 -1
  76. package/dist/dispatch/dispatcher.js +66 -65
  77. package/dist/dispatch/dispatcher.js.map +1 -1
  78. package/dist/dispatch/execute.d.ts +7 -6
  79. package/dist/dispatch/execute.d.ts.map +1 -1
  80. package/dist/dispatch/execute.js +1 -0
  81. package/dist/dispatch/execute.js.map +1 -1
  82. package/dist/dispatch/identity.d.ts +2 -2
  83. package/dist/dispatch/identity.d.ts.map +1 -1
  84. package/dist/dispatch/index.d.ts +6 -6
  85. package/dist/dispatch/index.d.ts.map +1 -1
  86. package/dist/dispatch/index.js +6 -6
  87. package/dist/dispatch/index.js.map +1 -1
  88. package/dist/dispatch/resolve.d.ts +1 -1
  89. package/dist/dispatch/resolve.d.ts.map +1 -1
  90. package/dist/dispatch/self.d.ts +1 -1
  91. package/dist/dispatch/self.d.ts.map +1 -1
  92. package/dist/domain/build-spec.d.ts +1 -1
  93. package/dist/domain/build-spec.d.ts.map +1 -1
  94. package/dist/domain/build-spec.js +2 -2
  95. package/dist/domain/build-spec.js.map +1 -1
  96. package/dist/domain/contract.d.ts +1 -1
  97. package/dist/domain/contract.d.ts.map +1 -1
  98. package/dist/domain/define.d.ts +4 -4
  99. package/dist/domain/define.d.ts.map +1 -1
  100. package/dist/domain/define.js +2 -2
  101. package/dist/domain/define.js.map +1 -1
  102. package/dist/domain/extend-functions.d.ts +1 -1
  103. package/dist/domain/extend-functions.d.ts.map +1 -1
  104. package/dist/domain/extend-functions.js +1 -1
  105. package/dist/domain/extend-functions.js.map +1 -1
  106. package/dist/domain/extend-views.d.ts +1 -1
  107. package/dist/domain/extend-views.d.ts.map +1 -1
  108. package/dist/domain/extend-views.js +1 -1
  109. package/dist/domain/extend-views.js.map +1 -1
  110. package/dist/domain/index.d.ts +4 -4
  111. package/dist/domain/index.d.ts.map +1 -1
  112. package/dist/domain/index.js +3 -3
  113. package/dist/domain/index.js.map +1 -1
  114. package/dist/index.d.ts +19 -19
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +10 -10
  117. package/dist/index.js.map +1 -1
  118. package/dist/linter/analyze.d.ts +6 -0
  119. package/dist/linter/analyze.d.ts.map +1 -0
  120. package/dist/linter/analyze.js +12 -0
  121. package/dist/linter/analyze.js.map +1 -0
  122. package/dist/linter/diagnostic.d.ts +32 -0
  123. package/dist/linter/diagnostic.d.ts.map +1 -0
  124. package/dist/linter/diagnostic.js +35 -0
  125. package/dist/linter/diagnostic.js.map +1 -0
  126. package/dist/linter/index.d.ts +10 -0
  127. package/dist/linter/index.d.ts.map +1 -0
  128. package/dist/linter/index.js +6 -0
  129. package/dist/linter/index.js.map +1 -0
  130. package/dist/linter/lint.d.ts +8 -0
  131. package/dist/linter/lint.d.ts.map +1 -0
  132. package/dist/linter/lint.js +26 -0
  133. package/dist/linter/lint.js.map +1 -0
  134. package/dist/linter/oxlint/config.d.ts +14 -0
  135. package/dist/linter/oxlint/config.d.ts.map +1 -0
  136. package/dist/linter/oxlint/config.js +18 -0
  137. package/dist/linter/oxlint/config.js.map +1 -0
  138. package/dist/linter/oxlint/plugin.d.ts +13 -0
  139. package/dist/linter/oxlint/plugin.d.ts.map +1 -0
  140. package/dist/linter/oxlint/plugin.js +14 -0
  141. package/dist/linter/oxlint/plugin.js.map +1 -0
  142. package/dist/linter/oxlint/run.d.ts +7 -0
  143. package/dist/linter/oxlint/run.d.ts.map +1 -0
  144. package/dist/linter/oxlint/run.js +122 -0
  145. package/dist/linter/oxlint/run.js.map +1 -0
  146. package/dist/linter/preflight.d.ts +2 -0
  147. package/dist/linter/preflight.d.ts.map +1 -0
  148. package/dist/linter/preflight.js +162 -0
  149. package/dist/linter/preflight.js.map +1 -0
  150. package/dist/linter/project.d.ts +12 -0
  151. package/dist/linter/project.d.ts.map +1 -0
  152. package/dist/linter/project.js +88 -0
  153. package/dist/linter/project.js.map +1 -0
  154. package/dist/linter/report.d.ts +4 -0
  155. package/dist/linter/report.d.ts.map +1 -0
  156. package/dist/linter/report.js +22 -0
  157. package/dist/linter/report.js.map +1 -0
  158. package/dist/linter/rules/catalog.d.ts +56 -0
  159. package/dist/linter/rules/catalog.d.ts.map +1 -0
  160. package/dist/linter/rules/catalog.js +53 -0
  161. package/dist/linter/rules/catalog.js.map +1 -0
  162. package/dist/linter/rules/core-has-no-async.d.ts +3 -0
  163. package/dist/linter/rules/core-has-no-async.d.ts.map +1 -0
  164. package/dist/linter/rules/core-has-no-async.js +43 -0
  165. package/dist/linter/rules/core-has-no-async.js.map +1 -0
  166. package/dist/linter/rules/core-is-pure.d.ts +3 -0
  167. package/dist/linter/rules/core-is-pure.d.ts.map +1 -0
  168. package/dist/linter/rules/core-is-pure.js +74 -0
  169. package/dist/linter/rules/core-is-pure.js.map +1 -0
  170. package/dist/linter/rules/no-nested-steps.d.ts +3 -0
  171. package/dist/linter/rules/no-nested-steps.d.ts.map +1 -0
  172. package/dist/linter/rules/no-nested-steps.js +32 -0
  173. package/dist/linter/rules/no-nested-steps.js.map +1 -0
  174. package/dist/linter/rules/no-read-inside-mutate.d.ts +3 -0
  175. package/dist/linter/rules/no-read-inside-mutate.d.ts.map +1 -0
  176. package/dist/linter/rules/no-read-inside-mutate.js +64 -0
  177. package/dist/linter/rules/no-read-inside-mutate.js.map +1 -0
  178. package/dist/linter/rules/one-remote-definition-per-file.d.ts +3 -0
  179. package/dist/linter/rules/one-remote-definition-per-file.d.ts.map +1 -0
  180. package/dist/linter/rules/one-remote-definition-per-file.js +23 -0
  181. package/dist/linter/rules/one-remote-definition-per-file.js.map +1 -0
  182. package/dist/linter/rules/oxlint-ast.d.ts +30 -0
  183. package/dist/linter/rules/oxlint-ast.d.ts.map +1 -0
  184. package/dist/linter/rules/oxlint-ast.js +104 -0
  185. package/dist/linter/rules/oxlint-ast.js.map +1 -0
  186. package/dist/linter/rules/oxlint-rule.d.ts +45 -0
  187. package/dist/linter/rules/oxlint-rule.d.ts.map +1 -0
  188. package/dist/linter/rules/oxlint-rule.js +2 -0
  189. package/dist/linter/rules/oxlint-rule.js.map +1 -0
  190. package/dist/linter/rules/project-rule.d.ts +10 -0
  191. package/dist/linter/rules/project-rule.d.ts.map +1 -0
  192. package/dist/linter/rules/project-rule.js +24 -0
  193. package/dist/linter/rules/project-rule.js.map +1 -0
  194. package/dist/linter/rules/thin-schema-composition-root.d.ts +3 -0
  195. package/dist/linter/rules/thin-schema-composition-root.d.ts.map +1 -0
  196. package/dist/linter/rules/thin-schema-composition-root.js +23 -0
  197. package/dist/linter/rules/thin-schema-composition-root.js.map +1 -0
  198. package/dist/linter/source.d.ts +24 -0
  199. package/dist/linter/source.d.ts.map +1 -0
  200. package/dist/linter/source.js +279 -0
  201. package/dist/linter/source.js.map +1 -0
  202. package/dist/linter/suppression.d.ts +3 -0
  203. package/dist/linter/suppression.d.ts.map +1 -0
  204. package/dist/linter/suppression.js +11 -0
  205. package/dist/linter/suppression.js.map +1 -0
  206. package/dist/method/class.d.ts +3 -3
  207. package/dist/method/class.d.ts.map +1 -1
  208. package/dist/method/context.d.ts +6 -4
  209. package/dist/method/context.d.ts.map +1 -1
  210. package/dist/method/index.d.ts +5 -5
  211. package/dist/method/index.d.ts.map +1 -1
  212. package/dist/method/index.js +2 -2
  213. package/dist/method/index.js.map +1 -1
  214. package/dist/method/single.d.ts +2 -2
  215. package/dist/method/single.d.ts.map +1 -1
  216. package/dist/server/auxiliary-routes.d.ts +3 -3
  217. package/dist/server/auxiliary-routes.d.ts.map +1 -1
  218. package/dist/server/auxiliary-routes.js +11 -11
  219. package/dist/server/auxiliary-routes.js.map +1 -1
  220. package/dist/server/config.d.ts +1 -1
  221. package/dist/server/config.d.ts.map +1 -1
  222. package/dist/server/create.d.ts +2 -2
  223. package/dist/server/create.d.ts.map +1 -1
  224. package/dist/server/create.js +11 -11
  225. package/dist/server/create.js.map +1 -1
  226. package/dist/server/domain-entry.d.ts +5 -5
  227. package/dist/server/domain-entry.d.ts.map +1 -1
  228. package/dist/server/domain-entry.js +2 -2
  229. package/dist/server/domain-entry.js.map +1 -1
  230. package/dist/server/index.d.ts +11 -11
  231. package/dist/server/index.d.ts.map +1 -1
  232. package/dist/server/index.js +7 -7
  233. package/dist/server/index.js.map +1 -1
  234. package/dist/server/start.d.ts +1 -1
  235. package/dist/server/start.d.ts.map +1 -1
  236. package/dist/server/start.js.map +1 -1
  237. package/dist/server/worker-entry.d.ts +1 -1
  238. package/dist/server/worker-entry.d.ts.map +1 -1
  239. package/dist/server/worker-entry.js +3 -3
  240. package/dist/server/worker-entry.js.map +1 -1
  241. package/dist/step/index.d.ts +4 -4
  242. package/dist/step/index.d.ts.map +1 -1
  243. package/dist/step/index.js +2 -2
  244. package/dist/step/index.js.map +1 -1
  245. package/dist/step/inline.d.ts +1 -1
  246. package/dist/step/inline.d.ts.map +1 -1
  247. package/dist/step/inline.js +1 -1
  248. package/dist/step/inline.js.map +1 -1
  249. package/package.json +29 -8
  250. package/src/auth/authenticate.ts +3 -3
  251. package/src/auth/check.ts +1 -1
  252. package/src/auth/function-context.ts +4 -4
  253. package/src/auth/index.ts +15 -15
  254. package/src/auth/issuer-mint.ts +3 -3
  255. package/src/auth/kernel-client.ts +3 -3
  256. package/src/auth/resolve.ts +4 -4
  257. package/src/auth/verify.ts +3 -3
  258. package/src/cli/bin.ts +1 -1
  259. package/src/cli/index.ts +2 -2
  260. package/src/cli/publish.ts +1 -1
  261. package/src/cli/run.ts +59 -8
  262. package/src/cli/spec.ts +3 -3
  263. package/src/config/define-domain.ts +2 -2
  264. package/src/config/deploy.ts +2 -2
  265. package/src/config/index.ts +6 -6
  266. package/src/define/index.ts +4 -4
  267. package/src/define/remote-function.ts +7 -5
  268. package/src/define/view.ts +3 -3
  269. package/src/deploy/check.ts +2 -2
  270. package/src/deploy/index.ts +2 -2
  271. package/src/dispatch/authorize.ts +1 -1
  272. package/src/dispatch/dispatcher.ts +76 -83
  273. package/src/dispatch/execute.ts +8 -6
  274. package/src/dispatch/identity.ts +2 -2
  275. package/src/dispatch/index.ts +6 -6
  276. package/src/dispatch/resolve.ts +1 -1
  277. package/src/dispatch/self.ts +1 -1
  278. package/src/domain/build-spec.ts +4 -4
  279. package/src/domain/contract.ts +1 -1
  280. package/src/domain/define.ts +6 -6
  281. package/src/domain/extend-functions.ts +2 -2
  282. package/src/domain/extend-views.ts +2 -2
  283. package/src/domain/index.ts +4 -4
  284. package/src/index.ts +20 -20
  285. package/src/linter/analyze.ts +17 -0
  286. package/src/linter/diagnostic.ts +68 -0
  287. package/src/linter/docs/DIAGNOSTICS.md +47 -0
  288. package/src/linter/docs/JUDGMENT.md +81 -0
  289. package/src/linter/docs/PRINCIPLES.md +97 -0
  290. package/src/linter/docs/README.md +38 -0
  291. package/src/linter/docs/RULE-AUTHORING.md +144 -0
  292. package/src/linter/docs/RULES.md +153 -0
  293. package/src/linter/index.ts +14 -0
  294. package/src/linter/lint.ts +32 -0
  295. package/src/linter/oxlint/astrale-ox.d.ts +5 -0
  296. package/src/linter/oxlint/config.ts +19 -0
  297. package/src/linter/oxlint/plugin.js +16 -0
  298. package/src/linter/oxlint/run.ts +162 -0
  299. package/src/linter/preflight.ts +181 -0
  300. package/src/linter/project.ts +108 -0
  301. package/src/linter/report.ts +25 -0
  302. package/src/linter/rules/catalog.ts +67 -0
  303. package/src/linter/rules/core-has-no-async.js +43 -0
  304. package/src/linter/rules/core-is-pure.ts +103 -0
  305. package/src/linter/rules/no-nested-steps.js +37 -0
  306. package/src/linter/rules/no-read-inside-mutate.js +72 -0
  307. package/src/linter/rules/one-remote-definition-per-file.ts +29 -0
  308. package/src/linter/rules/oxlint-ast.js +110 -0
  309. package/src/linter/rules/oxlint-rule.ts +35 -0
  310. package/src/linter/rules/project-rule.ts +37 -0
  311. package/src/linter/rules/thin-schema-composition-root.ts +26 -0
  312. package/src/linter/source.ts +323 -0
  313. package/src/linter/suppression.ts +11 -0
  314. package/src/method/class.ts +3 -3
  315. package/src/method/context.ts +6 -4
  316. package/src/method/index.ts +5 -5
  317. package/src/method/single.ts +2 -2
  318. package/src/server/auxiliary-routes.ts +22 -17
  319. package/src/server/config.ts +1 -1
  320. package/src/server/create.ts +15 -15
  321. package/src/server/domain-entry.ts +7 -7
  322. package/src/server/index.ts +11 -11
  323. package/src/server/start.ts +3 -2
  324. package/src/server/worker-entry.ts +4 -4
  325. package/src/step/index.ts +4 -4
  326. package/src/step/inline.ts +2 -2
  327. package/dist/defer/index.d.ts +0 -24
  328. package/dist/defer/index.d.ts.map +0 -1
  329. package/dist/defer/index.js +0 -42
  330. package/dist/defer/index.js.map +0 -1
  331. package/src/defer/index.ts +0 -64
@@ -24,11 +24,11 @@ import type { Schema } from '@astrale-os/kernel-dsl'
24
24
  import { AbsolutePath } from '@astrale-os/kernel-core'
25
25
  import { hashInstallGraph, serialize, zodToJsonSchema } from '@astrale-os/kernel-core/domain'
26
26
 
27
- import type { AnyRemoteHandler } from '../method/single'
28
- import type { RemoteDomain } from './define'
27
+ import type { AnyRemoteHandler } from '../method/single.js'
28
+ import type { RemoteDomain } from './define.js'
29
29
 
30
- import { extractBinding } from './contract'
31
- import { materializeRemoteDomain } from './define'
30
+ import { extractBinding } from './contract.js'
31
+ import { materializeRemoteDomain } from './define.js'
32
32
 
33
33
  /**
34
34
  * Build the install-ready wire graph for a domain served at `url`: materialize
@@ -14,7 +14,7 @@ import type {
14
14
  } from '@astrale-os/kernel-api/routed'
15
15
  import type { BoundMethod } from '@astrale-os/kernel-core/domain'
16
16
 
17
- import type { AnyRemoteHandler } from '../method/single'
17
+ import type { AnyRemoteHandler } from '../method/single.js'
18
18
 
19
19
  export function toSdkContract(method: BoundMethod<AnyRemoteHandler>): MountableContract {
20
20
  const handler = method.handler as {
@@ -14,17 +14,17 @@ import type { Core, Schema } from '@astrale-os/kernel-dsl'
14
14
 
15
15
  import { bindMethods, compileDomain } from '@astrale-os/kernel-core/domain'
16
16
 
17
- import type { DomainManifest } from '../config/define-domain'
18
- import type { AnyRemoteFunctionDef, ViewDef } from '../define'
19
- import type { SchemaMethodsImpl } from '../method/class'
20
- import type { AnyRemoteHandler } from '../method/single'
17
+ import type { DomainManifest } from '../config/define-domain.js'
18
+ import type { AnyRemoteFunctionDef, ViewDef } from '../define/index.js'
19
+ import type { SchemaMethodsImpl } from '../method/class.js'
20
+ import type { AnyRemoteHandler } from '../method/single.js'
21
21
 
22
22
  import {
23
23
  assertFunctionsMatchSchema,
24
24
  buildFunctionSchemas,
25
25
  DEFAULT_FUNCTIONS_FOLDER,
26
- } from './extend-functions'
27
- import { buildViewDeclarations, buildViewSchemas, DEFAULT_VIEWS_FOLDER } from './extend-views'
26
+ } from './extend-functions.js'
27
+ import { buildViewDeclarations, buildViewSchemas, DEFAULT_VIEWS_FOLDER } from './extend-views.js'
28
28
 
29
29
  export type RemoteDomainConfig<S extends Schema, TDeps> = {
30
30
  schema: S
@@ -22,9 +22,9 @@ import type { Schema } from '@astrale-os/kernel-dsl'
22
22
 
23
23
  import { zodToJsonSchema } from '@astrale-os/kernel-core/domain'
24
24
 
25
- import type { AnyRemoteFunctionDef } from '../define/remote-function'
25
+ import type { AnyRemoteFunctionDef } from '../define/remote-function.js'
26
26
 
27
- import { resolveBinding } from './binding'
27
+ import { resolveBinding } from './binding.js'
28
28
 
29
29
  /**
30
30
  * Default URL segment for a function's worker route (`<url>/functions/<slug>`).
@@ -29,9 +29,9 @@ import {
29
29
  type EdgeEndpoint,
30
30
  } from '@astrale-os/kernel-dsl'
31
31
 
32
- import type { ViewDef } from '../define/view'
32
+ import type { ViewDef } from '../define/view.js'
33
33
 
34
- import { joinWorkerPath, resolveBinding } from './binding'
34
+ import { joinWorkerPath, resolveBinding } from './binding.js'
35
35
 
36
36
  /**
37
37
  * Default URL segment for a view's worker route (`<url>/views/<slug>`). Names the
@@ -1,4 +1,4 @@
1
- export { defineRemoteDomain } from './define'
2
- export type { RemoteDomain, RemoteDomainConfig } from './define'
3
- export { buildInstallGraph, buildInstallGraphHash } from './build-spec'
4
- export { toSdkContract } from './contract'
1
+ export { defineRemoteDomain } from './define.js'
2
+ export type { RemoteDomain, RemoteDomainConfig } from './define.js'
3
+ export { buildInstallGraph, buildInstallGraphHash } from './build-spec.js'
4
+ export { toSdkContract } from './contract.js'
package/src/index.ts CHANGED
@@ -14,15 +14,15 @@ export type {
14
14
  ClassMethodsImpl,
15
15
  InterfaceMethodsImpl,
16
16
  SchemaMethodsImpl,
17
- } from './method'
18
- export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method'
17
+ } from './method/index.js'
18
+ export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method/index.js'
19
19
 
20
20
  // ─── Domain configuration (astrale.config.ts) ────────────────────────────
21
21
  // The author-facing way to declare a standalone domain + how it deploys. The
22
22
  // runtime-domain COMPILER (`defineRemoteDomain`) is internal machinery — reach
23
23
  // it via the `@astrale-os/sdk/domain` subpath when hand-rolling a worker, or
24
24
  // (preferred) use `domainWorkerEntry` from `@astrale-os/sdk/server`.
25
- export { defineDomain, deploy, defineAdapter } from './config'
25
+ export { defineDomain, deploy, defineAdapter } from './config/index.js'
26
26
  export type {
27
27
  DefineDomainConfig,
28
28
  DomainDefinition,
@@ -35,10 +35,10 @@ export type {
35
35
  DomainInfo,
36
36
  WatchCtx,
37
37
  WatchHandle,
38
- } from './config'
38
+ } from './config/index.js'
39
39
 
40
40
  // ─── Install graph (advanced) ────────────────────────────────────────────
41
- export { buildInstallGraph, buildInstallGraphHash } from './domain'
41
+ export { buildInstallGraph, buildInstallGraphHash } from './domain/index.js'
42
42
 
43
43
  // ─── Graph patching (advanced) ────────────────────────────────────────
44
44
  // Author-facing patch types, re-exported from kernel-core (the single source).
@@ -67,20 +67,20 @@ export type {
67
67
  // the reserved views / functions folder, keyed by its map slug; the same
68
68
  // entry's `render` / `execute` (+ auth hooks) is mounted as a worker route by
69
69
  // `createRemoteServer`.
70
- export { defineView, defineRemoteFunction } from './define'
70
+ export { defineView, defineRemoteFunction } from './define/index.js'
71
71
  export type {
72
72
  ViewDef,
73
73
  ViewRenderContext,
74
74
  RemoteFunctionAuthorizeContext,
75
75
  RemoteFunctionDef,
76
76
  RemoteFunctionContext,
77
- } from './define'
77
+ } from './define/index.js'
78
78
 
79
79
  // ─── Durable-shaped steps ────────────────────────────────────────────────
80
- export type { Step } from './step'
80
+ export type { Step } from './step/index.js'
81
81
 
82
- // ─── Request lifecycle ───────────────────────────────────────────────────
83
- export type { Defer, DeferredTask } from './defer'
82
+ // ─── Invocation capabilities ─────────────────────────────────────────────
83
+ export type { Defer, DeferredTask, Sleep } from '@astrale-os/kernel-server'
84
84
 
85
85
  // ─── Server ──────────────────────────────────────────────────────────────
86
86
  // `createRemoteServer` dynamically imports `@hono/node-server` via `./server/start`.
@@ -94,8 +94,8 @@ export type { Defer, DeferredTask } from './defer'
94
94
  // module load time. Exporting it from the barrel poisons browser bundlers
95
95
  // (Vite/esbuild) that transitively load every re-export. Consumers that need it
96
96
  // import from './deploy' directly.
97
- export { MetaSchema } from './deploy/meta'
98
- export type { Meta } from './deploy/meta'
97
+ export { MetaSchema } from './deploy/meta.js'
98
+ export type { Meta } from './deploy/meta.js'
99
99
 
100
100
  // ─── Route binding (re-exported from kernel-api for consumer convenience) ─
101
101
  export type {
@@ -110,22 +110,22 @@ export type {
110
110
  } from '@astrale-os/kernel-api/routed'
111
111
 
112
112
  // ─── Auth ────────────────────────────────────────────────────────────────
113
- export type { RemoteIdentityConfig, AuthenticateResult } from './auth'
113
+ export type { RemoteIdentityConfig, AuthenticateResult } from './auth/index.js'
114
114
  export type {
115
115
  DomainAuthority,
116
116
  FunctionContextApi,
117
117
  FunctionCredentialOptions,
118
118
  FunctionKernelOptions,
119
119
  MintIssuedParams,
120
- } from './auth'
120
+ } from './auth/index.js'
121
121
  export {
122
122
  authenticateRequest,
123
123
  buildComposedGrant,
124
124
  makeFunctionContext,
125
125
  signCredential,
126
- } from './auth'
127
- export { AuthMissingError, AuthInvalidError } from './auth'
128
- export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth'
126
+ } from './auth/index.js'
127
+ export { AuthMissingError, AuthInvalidError } from './auth/index.js'
128
+ export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth/index.js'
129
129
  export type {
130
130
  AuthContext,
131
131
  Attestation,
@@ -137,11 +137,11 @@ export type {
137
137
  export { selfGrant } from '@astrale-os/kernel-core'
138
138
 
139
139
  // ─── Dispatch (escape hatch for custom integrations) ─────────────────────
140
- export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch'
140
+ export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch/index.js'
141
141
  export {
142
142
  AuthorizationDeniedError,
143
143
  MethodNotFoundError,
144
144
  SdkValidationError,
145
145
  SdkResultValidationError,
146
- } from './dispatch'
147
- export type { SelfResult, TypedSelf } from './dispatch'
146
+ } from './dispatch/index.js'
147
+ export type { SelfResult, TypedSelf } from './dispatch/index.js'
@@ -0,0 +1,17 @@
1
+ import type { LintDiagnostic } from './diagnostic.js'
2
+ import type { DomainProject } from './project.js'
3
+ import type { AnalyzerRule } from './rules/project-rule.js'
4
+
5
+ import { coreIsPure } from './rules/core-is-pure.js'
6
+ import { oneRemoteDefinitionPerFile } from './rules/one-remote-definition-per-file.js'
7
+ import { thinSchemaCompositionRoot } from './rules/thin-schema-composition-root.js'
8
+
9
+ export const analyzerRules: readonly AnalyzerRule[] = [
10
+ thinSchemaCompositionRoot,
11
+ oneRemoteDefinitionPerFile,
12
+ coreIsPure,
13
+ ]
14
+
15
+ export function analyzeProject(project: DomainProject): LintDiagnostic[] {
16
+ return analyzerRules.flatMap((rule) => rule.analyze(project))
17
+ }
@@ -0,0 +1,68 @@
1
+ import type { RuleOwner } from './rules/catalog.js'
2
+
3
+ export type DiagnosticSeverity = 'error' | 'warning'
4
+
5
+ export type DiagnosticLocation = {
6
+ path: string
7
+ line: number
8
+ column: number
9
+ offset?: number
10
+ length?: number
11
+ }
12
+
13
+ export type LintDiagnostic = {
14
+ id: string
15
+ severity: DiagnosticSeverity
16
+ message: string
17
+ help?: string
18
+ url?: string
19
+ owner: RuleOwner | 'generic'
20
+ location?: DiagnosticLocation
21
+ }
22
+
23
+ export type LintResult = {
24
+ root: string
25
+ diagnostics: LintDiagnostic[]
26
+ files: number
27
+ durationMs: number
28
+ exitCode: 0 | 1
29
+ }
30
+
31
+ export class LinterToolError extends Error {
32
+ readonly exitCode = 2
33
+
34
+ constructor(message: string, options?: ErrorOptions) {
35
+ super(message, options)
36
+ this.name = 'LinterToolError'
37
+ }
38
+ }
39
+
40
+ export function compareDiagnostics(a: LintDiagnostic, b: LintDiagnostic): number {
41
+ return (
42
+ (a.location?.path ?? '').localeCompare(b.location?.path ?? '') ||
43
+ (a.location?.line ?? 0) - (b.location?.line ?? 0) ||
44
+ (a.location?.column ?? 0) - (b.location?.column ?? 0) ||
45
+ a.id.localeCompare(b.id) ||
46
+ a.message.localeCompare(b.message)
47
+ )
48
+ }
49
+
50
+ export function dedupeDiagnostics(diagnostics: readonly LintDiagnostic[]): LintDiagnostic[] {
51
+ const seen = new Set<string>()
52
+ const result: LintDiagnostic[] = []
53
+ for (const diagnostic of diagnostics) {
54
+ const location = diagnostic.location
55
+ const key = [
56
+ diagnostic.id,
57
+ location?.path ?? '',
58
+ location?.line ?? 0,
59
+ location?.column ?? 0,
60
+ location?.length ?? 0,
61
+ diagnostic.message,
62
+ ].join(':')
63
+ if (seen.has(key)) continue
64
+ seen.add(key)
65
+ result.push(diagnostic)
66
+ }
67
+ return result.sort(compareDiagnostics)
68
+ }
@@ -0,0 +1,47 @@
1
+ # Diagnostics
2
+
3
+ Every Astrale diagnostic uses the engine-neutral `LintDiagnostic` model and contains:
4
+
5
+ - A stable `astrale/<slug>` identifier.
6
+ - `error` or `warning` severity.
7
+ - A message describing the violated invariant.
8
+ - Remediation and a documentation URL when available.
9
+ - A normalized source location when one exists.
10
+ - The policy owner: `sdk`, `oxlint`, or `analyzer`.
11
+
12
+ Messages describe domain policy rather than AST or analyzer implementation details. Engine changes must
13
+ not rename identifiers, suppressions, or output fields.
14
+
15
+ ## Output
16
+
17
+ Stylish output is intended for people. JSON output preserves the complete `LintResult` for automation.
18
+ Diagnostics are sorted by path, position, identifier, and message. Duplicate reports with the same
19
+ identifier and source span are collapsed because dual ownership is a tooling defect.
20
+
21
+ Exit codes are part of the contract:
22
+
23
+ - `0`: no enabled error remains.
24
+ - `1`: policy diagnostics failed the run.
25
+ - `2`: configuration, dependency resolution, or an underlying tool failed.
26
+
27
+ Project preflight failures are tool errors, not suppressible policy diagnostics. Their messages must
28
+ name the conflicting package or tool and preserve the original cause.
29
+
30
+ ## Suppressions
31
+
32
+ Astrale rules share one exact, engine-neutral suppression syntax:
33
+
34
+ ```ts
35
+ // astrale-disable-next-line astrale/raw-path-only-at-boundary -- provider cache key requires a string
36
+ const key = node.path.raw
37
+ ```
38
+
39
+ A suppression must:
40
+
41
+ - Name exact rule identifiers.
42
+ - Include a non-empty reason after `--`.
43
+ - Apply only to the following line.
44
+ - Continue to work if rule ownership moves between Oxlint and the analyzer.
45
+
46
+ Generic Oxlint rules continue to use Oxlint suppression syntax. Suppressions are exceptional evidence,
47
+ not compensation for an ambiguous or noisy rule.
@@ -0,0 +1,81 @@
1
+ # Static-analysis Judgment
2
+
3
+ Not every valuable Astrale practice is a static rule. The linter must be honest about what it cannot
4
+ prove.
5
+
6
+ ## False-positive budget
7
+
8
+ The burden of proof belongs to automation, not to the code author. If a rule cannot distinguish valid
9
+ code from a violation without inferring intent, its default disposition is `guidance` or `research`,
10
+ not `warning`.
11
+
12
+ Before implementing a rule, ask:
13
+
14
+ - Is the violation represented by syntax, resolved symbols, types, compiled schema, or an explicit
15
+ project contract?
16
+ - Can every common valid alternative be represented without a suppression?
17
+ - Does the diagnostic prevent a concrete failure often enough to justify its maintenance and review
18
+ cost?
19
+ - Would a narrower rule capture the mechanically decidable part without claiming the broader design
20
+ judgment?
21
+
22
+ The existence of a possible AST heuristic is not evidence that a rule should exist. Severity does not
23
+ solve ambiguity, and a local disable comment does not make systematic false positives acceptable.
24
+
25
+ ## Keep in knowledge and review
26
+
27
+ The following require domain or product judgment:
28
+
29
+ - Whether bounded-context names and ownership reflect the business correctly.
30
+ - Which context semantically owns a cross-context edge.
31
+ - Whether a generic relation should instead be assignment, tagging, blocking, duplication, hierarchy,
32
+ or mention behavior.
33
+ - Whether an authorization check targets the correct resource and permission.
34
+ - Whether an intentionally open callable is appropriate.
35
+ - Whether deletion should cascade, reject, preserve, archive, or detach related data.
36
+ - Whether import conflict, identity, partial-failure, and idempotency semantics are adequate.
37
+ - Whether a set of writes forms one business invariant.
38
+ - Whether a query projects every fact required by the use case.
39
+ - Whether a fresh read is actually required after receiving hydrated data.
40
+ - Whether a helper legitimately owns its own durable step.
41
+ - Whether UI vocabulary, hierarchy, and interaction design are domain-first and high quality.
42
+ - Whether a feature should exist at all.
43
+
44
+ These topics may have simulations, review checklists, or evidence collectors. They must not become
45
+ static diagnostics based on filenames or keywords.
46
+
47
+ The registry keeps these ideas with an explicit `guidance` disposition and rationale. This is a design
48
+ record, not an implementation backlog. A narrower replacement may be proposed later under its own
49
+ detection contract.
50
+
51
+ ## Heuristic promotion
52
+
53
+ A heuristic may begin as an opt-in warning when it provides useful evidence, but its message must say
54
+ what was observed rather than claim intent.
55
+
56
+ For example:
57
+
58
+ ```text
59
+ Observed 101 get() calls after one children() page in scenario delete-large-issue.
60
+ ```
61
+
62
+ is valid evidence. The following overclaims:
63
+
64
+ ```text
65
+ Your query architecture is wrong.
66
+ ```
67
+
68
+ Promotion from warning to error requires repeated evidence across golden domains, a deterministic
69
+ contract, and documented valid exceptions.
70
+
71
+ Before a heuristic becomes even an opt-in warning, it must first move from `research` to `implement`.
72
+ Report-only prototypes may collect evidence, but they must not appear as ordinary project diagnostics.
73
+
74
+ ## Knowledge relationship
75
+
76
+ Every accepted rule links to knowledge that explains why it exists. Knowledge entries may reference
77
+ the semantic identifier, but the registry is authoritative for automation disposition and lifecycle.
78
+ Executable owner, severity, and detection behavior apply only after an `implement` entry is accepted.
79
+
80
+ Agent skills should instruct agents to run the native project commands and interpret diagnostics. They
81
+ should not duplicate the entire rule catalog in prose.
@@ -0,0 +1,97 @@
1
+ # Linter Principles
2
+
3
+ ## Outcome
4
+
5
+ An Astrale domain should naturally compile, lint, and test toward the preferred architecture. Agents
6
+ and humans should not need to memorize a long style guide before receiving precise feedback.
7
+
8
+ Knowledge remains responsible for rationale, examples, and judgment. Mechanically decidable policy
9
+ belongs in executable tooling.
10
+
11
+ ## Enforcement order
12
+
13
+ For every proposed convention, choose the earliest static layer that can enforce it correctly:
14
+
15
+ 1. **SDK** uses its API, TypeScript types, schema compilation, and runtime contracts to reject invalid
16
+ states directly.
17
+ 2. **Oxlint** reports file-local syntax, scope, or control-flow violations.
18
+ 3. **Astrale analyzer** reports cross-file, import-graph, schema-aware, or project-shape violations.
19
+ A later static layer must not duplicate a diagnostic already owned reliably by an earlier layer. If
20
+ none can decide the convention without guessing, keep it in tests, review, or knowledge rather than
21
+ weakening the linter.
22
+
23
+ ## Product principles
24
+
25
+ ### One native workflow
26
+
27
+ Authors run ordinary package scripts. They do not assemble Oxlint plugins, TypeScript parser services,
28
+ schema inspectors, or analyzer configuration themselves.
29
+
30
+ ### Prevent before reporting
31
+
32
+ If an SDK signature can require `authorize`, a linter should not be the primary enforcement mechanism.
33
+ If a complete schema-derived handler map can be expressed as a TypeScript type, a filesystem scanner
34
+ should not guess whether it is complete.
35
+
36
+ ### High signal
37
+
38
+ The default decision is not to automate. A rule earns implementation only when the linter can identify
39
+ the prohibited state and its legitimate exceptions from machine-visible evidence. Even a useful
40
+ principle should remain guidance when detection depends on guessing intent, ownership, or architectural
41
+ quality.
42
+
43
+ An error-level rule must have a deterministic detection contract and a very low false-positive rate.
44
+ Warnings are held to the same honesty standard: lower severity does not make recurring false positives
45
+ acceptable. Suppressions are an escape hatch for exceptional code, not compensation for a vague rule.
46
+
47
+ ### Stable diagnostics, replaceable engines
48
+
49
+ Accepted `astrale/<slug>` identifiers are Astrale contracts. Oxlint, a TypeScript project service, or
50
+ any future engine is an implementation detail. Changing engines must not rename accepted rules,
51
+ suppressions, or CI output.
52
+
53
+ ### Strict defaults, narrow exceptions
54
+
55
+ New domains receive the strict preset. Configuration exists to describe real domain structure or a
56
+ documented exception, not to recreate an arbitrary lint stack. Suppressions are local, reasoned, and
57
+ auditable.
58
+
59
+ ### Safe fixes only
60
+
61
+ `pnpm lint:fix` may apply transformations that preserve behavior and intent. Moving a declaration into
62
+ a guessed bounded context, inventing an authorization target, or grouping mutations automatically is
63
+ not a safe fix.
64
+
65
+ ### Measured speed
66
+
67
+ The fast path must remain interactive. New engines or rules are admitted only with cold, warm, and
68
+ changed-file measurements against representative domains.
69
+
70
+ ## Rule admission bar
71
+
72
+ A proposed rule may become `accepted` only when all of the following are true:
73
+
74
+ - The prohibited behavior has a concrete failure mode.
75
+ - The preferred behavior is stable across more than one domain.
76
+ - The primary owner is exactly one of `sdk`, `oxlint`, or `analyzer`.
77
+ - Valid and invalid examples can be stated without relying on taste.
78
+ - Detection does not require guessing business intent.
79
+ - Representative legitimate alternatives do not trigger.
80
+ - Every documented exception is either machine-visible or explicitly outside the rule's scope.
81
+ - The expected prevention value exceeds the cost of review, suppression, maintenance, and lost trust
82
+ from false positives.
83
+ - The diagnostic identifies a useful source location and remediation.
84
+ - Suppression semantics are defined.
85
+ - Runtime and maintenance cost are measured.
86
+
87
+ ## Non-goals
88
+
89
+ The linter does not:
90
+
91
+ - Build a new JavaScript or TypeScript parser, formatter, or compiler.
92
+ - Replace `tsgo`, Oxlint, Vitest, schema compilation, or live domain verification.
93
+ - Infer the correct business bounded context from vocabulary alone.
94
+ - Prove that an authorization target expresses the intended business policy.
95
+ - Grade visual design quality or domain language by keyword.
96
+ - Promise zero migration work for arbitrary repositories that were not scaffolded with the system.
97
+ - Turn every recommendation into an error.
@@ -0,0 +1,38 @@
1
+ # Astrale Linter
2
+
3
+ Astrale Linter is the SDK-owned authoring system that turns stable Astrale domain conventions into
4
+ type constraints and static diagnostics.
5
+
6
+ Domain authors use the ordinary project commands:
7
+
8
+ ```sh
9
+ pnpm lint
10
+ pnpm lint:fix
11
+ pnpm typecheck
12
+ pnpm test
13
+ ```
14
+
15
+ Generated domains contain the compatible dependencies and Oxlint bridge. Authors should not need to
16
+ assemble parser services, plugins, or analyzer configuration themselves.
17
+
18
+ ## Reference
19
+
20
+ - [PRINCIPLES.md](./PRINCIPLES.md) defines the enforcement philosophy and rule-admission bar.
21
+ - [JUDGMENT.md](./JUDGMENT.md) defines what must remain human or agent judgment.
22
+ - [RULE-AUTHORING.md](./RULE-AUTHORING.md) defines identifiers, metadata, lifecycle, and testing.
23
+ - [RULES.md](./RULES.md) is the canonical policy registry and implementation-status record.
24
+ - [DIAGNOSTICS.md](./DIAGNOSTICS.md) defines output, tool failures, and suppressions.
25
+
26
+ ## Scope
27
+
28
+ The implementation is authoring-only and is exposed through `@astrale-os/sdk/linter`. It is not
29
+ re-exported from the isomorphic SDK root and must never enter a worker or browser bundle.
30
+
31
+ Each executable policy has one owner:
32
+
33
+ - `sdk` prevents invalid states through public types and authoring contracts.
34
+ - `oxlint` detects reliable file-local syntax and control-flow violations.
35
+ - `analyzer` detects project shape, import-graph, and cross-file violations.
36
+
37
+ Generic JavaScript and TypeScript rules remain owned by `@astrale-os/ox`. Astrale rules retain stable
38
+ `astrale/<slug>` identifiers regardless of their execution engine.