@astrale-os/sdk 0.4.10 → 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.
- package/dist/auth/authenticate.d.ts +1 -1
- package/dist/auth/authenticate.d.ts.map +1 -1
- package/dist/auth/authenticate.js +2 -2
- package/dist/auth/authenticate.js.map +1 -1
- package/dist/auth/check.js +1 -1
- package/dist/auth/check.js.map +1 -1
- package/dist/auth/function-context.d.ts +1 -1
- package/dist/auth/function-context.d.ts.map +1 -1
- package/dist/auth/function-context.js +3 -3
- package/dist/auth/function-context.js.map +1 -1
- package/dist/auth/identity.d.ts +2 -0
- package/dist/auth/identity.d.ts.map +1 -1
- package/dist/auth/index.d.ts +15 -15
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +10 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/issuer-mint.d.ts +1 -1
- package/dist/auth/issuer-mint.d.ts.map +1 -1
- package/dist/auth/issuer-mint.js +2 -2
- package/dist/auth/issuer-mint.js.map +1 -1
- package/dist/auth/kernel-client.d.ts +1 -1
- package/dist/auth/kernel-client.d.ts.map +1 -1
- package/dist/auth/kernel-client.js +2 -2
- package/dist/auth/kernel-client.js.map +1 -1
- package/dist/auth/resolve.d.ts +2 -2
- package/dist/auth/resolve.d.ts.map +1 -1
- package/dist/auth/resolve.js +2 -2
- package/dist/auth/resolve.js.map +1 -1
- package/dist/auth/verify.d.ts +1 -1
- package/dist/auth/verify.d.ts.map +1 -1
- package/dist/auth/verify.js +3 -3
- package/dist/auth/verify.js.map +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/bin.js.map +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/publish.js +1 -1
- package/dist/cli/publish.js.map +1 -1
- package/dist/cli/run.d.ts +1 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +4 -4
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/spec.d.ts +1 -1
- package/dist/cli/spec.d.ts.map +1 -1
- package/dist/cli/spec.js +2 -1
- package/dist/cli/spec.js.map +1 -1
- package/dist/config/define-domain.d.ts +7 -3
- package/dist/config/define-domain.d.ts.map +1 -1
- package/dist/config/define-domain.js +1 -0
- package/dist/config/define-domain.js.map +1 -1
- package/dist/config/deploy.d.ts +2 -2
- package/dist/config/deploy.d.ts.map +1 -1
- package/dist/config/index.d.ts +6 -6
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -3
- package/dist/config/index.js.map +1 -1
- package/dist/defer/index.d.ts +24 -0
- package/dist/defer/index.d.ts.map +1 -0
- package/dist/defer/index.js +42 -0
- package/dist/defer/index.js.map +1 -0
- package/dist/define/index.d.ts +4 -4
- package/dist/define/index.d.ts.map +1 -1
- package/dist/define/index.js +2 -2
- package/dist/define/index.js.map +1 -1
- package/dist/define/remote-function.d.ts +7 -4
- package/dist/define/remote-function.d.ts.map +1 -1
- package/dist/define/remote-function.js.map +1 -1
- package/dist/define/view.d.ts +3 -3
- package/dist/define/view.d.ts.map +1 -1
- package/dist/deploy/check.d.ts +1 -1
- package/dist/deploy/check.d.ts.map +1 -1
- package/dist/deploy/check.js +1 -1
- package/dist/deploy/check.js.map +1 -1
- package/dist/deploy/index.d.ts +2 -2
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +2 -2
- package/dist/deploy/index.js.map +1 -1
- package/dist/dispatch/authorize.js +1 -1
- package/dist/dispatch/authorize.js.map +1 -1
- package/dist/dispatch/dispatcher.d.ts +7 -4
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +56 -34
- package/dist/dispatch/dispatcher.js.map +1 -1
- package/dist/dispatch/execute.d.ts +7 -5
- package/dist/dispatch/execute.d.ts.map +1 -1
- package/dist/dispatch/execute.js +1 -0
- package/dist/dispatch/execute.js.map +1 -1
- package/dist/dispatch/identity.d.ts +2 -2
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/index.d.ts +6 -6
- package/dist/dispatch/index.d.ts.map +1 -1
- package/dist/dispatch/index.js +6 -6
- package/dist/dispatch/index.js.map +1 -1
- package/dist/dispatch/resolve.d.ts +1 -1
- package/dist/dispatch/resolve.d.ts.map +1 -1
- package/dist/dispatch/self.d.ts +1 -1
- package/dist/dispatch/self.d.ts.map +1 -1
- package/dist/domain/build-spec.d.ts +1 -1
- package/dist/domain/build-spec.d.ts.map +1 -1
- package/dist/domain/build-spec.js +6 -2
- package/dist/domain/build-spec.js.map +1 -1
- package/dist/domain/contract.d.ts +1 -1
- package/dist/domain/contract.d.ts.map +1 -1
- package/dist/domain/define.d.ts +4 -4
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +2 -2
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/extend-functions.d.ts +1 -1
- package/dist/domain/extend-functions.d.ts.map +1 -1
- package/dist/domain/extend-functions.js +1 -1
- package/dist/domain/extend-functions.js.map +1 -1
- package/dist/domain/extend-views.d.ts +1 -1
- package/dist/domain/extend-views.d.ts.map +1 -1
- package/dist/domain/extend-views.js +1 -1
- package/dist/domain/extend-views.js.map +1 -1
- package/dist/domain/index.d.ts +4 -4
- package/dist/domain/index.d.ts.map +1 -1
- package/dist/domain/index.js +3 -3
- package/dist/domain/index.js.map +1 -1
- package/dist/index.d.ts +19 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/method/class.d.ts +3 -3
- package/dist/method/class.d.ts.map +1 -1
- package/dist/method/context.d.ts +6 -3
- package/dist/method/context.d.ts.map +1 -1
- package/dist/method/index.d.ts +5 -5
- package/dist/method/index.d.ts.map +1 -1
- package/dist/method/index.js +2 -2
- package/dist/method/index.js.map +1 -1
- package/dist/method/single.d.ts +2 -2
- package/dist/method/single.d.ts.map +1 -1
- package/dist/server/auxiliary-routes.d.ts +3 -3
- package/dist/server/auxiliary-routes.d.ts.map +1 -1
- package/dist/server/auxiliary-routes.js +54 -18
- package/dist/server/auxiliary-routes.js.map +1 -1
- package/dist/server/config.d.ts +1 -1
- package/dist/server/config.d.ts.map +1 -1
- package/dist/server/create.d.ts +2 -2
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/create.js +10 -10
- package/dist/server/create.js.map +1 -1
- package/dist/server/domain-entry.d.ts +5 -5
- package/dist/server/domain-entry.d.ts.map +1 -1
- package/dist/server/domain-entry.js +2 -2
- package/dist/server/domain-entry.js.map +1 -1
- package/dist/server/index.d.ts +11 -11
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -7
- package/dist/server/index.js.map +1 -1
- package/dist/server/start.d.ts +1 -1
- package/dist/server/start.d.ts.map +1 -1
- package/dist/server/worker-entry.d.ts +4 -3
- package/dist/server/worker-entry.d.ts.map +1 -1
- package/dist/server/worker-entry.js +5 -5
- package/dist/server/worker-entry.js.map +1 -1
- package/dist/step/index.d.ts +4 -4
- package/dist/step/index.d.ts.map +1 -1
- package/dist/step/index.js +2 -2
- package/dist/step/index.js.map +1 -1
- package/dist/step/inline.d.ts +1 -1
- package/dist/step/inline.d.ts.map +1 -1
- package/dist/step/inline.js +1 -1
- package/dist/step/inline.js.map +1 -1
- package/package.json +3 -2
- package/src/auth/authenticate.ts +3 -3
- package/src/auth/check.ts +1 -1
- package/src/auth/function-context.ts +4 -4
- package/src/auth/identity.ts +2 -0
- package/src/auth/index.ts +15 -15
- package/src/auth/issuer-mint.ts +3 -3
- package/src/auth/kernel-client.ts +3 -3
- package/src/auth/resolve.ts +4 -4
- package/src/auth/verify.ts +4 -4
- package/src/cli/bin.ts +1 -1
- package/src/cli/index.ts +2 -2
- package/src/cli/publish.ts +1 -1
- package/src/cli/run.ts +6 -6
- package/src/cli/spec.ts +4 -3
- package/src/config/define-domain.ts +8 -3
- package/src/config/deploy.ts +2 -2
- package/src/config/index.ts +6 -6
- package/src/defer/index.ts +64 -0
- package/src/define/index.ts +4 -4
- package/src/define/remote-function.ts +7 -4
- package/src/define/view.ts +3 -3
- package/src/deploy/check.ts +2 -2
- package/src/deploy/index.ts +2 -2
- package/src/dispatch/authorize.ts +1 -1
- package/src/dispatch/dispatcher.ts +64 -36
- package/src/dispatch/execute.ts +8 -5
- package/src/dispatch/identity.ts +2 -2
- package/src/dispatch/index.ts +6 -6
- package/src/dispatch/resolve.ts +1 -1
- package/src/dispatch/self.ts +1 -1
- package/src/domain/build-spec.ts +8 -4
- package/src/domain/contract.ts +1 -1
- package/src/domain/define.ts +6 -6
- package/src/domain/extend-functions.ts +2 -2
- package/src/domain/extend-views.ts +2 -2
- package/src/domain/index.ts +4 -4
- package/src/index.ts +21 -18
- package/src/method/class.ts +3 -3
- package/src/method/context.ts +6 -3
- package/src/method/index.ts +5 -5
- package/src/method/single.ts +2 -2
- package/src/server/auxiliary-routes.ts +70 -21
- package/src/server/config.ts +1 -1
- package/src/server/create.ts +14 -14
- package/src/server/domain-entry.ts +7 -7
- package/src/server/index.ts +11 -11
- package/src/server/start.ts +1 -1
- package/src/server/worker-entry.ts +16 -8
- package/src/step/index.ts +4 -4
- package/src/step/inline.ts +2 -2
package/dist/server/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACrD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC7D,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/server/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { createRemoteServer } from './create';
|
|
2
|
-
export { derivePublicJwk } from './jwks';
|
|
3
|
-
export { requireEnv } from './require-env';
|
|
4
|
-
export { canonicalizeServingUrl } from './serving-url';
|
|
5
|
-
export { assets, createWorkerEntry } from './worker-entry';
|
|
6
|
-
export { domainWorkerEntry } from './domain-entry';
|
|
7
|
-
export { startNodeServer } from './start';
|
|
1
|
+
export { createRemoteServer } from './create.js';
|
|
2
|
+
export { derivePublicJwk } from './jwks.js';
|
|
3
|
+
export { requireEnv } from './require-env.js';
|
|
4
|
+
export { canonicalizeServingUrl } from './serving-url.js';
|
|
5
|
+
export { assets, createWorkerEntry } from './worker-entry.js';
|
|
6
|
+
export { domainWorkerEntry } from './domain-entry.js';
|
|
7
|
+
export { startNodeServer } from './start.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/server/start.d.ts
CHANGED
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* Cloudflare, consumers go through `server.app.fetch` directly.
|
|
7
7
|
*/
|
|
8
8
|
import type { Hono } from 'hono';
|
|
9
|
-
import type { RemoteServerHandle } from './handle';
|
|
9
|
+
import type { RemoteServerHandle } from './handle.js';
|
|
10
10
|
export declare function startNodeServer(app: Hono, port?: number): Promise<RemoteServerHandle>;
|
|
11
11
|
//# sourceMappingURL=start.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/server/start.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/server/start.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD,wBAAsB,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,SAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4BzF"}
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
*
|
|
22
22
|
* The worker file is then just schema + methods + a `build(url, env)` callback.
|
|
23
23
|
*/
|
|
24
|
-
import type {
|
|
24
|
+
import type { ExecutionContext } from 'hono';
|
|
25
|
+
import type { RemoteServerConfig } from './config.js';
|
|
25
26
|
type Fetcher = {
|
|
26
27
|
fetch(request: Request): Response | Promise<Response>;
|
|
27
28
|
};
|
|
28
29
|
type App = {
|
|
29
|
-
fetch(request: Request): Response | Promise<Response>;
|
|
30
|
+
fetch(request: Request, env?: unknown, executionCtx?: ExecutionContext): Response | Promise<Response>;
|
|
30
31
|
};
|
|
31
32
|
/** A built app cached by its serving URL: `origin` for same-origin matching,
|
|
32
33
|
* `app` for in-process self-dispatch. */
|
|
@@ -111,7 +112,7 @@ export interface WorkerEntryConfig<TDeps> {
|
|
|
111
112
|
rewriteRequest?: (env: TDeps, request: Request) => Request;
|
|
112
113
|
}
|
|
113
114
|
export interface WorkerEntry<TDeps> {
|
|
114
|
-
fetch(request: Request, env: TDeps): Response | Promise<Response>;
|
|
115
|
+
fetch(request: Request, env: TDeps, executionCtx?: ExecutionContext): Response | Promise<Response>;
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
117
118
|
* The request origin as the CLIENT reached it — i.e. the origin a fallback
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.d.ts","sourceRoot":"","sources":["../../src/server/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"worker-entry.d.ts","sourceRoot":"","sources":["../../src/server/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAE5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAMrD,KAAK,OAAO,GAAG;IAAE,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAA;AACxE,KAAK,GAAG,GAAG;IACT,KAAK,CACH,OAAO,EAAE,OAAO,EAChB,GAAG,CAAC,EAAE,OAAO,EACb,YAAY,CAAC,EAAE,gBAAgB,GAC9B,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;CAChC,CAAA;AAED;yCACyC;AACzC,KAAK,SAAS,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CA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E,KAAK,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAA;CAC3D;AAED,MAAM,WAAW,WAAW,CAAC,KAAK;IAChC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,EAAE,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;CACnG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAM/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;IACnD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CACrD,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAiBvF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAsE7F"}
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
*
|
|
22
22
|
* The worker file is then just schema + methods + a `build(url, env)` callback.
|
|
23
23
|
*/
|
|
24
|
-
import { createRemoteServer } from './create';
|
|
25
|
-
import { requireEnv } from './require-env';
|
|
26
|
-
import { canonicalizeServingUrl } from './serving-url';
|
|
24
|
+
import { createRemoteServer } from './create.js';
|
|
25
|
+
import { requireEnv } from './require-env.js';
|
|
26
|
+
import { canonicalizeServingUrl } from './serving-url.js';
|
|
27
27
|
/**
|
|
28
28
|
* Choose where an OUTBOUND subrequest to `u` is routed — or `null` to let the
|
|
29
29
|
* real `fetch` handle it. Order matters and same-origin wins FIRST: a call to
|
|
@@ -169,7 +169,7 @@ export function createWorkerEntry(config) {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
return {
|
|
172
|
-
async fetch(request, env) {
|
|
172
|
+
async fetch(request, env, executionCtx) {
|
|
173
173
|
if (config.selfBinding)
|
|
174
174
|
self ??= config.selfBinding(env) ?? null;
|
|
175
175
|
if (config.routeSubrequest)
|
|
@@ -188,7 +188,7 @@ export function createWorkerEntry(config) {
|
|
|
188
188
|
: requireEnv(env, 'WORKER_URL', "the worker's public serving URL (its iss identity)");
|
|
189
189
|
const url = canonicalizeServingUrl(raw);
|
|
190
190
|
const dispatched = config.rewriteRequest ? config.rewriteRequest(env, request) : request;
|
|
191
|
-
return getApp(url, env).fetch(dispatched);
|
|
191
|
+
return getApp(url, env).fetch(dispatched, env, executionCtx);
|
|
192
192
|
},
|
|
193
193
|
};
|
|
194
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-entry.js","sourceRoot":"","sources":["../../src/server/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"worker-entry.js","sourceRoot":"","sources":["../../src/server/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAezD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,sBAAsB,CACpC,CAAM,EACN,GAKC;IAED,iFAAiF;IACjF,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9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F,MAAM,GAAG,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAA;YACvC,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;YACxF,OAAO,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,GAAG,EAAE,YAAY,CAAC,CAAA;QAC9D,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/dist/step/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/step/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/step/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/step/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/step/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createInlineStep } from './inline';
|
|
2
|
-
export { buildStepRun } from './step';
|
|
1
|
+
export { createInlineStep } from './inline.js';
|
|
2
|
+
export { buildStepRun } from './step.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/step/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/step/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/step/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/step/inline.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/step/inline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/step/inline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAIzD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;AAEzF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,IAAI,CAUtE"}
|
package/dist/step/inline.js
CHANGED
package/dist/step/inline.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/step/inline.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/step/inline.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAS7D,MAAM,UAAU,gBAAgB,CAAC,OAAO,GAAsB,EAAE;IAC9D,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAA;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,aAAa,CAAA;IAEhD,OAAO;QACL,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO;YACnB,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAA;YAC3F,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAC9B,CAAC;KACF,CAAA;AACH,CAAC;AAED,KAAK,UAAU,aAAa,CAAI,GAAY,EAAE,OAA6B;IACzE,MAAM,MAAM,GAAG,MAAM,OAAO,EAAE,CAAA;IAC9B,OAAO,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AAC7C,CAAC;AAED,SAAS,cAAc,CACrB,EAAU,EACV,KAA4B,EAC5B,WAAgC;IAEhC,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;IACtC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IAChD,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC,CAAC,CAAA;IACxC,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.12",
|
|
4
4
|
"description": "Astrale Remote Domain SDK - Define and deploy domains as standalone Hono servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -101,10 +101,11 @@
|
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"preinstall": "node -e \"try{require('./.check-workspace.cjs')}catch{}\"",
|
|
104
|
-
"build": "tsgo",
|
|
104
|
+
"build": "tsgo && pnpm run verify:package",
|
|
105
105
|
"typecheck": "tsgo --noEmit && pnpm run typecheck:types",
|
|
106
106
|
"typecheck:types": "tsgo --noEmit -p __tests__/tsconfig.types.json",
|
|
107
107
|
"test": "vitest run --config __tests__/vitest.config.ts",
|
|
108
|
+
"verify:package": "node --input-type=module -e \"await import('./dist/index.js')\"",
|
|
108
109
|
"test:watch": "vitest --config __tests__/vitest.config.ts",
|
|
109
110
|
"lint": "oxlint .",
|
|
110
111
|
"lint:fix": "oxlint --fix .",
|
package/src/auth/authenticate.ts
CHANGED
|
@@ -13,10 +13,10 @@ import type { Authenticated, CredentialInput } from '@astrale-os/kernel-core'
|
|
|
13
13
|
|
|
14
14
|
import { IdentityId, selfGrant } from '@astrale-os/kernel-core'
|
|
15
15
|
|
|
16
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
16
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
17
17
|
|
|
18
|
-
import { bindKernel } from './kernel-client'
|
|
19
|
-
import { verifyInboundCredential } from './verify'
|
|
18
|
+
import { bindKernel } from './kernel-client.js'
|
|
19
|
+
import { verifyInboundCredential } from './verify.js'
|
|
20
20
|
|
|
21
21
|
export type AuthenticateResult = {
|
|
22
22
|
authenticated: Authenticated
|
package/src/auth/check.ts
CHANGED
|
@@ -28,7 +28,7 @@ import type { IdentityId } from '@astrale-os/kernel-core'
|
|
|
28
28
|
|
|
29
29
|
import { SHARE } from '@astrale-os/kernel-core'
|
|
30
30
|
|
|
31
|
-
import { AuthorizationDeniedError } from '../dispatch/errors'
|
|
31
|
+
import { AuthorizationDeniedError } from '../dispatch/errors.js'
|
|
32
32
|
|
|
33
33
|
export { ALL, EDIT, READ, SHARE, USE } from '@astrale-os/kernel-core'
|
|
34
34
|
|
|
@@ -4,11 +4,11 @@ import type { UnresolvedIdentityExpr } from '@astrale-os/kernel-core'
|
|
|
4
4
|
|
|
5
5
|
import { createUnresolvedGrant } from '@astrale-os/kernel-core'
|
|
6
6
|
|
|
7
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
7
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
8
8
|
|
|
9
|
-
import { buildSelfExpr, buildSelfGrant } from './compose'
|
|
10
|
-
import { bindCredentialSession } from './kernel-client'
|
|
11
|
-
import { signCredential } from './sign'
|
|
9
|
+
import { buildSelfExpr, buildSelfGrant } from './compose.js'
|
|
10
|
+
import { bindCredentialSession } from './kernel-client.js'
|
|
11
|
+
import { signCredential } from './sign.js'
|
|
12
12
|
|
|
13
13
|
export type FunctionCredentialOptions = {
|
|
14
14
|
/** Credential audience. Defaults to the current/default kernel URL when known. */
|
package/src/auth/identity.ts
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
export type RemoteIdentityConfig = {
|
|
9
9
|
/** This service's issuer (URL where its JWKS is served, or a registered ID) */
|
|
10
10
|
issuer: string
|
|
11
|
+
/** Optional inbound audience when transport addressing differs from issuer. */
|
|
12
|
+
audience?: string
|
|
11
13
|
/** This service's subject identifier (e.g. "task-service") */
|
|
12
14
|
subject: string
|
|
13
15
|
/** Private key for signing outbound credentials */
|
package/src/auth/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export type { RemoteIdentityConfig } from './identity'
|
|
2
|
-
export type { VerifiedInbound } from './verify'
|
|
3
|
-
export type { AuthenticateResult } from './authenticate'
|
|
4
|
-
export { authenticateRequest } from './authenticate'
|
|
5
|
-
export { resolveInboundAuth, buildAuthContext, type ResolvedAuth } from './resolve'
|
|
6
|
-
export { verifyInboundCredential } from './verify'
|
|
7
|
-
export { buildComposedGrant } from './compose'
|
|
8
|
-
export { signCredential } from './sign'
|
|
9
|
-
export { makeDomainAuthority } from './issuer-mint'
|
|
10
|
-
export type { DomainAuthority, MintIssuedParams } from './issuer-mint'
|
|
11
|
-
export { makeFunctionContext } from './function-context'
|
|
1
|
+
export type { RemoteIdentityConfig } from './identity.js'
|
|
2
|
+
export type { VerifiedInbound } from './verify.js'
|
|
3
|
+
export type { AuthenticateResult } from './authenticate.js'
|
|
4
|
+
export { authenticateRequest } from './authenticate.js'
|
|
5
|
+
export { resolveInboundAuth, buildAuthContext, type ResolvedAuth } from './resolve.js'
|
|
6
|
+
export { verifyInboundCredential } from './verify.js'
|
|
7
|
+
export { buildComposedGrant } from './compose.js'
|
|
8
|
+
export { signCredential } from './sign.js'
|
|
9
|
+
export { makeDomainAuthority } from './issuer-mint.js'
|
|
10
|
+
export type { DomainAuthority, MintIssuedParams } from './issuer-mint.js'
|
|
11
|
+
export { makeFunctionContext } from './function-context.js'
|
|
12
12
|
export type {
|
|
13
13
|
FunctionContextApi,
|
|
14
14
|
FunctionCredentialOptions,
|
|
15
15
|
FunctionKernelOptions,
|
|
16
|
-
} from './function-context'
|
|
17
|
-
export { bindKernel } from './kernel-client'
|
|
18
|
-
export { AuthMissingError, AuthInvalidError } from './errors'
|
|
19
|
-
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './check'
|
|
16
|
+
} from './function-context.js'
|
|
17
|
+
export { bindKernel } from './kernel-client.js'
|
|
18
|
+
export { AuthMissingError, AuthInvalidError } from './errors.js'
|
|
19
|
+
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './check.js'
|
package/src/auth/issuer-mint.ts
CHANGED
|
@@ -22,10 +22,10 @@ import type { UnresolvedIdentityExpr } from '@astrale-os/kernel-core'
|
|
|
22
22
|
|
|
23
23
|
import { createUnresolvedGrant } from '@astrale-os/kernel-core'
|
|
24
24
|
|
|
25
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
25
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
26
26
|
|
|
27
|
-
import { bindCredentialSession } from './kernel-client'
|
|
28
|
-
import { signCredential } from './sign'
|
|
27
|
+
import { bindCredentialSession } from './kernel-client.js'
|
|
28
|
+
import { signCredential } from './sign.js'
|
|
29
29
|
|
|
30
30
|
export type DomainAuthorityRef = {
|
|
31
31
|
/** The issuer ID (used as the `iss` claim in credentials and on Identity nodes). */
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
type BoundClientSessionView,
|
|
28
28
|
} from '@astrale-os/kernel-client/session'
|
|
29
29
|
|
|
30
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
30
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
31
31
|
|
|
32
|
-
import { buildComposedExpr, buildComposedGrant, buildSelfExpr } from './compose'
|
|
33
|
-
import { signCredential } from './sign'
|
|
32
|
+
import { buildComposedExpr, buildComposedGrant, buildSelfExpr } from './compose.js'
|
|
33
|
+
import { signCredential } from './sign.js'
|
|
34
34
|
|
|
35
35
|
const DELEGATION_TTL_SECONDS = 3600
|
|
36
36
|
|
package/src/auth/resolve.ts
CHANGED
|
@@ -17,11 +17,11 @@ import type {
|
|
|
17
17
|
|
|
18
18
|
import { isKernelErrorClassifiable } from '@astrale-os/kernel-api'
|
|
19
19
|
|
|
20
|
-
import type { AuthenticateResult } from './authenticate'
|
|
21
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
20
|
+
import type { AuthenticateResult } from './authenticate.js'
|
|
21
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
22
22
|
|
|
23
|
-
import { authenticateRequest } from './authenticate'
|
|
24
|
-
import { AuthInvalidError, AuthMissingError } from './errors'
|
|
23
|
+
import { authenticateRequest } from './authenticate.js'
|
|
24
|
+
import { AuthInvalidError, AuthMissingError } from './errors.js'
|
|
25
25
|
|
|
26
26
|
export type ResolvedAuth = {
|
|
27
27
|
auth: AuthContext | null
|
package/src/auth/verify.ts
CHANGED
|
@@ -24,10 +24,10 @@ import {
|
|
|
24
24
|
} from '@astrale-os/kernel-core'
|
|
25
25
|
import { createLocalJWKSet, createRemoteJWKSet, type JWK } from 'jose'
|
|
26
26
|
|
|
27
|
-
import type { RemoteIdentityConfig } from './identity'
|
|
27
|
+
import type { RemoteIdentityConfig } from './identity.js'
|
|
28
28
|
|
|
29
|
-
import { derivePublicJwk } from '../server/jwks'
|
|
30
|
-
import { canonicalizeServingUrl } from '../server/serving-url'
|
|
29
|
+
import { derivePublicJwk } from '../server/jwks.js'
|
|
30
|
+
import { canonicalizeServingUrl } from '../server/serving-url.js'
|
|
31
31
|
|
|
32
32
|
export type VerifiedInbound = {
|
|
33
33
|
/** The full verified credential (iss, sub, aud, claims) */
|
|
@@ -177,7 +177,7 @@ export async function verifyInboundCredential(
|
|
|
177
177
|
|
|
178
178
|
// Validate audience matches this function's issuer (its serving URL).
|
|
179
179
|
// kernel-core's verifyAudience compares canonically.
|
|
180
|
-
verifyAudience(verified, config.issuer as IssuerId)
|
|
180
|
+
verifyAudience(verified, (config.audience ?? config.issuer) as IssuerId)
|
|
181
181
|
|
|
182
182
|
// Extract attestation and delegation from claims
|
|
183
183
|
const attestation = verified.claims.attestation as Attestation | undefined
|
package/src/cli/bin.ts
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* The bin lives at `./bin`.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
export { run, parseArgs } from './run'
|
|
15
|
-
export { parseDotenv, loadDotenvFile, loadDeclaredSecrets } from './dotenv'
|
|
14
|
+
export { run, parseArgs } from './run.js'
|
|
15
|
+
export { parseDotenv, loadDotenvFile, loadDeclaredSecrets } from './dotenv.js'
|
package/src/cli/publish.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync } from 'node
|
|
|
19
19
|
import { tmpdir } from 'node:os'
|
|
20
20
|
import { join } from 'node:path'
|
|
21
21
|
|
|
22
|
-
import { BOLD, DIM, error, GREEN, info, RESET, warn } from './log'
|
|
22
|
+
import { BOLD, DIM, error, GREEN, info, RESET, warn } from './log.js'
|
|
23
23
|
|
|
24
24
|
type SchemaPkg = {
|
|
25
25
|
name?: string
|
package/src/cli/run.ts
CHANGED
|
@@ -45,13 +45,13 @@ import { createRequire } from 'node:module'
|
|
|
45
45
|
import { basename, dirname, isAbsolute, join } from 'node:path'
|
|
46
46
|
import { pathToFileURL } from 'node:url'
|
|
47
47
|
|
|
48
|
-
import type { DeployResult, DomainAdapter, DomainInfo, WatchHandle } from '../config/adapter'
|
|
49
|
-
import type { DeployConfig } from '../config/deploy'
|
|
48
|
+
import type { DeployResult, DomainAdapter, DomainInfo, WatchHandle } from '../config/adapter.js'
|
|
49
|
+
import type { DeployConfig } from '../config/deploy.js'
|
|
50
50
|
|
|
51
|
-
import { loadDeclaredSecrets } from './dotenv'
|
|
52
|
-
import { BOLD, DIM, error, GREEN, info, RESET, warn } from './log'
|
|
53
|
-
import { publishSchema, runRelease, runReleaseAfterDeploy } from './publish'
|
|
54
|
-
import { buildProjectSpec } from './spec'
|
|
51
|
+
import { loadDeclaredSecrets } from './dotenv.js'
|
|
52
|
+
import { BOLD, DIM, error, GREEN, info, RESET, warn } from './log.js'
|
|
53
|
+
import { publishSchema, runRelease, runReleaseAfterDeploy } from './publish.js'
|
|
54
|
+
import { buildProjectSpec } from './spec.js'
|
|
55
55
|
|
|
56
56
|
const CONFIG_NAMES = ['astrale.config.ts', 'astrale.config.js', 'astrale.config.mjs']
|
|
57
57
|
|
package/src/cli/spec.ts
CHANGED
|
@@ -16,10 +16,10 @@ import type { Schema } from '@astrale-os/kernel-dsl'
|
|
|
16
16
|
|
|
17
17
|
import { hashInstallGraph } from '@astrale-os/kernel-core/domain'
|
|
18
18
|
|
|
19
|
-
import type { DomainDefinition } from '../config/define-domain'
|
|
20
|
-
import type { RemoteDomainConfig } from '../domain'
|
|
19
|
+
import type { DomainDefinition } from '../config/define-domain.js'
|
|
20
|
+
import type { RemoteDomainConfig } from '../domain/index.js'
|
|
21
21
|
|
|
22
|
-
import { buildInstallGraph, defineRemoteDomain } from '../domain'
|
|
22
|
+
import { buildInstallGraph, defineRemoteDomain } from '../domain/index.js'
|
|
23
23
|
|
|
24
24
|
export async function buildProjectSpec(
|
|
25
25
|
def: DomainDefinition,
|
|
@@ -31,6 +31,7 @@ export async function buildProjectSpec(
|
|
|
31
31
|
const config = {
|
|
32
32
|
schema: def.schema,
|
|
33
33
|
methods: def.methods,
|
|
34
|
+
...(def.core ? { core: def.core } : {}),
|
|
34
35
|
...(def.views ? { views: def.views } : {}),
|
|
35
36
|
...(def.functions ? { remoteFunctions: def.functions } : {}),
|
|
36
37
|
...(def.path ? { path: def.path } : {}),
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
* no kernel — it validates and packages the declaration.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import type { Schema } from '@astrale-os/kernel-dsl'
|
|
19
|
+
import type { Core, Schema } from '@astrale-os/kernel-dsl'
|
|
20
20
|
|
|
21
21
|
import { DomainOrigin } from '@astrale-os/kernel-core/domain'
|
|
22
22
|
|
|
23
|
-
import type { AnyRemoteFunctionDef, ViewDef } from '../define'
|
|
24
|
-
import type { SchemaMethodsImpl } from '../method'
|
|
23
|
+
import type { AnyRemoteFunctionDef, ViewDef } from '../define/index.js'
|
|
24
|
+
import type { SchemaMethodsImpl } from '../method/index.js'
|
|
25
25
|
|
|
26
26
|
// A registry holds views / functions of every deps + param/result shape. Their
|
|
27
27
|
// per-entry typing is enforced at the `defineView` / `defineRemoteFunction` call
|
|
@@ -101,6 +101,8 @@ export interface DefineDomainConfig<S extends Schema, TDeps, TEnv = unknown> {
|
|
|
101
101
|
* compile error here.
|
|
102
102
|
*/
|
|
103
103
|
methods: SchemaMethodsImpl<S, TDeps>
|
|
104
|
+
/** Declarative genesis nodes and edges materialized with the domain at install time. */
|
|
105
|
+
core?: Core<S>
|
|
104
106
|
/**
|
|
105
107
|
* Map the worker `env` to the handler dependency container (`ctx.deps`).
|
|
106
108
|
* Run ONCE per cold isolate per serving URL (the built app is cached), NOT
|
|
@@ -172,6 +174,8 @@ export interface DomainDefinition {
|
|
|
172
174
|
schema: Schema
|
|
173
175
|
// oxlint-disable-next-line no-explicit-any -- erased at the consumption casts in spec/codegen
|
|
174
176
|
methods: SchemaMethodsImpl<Schema, any>
|
|
177
|
+
/** Declarative genesis nodes and edges, preserved through codegen and diagnostic builds. */
|
|
178
|
+
core?: Core<Schema>
|
|
175
179
|
/**
|
|
176
180
|
* env → deps mapper, when the author supplied one. Held loosely (the worker
|
|
177
181
|
* imports the real function from its own `deps` module); the CLI reads only
|
|
@@ -280,6 +284,7 @@ export function defineDomain<S extends Schema, TDeps, TEnv = unknown>(
|
|
|
280
284
|
return {
|
|
281
285
|
schema: config.schema,
|
|
282
286
|
methods: config.methods as DomainDefinition['methods'],
|
|
287
|
+
...(config.core ? { core: config.core as DomainDefinition['core'] } : {}),
|
|
283
288
|
...(config.deps ? { deps: config.deps as DomainDefinition['deps'] } : {}),
|
|
284
289
|
...(config.views ? { views: config.views as Record<string, ViewDef> } : {}),
|
|
285
290
|
...(config.functions ? { functions: config.functions } : {}),
|
package/src/config/deploy.ts
CHANGED
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
* the loader is unchanged.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import type { DomainAdapter } from './adapter'
|
|
23
|
-
import type { DomainDefinition } from './define-domain'
|
|
22
|
+
import type { DomainAdapter } from './adapter.js'
|
|
23
|
+
import type { DomainDefinition } from './define-domain.js'
|
|
24
24
|
|
|
25
25
|
/** A domain definition bound to its deployment adapter — the CLI's input. */
|
|
26
26
|
export interface DeployConfig<Params = unknown> extends DomainDefinition {
|
package/src/config/index.ts
CHANGED
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* declaration.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
export { defineDomain } from './define-domain'
|
|
17
|
-
export type { DefineDomainConfig, DomainDefinition, DomainManifest } from './define-domain'
|
|
16
|
+
export { defineDomain } from './define-domain.js'
|
|
17
|
+
export type { DefineDomainConfig, DomainDefinition, DomainManifest } from './define-domain.js'
|
|
18
18
|
|
|
19
|
-
export { deploy } from './deploy'
|
|
20
|
-
export type { DeployConfig } from './deploy'
|
|
19
|
+
export { deploy } from './deploy.js'
|
|
20
|
+
export type { DeployConfig } from './deploy.js'
|
|
21
21
|
|
|
22
|
-
export { defineAdapter } from './adapter'
|
|
22
|
+
export { defineAdapter } from './adapter.js'
|
|
23
23
|
export type {
|
|
24
24
|
AdapterSpec,
|
|
25
25
|
DeployCtx,
|
|
@@ -28,4 +28,4 @@ export type {
|
|
|
28
28
|
DomainInfo,
|
|
29
29
|
WatchCtx,
|
|
30
30
|
WatchHandle,
|
|
31
|
-
} from './adapter'
|
|
31
|
+
} from './adapter.js'
|