@astrale-os/sdk 0.4.11 → 0.4.12

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 (205) 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 +1 -1
  40. package/dist/cli/run.d.ts.map +1 -1
  41. package/dist/cli/run.js +4 -4
  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 +5 -5
  60. package/dist/define/remote-function.d.ts.map +1 -1
  61. package/dist/define/view.d.ts +3 -3
  62. package/dist/define/view.d.ts.map +1 -1
  63. package/dist/deploy/check.d.ts +1 -1
  64. package/dist/deploy/check.d.ts.map +1 -1
  65. package/dist/deploy/check.js +1 -1
  66. package/dist/deploy/check.js.map +1 -1
  67. package/dist/deploy/index.d.ts +2 -2
  68. package/dist/deploy/index.d.ts.map +1 -1
  69. package/dist/deploy/index.js +2 -2
  70. package/dist/deploy/index.js.map +1 -1
  71. package/dist/dispatch/authorize.js +1 -1
  72. package/dist/dispatch/authorize.js.map +1 -1
  73. package/dist/dispatch/dispatcher.d.ts +2 -2
  74. package/dist/dispatch/dispatcher.d.ts.map +1 -1
  75. package/dist/dispatch/dispatcher.js +12 -12
  76. package/dist/dispatch/dispatcher.js.map +1 -1
  77. package/dist/dispatch/execute.d.ts +6 -6
  78. package/dist/dispatch/execute.d.ts.map +1 -1
  79. package/dist/dispatch/identity.d.ts +2 -2
  80. package/dist/dispatch/identity.d.ts.map +1 -1
  81. package/dist/dispatch/index.d.ts +6 -6
  82. package/dist/dispatch/index.d.ts.map +1 -1
  83. package/dist/dispatch/index.js +6 -6
  84. package/dist/dispatch/index.js.map +1 -1
  85. package/dist/dispatch/resolve.d.ts +1 -1
  86. package/dist/dispatch/resolve.d.ts.map +1 -1
  87. package/dist/dispatch/self.d.ts +1 -1
  88. package/dist/dispatch/self.d.ts.map +1 -1
  89. package/dist/domain/build-spec.d.ts +1 -1
  90. package/dist/domain/build-spec.d.ts.map +1 -1
  91. package/dist/domain/build-spec.js +2 -2
  92. package/dist/domain/build-spec.js.map +1 -1
  93. package/dist/domain/contract.d.ts +1 -1
  94. package/dist/domain/contract.d.ts.map +1 -1
  95. package/dist/domain/define.d.ts +4 -4
  96. package/dist/domain/define.d.ts.map +1 -1
  97. package/dist/domain/define.js +2 -2
  98. package/dist/domain/define.js.map +1 -1
  99. package/dist/domain/extend-functions.d.ts +1 -1
  100. package/dist/domain/extend-functions.d.ts.map +1 -1
  101. package/dist/domain/extend-functions.js +1 -1
  102. package/dist/domain/extend-functions.js.map +1 -1
  103. package/dist/domain/extend-views.d.ts +1 -1
  104. package/dist/domain/extend-views.d.ts.map +1 -1
  105. package/dist/domain/extend-views.js +1 -1
  106. package/dist/domain/extend-views.js.map +1 -1
  107. package/dist/domain/index.d.ts +4 -4
  108. package/dist/domain/index.d.ts.map +1 -1
  109. package/dist/domain/index.js +3 -3
  110. package/dist/domain/index.js.map +1 -1
  111. package/dist/index.d.ts +19 -19
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +10 -10
  114. package/dist/index.js.map +1 -1
  115. package/dist/method/class.d.ts +3 -3
  116. package/dist/method/class.d.ts.map +1 -1
  117. package/dist/method/context.d.ts +4 -4
  118. package/dist/method/context.d.ts.map +1 -1
  119. package/dist/method/index.d.ts +5 -5
  120. package/dist/method/index.d.ts.map +1 -1
  121. package/dist/method/index.js +2 -2
  122. package/dist/method/index.js.map +1 -1
  123. package/dist/method/single.d.ts +2 -2
  124. package/dist/method/single.d.ts.map +1 -1
  125. package/dist/server/auxiliary-routes.d.ts +3 -3
  126. package/dist/server/auxiliary-routes.d.ts.map +1 -1
  127. package/dist/server/auxiliary-routes.js +8 -8
  128. package/dist/server/auxiliary-routes.js.map +1 -1
  129. package/dist/server/config.d.ts +1 -1
  130. package/dist/server/config.d.ts.map +1 -1
  131. package/dist/server/create.d.ts +2 -2
  132. package/dist/server/create.d.ts.map +1 -1
  133. package/dist/server/create.js +10 -10
  134. package/dist/server/create.js.map +1 -1
  135. package/dist/server/domain-entry.d.ts +5 -5
  136. package/dist/server/domain-entry.d.ts.map +1 -1
  137. package/dist/server/domain-entry.js +2 -2
  138. package/dist/server/domain-entry.js.map +1 -1
  139. package/dist/server/index.d.ts +11 -11
  140. package/dist/server/index.d.ts.map +1 -1
  141. package/dist/server/index.js +7 -7
  142. package/dist/server/index.js.map +1 -1
  143. package/dist/server/start.d.ts +1 -1
  144. package/dist/server/start.d.ts.map +1 -1
  145. package/dist/server/worker-entry.d.ts +1 -1
  146. package/dist/server/worker-entry.d.ts.map +1 -1
  147. package/dist/server/worker-entry.js +3 -3
  148. package/dist/server/worker-entry.js.map +1 -1
  149. package/dist/step/index.d.ts +4 -4
  150. package/dist/step/index.d.ts.map +1 -1
  151. package/dist/step/index.js +2 -2
  152. package/dist/step/index.js.map +1 -1
  153. package/dist/step/inline.d.ts +1 -1
  154. package/dist/step/inline.d.ts.map +1 -1
  155. package/dist/step/inline.js +1 -1
  156. package/dist/step/inline.js.map +1 -1
  157. package/package.json +3 -2
  158. package/src/auth/authenticate.ts +3 -3
  159. package/src/auth/check.ts +1 -1
  160. package/src/auth/function-context.ts +4 -4
  161. package/src/auth/index.ts +15 -15
  162. package/src/auth/issuer-mint.ts +3 -3
  163. package/src/auth/kernel-client.ts +3 -3
  164. package/src/auth/resolve.ts +4 -4
  165. package/src/auth/verify.ts +3 -3
  166. package/src/cli/bin.ts +1 -1
  167. package/src/cli/index.ts +2 -2
  168. package/src/cli/publish.ts +1 -1
  169. package/src/cli/run.ts +6 -6
  170. package/src/cli/spec.ts +3 -3
  171. package/src/config/define-domain.ts +2 -2
  172. package/src/config/deploy.ts +2 -2
  173. package/src/config/index.ts +6 -6
  174. package/src/define/index.ts +4 -4
  175. package/src/define/remote-function.ts +5 -5
  176. package/src/define/view.ts +3 -3
  177. package/src/deploy/check.ts +2 -2
  178. package/src/deploy/index.ts +2 -2
  179. package/src/dispatch/authorize.ts +1 -1
  180. package/src/dispatch/dispatcher.ts +15 -15
  181. package/src/dispatch/execute.ts +6 -6
  182. package/src/dispatch/identity.ts +2 -2
  183. package/src/dispatch/index.ts +6 -6
  184. package/src/dispatch/resolve.ts +1 -1
  185. package/src/dispatch/self.ts +1 -1
  186. package/src/domain/build-spec.ts +4 -4
  187. package/src/domain/contract.ts +1 -1
  188. package/src/domain/define.ts +6 -6
  189. package/src/domain/extend-functions.ts +2 -2
  190. package/src/domain/extend-views.ts +2 -2
  191. package/src/domain/index.ts +4 -4
  192. package/src/index.ts +19 -19
  193. package/src/method/class.ts +3 -3
  194. package/src/method/context.ts +4 -4
  195. package/src/method/index.ts +5 -5
  196. package/src/method/single.ts +2 -2
  197. package/src/server/auxiliary-routes.ts +13 -13
  198. package/src/server/config.ts +1 -1
  199. package/src/server/create.ts +14 -14
  200. package/src/server/domain-entry.ts +7 -7
  201. package/src/server/index.ts +11 -11
  202. package/src/server/start.ts +1 -1
  203. package/src/server/worker-entry.ts +4 -4
  204. package/src/step/index.ts +4 -4
  205. package/src/step/inline.ts +2 -2
