@astrale-os/sdk 0.6.0-beta.22 → 0.6.0-beta.24
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/README.md +30 -36
- package/dist/application/define.d.ts +3 -1
- package/dist/application/define.js +16 -2
- package/dist/application/domain.d.ts +3 -1
- package/dist/application/index.d.ts +1 -1
- package/dist/application/mutation/index.d.ts +1 -1
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- package/dist/application/view/define.js +4 -6
- package/dist/application/view/frontend.d.ts +2 -2
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +0 -14
- package/dist/application/view/route.js +1 -64
- package/dist/deployment/adapter/adapter.d.ts +11 -24
- package/dist/deployment/adapter/bundle/file.d.ts +1 -1
- package/dist/deployment/adapter/define.d.ts +4 -25
- package/dist/deployment/adapter/define.js +12 -44
- package/dist/deployment/adapter/index.d.ts +0 -2
- package/dist/deployment/adapter/release/context.d.ts +3 -4
- package/dist/deployment/adapter/release/list.d.ts +1 -2
- package/dist/deployment/address/configuration.d.ts +12 -0
- package/dist/deployment/address/configuration.js +11 -0
- package/dist/deployment/address/index.d.ts +2 -2
- package/dist/deployment/address/index.js +2 -2
- package/dist/deployment/address/label.d.ts +5 -5
- package/dist/deployment/address/label.js +5 -5
- package/dist/deployment/address/record.d.ts +21 -0
- package/dist/deployment/address/record.js +34 -0
- package/dist/deployment/address/summary.d.ts +3 -7
- package/dist/deployment/authoring.d.ts +0 -2
- package/dist/deployment/authoring.js +0 -1
- package/dist/deployment/build/build.d.ts +6 -0
- package/dist/deployment/build/compile.js +2 -0
- package/dist/deployment/build/frontend/compilation.d.ts +2 -4
- package/dist/deployment/build/frontend/compilation.js +0 -5
- package/dist/deployment/build/frontend/digest.js +1 -5
- package/dist/deployment/build/material.d.ts +2 -2
- package/dist/deployment/build/material.js +28 -13
- package/dist/deployment/deployment.d.ts +4 -8
- package/dist/deployment/index.d.ts +3 -5
- package/dist/deployment/index.js +1 -2
- package/dist/deployment/release/addressing.d.ts +2 -9
- package/dist/deployment/release/addressing.js +2 -3
- package/dist/deployment/release/index.d.ts +0 -2
- package/dist/deployment/release/index.js +0 -2
- package/dist/deployment/release/release.d.ts +1 -1
- package/dist/deployment/release/runtime.d.ts +0 -2
- package/dist/deployment/release/runtime.js +0 -2
- package/dist/deployment/release/served/index.d.ts +1 -2
- package/dist/deployment/release/served/index.js +7 -3
- package/dist/deployment/release/served/views.js +0 -1
- package/dist/deployment/verify/index.d.ts +2 -4
- package/dist/deployment/verify/index.js +1 -3
- package/dist/deployment/verify/preflight/index.d.ts +0 -12
- package/dist/deployment/verify/preflight/index.js +0 -12
- package/dist/deployment/verify/readiness/index.d.ts +9 -6
- package/dist/deployment/verify/readiness/index.js +20 -12
- package/dist/deployment/worker/address.d.ts +26 -0
- package/dist/deployment/worker/address.js +43 -0
- package/dist/deployment/worker/build.d.ts +60 -0
- package/dist/deployment/worker/build.js +172 -0
- package/dist/deployment/worker/configuration.d.ts +73 -0
- package/dist/deployment/worker/configuration.js +165 -0
- package/dist/deployment/worker/content.d.ts +38 -0
- package/dist/deployment/worker/content.js +169 -0
- package/dist/deployment/worker/index.d.ts +29 -0
- package/dist/deployment/worker/index.js +29 -0
- package/dist/deployment/worker/limits.d.ts +30 -0
- package/dist/deployment/worker/limits.js +30 -0
- package/dist/deployment/worker/record.d.ts +29 -0
- package/dist/deployment/worker/record.js +69 -0
- package/dist/deployment/worker/request.d.ts +118 -0
- package/dist/deployment/worker/request.js +280 -0
- package/dist/deployment/worker/response.d.ts +101 -0
- package/dist/deployment/worker/response.js +207 -0
- package/dist/execution/identity/delivery.d.ts +2 -7
- package/dist/execution/identity/delivery.js +1 -23
- package/dist/execution/identity/identity.d.ts +2 -3
- package/dist/execution/index.d.ts +1 -3
- package/dist/execution/index.js +1 -2
- package/dist/execution/invocation/admission/authority.d.ts +4 -5
- package/dist/execution/invocation/admission/authority.js +1 -2
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/invocation.js +3 -12
- package/dist/execution/invocation/result/errors.d.ts +0 -10
- package/dist/execution/invocation/result/errors.js +0 -17
- package/dist/execution/invocation/result/index.d.ts +2 -2
- package/dist/execution/invocation/result/index.js +1 -1
- package/dist/execution/runtime/release.d.ts +6 -11
- package/dist/execution/runtime/release.js +2 -9
- package/dist/execution/service/create.js +3 -1
- package/dist/execution/service/service.d.ts +2 -3
- package/dist/execution/service/serving/delivery.d.ts +1 -2
- package/dist/execution/service/serving/delivery.js +1 -2
- package/dist/execution/service/serving/source.d.ts +3 -10
- package/dist/execution/service/serving/source.js +1 -5
- package/dist/execution/workflows/index.d.ts +1 -1
- package/dist/execution/workflows/index.js +1 -1
- package/dist/execution/workflows/options.d.ts +0 -6
- package/dist/execution/workflows/options.js +0 -18
- package/dist/execution/workflows/receiver.d.ts +1 -2
- package/dist/execution/workflows/receiver.js +13 -20
- package/dist/execution/workflows/route.d.ts +1 -3
- package/dist/execution/workflows/route.js +4 -9
- package/dist/execution/workflows/run.d.ts +1 -1
- package/dist/execution/workflows/run.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/platform/graph/alias.d.ts +1 -5
- package/dist/platform/graph/alias.js +1 -5
- package/dist/platform/graph/document/index.d.ts +1 -1
- package/dist/platform/graph/document/index.js +1 -1
- package/dist/platform/graph/index.d.ts +1 -1
- package/dist/platform/graph/index.js +1 -1
- package/dist/platform/release/index.d.ts +1 -26
- package/dist/platform/release/index.js +1 -26
- package/dist/platform/schema/class-icon-svg.d.ts +9 -0
- package/dist/platform/schema/class-icon-svg.js +29 -0
- package/dist/platform/schema/class-icon.d.ts +3 -8
- package/dist/platform/schema/class-icon.js +2 -29
- package/dist/platform/schema/index.d.ts +1 -1
- package/dist/platform/schema/schema-authoring.d.ts +14 -7
- package/dist/platform/schema/schema-authoring.js +5 -1
- package/dist/project/admit.js +0 -4
- package/dist/project/install-command.d.ts +0 -4
- package/dist/project/install-command.js +1 -5
- package/dist/tooling/cli/deploy-mode.d.ts +3 -59
- package/dist/tooling/cli/deploy-mode.js +46 -122
- package/dist/tooling/cli/deploy-result.d.ts +10 -15
- package/dist/tooling/cli/help.js +9 -16
- package/dist/tooling/cli/immutable-deployment.d.ts +5 -5
- package/dist/tooling/cli/index.d.ts +1 -1
- package/dist/tooling/cli/list.d.ts +5 -7
- package/dist/tooling/cli/list.js +9 -61
- package/dist/tooling/cli/orchestrate.js +6 -16
- package/dist/tooling/cli/publish/index.d.ts +2 -2
- package/dist/tooling/cli/registry/client.js +1 -1
- package/dist/tooling/cli/secrets.d.ts +2 -2
- package/dist/tooling/linter/implementations/source/global.js +0 -1
- package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
- package/dist/tooling/linter/policy/generated.js +2 -51
- package/dist/tooling/linter/requirements/registry.js +0 -6
- package/package.json +10 -6
- package/dist/application/query/execution/projection.d.ts +0 -3
- package/dist/application/query/execution/projection.js +0 -3
- package/dist/deployment/adapter/legacy/adapter.d.ts +0 -40
- package/dist/deployment/adapter/legacy/adapter.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/context.d.ts +0 -19
- package/dist/deployment/adapter/legacy/deploy/context.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/index.d.ts +0 -2
- package/dist/deployment/adapter/legacy/deploy/index.js +0 -1
- package/dist/deployment/adapter/legacy/deploy/result.d.ts +0 -89
- package/dist/deployment/adapter/legacy/deploy/result.js +0 -1
- package/dist/deployment/adapter/legacy/index.d.ts +0 -24
- package/dist/deployment/adapter/legacy/index.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +0 -43
- package/dist/deployment/adapter/legacy/prepare/artifact.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/context.d.ts +0 -33
- package/dist/deployment/adapter/legacy/prepare/context.js +0 -1
- package/dist/deployment/adapter/legacy/prepare/index.d.ts +0 -2
- package/dist/deployment/adapter/legacy/prepare/index.js +0 -1
- package/dist/deployment/deploy.d.ts +0 -20
- package/dist/deployment/deploy.js +0 -31
- package/dist/deployment/release/legacy/admission.d.ts +0 -3
- package/dist/deployment/release/legacy/admission.js +0 -8
- package/dist/deployment/release/legacy/assemble.d.ts +0 -5
- package/dist/deployment/release/legacy/assemble.js +0 -20
- package/dist/deployment/release/legacy/index.d.ts +0 -35
- package/dist/deployment/release/legacy/index.js +0 -34
- package/dist/deployment/release/legacy/release.d.ts +0 -12
- package/dist/deployment/release/legacy/release.js +0 -1
- package/dist/deployment/release/legacy/seal.d.ts +0 -10
- package/dist/deployment/release/legacy/seal.js +0 -17
- package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
- package/dist/deployment/verify/preflight/artifact.js +0 -122
- package/dist/deployment/verify/preflight/publication.d.ts +0 -4
- package/dist/deployment/verify/preflight/publication.js +0 -15
- package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
- package/dist/deployment/verify/readiness/deployment.js +0 -143
- package/dist/deployment/verify/readiness/legacy/index.d.ts +0 -2
- package/dist/deployment/verify/readiness/legacy/index.js +0 -2
- package/dist/deployment/verify/readiness/legacy/publication.d.ts +0 -12
- package/dist/deployment/verify/readiness/legacy/publication.js +0 -23
- package/dist/execution/service/errors.d.ts +0 -3
- package/dist/execution/service/errors.js +0 -3
- package/dist/execution/service/serving/legacy/index.d.ts +0 -15
- package/dist/execution/service/serving/legacy/index.js +0 -19
- package/dist/tooling/cli/deprecations.d.ts +0 -9
- package/dist/tooling/cli/deprecations.js +0 -15
- package/dist/tooling/cli/legacy/deploy-result.d.ts +0 -28
- package/dist/tooling/cli/legacy/deploy-result.js +0 -37
- package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +0 -21
- package/dist/tooling/cli/legacy/stable-target-adapter.js +0 -14
- package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +0 -40
- package/dist/tooling/cli/legacy/stable-target-deploy.js +0 -102
- package/dist/tooling/cli/legacy/uploaded-build.d.ts +0 -11
- package/dist/tooling/cli/legacy/uploaded-build.js +0 -22
- package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
- package/dist/tooling/linter/implementations/source/migrations.js +0 -113
- package/dist/tooling/linter/qualification/index.d.ts +0 -10
- package/dist/tooling/linter/qualification/index.js +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
- package/dist/tooling/linter/qualification/runner.d.ts +0 -3
- package/dist/tooling/linter/qualification/runner.js +0 -6
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { acceptWorkflowEngineIdentityKey } from '@astrale-os/kernel-protocol/issuer/workflow-engine';
|
|
2
1
|
const HOUR_MS = 60 * 60_000;
|
|
3
2
|
const DAY_MS = 24 * HOUR_MS;
|
|
4
|
-
const MAXIMUM_IDENTITY_KEYS = 16;
|
|
5
3
|
/** Capture one durable serving configuration, failing closed on any gap. */
|
|
6
4
|
export function durableServing(input) {
|
|
7
5
|
if (input === null ||
|
|
8
6
|
typeof input !== 'object' ||
|
|
9
7
|
Array.isArray(input) ||
|
|
10
8
|
Reflect.ownKeys(input).some((key) => key !== 'engine' &&
|
|
11
|
-
key !== 'identityKeys' &&
|
|
12
9
|
key !== 'fetch' &&
|
|
13
10
|
key !== 'retentionMs' &&
|
|
14
11
|
key !== 'retry' &&
|
|
@@ -24,20 +21,6 @@ export function durableServing(input) {
|
|
|
24
21
|
typeof engine.CancelledError !== 'function') {
|
|
25
22
|
invalid('Durable serving requires the Restate SDK Fetch entrypoint of this platform.');
|
|
26
23
|
}
|
|
27
|
-
const keys = input.identityKeys;
|
|
28
|
-
let identityKeys = Object.freeze([]);
|
|
29
|
-
if (keys !== undefined) {
|
|
30
|
-
if (!Array.isArray(keys) || keys.length === 0 || keys.length > MAXIMUM_IDENTITY_KEYS) {
|
|
31
|
-
invalid('Durable serving requires engine request identity keys (publickeyv1_…).');
|
|
32
|
-
}
|
|
33
|
-
// Legacy callbacks retain their original sixteen-key input budget and duplicate policy.
|
|
34
|
-
try {
|
|
35
|
-
identityKeys = Object.freeze(Array.from(keys, acceptWorkflowEngineIdentityKey));
|
|
36
|
-
}
|
|
37
|
-
catch (cause) {
|
|
38
|
-
throw new TypeError('Durable serving requires engine request identity keys (publickeyv1_…).', { cause });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
24
|
const fetch = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
42
25
|
if (typeof fetch !== 'function')
|
|
43
26
|
invalid('Durable serving requires Fetch for engine discovery.');
|
|
@@ -57,7 +40,6 @@ export function durableServing(input) {
|
|
|
57
40
|
TerminalError: engine.TerminalError,
|
|
58
41
|
CancelledError: engine.CancelledError,
|
|
59
42
|
}),
|
|
60
|
-
identityKeys,
|
|
61
43
|
fetch,
|
|
62
44
|
retentionMs: bounded(input.retentionMs, 7 * DAY_MS, HOUR_MS, 365 * DAY_MS, 'retentionMs'),
|
|
63
45
|
retryPolicy: Object.freeze({
|
|
@@ -8,8 +8,7 @@ export interface DurableReceiver {
|
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Route `…/invoke/restate/<Kernel issuer>/<declaration key>/<service>/{discover,invoke/…}` to one
|
|
11
|
-
* engine endpoint.
|
|
12
|
-
* `<declaration key>/<service>` route with explicit legacy signing keys. Canonical routes discover
|
|
11
|
+
* engine endpoint. Routes discover
|
|
13
12
|
* their signing authority at the named Kernel; that issuer also binds the run envelope. Each
|
|
14
13
|
* endpoint serves exactly that service with the declared Workflow. A declaration this Release does not
|
|
15
14
|
* serve durably is refused, so an endpoint never runs code it does not declare.
|
|
@@ -4,8 +4,7 @@ import { durableHandlers } from './run.js';
|
|
|
4
4
|
const MAXIMUM_ENDPOINTS = 256;
|
|
5
5
|
/**
|
|
6
6
|
* Route `…/invoke/restate/<Kernel issuer>/<declaration key>/<service>/{discover,invoke/…}` to one
|
|
7
|
-
* engine endpoint.
|
|
8
|
-
* `<declaration key>/<service>` route with explicit legacy signing keys. Canonical routes discover
|
|
7
|
+
* engine endpoint. Routes discover
|
|
9
8
|
* their signing authority at the named Kernel; that issuer also binds the run envelope. Each
|
|
10
9
|
* endpoint serves exactly that service with the declared Workflow. A declaration this Release does not
|
|
11
10
|
* serve durably is refused, so an endpoint never runs code it does not declare.
|
|
@@ -31,21 +30,17 @@ export function createDurableReceiver(input) {
|
|
|
31
30
|
const workflow = declared.get(declaration);
|
|
32
31
|
if (workflow === undefined)
|
|
33
32
|
return refused();
|
|
34
|
-
let identityKeys
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return unavailable();
|
|
43
|
-
}
|
|
33
|
+
let identityKeys;
|
|
34
|
+
try {
|
|
35
|
+
identityKeys = (await discovery.resolve(kernel)).identity_keys;
|
|
36
|
+
}
|
|
37
|
+
catch (cause) {
|
|
38
|
+
if (!(cause instanceof WorkflowEngineUnavailable))
|
|
39
|
+
throw cause;
|
|
40
|
+
return unavailable();
|
|
44
41
|
}
|
|
45
|
-
else if (identityKeys.length === 0)
|
|
46
|
-
return refused();
|
|
47
42
|
request.signal.throwIfAborted();
|
|
48
|
-
const cacheKey = JSON.stringify([kernel
|
|
43
|
+
const cacheKey = JSON.stringify([kernel, declaration, service, identityKeys]);
|
|
49
44
|
let endpoint = endpoints.get(cacheKey);
|
|
50
45
|
if (endpoint === undefined) {
|
|
51
46
|
const definition = engine.workflow({
|
|
@@ -55,7 +50,7 @@ export function createDurableReceiver(input) {
|
|
|
55
50
|
domain: input.domain,
|
|
56
51
|
executor: bound,
|
|
57
52
|
serving: input.serving,
|
|
58
|
-
|
|
53
|
+
kernel,
|
|
59
54
|
}),
|
|
60
55
|
options: {
|
|
61
56
|
workflowRetention: input.serving.retentionMs,
|
|
@@ -68,9 +63,7 @@ export function createDurableReceiver(input) {
|
|
|
68
63
|
services: [definition],
|
|
69
64
|
});
|
|
70
65
|
}
|
|
71
|
-
catch
|
|
72
|
-
if (kernel === undefined)
|
|
73
|
-
throw cause;
|
|
66
|
+
catch {
|
|
74
67
|
discovery.forget(kernel, identityKeys);
|
|
75
68
|
return unavailable();
|
|
76
69
|
}
|
|
@@ -79,7 +72,7 @@ export function createDurableReceiver(input) {
|
|
|
79
72
|
endpoints.set(cacheKey, endpoint);
|
|
80
73
|
}
|
|
81
74
|
const response = await endpoint(request);
|
|
82
|
-
if (
|
|
75
|
+
if (response.status === 401)
|
|
83
76
|
discovery.invalidate(kernel, identityKeys);
|
|
84
77
|
return response;
|
|
85
78
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IssuerId } from '../../platform/auth/index.js';
|
|
2
2
|
export interface DurableRoute {
|
|
3
|
-
readonly kernel
|
|
3
|
+
readonly kernel: IssuerId;
|
|
4
4
|
readonly declaration: string;
|
|
5
5
|
readonly service: string;
|
|
6
6
|
}
|
|
@@ -8,7 +8,5 @@ export interface DurableRoute {
|
|
|
8
8
|
export declare function isDurableRequest(request: Request): boolean;
|
|
9
9
|
/** Canonical requests discover authority at the HTTPS Kernel named by this admitted route. */
|
|
10
10
|
export declare function isCanonicalDurableRequest(request: Request): boolean;
|
|
11
|
-
/** Retained callbacks need explicit legacy signing authority before an engine module is loaded. */
|
|
12
|
-
export declare function isLegacyDurableRequest(request: Request): boolean;
|
|
13
11
|
/** One wire decoder shared by the receiver and platform lazy-load eligibility. */
|
|
14
12
|
export declare function durableRoute(request: Request): DurableRoute | undefined;
|
|
@@ -12,11 +12,6 @@ export function isDurableRequest(request) {
|
|
|
12
12
|
export function isCanonicalDurableRequest(request) {
|
|
13
13
|
return durableRoute(request)?.kernel !== undefined;
|
|
14
14
|
}
|
|
15
|
-
/** Retained callbacks need explicit legacy signing authority before an engine module is loaded. */
|
|
16
|
-
export function isLegacyDurableRequest(request) {
|
|
17
|
-
const route = durableRoute(request);
|
|
18
|
-
return route !== undefined && route.kernel === undefined;
|
|
19
|
-
}
|
|
20
15
|
/** One wire decoder shared by the receiver and platform lazy-load eligibility. */
|
|
21
16
|
export function durableRoute(request) {
|
|
22
17
|
const pathname = new URL(request.url).pathname;
|
|
@@ -25,12 +20,12 @@ export function durableRoute(request) {
|
|
|
25
20
|
const parts = pathname.slice(PREFIX.length).split('/');
|
|
26
21
|
try {
|
|
27
22
|
const first = decodeURIComponent(parts[0] ?? '');
|
|
28
|
-
const kernel =
|
|
29
|
-
const declaration =
|
|
30
|
-
const service = parts[
|
|
23
|
+
const kernel = httpIssuer(first, false);
|
|
24
|
+
const declaration = decodeURIComponent(parts[1] ?? '');
|
|
25
|
+
const service = parts[2] ?? '';
|
|
31
26
|
if (!Key.is(declaration) || !SERVICE.test(service))
|
|
32
27
|
return undefined;
|
|
33
|
-
return Object.freeze({
|
|
28
|
+
return Object.freeze({ kernel, declaration, service });
|
|
34
29
|
}
|
|
35
30
|
catch (cause) {
|
|
36
31
|
if (cause instanceof URIError || cause instanceof AuthValueError || cause instanceof TypeError)
|
|
@@ -6,7 +6,7 @@ import type { EngineSharedContext, EngineWorkflowContext } from './engine.js';
|
|
|
6
6
|
import type { AdmittedDurableServing } from './options.js';
|
|
7
7
|
type Executor = NonNullable<Identity['executor']>;
|
|
8
8
|
export interface DurableRun {
|
|
9
|
-
readonly kernel
|
|
9
|
+
readonly kernel: IssuerId;
|
|
10
10
|
readonly workflow: RuntimeWorkflow;
|
|
11
11
|
readonly domain: Domain;
|
|
12
12
|
readonly executor: Executor;
|
|
@@ -61,7 +61,7 @@ async function run(input, context, raw) {
|
|
|
61
61
|
}
|
|
62
62
|
function admitted(workflow, raw, kernel) {
|
|
63
63
|
const envelope = decodeEnvelope(raw);
|
|
64
|
-
if (
|
|
64
|
+
if (envelope.execution.kernel !== kernel) {
|
|
65
65
|
throw new TypeError('Durable envelope Kernel differs from its authenticated endpoint.');
|
|
66
66
|
}
|
|
67
67
|
const diagnostics = workflow.callable.validateInput(envelope.input);
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { defineRuntime } from './application/runtime/index.js';
|
|
|
13
13
|
export type { Runtime } from './application/runtime/index.js';
|
|
14
14
|
export { defineWorkflow } from './application/workflow/index.js';
|
|
15
15
|
export type { Workflow, WorkflowContext } from './application/workflow/index.js';
|
|
16
|
-
export { compile,
|
|
16
|
+
export { compile, runtime } from './deployment/index.js';
|
|
17
17
|
export type { Build, Deployment, Release } from './deployment/index.js';
|
|
18
18
|
export { defineProject } from './project/index.js';
|
|
19
19
|
export type { Project } from './project/index.js';
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,6 @@ export { defineMutation, executeMutation } from './application/mutation/index.js
|
|
|
6
6
|
export { defineCollectionQuery, defineCompositeQuery, defineQuery, executeQuery, } from './application/query/index.js';
|
|
7
7
|
export { defineRuntime } from './application/runtime/index.js';
|
|
8
8
|
export { defineWorkflow } from './application/workflow/index.js';
|
|
9
|
-
export { compile,
|
|
9
|
+
export { compile, runtime } from './deployment/index.js';
|
|
10
10
|
export { defineProject } from './project/index.js';
|
|
11
11
|
export { serve } from './execution/index.js';
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
/** Graph-local names retain the canonical Kernel type and constructor identity. */
|
|
2
|
-
export {
|
|
3
|
-
/** @deprecated Use LocalAlias. */
|
|
4
|
-
export { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
5
|
-
/** @deprecated Use isLocalAlias. */
|
|
6
|
-
export { isLocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
2
|
+
export { LocalAlias, isLocalAlias } from '@astrale-os/kernel-core/graph/graph';
|
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
/** Graph-local names retain the canonical Kernel type and constructor identity. */
|
|
2
|
-
export {
|
|
3
|
-
/** @deprecated Use LocalAlias. */
|
|
4
|
-
export { LocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
5
|
-
/** @deprecated Use isLocalAlias. */
|
|
6
|
-
export { isLocalBinding } from '@astrale-os/kernel-core/graph/graph';
|
|
2
|
+
export { LocalAlias, isLocalAlias } from '@astrale-os/kernel-core/graph/graph';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Curated aggregate over canonical graph values. */
|
|
2
2
|
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError, } from '@astrale-os/kernel-core/graph/graph';
|
|
3
|
-
export { LocalAlias, isLocalAlias
|
|
3
|
+
export { LocalAlias, isLocalAlias } from './alias.js';
|
|
4
4
|
export type { AnonymousNodeSpec, GraphDataJson, GraphSpecEdge, GraphSpecEndpoint, GraphSpecJson, GraphSpecNode, } from '@astrale-os/kernel-core/graph/graph';
|
|
5
5
|
export * from './edge/index.js';
|
|
6
6
|
export * from './node/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Curated aggregate over canonical graph values. */
|
|
2
2
|
export { GraphData, GraphDataDecodeError, GraphSpec, GraphSpecDecodeError, } from '@astrale-os/kernel-core/graph/graph';
|
|
3
|
-
export { LocalAlias, isLocalAlias
|
|
3
|
+
export { LocalAlias, isLocalAlias } from './alias.js';
|
|
4
4
|
export * from './edge/index.js';
|
|
5
5
|
export * from './node/index.js';
|
|
6
6
|
export * from './path/index.js';
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical `DomainRelease` v4 wire contract and admission owned by the Astrale platform: the
|
|
3
|
-
* document a deployment serves at `release.json`, its release digest and `ReleaseRef`.
|
|
4
|
-
*/
|
|
1
|
+
/** Canonical DomainRelease v4 and Delivery v2 wire contracts. */
|
|
5
2
|
export * from '@astrale-os/kernel-protocol/release';
|
|
6
|
-
/**
|
|
7
|
-
* The Kernel's Publication v2/v3 codec (`@astrale-os/kernel-protocol/release/legacy`): `accept`,
|
|
8
|
-
* `seal`, `encode`, `url`/`PATH`, the bundle helpers, `PublicationError` and Delivery v1, which
|
|
9
|
-
* stable targets and pre-v4 Kernels still serve and read.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Read and seal `DomainRelease` v4 with this module's root exports.
|
|
12
|
-
*
|
|
13
|
-
* Short-term consumers, which took it from the removed `@astrale-os/sdk/publication`:
|
|
14
|
-
* - cli `src/lib/domain-publication.ts` and its test (C1a: `accept`, `PATH`, `PublicationError`);
|
|
15
|
-
* - admin `domain/providers/http-publication/resolver.ts`,
|
|
16
|
-
* `domain/providers/remote-kernel/instance-gateway.ts`,
|
|
17
|
-
* `domain/providers/scaleway/machine-provider.ts`, `domain/scripts/admin-bootstrap/cli.ts`,
|
|
18
|
-
* `domain/scripts/e2e/install-domain-set.ts`, their tests and two `worker/src` tests, which also
|
|
19
|
-
* seal v2/v3 fixtures (A10a);
|
|
20
|
-
* - domains issues `tests/deployment/archived-errors.test.ts` (SV16).
|
|
21
|
-
*
|
|
22
|
-
* Removal, in a breaking SDK release: once those consumers no longer import it (the CLI and Admin
|
|
23
|
-
* read `release.json`), at the latest with the Kernel folder it re-exports, which the Kernel
|
|
24
|
-
* removes once no supported Kernel predates v4, no installation pins a v2/v3 document and no
|
|
25
|
-
* stable Worker serves one (D10).
|
|
26
|
-
*/
|
|
27
|
-
export { legacy } from '@astrale-os/kernel-protocol/release';
|
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical `DomainRelease` v4 wire contract and admission owned by the Astrale platform: the
|
|
3
|
-
* document a deployment serves at `release.json`, its release digest and `ReleaseRef`.
|
|
4
|
-
*/
|
|
1
|
+
/** Canonical DomainRelease v4 and Delivery v2 wire contracts. */
|
|
5
2
|
export * from '@astrale-os/kernel-protocol/release';
|
|
6
|
-
/**
|
|
7
|
-
* The Kernel's Publication v2/v3 codec (`@astrale-os/kernel-protocol/release/legacy`): `accept`,
|
|
8
|
-
* `seal`, `encode`, `url`/`PATH`, the bundle helpers, `PublicationError` and Delivery v1, which
|
|
9
|
-
* stable targets and pre-v4 Kernels still serve and read.
|
|
10
|
-
*
|
|
11
|
-
* @deprecated Read and seal `DomainRelease` v4 with this module's root exports.
|
|
12
|
-
*
|
|
13
|
-
* Short-term consumers, which took it from the removed `@astrale-os/sdk/publication`:
|
|
14
|
-
* - cli `src/lib/domain-publication.ts` and its test (C1a: `accept`, `PATH`, `PublicationError`);
|
|
15
|
-
* - admin `domain/providers/http-publication/resolver.ts`,
|
|
16
|
-
* `domain/providers/remote-kernel/instance-gateway.ts`,
|
|
17
|
-
* `domain/providers/scaleway/machine-provider.ts`, `domain/scripts/admin-bootstrap/cli.ts`,
|
|
18
|
-
* `domain/scripts/e2e/install-domain-set.ts`, their tests and two `worker/src` tests, which also
|
|
19
|
-
* seal v2/v3 fixtures (A10a);
|
|
20
|
-
* - domains issues `tests/deployment/archived-errors.test.ts` (SV16).
|
|
21
|
-
*
|
|
22
|
-
* Removal, in a breaking SDK release: once those consumers no longer import it (the CLI and Admin
|
|
23
|
-
* read `release.json`), at the latest with the Kernel folder it re-exports, which the Kernel
|
|
24
|
-
* removes once no supported Kernel predates v4, no installation pins a v2/v3 document and no
|
|
25
|
-
* stable Worker serves one (D10).
|
|
26
|
-
*/
|
|
27
|
-
export { legacy } from '@astrale-os/kernel-protocol/release';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const CLASS_ICON: unique symbol;
|
|
2
|
+
/** An admitted, self-contained SVG suitable for a Node Class presentation icon. */
|
|
3
|
+
export type ClassIcon = string & {
|
|
4
|
+
readonly [CLASS_ICON]: true;
|
|
5
|
+
};
|
|
6
|
+
/** Stable empty SVG used when an author explicitly chooses to render no icon glyph. */
|
|
7
|
+
export declare const NEUTRAL_CLASS_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"></svg>";
|
|
8
|
+
export declare function admitClassIconSvg(source: string): ClassIcon;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const MAX_CLASS_ICON_LENGTH = 8_000;
|
|
2
|
+
const SVG_ROOT = /^<svg(?:\s[^>]*)?>[\s\S]*<\/svg>$/u;
|
|
3
|
+
const SVG_ROOT_OPEN = /<svg(?:\s|>)/gu;
|
|
4
|
+
const SVG_ROOT_CLOSE = /<\/svg\s*>/gu;
|
|
5
|
+
const SVG_GRAPHIC = /<(?:circle|ellipse|line|path|polygon|polyline|rect)\b/iu;
|
|
6
|
+
const UNSAFE_SVG = /<\s*(?:animate|discard|embed|foreignObject|iframe|image|object|script|set|style|use)\b|<!DOCTYPE\b|<!ENTITY\b|\son[a-z][\w:.-]*\s*=|(?:href|xlink:href)\s*=|javascript\s*:|url\s*\(/iu;
|
|
7
|
+
/** Stable empty SVG used when an author explicitly chooses to render no icon glyph. */
|
|
8
|
+
export const NEUTRAL_CLASS_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>';
|
|
9
|
+
export function admitClassIconSvg(source) {
|
|
10
|
+
if (typeof source !== 'string') {
|
|
11
|
+
throw new TypeError('Class icon must be an inline SVG string.');
|
|
12
|
+
}
|
|
13
|
+
const value = source.trim();
|
|
14
|
+
if (Array.from(value).length > MAX_CLASS_ICON_LENGTH) {
|
|
15
|
+
throw new TypeError(`Class icon must contain at most ${MAX_CLASS_ICON_LENGTH} characters.`);
|
|
16
|
+
}
|
|
17
|
+
if (!SVG_ROOT.test(value) ||
|
|
18
|
+
(value.match(SVG_ROOT_OPEN)?.length ?? 0) !== 1 ||
|
|
19
|
+
(value.match(SVG_ROOT_CLOSE)?.length ?? 0) !== 1) {
|
|
20
|
+
throw new TypeError('Class icon must be one complete inline <svg> element.');
|
|
21
|
+
}
|
|
22
|
+
if (UNSAFE_SVG.test(value)) {
|
|
23
|
+
throw new TypeError('Class icon SVG must be self-contained and contain no executable content.');
|
|
24
|
+
}
|
|
25
|
+
if (value !== NEUTRAL_CLASS_ICON_SVG && !SVG_GRAPHIC.test(value)) {
|
|
26
|
+
throw new TypeError('Class icon SVG must contain a visible vector element.');
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import type { LucideIconData } from '@lucide/icons';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
readonly [CLASS_ICON]: true;
|
|
6
|
-
};
|
|
7
|
-
/** Stable empty SVG used when an author explicitly chooses to render no icon glyph. */
|
|
8
|
-
export declare const NEUTRAL_CLASS_ICON_SVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"></svg>";
|
|
2
|
+
import type { ClassIcon } from './class-icon-svg.js';
|
|
3
|
+
export type { ClassIcon } from './class-icon-svg.js';
|
|
4
|
+
export { NEUTRAL_CLASS_ICON_SVG } from './class-icon-svg.js';
|
|
9
5
|
/** Framework-neutral constructors for canonical Node Class icons. */
|
|
10
6
|
export declare const classIcon: Readonly<{
|
|
11
7
|
readonly neutral: ClassIcon;
|
|
12
8
|
svg(source: string): ClassIcon;
|
|
13
9
|
lucide(icon: LucideIconData): ClassIcon;
|
|
14
10
|
}>;
|
|
15
|
-
export {};
|
|
@@ -1,33 +1,6 @@
|
|
|
1
1
|
import { buildLucideSvg } from '@lucide/icons/build';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const SVG_ROOT_OPEN = /<svg(?:\s|>)/gu;
|
|
5
|
-
const SVG_ROOT_CLOSE = /<\/svg\s*>/gu;
|
|
6
|
-
const SVG_GRAPHIC = /<(?:circle|ellipse|line|path|polygon|polyline|rect)\b/iu;
|
|
7
|
-
const UNSAFE_SVG = /<\s*(?:animate|discard|embed|foreignObject|iframe|image|object|script|set|style|use)\b|<!DOCTYPE\b|<!ENTITY\b|\son[a-z][\w:.-]*\s*=|(?:href|xlink:href)\s*=|javascript\s*:|url\s*\(/iu;
|
|
8
|
-
/** Stable empty SVG used when an author explicitly chooses to render no icon glyph. */
|
|
9
|
-
export const NEUTRAL_CLASS_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"></svg>';
|
|
10
|
-
function svg(source) {
|
|
11
|
-
if (typeof source !== 'string') {
|
|
12
|
-
throw new TypeError('Class icon must be an inline SVG string.');
|
|
13
|
-
}
|
|
14
|
-
const value = source.trim();
|
|
15
|
-
if (Array.from(value).length > MAX_CLASS_ICON_LENGTH) {
|
|
16
|
-
throw new TypeError(`Class icon must contain at most ${MAX_CLASS_ICON_LENGTH} characters.`);
|
|
17
|
-
}
|
|
18
|
-
if (!SVG_ROOT.test(value) ||
|
|
19
|
-
(value.match(SVG_ROOT_OPEN)?.length ?? 0) !== 1 ||
|
|
20
|
-
(value.match(SVG_ROOT_CLOSE)?.length ?? 0) !== 1) {
|
|
21
|
-
throw new TypeError('Class icon must be one complete inline <svg> element.');
|
|
22
|
-
}
|
|
23
|
-
if (UNSAFE_SVG.test(value)) {
|
|
24
|
-
throw new TypeError('Class icon SVG must be self-contained and contain no executable content.');
|
|
25
|
-
}
|
|
26
|
-
if (value !== NEUTRAL_CLASS_ICON_SVG && !SVG_GRAPHIC.test(value)) {
|
|
27
|
-
throw new TypeError('Class icon SVG must contain a visible vector element.');
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
2
|
+
import { admitClassIconSvg as svg, NEUTRAL_CLASS_ICON_SVG } from './class-icon-svg.js';
|
|
3
|
+
export { NEUTRAL_CLASS_ICON_SVG } from './class-icon-svg.js';
|
|
31
4
|
function lucide(icon) {
|
|
32
5
|
let source;
|
|
33
6
|
try {
|
|
@@ -16,7 +16,7 @@ export type { ClassIcon } from './class-icon.js';
|
|
|
16
16
|
export type { StoredPropertyInputOf } from './property-input.js';
|
|
17
17
|
export type { CallablePolicyBuilder, CallablePolicyContext, CallableProjection, AuthoredMethodProjection, AuthoredPropertyProjection, ClassIdentityProjection, ClassOwnerProjection, CoreEdge, CoreEndpoint, CoreNode, DefinedSchema, DirectedEdgeClass, ClassReferenceProjection, ClassProjection, FunctionProjection, EdgeClass, Function, Method, MethodProjection, Lazy, NodeClass, Policy, PolicyExistsContext, PolicyNodeBinder, PolicyPatternContext, Property, PropertyProjection, ResolvedDomainOfInput, View, } from '@astrale-os/kernel-dsl/v1/builder';
|
|
18
18
|
export type { Array, Object, Value } from '@astrale-os/kernel-dsl/value';
|
|
19
|
-
export type { CallableExecution, ClassKind, DirectedEdgeContract, EdgeClassPolicies, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
19
|
+
export type { CallableExecution, ClassKind, DirectedEdgeContract, EdgeClassPolicies, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, PropertyImmutability, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
20
20
|
export type { DomainSchema } from '@astrale-os/kernel-dsl/v1/schema';
|
|
21
21
|
/** Kernel-owned Schema values used by authored product Schemas and graph operations. */
|
|
22
22
|
export { AuthorityOperationOrder, AuthorityOperations, AuthorityRelations, KernelRootFunctions, OperationCore, operationOf, } from '@astrale-os/kernel-core/schema';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { DefinedSchema, ResolvedDomainOfInput } from '@astrale-os/kernel-dsl/v1/builder';
|
|
1
|
+
import type { DefinedSchema, EntrypointOf, ResolvedDomainOfInput, SchemaInput } from '@astrale-os/kernel-dsl/v1/builder';
|
|
2
2
|
import type { DomainSchema } from '@astrale-os/kernel-dsl/v1/schema';
|
|
3
|
-
|
|
4
|
-
type DomainSchemaInput = Parameters<typeof kernelDefineSchema>[1];
|
|
3
|
+
type DomainSchemaInput = SchemaInput;
|
|
5
4
|
declare const authoredGraph: unique symbol;
|
|
6
|
-
/**
|
|
5
|
+
/** Resolved Schemas retain their witness; authored Schemas retain input and dependency edges. */
|
|
7
6
|
type Entry = readonly [origin: string, schema: DomainSchema] | readonly [
|
|
8
7
|
origin: string,
|
|
9
8
|
input: DomainSchemaInput,
|
|
@@ -34,7 +33,7 @@ type InputOf<Origin extends string, Graph extends Entry> = Extract<Graph, readon
|
|
|
34
33
|
readonly [Alias in keyof Dependencies]: SchemaOf<Dependencies[Alias], Graph>;
|
|
35
34
|
};
|
|
36
35
|
} : never;
|
|
37
|
-
type SchemaOf<Origin extends string, Graph extends Entry> = Extract<Graph, readonly [Origin, DomainSchema]> extends infer
|
|
36
|
+
type SchemaOf<Origin extends string, Graph extends Entry> = Extract<Graph, readonly [Origin, DomainSchema]> extends infer Resolved ? [Resolved] extends [never] ? AuthoredSchema<Origin, Graph> : Resolved extends readonly [string, infer Schema extends DomainSchema] ? Schema : never : never;
|
|
38
37
|
/** Resolve a dependency graph without expanding a shared Schema at each dependency edge. */
|
|
39
38
|
export interface AuthoredDomain<Origin extends string, Graph extends Entry> extends ResolvedDomainOfInput<Origin, InputOf<Origin, Graph>> {
|
|
40
39
|
}
|
|
@@ -42,7 +41,15 @@ export interface AuthoredDomain<Origin extends string, Graph extends Entry> exte
|
|
|
42
41
|
export interface AuthoredSchema<Origin extends string, Graph extends Entry> extends DefinedSchema<Origin, AuthoredDomain<Origin, Graph>> {
|
|
43
42
|
readonly [authoredGraph]?: Graph;
|
|
44
43
|
}
|
|
45
|
-
type DefineSchema = <const Origin extends string, const Input extends DomainSchemaInput
|
|
46
|
-
|
|
44
|
+
type DefineSchema = <const Origin extends string, const Input extends DomainSchemaInput & {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
}>(origin: Origin, input: Input & {
|
|
47
|
+
readonly entrypoint?: EntrypointOf<Input>;
|
|
48
|
+
}) => string extends Origin | Extract<Dependencies<Input>[keyof Dependencies<Input>], DomainSchema>['origin'] ? DefinedSchema<Origin, ResolvedDomainOfInput<Origin, Input>> : AuthoredSchema<Origin, Extract<UniqueEntries<GraphOfInput<Origin, Input>>, Entry>>;
|
|
49
|
+
/**
|
|
50
|
+
* The canonical implementation with a portable, automatically inferred declaration. Its type
|
|
51
|
+
* requires the Domain `name`, which the Kernel requires to install a new revision; `defineDomain`
|
|
52
|
+
* refuses an unnamed root Schema at runtime. `entrypoint` names one of the declared Views.
|
|
53
|
+
*/
|
|
47
54
|
export declare const defineSchema: DefineSchema;
|
|
48
55
|
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { defineSchema as kernelDefineSchema } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The canonical implementation with a portable, automatically inferred declaration. Its type
|
|
4
|
+
* requires the Domain `name`, which the Kernel requires to install a new revision; `defineDomain`
|
|
5
|
+
* refuses an unnamed root Schema at runtime. `entrypoint` names one of the declared Views.
|
|
6
|
+
*/
|
|
3
7
|
export const defineSchema = kernelDefineSchema;
|
package/dist/project/admit.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isLegacyDeployment } from '../deployment/deploy.js';
|
|
2
1
|
import { isProject } from './define.js';
|
|
3
2
|
export const PROJECT_EXPORT_HINT = 'astrale.config.ts must export exactly one default Project:\n' +
|
|
4
3
|
" import { defineProject } from '@astrale-os/sdk/project'\n" +
|
|
@@ -15,8 +14,5 @@ export function admitProjectModule(loaded) {
|
|
|
15
14
|
const value = Reflect.get(loaded, 'default');
|
|
16
15
|
if (isProject(value))
|
|
17
16
|
return value;
|
|
18
|
-
if (isLegacyDeployment(value)) {
|
|
19
|
-
throw new TypeError(`astrale.config.ts exports the legacy deploy() aggregate; migrate the Domain and Environments into defineProject().\n${PROJECT_EXPORT_HINT}`);
|
|
20
|
-
}
|
|
21
17
|
throw new TypeError(`Default export must be created by defineProject().\n${PROJECT_EXPORT_HINT}`);
|
|
22
18
|
}
|
|
@@ -2,9 +2,5 @@
|
|
|
2
2
|
* The command that installs a deployed URL on an instance, as every SDK refusal and help text
|
|
3
3
|
* names it. A deploy never installs (DX [.81399], AM-72): `astrale-domain deploy <environment>`
|
|
4
4
|
* prints a URL, and this command installs it.
|
|
5
|
-
*
|
|
6
|
-
* `--direct` sends a URL install to the instance Kernel, which the astrale CLI requires today and
|
|
7
|
-
* accepts until D13. When the CLI retires it, this is the one SDK text to change; the adapter and
|
|
8
|
-
* scaffold READMEs and templates repeat it as prose.
|
|
9
5
|
*/
|
|
10
6
|
export declare function installCommand(instance?: string, identity?: string): string;
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
* The command that installs a deployed URL on an instance, as every SDK refusal and help text
|
|
3
3
|
* names it. A deploy never installs (DX [.81399], AM-72): `astrale-domain deploy <environment>`
|
|
4
4
|
* prints a URL, and this command installs it.
|
|
5
|
-
*
|
|
6
|
-
* `--direct` sends a URL install to the instance Kernel, which the astrale CLI requires today and
|
|
7
|
-
* accepts until D13. When the CLI retires it, this is the one SDK text to change; the adapter and
|
|
8
|
-
* scaffold READMEs and templates repeat it as prose.
|
|
9
5
|
*/
|
|
10
6
|
export function installCommand(instance = '<instance>', identity) {
|
|
11
|
-
return (`astrale domain install <url>
|
|
7
|
+
return (`astrale domain install <url> -i ${instance}` +
|
|
12
8
|
(identity === undefined ? '' : ` --as ${identity}`));
|
|
13
9
|
}
|
|
@@ -1,75 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The deploy mode of one Environment for one command (CT33), chosen by the configuration itself:
|
|
3
|
-
* an unchanged configuration keeps its mode, and so its behaviour, across an SDK upgrade, as long as
|
|
4
|
-
* that mode still has a consumer (AM-16, AM-72).
|
|
5
|
-
*
|
|
6
|
-
* - `canonical`: an immutable deployment of one sealed release through the adapter's
|
|
7
|
-
* `deployRelease`, with a key generated for it, and no call to any instance.
|
|
8
|
-
* - `legacy-direct`: today's stable target, replaced in place through `prepare` and `deploy`, which
|
|
9
|
-
* serves a v3 Publication only. Its `reasons` name what selected it.
|
|
10
|
-
* - `refused`: a shape no deploy of this SDK serves, refused before any effect. Each refusal
|
|
11
|
-
* carries the configuration or command to write instead.
|
|
12
|
-
*
|
|
13
|
-
* A deploy never installs, so two shapes are refused before a mode is selected at all: an
|
|
14
|
-
* Environment that declares `installation` by `defineProject`, and `--deploy-only` by the
|
|
15
|
-
* command-line parser (AM-72).
|
|
16
|
-
*/
|
|
1
|
+
/** A supported immutable deployment, or a configuration refused before provider effects. */
|
|
17
2
|
export type DeployMode = {
|
|
18
3
|
readonly kind: 'canonical';
|
|
19
|
-
} | {
|
|
20
|
-
readonly kind: 'legacy-direct';
|
|
21
|
-
readonly reasons: readonly LegacyDirectReason[];
|
|
22
4
|
} | {
|
|
23
5
|
readonly kind: 'refused';
|
|
24
6
|
readonly refusals: readonly DeployRefusal[];
|
|
25
7
|
};
|
|
26
|
-
/** What puts an Environment on the legacy direct-mode path. */
|
|
27
|
-
export type LegacyDirectReason =
|
|
28
|
-
/** An adapter-cloudflare parameter of direct mode. */
|
|
29
|
-
{
|
|
30
|
-
readonly reason: 'direct-parameter';
|
|
31
|
-
readonly parameter: CloudflareDirectParameter;
|
|
32
|
-
}
|
|
33
|
-
/** adapter-cloudflare without a dispatch `namespace`: direct mode is its default. */
|
|
34
|
-
| {
|
|
35
|
-
readonly reason: 'no-namespace';
|
|
36
|
-
}
|
|
37
|
-
/** An adapter that declares no `deployRelease`: the contract before adapter interface v2. */
|
|
38
|
-
| {
|
|
39
|
-
readonly reason: 'no-deploy-release';
|
|
40
|
-
};
|
|
41
|
-
export type CloudflareDirectParameter = 'route' | 'workerName' | 'identityIssuer' | 'addressing' | 'signingIdentity';
|
|
42
8
|
export interface DeployRefusal {
|
|
43
|
-
readonly reason: '
|
|
44
|
-
/** The configuration or command to write instead, for the author. */
|
|
9
|
+
readonly reason: 'invalid-parameters' | 'missing-namespace' | 'scheduled-triggers' | 'unsupported-adapter';
|
|
45
10
|
readonly guidance: string;
|
|
46
11
|
}
|
|
47
|
-
/**
|
|
48
|
-
* The commands that select a deploy mode. `publish` names only an immutable deployment, so it
|
|
49
|
-
* refuses every Environment that is not canonical (CT33, R-G03).
|
|
50
|
-
*/
|
|
51
12
|
export type DeployModeCommand = 'deploy' | 'publish';
|
|
52
|
-
/**
|
|
53
|
-
* Select the deploy mode of one Environment (CT33). It reads the configuration and the command
|
|
54
|
-
* only, and has no effect.
|
|
55
|
-
*
|
|
56
|
-
* A refusal wins over every other reason. adapter-astrale deploys immutable deployments only
|
|
57
|
-
* (`deployRelease`): its removed instance mode's `instance` and `signingIdentity` are refused
|
|
58
|
-
* before any effect, since their one consumer pins an older SDK (AM-72). Otherwise the Environment
|
|
59
|
-
* is on the legacy direct-mode path when adapter-cloudflare names a direct-mode parameter or no
|
|
60
|
-
* `namespace`, or when its adapter declares no `deployRelease`. Everything else is canonical,
|
|
61
|
-
* and `publish` refuses the legacy direct-mode path: a stable target serves no release, so no
|
|
62
|
-
* version can name it.
|
|
63
|
-
*
|
|
64
|
-
* Within canonical adapter-cloudflare (with `namespace`), a direct-mode parameter is refused
|
|
65
|
-
* rather than silently selecting either mode, and so is `wrangler.triggers`: an immutable
|
|
66
|
-
* deployment runs no cron of its own (D13). The bundling-affecting `wrangler` keys are refused by
|
|
67
|
-
* adapter-cloudflare itself for every Environment (AM-51).
|
|
68
|
-
*/
|
|
13
|
+
/** Inspect one Environment's deployment contract without building or changing any provider. */
|
|
69
14
|
export declare function selectDeployMode(input: {
|
|
70
15
|
readonly command: DeployModeCommand;
|
|
71
16
|
readonly environment: string;
|
|
72
|
-
/** The Environment's definition, of which selection reads only the adapter and its parameters. */
|
|
73
17
|
readonly definition: {
|
|
74
18
|
readonly deployment: {
|
|
75
19
|
readonly adapter: {
|