@astrale-os/sdk 0.1.10 → 0.3.0
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/LICENSE +202 -0
- package/dist/auth/check.d.ts +1 -2
- package/dist/auth/check.d.ts.map +1 -1
- package/dist/auth/check.js +2 -6
- package/dist/auth/check.js.map +1 -1
- package/dist/auth/index.d.ts +3 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/issuer-mint.d.ts +53 -0
- package/dist/auth/issuer-mint.d.ts.map +1 -0
- package/dist/auth/issuer-mint.js +35 -0
- package/dist/auth/issuer-mint.js.map +1 -0
- package/dist/auth/kernel-client.d.ts +8 -2
- package/dist/auth/kernel-client.d.ts.map +1 -1
- package/dist/auth/kernel-client.js +22 -46
- package/dist/auth/kernel-client.js.map +1 -1
- package/dist/cli/dotenv.d.ts +8 -0
- package/dist/cli/dotenv.d.ts.map +1 -1
- package/dist/cli/dotenv.js +18 -0
- package/dist/cli/dotenv.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/log.d.ts +11 -0
- package/dist/cli/log.d.ts.map +1 -0
- package/dist/cli/log.js +17 -0
- package/dist/cli/log.js.map +1 -0
- package/dist/cli/publish.d.ts +35 -0
- package/dist/cli/publish.d.ts.map +1 -0
- package/dist/cli/publish.js +271 -0
- package/dist/cli/publish.js.map +1 -0
- package/dist/cli/run.d.ts +17 -2
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +102 -111
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/spec.d.ts.map +1 -1
- package/dist/cli/spec.js +1 -0
- package/dist/cli/spec.js.map +1 -1
- package/dist/config/adapter.d.ts +12 -11
- package/dist/config/adapter.d.ts.map +1 -1
- package/dist/config/adapter.js.map +1 -1
- package/dist/config/define-domain.d.ts +88 -27
- package/dist/config/define-domain.d.ts.map +1 -1
- package/dist/config/define-domain.js +79 -33
- package/dist/config/define-domain.js.map +1 -1
- package/dist/config/deploy.d.ts +1 -1
- package/dist/config/deploy.js +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/define/remote-function.d.ts +32 -17
- package/dist/define/remote-function.d.ts.map +1 -1
- package/dist/define/remote-function.js +10 -9
- package/dist/define/remote-function.js.map +1 -1
- package/dist/define/view.d.ts +8 -6
- package/dist/define/view.d.ts.map +1 -1
- package/dist/define/view.js +8 -6
- package/dist/define/view.js.map +1 -1
- package/dist/deploy/check.d.ts +6 -6
- 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 +0 -1
- package/dist/deploy/index.d.ts.map +1 -1
- package/dist/deploy/index.js +0 -1
- package/dist/deploy/index.js.map +1 -1
- package/dist/deploy/meta.d.ts +11 -0
- package/dist/deploy/meta.d.ts.map +1 -1
- package/dist/deploy/meta.js +23 -0
- package/dist/deploy/meta.js.map +1 -1
- package/dist/dispatch/dispatcher.d.ts +17 -4
- package/dist/dispatch/dispatcher.d.ts.map +1 -1
- package/dist/dispatch/dispatcher.js +15 -3
- package/dist/dispatch/dispatcher.js.map +1 -1
- package/dist/dispatch/execute.d.ts +6 -2
- 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 +12 -10
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/identity.js +10 -15
- package/dist/dispatch/identity.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 +1 -1
- package/dist/dispatch/index.js.map +1 -1
- package/dist/dispatch/self.d.ts +25 -37
- package/dist/dispatch/self.d.ts.map +1 -1
- package/dist/dispatch/self.js +60 -30
- package/dist/dispatch/self.js.map +1 -1
- package/dist/domain/binding.d.ts +18 -0
- package/dist/domain/binding.d.ts.map +1 -0
- package/dist/domain/binding.js +29 -0
- package/dist/domain/binding.js.map +1 -0
- package/dist/domain/build-spec.d.ts.map +1 -1
- package/dist/domain/build-spec.js +22 -7
- package/dist/domain/build-spec.js.map +1 -1
- package/dist/domain/define.d.ts +28 -43
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +23 -60
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/extend-functions.d.ts +48 -0
- package/dist/domain/extend-functions.d.ts.map +1 -0
- package/dist/domain/extend-functions.js +84 -0
- package/dist/domain/extend-functions.js.map +1 -0
- package/dist/domain/extend-views.d.ts +45 -0
- package/dist/domain/extend-views.d.ts.map +1 -0
- package/dist/domain/extend-views.js +116 -0
- package/dist/domain/extend-views.js.map +1 -0
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -5
- package/dist/index.js.map +1 -1
- package/dist/method/class.d.ts +2 -2
- package/dist/method/class.d.ts.map +1 -1
- package/dist/method/class.js.map +1 -1
- package/dist/method/context.d.ts +18 -3
- package/dist/method/context.d.ts.map +1 -1
- package/dist/method/index.d.ts +2 -2
- package/dist/method/index.d.ts.map +1 -1
- package/dist/method/index.js.map +1 -1
- package/dist/method/single.d.ts +25 -38
- package/dist/method/single.d.ts.map +1 -1
- package/dist/method/single.js +1 -11
- package/dist/method/single.js.map +1 -1
- package/dist/server/auxiliary-routes.d.ts.map +1 -1
- package/dist/server/auxiliary-routes.js +14 -3
- package/dist/server/auxiliary-routes.js.map +1 -1
- package/dist/server/create.d.ts +2 -15
- package/dist/server/create.d.ts.map +1 -1
- package/dist/server/create.js +15 -51
- package/dist/server/create.js.map +1 -1
- package/dist/server/domain-entry.d.ts +10 -0
- package/dist/server/domain-entry.d.ts.map +1 -1
- package/dist/server/domain-entry.js +2 -0
- package/dist/server/domain-entry.js.map +1 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +0 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/worker-entry.d.ts +3 -3
- package/dist/server/worker-entry.js +3 -3
- package/package.json +10 -11
- package/src/auth/check.ts +2 -6
- package/src/auth/index.ts +3 -1
- package/src/auth/issuer-mint.ts +75 -0
- package/src/auth/kernel-client.ts +31 -63
- package/src/cli/dotenv.ts +20 -0
- package/src/cli/index.ts +1 -1
- package/src/cli/log.ts +18 -0
- package/src/cli/publish.ts +341 -0
- package/src/cli/run.ts +109 -125
- package/src/cli/spec.ts +1 -0
- package/src/config/adapter.ts +9 -11
- package/src/config/define-domain.ts +184 -53
- package/src/config/deploy.ts +1 -1
- package/src/config/index.ts +1 -1
- package/src/define/remote-function.ts +56 -21
- package/src/define/view.ts +8 -6
- package/src/deploy/check.ts +7 -7
- package/src/deploy/index.ts +0 -1
- package/src/deploy/meta.ts +25 -0
- package/src/dispatch/dispatcher.ts +32 -9
- package/src/dispatch/execute.ts +7 -2
- package/src/dispatch/identity.ts +17 -22
- package/src/dispatch/index.ts +1 -1
- package/src/dispatch/self.ts +117 -41
- package/src/domain/binding.ts +37 -0
- package/src/domain/build-spec.ts +32 -7
- package/src/domain/define.ts +71 -78
- package/src/domain/extend-functions.ts +106 -0
- package/src/domain/extend-views.ts +151 -0
- package/src/index.ts +36 -7
- package/src/method/class.ts +11 -7
- package/src/method/context.ts +19 -3
- package/src/method/index.ts +8 -2
- package/src/method/single.ts +35 -42
- package/src/server/auxiliary-routes.ts +14 -3
- package/src/server/create.ts +15 -51
- package/src/server/domain-entry.ts +12 -0
- package/src/server/index.ts +0 -1
- package/src/server/worker-entry.ts +3 -3
- package/src/deploy/hash-spec.ts +0 -31
- package/src/domain/extend-core.ts +0 -301
- package/src/server/worker-meta.ts +0 -25
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize the `functions` map (`defineRemoteFunction` entries) into the two
|
|
3
|
+
* halves a standalone-function DOMAIN MEMBER contributes — mirroring how a class
|
|
4
|
+
* method splits across compile + serialize:
|
|
5
|
+
*
|
|
6
|
+
* - the CONTRACT half — a `func({ input, output })` per slug, declared in the
|
|
7
|
+
* schema's `functions` group so the compiled domain carries `function.<slug>`
|
|
8
|
+
* on `refs.functions` (the kernel owns the ref/layout/of_domain mapping).
|
|
9
|
+
* - `FunctionSchema[]` + per-slug `FunctionBinding` — the IMPL/BINDING half,
|
|
10
|
+
* fed to `serialize` (url-stamped). The worker route is
|
|
11
|
+
* `<url>/<functionsFolder>/<slug>`, DECOUPLED from the graph layout — so
|
|
12
|
+
* `functionsFolder` only names the URL segment, not the node position.
|
|
13
|
+
*
|
|
14
|
+
* A standalone function is NOT a core/instance node: it is attached directly to
|
|
15
|
+
* the Domain via `of_domain` by the kernel-core serializer, so this module never
|
|
16
|
+
* touches `Core`.
|
|
17
|
+
*/
|
|
18
|
+
import { zodToJsonSchema } from '@astrale-os/kernel-core/domain';
|
|
19
|
+
import { resolveBinding } from './binding';
|
|
20
|
+
/**
|
|
21
|
+
* Default URL segment for a function's worker route (`<url>/functions/<slug>`).
|
|
22
|
+
* Names the HTTP route only — the graph layout (`/<origin>/functions/<slug>`) is
|
|
23
|
+
* a fixed kernel convention, independent of this.
|
|
24
|
+
*/
|
|
25
|
+
export const DEFAULT_FUNCTIONS_FOLDER = 'functions';
|
|
26
|
+
const SLUG_RE = /^[a-z][a-z0-9-]*$/;
|
|
27
|
+
function assertValidSlugs(functions) {
|
|
28
|
+
for (const slug of Object.keys(functions)) {
|
|
29
|
+
if (!SLUG_RE.test(slug)) {
|
|
30
|
+
throw new Error(`defineRemoteDomain: invalid function slug "${slug}" — must match ${SLUG_RE}.`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Contract half — since "functions as first-class defineSchema members", a
|
|
36
|
+
* standalone function's CONTRACT is declared in the SCHEMA (`defineSchema(...,
|
|
37
|
+
* { functions: { seed: func({ input, output }) } })`) and `compileDomain` builds
|
|
38
|
+
* the member refs from it; the SDK map supplies the HANDLER half. This check
|
|
39
|
+
* pins the two halves together at define time: every schema-declared function
|
|
40
|
+
* needs a handler, every handler a declaration — a drifted key fails loudly at
|
|
41
|
+
* authoring, never as a boot-time missing-identity or a dangling graph member.
|
|
42
|
+
*/
|
|
43
|
+
export function assertFunctionsMatchSchema(schema, functions) {
|
|
44
|
+
if (functions)
|
|
45
|
+
assertValidSlugs(functions);
|
|
46
|
+
const declared = Object.keys(schema.functions ?? {});
|
|
47
|
+
const handled = Object.keys(functions ?? {});
|
|
48
|
+
const missingHandler = declared.filter((slug) => !handled.includes(slug));
|
|
49
|
+
const missingDecl = handled.filter((slug) => !declared.includes(slug));
|
|
50
|
+
if (missingHandler.length === 0 && missingDecl.length === 0)
|
|
51
|
+
return;
|
|
52
|
+
const parts = [];
|
|
53
|
+
if (missingHandler.length > 0) {
|
|
54
|
+
parts.push(`schema declares function(s) with no handler: ${missingHandler.map((s) => `"${s}"`).join(', ')}`);
|
|
55
|
+
}
|
|
56
|
+
if (missingDecl.length > 0) {
|
|
57
|
+
parts.push(`handler(s) with no schema declaration: ${missingDecl.map((s) => `"${s}"`).join(', ')} ` +
|
|
58
|
+
`(declare them in defineSchema's \`functions\` group via \`func({ input, output })\`)`);
|
|
59
|
+
}
|
|
60
|
+
throw new Error(`defineRemoteDomain: functions/schema mismatch — ${parts.join('; ')}.`);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Impl/binding half — `FunctionSchema[]` for `serialize` plus the per-slug
|
|
64
|
+
* `FunctionBinding` map the worker mounts routes from. `ref` is the canonical
|
|
65
|
+
* `function.<slug>` member ref (matching `compiled.$.refs.functions`), so the
|
|
66
|
+
* serializer's per-member impl lookup finds it.
|
|
67
|
+
*/
|
|
68
|
+
export function buildFunctionSchemas(functions, url, functionsFolder) {
|
|
69
|
+
const schemas = [];
|
|
70
|
+
const bindings = {};
|
|
71
|
+
for (const [slug, def] of Object.entries(functions)) {
|
|
72
|
+
const binding = resolveBinding(def.binding, url, functionsFolder, slug);
|
|
73
|
+
bindings[slug] = binding;
|
|
74
|
+
schemas.push({
|
|
75
|
+
ref: `function.${slug}`,
|
|
76
|
+
inputSchema: zodToJsonSchema(def.inputSchema),
|
|
77
|
+
outputSchema: zodToJsonSchema(def.outputSchema),
|
|
78
|
+
output: 'value',
|
|
79
|
+
binding,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return { schemas, bindings };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=extend-functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-functions.js","sourceRoot":"","sources":["../../src/domain/extend-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAIhE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAA;AACnD,MAAM,OAAO,GAAG,mBAAmB,CAAA;AAEnC,SAAS,gBAAgB,CAAC,SAA+C;IACvE,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,8CAA8C,IAAI,kBAAkB,OAAO,GAAG,CAC/E,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CACxC,MAAc,EACd,SAA2D;IAE3D,IAAI,SAAS;QAAE,gBAAgB,CAAC,SAAS,CAAC,CAAA;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAA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,GAAoC,EAAE,CAAA;IACpD,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,CAAA;QACvE,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAA;QACxB,OAAO,CAAC,IAAI,CAAC;YACX,GAAG,EAAE,YAAY,IAAI,EAAE;YACvB,WAAW,EAAE,eAAe,CAAC,GAAG,CAAC,WAAW,CAAC;YAC7C,YAAY,EAAE,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC;YAC/C,MAAM,EAAE,OAAO;YACf,OAAO;SACR,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize the `views` map (`defineView` entries) into the two halves a view
|
|
3
|
+
* DOMAIN MEMBER contributes — mirroring `extend-functions.ts`:
|
|
4
|
+
*
|
|
5
|
+
* - `ViewDeclarations` — the CONTRACT half, fed to `compileDomain`'s members
|
|
6
|
+
* arg. The member ref (`view.<slug>`), the layout (`/<origin>/views/<slug>`),
|
|
7
|
+
* and the `of_domain` edge slug all derive from the map key.
|
|
8
|
+
* - `ViewSchema[]` + per-slug `FunctionBinding` — the IMPL half, fed to
|
|
9
|
+
* `serialize`. A view carries more than a function: a `UI.handshake` mode and
|
|
10
|
+
* `view_for` target edges (resolved here to graph paths). The worker route is
|
|
11
|
+
* `<url>/<viewsFolder>/<slug>`, DECOUPLED from the graph layout.
|
|
12
|
+
*
|
|
13
|
+
* A view is NOT a core/instance node: the kernel-core serializer attaches it to
|
|
14
|
+
* the Domain via `of_domain` (slug `view.<slug>`) and emits its `view_for` edges,
|
|
15
|
+
* so this module never touches `Core`.
|
|
16
|
+
*/
|
|
17
|
+
import type { FunctionBinding } from '@astrale-os/kernel-api/routed';
|
|
18
|
+
import type { ViewDeclarations, ViewSchema } from '@astrale-os/kernel-core/domain';
|
|
19
|
+
import type { Schema } from '@astrale-os/kernel-dsl';
|
|
20
|
+
import type { ViewDef } from '../define/view';
|
|
21
|
+
/**
|
|
22
|
+
* Default URL segment for a view's worker route (`<url>/views/<slug>`). Names the
|
|
23
|
+
* HTTP route only — the graph layout (`/<origin>/views/<slug>`) is a fixed kernel
|
|
24
|
+
* convention, independent of this.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_VIEWS_FOLDER = "views";
|
|
27
|
+
type AnyViewDef = ViewDef<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Contract half — one declaration per `views` map key, for `compileDomain`'s
|
|
30
|
+
* `views` arg. The slug drives ref/path/of_domain; impl/binding/view_for arrive
|
|
31
|
+
* at serialize.
|
|
32
|
+
*/
|
|
33
|
+
export declare function buildViewDeclarations(views: Record<string, AnyViewDef>): ViewDeclarations;
|
|
34
|
+
/**
|
|
35
|
+
* Impl half — `ViewSchema[]` for `serialize` plus the per-slug `FunctionBinding`
|
|
36
|
+
* map the worker mounts routes from. `viewFor` markers are resolved here to
|
|
37
|
+
* concrete target paths (class meta-nodes) because the kernel-core serializer is
|
|
38
|
+
* pure and does not resolve `defineCore` endpoints.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildViewSchemas(views: Record<string, AnyViewDef>, url: string, viewsFolder: string, schema: Schema): {
|
|
41
|
+
schemas: ViewSchema[];
|
|
42
|
+
bindings: Record<string, FunctionBinding>;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=extend-views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-views.d.ts","sourceRoot":"","sources":["../../src/domain/extend-views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAYpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAI7C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAAU,CAAA;AAI3C,KAAK,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;AAoB9B;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,gBAAgB,CAKzF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAAE,CAsBtE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize the `views` map (`defineView` entries) into the two halves a view
|
|
3
|
+
* DOMAIN MEMBER contributes — mirroring `extend-functions.ts`:
|
|
4
|
+
*
|
|
5
|
+
* - `ViewDeclarations` — the CONTRACT half, fed to `compileDomain`'s members
|
|
6
|
+
* arg. The member ref (`view.<slug>`), the layout (`/<origin>/views/<slug>`),
|
|
7
|
+
* and the `of_domain` edge slug all derive from the map key.
|
|
8
|
+
* - `ViewSchema[]` + per-slug `FunctionBinding` — the IMPL half, fed to
|
|
9
|
+
* `serialize`. A view carries more than a function: a `UI.handshake` mode and
|
|
10
|
+
* `view_for` target edges (resolved here to graph paths). The worker route is
|
|
11
|
+
* `<url>/<viewsFolder>/<slug>`, DECOUPLED from the graph layout.
|
|
12
|
+
*
|
|
13
|
+
* A view is NOT a core/instance node: the kernel-core serializer attaches it to
|
|
14
|
+
* the Domain via `of_domain` (slug `view.<slug>`) and emits its `view_for` edges,
|
|
15
|
+
* so this module never touches `Core`.
|
|
16
|
+
*/
|
|
17
|
+
import { DomainPaths } from '@astrale-os/kernel-core/domain';
|
|
18
|
+
import { buildDefOriginMap, scanImportedDefs } from '@astrale-os/kernel-core/domain';
|
|
19
|
+
import { buildDefDescriptorMap, isAbstract, isCorePath, isSelfMarker, } from '@astrale-os/kernel-dsl';
|
|
20
|
+
import { joinWorkerPath, resolveBinding } from './binding';
|
|
21
|
+
/**
|
|
22
|
+
* Default URL segment for a view's worker route (`<url>/views/<slug>`). Names the
|
|
23
|
+
* HTTP route only — the graph layout (`/<origin>/views/<slug>`) is a fixed kernel
|
|
24
|
+
* convention, independent of this.
|
|
25
|
+
*/
|
|
26
|
+
export const DEFAULT_VIEWS_FOLDER = 'views';
|
|
27
|
+
const SLUG_RE = /^[a-z][a-z0-9-]*$/;
|
|
28
|
+
function assertValidSlugs(views) {
|
|
29
|
+
for (const slug of Object.keys(views)) {
|
|
30
|
+
if (!SLUG_RE.test(slug)) {
|
|
31
|
+
throw new Error(`defineRemoteDomain: invalid view slug "${slug}" — must match ${SLUG_RE}.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Enforce ViewDef's documented exclusivity: `mount` cannot combine with `render`/`binding`. */
|
|
36
|
+
function assertExclusivity(slug, def) {
|
|
37
|
+
if (def.mount && (def.render || def.binding)) {
|
|
38
|
+
throw new Error(`defineRemoteDomain: view "${slug}" sets \`mount\` together with ` +
|
|
39
|
+
`${def.render ? '`render`' : '`binding`'} — they are mutually exclusive.`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Contract half — one declaration per `views` map key, for `compileDomain`'s
|
|
44
|
+
* `views` arg. The slug drives ref/path/of_domain; impl/binding/view_for arrive
|
|
45
|
+
* at serialize.
|
|
46
|
+
*/
|
|
47
|
+
export function buildViewDeclarations(views) {
|
|
48
|
+
assertValidSlugs(views);
|
|
49
|
+
const out = {};
|
|
50
|
+
for (const slug of Object.keys(views))
|
|
51
|
+
out[slug] = { slug };
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Impl half — `ViewSchema[]` for `serialize` plus the per-slug `FunctionBinding`
|
|
56
|
+
* map the worker mounts routes from. `viewFor` markers are resolved here to
|
|
57
|
+
* concrete target paths (class meta-nodes) because the kernel-core serializer is
|
|
58
|
+
* pure and does not resolve `defineCore` endpoints.
|
|
59
|
+
*/
|
|
60
|
+
export function buildViewSchemas(views, url, viewsFolder, schema) {
|
|
61
|
+
const schemas = [];
|
|
62
|
+
const bindings = {};
|
|
63
|
+
for (const [slug, def] of Object.entries(views)) {
|
|
64
|
+
assertExclusivity(slug, def);
|
|
65
|
+
// `mount` is a worker-relative SPA path → `<url><mount>`; otherwise the
|
|
66
|
+
// default/overridden `<url>/<viewsFolder>/<slug>`.
|
|
67
|
+
const binding = def.mount
|
|
68
|
+
? { remoteUrl: joinWorkerPath(url, def.mount) }
|
|
69
|
+
: resolveBinding(def.binding, url, viewsFolder, slug);
|
|
70
|
+
bindings[slug] = binding;
|
|
71
|
+
// Inline `render` views ship no shell client → default handshake 'none'.
|
|
72
|
+
const handshake = def.handshake ?? (def.render ? 'none' : undefined);
|
|
73
|
+
schemas.push({
|
|
74
|
+
ref: `view.${slug}`,
|
|
75
|
+
name: slug,
|
|
76
|
+
binding,
|
|
77
|
+
...(handshake ? { handshake } : {}),
|
|
78
|
+
viewFor: resolveViewForTargets(def.viewFor, schema),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return { schemas, bindings };
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Resolve `defineView`'s `viewFor` endpoints to concrete graph path raws.
|
|
85
|
+
* Mirrors kernel-core `compileCore`'s endpoint resolution (the old channel that
|
|
86
|
+
* carried view_for as core edges): `selfOf(Def)` → the def's class/interface
|
|
87
|
+
* meta-node `/<declaringDomain>/{class,interface}.<Name>/self`; a `CorePath`
|
|
88
|
+
* string → its anchored graph path. Empty when the view targets nothing.
|
|
89
|
+
*/
|
|
90
|
+
function resolveViewForTargets(viewFor, schema) {
|
|
91
|
+
if (!viewFor)
|
|
92
|
+
return [];
|
|
93
|
+
const targets = Array.isArray(viewFor) ? viewFor : [viewFor];
|
|
94
|
+
if (targets.length === 0)
|
|
95
|
+
return [];
|
|
96
|
+
const descriptorMap = buildDefDescriptorMap(schema);
|
|
97
|
+
const defOrigins = buildDefOriginMap(schema, scanImportedDefs(schema));
|
|
98
|
+
return targets.map((target) => {
|
|
99
|
+
if (isSelfMarker(target)) {
|
|
100
|
+
const def = target.__def;
|
|
101
|
+
const desc = descriptorMap.get(def);
|
|
102
|
+
if (!desc) {
|
|
103
|
+
throw new Error('defineView: `viewFor: selfOf(...)` references a def that is neither in this ' +
|
|
104
|
+
"schema nor any of its `imports`. Add the def's schema to `imports`.");
|
|
105
|
+
}
|
|
106
|
+
const origin = defOrigins.get(def) ?? schema.domain;
|
|
107
|
+
const dp = DomainPaths.of(origin);
|
|
108
|
+
return isAbstract(def) ? dp.interface(desc.name).raw : dp.class(desc.name).raw;
|
|
109
|
+
}
|
|
110
|
+
if (isCorePath(target)) {
|
|
111
|
+
return DomainPaths.of(schema.domain).corePath(target).raw;
|
|
112
|
+
}
|
|
113
|
+
throw new Error('defineView: unsupported `viewFor` endpoint — use `selfOf(Class)` or a CorePath.');
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=extend-views.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extend-views.js","sourceRoot":"","sources":["../../src/domain/extend-views.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5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,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
export type { AuthForPolicy, Kernel, KernelForAuth, RemoteContext, RemoteHandler, MethodImpl, ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl, } from './method';
|
|
1
|
+
export type { MethodParams, MethodResult, AuthForPolicy, GraphApi, Kernel, KernelForAuth, RemoteContext, RemoteHandler, MethodImpl, ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl, } from './method';
|
|
2
2
|
export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './method';
|
|
3
3
|
export { defineDomain, deploy, defineAdapter } from './config';
|
|
4
|
-
export type {
|
|
4
|
+
export type { DefineDomainConfig, DomainDefinition, DomainManifest, DeployConfig, AdapterSpec, DeployCtx, DeployResult, DomainAdapter, DomainInfo, WatchCtx, WatchHandle, } from './config';
|
|
5
5
|
export { buildInstallGraph, buildInstallGraphHash } from './domain';
|
|
6
|
+
export { AbsolutePath, Patch, Path } from '@astrale-os/kernel-core';
|
|
7
|
+
export { ClassPath } from '@astrale-os/kernel-core/domain';
|
|
8
|
+
export type { EdgeCreate, EdgeDelete, EdgeMatcher, EdgeUpdate, NodeCreate, NodeDelete, NodeUpdate, PatchData, } from '@astrale-os/kernel-core';
|
|
6
9
|
export { defineView, defineRemoteFunction } from './define';
|
|
7
10
|
export type { ViewDef, ViewRenderContext, RemoteFunctionDef, RemoteFunctionContext } from './define';
|
|
8
11
|
export { MetaSchema } from './deploy/meta';
|
|
9
12
|
export type { Meta } from './deploy/meta';
|
|
10
13
|
export type { AuthPolicy, RouteBinding, FunctionBinding, CredentialSource, SingleCredentialSource, HttpMethod, RouteBody, OutputMode, } from '@astrale-os/kernel-api/routed';
|
|
11
14
|
export type { RemoteIdentityConfig, AuthenticateResult } from './auth';
|
|
12
|
-
export {
|
|
15
|
+
export type { DomainIssuer, MintIssuedParams } from './auth';
|
|
16
|
+
export { authenticateRequest, bindSelfKernel, buildComposedGrant, makeSelfKernel, signCredential, } from './auth';
|
|
13
17
|
export { AuthMissingError, AuthInvalidError } from './auth';
|
|
14
18
|
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth';
|
|
15
19
|
export type { AuthContext, Attestation, Authenticated, Delegation, IdentityId, IssuerId, } from '@astrale-os/kernel-core';
|
|
16
20
|
export { selfGrant } from '@astrale-os/kernel-core';
|
|
17
21
|
export { SdkDispatcher, type SdkDispatcherConfig } from './dispatch';
|
|
18
22
|
export { AuthorizationDeniedError, MethodNotFoundError, SdkValidationError, SdkResultValidationError, } from './dispatch';
|
|
19
|
-
export type { SelfResult, CallRemoteFn, KernelCaller } from './dispatch';
|
|
23
|
+
export type { SelfResult, TypedSelf, CallRemoteFn, KernelCaller } from './dispatch';
|
|
20
24
|
//# 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,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,MAAM,EACN,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,oBAAoB,E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ACd,kBAAkB,EAClB,cAAc,EACd,cAAc,GACf,MAAM,QAAQ,CAAA;AACf,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,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,14 @@ export { remoteMethod, remoteClassMethods, remoteInterfaceMethods } from './meth
|
|
|
7
7
|
export { defineDomain, deploy, defineAdapter } from './config';
|
|
8
8
|
// ─── Install graph (advanced) ────────────────────────────────────────────
|
|
9
9
|
export { buildInstallGraph, buildInstallGraphHash } from './domain';
|
|
10
|
+
// ─── Graph patching (advanced) ────────────────────────────────────────
|
|
11
|
+
// Author-facing patch types, re-exported from kernel-core (the single source).
|
|
12
|
+
// Build a `Patch` and feed it straight to `ctx.kernel.mutate(patch)` (it implements
|
|
13
|
+
// `PatchData`); the graph sugar itself lives in `@astrale-os/kernel-client/graph`,
|
|
14
|
+
// flattened onto `ctx.kernel`, and `function.mutate` validates every patch kernel-side
|
|
15
|
+
// against kernel-core's `patchDataSchema` — no client-side re-validation needed.
|
|
16
|
+
export { AbsolutePath, Patch, Path } from '@astrale-os/kernel-core';
|
|
17
|
+
export { ClassPath } from '@astrale-os/kernel-core/domain';
|
|
10
18
|
// ─── Declarative resource helpers ────────────────────────────────────────
|
|
11
19
|
// Author Views (iframe-mountable) and RemoteFunctions (standalone callables)
|
|
12
20
|
// at the domain definition site. Each `defineView` / `defineRemoteFunction`
|
|
@@ -23,12 +31,12 @@ export { defineView, defineRemoteFunction } from './define';
|
|
|
23
31
|
// chunk — which fails on Node built-ins. Consumers that need the server
|
|
24
32
|
// runtime import from '@astrale-os/sdk/server' directly.
|
|
25
33
|
// ─── Deploy ──────────────────────────────────────────────────────────────
|
|
26
|
-
// `deployCheck`
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
34
|
+
// `deployCheck` uses Node-only modules (`node:path`, `node:child_process`) at
|
|
35
|
+
// module load time. Exporting it from the barrel poisons browser bundlers
|
|
36
|
+
// (Vite/esbuild) that transitively load every re-export. Consumers that need it
|
|
37
|
+
// import from './deploy' directly.
|
|
30
38
|
export { MetaSchema } from './deploy/meta';
|
|
31
|
-
export { authenticateRequest, buildComposedGrant, signCredential } from './auth';
|
|
39
|
+
export { authenticateRequest, bindSelfKernel, buildComposedGrant, makeSelfKernel, signCredential, } from './auth';
|
|
32
40
|
export { AuthMissingError, AuthInvalidError } from './auth';
|
|
33
41
|
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth';
|
|
34
42
|
export { selfGrant } from '@astrale-os/kernel-core';
|
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":"AAeA,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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B,GACzB,MAAM,YAAY,CAAA"}
|
package/dist/method/class.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { DefForInterface, InterfaceMethodDefs, InterfaceMethodKeys, MethodClassKeys, NonSealedMethodKeys, OwnMethodKeys, ResolveParams, ResolveReturn, SealedKeys } from '@astrale-os/kernel-core/domain';
|
|
15
15
|
import type { ImplementableOwnKeys, Schema } from '@astrale-os/kernel-dsl';
|
|
16
|
-
import type {
|
|
16
|
+
import type { TypedSelf } from '../dispatch/self';
|
|
17
17
|
import type { MethodImpl, RemoteHandler } from './single';
|
|
18
18
|
/** Per-class method implementations for a remote domain. */
|
|
19
19
|
export type ClassMethodsImpl<S extends Schema, K extends MethodClassKeys<S> & string, TDeps = unknown> = {
|
|
@@ -28,7 +28,7 @@ type InterfaceMethodHandler<S extends Schema, K extends string, M extends string
|
|
|
28
28
|
readonly config: infer MC;
|
|
29
29
|
} ? MC extends {
|
|
30
30
|
readonly static: true;
|
|
31
|
-
} ? RemoteHandler<ResolveParams<MC>, ResolveReturn<MC>, undefined, TDeps> : RemoteHandler<ResolveParams<MC>, ResolveReturn<MC>,
|
|
31
|
+
} ? RemoteHandler<ResolveParams<MC>, ResolveReturn<MC>, undefined, TDeps> : RemoteHandler<ResolveParams<MC>, ResolveReturn<MC>, TypedSelf<DefForInterface<S, K>, S>, TDeps> : never : never;
|
|
32
32
|
/** Per-interface method implementations. */
|
|
33
33
|
export type InterfaceMethodsImpl<S extends Schema, K extends InterfaceMethodKeys<S> & string, TDeps = unknown> = {
|
|
34
34
|
[M in ImplementableOwnKeys<DefForInterface<S, K>> & string]: InterfaceMethodHandler<S, K, M, TDeps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../src/method/class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,mBAAmB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AE,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;AAsGH,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
|
@@ -10,7 +10,9 @@ import type { AuthPolicy } from '@astrale-os/kernel-api/routed';
|
|
|
10
10
|
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
|
+
import type { DomainIssuer } from '../auth/issuer-mint';
|
|
13
14
|
import type { CallRemoteFn } from '../dispatch/call-remote';
|
|
15
|
+
export type { GraphApi } from '@astrale-os/kernel-client/graph';
|
|
14
16
|
/**
|
|
15
17
|
* The kernel session a handler holds: a credential-bound view over the parent
|
|
16
18
|
* kernel — the FULL dispatch surface (`call`/`stream`/`binary`/`signal`,
|
|
@@ -60,11 +62,24 @@ export type RemoteContext<TParams, TSelf, TDeps, TKernel = Kernel | null, TAuth
|
|
|
60
62
|
* credential `union(delegation, self)`. Its nullability is `{@link
|
|
61
63
|
* KernelForAuth}` of the method's `auth`: non-null for the default
|
|
62
64
|
* `'required'`, `… | null` for `'optional'`, `null` for `'public'`. Use for
|
|
63
|
-
* kernel syscalls + same-domain methods
|
|
64
|
-
*
|
|
65
|
-
*
|
|
65
|
+
* kernel syscalls + same-domain methods, and for the typed graph read/write
|
|
66
|
+
* sugar flattened onto it (`kernel.get` / `kernel.children` / `kernel.query`,
|
|
67
|
+
* plus `kernel.createNode` / `kernel.updateNode` /
|
|
68
|
+
* `kernel.deleteNode` / `kernel.createEdge` / `kernel.updateEdge` /
|
|
69
|
+
* `kernel.deleteEdge` / `kernel.mutate(patch)`) over the `function.get` /
|
|
70
|
+
* `function.mutate` syscalls. For ANOTHER worker's remote method use
|
|
71
|
+
* {@link RemoteContext.callRemote} — `kernel.call` to a remote method fails the
|
|
72
|
+
* audience check.
|
|
66
73
|
*/
|
|
67
74
|
kernel: TKernel;
|
|
75
|
+
/**
|
|
76
|
+
* Mint seam for identities THIS DOMAIN issues (`iss` = this worker): sign a
|
|
77
|
+
* credential for a domain-owned principal (an App identity, a role umbrella,
|
|
78
|
+
* a managed user) and optionally open a kernel session AS it. See
|
|
79
|
+
* {@link DomainIssuer}. The kernel enforces trust/frozen/grant rules — this
|
|
80
|
+
* only signs under the worker's own issuer.
|
|
81
|
+
*/
|
|
82
|
+
issuer: DomainIssuer;
|
|
68
83
|
/**
|
|
69
84
|
* Call another worker's remote method (a Function with `binding.remoteUrl`),
|
|
70
85
|
* 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,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;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,UAAU,IAAI,KAAK,SAAS,QAAQ,GACxE,IAAI,GACJ,KAAK,SAAS,UAAU,GACtB,WAAW,GAAG,IAAI,GAClB,WAAW,CAAA;AAEjB,MAAM,MAAM,aAAa,CACvB,OAAO,EACP,KAAK,EACL,KAAK,EACL,OAAO,GAAG,MAAM,GAAG,IAAI,EACvB,KAAK,SAAS,UAAU,GAAG,UAAU,IACnC;IACF,yEAAyE;IACzE,MAAM,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;IAC1B,4DAA4D;IAC5D,IAAI,EAAE,KAAK,CAAA;IACX,6DAA6D;IAC7D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AC1B,4DAA4D;IAC5D,IAAI,EAAE,KAAK,CAAA;IACX,6DAA6D;IAC7D,IAAI,EAAE,KAAK,CAAA;IACX,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,OAAO,CAAA;IACf;;;;;;OAMG;IACH,MAAM,EAAE,YAAY,CAAA;IACpB;;;;;;;OAOG;IACH,UAAU,EAAE,YAAY,CAAA;CACzB,CAAA"}
|
package/dist/method/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { AuthForPolicy, Kernel, KernelForAuth, RemoteContext } from './context';
|
|
2
|
-
export type { RemoteHandler, AnyRemoteHandler, MethodImpl } from './single';
|
|
1
|
+
export type { AuthForPolicy, GraphApi, Kernel, KernelForAuth, RemoteContext } from './context';
|
|
2
|
+
export type { RemoteHandler, AnyRemoteHandler, MethodImpl, MethodParams, MethodResult, } from './single';
|
|
3
3
|
export { remoteMethod } from './single';
|
|
4
4
|
export type { ClassMethodsImpl, InterfaceMethodsImpl, SchemaMethodsImpl } from './class';
|
|
5
5
|
export { remoteClassMethods, remoteInterfaceMethods } 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,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/method/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC9F,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,UAAU,CAAA;AACjB,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/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/method/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/method/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/method/single.d.ts
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authoring a single remote method.
|
|
3
|
-
*
|
|
4
|
-
* `RemoteHandler` is the typed shape an author writes for ONE method:
|
|
5
|
-
* an `execute` body plus optional REST `route` (using the kernel's
|
|
6
|
-
* canonical `RouteBinding`) and optional anchor `remoteUrl`.
|
|
7
|
-
*
|
|
8
|
-
* `MethodImpl` resolves params/result/self from a schema for a given
|
|
9
|
-
* `(class, method)` pair. `remoteMethod` is the identity helper an author
|
|
10
|
-
* calls per method to get full inference without writing generics by hand.
|
|
11
|
-
*/
|
|
1
|
+
/** Authoring helpers for one schema-bound remote method. */
|
|
12
2
|
import type { AuthPolicy, RouteBinding } from '@astrale-os/kernel-api/routed';
|
|
13
3
|
import type { MethodClassKeys, ClassMethodConfig, NonSealedMethodKeys, OwnMethodKeys } from '@astrale-os/kernel-core/domain';
|
|
14
4
|
import type { Schema } from '@astrale-os/kernel-dsl';
|
|
15
|
-
import type {
|
|
5
|
+
import type { TypedSelf } from '../dispatch/self';
|
|
16
6
|
import type { KernelForAuth, RemoteContext } from './context';
|
|
17
7
|
/**
|
|
18
|
-
* Remote
|
|
19
|
-
*
|
|
20
|
-
* `execute` is **optional** at the type level: a handler may be a pure
|
|
21
|
-
* binding stub (only `remoteUrl` / `route` set) when authored as a spec-side
|
|
22
|
-
* declaration that never runs locally — the kernel resolver short-circuits
|
|
23
|
-
* via `binding.remoteUrl` before reaching the handler body. The worker-side
|
|
24
|
-
* declaration that actually serves the call MUST provide `execute`.
|
|
25
|
-
*
|
|
26
|
-
* Runtime guard: if dispatch routes to a handler that has no `execute`, the
|
|
27
|
-
* dispatcher throws — that's a programmer error indicating a stub leaked into
|
|
28
|
-
* a code path that was supposed to execute it.
|
|
8
|
+
* Remote method handler. `execute` is optional only for binding stubs; any
|
|
9
|
+
* handler that the dispatcher actually reaches must provide it.
|
|
29
10
|
*/
|
|
30
11
|
export type RemoteHandler<TParams, TResult, TSelf, TDeps, TAuth extends AuthPolicy = 'required'> = {
|
|
31
12
|
/** The handler body. May be async or an async generator (for `output: 'stream'`). */
|
|
@@ -52,22 +33,22 @@ export type RemoteHandler<TParams, TResult, TSelf, TDeps, TAuth extends AuthPoli
|
|
|
52
33
|
*/
|
|
53
34
|
auth?: TAuth;
|
|
54
35
|
/**
|
|
55
|
-
* Optional
|
|
56
|
-
*
|
|
57
|
-
* the SDK wraps it as `AuthorizationDeniedError` (mapped to wire-level
|
|
58
|
-
* `PERMISSION_DENIED`).
|
|
59
|
-
*
|
|
60
|
-
* Use for fine-grained checks the kernel's bit-level perms can't express
|
|
61
|
-
* (e.g. "only the project lead can addMember"). For straight bit-level
|
|
62
|
-
* checks, prefer the helpers in `@astrale-os/sdk` (`assertPerm`,
|
|
63
|
-
* `requireOwnership`).
|
|
64
|
-
*
|
|
65
|
-
* The kernel still enforces `has_perm` independently — `authorize` is
|
|
66
|
-
* additive ergonomic gating on top, not a replacement.
|
|
36
|
+
* Optional business authorization after auth/_self resolution. Kernel
|
|
37
|
+
* has_perm checks remain authoritative; this is additive gating.
|
|
67
38
|
*/
|
|
68
39
|
authorize?: (ctx: RemoteContext<TParams, TSelf, TDeps, KernelForAuth<TAuth>, TAuth>) => void | Promise<void>;
|
|
69
40
|
};
|
|
70
|
-
export type AnyRemoteHandler = RemoteHandler<any, any, any, any, AuthPolicy
|
|
41
|
+
export type AnyRemoteHandler = Omit<RemoteHandler<any, any, any, any, AuthPolicy>, 'authorize' | 'execute'> & {
|
|
42
|
+
execute?: (ctx: any) => any;
|
|
43
|
+
authorize?: (ctx: any) => void | Promise<void>;
|
|
44
|
+
};
|
|
45
|
+
type _AssertTrueH<T extends true> = T;
|
|
46
|
+
type _HandlerFitsBag<D> = D extends AnyRemoteHandler ? true : false;
|
|
47
|
+
export type _MethodPolicyBagGuards = [
|
|
48
|
+
_AssertTrueH<_HandlerFitsBag<RemoteHandler<unknown, unknown, unknown, unknown, 'public'>>>,
|
|
49
|
+
_AssertTrueH<_HandlerFitsBag<RemoteHandler<unknown, unknown, unknown, unknown, 'optional'>>>,
|
|
50
|
+
_AssertTrueH<_HandlerFitsBag<RemoteHandler<unknown, unknown, unknown, unknown, 'required'>>>
|
|
51
|
+
];
|
|
71
52
|
/**
|
|
72
53
|
* Fully typed method implementation — resolves params/result/self from the
|
|
73
54
|
* schema, wraps in `RemoteHandler` with deps.
|
|
@@ -77,7 +58,14 @@ export type MethodImpl<S extends Schema, K extends MethodClassKeys<S> & string,
|
|
|
77
58
|
result: infer R;
|
|
78
59
|
self: unknown;
|
|
79
60
|
isStatic: infer St;
|
|
80
|
-
} ? RemoteHandler<P, R, St extends true ? undefined :
|
|
61
|
+
} ? RemoteHandler<P, R, St extends true ? undefined : TypedSelf<S['classes'][K], S>, TDeps, TAuth> : never;
|
|
62
|
+
/**
|
|
63
|
+
* `MethodParams` / `MethodResult` — a handler types its `params` as
|
|
64
|
+
* `MethodParams<typeof schema, 'Def', 'method'>` and its return as
|
|
65
|
+
* `MethodResult<…>`, so it never re-declares (and can't drift from) the schema.
|
|
66
|
+
* Resolved from whichever def — CLASS or INTERFACE — declares the method.
|
|
67
|
+
*/
|
|
68
|
+
export type { MethodParams, MethodResult } from '@astrale-os/kernel-core/domain';
|
|
81
69
|
type ImplementableMethodName<S extends Schema, K extends MethodClassKeys<S> & string> = (OwnMethodKeys<S, K> | NonSealedMethodKeys<S, K>) & string;
|
|
82
70
|
/**
|
|
83
71
|
* Identity helper for authoring one remote method with full schema-driven typing.
|
|
@@ -90,5 +78,4 @@ type ImplementableMethodName<S extends Schema, K extends MethodClassKeys<S> & st
|
|
|
90
78
|
*/
|
|
91
79
|
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>;
|
|
92
80
|
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>;
|
|
93
|
-
export {};
|
|
94
81
|
//# sourceMappingURL=single.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"single.d.ts","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAE5D,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,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAE7D;;;GAGG;AACH,MAAM,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AC,CAAC,CAC5B,GACC,MAAM,CAAA;AAER;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,KAAK,CACrC,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,KAAK,EAAE,KAAK,CAAC,KACpC,UAAU,CAAC,CAAC,EAAE,CAAC,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"}
|
package/dist/method/single.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authoring a single remote method.
|
|
3
|
-
*
|
|
4
|
-
* `RemoteHandler` is the typed shape an author writes for ONE method:
|
|
5
|
-
* an `execute` body plus optional REST `route` (using the kernel's
|
|
6
|
-
* canonical `RouteBinding`) and optional anchor `remoteUrl`.
|
|
7
|
-
*
|
|
8
|
-
* `MethodImpl` resolves params/result/self from a schema for a given
|
|
9
|
-
* `(class, method)` pair. `remoteMethod` is the identity helper an author
|
|
10
|
-
* calls per method to get full inference without writing generics by hand.
|
|
11
|
-
*/
|
|
1
|
+
/** Authoring helpers for one schema-bound remote method. */
|
|
12
2
|
export function remoteMethod(...args) {
|
|
13
3
|
if (args.length === 0) {
|
|
14
4
|
return (...innerArgs) => innerArgs[3];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single.js","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"single.js","sourceRoot":"","sources":["../../src/method/single.ts"],"names":[],"mappings":"AAAA,4DAA4D;AA2I5D,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auxiliary-routes.d.ts","sourceRoot":"","sources":["../../src/server/auxiliary-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,MAAM,CAAA;AAQzC,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAG7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"auxiliary-routes.d.ts","sourceRoot":"","sources":["../../src/server/auxiliary-routes.ts"],"names":[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