@@ -1,10 +1,10 @@
1
- export { defineView } from './view'
2
- export type { ViewDef, ViewRenderContext } from './view'
1
+ export { defineView } from './view.js'
2
+ export type { ViewDef, ViewRenderContext } from './view.js'
3
3
 
4
- export { defineRemoteFunction } from './remote-function'
4
+ export { defineRemoteFunction } from './remote-function.js'
5
5
  export type {
6
6
  AnyRemoteFunctionDef,
7
7
  RemoteFunctionAuthorizeContext,
8
8
  RemoteFunctionContext,
9
9
  RemoteFunctionDef,
10
- } from './remote-function'
10
+ } from './remote-function.js'
@@ -23,11 +23,11 @@ import type { BoundClientSessionView } from '@astrale-os/kernel-client/session'
23
23
  import type { Context } from 'hono'
24
24
  import type { z } from 'zod'
25
25
 
26
- import type { FunctionContextApi } from '../auth/function-context'
27
- import type { DomainAuthority } from '../auth/issuer-mint'
28
- import type { Defer } from '../defer'
29
- import type { AuthForPolicy, CallerContext, KernelForAuth, RemoteEnv } from '../method/context'
30
- import type { Step } from '../step'
26
+ import type { FunctionContextApi } from '../auth/function-context.js'
27
+ import type { DomainAuthority } from '../auth/issuer-mint.js'
28
+ import type { Defer } from '../defer/index.js'
29
+ import type { AuthForPolicy, CallerContext, KernelForAuth, RemoteEnv } from '../method/context.js'
30
+ import type { Step } from '../step/index.js'
31
31
 
