@astrale-os/cli 1.0.0-beta.22 → 1.0.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.
Files changed (33) hide show
  1. package/dist/astrale.js +2759 -625
  2. package/dist/public/connect-core.js +4 -4
  3. package/dist/types/admin/contract.d.ts +2 -2
  4. package/package.json +5 -4
  5. package/src/admin/contract.ts +3 -2
  6. package/src/commands/__tests__/read-commands.test.ts +56 -0
  7. package/src/commands/__tests__/view.test.ts +1 -2
  8. package/src/commands/introspect.ts +8 -9
  9. package/src/ui/.spec/architecture.md +8 -7
  10. package/src/ui/.spec/laws.ts +7 -0
  11. package/src/ui/__tests__/ui.test.ts +357 -5
  12. package/src/ui/lock.ts +1 -1
  13. package/src/ui/operations.ts +89 -19
  14. package/src/ui/project.ts +114 -0
  15. package/src/ui/release.ts +9 -2
  16. package/studio/client/dist/assets/{index-7YHdeCxp.js → index-OeJK1TjG.js} +2 -2
  17. package/studio/client/dist/assets/{schema-studio-CABpTfvH.js → schema-studio-DRdfu_cQ.js} +2 -2
  18. package/studio/client/dist/index.html +1 -1
  19. package/studio/package.json +3 -3
  20. package/studio/server/cli-consumers.test.ts +0 -1
  21. package/studio/server/introspect/anatomy/views.ts +1 -2
  22. package/studio/server/introspect/anatomy-extras.test.ts +3 -14
  23. package/studio/server/introspect/canonical-schema.test.ts +1 -1
  24. package/studio/server/introspect/canonical-schema.ts +0 -4
  25. package/studio/server/introspect/diff.test.ts +10 -2
  26. package/studio/server/introspect/diff.ts +1 -9
  27. package/studio/server/introspect/runtime.test.ts +1 -1
  28. package/studio/server/introspect/schema-ir-json.test.ts +12 -1
  29. package/studio/server/introspect/schema-ir-json.ts +1 -1
  30. package/studio/server/views/target.test.ts +1 -2
  31. package/studio/shared/contracts/schema.ts +1 -3
  32. package/studio/tsconfig.json +2 -1
  33. package/viewer/dist/main.js +13 -13
@@ -8242,14 +8242,14 @@ function isPidAlive(pid) {
8242
8242
  function sleep(milliseconds) {
8243
8243
  return new Promise((resolve) => setTimeout(resolve, milliseconds));
8244
8244
  }
8245
- // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.12/node_modules/@astrale-os/kernel-dsl/dist/value/limits.js
8245
+ // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.13/node_modules/@astrale-os/kernel-dsl/dist/value/limits.js
8246
8246
  var defaultLimits = Object.freeze({
8247
8247
  maxBytes: 16 * 1024 * 1024,
8248
8248
  maxDepth: 64,
8249
8249
  maxMembers: 1e5,
8250
8250
  maxStringBytes: 1024 * 1024
8251
8251
  });
8252
- // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.12/node_modules/@astrale-os/kernel-dsl/dist/value/canonical.js
8252
+ // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.13/node_modules/@astrale-os/kernel-dsl/dist/value/canonical.js
8253
8253
  var encoder2 = new TextEncoder;
8254
8254
  // node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
8255
8255
  var CharacterCodes;
@@ -8429,7 +8429,7 @@ var ParseErrorCode;
8429
8429
  ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
8430
8430
  })(ParseErrorCode || (ParseErrorCode = {}));
8431
8431
 
8432
- // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.12/node_modules/@astrale-os/kernel-dsl/dist/value/decode.js
8432
+ // node_modules/.pnpm/@astrale-os+kernel-dsl@0.2.0-beta.13/node_modules/@astrale-os/kernel-dsl/dist/value/decode.js
8433
8433
  var decoder2 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
8434
8434
  // node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
8435
8435
  var exports_external = {};
@@ -23659,7 +23659,7 @@ var log = {
23659
23659
  dim: (msg) => console.log(source_default.dim(msg))
23660
23660
  };
23661
23661
  var IS_CI = !!(process.env.CI || process.env.CONTINUOUS_INTEGRATION || process.env.NO_SPINNER);
23662
- // node_modules/.pnpm/@astrale-os+kernel-core@0.9.0-beta.15/node_modules/@astrale-os/kernel-core/dist/dns-label.js
23662
+ // node_modules/.pnpm/@astrale-os+kernel-core@0.9.0-beta.16/node_modules/@astrale-os/kernel-core/dist/dns-label.js
23663
23663
  var DNS_LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
