@astrale-os/sdk 0.1.10 → 0.2.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/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/cli/run.d.ts +0 -1
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +17 -10
- package/dist/cli/run.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 +13 -29
- package/dist/config/define-domain.d.ts.map +1 -1
- package/dist/config/define-domain.js +22 -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 +9 -14
- package/dist/define/remote-function.d.ts.map +1 -1
- package/dist/define/remote-function.js +9 -8
- 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/dispatch/identity.d.ts +10 -9
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/identity.js +9 -15
- package/dist/dispatch/identity.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 +10 -7
- package/dist/domain/build-spec.js.map +1 -1
- package/dist/domain/define.d.ts +27 -27
- package/dist/domain/define.d.ts.map +1 -1
- package/dist/domain/define.js +31 -49
- package/dist/domain/define.js.map +1 -1
- package/dist/domain/extend-functions.d.ts +44 -0
- package/dist/domain/extend-functions.d.ts.map +1 -0
- package/dist/domain/extend-functions.js +69 -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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/server/auxiliary-routes.js +1 -1
- package/dist/server/auxiliary-routes.js.map +1 -1
- package/dist/server/worker-entry.d.ts +3 -3
- package/dist/server/worker-entry.js +3 -3
- package/package.json +2 -5
- package/src/auth/index.ts +1 -1
- package/src/cli/run.ts +17 -12
- package/src/config/adapter.ts +9 -11
- package/src/config/define-domain.ts +34 -56
- package/src/config/deploy.ts +1 -1
- package/src/config/index.ts +1 -1
- package/src/define/remote-function.ts +9 -14
- package/src/define/view.ts +8 -6
- package/src/dispatch/identity.ts +15 -21
- package/src/domain/binding.ts +37 -0
- package/src/domain/build-spec.ts +18 -7
- package/src/domain/define.ts +67 -62
- package/src/domain/extend-functions.ts +86 -0
- package/src/domain/extend-views.ts +151 -0
- package/src/index.ts +7 -2
- package/src/server/auxiliary-routes.ts +1 -1
- package/src/server/worker-entry.ts +3 -3
- package/src/domain/extend-core.ts +0 -301
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
* - `FunctionDeclarations` — the CONTRACT half, fed to `compileDomain`'s 4th
|
|
7
|
+
* arg. The member ref (`function.<slug>`), the layout
|
|
8
|
+
* (`/<origin>/functions/<slug>`), and the `of_domain` edge slug all derive
|
|
9
|
+
* from the map key; the kernel owns that mapping.
|
|
10
|
+
* - `FunctionSchema[]` + per-slug `FunctionBinding` — the IMPL/BINDING half,
|
|
11
|
+
* fed to `serialize` (url-stamped). The worker route is
|
|
12
|
+
* `<url>/<functionsFolder>/<slug>`, DECOUPLED from the graph layout — so
|
|
13
|
+
* `functionsFolder` only names the URL segment, not the node position.
|
|
14
|
+
*
|
|
15
|
+
* A standalone function is NOT a core/instance node: it is attached directly to
|
|
16
|
+
* the Domain via `of_domain` by the kernel-core serializer, so this module never
|
|
17
|
+
* touches `Core`.
|
|
18
|
+
*/
|
|
19
|
+
import { zodToJsonSchema } from '@astrale-os/kernel-core/domain';
|
|
20
|
+
import { resolveBinding } from './binding';
|
|
21
|
+
/**
|
|
22
|
+
* Default URL segment for a function's worker route (`<url>/functions/<slug>`).
|
|
23
|
+
* Names the HTTP route only — the graph layout (`/<origin>/functions/<slug>`) is
|
|
24
|
+
* a fixed kernel convention, independent of this.
|
|
25
|
+
*/
|
|
26
|
+
export const DEFAULT_FUNCTIONS_FOLDER = 'functions';
|
|
27
|
+
const SLUG_RE = /^[a-z][a-z0-9-]*$/;
|
|
28
|
+
function assertValidSlugs(functions) {
|
|
29
|
+
for (const slug of Object.keys(functions)) {
|
|
30
|
+
if (!SLUG_RE.test(slug)) {
|
|
31
|
+
throw new Error(`defineRemoteDomain: invalid function slug "${slug}" — must match ${SLUG_RE}.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Contract half — one declaration per `functions` map key, for `compileDomain`'s
|
|
37
|
+
* `functions` arg. The slug drives ref/path/of_domain; impl/binding arrive at
|
|
38
|
+
* serialize.
|
|
39
|
+
*/
|
|
40
|
+
export function buildFunctionDeclarations(functions) {
|
|
41
|
+
assertValidSlugs(functions);
|
|
42
|
+
const out = {};
|
|
43
|
+
for (const slug of Object.keys(functions))
|
|
44
|
+
out[slug] = { slug };
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Impl/binding half — `FunctionSchema[]` for `serialize` plus the per-slug
|
|
49
|
+
* `FunctionBinding` map the worker mounts routes from. `ref` is the canonical
|
|
50
|
+
* `function.<slug>` member ref (matching `compiled.$.refs.functions`), so the
|
|
51
|
+
* serializer's per-member impl lookup finds it.
|
|
52
|
+
*/
|
|
53
|
+
export function buildFunctionSchemas(functions, url, functionsFolder) {
|
|
54
|
+
const schemas = [];
|
|
55
|
+
const bindings = {};
|
|
56
|
+
for (const [slug, def] of Object.entries(functions)) {
|
|
57
|
+
const binding = resolveBinding(def.binding, url, functionsFolder, slug);
|
|
58
|
+
bindings[slug] = binding;
|
|
59
|
+
schemas.push({
|
|
60
|
+
ref: `function.${slug}`,
|
|
61
|
+
inputSchema: zodToJsonSchema(def.inputSchema),
|
|
62
|
+
outputSchema: zodToJsonSchema(def.outputSchema),
|
|
63
|
+
output: 'value',
|
|
64
|
+
binding,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return { schemas, bindings };
|
|
68
|
+
}
|
|
69
|
+
//# 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;;;;;;;;;;;;;;;;;GAiBG;AAKH,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;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,SAA+C;IAE/C,gBAAgB,CAAC,SAAS,CAAC,CAAA;IAC3B,MAAM,GAAG,GAAqC,EAAE,CAAA;IAChD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,CAAA;IAC/D,OAAO,GAAG,CAAA;AACZ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,SAA+C,EAC/C,GAAW,EACX,eAAuB;IAEvB,MAAM,OAAO,GAAqB,EAAE,CAAA;IACpC,MAAM,QAAQ,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;AAC5D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACpF,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,YAAY,GAEb,MAAM,wBAAwB,CAAA;AAI/B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAC3C,MAAM,OAAO,GAAG,mBAAmB,CAAA;AAKnC,SAAS,gBAAgB,CAAC,KAAiC;IACzD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,kBAAkB,OAAO,GAAG,CAAC,CAAA;QAC7F,CAAC;IACH,CAAC;AACH,CAAC;AAED,gGAAgG;AAChG,SAAS,iBAAiB,CAAC,IAAY,EAAE,GAAe;IACtD,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC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AM,CAAA;YACnD,MAAM,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;YACjC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAA;QAChF,CAAC;QACD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACvB,OAAO,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAA;QAC3D,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type { AuthForPolicy, 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, DeployConfig, AdapterSpec, DeployCtx, DeployResult, DomainAdapter, DomainInfo, WatchCtx, WatchHandle, } from './config';
|
|
5
5
|
export { buildInstallGraph, buildInstallGraphHash } from './domain';
|
|
6
6
|
export { defineView, defineRemoteFunction } from './define';
|
|
7
7
|
export type { ViewDef, ViewRenderContext, RemoteFunctionDef, RemoteFunctionContext } from './define';
|
|
@@ -9,7 +9,7 @@ export { MetaSchema } from './deploy/meta';
|
|
|
9
9
|
export type { Meta } from './deploy/meta';
|
|
10
10
|
export type { AuthPolicy, RouteBinding, FunctionBinding, CredentialSource, SingleCredentialSource, HttpMethod, RouteBody, OutputMode, } from '@astrale-os/kernel-api/routed';
|
|
11
11
|
export type { RemoteIdentityConfig, AuthenticateResult } from './auth';
|
|
12
|
-
export { authenticateRequest, buildComposedGrant, signCredential } from './auth';
|
|
12
|
+
export { authenticateRequest, bindSelfKernel, buildComposedGrant, makeSelfKernel, signCredential, } from './auth';
|
|
13
13
|
export { AuthMissingError, AuthInvalidError } from './auth';
|
|
14
14
|
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth';
|
|
15
15
|
export type { AuthContext, Attestation, Authenticated, Delegation, IdentityId, IssuerId, } from '@astrale-os/kernel-core';
|
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,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,kBAAkB,EAClB,gBAAgB,EAChB,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AA;AACnB,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ export { defineView, defineRemoteFunction } from './define';
|
|
|
28
28
|
// the barrel poisons browser bundlers (Vite/esbuild) that transitively load
|
|
29
29
|
// every re-export. Consumers that need them import from './deploy' directly.
|
|
30
30
|
export { MetaSchema } from './deploy/meta';
|
|
31
|
-
export { authenticateRequest, buildComposedGrant, signCredential } from './auth';
|
|
31
|
+
export { authenticateRequest, bindSelfKernel, buildComposedGrant, makeSelfKernel, signCredential, } from './auth';
|
|
32
32
|
export { AuthMissingError, AuthInvalidError } from './auth';
|
|
33
33
|
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './auth';
|
|
34
34
|
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":"AAYA,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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,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;AAc9D,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;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAiB1C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,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;AASlF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,4EAA4E;AAC5E,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAA;AACpE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,YAAY,CAAA"}
|
|
@@ -82,7 +82,7 @@ export function mountAuxiliaryRoutes(config) {
|
|
|
82
82
|
const result = await def.execute(ctx);
|
|
83
83
|
const outValidation = validateResult(def.outputSchema, result);
|
|
84
84
|
if (!outValidation.ok) {
|
|
85
|
-
throw new SdkResultValidationError(outValidation.issues,
|
|
85
|
+
throw new SdkResultValidationError(outValidation.issues, `function.${slug}`);
|
|
86
86
|
}
|
|
87
87
|
return c.json({ result: outValidation.data });
|
|
88
88
|
},
|
|
@@ -1 +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AAQ,CAAC,CAAS,EAAE,CAAS;IACpC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAA;IAChB,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAA;IAChB,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACjD,MAAM,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAA;IAC7C,OAAO,GAAG,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAA;AACjC,CAAC;AAED,oEAAoE;AACpE,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI;SACR,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC;SAClC,OAAO,CAAC,cAAc,EAAE,SAAS,CAAC;SAClC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;AACjC,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAA;AAChD,CAAC"}
|
|
@@ -127,9 +127,9 @@ export interface WorkerEntry<TDeps> {
|
|
|
127
127
|
export declare function clientOrigin(url: URL, request: Request): string;
|
|
128
128
|
/**
|
|
129
129
|
* Build a `before` hook that serves a static-asset `binding` (e.g. a Workers
|
|
130
|
-
* Assets binding) mounted under `base` (default `/ui`) — the runtime half of
|
|
131
|
-
*
|
|
132
|
-
* when no binding is present) so the request falls through to domain dispatch.
|
|
130
|
+
* Assets binding) mounted under `base` (default `/ui`) — the runtime half of an
|
|
131
|
+
* adapter env's client-asset config. Returns `undefined` for non-matching paths
|
|
132
|
+
* (and when no binding is present) so the request falls through to domain dispatch.
|
|
133
133
|
*
|
|
134
134
|
* Asset URLs are rooted at `base` (a client bundler sets `base: '<base>/'`);
|
|
135
135
|
* this hook strips that prefix before delegating to the binding, so
|
|
@@ -82,9 +82,9 @@ export function clientOrigin(url, request) {
|
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Build a `before` hook that serves a static-asset `binding` (e.g. a Workers
|
|
85
|
-
* Assets binding) mounted under `base` (default `/ui`) — the runtime half of
|
|
86
|
-
*
|
|
87
|
-
* when no binding is present) so the request falls through to domain dispatch.
|
|
85
|
+
* Assets binding) mounted under `base` (default `/ui`) — the runtime half of an
|
|
86
|
+
* adapter env's client-asset config. Returns `undefined` for non-matching paths
|
|
87
|
+
* (and when no binding is present) so the request falls through to domain dispatch.
|
|
88
88
|
*
|
|
89
89
|
* Asset URLs are rooted at `base` (a client bundler sets `base: '<base>/'`);
|
|
90
90
|
* this hook strips that prefix before delegating to the binding, so
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Astrale Remote Domain SDK - Define and deploy domains as standalone Hono servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -47,13 +47,10 @@
|
|
|
47
47
|
"import": "./dist/deploy/index.js"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
"publishConfig": {
|
|
51
|
-
"registry": "https://npm.pkg.github.com"
|
|
52
|
-
},
|
|
53
50
|
"dependencies": {
|
|
54
51
|
"@astrale-os/kernel-api": ">=0.4.5 <1.0.0",
|
|
55
52
|
"@astrale-os/kernel-client": ">=0.2.2 <1.0.0",
|
|
56
|
-
"@astrale-os/kernel-core": ">=0.
|
|
53
|
+
"@astrale-os/kernel-core": ">=0.5.0 <1.0.0",
|
|
57
54
|
"@astrale-os/kernel-dsl": ">=0.1.2 <1.0.0",
|
|
58
55
|
"@astrale-os/kernel-server": ">=0.4.0 <1.0.0",
|
|
59
56
|
"hono": "^4.6.20",
|
package/src/auth/index.ts
CHANGED
|
@@ -6,6 +6,6 @@ export { resolveInboundAuth, buildAuthContext, type ResolvedAuth } from './resol
|
|
|
6
6
|
export { verifyInboundCredential } from './verify'
|
|
7
7
|
export { buildComposedGrant } from './compose'
|
|
8
8
|
export { signCredential } from './sign'
|
|
9
|
-
export { bindKernel } from './kernel-client'
|
|
9
|
+
export { bindKernel, bindSelfKernel, makeSelfKernel } from './kernel-client'
|
|
10
10
|
export { AuthMissingError, AuthInvalidError } from './errors'
|
|
11
11
|
export { assertPerm, requireOwnership, READ, EDIT, USE, SHARE, ALL } from './check'
|
package/src/cli/run.ts
CHANGED
|
@@ -172,9 +172,6 @@ export async function run(argv: readonly string[]): Promise<number> {
|
|
|
172
172
|
|
|
173
173
|
const domain = toDomainInfo(def)
|
|
174
174
|
|
|
175
|
-
// The client SPA is a DECLARED binding (`defineDomain({ client })`), not a
|
|
176
|
-
// folder we sniff for: its presence + source dir come from the definition.
|
|
177
|
-
const clientDir = def.client ? join(projectDir, def.client.dir) : undefined
|
|
178
175
|
const secrets = loadSecrets(adapter, params, projectDir)
|
|
179
176
|
|
|
180
177
|
if (parsed.command === 'dev' || (parsed.command === 'deploy' && parsed.watch)) {
|
|
@@ -184,7 +181,6 @@ export async function run(argv: readonly string[]): Promise<number> {
|
|
|
184
181
|
paramOverrides,
|
|
185
182
|
projectDir,
|
|
186
183
|
specPath,
|
|
187
|
-
clientDir,
|
|
188
184
|
secrets,
|
|
189
185
|
domain,
|
|
190
186
|
env: parsed.env,
|
|
@@ -198,7 +194,6 @@ export async function run(argv: readonly string[]): Promise<number> {
|
|
|
198
194
|
projectDir,
|
|
199
195
|
specPath,
|
|
200
196
|
secrets,
|
|
201
|
-
...(clientDir ? { clientDir } : {}),
|
|
202
197
|
domain,
|
|
203
198
|
env: parsed.env,
|
|
204
199
|
schemaHashForUrl: async (url) => {
|
|
@@ -294,14 +289,13 @@ async function runWatch(args: {
|
|
|
294
289
|
paramOverrides: Record<string, unknown>
|
|
295
290
|
projectDir: string
|
|
296
291
|
specPath: string
|
|
297
|
-
clientDir?: string
|
|
298
292
|
secrets: Record<string, string>
|
|
299
293
|
domain: DomainInfo
|
|
300
294
|
env: string
|
|
301
295
|
def: DeployConfig
|
|
302
296
|
configPath: string
|
|
303
297
|
}): Promise<number> {
|
|
304
|
-
const { adapter, params, projectDir, specPath,
|
|
298
|
+
const { adapter, params, projectDir, specPath, secrets, domain, env, def } = args
|
|
305
299
|
let reloads = 0
|
|
306
300
|
const onReload = () => {
|
|
307
301
|
reloads += 1
|
|
@@ -310,7 +304,6 @@ async function runWatch(args: {
|
|
|
310
304
|
const handle: WatchHandle = await adapter.watch(params, {
|
|
311
305
|
projectDir,
|
|
312
306
|
specPath,
|
|
313
|
-
...(clientDir ? { clientDir } : {}),
|
|
314
307
|
secrets,
|
|
315
308
|
domain,
|
|
316
309
|
env,
|
|
@@ -326,7 +319,6 @@ async function runWatch(args: {
|
|
|
326
319
|
paramOverrides: args.paramOverrides,
|
|
327
320
|
projectDir,
|
|
328
321
|
specPath,
|
|
329
|
-
...(clientDir ? { clientDir } : {}),
|
|
330
322
|
url: handle.url,
|
|
331
323
|
onReload,
|
|
332
324
|
})
|
|
@@ -368,7 +360,6 @@ export function watchConfigForRegen(args: {
|
|
|
368
360
|
paramOverrides: Record<string, unknown>
|
|
369
361
|
projectDir: string
|
|
370
362
|
specPath: string
|
|
371
|
-
clientDir?: string
|
|
372
363
|
url: string
|
|
373
364
|
onReload: () => void
|
|
374
365
|
}): () => void {
|
|
@@ -409,7 +400,6 @@ export function watchConfigForRegen(args: {
|
|
|
409
400
|
await adapter.regenerate(params, {
|
|
410
401
|
projectDir: args.projectDir,
|
|
411
402
|
specPath: args.specPath,
|
|
412
|
-
...(args.clientDir ? { clientDir: args.clientDir } : {}),
|
|
413
403
|
secrets: loadSecrets(adapter, params, args.projectDir),
|
|
414
404
|
domain,
|
|
415
405
|
env: args.env,
|
|
@@ -521,11 +511,26 @@ function toDomainInfo(def: DeployConfig): DomainInfo {
|
|
|
521
511
|
// Presence comes from the definition the author wired — never a folder probe.
|
|
522
512
|
hasViews: def.views !== undefined,
|
|
523
513
|
hasFunctions: def.functions !== undefined,
|
|
524
|
-
|
|
514
|
+
mountedViews: collectMountedViews(def.views),
|
|
525
515
|
hasDeps: def.deps !== undefined,
|
|
526
516
|
}
|
|
527
517
|
}
|
|
528
518
|
|
|
519
|
+
function collectMountedViews(views: DeployConfig['views']): DomainInfo['mountedViews'] {
|
|
520
|
+
if (!views) return []
|
|
521
|
+
const mounted: DomainInfo['mountedViews'] = []
|
|
522
|
+
for (const [slug, def] of Object.entries(views)) {
|
|
523
|
+
const mount = (def as { mount?: unknown }).mount
|
|
524
|
+
if (typeof mount !== 'string' || mount.length === 0) continue
|
|
525
|
+
mounted.push({ slug, mount: normalizeMount(mount) })
|
|
526
|
+
}
|
|
527
|
+
return mounted
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function normalizeMount(mount: string): string {
|
|
531
|
+
return `/${mount.replace(/^\/+/, '')}`
|
|
532
|
+
}
|
|
533
|
+
|
|
529
534
|
async function loadConfig(path: string, opts?: { fresh: boolean }): Promise<DeployConfig> {
|
|
530
535
|
// Re-importing an EDITED file: Bun's ESM registry is keyed by path and never
|
|
531
536
|
// re-reads the source — a `?reload=N` query re-EVALUATES but serves the
|
package/src/config/adapter.ts
CHANGED
|
@@ -32,17 +32,18 @@ export interface DomainInfo {
|
|
|
32
32
|
/** Optional Astrale Path called by the kernel after install (as __SYSTEM__). */
|
|
33
33
|
postInstall?: string
|
|
34
34
|
/**
|
|
35
|
-
* Whether the domain declares
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* only when true. `hasClient` governs the WORKER's `/ui` hook specifically
|
|
39
|
-
* (present whenever the domain has a client, even on managed deploys that ship
|
|
40
|
-
* the built assets separately and pass no `clientDir`); the wrangler
|
|
41
|
-
* `assets.directory` binding tracks `clientDir` instead.
|
|
35
|
+
* Whether the domain declares Views / standalone Functions — read from the
|
|
36
|
+
* `defineDomain` definition, NOT probed from the filesystem. The adapter
|
|
37
|
+
* codegen imports the corresponding module only when true.
|
|
42
38
|
*/
|
|
43
39
|
hasViews: boolean
|
|
44
40
|
hasFunctions: boolean
|
|
45
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Views whose binding is backed by a worker-relative SPA mount. This is domain
|
|
43
|
+
* contract metadata (`defineView({ mount })`), not a frontend source folder:
|
|
44
|
+
* adapters decide, per env, which client assets serve these mounts.
|
|
45
|
+
*/
|
|
46
|
+
mountedViews: Array<{ slug: string; mount: string }>
|
|
46
47
|
/**
|
|
47
48
|
* Whether the domain declares a `deps` mapper (`defineDomain({ deps })`).
|
|
48
49
|
* When true the adapter codegen imports it from the domain's fixed `deps`
|
|
@@ -58,8 +59,6 @@ export interface WatchCtx {
|
|
|
58
59
|
projectDir: string
|
|
59
60
|
/** Absolute path where the CLI writes the diagnostic `spec.json`. */
|
|
60
61
|
specPath: string
|
|
61
|
-
/** Absolute path to the client SPA dir, when the domain declares a `client`. */
|
|
62
|
-
clientDir?: string
|
|
63
62
|
/** Flat secret map loaded from the env's `secrets` file — injected locally in dev. */
|
|
64
63
|
secrets: Record<string, string>
|
|
65
64
|
/** Domain metadata for codegen. */
|
|
@@ -75,7 +74,6 @@ export interface DeployCtx {
|
|
|
75
74
|
specPath: string
|
|
76
75
|
/** Flat secret map loaded from the env's `secrets` file (gitignored). */
|
|
77
76
|
secrets: Record<string, string>
|
|
78
|
-
clientDir?: string
|
|
79
77
|
domain: DomainInfo
|
|
80
78
|
/** The env key being deployed (e.g. 'dev' | 'prod' | 'canary'). */
|
|
81
79
|
env: string
|