32
32
  type RemoteFunctionBaseContext<
33
33
  TParams,
@@ -24,9 +24,9 @@ import type { AuthPolicy, FunctionBinding } from '@astrale-os/kernel-api/routed'
24
24
  import type { EdgeEndpoint } from '@astrale-os/kernel-dsl'
25
25
  import type { Context } from 'hono'
26
26
 
27
- import type { FunctionContextApi } from '../auth/function-context'
28
- import type { AuthForPolicy } from '../method/context'
29
- import type { RemoteEnv } from '../method/context'
27
+ import type { FunctionContextApi } from '../auth/function-context.js'
28
+ import type { AuthForPolicy } from '../method/context.js'
29
+ import type { RemoteEnv } from '../method/context.js'
30
30
 
31
31
  export type ViewRenderContext<TDeps = unknown, TAuth extends AuthPolicy = AuthPolicy> = {
32
32
  /** Hono request context — read params, headers, query, etc. */
@@ -1,9 +1,9 @@
1
1
  import { spawnSync } from 'node:child_process'
2
2
  import { join } from 'node:path'
3
3
 
4
- import type { Meta } from './meta'
4
+ import type { Meta } from './meta.js'
5
5
 
6
- import { MetaSchema } from './meta'
6
+ import { MetaSchema } from './meta.js'
7
7
 
8
8
  export type DeployCheckOptions = {
9
9
  /** Deployed worker URL (e.g. `https://example.astrale.ai`). */
@@ -1,2 +1,2 @@
1
- export { MetaSchema, type Meta } from './meta'
2
- export { deployCheck, type DeployCheckOptions } from './check'
1
+ export { MetaSchema, type Meta } from './meta.js'
2
+ export { deployCheck, type DeployCheckOptions } from './check.js'
@@ -11,7 +11,7 @@
11
11
  * plain `Error` thrown to deny leaked out as a 500 instead of a 403.
12
12
  */
13
13
 
14
- import { AuthorizationDeniedError } from './errors'
14
+ import { AuthorizationDeniedError } from './errors.js'
15
15
 
16
16
  export async function runAuthorize<C>(
17
17
  hook: (ctx: C) => void | Promise<void>,
@@ -17,22 +17,22 @@ import type { BoundMethod, CompiledDomain } from '@astrale-os/kernel-core/domain
17
17
 
18
18
  import { createNodeBinder } from '@astrale-os/kernel-client/schema'
19
19
 
20
- import type { RemoteIdentityConfig } from '../auth/identity'
21
- import type { AnyRemoteHandler } from '../method/single'
22
- import type { MethodIndex } from './resolve'
20
+ import type { RemoteIdentityConfig } from '../auth/identity.js'
21
+ import type { AnyRemoteHandler } from '../method/single.js'
22
+ import type { MethodIndex } from './resolve.js'
23
23
 
24
- import { makeFunctionContext } from '../auth/function-context'
25
- import { makeDomainAuthority } from '../auth/issuer-mint'
26
- import { resolveInboundAuth } from '../auth/resolve'
27
- import { createHandlerLifecycle, type HandlerExecutionLifetime } from '../defer'
28
- import { createInlineStep } from '../step'
29
- import { runAuthorize } from './authorize'
30
- import { MethodNotFoundError, SdkResultValidationError, SdkValidationError } from './errors'
31
- import { executeHandler } from './execute'
32
- import { buildIdentityMap } from './identity'
33
- import { resolveMethod } from './resolve'
34
- import { resolveSelf, withBoundNode, type ParsedSelf } from './self'
35
- import { validateParams, validateResult } from './validate'
24
+ import { makeFunctionContext } from '../auth/function-context.js'
25
+ import { makeDomainAuthority } from '../auth/issuer-mint.js'
26
+ import { resolveInboundAuth } from '../auth/resolve.js'
27
+ import { createHandlerLifecycle, type HandlerExecutionLifetime } from '../defer/index.js'
28
+ import { createInlineStep } from '../step/index.js'
29
+ import { runAuthorize } from './authorize.js'
30
+ import { MethodNotFoundError, SdkResultValidationError, SdkValidationError } from './errors.js'
31
+ import { executeHandler } from './execute.js'
32
+ import { buildIdentityMap } from './identity.js'
33
+ import { resolveMethod } from './resolve.js'
34
+ import { resolveSelf, withBoundNode, type ParsedSelf } from './self.js'
35
+ import { validateParams, validateResult } from './validate.js'
36
36
 
37
37
  type PathInput = string | { raw: string }
38
38
 
@@ -11,12 +11,12 @@ import type { FnMap } from '@astrale-os/kernel-client'
11
11
  import type { BoundClientSessionView } from '@astrale-os/kernel-client/session'
12
12
  import type { AuthContext } from '@astrale-os/kernel-core'
13
13
 
14
- import type { FunctionContextApi } from '../auth/function-context'
15
- import type { DomainAuthority } from '../auth/issuer-mint'
16
- import type { Defer } from '../defer'
17
- import type { CallerContext, RemoteEnv } from '../method/context'
18
- import type { Step } from '../step'
19
- import type { SelfResult, TypedSelf } from './self'
14
+ import type { FunctionContextApi } from '../auth/function-context.js'
15
+ import type { DomainAuthority } from '../auth/issuer-mint.js'
16
+ import type { Defer } from '../defer/index.js'
17
+ import type { CallerContext, RemoteEnv } from '../method/context.js'
18
+ import type { Step } from '../step/index.js'
19
+ import type { SelfResult, TypedSelf } from './self.js'
20
20
 
21
21
  // oxlint-disable-next-line no-explicit-any
22
22
  type HandlerFn = (...args: any[]) => any
@@ -25,8 +25,8 @@ import type { BoundMethod, CompiledDomain } from '@astrale-os/kernel-core/domain
25
25
 
26
26
  import { resolveCallables } from '@astrale-os/kernel-core/domain'
27
27
 
28
- import type { RemoteIdentityConfig } from '../auth/identity'
29
- import type { AnyRemoteHandler } from '../method/single'
28
+ import type { RemoteIdentityConfig } from '../auth/identity.js'
29
+ import type { AnyRemoteHandler } from '../method/single.js'
30
30
 
31
31
  /**
32
32
  * For each materialized method node, emit its `MethodPath` (semantic,
@@ -1,16 +1,16 @@
1
- export { SdkDispatcher, type SdkDispatcherConfig } from './dispatcher'
2
- export { resolveMethod, buildMethodIndex, type MethodIndex } from './resolve'
1
+ export { SdkDispatcher, type SdkDispatcherConfig } from './dispatcher.js'
2
+ export { resolveMethod, buildMethodIndex, type MethodIndex } from './resolve.js'
3
3
  export {
4
4
  validateParams,
5
5
  validateResult,
6
6
  type ValidationResult,
7
7
  type ResultValidationResult,
8
- } from './validate'
9
- export { resolveSelf, withBoundNode, type SelfResult, type TypedSelf } from './self'
10
- export { executeHandler, type ExecuteParams } from './execute'
8
+ } from './validate.js'
9
+ export { resolveSelf, withBoundNode, type SelfResult, type TypedSelf } from './self.js'
10
+ export { executeHandler, type ExecuteParams } from './execute.js'
11
11
  export {
12
12
  AuthorizationDeniedError,
13
13
  MethodNotFoundError,
14
14
  SdkValidationError,
15
15
  SdkResultValidationError,
16
- } from './errors'
16
+ } from './errors.js'
@@ -22,7 +22,7 @@
22
22
  import type { Path } from '@astrale-os/kernel-core'
23
23
  import type { BoundMethod } from '@astrale-os/kernel-core/domain'
24
24
 
25
- import type { AnyRemoteHandler } from '../method/single'
25
+ import type { AnyRemoteHandler } from '../method/single.js'
26
26
 
27
27
  export type MethodIndex = Map<string, BoundMethod<AnyRemoteHandler>>
28
28
 
@@ -25,7 +25,7 @@ import { classPathSchema } from '@astrale-os/kernel-core/domain'
25
25
  import { absolutePathSchema } from '@astrale-os/kernel-core/tree'
26
26
  import { z } from 'zod'
27
27
 
28
- import type { Kernel } from '../method/context'
28
+ import type { Kernel } from '../method/context.js'
29
29
 
30
30
  /** The node a non-static method runs on — its full record, id guaranteed. */
31
31
  export type ResolvedSelfNode = Node & { id: NodeId }
@@ -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
82
  // ─── Request lifecycle ───────────────────────────────────────────────────
83
- export type { Defer, DeferredTask } from './defer'
83
+ export type { Defer, DeferredTask } from './defer/index.js'
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'
@@ -25,9 +25,9 @@ import type {
25
25
  } from '@astrale-os/kernel-core/domain'
26
26
  import type { ImplementableOwnKeys, Schema } from '@astrale-os/kernel-dsl'
27
27
 
28
- import type { TypedSelf } from '../dispatch/self'
29
- import type { DomainKernel } from './context'
30
- import type { MethodImpl, RemoteHandler } from './single'
28
+ import type { TypedSelf } from '../dispatch/self.js'
29
+ import type { DomainKernel } from './context.js'
30
+ import type { MethodImpl, RemoteHandler } from './single.js'
31
31
 
32
32
  /** Per-class method implementations for a remote domain. */
33
33
  export type ClassMethodsImpl<
@@ -14,10 +14,10 @@ import type { BoundClientSessionView } from '@astrale-os/kernel-client/session'
14
14
  import type { AuthContext } from '@astrale-os/kernel-core'
15
15
  import type { Schema } from '@astrale-os/kernel-dsl'
16
16
 
17
- import type { FunctionContextApi } from '../auth/function-context'
18
- import type { DomainAuthority } from '../auth/issuer-mint'
19
- import type { Defer } from '../defer'
20
- import type { Step } from '../step'
17
+ import type { FunctionContextApi } from '../auth/function-context.js'
18
+ import type { DomainAuthority } from '../auth/issuer-mint.js'
19
+ import type { Defer } from '../defer/index.js'
20
+ import type { Step } from '../step/index.js'
21
21
 
22
22
  export type { GraphApi } from '@astrale-os/kernel-client/graph'
23
23
 
@@ -6,14 +6,14 @@ export type {
6
6
  KernelForAuth,
7
7
  RemoteAuthorizeContext,
8
8
  RemoteContext,
9
- } from './context'
9
+ } from './context.js'
10
10
  export type {
11
11
  RemoteHandler,
12
12
  AnyRemoteHandler,
13
13
  MethodImpl,
14
14
  MethodParams,
15
15
  MethodResult,
16
- } from './single'
17
- export { remoteMethod } from './single'
18
- export type { ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl } from './class'
19
- export { remoteClassMethods, remoteInterfaceMethods } from './class'
16
+ } from './single.js'
17
+ export { remoteMethod } from './single.js'
18
+ export type { ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl } from './class.js'
19
+ export { remoteClassMethods, remoteInterfaceMethods } from './class.js'
@@ -9,14 +9,14 @@ import type {
9
9
  } from '@astrale-os/kernel-core/domain'
10
10
  import type { Schema } from '@astrale-os/kernel-dsl'
11
11
 
12
- import type { TypedSelf } from '../dispatch/self'
12
+ import type { TypedSelf } from '../dispatch/self.js'
13
13
  import type {
14
14
  DomainKernel,
15
15
  Kernel,
16
16
  KernelForAuth,
17
17
  RemoteAuthorizeContext,
18
18
  RemoteContext,
19
- } from './context'
19
+ } from './context.js'
20
20
 