23664
23664
  function isDnsLabel(value) {
23665
23665
  return DNS_LABEL_RE.test(value);
@@ -1,5 +1,5 @@
1
1
  import type { Input } from '@astrale-os/sdk/client';
2
- import type { ClientSession } from '@astrale-os/sdk/client/session';
2
+ import type { ClientSession, SessionRequestOptions } from '@astrale-os/sdk/client/session';
3
3
  import type { ClassRef } from '@astrale-os/sdk/schema';
4
4
  import { Path } from '@astrale-os/sdk/graph/path';
5
5
  export declare const AdminContract: Readonly<{
@@ -23,4 +23,4 @@ export declare const AdminContract: Readonly<{
23
23
  }>;
24
24
  }>;
25
25
  /** Invoke one stable Admin instance Method without schema discovery or reflection. */
26
- export declare function callAdminMethod(session: ClientSession, receiver: Path, method: string, input: Input): Promise<unknown>;
26
+ export declare function callAdminMethod(session: ClientSession, receiver: Path, method: string, input: Input, options?: SessionRequestOptions): Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/cli",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.24",
4
4
  "description": "Astrale CLI — connect to existing Astrale kernels",
5
5
  "keywords": [
6
6
  "astrale",
@@ -57,13 +57,14 @@
57
57
  "jose": "^6.1.3",
58
58
  "ora": "^9.0.0",
59
59
  "ts-morph": "^25.0.1",
60
+ "tsconfig-paths": "4.2.0",
60
61
  "yaml": "^2.8.2",
61
62
  "zod": "^4.4.3"
62
63
  },
63
64
  "devDependencies": {
64
65
  "@astrale-os/ox": ">=0.1.3 <1.0.0",
65
- "@astrale-os/sdk": "0.5.0-beta.50",
66
- "@astrale-os/shell": "0.4.2-beta.5",
66
+ "@astrale-os/sdk": "0.5.0-beta.51",
67
+ "@astrale-os/shell": "0.4.2-beta.6",
67
68
  "@astrale/commitlint-config": "npm:@jsr/astrale__commitlint-config@~2.0.1",
68
69
  "@commitlint/cli": "21.2.2",
69
70
  "@commitlint/config-conventional": "21.2.2",
@@ -98,7 +99,7 @@
98
99
  "scripts": {
99
100
  "build": "bun scripts/build.ts",
100
101
  "package:check": "pnpm run typecheck && pnpm run test && pnpm run build && node scripts/verify-public-exports.mjs && node scripts/verify-public-dependency-boundary.mjs",
101
- "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json && tsc --noEmit -p viewer && pnpm --dir studio run typecheck",
102
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json && tsc --noEmit -p tsconfig.scripts.json && tsc --noEmit -p viewer && pnpm --dir studio run typecheck",
102
103
  "lint": "oxlint .",
103
104
  "lint:fix": "oxlint --fix .",
104
105
  "format": "pnpm exec oxfmt --write .",
@@ -1,5 +1,5 @@
1
1
  import type { Input } from '@astrale-os/sdk/client'
2
- import type { ClientSession } from '@astrale-os/sdk/client/session'
2
+ import type { ClientSession, SessionRequestOptions } from '@astrale-os/sdk/client/session'
3
3
  import type { ClassRef } from '@astrale-os/sdk/schema'
4
4
 
5
5
  import { call } from '@astrale-os/sdk/client'
@@ -41,6 +41,7 @@ export function callAdminMethod(
41
41
  receiver: Path,
42
42
  method: string,
43
43
  input: Input,
44
+ options?: SessionRequestOptions,
44
45
  ): Promise<unknown> {
45
- return session.call(call(Path.instanceMethod(receiver, method), input))
46
+ return session.call(call(Path.instanceMethod(receiver, method), input), options)
46
47
  }
@@ -6,6 +6,12 @@ type GraphContext = {
6
6
  getOrThrow: typeof getOrThrowMock
7
7
  mutate: typeof mutateMock
8
8
  }
9
+ session: {
10
+ schema: {
11
+ inspect: typeof inspectMock
12
+ bundle: typeof bundleMock
13
+ }
14
+ }
9
15
  }
10
16
 
11
17
  type RunOpts = {
@@ -36,6 +42,8 @@ let mutations: unknown[] = []
36
42
  let queryResult: unknown
37
43
  let getResult: unknown
38
44
  let mutationResult: unknown
45
+ let inspectResult: unknown
46
+ let bundleResult: unknown
39
47
  let selfFailure: unknown
40
48
  let selfContexts: unknown[] = []
41
49
 
@@ -51,6 +59,8 @@ const mutateMock = mock(async (mutation: unknown) => {
51
59
  mutations.push(mutation)
52
60
  return mutationResult
53
61
  })
62
+ const inspectMock = mock(async (_origin: string) => inspectResult)
63
+ const bundleMock = mock(async (_origin: string) => bundleResult)
54
64
  const expandSelfInPathMock = mock(async (path: string, context: unknown) => {
55
65
  selfContexts.push(context)
56
66
  if (selfFailure !== undefined) throw selfFailure
@@ -65,6 +75,7 @@ const expandSelfInPathMock = mock(async (path: string, context: unknown) => {
65
75
  const withSelfHintMock = mock(async (action: () => Promise<unknown>) => action())
66
76
  const commandContext = {
67
77
  graph: { query: queryMock, getOrThrow: getOrThrowMock, mutate: mutateMock },
78
+ session: { schema: { inspect: inspectMock, bundle: bundleMock } },
68
79
  }
69
80
  const runKernelCommandMock = mock(async (run: RunOpts) => {
70
81
  const result = await run.fn(commandContext)
@@ -93,11 +104,22 @@ beforeEach(() => {
93
104
  }
94
105
  getResult = undefined
95
106
  mutationResult = { createdNodes: {} }
107
+ inspectResult = {
108
+ origin: 'notes.example.dev',
109
+ revision: 'notes-v1',
110
+ generation: 'sha256:generation',
111
+ }
112
+ bundleResult = {
113
+ domain: inspectResult,
114
+ bundle: { origin: 'notes.example.dev', revision: 'notes-v1' },
115
+ }
96
116
  selfFailure = undefined
97
117
  selfContexts = []
98
118
  queryMock.mockClear()
99
119
  getOrThrowMock.mockClear()
100
120
  mutateMock.mockClear()
121
+ inspectMock.mockClear()
122
+ bundleMock.mockClear()
101
123
  expandSelfInPathMock.mockClear()
102
124
  withSelfHintMock.mockClear()
103
125
  runKernelCommandMock.mockClear()
@@ -280,6 +302,40 @@ describe('get command', () => {
280
302
  })
281
303
  })
282
304
 
305
+ describe('introspect command', () => {
306
+ test('uses the split SDK Schema API without recreating the retired introspection request', async () => {
307
+ const { introspectCommand } = await import('../introspect')
308
+
309
+ await introspectCommand(
310
+ 'notes.example.dev',
311
+ { json: true },
312
+ {
313
+ runKernelCommand: runKernelCommandMock as never,
314
+ },
315
+ )
316
+
317
+ expect(inspectMock).toHaveBeenCalledWith('notes.example.dev')
318
+ expect(bundleMock).not.toHaveBeenCalled()
319
+ expect(JSON.parse(stdout)).toEqual(inspectResult)
320
+ })
321
+
322
+ test('requests the immutable bundle only when explicitly selected', async () => {
323
+ const { introspectCommand } = await import('../introspect')
324
+
325
+ await introspectCommand(
326
+ 'notes.example.dev',
327
+ { json: true, bundle: true },
328
+ {
329
+ runKernelCommand: runKernelCommandMock as never,
330
+ },
331
+ )
332
+
333
+ expect(bundleMock).toHaveBeenCalledWith('notes.example.dev')
334
+ expect(inspectMock).not.toHaveBeenCalled()
335
+ expect(JSON.parse(stdout)).toEqual(bundleResult)
336
+ })
337
+ })
338
+
283
339
  describe('mutate command', () => {
284
340
  /** @evidence TEST-CLI-MUTATE-DISPATCHES-CANONICAL-V3 */
285
341
  test('admits authoring input and dispatches one canonical Mutation V3 document', async () => {
@@ -52,7 +52,6 @@ const resolved = [
52
52
  kind: 'definition' as const,
53
53
  definitions: [{ origin: 'ai-gateway.astrale.ai', kind: 'class' as const, name: 'Model' }],
54
54
  },
55
- auth: 'required' as const,
56
55
  },
57
56
  }),
58
57
  route({
@@ -62,7 +61,7 @@ const resolved = [
62
61
  issuer: 'https://ai-gateway.astrale.ai',
63
62
  etag: `sha256:${'c'.repeat(64)}`,
64
63
  revision: `sha256:${'d'.repeat(64)}`,
65
- declaration: { target: { kind: 'domain' as const }, auth: 'public' as const },
64
+ declaration: { target: { kind: 'domain' as const } },
66
65
  }),
67
66
  ]
68
67
 
@@ -38,14 +38,13 @@ export async function introspectCommand(
38
38
  opts,
39
39
  label: `Introspect ${origin}`,
40
40
  fn: async ({ session }) => {
41
- const includeBundle = wantsCallable || opts.bundle === true
42
- const result = await readInstalledDomain(session.schema, origin, includeBundle)
43
41
  if (wantsCallable) {
44
- const described = describeCallableFromBundle(path, (result as DomainBundle).bundle)
42
+ const result = await readInstalledDomain(session.schema, origin, true)
43
+ const described = describeCallableFromBundle(path, result.bundle)
45
44
  if (described === undefined) throw missingCallableDescription(path.raw)
46
45
  return described
47
46
  }
48
- return result
47
+ return readInstalledDomain(session.schema, origin, opts.bundle === true)
49
48
  },
50
49
  format: (value, format) => output(value, format),
51
50
  })
@@ -110,11 +109,11 @@ export default {
110
109
  description: 'Read installed Domain schema from the Kernel Schema syscall',
111
110
  afterHelpText: `
112
111
  Behavior:
113
- Calls the public Kernel introspect syscall for one installed Domain.
114
- A bare origin (kernel.astrale.ai or /:kernel.astrale.ai) prints installation
115
- state, target, source, readiness, and capabilities. --bundle includes the
116
- schema bundle. A method or Function Path projects that callable's
117
- input/output from the installed bundle.
112
+ Calls the public SDK Schema API for one installed Domain. A bare origin
113
+ (kernel.astrale.ai or /:kernel.astrale.ai) prints its exact revision,
114
+ generation, publication, readiness, capabilities, and bindings. --bundle
115
+ includes the schema bundle. A method or Function Path projects that
116
+ callable's input/output from the installed bundle.
118
117
 
119
118
  Examples:
120
119
  $ astrale introspect kernel.astrale.ai
@@ -4,10 +4,11 @@ This private CLI owner manages an existing local React project. It does not conn
4
4
  does not add React, Base UI, Tailwind, shadcn, or the UI runtime to the installed CLI dependency
5
5
  graph.
6
6
 
7
- One registry operation resolves one immutable UI commit. Package compatibility and registry reads
8
- use that commit. Patterns and blocks invoke the release-qualified shadcn CLI on demand through the
9
- detected package manager. Released themes copy the exact admitted embedded CSS directly, while a
10
- local playground export is admitted and copied without registry or shadcn. Both theme paths install
11
- consumer-owned source and activate it through one project-relative CSS
12
- import, and complete application writes before the lock advances. Dry-run, list, and doctor do not
13
- claim a file mutation.
7
+ One registry operation resolves one immutable UI commit. During the V1 prerelease, operations
8
+ without an explicit version resolve the npm `beta` dist-tag; the legacy `latest` channel is not a V1
9
+ source. Package compatibility and registry reads use that commit. Patterns and blocks invoke the
10
+ release-qualified shadcn CLI on demand through the detected package manager. Released themes copy
11
+ the exact admitted embedded CSS directly, while a local playground export is admitted and copied
12
+ without registry or shadcn. Both theme paths install consumer-owned source and activate it through
13
+ one project-relative CSS import, and complete application writes before the lock advances. Dry-run,
14
+ list, and doctor do not claim a file mutation.
@@ -1,5 +1,12 @@
1
1
  import { defineLaw } from '@astrale-os/spec/authoring'
2
2
 
3
+ export const CLI_UI_BETA_DEFAULT = defineLaw({
4
+ id: 'CLI-UI-BETA-DEFAULT',
5
+ statement:
6
+ 'Until the UI V1 channel is promoted, an operation without an explicit version resolves the npm beta dist-tag and never the legacy latest dist-tag.',
7
+ tests: [{ file: '../__tests__/ui.test.ts', id: 'TEST-CLI-UI-BETA-DEFAULT' }],
8
+ })
9
+
3
10
  export const CLI_UI_ONE_SNAPSHOT = defineLaw({
4
11
  id: 'CLI-UI-ONE-SNAPSHOT',
5
12
  statement: