@astrale-os/sdk 0.6.0-beta.17 → 0.6.0-beta.19
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 +1 -1
- package/dist/deployment/adapter/legacy/index.d.ts +2 -2
- package/dist/deployment/adapter/legacy/prepare/context.d.ts +4 -5
- package/dist/execution/identity/jwks.js +57 -12
- package/dist/platform/schema/property.d.ts +5 -0
- package/dist/tooling/cli/arguments.d.ts +1 -3
- package/dist/tooling/cli/arguments.js +5 -39
- package/dist/tooling/cli/bun.d.ts +0 -1
- package/dist/tooling/cli/bun.js +0 -7
- package/dist/tooling/cli/deploy-mode.d.ts +4 -4
- package/dist/tooling/cli/deploy-mode.js +2 -15
- package/dist/tooling/cli/help.js +3 -50
- package/dist/tooling/cli/index.d.ts +1 -2
- package/dist/tooling/cli/index.js +1 -2
- package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +1 -1
- package/dist/tooling/cli/orchestrate.d.ts +0 -6
- package/dist/tooling/cli/orchestrate.js +0 -28
- package/package.json +7 -7
- package/dist/tooling/cli/legacy/development/candidate.d.ts +0 -25
- package/dist/tooling/cli/legacy/development/candidate.js +0 -170
- package/dist/tooling/cli/legacy/development/credential.d.ts +0 -2
- package/dist/tooling/cli/legacy/development/credential.js +0 -57
- package/dist/tooling/cli/legacy/development/deployment.d.ts +0 -10
- package/dist/tooling/cli/legacy/development/deployment.js +0 -20
- package/dist/tooling/cli/legacy/development/deprecation.d.ts +0 -11
- package/dist/tooling/cli/legacy/development/deprecation.js +0 -13
- package/dist/tooling/cli/legacy/development/develop.d.ts +0 -15
- package/dist/tooling/cli/legacy/development/develop.js +0 -142
- package/dist/tooling/cli/legacy/development/index.d.ts +0 -21
- package/dist/tooling/cli/legacy/development/index.js +0 -21
- package/dist/tooling/cli/legacy/development/lease.d.ts +0 -18
- package/dist/tooling/cli/legacy/development/lease.js +0 -163
- package/dist/tooling/cli/legacy/development/lifecycle.d.ts +0 -9
- package/dist/tooling/cli/legacy/development/lifecycle.js +0 -43
- package/dist/tooling/cli/legacy/development/project-imports.d.ts +0 -22
- package/dist/tooling/cli/legacy/development/project-imports.js +0 -39
- package/dist/tooling/cli/legacy/development/project-lock.d.ts +0 -16
- package/dist/tooling/cli/legacy/development/project-lock.js +0 -41
- package/dist/tooling/cli/legacy/development/rebuild.d.ts +0 -13
- package/dist/tooling/cli/legacy/development/rebuild.js +0 -58
- package/dist/tooling/cli/legacy/development/report.d.ts +0 -7
- package/dist/tooling/cli/legacy/development/report.js +0 -11
- package/dist/tooling/cli/legacy/development/secrets-file.d.ts +0 -2
- package/dist/tooling/cli/legacy/development/secrets-file.js +0 -33
- package/dist/tooling/cli/legacy/development/source-watch.d.ts +0 -14
- package/dist/tooling/cli/legacy/development/source-watch.js +0 -140
- package/dist/tooling/cli/legacy/development/sources.d.ts +0 -7
- package/dist/tooling/cli/legacy/development/sources.js +0 -48
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ The command covers the workspace root and its packages, pins exact versions, and
|
|
|
42
42
|
lockfile through pnpm. Use `--channel latest` to select that tag instead. Missing tags and local,
|
|
43
43
|
catalog, or aliased dependencies are left unchanged and reported; peers and overrides are not edited.
|
|
44
44
|
For an older SDK without this command, start with `pnpm dlx @astrale-os/sdk@beta upgrade`.
|
|
45
|
-
|
|
45
|
+
Run the project's checks and validate on development.
|
|
46
46
|
Nothing is committed or deployed. A Shell update also requires checking the installed Shell revision.
|
|
47
47
|
Rerunning an upgrade synchronizes installation even when the manifest versions are already current.
|
|
48
48
|
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* `placement` and `deployRelease`, which deploys one sealed release as one immutable deployment,
|
|
8
8
|
* created or reused, and installs nothing.
|
|
9
9
|
*
|
|
10
|
-
* Short-term consumers: the legacy direct-mode path (CT33), which `astrale-domain deploy`
|
|
11
|
-
*
|
|
10
|
+
* Short-term consumers: the legacy direct-mode path (CT33), which `astrale-domain deploy`
|
|
11
|
+
* runs through these operations: adapter-cloudflare direct mode (`route`,
|
|
12
12
|
* `workerName`, `identityIssuer`, `addressing`, `signingIdentity`, or no `namespace`), which serves
|
|
13
13
|
* the configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15),
|
|
14
14
|
* domains organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until
|
|
@@ -11,9 +11,8 @@ export interface PrepareContext<BuildValue extends Build = Build> {
|
|
|
11
11
|
readonly projectDir: string;
|
|
12
12
|
readonly environment: string;
|
|
13
13
|
/**
|
|
14
|
-
* Preparation purpose.
|
|
15
|
-
*
|
|
16
|
-
* release for compatibility during the beta migration.
|
|
14
|
+
* Preparation purpose. One-shot deployment prepares complete release artifacts. Omitted by
|
|
15
|
+
* older custom callers means release for compatibility during the beta migration.
|
|
17
16
|
*/
|
|
18
17
|
readonly mode?: 'release';
|
|
19
18
|
/**
|
|
@@ -27,8 +26,8 @@ export interface PrepareContext<BuildValue extends Build = Build> {
|
|
|
27
26
|
readonly runtime: ResolvedRuntimeReference;
|
|
28
27
|
/**
|
|
29
28
|
* The environment-free Bundle of the adapter's own `bundler`, which `astrale-domain deploy`
|
|
30
|
-
* always produces first so that preparation only places it. Absent
|
|
31
|
-
*
|
|
29
|
+
* always produces first so that preparation only places it. Absent for a custom caller, the
|
|
30
|
+
* adapter bundles by itself. Legacy prepare/deploy surface: deleted with it.
|
|
32
31
|
*/
|
|
33
32
|
readonly bundle?: Bundle<BuildValue>;
|
|
34
33
|
}
|
|
@@ -8,6 +8,17 @@ const MAXIMUM_DISCOVERY_BYTES = 256 * 1024;
|
|
|
8
8
|
const MAXIMUM_VERIFICATION_BASES = 64;
|
|
9
9
|
const VERIFICATION_BASIS_TTL_MS = 60_000;
|
|
10
10
|
const UNKNOWN_KEY_REFRESH_COOLDOWN_MS = 60_000;
|
|
11
|
+
const DISCOVERY_RETRY_DELAY_MS = 250;
|
|
12
|
+
// Only typed transport failures are replayable. Browser TypeError, TLS, HTTP and document
|
|
13
|
+
// admission failures carry no evidence that repeating the request can safely recover.
|
|
14
|
+
const TRANSIENT_TRANSPORT_CODES = new Set([
|
|
15
|
+
'ENOTFOUND',
|
|
16
|
+
'EAI_AGAIN',
|
|
17
|
+
'ECONNRESET',
|
|
18
|
+
'ETIMEDOUT',
|
|
19
|
+
'UND_ERR_CONNECT_TIMEOUT',
|
|
20
|
+
'UND_ERR_SOCKET',
|
|
21
|
+
]);
|
|
11
22
|
/**
|
|
12
23
|
* Retain only recently admitted public issuer material for one execution Identity.
|
|
13
24
|
* An unseen key ID may refresh once per cooldown; failures never replace a usable basis.
|
|
@@ -220,21 +231,55 @@ async function discover(issuer, fetch, signal, policy) {
|
|
|
220
231
|
});
|
|
221
232
|
}
|
|
222
233
|
async function request(fetch, url, signal) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
await
|
|
227
|
-
|
|
234
|
+
for (let attempt = 0;; attempt += 1) {
|
|
235
|
+
signal.throwIfAborted();
|
|
236
|
+
try {
|
|
237
|
+
const response = await fetch(url, { method: 'GET', redirect: 'error', signal });
|
|
238
|
+
if (!response.ok) {
|
|
239
|
+
await response.body?.cancel();
|
|
240
|
+
throw new IssuerUnavailable(`Issuer discovery returned HTTP ${response.status}.`);
|
|
241
|
+
}
|
|
242
|
+
return response;
|
|
243
|
+
}
|
|
244
|
+
catch (cause) {
|
|
245
|
+
if (signal.aborted)
|
|
246
|
+
throw signal.reason;
|
|
247
|
+
if (cause instanceof IssuerUnavailable)
|
|
248
|
+
throw cause;
|
|
249
|
+
// One retry belongs to the shared issuer load, never to each observer or business call.
|
|
250
|
+
if (attempt !== 0 || !transientTransport(cause)) {
|
|
251
|
+
throw new IssuerUnavailable('Issuer discovery request failed.', cause);
|
|
252
|
+
}
|
|
253
|
+
await retryDelay(signal);
|
|
228
254
|
}
|
|
229
|
-
return response;
|
|
230
255
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
256
|
+
}
|
|
257
|
+
function transientTransport(cause) {
|
|
258
|
+
// Node fetch wraps its transport Error; Bun may expose the code directly. Bound traversal
|
|
259
|
+
// of an external cause chain, including cycles, and do not look past a classified refusal.
|
|
260
|
+
for (let depth = 0; depth < 4; depth += 1) {
|
|
261
|
+
if (cause === null || typeof cause !== 'object')
|
|
262
|
+
return false;
|
|
263
|
+
const code = Reflect.get(cause, 'code');
|
|
264
|
+
if (typeof code === 'string')
|
|
265
|
+
return TRANSIENT_TRANSPORT_CODES.has(code);
|
|
266
|
+
cause = Reflect.get(cause, 'cause');
|
|
237
267
|
}
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
function retryDelay(signal) {
|
|
271
|
+
signal.throwIfAborted();
|
|
272
|
+
return new Promise((resolve, reject) => {
|
|
273
|
+
const cancel = () => {
|
|
274
|
+
clearTimeout(timer);
|
|
275
|
+
reject(signal.reason);
|
|
276
|
+
};
|
|
277
|
+
const timer = setTimeout(() => {
|
|
278
|
+
signal.removeEventListener('abort', cancel);
|
|
279
|
+
resolve();
|
|
280
|
+
}, DISCOVERY_RETRY_DELAY_MS);
|
|
281
|
+
signal.addEventListener('abort', cancel, { once: true });
|
|
282
|
+
});
|
|
238
283
|
}
|
|
239
284
|
async function json(response, signal) {
|
|
240
285
|
const bytes = new Uint8Array(await response.arrayBuffer());
|
|
@@ -3,6 +3,11 @@ import { type Property as CanonicalProperty, type ValueSchemaInput } from '@astr
|
|
|
3
3
|
export interface PropertyOptions {
|
|
4
4
|
readonly required?: boolean;
|
|
5
5
|
readonly description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* `create` freezes the value when its node or edge is created. `once` admits one write while the
|
|
8
|
+
* value is absent; neither can be changed or unset afterwards, only removed with the element.
|
|
9
|
+
*/
|
|
10
|
+
readonly immutable?: 'create' | 'once';
|
|
6
11
|
}
|
|
7
12
|
/** Keep canonical generic inference: ordinary properties carry no state machine. */
|
|
8
13
|
export type AuthoredProperty<Schema extends ValueSchemaInput, Options extends PropertyOptions = Record<never, never>> = CanonicalProperty<Schema, Options, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LintReportFormat } from '../linter/index.js';
|
|
2
2
|
import { type Version } from '../../platform/versioning/index.js';
|
|
3
|
-
export declare const COMMANDS: readonly ['
|
|
3
|
+
export declare const COMMANDS: readonly ['build', 'deploy', 'diff', 'list', 'publish', 'test', 'lint', 'package', 'upgrade', 'yank'];
|
|
4
4
|
export type Command = (typeof COMMANDS)[number];
|
|
5
5
|
export interface ParsedArgs {
|
|
6
6
|
readonly command: Command;
|
|
@@ -8,9 +8,7 @@ export interface ParsedArgs {
|
|
|
8
8
|
readonly fix?: boolean;
|
|
9
9
|
readonly format?: LintReportFormat;
|
|
10
10
|
readonly identity?: string;
|
|
11
|
-
readonly credentialFile?: string;
|
|
12
11
|
readonly suite?: string;
|
|
13
|
-
readonly secretsFile?: string;
|
|
14
12
|
readonly channel?: string;
|
|
15
13
|
readonly check?: boolean;
|
|
16
14
|
readonly json?: boolean;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { isAbsolute, normalize } from 'node:path';
|
|
2
1
|
import { acceptVersion } from '../../platform/versioning/index.js';
|
|
3
2
|
import { installCommand } from '../../project/install-command.js';
|
|
4
3
|
export const COMMANDS = [
|
|
5
|
-
'dev',
|
|
6
4
|
'build',
|
|
7
5
|
'deploy',
|
|
8
6
|
'diff',
|
|
@@ -24,8 +22,6 @@ export function parseArgs(argv) {
|
|
|
24
22
|
const json = rest.includes('--json');
|
|
25
23
|
const undo = rest.includes('--undo');
|
|
26
24
|
const allowDirty = rest.includes('--allow-dirty');
|
|
27
|
-
let secretsFile;
|
|
28
|
-
let credentialFile;
|
|
29
25
|
let identity;
|
|
30
26
|
let suite;
|
|
31
27
|
let format;
|
|
@@ -34,19 +30,7 @@ export function parseArgs(argv) {
|
|
|
34
30
|
const cleaned = [];
|
|
35
31
|
for (let index = 0; index < rest.length; index += 1) {
|
|
36
32
|
const argument = rest[index];
|
|
37
|
-
if (argument === '--
|
|
38
|
-
credentialFile = absoluteFilePath('--credential-file', rest[++index]);
|
|
39
|
-
}
|
|
40
|
-
else if (argument.startsWith('--credential-file=')) {
|
|
41
|
-
credentialFile = absoluteFilePath('--credential-file', argument.slice('--credential-file='.length));
|
|
42
|
-
}
|
|
43
|
-
else if (argument === '--secrets-file') {
|
|
44
|
-
secretsFile = absoluteFilePath('--secrets-file', rest[++index]);
|
|
45
|
-
}
|
|
46
|
-
else if (argument.startsWith('--secrets-file=')) {
|
|
47
|
-
secretsFile = absoluteFilePath('--secrets-file', argument.slice('--secrets-file='.length));
|
|
48
|
-
}
|
|
49
|
-
else if (argument === '--as') {
|
|
33
|
+
if (argument === '--as') {
|
|
50
34
|
identity = requiredValue('--as', rest[++index]);
|
|
51
35
|
}
|
|
52
36
|
else if (argument.startsWith('--as=')) {
|
|
@@ -110,28 +94,20 @@ export function parseArgs(argv) {
|
|
|
110
94
|
if (format !== undefined && command !== 'lint') {
|
|
111
95
|
throw new Error('`--format` is only valid for `lint`.');
|
|
112
96
|
}
|
|
113
|
-
if (
|
|
114
|
-
throw new Error('`--credential-file` and `--secrets-file` are only valid for `dev`.');
|
|
115
|
-
}
|
|
116
|
-
if (identity !== undefined && credentialFile !== undefined) {
|
|
117
|
-
throw new Error('Choose either `--as` or `--credential-file`, not both.');
|
|
118
|
-
}
|
|
119
|
-
if (deployOnly && command !== 'dev' && command !== 'deploy')
|
|
97
|
+
if (deployOnly && command !== 'deploy')
|
|
120
98
|
refuseDeployOnly(undefined);
|
|
121
99
|
if (identity !== undefined &&
|
|
122
|
-
command !== 'dev' &&
|
|
123
100
|
command !== 'deploy' &&
|
|
124
101
|
command !== 'diff' &&
|
|
125
102
|
command !== 'list' &&
|
|
126
103
|
command !== 'publish') {
|
|
127
|
-
throw new Error('`--as` is only valid for `
|
|
104
|
+
throw new Error('`--as` is only valid for `deploy`, `diff`, `list` or `publish`.');
|
|
128
105
|
}
|
|
129
106
|
if (environment !== undefined &&
|
|
130
|
-
command !== 'dev' &&
|
|
131
107
|
command !== 'deploy' &&
|
|
132
108
|
command !== 'list' &&
|
|
133
109
|
command !== 'test') {
|
|
134
|
-
throw new Error('`--environment` is only valid for `
|
|
110
|
+
throw new Error('`--environment` is only valid for `deploy`, `list` or `test`.');
|
|
135
111
|
}
|
|
136
112
|
if (suite !== undefined && command !== 'test') {
|
|
137
113
|
throw new Error('`--suite` is only valid for `test`.');
|
|
@@ -141,12 +117,11 @@ export function parseArgs(argv) {
|
|
|
141
117
|
throw new Error('Choose either a positional Environment or `--environment`, not both.');
|
|
142
118
|
}
|
|
143
119
|
switch (command) {
|
|
144
|
-
case 'dev':
|
|
145
120
|
case 'deploy': {
|
|
146
121
|
if (positionals.length > 1) {
|
|
147
122
|
throw new Error(`\`${command}\` accepts exactly one Environment.`);
|
|
148
123
|
}
|
|
149
|
-
const env = environment ?? positionals[0]
|
|
124
|
+
const env = environment ?? positionals[0];
|
|
150
125
|
if (!env) {
|
|
151
126
|
throw new Error(`\`${command}\` requires an Environment, e.g. \`${command} development\`.`);
|
|
152
127
|
}
|
|
@@ -157,8 +132,6 @@ export function parseArgs(argv) {
|
|
|
157
132
|
env,
|
|
158
133
|
...(json ? { json: true } : {}),
|
|
159
134
|
...(identity === undefined ? {} : { identity }),
|
|
160
|
-
...(credentialFile === undefined ? {} : { credentialFile }),
|
|
161
|
-
...(secretsFile === undefined ? {} : { secretsFile }),
|
|
162
135
|
};
|
|
163
136
|
}
|
|
164
137
|
case 'list':
|
|
@@ -278,10 +251,3 @@ function requiredValue(flag, input) {
|
|
|
278
251
|
throw new Error(`${flag} needs a value.`);
|
|
279
252
|
return input;
|
|
280
253
|
}
|
|
281
|
-
function absoluteFilePath(flag, input) {
|
|
282
|
-
const value = requiredValue(flag, input);
|
|
283
|
-
if (!isAbsolute(value) || normalize(value) !== value) {
|
|
284
|
-
throw new Error(`${flag} needs a normalized absolute path, got "${value}"`);
|
|
285
|
-
}
|
|
286
|
-
return value;
|
|
287
|
-
}
|
|
@@ -10,6 +10,5 @@ export type BunOutcome = {
|
|
|
10
10
|
};
|
|
11
11
|
/** Re-enter the published executable under Bun only when authored TypeScript must be imported. */
|
|
12
12
|
export declare function runWithBun(executable: string, argv: readonly string[]): Promise<BunOutcome>;
|
|
13
|
-
export declare function isolateDevelopmentProcessGroup(argv: readonly string[], platform?: NodeJS.Platform): boolean;
|
|
14
13
|
/** Prefer the generated project's exact Bun package binary over an ambient executable or shim. */
|
|
15
14
|
export declare function resolveBunExecutable(cwd: string): string;
|
package/dist/tooling/cli/bun.js
CHANGED
|
@@ -14,10 +14,6 @@ export function runWithBun(executable, argv) {
|
|
|
14
14
|
return new Promise((resolve, reject) => {
|
|
15
15
|
const child = spawn(resolveBunExecutable(process.cwd()), [executable, ...argv], {
|
|
16
16
|
stdio: 'inherit',
|
|
17
|
-
// Keep a long-lived development runtime outside the launcher's terminal
|
|
18
|
-
// process group. The launcher receives Ctrl-C, forwards it exactly once,
|
|
19
|
-
// and remains alive until Bun finishes provider and Kernel cleanup.
|
|
20
|
-
detached: isolateDevelopmentProcessGroup(argv),
|
|
21
17
|
});
|
|
22
18
|
const handlers = FORWARDED_SIGNALS.map((signal) => [signal, () => child.kill(signal)]);
|
|
23
19
|
for (const [signal, handler] of handlers)
|
|
@@ -44,9 +40,6 @@ export function runWithBun(executable, argv) {
|
|
|
44
40
|
});
|
|
45
41
|
});
|
|
46
42
|
}
|
|
47
|
-
export function isolateDevelopmentProcessGroup(argv, platform = process.platform) {
|
|
48
|
-
return platform !== 'win32' && argv[0] === 'dev';
|
|
49
|
-
}
|
|
50
43
|
/** Prefer the generated project's exact Bun package binary over an ambient executable or shim. */
|
|
51
44
|
export function resolveBunExecutable(cwd) {
|
|
52
45
|
const projectRequire = createRequire(join(cwd, 'package.json'));
|
|
@@ -40,7 +40,7 @@ export type LegacyDirectReason =
|
|
|
40
40
|
};
|
|
41
41
|
export type CloudflareDirectParameter = 'route' | 'workerName' | 'identityIssuer' | 'addressing' | 'signingIdentity';
|
|
42
42
|
export interface DeployRefusal {
|
|
43
|
-
readonly reason: 'astrale-instance' | 'astrale-signing-identity' | 'mixed-parameters' | 'scheduled-triggers' | '
|
|
43
|
+
readonly reason: 'astrale-instance' | 'astrale-signing-identity' | 'mixed-parameters' | 'scheduled-triggers' | 'publish-legacy-direct';
|
|
44
44
|
/** The configuration or command to write instead, for the author. */
|
|
45
45
|
readonly guidance: string;
|
|
46
46
|
}
|
|
@@ -48,7 +48,7 @@ export interface DeployRefusal {
|
|
|
48
48
|
* The commands that select a deploy mode. `publish` names only an immutable deployment, so it
|
|
49
49
|
* refuses every Environment that is not canonical (CT33, R-G03).
|
|
50
50
|
*/
|
|
51
|
-
export type DeployModeCommand = 'deploy' | '
|
|
51
|
+
export type DeployModeCommand = 'deploy' | 'publish';
|
|
52
52
|
/**
|
|
53
53
|
* Select the deploy mode of one Environment (CT33). It reads the configuration and the command
|
|
54
54
|
* only, and has no effect.
|
|
@@ -58,8 +58,8 @@ export type DeployModeCommand = 'deploy' | 'dev' | 'publish';
|
|
|
58
58
|
* before any effect, since their one consumer pins an older SDK (AM-72). Otherwise the Environment
|
|
59
59
|
* is on the legacy direct-mode path when adapter-cloudflare names a direct-mode parameter or no
|
|
60
60
|
* `namespace`, or when its adapter declares no `deployRelease`. Everything else is canonical,
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* and `publish` refuses the legacy direct-mode path: a stable target serves no release, so no
|
|
62
|
+
* version can name it.
|
|
63
63
|
*
|
|
64
64
|
* Within canonical adapter-cloudflare (with `namespace`), a direct-mode parameter is refused
|
|
65
65
|
* rather than silently selecting either mode, and so is `wrangler.triggers`: an immutable
|
|
@@ -22,8 +22,8 @@ const CLOUDFLARE_DIRECT_PARAMETERS = [
|
|
|
22
22
|
* before any effect, since their one consumer pins an older SDK (AM-72). Otherwise the Environment
|
|
23
23
|
* is on the legacy direct-mode path when adapter-cloudflare names a direct-mode parameter or no
|
|
24
24
|
* `namespace`, or when its adapter declares no `deployRelease`. Everything else is canonical,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* and `publish` refuses the legacy direct-mode path: a stable target serves no release, so no
|
|
26
|
+
* version can name it.
|
|
27
27
|
*
|
|
28
28
|
* Within canonical adapter-cloudflare (with `namespace`), a direct-mode parameter is refused
|
|
29
29
|
* rather than silently selecting either mode, and so is `wrangler.triggers`: an immutable
|
|
@@ -94,19 +94,6 @@ export function selectDeployMode(input) {
|
|
|
94
94
|
}
|
|
95
95
|
if (reasons.length > 0)
|
|
96
96
|
return Object.freeze({ kind: 'legacy-direct', reasons: freeze(reasons) });
|
|
97
|
-
if (command === 'dev') {
|
|
98
|
-
return Object.freeze({
|
|
99
|
-
kind: 'refused',
|
|
100
|
-
refusals: freeze([
|
|
101
|
-
{
|
|
102
|
-
reason: 'development-canonical',
|
|
103
|
-
guidance: `\`astrale-domain dev\` serves only legacy direct-mode Environments, and ${environment} ` +
|
|
104
|
-
`deploys immutable deployments. Run \`astrale-domain deploy ${environment}\`, then ` +
|
|
105
|
-
`\`${installCommand()}\`.`,
|
|
106
|
-
},
|
|
107
|
-
]),
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
97
|
return Object.freeze({ kind: 'canonical' });
|
|
111
98
|
}
|
|
112
99
|
/**
|
package/dist/tooling/cli/help.js
CHANGED
|
@@ -14,13 +14,12 @@ export function helpText(command) {
|
|
|
14
14
|
export const ERROR_USAGE = `Usage: astrale-domain <command> [options]
|
|
15
15
|
Run "astrale-domain --help" for available commands.
|
|
16
16
|
`;
|
|
17
|
-
const GLOBAL_HELP = `Build,
|
|
17
|
+
const GLOBAL_HELP = `Build, deploy, list, test, lint, and package Astrale Domains.
|
|
18
18
|
|
|
19
19
|
Usage:
|
|
20
20
|
astrale-domain <command> [options]
|
|
21
21
|
|
|
22
22
|
Commands:
|
|
23
|
-
dev [environment] Deprecated: use deploy, then astrale domain install.
|
|
24
23
|
build Build, verify and print the build digest.
|
|
25
24
|
deploy <environment> Deploy one Environment; never installs.
|
|
26
25
|
diff Show the changes since the published version and the minimum.
|
|
@@ -57,55 +56,9 @@ Behavior:
|
|
|
57
56
|
unchanged with a warning.
|
|
58
57
|
Local links, catalogs, aliases, peers, and overrides are not rewritten.
|
|
59
58
|
Does not load astrale.config.ts, require Bun, run project checks, commit, or deploy.
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
Review changes and run your project's checks afterwards. Failed installations leave
|
|
60
|
+
local changes available for repair.
|
|
62
61
|
For an older SDK without this command: pnpm dlx @astrale-os/sdk@beta upgrade.
|
|
63
|
-
`,
|
|
64
|
-
dev: `Build, verify, remotely deploy, and watch one Project Environment (deprecated).
|
|
65
|
-
|
|
66
|
-
Usage:
|
|
67
|
-
astrale-domain dev [environment] [options]
|
|
68
|
-
|
|
69
|
-
Deprecated:
|
|
70
|
-
Development is not a command of the deployment model. Deploy the Environment with
|
|
71
|
-
astrale-domain deploy <environment>, then install the URL it prints with
|
|
72
|
-
astrale domain install <url> --direct -i <instance>. dev keeps its behavior until
|
|
73
|
-
it is removed and warns on every run.
|
|
74
|
-
|
|
75
|
-
Arguments:
|
|
76
|
-
environment Project Environment name; defaults to development.
|
|
77
|
-
|
|
78
|
-
Options:
|
|
79
|
-
--environment <name> Select the environment without a positional argument.
|
|
80
|
-
--as <identity> Select the Astrale identity for the adapter's provider calls.
|
|
81
|
-
--credential-file <path>
|
|
82
|
-
Use one private operator credential for the adapter's provider
|
|
83
|
-
calls without exposing it in Project configuration.
|
|
84
|
-
--secrets-file <path> Load one private, absolute secrets file for this development
|
|
85
|
-
session instead of the adapter-declared secrets file.
|
|
86
|
-
-h, --help Show help for dev.
|
|
87
|
-
|
|
88
|
-
Behavior:
|
|
89
|
-
The selected Environment must exist; no other Environment is chosen as a fallback.
|
|
90
|
-
Builds and verifies the Domain, Runtime, frontend, and adapter artifact, then
|
|
91
|
-
deploys it through the selected Environment. It never starts a local Worker,
|
|
92
|
-
Vite server, or tunnel, and never installs the Domain: install the URL it prints with
|
|
93
|
-
${installCommand()}. Imported source changes
|
|
94
|
-
produce serialized remote updates; configuration changes require restarting the
|
|
95
|
-
command. It serves only legacy direct-mode Environments; an Environment that
|
|
96
|
-
deploys immutable deployments is refused.
|
|
97
|
-
A shared direct-provider target additionally requires an external single-writer
|
|
98
|
-
boundary such as a CI/CD concurrency group.
|
|
99
|
-
A credential file is admitted and read once. Its value is passed only to the
|
|
100
|
-
deployment adapter; it never enters Domain Runtime secrets or diagnostics. It is
|
|
101
|
-
currently unavailable on Windows because private no-reparse file admission is
|
|
102
|
-
absent.
|
|
103
|
-
A secrets-file override is read once, passed to the Domain runtime as secrets,
|
|
104
|
-
never mutates the authored project, and is not watched for later changes. It is
|
|
105
|
-
also unavailable on Windows because private no-reparse admission is absent.
|
|
106
|
-
|
|
107
|
-
Stopping the watcher stops only local build orchestration. The remote deployment
|
|
108
|
-
remains available.
|
|
109
62
|
`,
|
|
110
63
|
build: `Build and verify a Domain without deploying it, and print its build digest.
|
|
111
64
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@astrale-os/sdk/cli` — the `astrale-domain` CLI
|
|
3
|
-
* (
|
|
3
|
+
* (build | deploy | diff | list | publish | test | lint | package | upgrade | yank), its JSON results,
|
|
4
4
|
* the deploy mode each command selects for an Environment (CT33), and the explicit dotenv boundary.
|
|
5
|
-
* `dev` is deprecated and lives in `legacy/development/`.
|
|
6
5
|
*
|
|
7
6
|
* Node-only: the CLI imports `node:fs`/`node:module`/`node:url` and runs under
|
|
8
7
|
* Bun (it imports the project's `astrale.config.ts` directly). This subpath is
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@astrale-os/sdk/cli` — the `astrale-domain` CLI
|
|
3
|
-
* (
|
|
3
|
+
* (build | deploy | diff | list | publish | test | lint | package | upgrade | yank), its JSON results,
|
|
4
4
|
* the deploy mode each command selects for an Environment (CT33), and the explicit dotenv boundary.
|
|
5
|
-
* `dev` is deprecated and lives in `legacy/development/`.
|
|
6
5
|
*
|
|
7
6
|
* Node-only: the CLI imports `node:fs`/`node:module`/`node:url` and runs under
|
|
8
7
|
* Bun (it imports the project's `astrale.config.ts` directly). This subpath is
|
|
@@ -4,7 +4,7 @@ import type { Adapter, LegacyAdapter } from '../../../deployment/adapter/index.j
|
|
|
4
4
|
* v2 that keeps `prepare` and `deploy` for its direct-mode Environments.
|
|
5
5
|
*
|
|
6
6
|
* @deprecated Stable-target deploy path only. Replacement: `deployRelease` of adapter interface
|
|
7
|
-
* v2. Consumers: `astrale-domain deploy`
|
|
7
|
+
* v2. Consumers: `astrale-domain deploy` on the direct-mode
|
|
8
8
|
* configurations of domains ai-gateway, closing, grc, integrations and issues (until SV15), domains
|
|
9
9
|
* organization (until it leaves direct mode, AM-147), the Services `beta` and `prod` (until SV12),
|
|
10
10
|
* `development` (until SV9) and frozen `admin-beta` (until D19) environments, shell (until SH2)
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
import { type ParsedArgs } from './arguments.js';
|
|
2
|
-
import { develop } from './legacy/development/index.js';
|
|
3
1
|
export declare function run(argv: readonly string[]): Promise<number>;
|
|
4
|
-
export declare function executeDevelopmentCommand(parsed: ParsedArgs, input: {
|
|
5
|
-
readonly configPath: string;
|
|
6
|
-
readonly projectDir: string;
|
|
7
|
-
}, execute?: typeof develop): Promise<number>;
|
|
@@ -10,7 +10,6 @@ import { deprecationWarnings } from './deprecations.js';
|
|
|
10
10
|
import { runDiff } from './diff/index.js';
|
|
11
11
|
import { ERROR_USAGE, helpRequest, helpText } from './help.js';
|
|
12
12
|
import { deployImmutable } from './immutable-deployment.js';
|
|
13
|
-
import { develop, developmentDeprecation } from './legacy/development/index.js';
|
|
14
13
|
import { deployStableTarget } from './legacy/stable-target-deploy.js';
|
|
15
14
|
import { listDeployments, renderDeploymentList } from './list.js';
|
|
16
15
|
import { error, info, progress, warn } from './log.js';
|
|
@@ -56,10 +55,6 @@ export async function run(argv) {
|
|
|
56
55
|
if (!process.versions.bun) {
|
|
57
56
|
throw new BunRequiredError();
|
|
58
57
|
}
|
|
59
|
-
// Under Bun, before any Project prerequisite, so a refused `dev` run still names its
|
|
60
|
-
// replacement. The Node launcher re-enters Bun through BunRequiredError, so it prints once.
|
|
61
|
-
if (parsed.command === 'dev')
|
|
62
|
-
warn(developmentDeprecation(parsed.env));
|
|
63
58
|
const projectDir = process.cwd();
|
|
64
59
|
const configPath = findConfig(projectDir);
|
|
65
60
|
if (configPath === undefined) {
|
|
@@ -71,17 +66,6 @@ export async function run(argv) {
|
|
|
71
66
|
return list(parsed, project, projectDir);
|
|
72
67
|
if (parsed.command === 'yank')
|
|
73
68
|
return yank(parsed, project);
|
|
74
|
-
if (parsed.command === 'dev') {
|
|
75
|
-
// `dev` deploys only legacy direct-mode Environments; any other is refused before any effect.
|
|
76
|
-
const mode = selectDeployMode({
|
|
77
|
-
command: 'dev',
|
|
78
|
-
environment: parsed.env,
|
|
79
|
-
definition: selectEnvironment(project, parsed.env),
|
|
80
|
-
});
|
|
81
|
-
if (refused(mode))
|
|
82
|
-
return 1;
|
|
83
|
-
return executeDevelopmentCommand(parsed, { configPath, projectDir });
|
|
84
|
-
}
|
|
85
69
|
if (parsed.command === 'publish') {
|
|
86
70
|
// A version names an immutable deployment's release: any other Environment is refused before
|
|
87
71
|
// anything is built (CT33, R-G03).
|
|
@@ -299,18 +283,6 @@ function refused(mode) {
|
|
|
299
283
|
error(refusal.guidance);
|
|
300
284
|
return true;
|
|
301
285
|
}
|
|
302
|
-
export function executeDevelopmentCommand(parsed, input, execute = develop) {
|
|
303
|
-
if (parsed.command !== 'dev')
|
|
304
|
-
throw new TypeError('Development execution requires the dev command.');
|
|
305
|
-
return execute({
|
|
306
|
-
configPath: input.configPath,
|
|
307
|
-
projectDir: input.projectDir,
|
|
308
|
-
environment: parsed.env,
|
|
309
|
-
...(parsed.identity === undefined ? {} : { identity: parsed.identity }),
|
|
310
|
-
...(parsed.credentialFile === undefined ? {} : { credentialFile: parsed.credentialFile }),
|
|
311
|
-
...(parsed.secretsFile === undefined ? {} : { secretsFile: parsed.secretsFile }),
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
286
|
/**
|
|
315
287
|
* `astrale-domain yank <version> [--undo]`: take one published version of the Project's Domain
|
|
316
288
|
* out of resolution in the Admin registry, or put it back. With `--json`, stdout carries only the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/sdk",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.19",
|
|
4
4
|
"description": "Schema-first SDK for defining, composing, and deploying Astrale domains",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -253,11 +253,11 @@
|
|
|
253
253
|
"registry": "https://registry.npmjs.org/"
|
|
254
254
|
},
|
|
255
255
|
"dependencies": {
|
|
256
|
-
"@astrale-os/kernel-client": "0.6.0-beta.
|
|
257
|
-
"@astrale-os/kernel-core": "0.9.0-beta.
|
|
258
|
-
"@astrale-os/kernel-dsl": "0.2.0-beta.
|
|
259
|
-
"@astrale-os/kernel-protocol": "0.5.0-beta.
|
|
260
|
-
"@astrale-os/kernel-server": "0.5.0-beta.
|
|
256
|
+
"@astrale-os/kernel-client": "0.6.0-beta.85",
|
|
257
|
+
"@astrale-os/kernel-core": "0.9.0-beta.64",
|
|
258
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.46",
|
|
259
|
+
"@astrale-os/kernel-protocol": "0.5.0-beta.70",
|
|
260
|
+
"@astrale-os/kernel-server": "0.5.0-beta.72",
|
|
261
261
|
"@lucide/icons": "1.34.0",
|
|
262
262
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
263
263
|
"cross-spawn": "7.0.6",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"e2e": "node __e2e__/flagship/runner.mjs",
|
|
334
334
|
"typecheck": "tsgo --noEmit && pnpm run typecheck:workers && pnpm run typecheck:specs && pnpm run typecheck:types && pnpm run typecheck:tests && pnpm run typecheck:e2e && pnpm run typecheck:knowledge",
|
|
335
335
|
"typecheck:workers": "tsgo --noEmit -p tsconfig.workers.json",
|
|
336
|
-
"typecheck:specs": "tsgo --noEmit -p src/application/query/.spec/tsconfig.json && tsgo --noEmit -p src/platform/schema/.spec/tsconfig.json && tsgo --noEmit -p src/application/mutation/.spec/tsconfig.json && tsgo --noEmit -p src/tooling/cli/.spec/tsconfig.json
|
|
336
|
+
"typecheck:specs": "tsgo --noEmit -p src/application/query/.spec/tsconfig.json && tsgo --noEmit -p src/platform/schema/.spec/tsconfig.json && tsgo --noEmit -p src/application/mutation/.spec/tsconfig.json && tsgo --noEmit -p src/tooling/cli/.spec/tsconfig.json",
|
|
337
337
|
"typecheck:types": "tsgo --noEmit -p __tests__/tsconfig.types.json",
|
|
338
338
|
"typecheck:tests": "tsgo --noEmit -p tsconfig.test.json",
|
|
339
339
|
"typecheck:e2e": "tsgo --noEmit -p __e2e__/flagship/fixtures/tsconfig.v1.json && tsgo --noEmit -p __e2e__/flagship/fixtures/tsconfig.json",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PreparedArtifact } from '../../../../deployment/adapter/index.js';
|
|
2
|
-
import type { StableTargetAdapter } from '../stable-target-adapter.js';
|
|
3
|
-
export interface DevelopmentCandidate {
|
|
4
|
-
readonly adapter: StableTargetAdapter<object>;
|
|
5
|
-
readonly parameters: object;
|
|
6
|
-
readonly artifact: PreparedArtifact;
|
|
7
|
-
readonly secrets: Readonly<Record<string, string>>;
|
|
8
|
-
readonly sources: ReadonlySet<string>;
|
|
9
|
-
}
|
|
10
|
-
/** Rebuild one complete, isolated Environment candidate from authored sources. */
|
|
11
|
-
export declare class DevelopmentCandidateBuilder {
|
|
12
|
-
#private;
|
|
13
|
-
constructor(input: {
|
|
14
|
-
readonly configPath: string;
|
|
15
|
-
readonly projectDir: string;
|
|
16
|
-
readonly environment: string;
|
|
17
|
-
readonly runtimePath: string;
|
|
18
|
-
readonly overrideSecrets?: Readonly<Record<string, string>>;
|
|
19
|
-
});
|
|
20
|
-
prepare(signal: AbortSignal): Promise<DevelopmentCandidate>;
|
|
21
|
-
}
|
|
22
|
-
export declare function discoverRuntimePath(configPath: string): Promise<string>;
|
|
23
|
-
export declare function sameEnvironment(current: DevelopmentCandidate, candidate: DevelopmentCandidate): boolean;
|
|
24
|
-
/** Identify a rebuilt candidate that cannot change provider state. */
|
|
25
|
-
export declare function sameDeploymentCandidate(current: DevelopmentCandidate, candidate: DevelopmentCandidate): boolean;
|