21
21
  /**
22
22
  * Remote method handler. `execute` is optional only for binding stubs; any
@@ -38,19 +38,19 @@ import {
38
38
  } from '@astrale-os/kernel-api/routed'
39
39
  import { buildCorsHeaders, type CorsConfig } from '@astrale-os/kernel-server'
40
40
 
41
- import type { RemoteIdentityConfig } from '../auth/identity'
42
- import type { AnyRemoteFunctionDef } from '../define/remote-function'
43
- import type { ViewDef } from '../define/view'
44
- import type { AuxIdentityMap } from '../dispatch/identity'
45
-
46
- import { makeFunctionContext } from '../auth/function-context'
47
- import { makeDomainAuthority } from '../auth/issuer-mint'
48
- import { resolveInboundAuth } from '../auth/resolve'
49
- import { createHandlerLifecycle, executionLifetime } from '../defer'
50
- import { runAuthorize } from '../dispatch/authorize'
51
- import { SdkResultValidationError, SdkValidationError } from '../dispatch/errors'
52
- import { validateParams, validateResult } from '../dispatch/validate'
53
- import { createInlineStep } from '../step'
41
+ import type { RemoteIdentityConfig } from '../auth/identity.js'
42
+ import type { AnyRemoteFunctionDef } from '../define/remote-function.js'
43
+ import type { ViewDef } from '../define/view.js'
44
+ import type { AuxIdentityMap } from '../dispatch/identity.js'
45
+
46
+ import { makeFunctionContext } from '../auth/function-context.js'
47
+ import { makeDomainAuthority } from '../auth/issuer-mint.js'
48
+ import { resolveInboundAuth } from '../auth/resolve.js'
49
+ import { createHandlerLifecycle, executionLifetime } from '../defer/index.js'
50
+ import { runAuthorize } from '../dispatch/authorize.js'
51
+ import { SdkResultValidationError, SdkValidationError } from '../dispatch/errors.js'
52
+ import { validateParams, validateResult } from '../dispatch/validate.js'
53
+ import { createInlineStep } from '../step/index.js'
54
54
 
55
55
  export type AuxiliaryRoutesConfig<TDeps> = {
56
56
  app: Hono
@@ -9,7 +9,7 @@ import type { CorsConfig, WsAdapter } from '@astrale-os/kernel-server'
9
9
  import type { Context } from 'hono'
10
10
  import type { Hono } from 'hono'
11
11
 
12
- import type { RemoteDomain } from '../domain/define'
12
+ import type { RemoteDomain } from '../domain/define.js'
13
13
 
14
14
  export type RemoteServerConfig<TDeps> = {
15
15
  /** Domain produced by `defineRemoteDomain(...)`. */
@@ -15,20 +15,20 @@ import { createKernelApp } from '@astrale-os/kernel-server'
15
15
  import { Hono } from 'hono'
16
16
  import { importJWK, SignJWT } from 'jose'
17
17
 
18
- import type { ViewDef } from '../define'
19
- import type { RemoteServerConfig } from './config'
20
- import type { RemoteServer, RemoteServerHandle } from './handle'
21
-
22
- import { MetaSchema } from '../deploy/meta'
23
- import { SdkDispatcher } from '../dispatch/dispatcher'
24
- import { buildAuxIdentityMap } from '../dispatch/identity'
25
- import { buildMethodIndex } from '../dispatch/resolve'
26
- import { buildInstallGraph, buildInstallGraphHash } from '../domain/build-spec'
27
- import { toSdkContract } from '../domain/contract'
28
- import { materializeRemoteDomain } from '../domain/define'
29
- import { mountAuxiliaryRoutes } from './auxiliary-routes'
30
- import { derivePublicJwk } from './jwks'
31
- import { canonicalizeServingUrl } from './serving-url'
18
+ import type { ViewDef } from '../define/index.js'
19
+ import type { RemoteServerConfig } from './config.js'
20
+ import type { RemoteServer, RemoteServerHandle } from './handle.js'
21
+
22
+ import { MetaSchema } from '../deploy/meta.js'
23
+ import { SdkDispatcher } from '../dispatch/dispatcher.js'
24
+ import { buildAuxIdentityMap } from '../dispatch/identity.js'
25
+ import { buildMethodIndex } from '../dispatch/resolve.js'
26
+ import { buildInstallGraph, buildInstallGraphHash } from '../domain/build-spec.js'
27
+ import { toSdkContract } from '../domain/contract.js'
28
+ import { materializeRemoteDomain } from '../domain/define.js'
29
+ import { mountAuxiliaryRoutes } from './auxiliary-routes.js'
30
+ import { derivePublicJwk } from './jwks.js'
31
+ import { canonicalizeServingUrl } from './serving-url.js'
32
32
 
