@astrale-os/sdk 0.1.5 → 0.1.7
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/verify.d.ts +2 -0
- package/dist/auth/verify.d.ts.map +1 -1
- package/dist/auth/verify.js +81 -26
- package/dist/auth/verify.js.map +1 -1
- package/dist/cli/bin.d.ts +7 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +15 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/dotenv.d.ts +13 -0
- package/dist/cli/dotenv.d.ts.map +1 -0
- package/dist/cli/dotenv.js +46 -0
- package/dist/cli/dotenv.js.map +1 -0
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +15 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/run.d.ts +79 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +569 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/spec.d.ts +19 -0
- package/dist/cli/spec.d.ts.map +1 -0
- package/dist/cli/spec.js +31 -0
- package/dist/cli/spec.js.map +1 -0
- package/dist/config/adapter.d.ts +140 -0
- package/dist/config/adapter.d.ts.map +1 -0
- package/dist/config/adapter.js +40 -0
- package/dist/config/adapter.js.map +1 -0
- package/dist/config/define-domain.d.ts +112 -0
- package/dist/config/define-domain.d.ts.map +1 -0
- package/dist/config/define-domain.js +98 -0
- package/dist/config/define-domain.js.map +1 -0
- package/dist/config/deploy.d.ts +28 -0
- package/dist/config/deploy.d.ts.map +1 -0
- package/dist/config/deploy.js +24 -0
- package/dist/config/deploy.js.map +1 -0
- package/dist/config/index.d.ts +21 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +18 -0
- package/dist/config/index.js.map +1 -0
- package/dist/define/remote-function.d.ts +19 -11
- package/dist/define/remote-function.d.ts.map +1 -1
- package/dist/define/remote-function.js.map +1 -1
- package/dist/dispatch/call-remote.d.ts +7 -3
- package/dist/dispatch/call-remote.d.ts.map +1 -1
- package/dist/dispatch/call-remote.js.map +1 -1
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +8 -4
- package/dist/dispatch/dispatcher.js.map +1 -1
- package/dist/dispatch/index.d.ts +1 -1
- package/dist/dispatch/index.d.ts.map +1 -1
- package/dist/dispatch/index.js.map +1 -1
- package/dist/dispatch/self.d.ts +46 -10
- package/dist/dispatch/self.d.ts.map +1 -1
- package/dist/dispatch/self.js +65 -8
- package/dist/dispatch/self.js.map +1 -1
- package/dist/domain/define.d.ts +3 -3
- package/dist/domain/define.js +3 -3
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/method/class.d.ts.map +1 -1
- package/dist/method/class.js.map +1 -1
- package/dist/method/context.d.ts +32 -7
- package/dist/method/context.d.ts.map +1 -1
- package/dist/method/index.d.ts +1 -1
- package/dist/method/index.d.ts.map +1 -1
- package/dist/method/single.d.ts +16 -11
- package/dist/method/single.d.ts.map +1 -1
- package/dist/method/single.js.map +1 -1
- package/dist/server/domain-entry.d.ts +67 -0
- package/dist/server/domain-entry.d.ts.map +1 -0
- package/dist/server/domain-entry.js +58 -0
- package/dist/server/domain-entry.js.map +1 -0
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/worker-entry.d.ts +57 -5
- package/dist/server/worker-entry.d.ts.map +1 -1
- package/dist/server/worker-entry.js +108 -24
- package/dist/server/worker-entry.js.map +1 -1
- package/package.json +12 -3
- package/src/auth/verify.ts +89 -28
- package/src/cli/bin.ts +15 -0
- package/src/cli/dotenv.ts +45 -0
- package/src/cli/index.ts +15 -0
- package/src/cli/run.ts +675 -0
- package/src/cli/spec.ts +42 -0
- package/src/config/adapter.ts +172 -0
- package/src/config/define-domain.ts +218 -0
- package/src/config/deploy.ts +35 -0
- package/src/config/index.ts +31 -0
- package/src/define/remote-function.ts +42 -13
- package/src/dispatch/call-remote.ts +7 -2
- package/src/dispatch/dispatcher.ts +8 -4
- package/src/dispatch/index.ts +1 -1
- package/src/dispatch/self.ts +96 -10
- package/src/domain/define.ts +3 -3
- package/src/index.ts +25 -4
- package/src/method/class.ts +4 -3
- package/src/method/context.ts +38 -7
- package/src/method/index.ts +1 -1
- package/src/method/single.ts +30 -11
- package/src/server/domain-entry.ts +113 -0
- package/src/server/index.ts +3 -1
- package/src/server/worker-entry.ts +122 -23
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-remote.d.ts","sourceRoot":"","sources":["../../src/dispatch/call-remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAEjF
|
|
1
|
+
{"version":3,"file":"call-remote.d.ts","sourceRoot":"","sources":["../../src/dispatch/call-remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAEjF;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,wBAAwB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC7F,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/F;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,YAAY,CAWxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call-remote.js","sourceRoot":"","sources":["../../src/dispatch/call-remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"call-remote.js","sourceRoot":"","sources":["../../src/dispatch/call-remote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,MAA2B;IACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,EAAE;QACjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,sFAAsF,CACvF,CAAA;QACH,CAAC;QACD,yEAAyE;QACzE,6EAA6E;QAC7E,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAClC,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/dispatch/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAIjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAY5C,MAAM,MAAM,mBAAmB,CAAC,KAAK,IAAI;IACvC,mFAAmF;IACnF,QAAQ,EAAE,cAAc,CAAA;IACxB,+CAA+C;IAC/C,OAAO,EAAE,WAAW,CAAA;IACpB,wDAAwD;IACxD,IAAI,EAAE,KAAK,CAAA;IACX,iEAAiE;IACjE,UAAU,EAAE,UAAU,CAAA;IACtB;;;;;OAKG;IACH,MAAM,EAAE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AI,GAAG,MAAM,EACnB,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACvB,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAMlC;IAED;;;;OAIG;IACG,QAAQ,CACZ,IAAI,EAAE,IAAI,GAAG,MAAM,EACnB,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GACvB,OAAO,CAAC,cAAc,CAAC,CAKzB;IAED,EAAE,CAAC,UAAU,EAAE,eAAe,GAAG,eAAe,CAK/C;YAEa,GAAG;IA8EjB,OAAO,CAAC,WAAW;CAapB"}
|
|
@@ -15,7 +15,7 @@ import { MethodNotFoundError, SdkResultValidationError, SdkValidationError } fro
|
|
|
15
15
|
import { executeHandler } from './execute';
|
|
16
16
|
import { buildIdentityMap } from './identity';
|
|
17
17
|
import { resolveMethod } from './resolve';
|
|
18
|
-
import { resolveSelf } from './self';
|
|
18
|
+
import { resolveSelf, withNode } from './self';
|
|
19
19
|
import { validateParams, validateResult } from './validate';
|
|
20
20
|
export class SdkDispatcher {
|
|
21
21
|
methods;
|
|
@@ -80,7 +80,7 @@ export class SdkDispatcher {
|
|
|
80
80
|
}
|
|
81
81
|
// `undefined` (not `null`) for static methods — matches the `self` type on
|
|
82
82
|
// `RemoteContext` / `MethodImpl`, which is `undefined` for static methods.
|
|
83
|
-
let
|
|
83
|
+
let parsedSelf;
|
|
84
84
|
if (!bound.isStatic) {
|
|
85
85
|
if (selfRef === undefined || selfRef === null || selfRef === '') {
|
|
86
86
|
throw new SdkValidationError([{ path: ['self'], message: 'Required for non-static method' }], `"${bound.owner}.${bound.method}" is an instance method — it needs a target node. ` +
|
|
@@ -89,7 +89,7 @@ export class SdkDispatcher {
|
|
|
89
89
|
`(e.g. { self: "@<nodeId>" }).`);
|
|
90
90
|
}
|
|
91
91
|
try {
|
|
92
|
-
|
|
92
|
+
parsedSelf = resolveSelf(String(selfRef));
|
|
93
93
|
}
|
|
94
94
|
catch (err) {
|
|
95
95
|
// A malformed caller-supplied `self` is bad client input, not a server
|
|
@@ -106,10 +106,14 @@ export class SdkDispatcher {
|
|
|
106
106
|
const handler = bound.handler;
|
|
107
107
|
const handlerParams = validation.data;
|
|
108
108
|
const callRemote = makeCallRemote(kernel);
|
|
109
|
+
// Enrich the parsed self with the lazy `node()` accessor, bound to this
|
|
110
|
+
// request's kernel (null when the auth policy yields none — `node()` then
|
|
111
|
+
// rejects). Done here, not in `resolveSelf`, so the parse stays kernel-free.
|
|
112
|
+
const self = parsedSelf ? withNode(parsedSelf, kernel) : undefined;
|
|
109
113
|
const ctx = {
|
|
110
114
|
params: handlerParams,
|
|
111
115
|
auth,
|
|
112
|
-
self
|
|
116
|
+
self,
|
|
113
117
|
deps: this.deps,
|
|
114
118
|
url: this.url,
|
|
115
119
|
kernel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/dispatch/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,WAAW,EAAmB,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","s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I,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAA;AACnD,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,cAAc,CAAC,KAAoC,EAAE,MAAe;IAC3E,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAA;IAC5C,IAAI,gBAAgB,CAAC,MAAM,CAAC;QAAE,OAAO,oBAAoB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACxE,OAAO,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;AACrC,CAAC;AAED,KAAK,SAAS,CAAC,CAAC,oBAAoB,CAClC,KAAoC,EACpC,GAA4B;IAE5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QAC9B,MAAM,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IACnC,CAAC;AACH,CAAC;AAED,sFAAsF;AACtF,SAAS,aAAa,CAAC,KAAoC,EAAE,KAAc;IACzE,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;IACrD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,wBAAwB,CAAC,GAAG,CAAC,MAA4C,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IACjG,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,CAAA;AACjB,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,CACL,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,SAAS;QACnB,OAAO,KAAK,KAAK,QAAQ;QACzB,MAAM,CAAC,aAAa,IAAI,KAAK,CAC9B,CAAA;AACH,CAAC"}
|
package/dist/dispatch/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { resolveMethod, buildMethodIndex, type MethodIndex } from './resolve';
|
|
|
3
3
|
export { validateParams, validateResult, type ValidationResult, type ResultValidationResult, } from './validate';
|
|
4
4
|
export { resolveSelf, type SelfResult } from './self';
|
|
5
5
|
export { executeHandler, type ExecuteParams } from './execute';
|
|
6
|
-
export { makeCallRemote, type CallRemoteFn } from './call-remote';
|
|
6
|
+
export { makeCallRemote, type CallRemoteFn, type KernelCaller } from './call-remote';
|
|
7
7
|
export { AuthorizationDeniedError, MethodNotFoundError, SdkValidationError, SdkResultValidationError, } from './errors';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAC7E,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AAC7E,OAAO,EACL,cAAc,EACd,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,GAC5B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AACpF,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,UAAU,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAoB,MAAM,WAAW,CAAA;AAC7E,OAAO,EACL,cAAc,EACd,cAAc,GAGf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAmB,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA4B,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAoB,MAAM,WAAW,CAAA;AAC7E,OAAO,EACL,cAAc,EACd,cAAc,GAGf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAmB,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,cAAc,EAAsB,MAAM,WAAW,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAwC,MAAM,eAAe,CAAA;AACpF,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,UAAU,CAAA"}
|
package/dist/dispatch/self.d.ts
CHANGED
|
@@ -2,26 +2,62 @@
|
|
|
2
2
|
* Self resolution — pipeline step 3.
|
|
3
3
|
*
|
|
4
4
|
* `_self` is a path reference to the node the non-static method runs on.
|
|
5
|
-
*
|
|
6
|
-
* build recursive paths as `${self.path}::method` (the `Path`'s
|
|
7
|
-
* yields its raw form, so template literals work unchanged).
|
|
5
|
+
* `resolveSelf` is a thin PARSE: the caller's string becomes a `Path`, and
|
|
6
|
+
* handlers build recursive paths as `${self.path}::method` (the `Path`'s
|
|
7
|
+
* `toString` yields its raw form, so template literals work unchanged). It does
|
|
8
|
+
* NOT touch the graph — the whole dispatch pipeline (resolve → authenticate →
|
|
9
|
+
* validate → self → execute) reaches the handler without a single `Node::get`.
|
|
8
10
|
*
|
|
9
11
|
* `resolveSelf` receives the bare self target (`@<id>` or a tree path) — the
|
|
10
12
|
* method ref travels in a separate dispatch channel, so `::method` never
|
|
11
13
|
* reaches here. For the `@<id>` form the parsed `Path` is an `IdPath` which
|
|
12
14
|
* already carries the node id; surfacing it on `SelfResult.id` saves every
|
|
13
|
-
* worker handler from
|
|
14
|
-
*
|
|
15
|
-
* operating on.
|
|
15
|
+
* worker handler from parsing `self.path.raw` by hand to recover the id of the
|
|
16
|
+
* node it is already operating on.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* `withNode` enriches the parsed self with the lazy `node()` accessor — the one
|
|
19
|
+
* place a handler can fetch its own node's full record (`{ id, class, props }`)
|
|
20
|
+
* without hand-rolling a `::get`. Construction stays split from parsing so
|
|
21
|
+
* `resolveSelf` remains pure and trivially testable; the dispatcher attaches the
|
|
22
|
+
* accessor once it holds the request's kernel.
|
|
19
23
|
*/
|
|
24
|
+
import type { Node } from '@astrale-os/kernel-core/graph';
|
|
20
25
|
import { Path, type NodeId } from '@astrale-os/kernel-core';
|
|
21
|
-
|
|
26
|
+
import type { Kernel } from '../method/context';
|
|
27
|
+
/** The node a non-static method runs on — its full record, id guaranteed. */
|
|
28
|
+
export type ResolvedSelfNode = Node & {
|
|
29
|
+
id: NodeId;
|
|
30
|
+
};
|
|
31
|
+
/** The bare parse of a self target — no kernel, no fetch. */
|
|
32
|
+
export type ParsedSelf = {
|
|
22
33
|
path: Path;
|
|
23
34
|
/** Set when `path` is an `IdPath` (i.e. `@<id>::method` calls). */
|
|
24
35
|
id?: NodeId;
|
|
25
36
|
};
|
|
26
|
-
export
|
|
37
|
+
export type SelfResult = ParsedSelf & {
|
|
38
|
+
/**
|
|
39
|
+
* Lazily read THIS node's full record via one `::get` on the handler's
|
|
40
|
+
* kernel. Memoized for the dispatch: repeated and concurrent calls share a
|
|
41
|
+
* single in-flight fetch, and a failure clears the cache so it stays
|
|
42
|
+
* retryable. Pass `{ reload: true }` to force a fresh read.
|
|
43
|
+
*
|
|
44
|
+
* The result is a point-in-time SNAPSHOT, not a live view — for
|
|
45
|
+
* read-modify-write, treat it as the value as of the read (or `reload`).
|
|
46
|
+
* `props` is returned structurally validated only, NOT typed against the
|
|
47
|
+
* node's declared schema: the kernel does not hydrate declared props at
|
|
48
|
+
* runtime, so a node-typed `self` would be unsound. Read the concrete backend
|
|
49
|
+
* off `node.class` (a `ClassPath`) — that is the persisted discriminator.
|
|
50
|
+
*/
|
|
51
|
+
node(opts?: {
|
|
52
|
+
reload?: boolean;
|
|
53
|
+
}): Promise<ResolvedSelfNode>;
|
|
54
|
+
};
|
|
55
|
+
export declare function resolveSelf(ref: string): ParsedSelf;
|
|
56
|
+
/**
|
|
57
|
+
* Attach the memoized `node()` accessor, binding it to the handler's kernel.
|
|
58
|
+
* `kernel` is `null` for methods whose auth policy yields none (`public`, or an
|
|
59
|
+
* unauthenticated `optional`) — there `node()` rejects with a clear error
|
|
60
|
+
* rather than reading the graph unauthenticated.
|
|
61
|
+
*/
|
|
62
|
+
export declare function withNode(parsed: ParsedSelf, kernel: Kernel | null): SelfResult;
|
|
27
63
|
//# sourceMappingURL=self.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../src/dispatch/self.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"self.d.ts","sourceRoot":"","sources":["../../src/dispatch/self.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AAEzD,OAAO,EAAU,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAKnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE/C,6EAA6E;AAC7E,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpD,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,IAAI,CAAA;IACV,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;CAC7D,CAAA;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAGnD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,UAAU,CAa9E"}
|
package/dist/dispatch/self.js
CHANGED
|
@@ -2,24 +2,81 @@
|
|
|
2
2
|
* Self resolution — pipeline step 3.
|
|
3
3
|
*
|
|
4
4
|
* `_self` is a path reference to the node the non-static method runs on.
|
|
5
|
-
*
|
|
6
|
-
* build recursive paths as `${self.path}::method` (the `Path`'s
|
|
7
|
-
* yields its raw form, so template literals work unchanged).
|
|
5
|
+
* `resolveSelf` is a thin PARSE: the caller's string becomes a `Path`, and
|
|
6
|
+
* handlers build recursive paths as `${self.path}::method` (the `Path`'s
|
|
7
|
+
* `toString` yields its raw form, so template literals work unchanged). It does
|
|
8
|
+
* NOT touch the graph — the whole dispatch pipeline (resolve → authenticate →
|
|
9
|
+
* validate → self → execute) reaches the handler without a single `Node::get`.
|
|
8
10
|
*
|
|
9
11
|
* `resolveSelf` receives the bare self target (`@<id>` or a tree path) — the
|
|
10
12
|
* method ref travels in a separate dispatch channel, so `::method` never
|
|
11
13
|
* reaches here. For the `@<id>` form the parsed `Path` is an `IdPath` which
|
|
12
14
|
* already carries the node id; surfacing it on `SelfResult.id` saves every
|
|
13
|
-
* worker handler from
|
|
14
|
-
*
|
|
15
|
-
* operating on.
|
|
15
|
+
* worker handler from parsing `self.path.raw` by hand to recover the id of the
|
|
16
|
+
* node it is already operating on.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* `withNode` enriches the parsed self with the lazy `node()` accessor — the one
|
|
19
|
+
* place a handler can fetch its own node's full record (`{ id, class, props }`)
|
|
20
|
+
* without hand-rolling a `::get`. Construction stays split from parsing so
|
|
21
|
+
* `resolveSelf` remains pure and trivially testable; the dispatcher attaches the
|
|
22
|
+
* accessor once it holds the request's kernel.
|
|
19
23
|
*/
|
|
20
24
|
import { IdPath, Path } from '@astrale-os/kernel-core';
|
|
25
|
+
import { classPathSchema } from '@astrale-os/kernel-core/domain';
|
|
26
|
+
import { absolutePathSchema } from '@astrale-os/kernel-core/tree';
|
|
27
|
+
import { z } from 'zod';
|
|
21
28
|
export function resolveSelf(ref) {
|
|
22
29
|
const path = Path.parse(ref);
|
|
23
30
|
return path instanceof IdPath ? { path, id: path.id } : { path };
|
|
24
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Attach the memoized `node()` accessor, binding it to the handler's kernel.
|
|
34
|
+
* `kernel` is `null` for methods whose auth policy yields none (`public`, or an
|
|
35
|
+
* unauthenticated `optional`) — there `node()` rejects with a clear error
|
|
36
|
+
* rather than reading the graph unauthenticated.
|
|
37
|
+
*/
|
|
38
|
+
export function withNode(parsed, kernel) {
|
|
39
|
+
let cached;
|
|
40
|
+
const node = (opts) => {
|
|
41
|
+
if (opts?.reload)
|
|
42
|
+
cached = undefined;
|
|
43
|
+
if (!cached) {
|
|
44
|
+
cached = fetchSelfNode(parsed.path, kernel).catch((err) => {
|
|
45
|
+
cached = undefined; // never cache a rejection — a later call may succeed
|
|
46
|
+
throw err;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return cached;
|
|
50
|
+
};
|
|
51
|
+
return { ...parsed, node };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Boundary schema for a node record off the wire. Structurally identical to
|
|
55
|
+
* kernel-core's `nodeSchema`, re-declared here from its public coercers
|
|
56
|
+
* (`classPathSchema` from `/domain`, `absolutePathSchema` from `/tree`) on
|
|
57
|
+
* purpose: importing the schema from `#graph` would pull zod into the graph
|
|
58
|
+
* barrel and cycle with `AbsolutePath` init (see `kernel/core/graph/index.ts`).
|
|
59
|
+
* Coercing through the canonical schemas yields a real `ClassPath` / `AbsolutePath`.
|
|
60
|
+
*/
|
|
61
|
+
const nodeRecordSchema = z.object({
|
|
62
|
+
class: classPathSchema(),
|
|
63
|
+
path: absolutePathSchema(),
|
|
64
|
+
props: z.record(z.string(), z.unknown()),
|
|
65
|
+
id: z.string().optional(),
|
|
66
|
+
__labels: z.array(z.string()).optional(),
|
|
67
|
+
});
|
|
68
|
+
async function fetchSelfNode(path, kernel) {
|
|
69
|
+
if (!kernel) {
|
|
70
|
+
throw new Error(`self.node() needs an authenticated kernel to read "${path.raw}", but this method ran ` +
|
|
71
|
+
`without one (its auth policy yields no kernel — e.g. 'public'). Read the node from a ` +
|
|
72
|
+
`method whose auth is 'required', or supply a credential.`);
|
|
73
|
+
}
|
|
74
|
+
const record = nodeRecordSchema.parse(await kernel.call(`${path.raw}::get`, {}));
|
|
75
|
+
if (record.id === undefined) {
|
|
76
|
+
throw new Error(`self.node(): "${path.raw}::get" returned a record with no id`);
|
|
77
|
+
}
|
|
78
|
+
// Validated at the wire boundary: id is now known-present, props are
|
|
79
|
+
// structurally checked. Bridge the parse output to the canonical `Node`.
|
|
80
|
+
return { ...record, id: record.id };
|
|
81
|
+
}
|
|
25
82
|
//# sourceMappingURL=self.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"self.js","sourceRoot":"","sources":["../../src/dispatch/self.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"self.js","sourceRoot":"","sources":["../../src/dispatch/self.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAe,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA+BvB,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAA;AAClE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAkB,EAAE,MAAqB;IAChE,IAAI,MAA6C,CAAA;IACjD,MAAM,IAAI,GAAG,CAAC,IAA2B,EAA6B,EAAE;QACtE,IAAI,IAAI,EAAE,MAAM;YAAE,MAAM,GAAG,SAAS,CAAA;QACpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;g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/domain/define.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The domain definition is deployment-agnostic: it carries NO serving url. The
|
|
14
14
|
* url is supplied late by the spec producer (`createRemoteServer({ url })` at
|
|
15
|
-
* runtime, the
|
|
15
|
+
* runtime, the `astrale-domain` CLI offline) and stamped onto every `binding.remoteUrl`
|
|
16
16
|
* by `materializeRemoteDomain`. There is exactly one notion of `url` in the SDK
|
|
17
17
|
* — the worker serving URL, which is also `iss` and the binding base.
|
|
18
18
|
*/
|
|
@@ -69,8 +69,8 @@ export declare function defineRemoteDomain<TDeps>(): <S extends Schema>(config:
|
|
|
69
69
|
* Materialize a `RemoteDomain` at its real serving `url`: re-runs `extendCore`
|
|
70
70
|
* so every aux View/Function `binding.remoteUrl` points at the actual host,
|
|
71
71
|
* and returns the binding maps the auxiliary routes mount from. Called by the
|
|
72
|
-
* only two spec producers — `createRemoteServer` (`config.url`) and the
|
|
73
|
-
* CLI. Returns the define-time `compiled` untouched when there is no aux to
|
|
72
|
+
* only two spec producers — `createRemoteServer` (`config.url`) and the
|
|
73
|
+
* `astrale-domain` CLI. Returns the define-time `compiled` untouched when there is no aux to
|
|
74
74
|
* stamp. `extendCore`/`compileDomain` are pure, so this is safe to call
|
|
75
75
|
* repeatedly (and is memoized per cold isolate by the callers).
|
|
76
76
|
*/
|
package/dist/domain/define.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The domain definition is deployment-agnostic: it carries NO serving url. The
|
|
14
14
|
* url is supplied late by the spec producer (`createRemoteServer({ url })` at
|
|
15
|
-
* runtime, the
|
|
15
|
+
* runtime, the `astrale-domain` CLI offline) and stamped onto every `binding.remoteUrl`
|
|
16
16
|
* by `materializeRemoteDomain`. There is exactly one notion of `url` in the SDK
|
|
17
17
|
* — the worker serving URL, which is also `iss` and the binding base.
|
|
18
18
|
*/
|
|
@@ -61,8 +61,8 @@ export function defineRemoteDomain() {
|
|
|
61
61
|
* Materialize a `RemoteDomain` at its real serving `url`: re-runs `extendCore`
|
|
62
62
|
* so every aux View/Function `binding.remoteUrl` points at the actual host,
|
|
63
63
|
* and returns the binding maps the auxiliary routes mount from. Called by the
|
|
64
|
-
* only two spec producers — `createRemoteServer` (`config.url`) and the
|
|
65
|
-
* CLI. Returns the define-time `compiled` untouched when there is no aux to
|
|
64
|
+
* only two spec producers — `createRemoteServer` (`config.url`) and the
|
|
65
|
+
* `astrale-domain` CLI. Returns the define-time `compiled` untouched when there is no aux to
|
|
66
66
|
* stamp. `extendCore`/`compileDomain` are pure, so this is safe to call
|
|
67
67
|
* repeatedly (and is memoized per cold isolate by the callers).
|
|
68
68
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type { RemoteContext, RemoteHandler, MethodImpl, ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl, } from './method';
|
|
1
|
+
export type { Kernel, KernelForAuth, RemoteContext, RemoteHandler, MethodImpl, ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl, } from './method';
|
|
2
2
|
export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method';
|
|
3
|
-
export {
|
|
4
|
-
export type {
|
|
3
|
+
export { defineDomain, deploy, defineAdapter } from './config';
|
|
4
|
+
export type { ClientBinding, DefineDomainConfig, DomainDefinition, DeployConfig, AdapterSpec, DeployCtx, DeployResult, DomainAdapter, DomainInfo, WatchCtx, WatchHandle, } from './config';
|
|
5
|
+
export { buildInstallGraph, buildInstallGraphHash } from './domain';
|
|
5
6
|
export { defineView, defineRemoteFunction } from './define';
|
|
6
7
|
export type { ViewDef, ViewRenderContext, RemoteFunctionDef, RemoteFunctionContext } from './define';
|
|
7
8
|
export { MetaSchema } from './deploy/meta';
|
|
@@ -15,5 +16,5 @@ export type { AuthContext, Attestation, Authenticated, Delegation, IdentityId, I
|
|
|
15
16
|
export { selfGrant } from '@astrale-os/kernel-core';
|
|
16
17
|
export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch';
|
|
17
18
|
export { AuthorizationDeniedError, MethodNotFoundError, SdkValidationError, SdkResultValidationError, } from './dispatch';
|
|
18
|
-
export type { SelfResult, CallRemoteFn } from './dispatch';
|
|
19
|
+
export type { SelfResult, CallRemoteFn, KernelCaller } from './dispatch';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,aAAa,EACb,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAOnF,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC9D,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAUnE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAC3D,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAcpG,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAGzC,YAAY,EACV,UAAU,EACV,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,UAAU,GACX,MAAM,+BAA+B,CAAA;AAGtC,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAChF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAClF,YAAY,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,EACV,QAAQ,GACT,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGnD,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method';
|
|
2
|
-
// ─── Domain
|
|
3
|
-
|
|
2
|
+
// ─── Domain configuration (astrale.config.ts) ────────────────────────────
|
|
3
|
+
// The author-facing way to declare a standalone domain + how it deploys. The
|
|
4
|
+
// runtime-domain COMPILER (`defineRemoteDomain`) is internal machinery — reach
|
|
5
|
+
// it via the `@astrale-os/sdk/domain` subpath when hand-rolling a worker, or
|
|
6
|
+
// (preferred) use `domainWorkerEntry` from `@astrale-os/sdk/server`.
|
|
7
|
+
export { defineDomain, deploy, defineAdapter } from './config';
|
|
8
|
+
// ─── Install graph (advanced) ────────────────────────────────────────────
|
|
9
|
+
export { buildInstallGraph, buildInstallGraphHash } from './domain';
|
|
4
10
|
// ─── Declarative resource helpers ────────────────────────────────────────
|
|
5
11
|
// Author Views (iframe-mountable) and RemoteFunctions (standalone callables)
|
|
6
12
|
// at the domain definition site. Each `defineView` / `defineRemoteFunction`
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAEnF,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,6EAA6E;AAC7E,qEAAqE;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAe9D,4EAA4E;AAC5E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAEnE,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,yEAAyE;AACzE,8EAA8E;AAC9E,wBAAwB;AACxB,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAG3D,4EAA4E;AAC5E,qFAAqF;AACrF,wEAAwE;AACxE,6EAA6E;AAC7E,wEAAwE;AACxE,yDAAyD;AAEzD,4EAA4E;AAC5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AAA;AACN,wBAAgB,kBAAkB,CAChC,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM,EACrC,CAAC,SAAS,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;AASlE;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,KAAK,CAC/C,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,EACzC,CAAC,SAAS,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAE3C,MAAM,EAAE,CAAC,EACT,aAAa,EAAE,CAAC,EAChB,IAAI,EAAE,CAAC,KACJ,CAAC,CAAA;AACN,wBAAgB,sBAAsB,CACpC,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,mBAAmB,CAAC,CAAC,CAAC,GAAG,MAAM,EACzC,CAAC,SAAS,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,EACpC,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAAA"}
|
package/dist/method/class.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/method/class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../src/method/class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkGH,MAAM,UAAU,kBAAkB,CAAC,GAAG,IAAe;IACnD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC;AA0BD,MAAM,UAAU,sBAAsB,CAAC,GAAG,IAAe;IACvD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC"}
|
package/dist/method/context.d.ts
CHANGED
|
@@ -6,11 +6,35 @@
|
|
|
6
6
|
* non-static methods), the typed dependency container, and a
|
|
7
7
|
* `BoundClientSessionView` to call back into the parent kernel.
|
|
8
8
|
*/
|
|
9
|
+
import type { AuthPolicy } from '@astrale-os/kernel-api/routed';
|
|
9
10
|
import type { FnMap } from '@astrale-os/kernel-client';
|
|
10
11
|
import type { BoundClientSessionView } from '@astrale-os/kernel-client/session';
|
|
11
12
|
import type { AuthContext } from '@astrale-os/kernel-core';
|
|
12
13
|
import type { CallRemoteFn } from '../dispatch/call-remote';
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The kernel session a handler holds: a credential-bound view over the parent
|
|
16
|
+
* kernel — the FULL dispatch surface (`call`/`stream`/`binary`/`signal`,
|
|
17
|
+
* `withSchema` typed dispatch, `as` to rebind the acting credential), not just
|
|
18
|
+
* `call`. Name it from `@astrale-os/sdk` instead of reaching into
|
|
19
|
+
* `@astrale-os/kernel-client`. (For the narrow `{ call }` contract — e.g. a
|
|
20
|
+
* tiny test double — see {@link KernelCaller}.)
|
|
21
|
+
*/
|
|
22
|
+
export type Kernel = BoundClientSessionView<FnMap>;
|
|
23
|
+
/**
|
|
24
|
+
* The `kernel` a handler receives, derived from its declared `auth` policy.
|
|
25
|
+
* The runtime guarantee (see `auth/resolve.ts`) is exact:
|
|
26
|
+
* - `'required'` (the default) — the dispatcher rejects a credentialless call
|
|
27
|
+
* before `execute`, so the kernel is ALWAYS present → non-null.
|
|
28
|
+
* - `'optional'` — a kernel only when a credential was supplied → `… | null`.
|
|
29
|
+
* - `'public'` — never any inbound credential → `null`. (Public handlers that
|
|
30
|
+
* must touch the graph use `selfKernel` after verifying their own upstream.)
|
|
31
|
+
*
|
|
32
|
+
* Distributes over a `AuthPolicy` union (e.g. when `auth` is typed but not a
|
|
33
|
+
* literal) to the widened `Kernel | null` — the safe superset, matching the
|
|
34
|
+
* pre-conditional behaviour.
|
|
35
|
+
*/
|
|
36
|
+
export type KernelForAuth<TAuth extends AuthPolicy> = TAuth extends 'public' ? null : TAuth extends 'optional' ? Kernel | null : Kernel;
|
|
37
|
+
export type RemoteContext<TParams, TSelf, TDeps, TKernel = Kernel | null> = {
|
|
14
38
|
/** Validated params (Zod-checked against the method's `inputSchema`). */
|
|
15
39
|
params: TParams;
|
|
16
40
|
/** Auth context resolved from the inbound delegation credential. `null` for public or unauthenticated optional methods. */
|
|
@@ -23,13 +47,14 @@ export type RemoteContext<TParams, TSelf, TDeps> = {
|
|
|
23
47
|
url: string;
|
|
24
48
|
/**
|
|
25
49
|
* `BoundClientSessionView` to the parent kernel, bound to the composed
|
|
26
|
-
* credential `union(delegation, self)`.
|
|
27
|
-
* `
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
50
|
+
* credential `union(delegation, self)`. Its nullability is `{@link
|
|
51
|
+
* KernelForAuth}` of the method's `auth`: non-null for the default
|
|
52
|
+
* `'required'`, `… | null` for `'optional'`, `null` for `'public'`. Use for
|
|
53
|
+
* kernel syscalls + same-domain methods. For ANOTHER worker's remote method
|
|
54
|
+
* use {@link RemoteContext.callRemote} — `kernel.call` to a remote method
|
|
55
|
+
* fails the audience check.
|
|
31
56
|
*/
|
|
32
|
-
kernel:
|
|
57
|
+
kernel: TKernel;
|
|
33
58
|
/**
|
|
34
59
|
* Call another worker's remote method (a Function with `binding.remoteUrl`),
|
|
35
60
|
* re-minting the credential for the target's audience so it isn't rejected at
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/method/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D,MAAM,MAAM,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/method/context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAA;AAElD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,QAAQ,GACxE,IAAI,GACJ,KAAK,SAAS,UAAU,GACtB,MAAM,GAAG,IAAI,GACb,MAAM,CAAA;AAEZ,MAAM,MAAM,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,IAAI;IAC1E,yEAAyE;IACzE,MAAM,EAAE,OAAO,CAAA;IACf,2HAA2H;IAC3H,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IACxB,4DAA4D;IAC5D,IAAI,EAAE,KAAK,CAAA;IACX,6DAA6D;IAC7D,IAAI,EAAE,KAAK,CAAA;IACX,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;;;OAQG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;;;;;;OAOG;IACH,UAAU,EAAE,YAAY,CAAA;CACzB,CAAA"}
|
package/dist/method/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { RemoteContext } from './context';
|
|
1
|
+
export type { Kernel, KernelForAuth, RemoteContext } from './context';
|
|
2
2
|
export type { RemoteHandler, AnyRemoteHandler, MethodImpl } from './single';
|
|
3
3
|
export { remoteMethod } from './single';
|
|
4
4
|
export type { ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl } from './class';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/method/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/method/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACrE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/method/single.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { AuthPolicy, RouteBinding } from '@astrale-os/kernel-api/routed';
|
|
|
13
13
|
import type { MethodClassKeys, ClassMethodConfig, NonSealedMethodKeys, OwnMethodKeys } from '@astrale-os/kernel-core/domain';
|
|
14
14
|
import type { Schema } from '@astrale-os/kernel-dsl';
|
|
15
15
|
import type { SelfResult } from '../dispatch/self';
|
|
16
|
-
import type { RemoteContext } from './context';
|
|
16
|
+
import type { KernelForAuth, RemoteContext } from './context';
|
|
17
17
|
/**
|
|
18
18
|
* Remote function handler — execute with full typed context.
|
|
19
19
|
*
|
|
@@ -27,9 +27,9 @@ import type { RemoteContext } from './context';
|
|
|
27
27
|
* dispatcher throws — that's a programmer error indicating a stub leaked into
|
|
28
28
|
* a code path that was supposed to execute it.
|
|
29
29
|
*/
|
|
30
|
-
export type RemoteHandler<TParams, TResult, TSelf, TDeps> = {
|
|
30
|
+
export type RemoteHandler<TParams, TResult, TSelf, TDeps, TAuth extends AuthPolicy = 'required'> = {
|
|
31
31
|
/** The handler body. May be async or an async generator (for `output: 'stream'`). */
|
|
32
|
-
execute?: (ctx: RemoteContext<TParams, TSelf, TDeps
|
|
32
|
+
execute?: (ctx: RemoteContext<TParams, TSelf, TDeps, KernelForAuth<TAuth>>) => TResult | Promise<TResult> | AsyncGenerator<TResult>;
|
|
33
33
|
/**
|
|
34
34
|
* Optional REST binding — attaches a native HTTP route to this method.
|
|
35
35
|
* Uses the kernel's canonical `RouteBinding` type directly.
|
|
@@ -43,8 +43,13 @@ export type RemoteHandler<TParams, TResult, TSelf, TDeps> = {
|
|
|
43
43
|
remoteUrl?: string;
|
|
44
44
|
/** Optional human-readable description. Appears in generated docs. */
|
|
45
45
|
description?: string;
|
|
46
|
-
/**
|
|
47
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Authentication policy. Defaults to `'required'` when absent. Captured as a
|
|
48
|
+
* literal type so it drives {@link KernelForAuth} on the `execute`/`authorize`
|
|
49
|
+
* context: omit it (or set `'required'`) and `ctx.kernel` is non-null;
|
|
50
|
+
* `'optional'` widens it to `… | null`; `'public'` makes it `null`.
|
|
51
|
+
*/
|
|
52
|
+
auth?: TAuth;
|
|
48
53
|
/**
|
|
49
54
|
* Optional pre-execute authorization check. Runs after auth resolution and
|
|
50
55
|
* `_self` resolution, before `execute`. Throw any error to deny the call —
|
|
@@ -59,19 +64,19 @@ export type RemoteHandler<TParams, TResult, TSelf, TDeps> = {
|
|
|
59
64
|
* The kernel still enforces `has_perm` independently — `authorize` is
|
|
60
65
|
* additive ergonomic gating on top, not a replacement.
|
|
61
66
|
*/
|
|
62
|
-
authorize?: (ctx: RemoteContext<TParams, TSelf, TDeps
|
|
67
|
+
authorize?: (ctx: RemoteContext<TParams, TSelf, TDeps, KernelForAuth<TAuth>>) => void | Promise<void>;
|
|
63
68
|
};
|
|
64
|
-
export type AnyRemoteHandler = RemoteHandler<any, any, any, any>;
|
|
69
|
+
export type AnyRemoteHandler = RemoteHandler<any, any, any, any, AuthPolicy>;
|
|
65
70
|
/**
|
|
66
71
|
* Fully typed method implementation — resolves params/result/self from the
|
|
67
72
|
* schema, wraps in `RemoteHandler` with deps.
|
|
68
73
|
*/
|
|
69
|
-
export type MethodImpl<S extends Schema, K extends MethodClassKeys<S> & string, M extends string, TDeps = unknown> = ClassMethodConfig<S, K, M> extends {
|
|
74
|
+
export type MethodImpl<S extends Schema, K extends MethodClassKeys<S> & string, M extends string, TDeps = unknown, TAuth extends AuthPolicy = 'required'> = ClassMethodConfig<S, K, M> extends {
|
|
70
75
|
params: infer P;
|
|
71
76
|
result: infer R;
|
|
72
77
|
self: unknown;
|
|
73
78
|
isStatic: infer St;
|
|
74
|
-
} ? RemoteHandler<P, R, St extends true ? undefined : SelfResult, TDeps> : never;
|
|
79
|
+
} ? RemoteHandler<P, R, St extends true ? undefined : SelfResult, TDeps, TAuth> : never;
|
|
75
80
|
type ImplementableMethodName<S extends Schema, K extends MethodClassKeys<S> & string> = (OwnMethodKeys<S, K> | NonSealedMethodKeys<S, K>) & string;
|
|
76
81
|
/**
|
|
77
82
|
* Identity helper for authoring one remote method with full schema-driven typing.
|
|
@@ -82,7 +87,7 @@ type ImplementableMethodName<S extends Schema, K extends MethodClassKeys<S> & st
|
|
|
82
87
|
* - `remoteMethod(schema, className, methodName, impl)` — direct form with
|
|
83
88
|
* `unknown` deps.
|
|
84
89
|
*/
|
|
85
|
-
export declare function remoteMethod<TDeps>(): <S extends Schema, K extends MethodClassKeys<S> & string, M extends ImplementableMethodName<S, K
|
|
86
|
-
export declare function remoteMethod<S extends Schema, K extends MethodClassKeys<S> & string, M extends ImplementableMethodName<S, K
|
|
90
|
+
export declare function remoteMethod<TDeps>(): <S extends Schema, K extends MethodClassKeys<S> & string, M extends ImplementableMethodName<S, K>, TAuth extends AuthPolicy = 'required'>(schema: S, className: K, methodName: M, impl: MethodImpl<S, K, M, TDeps, TAuth>) => MethodImpl<S, K, M, TDeps, TAuth>;
|
|
91
|
+
export declare function remoteMethod<S extends Schema, K extends MethodClassKeys<S> & string, M extends ImplementableMethodName<S, K>, TAuth extends AuthPolicy = 'required'>(schema: S, className: K, methodName: M, impl: MethodImpl<S, K, M, unknown, TAuth>): MethodImpl<S, K, M, unknown, TAuth>;
|
|
87
92
|
export {};
|
|
88
93
|
//# sourceMappingURL=single.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACd,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"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C,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA;AACtC,wBAAgB,YAAY,CAC1B,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,GAAG,MAAM,EACrC,CAAC,SAAS,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,EACvC,KAAK,SAAS,UAAU,GAAG,UAAU,EAErC,MAAM,EAAE,CAAC,EACT,SAAS,EAAE,CAAC,EACZ,UAAU,EAAE,CAAC,EACb,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GACxC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.js","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"single.js","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuIH,MAAM,UAAU,YAAY,CAAC,GAAG,IAAe;IAC7C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC"}
|