33
33
  export function createRemoteServer<TDeps>(config: RemoteServerConfig<TDeps>): RemoteServer {
34
34
  const methods = buildMethodIndex(config.domain.methods)
@@ -18,14 +18,14 @@
18
18
  import type { Core, Schema } from '@astrale-os/kernel-dsl'
19
19
  import type { Hono } from 'hono'
20
20
 
21
- import type { DomainManifest } from '../config/define-domain'
22
- import type { AnyRemoteFunctionDef, ViewDef } from '../define'
23
- import type { SchemaMethodsImpl } from '../method'
24
- import type { RemoteServerConfig } from './config'
25
- import type { WorkerEntry, WorkerEntryConfig } from './worker-entry'
21
+ import type { DomainManifest } from '../config/define-domain.js'
22
+ import type { AnyRemoteFunctionDef, ViewDef } from '../define/index.js'
23
+ import type { SchemaMethodsImpl } from '../method/index.js'
24
+ import type { RemoteServerConfig } from './config.js'
25
+ import type { WorkerEntry, WorkerEntryConfig } from './worker-entry.js'
26
26
 
27
- import { defineRemoteDomain } from '../domain'
28
- import { createWorkerEntry } from './worker-entry'
27
+ import { defineRemoteDomain } from '../domain/index.js'
28
+ import { createWorkerEntry } from './worker-entry.js'
29
29
 
30
30
  export interface DomainWorkerEntryConfig<S extends Schema, TEnv, TDeps> {
31
31
  /** The domain schema. */
@@ -1,11 +1,11 @@
1
- export { createRemoteServer } from './create'
2
- export type { RemoteServerConfig } from './config'
3
- export type { RemoteServer, RemoteServerHandle } from './handle'
4
- export { derivePublicJwk } from './jwks'
5
- export { requireEnv } from './require-env'
6
- export { canonicalizeServingUrl } from './serving-url'
7
- export { assets, createWorkerEntry } from './worker-entry'
8
- export type { WorkerEntry, WorkerEntryConfig } from './worker-entry'
9
- export { domainWorkerEntry } from './domain-entry'
10
- export type { DomainWorkerEntryConfig } from './domain-entry'
11
- export { startNodeServer } from './start'
1
+ export { createRemoteServer } from './create.js'
2
+ export type { RemoteServerConfig } from './config.js'
3
+ export type { RemoteServer, RemoteServerHandle } from './handle.js'
4
+ export { derivePublicJwk } from './jwks.js'
5
+ export { requireEnv } from './require-env.js'
6
+ export { canonicalizeServingUrl } from './serving-url.js'
7
+ export { assets, createWorkerEntry } from './worker-entry.js'
8
+ export type { WorkerEntry, WorkerEntryConfig } from './worker-entry.js'
9
+ export { domainWorkerEntry } from './domain-entry.js'
10
+ export type { DomainWorkerEntryConfig } from './domain-entry.js'
11
+ export { startNodeServer } from './start.js'
@@ -8,7 +8,7 @@
8
8
 
9
9
  import type { Hono } from 'hono'
10
10
 
11
- import type { RemoteServerHandle } from './handle'
11
+ import type { RemoteServerHandle } from './handle.js'
12
12
 
13
13
  export async function startNodeServer(app: Hono, port = 3000): Promise<RemoteServerHandle> {
14
14
  // Opaque specifier: the `./server` barrel re-exports this module, so worker
@@ -24,11 +24,11 @@
24
24
 
25
25
  import type { ExecutionContext } from 'hono'
26
26
 
27
- import type { RemoteServerConfig } from './config'
27
+ import type { RemoteServerConfig } from './config.js'
28
28
 
29
- import { createRemoteServer } from './create'
30
- import { requireEnv } from './require-env'
31
- import { canonicalizeServingUrl } from './serving-url'
29
+ import { createRemoteServer } from './create.js'
30
+ import { requireEnv } from './require-env.js'
31
+ import { canonicalizeServingUrl } from './serving-url.js'
32
32
 
33
33
  type Fetcher = { fetch(request: Request): Response | Promise<Response> }
34
34
  type App = {
package/src/step/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { createInlineStep } from './inline'
2
- export type { InlineStepOptions, StepExecutor } from './inline'
3
- export { buildStepRun } from './step'
4
- export type { FunctionStepScope, MethodStepScope, Step, StepRun, StepScope } from './step'
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'