@astrale-os/cli 1.0.0-beta.2 → 1.0.0-beta.20
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 +16 -1
- package/dist/astrale.js +51105 -58057
- package/dist/public/connect-core.js +2085 -30702
- package/dist/public/keys/index.js +884 -29476
- package/dist/public/paths/index.js +13101 -41452
- package/dist/types/admin/contract.d.ts +26 -0
- package/dist/types/admin/instance/client.d.ts +20 -0
- package/dist/types/admin/instance/index.d.ts +2 -0
- package/dist/types/admin/instance/model.d.ts +6 -10
- package/dist/types/connection/auth.d.ts +3 -0
- package/dist/types/connection/call.d.ts +3 -0
- package/dist/types/connection/command.d.ts +27 -0
- package/dist/types/connection/credential.d.ts +14 -0
- package/dist/types/connection/errors.d.ts +1 -0
- package/dist/types/connection/exchange.d.ts +9 -0
- package/dist/types/connection/failure/classify.d.ts +2 -0
- package/dist/types/connection/failure/index.d.ts +5 -0
- package/dist/types/connection/failure/model.d.ts +25 -0
- package/dist/types/connection/failure/render.d.ts +3 -0
- package/dist/types/connection/index.d.ts +8 -0
- package/dist/types/connection/reasons.d.ts +37 -0
- package/dist/types/connection/self.d.ts +37 -0
- package/dist/types/connection/session.d.ts +31 -0
- package/dist/types/connection/target.d.ts +38 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/lib/admin-instance.d.ts +17 -0
- package/dist/types/lib/admin-target.d.ts +11 -36
- package/dist/types/lib/config.d.ts +7 -59
- package/dist/types/lib/failure-debug.d.ts +1 -0
- package/dist/types/lib/idp.d.ts +25 -173
- package/dist/types/lib/instance-target.d.ts +1 -1
- package/dist/types/lib/instance.d.ts +30 -88
- package/dist/types/lib/log.d.ts +5 -3
- package/dist/types/lib/output.d.ts +1 -1
- package/dist/types/lib/proc.d.ts +43 -0
- package/dist/types/lib/self.d.ts +9 -0
- package/dist/types/lib/update.d.ts +109 -0
- package/dist/types/lib/validation.d.ts +4 -1
- package/package.json +15 -20
- package/src/__tests__/fixtures/publication.ts +20 -0
- package/src/admin/.spec/architecture.md +12 -5
- package/src/admin/__tests__/fixture.ts +25 -0
- package/src/admin/catalog/.spec/api.d.ts +1 -3
- package/src/admin/catalog/.spec/architecture.md +5 -4
- package/src/admin/catalog/__tests__/client.test.ts +143 -69
- package/src/admin/catalog/client.ts +40 -54
- package/src/admin/catalog/model.ts +3 -4
- package/src/admin/contract.ts +46 -0
- package/src/admin/graph/.spec/api.d.ts +4 -10
- package/src/admin/graph/nodes.ts +1 -1
- package/src/admin/instance/.spec/api.d.ts +5 -9
- package/src/admin/instance/.spec/architecture.md +7 -7
- package/src/admin/instance/__tests__/client.test.ts +157 -175
- package/src/admin/instance/client.ts +39 -128
- package/src/admin/instance/index.ts +1 -2
- package/src/admin/instance/model.ts +12 -18
- package/src/commands/__tests__/admin-instance.test.ts +11 -8
- package/src/commands/__tests__/call-describe.test.ts +46 -33
- package/src/commands/__tests__/call.test.ts +34 -0
- package/src/commands/__tests__/domain-install-operation.test.ts +7 -22
- package/src/commands/__tests__/domain-install-owned.test.ts +1 -1
- package/src/commands/__tests__/domain-list.test.ts +5 -25
- package/src/commands/__tests__/install-direct.test.ts +115 -8
- package/src/commands/__tests__/install-identity-override.test.ts +3 -14
- package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
- package/src/commands/__tests__/instance-status.test.ts +139 -0
- package/src/commands/__tests__/introspect-parse.test.ts +80 -1
- package/src/commands/__tests__/logs.test.ts +250 -2
- package/src/commands/__tests__/read-commands.test.ts +62 -10
- package/src/commands/__tests__/token-ttl.test.ts +49 -4
- package/src/commands/__tests__/update.test.ts +25 -3
- package/src/commands/__tests__/view.test.ts +49 -0
- package/src/commands/call-describe.ts +60 -68
- package/src/commands/call.ts +71 -59
- package/src/commands/domain/install.ts +54 -35
- package/src/commands/domain/list.ts +1 -1
- package/src/commands/domain/publish.ts +14 -11
- package/src/commands/domain/uninstall.ts +2 -2
- package/src/commands/get.ts +14 -15
- package/src/commands/identity/__tests__/register.test.ts +3 -3
- package/src/commands/identity/register.ts +5 -4
- package/src/commands/instance/create.ts +8 -16
- package/src/commands/instance/delete.ts +12 -9
- package/src/commands/instance/list.ts +2 -2
- package/src/commands/instance/status.ts +66 -20
- package/src/commands/instance/use.ts +16 -12
- package/src/commands/introspect.ts +48 -35
- package/src/commands/logs.ts +123 -33
- package/src/commands/mutate.ts +6 -5
- package/src/commands/query.ts +35 -32
- package/src/commands/token.ts +42 -27
- package/src/commands/ui/__tests__/commands.test.ts +152 -0
- package/src/commands/ui/add.ts +51 -0
- package/src/commands/ui/doctor.ts +13 -0
- package/src/commands/ui/init.ts +38 -0
- package/src/commands/ui/list.ts +26 -0
- package/src/commands/ui/preset-apply.ts +19 -0
- package/src/commands/ui/preset-list.ts +12 -0
- package/src/commands/ui/shared.ts +25 -0
- package/src/commands/update.ts +31 -11
- package/src/commands/view.ts +82 -37
- package/src/connection/.spec/api.d.ts +7 -8
- package/src/connection/.spec/architecture.md +5 -4
- package/src/connection/.spec/flows/session.ts +2 -2
- package/src/connection/.spec/laws/connection.ts +6 -2
- package/src/connection/.spec/layout.ts +1 -0
- package/src/connection/__tests__/credential.test.ts +20 -1
- package/src/connection/__tests__/errors.test.ts +27 -20
- package/src/connection/__tests__/exchange.test.ts +30 -1
- package/src/connection/__tests__/failure-fixtures.ts +39 -0
- package/src/connection/__tests__/failure-safety.test.ts +75 -0
- package/src/connection/__tests__/self.test.ts +31 -11
- package/src/connection/__tests__/session.test.ts +3 -3
- package/src/connection/__tests__/target.test.ts +1 -0
- package/src/connection/auth.ts +13 -0
- package/src/connection/call.ts +1 -1
- package/src/connection/credential.ts +2 -2
- package/src/connection/errors.ts +1 -355
- package/src/connection/exchange.ts +47 -23
- package/src/connection/failure/classify.ts +110 -0
- package/src/connection/failure/index.ts +18 -0
- package/src/connection/failure/model.ts +28 -0
- package/src/connection/failure/render.ts +116 -0
- package/src/connection/reasons.ts +16 -0
- package/src/connection/self.ts +39 -21
- package/src/connection/session.ts +19 -8
- package/src/errors.ts +3 -2
- package/src/graph/.spec/api.d.ts +12 -5
- package/src/graph/.spec/layout.ts +9 -1
- package/src/graph/__tests__/mutation.test.ts +2 -2
- package/src/graph/__tests__/query.test.ts +25 -6
- package/src/graph/class.ts +30 -0
- package/src/graph/index.ts +1 -0
- package/src/graph/query.ts +21 -32
- package/src/identity/.spec/api.d.ts +2 -2
- package/src/identity/__tests__/registration.test.ts +1 -1
- package/src/identity/registration.ts +3 -3
- package/src/keys/__tests__/keys.test.ts +4 -0
- package/src/keys/credential.ts +1 -0
- package/src/lib/__tests__/admin-target.test.ts +12 -0
- package/src/lib/__tests__/binary.test.ts +16 -1
- package/src/lib/__tests__/command-dx.test.ts +1 -1
- package/src/lib/__tests__/domain-publication.test.ts +10 -16
- package/src/lib/__tests__/idp.test.ts +34 -4
- package/src/lib/__tests__/instance-candidates.test.ts +1 -3
- package/src/lib/__tests__/instance-target.test.ts +7 -39
- package/src/lib/__tests__/log-errors.test.ts +64 -0
- package/src/lib/__tests__/studio-server-deps.test.ts +1 -1
- package/src/lib/__tests__/update.test.ts +264 -11
- package/src/lib/__tests__/view-assets.test.ts +14 -0
- package/src/lib/__tests__/view-external-open-intent.test.ts +150 -0
- package/src/lib/__tests__/view-external-open-origins.test.ts +27 -0
- package/src/lib/__tests__/view-open-intent.test.ts +0 -2
- package/src/lib/__tests__/view-server.test.ts +26 -3
- package/src/lib/__tests__/view-session.test.ts +2 -1
- package/src/lib/admin-instance.ts +14 -8
- package/src/lib/admin-target.ts +21 -2
- package/src/lib/binary.ts +22 -5
- package/src/lib/command-dx.ts +9 -9
- package/src/lib/domain-publication.ts +9 -7
- package/src/lib/failure-debug.ts +26 -0
- package/src/lib/idp.ts +34 -3
- package/src/lib/instance-candidates.ts +2 -2
- package/src/lib/instance-target.ts +3 -14
- package/src/lib/instance.ts +16 -11
- package/src/lib/log.ts +16 -9
- package/src/lib/output.ts +1 -1
- package/src/lib/proc.ts +7 -2
- package/src/lib/provision-instance.ts +34 -57
- package/src/lib/update.ts +298 -45
- package/src/lib/validation.ts +2 -2
- package/src/lib/view/assets.ts +11 -2
- package/src/lib/view/external-open-intent.ts +41 -0
- package/src/lib/view/external-open-origins.ts +37 -0
- package/src/lib/view/host-capabilities.ts +17 -0
- package/src/lib/view/resolve.ts +1 -1
- package/src/lib/view/server.ts +18 -3
- package/src/lib/view/session.ts +2 -0
- package/src/program/.spec/api.d.ts +1 -0
- package/src/program/__tests__/program.test.ts +163 -6
- package/src/program/argv.ts +14 -0
- package/src/program/build.ts +26 -4
- package/src/program/command.ts +1 -0
- package/src/program/index.ts +1 -0
- package/src/program/registry.ts +2 -1
- package/src/setup/__tests__/instance-step.test.ts +27 -10
- package/src/setup/steps/instance.ts +22 -15
- package/src/telemetry/__tests__/recorder.test.ts +1 -0
- package/src/telemetry/recorder.ts +9 -1
- package/src/ui/.spec/api.d.ts +14 -0
- package/src/ui/.spec/architecture.md +10 -0
- package/src/ui/.spec/laws.ts +36 -0
- package/src/ui/.spec/layout.ts +16 -0
- package/src/ui/__tests__/ui.test.ts +981 -0
- package/src/ui/index.ts +13 -0
- package/src/ui/lock.ts +87 -0
- package/src/ui/model.ts +83 -0
- package/src/ui/operations.ts +710 -0
- package/src/ui/project.ts +219 -0
- package/src/ui/release.ts +321 -0
- package/src/ui/runner.ts +18 -0
- package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
- package/studio/client/dist/assets/index-7YHdeCxp.js +81 -0
- package/studio/client/dist/assets/index-C0FAnwNw.css +2 -0
- package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +1 -0
- package/studio/client/dist/assets/schema-studio-CABpTfvH.js +8 -0
- package/studio/client/dist/index.html +3 -2
- package/studio/package.json +7 -13
- package/studio/server/agent/ask.test.ts +1 -1
- package/studio/server/agent/bridge/grant.test.ts +1 -1
- package/studio/server/agent/bridge/routes.test.ts +1 -1
- package/studio/server/agent/harness/claude/adapter.test.ts +15 -5
- package/studio/server/agent/harness/gateway/token.test.ts +1 -1
- package/studio/server/agent/harness/gateway/token.ts +3 -3
- package/studio/server/agent/prompts/anchors.test.ts +32 -36
- package/studio/server/agent/prompts/anchors.ts +20 -49
- package/studio/server/agent/prompts/system.test.ts +3 -2
- package/studio/server/agent/prompts/system.ts +3 -3
- package/studio/server/agent/routes.test.ts +1 -1
- package/studio/server/agent/run/coordinator.test.ts +1 -1
- package/studio/server/api/canvas.ts +0 -1
- package/studio/server/api-agent-loadout.test.ts +1 -1
- package/studio/server/api.test.ts +1 -1
- package/studio/server/cache.test.ts +23 -12
- package/studio/server/cache.ts +12 -15
- package/studio/server/domain.test.ts +50 -68
- package/studio/server/domain.ts +82 -63
- package/studio/server/handoff/copy.ts +1 -1
- package/studio/server/index.ts +1 -1
- package/studio/server/instances/probe.test.ts +1 -1
- package/studio/server/introspect/anatomy/views/routes.ts +46 -37
- package/studio/server/introspect/anatomy/views.ts +9 -14
- package/studio/server/introspect/anatomy-extras.test.ts +26 -42
- package/studio/server/introspect/anatomy.test.ts +22 -14
- package/studio/server/introspect/anatomy.ts +6 -9
- package/studio/server/introspect/bundle.ts +0 -3
- package/studio/server/introspect/canonical-schema.test.ts +94 -389
- package/studio/server/introspect/canonical-schema.ts +227 -457
- package/studio/server/introspect/core-extractor.ts +18 -127
- package/studio/server/introspect/core.ts +1 -2
- package/studio/server/introspect/diff.test.ts +11 -7
- package/studio/server/introspect/diff.ts +18 -55
- package/studio/server/introspect/extractor.ts +22 -117
- package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
- package/studio/server/introspect/overlay.test.ts +26 -54
- package/studio/server/introspect/overlay.ts +10 -37
- package/studio/server/introspect/revision.test.ts +1 -1
- package/studio/server/introspect/revision.ts +1 -1
- package/studio/server/introspect/runtime.test.ts +65 -183
- package/studio/server/introspect/runtime.ts +8 -25
- package/studio/server/introspect/schema-ir-json.test.ts +70 -0
- package/studio/server/introspect/schema-ir-json.ts +38 -68
- package/studio/server/introspect/schema-refs.test.ts +43 -88
- package/studio/server/introspect/schema-refs.ts +14 -49
- package/studio/server/introspect/source-overlay/handlers.ts +116 -636
- package/studio/server/introspect/source-overlay/kernel-calls.ts +0 -3
- package/studio/server/introspect/source-overlay/spans.ts +15 -45
- package/studio/server/state/baseline.test.ts +14 -9
- package/studio/server/state/baseline.ts +3 -5
- package/studio/server/state/visibility.ts +1 -5
- package/studio/server/views/model.ts +3 -3
- package/studio/server/views/target.test.ts +17 -74
- package/studio/server/views/target.ts +24 -50
- package/studio/server/watch.test.ts +11 -11
- package/studio/server/watch.ts +8 -4
- package/studio/server/workspace-watch.ts +2 -2
- package/studio/shared/contracts/schema.ts +38 -107
- package/studio/shared/contracts/surface.test.ts +13 -15
- package/studio/shared/contracts/workspace.ts +2 -11
- package/studio/shared/schema/identity.test.ts +20 -44
- package/studio/shared/schema/identity.ts +9 -23
- package/viewer/dist/main.js +30 -51
- package/.check-workspace.cjs +0 -40
- package/src/admin/binding.ts +0 -168
- package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
- package/studio/client/dist/assets/elk-api-lwhFo7vB.js +0 -1
- package/studio/client/dist/assets/index-B-c-smo9.js +0 -8
- package/studio/client/dist/assets/index-BckHuAWk.js +0 -81
- package/studio/client/dist/assets/index-C4aNQ6dz.css +0 -1
- package/studio/client/dist/assets/index-ChOr3yP0.css +0 -1
- package/studio/server/introspect/anatomy/views/legacy.ts +0 -232
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Domain Studio</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-7YHdeCxp.js"></script>
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C0FAnwNw.css">
|
|
9
10
|
</head>
|
|
10
11
|
<body>
|
|
11
12
|
<div id="root"></div>
|
package/studio/package.json
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"typecheck": "tsgo --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@astrale-os/
|
|
24
|
+
"@astrale-os/sdk": "0.5.0-beta.50",
|
|
25
|
+
"@astrale-os/shell": "0.4.2-beta.5",
|
|
25
26
|
"@dagrejs/dagre": "^3.0.0",
|
|
26
27
|
"@radix-ui/react-collapsible": "^1.1.0",
|
|
27
28
|
"@radix-ui/react-dialog": "^1.1.6",
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"clsx": "^2.1.1",
|
|
40
41
|
"cmdk": "^1.1.1",
|
|
41
42
|
"elkjs": "^0.11.1",
|
|
42
|
-
"lucide-react": "^
|
|
43
|
+
"lucide-react": "^1.31.0",
|
|
43
44
|
"react": "^19.2.0",
|
|
44
45
|
"react-dom": "^19.2.0",
|
|
45
46
|
"react-markdown": "^10.1.0",
|
|
@@ -55,18 +56,11 @@
|
|
|
55
56
|
"@types/node": "^20.19.43",
|
|
56
57
|
"@types/react": "^19.2.0",
|
|
57
58
|
"@types/react-dom": "^19.2.0",
|
|
58
|
-
"@
|
|
59
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
60
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
59
61
|
"bun-types": "^1.4.0",
|
|
60
62
|
"tailwindcss": "^4.0.6",
|
|
61
|
-
"typescript": "
|
|
62
|
-
"vite": "^
|
|
63
|
-
},
|
|
64
|
-
"overrides": {
|
|
65
|
-
"@astrale-os/kernel-client": "file:../vendor/kernel/astrale-os-kernel-client-0.6.0-beta.3.tgz",
|
|
66
|
-
"@astrale-os/kernel-core": "file:../vendor/kernel/astrale-os-kernel-core-0.9.0-beta.2.tgz",
|
|
67
|
-
"@astrale-os/kernel-dsl": "file:../vendor/kernel/astrale-os-kernel-dsl-0.2.0-beta.2.tgz",
|
|
68
|
-
"@astrale-os/kernel-protocol": "file:../vendor/kernel/astrale-os-kernel-protocol-0.5.0-beta.2.tgz",
|
|
69
|
-
"@astrale-os/kernel-server": "file:../vendor/kernel/astrale-os-kernel-server-0.5.0-beta.3.tgz",
|
|
70
|
-
"@astrale-os/sdk": "file:../vendor/astrale-os-sdk-0.5.0-beta.3.tgz"
|
|
63
|
+
"typescript": "~6.0.3",
|
|
64
|
+
"vite": "^8.2.1"
|
|
71
65
|
}
|
|
72
66
|
}
|
|
@@ -35,7 +35,7 @@ test('Ask uses the active harness model and matching per-harness conversation',
|
|
|
35
35
|
roots.push(root)
|
|
36
36
|
mkdirSync(join(root, 'schema'))
|
|
37
37
|
writeFileSync(join(root, 'astrale.config.ts'), 'export default {}\n')
|
|
38
|
-
writeFileSync(join(root, '
|
|
38
|
+
writeFileSync(join(root, 'application.ts'), 'export default {}\n')
|
|
39
39
|
writeFileSync(join(root, 'schema/index.ts'), 'export const Test = {}\n')
|
|
40
40
|
const handle = registerDomain(root)!
|
|
41
41
|
domainIds.push(handle.id)
|
|
@@ -18,7 +18,7 @@ function domain(root: string, id: string): DomainHandle {
|
|
|
18
18
|
id,
|
|
19
19
|
root,
|
|
20
20
|
configFile: join(root, 'astrale.config.ts'),
|
|
21
|
-
|
|
21
|
+
applicationFile: join(root, 'application.ts'),
|
|
22
22
|
schemaDirName: 'schema',
|
|
23
23
|
schemaDir: join(root, 'schema'),
|
|
24
24
|
schemaIndex: join(root, 'schema/index.ts'),
|
|
@@ -20,7 +20,7 @@ function domain(root: string, id: string): DomainHandle {
|
|
|
20
20
|
id,
|
|
21
21
|
root,
|
|
22
22
|
configFile: join(root, 'astrale.config.ts'),
|
|
23
|
-
|
|
23
|
+
applicationFile: join(root, 'application.ts'),
|
|
24
24
|
schemaDirName: 'schema',
|
|
25
25
|
schemaDir: join(root, 'schema'),
|
|
26
26
|
schemaIndex: join(root, 'schema/index.ts'),
|
|
@@ -323,10 +323,20 @@ test('Claude Ask cancellation kills the entire stubborn subprocess group', async
|
|
|
323
323
|
onDelta: () => {},
|
|
324
324
|
})
|
|
325
325
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
let pids: { parent: number; child: number } | undefined
|
|
327
|
+
await waitFor(() => {
|
|
328
|
+
if (!existsSync(pidLog)) return false
|
|
329
|
+
try {
|
|
330
|
+
pids = JSON.parse(readFileSync(pidLog, 'utf8')) as { parent: number; child: number }
|
|
331
|
+
return Number.isInteger(pids.parent) && Number.isInteger(pids.child)
|
|
332
|
+
} catch {
|
|
333
|
+
return false
|
|
334
|
+
}
|
|
335
|
+
})
|
|
336
|
+
if (!pids) throw new Error('fake Claude did not publish complete process evidence')
|
|
337
|
+
const processIds = pids
|
|
338
|
+
expect(processExists(processIds.parent)).toBe(true)
|
|
339
|
+
expect(processExists(processIds.child)).toBe(true)
|
|
330
340
|
controller.abort()
|
|
331
341
|
|
|
332
342
|
expect(await resultPromise).toEqual({
|
|
@@ -334,5 +344,5 @@ test('Claude Ask cancellation kills the entire stubborn subprocess group', async
|
|
|
334
344
|
isError: true,
|
|
335
345
|
errorMessage: 'canceled',
|
|
336
346
|
})
|
|
337
|
-
await waitFor(() => !processExists(
|
|
347
|
+
await waitFor(() => !processExists(processIds.parent) && !processExists(processIds.child))
|
|
338
348
|
})
|
|
@@ -79,7 +79,7 @@ test('mints with the exact audience and instance, caches, and coalesces concurre
|
|
|
79
79
|
expect(await broker.acquireGatewayToken(config, audience)).toBe(token)
|
|
80
80
|
expect(calls).toEqual([
|
|
81
81
|
{
|
|
82
|
-
args: ['token', '--audience', audience, '--ttl', '
|
|
82
|
+
args: ['token', '--audience', audience, '--ttl', '240', '--raw', '-i', 'prod'],
|
|
83
83
|
timeoutMs: 12_000,
|
|
84
84
|
},
|
|
85
85
|
])
|
|
@@ -12,8 +12,8 @@ import type { HarnessGatewayConfig } from '../../../../shared/types'
|
|
|
12
12
|
|
|
13
13
|
import { captureCommand, type CapturedCommand, type CaptureOptions } from '../process'
|
|
14
14
|
|
|
15
|
-
const MINT_TTL_SECONDS =
|
|
16
|
-
const REFRESH_SKEW_MS =
|
|
15
|
+
const MINT_TTL_SECONDS = 4 * 60
|
|
16
|
+
const REFRESH_SKEW_MS = 60_000
|
|
17
17
|
|
|
18
18
|
interface CachedToken {
|
|
19
19
|
token: string
|
|
@@ -141,7 +141,7 @@ export class HarnessTokenBroker {
|
|
|
141
141
|
(claims.expiresAtMs !== undefined && claims.expiresAtMs <= this.now())
|
|
142
142
|
)
|
|
143
143
|
throw new HarnessTokenError(
|
|
144
|
-
'could not mint a delegation token — is the instance reachable and are you signed in? (try `astrale login` / `astrale use <instance>`)',
|
|
144
|
+
'could not mint a delegation token — is the instance reachable and are you signed in? (try `astrale auth login` / `astrale instance use <instance>`)',
|
|
145
145
|
'mint-failed',
|
|
146
146
|
)
|
|
147
147
|
this.mintCache.set(key, {
|
|
@@ -4,30 +4,35 @@ import type { SchemaIR } from '../../../shared/types'
|
|
|
4
4
|
|
|
5
5
|
import { describeAnchor } from './anchors'
|
|
6
6
|
|
|
7
|
-
const importedKey = 'directory.example.dev:
|
|
8
|
-
|
|
7
|
+
const importedKey = 'directory.example.dev:class.Named' as const
|
|
9
8
|
const ir: SchemaIR = {
|
|
10
9
|
format: 'astrale.dsl',
|
|
11
10
|
version: 'v1',
|
|
12
11
|
domain: 'example.dev',
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
classes: {
|
|
13
|
+
Item: {
|
|
14
|
+
type: 'node',
|
|
15
|
+
name: 'Item',
|
|
16
|
+
origin: 'example.dev',
|
|
17
|
+
ref: { origin: 'example.dev', kind: 'class', name: 'Item' },
|
|
18
|
+
properties: { count: { type: 'integer' } },
|
|
19
|
+
required: ['count'],
|
|
20
|
+
methods: {},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
17
23
|
importsByKey: {
|
|
18
24
|
[importedKey]: {
|
|
19
25
|
origin: 'directory.example.dev',
|
|
20
|
-
definition: 'interface',
|
|
21
26
|
key: importedKey,
|
|
22
|
-
ref: { origin: 'directory.example.dev', kind: '
|
|
27
|
+
ref: { origin: 'directory.example.dev', kind: 'class', name: 'Named' },
|
|
23
28
|
},
|
|
24
29
|
},
|
|
25
|
-
|
|
30
|
+
importedClassesByKey: {
|
|
26
31
|
[importedKey]: {
|
|
27
|
-
type: '
|
|
32
|
+
type: 'node',
|
|
28
33
|
name: 'Named',
|
|
29
34
|
origin: 'directory.example.dev',
|
|
30
|
-
ref: { origin: 'directory.example.dev', kind: '
|
|
35
|
+
ref: { origin: 'directory.example.dev', kind: 'class', name: 'Named' },
|
|
31
36
|
properties: { label: { type: 'string' } },
|
|
32
37
|
required: [],
|
|
33
38
|
methods: {},
|
|
@@ -36,39 +41,30 @@ const ir: SchemaIR = {
|
|
|
36
41
|
functions: {
|
|
37
42
|
inspect: {
|
|
38
43
|
name: 'inspect',
|
|
39
|
-
input: {
|
|
40
|
-
type: 'object',
|
|
41
|
-
properties: { cursor: { type: 'string' } },
|
|
42
|
-
required: [],
|
|
43
|
-
},
|
|
44
|
-
params: { cursor: { type: 'string' } },
|
|
45
|
-
requiredParams: [],
|
|
44
|
+
input: { type: 'object', properties: { cursor: { type: 'string' } }, required: [] },
|
|
46
45
|
output: { mode: 'stream', item: { type: 'integer' } },
|
|
47
|
-
returns: { type: 'integer' },
|
|
48
|
-
static: true,
|
|
49
|
-
inheritance: 'default',
|
|
50
46
|
auth: 'authenticated',
|
|
51
47
|
},
|
|
52
48
|
},
|
|
49
|
+
views: {},
|
|
50
|
+
policies: {},
|
|
51
|
+
dependencies: [],
|
|
52
|
+
core: {},
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
describe('
|
|
56
|
-
test('describes
|
|
57
|
-
expect(describeAnchor('
|
|
58
|
-
'
|
|
55
|
+
describe('anchor descriptions', () => {
|
|
56
|
+
test('describes local and exact imported Class properties', () => {
|
|
57
|
+
expect(describeAnchor('class.Item.property.count', ir, undefined)).toContain(
|
|
58
|
+
'**Item.count** : int',
|
|
59
|
+
)
|
|
60
|
+
expect(describeAnchor(`class.${importedKey}.property.label`, ir, undefined)).toContain(
|
|
61
|
+
'**Named.label** : string?',
|
|
59
62
|
)
|
|
60
63
|
})
|
|
61
64
|
|
|
62
|
-
test('
|
|
63
|
-
expect(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
ir,
|
|
67
|
-
undefined,
|
|
68
|
-
),
|
|
69
|
-
).toBe('**Named.label** : string?')
|
|
70
|
-
expect(
|
|
71
|
-
describeAnchor('interface.directory.example.dev:interface.Named', ir, undefined),
|
|
72
|
-
).toContain('from directory.example.dev')
|
|
65
|
+
test('describes standalone Functions with output mode and authentication', () => {
|
|
66
|
+
expect(describeAnchor('function.inspect', ir, undefined)).toContain(
|
|
67
|
+
'stream<int> [authenticated]',
|
|
68
|
+
)
|
|
73
69
|
})
|
|
74
70
|
})
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type {
|
|
7
7
|
Comment,
|
|
8
|
-
|
|
8
|
+
IrClass,
|
|
9
|
+
IrClassKey,
|
|
9
10
|
IrFunction,
|
|
10
|
-
IrInterface,
|
|
11
11
|
IrMethod,
|
|
12
12
|
JsonSchema,
|
|
13
13
|
SchemaIR,
|
|
@@ -33,32 +33,30 @@ function propType(s: JsonSchema | undefined, optionalOverride?: boolean): string
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function methodSig(name: string, m: IrMethod | IrFunction): string {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`${p}:${propType(s, m.requiredParams ? !m.requiredParams.includes(p) : undefined)}`,
|
|
40
|
-
)
|
|
36
|
+
const required = new Set(m.input.required ?? [])
|
|
37
|
+
const params = Object.entries(m.input.properties ?? {})
|
|
38
|
+
.map(([p, s]) => `${p}:${propType(s, !required.has(p))}`)
|
|
41
39
|
.join(', ')
|
|
42
40
|
const output =
|
|
43
|
-
m.output
|
|
41
|
+
m.output.mode === 'stream'
|
|
44
42
|
? `stream<${propType(m.output.item)}>`
|
|
45
|
-
: m.output
|
|
43
|
+
: m.output.mode === 'binary'
|
|
46
44
|
? 'binary'
|
|
47
|
-
: propType(m.output
|
|
45
|
+
: propType(m.output.schema)
|
|
48
46
|
const tags = [
|
|
49
|
-
m.static ? 'static' : '',
|
|
50
|
-
m.inheritance === 'abstract' ? 'abstract' : '',
|
|
47
|
+
'static' in m && m.static ? 'static' : '',
|
|
48
|
+
'inheritance' in m && m.inheritance === 'abstract' ? 'abstract' : '',
|
|
51
49
|
m.auth ?? '',
|
|
52
50
|
].filter(Boolean)
|
|
53
51
|
return `${name}(${params})→${output}${tags.length ? ` [${tags.join(',')}]` : ''}`
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
function
|
|
57
|
-
const exact = /^(.+):
|
|
58
|
-
if (!exact) return ir.
|
|
54
|
+
function classByToken(ir: SchemaIR, token: string): IrClass | undefined {
|
|
55
|
+
const exact = /^(.+):class\.([A-Za-z_$][\w$]*)$/.exec(token)
|
|
56
|
+
if (!exact) return ir.classes[token]
|
|
59
57
|
const [, origin, name] = exact
|
|
60
|
-
if (origin === ir.domain) return ir.
|
|
61
|
-
return ir.
|
|
58
|
+
if (origin === ir.domain) return ir.classes[name]
|
|
59
|
+
return ir.importedClassesByKey[`${origin}:class.${name}` as IrClassKey]
|
|
62
60
|
}
|
|
63
61
|
|
|
64
62
|
/**
|
|
@@ -77,20 +75,20 @@ export function describeAnchor(
|
|
|
77
75
|
const doc = span?.doc ? ` — ${span.doc.replace(/\s+/g, ' ').trim().slice(0, 160)}` : ''
|
|
78
76
|
|
|
79
77
|
// class.X.property.y / class.X.method.m
|
|
80
|
-
const member = ref.match(/^class\.(
|
|
78
|
+
const member = ref.match(/^class\.(.+)\.(property|method)\.([^.]+)$/)
|
|
81
79
|
if (member && ir) {
|
|
82
80
|
const [, cls, kind, name] = member
|
|
83
|
-
const c = ir
|
|
81
|
+
const c = classByToken(ir, cls)
|
|
84
82
|
if (c && kind === 'property' && c.properties?.[name])
|
|
85
|
-
return `**${
|
|
83
|
+
return `**${c.name}.${name}** : ${propType(c.properties[name], c.required ? !c.required.includes(name) : undefined)}${loc ? ` (${loc})` : ''}${doc}`
|
|
86
84
|
if (c && kind === 'method' && c.methods?.[name])
|
|
87
|
-
return `**${
|
|
85
|
+
return `**${c.name}.${name}** — ${methodSig(name, c.methods[name])}${loc ? ` (${loc})` : ''}${doc}`
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
// class.X / edge.X (edges live in ir.classes too)
|
|
91
89
|
const cm = ref.match(/^(?:class|edge)\.(.+)$/)
|
|
92
90
|
if (cm && ir) {
|
|
93
|
-
const c = ir
|
|
91
|
+
const c = classByToken(ir, cm[1])
|
|
94
92
|
if (c) {
|
|
95
93
|
const L = [`**${c.name}** (${c.type})${loc ? ` (${loc})` : ''}${doc}`]
|
|
96
94
|
const props = Object.entries(c.properties ?? {})
|
|
@@ -121,33 +119,6 @@ export function describeAnchor(
|
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
|
|
124
|
-
// interface.X.property.y / interface.<origin>:interface.X.method.m
|
|
125
|
-
const interfaceMember = ref.match(/^interface\.(.+)\.(property|method)\.([^.]+)$/)
|
|
126
|
-
if (interfaceMember && ir) {
|
|
127
|
-
const [, token, kind, name] = interfaceMember
|
|
128
|
-
const iface = interfaceByToken(ir, token)
|
|
129
|
-
if (iface && kind === 'property' && iface.properties?.[name]) {
|
|
130
|
-
return `**${iface.name}.${name}** : ${propType(iface.properties[name], iface.required ? !iface.required.includes(name) : undefined)}${loc ? ` (${loc})` : ''}${doc}`
|
|
131
|
-
}
|
|
132
|
-
if (iface && kind === 'method' && iface.methods?.[name]) {
|
|
133
|
-
return `**${iface.name}.${name}** — ${methodSig(name, iface.methods[name])}${loc ? ` (${loc})` : ''}${doc}`
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// interface.X or exact interface.<origin>:interface.X
|
|
138
|
-
const im = ref.match(/^interface\.(.+)$/)
|
|
139
|
-
if (im && ir) {
|
|
140
|
-
const i = interfaceByToken(ir, im[1])
|
|
141
|
-
if (i) {
|
|
142
|
-
const props = Object.entries(i.properties ?? {}).map(
|
|
143
|
-
([name, schema]) =>
|
|
144
|
-
`${name}:${propType(schema, i.required ? !i.required.includes(name) : undefined)}`,
|
|
145
|
-
)
|
|
146
|
-
const ms = Object.entries(i.methods ?? {}).map(([n, m]) => methodSig(n, m))
|
|
147
|
-
return `**${i.name}** (interface)${i.origin && i.origin !== ir.domain ? ` from ${i.origin}` : ''}${loc ? ` (${loc})` : ''}${doc}${props.length ? `\n props: ${props.join(' · ')}` : ''}${ms.length ? `\n methods: ${ms.join(' · ')}` : ''}`
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
122
|
// Standalone canonical Function.
|
|
152
123
|
const fm = ref.match(/^function\.([A-Za-z_$][\w$]*)$/)
|
|
153
124
|
if (fm && ir) {
|
|
@@ -5,8 +5,9 @@ import { buildSystemPrompt } from './system'
|
|
|
5
5
|
test('embedded agents receive the current SDK layout contract', () => {
|
|
6
6
|
const prompt = buildSystemPrompt({ bridge: false })
|
|
7
7
|
|
|
8
|
-
expect(prompt).toContain('
|
|
8
|
+
expect(prompt).toContain('modular Actions and Workflows')
|
|
9
9
|
expect(prompt).toContain('pre-Kernel-V2 APIs or layouts')
|
|
10
|
-
expect(prompt).toContain('
|
|
10
|
+
expect(prompt).toContain('Runtime/Application entries')
|
|
11
|
+
expect(prompt).toContain('do not restore defineDomain or Interface-era layouts')
|
|
11
12
|
expect(prompt).not.toContain('schema/ runtime/ views/')
|
|
12
13
|
})
|
|
@@ -28,9 +28,9 @@ export function buildSystemPrompt(options: { bridge: boolean }): string {
|
|
|
28
28
|
' and **astrale-cli** when you run the `astrale` CLI. Treat those current skills and',
|
|
29
29
|
' the project itself as authoritative; do not restore pre-Kernel-V2 APIs or layouts.',
|
|
30
30
|
'- Prefer the project’s existing semantic modules over inventing new structure. Current',
|
|
31
|
-
' SDK projects
|
|
32
|
-
'
|
|
33
|
-
'
|
|
31
|
+
' SDK projects author Schema definitions, modular Actions and Workflows, a Runtime,',
|
|
32
|
+
' and an Application. Wire modules through their semantic SDK facades and explicit',
|
|
33
|
+
' Runtime/Application entries; do not restore defineDomain or Interface-era layouts.',
|
|
34
34
|
'- The studio re-renders automatically as you save files — never start, build, or refresh',
|
|
35
35
|
' anything for the UI to update.',
|
|
36
36
|
'- Sanity-check schema/handler edits with `pnpm typecheck` (or `tsgo --noEmit`).',
|
|
@@ -26,7 +26,7 @@ function fixture() {
|
|
|
26
26
|
roots.push(root)
|
|
27
27
|
mkdirSync(join(root, 'schema'))
|
|
28
28
|
writeFileSync(join(root, 'astrale.config.ts'), 'export default {}\n')
|
|
29
|
-
writeFileSync(join(root, '
|
|
29
|
+
writeFileSync(join(root, 'application.ts'), 'export default {}\n')
|
|
30
30
|
writeFileSync(join(root, 'schema/index.ts'), 'export const Test = {}\n')
|
|
31
31
|
const handle = registerDomain(root)!
|
|
32
32
|
domainIds.push(handle.id)
|
|
@@ -58,7 +58,7 @@ function fixture(): DomainHandle {
|
|
|
58
58
|
roots.push(root)
|
|
59
59
|
mkdirSync(join(root, 'schema'))
|
|
60
60
|
writeFileSync(join(root, 'astrale.config.ts'), 'export default {}\n')
|
|
61
|
-
writeFileSync(join(root, '
|
|
61
|
+
writeFileSync(join(root, 'application.ts'), 'export default {}\n')
|
|
62
62
|
writeFileSync(join(root, 'schema/index.ts'), 'export const Test = {}\n')
|
|
63
63
|
const handle = registerDomain(root)!
|
|
64
64
|
domainIds.push(handle.id)
|
|
@@ -32,7 +32,6 @@ export async function handleCanvasRoute(context: DomainRouteContext): Promise<Re
|
|
|
32
32
|
saveVisibility(root, {
|
|
33
33
|
hidden: body.hidden ?? {},
|
|
34
34
|
showInheritedEdges: body.showInheritedEdges ?? true,
|
|
35
|
-
materializedInterfaces: body.materializedInterfaces ?? {},
|
|
36
35
|
}),
|
|
37
36
|
)
|
|
38
37
|
}
|
|
@@ -27,7 +27,7 @@ test('loadout fails closed instead of probing ambient Claude when gateway auth f
|
|
|
27
27
|
roots.push(root)
|
|
28
28
|
mkdirSync(join(root, 'schema'))
|
|
29
29
|
writeFileSync(join(root, 'astrale.config.ts'), 'export default {}\n')
|
|
30
|
-
writeFileSync(join(root, '
|
|
30
|
+
writeFileSync(join(root, 'application.ts'), 'export default {}\n')
|
|
31
31
|
writeFileSync(join(root, 'schema/index.ts'), 'export const Test = {}\n')
|
|
32
32
|
const handle = registerDomain(root)!
|
|
33
33
|
domainIds.push(handle.id)
|
|
@@ -19,7 +19,7 @@ function fixture() {
|
|
|
19
19
|
roots.push(root)
|
|
20
20
|
mkdirSync(join(root, 'schema'))
|
|
21
21
|
writeFileSync(join(root, 'astrale.config.ts'), 'export default {}\n')
|
|
22
|
-
writeFileSync(join(root, '
|
|
22
|
+
writeFileSync(join(root, 'application.ts'), 'export default {}\n')
|
|
23
23
|
writeFileSync(join(root, 'schema/index.ts'), 'export const Test = {}\n')
|
|
24
24
|
const handle = registerDomain(root)!
|
|
25
25
|
domainIds.push(handle.id)
|
|
@@ -4,23 +4,27 @@ import { decodeBundleCacheEntry } from './cache'
|
|
|
4
4
|
|
|
5
5
|
function entry(): Record<string, unknown> {
|
|
6
6
|
return {
|
|
7
|
-
version:
|
|
7
|
+
version: 5,
|
|
8
8
|
key: 'cache-key',
|
|
9
9
|
futureEntryField: { version: 5 },
|
|
10
10
|
bundle: {
|
|
11
11
|
domainId: 'notes',
|
|
12
12
|
renderFingerprint: 'render-hash',
|
|
13
|
-
schemaMode: '
|
|
13
|
+
schemaMode: 'canonical-preview',
|
|
14
14
|
extractedBy: 'runtime-bun',
|
|
15
15
|
depsInstalled: true,
|
|
16
16
|
ir: {
|
|
17
|
-
|
|
17
|
+
format: 'astrale.dsl',
|
|
18
|
+
version: 'v1',
|
|
18
19
|
domain: 'notes.example.dev',
|
|
19
|
-
types: {},
|
|
20
|
-
interfaces: {},
|
|
21
20
|
classes: {},
|
|
22
|
-
|
|
21
|
+
importsByKey: {},
|
|
22
|
+
importedClassesByKey: {},
|
|
23
23
|
functions: {},
|
|
24
|
+
views: {},
|
|
25
|
+
policies: {},
|
|
26
|
+
dependencies: [],
|
|
27
|
+
core: {},
|
|
24
28
|
},
|
|
25
29
|
overlay: {
|
|
26
30
|
origin: 'notes.example.dev',
|
|
@@ -31,7 +35,11 @@ function entry(): Record<string, unknown> {
|
|
|
31
35
|
sourceSpans: {},
|
|
32
36
|
annotations: [],
|
|
33
37
|
},
|
|
34
|
-
|
|
38
|
+
schemaRoot: {
|
|
39
|
+
format: 'astrale.dsl',
|
|
40
|
+
version: 'v1',
|
|
41
|
+
origin: 'notes.example.dev',
|
|
42
|
+
},
|
|
35
43
|
error: null,
|
|
36
44
|
extractedAt: '2026-08-20T00:00:00.000Z',
|
|
37
45
|
futureBundleField: true,
|
|
@@ -43,9 +51,9 @@ test('bundle cache admits known structure while ignoring future fields', () => {
|
|
|
43
51
|
const decoded = decodeBundleCacheEntry(entry())
|
|
44
52
|
|
|
45
53
|
expect(decoded).toMatchObject({
|
|
46
|
-
version:
|
|
54
|
+
version: 5,
|
|
47
55
|
key: 'cache-key',
|
|
48
|
-
bundle: { domainId: 'notes', schemaMode: '
|
|
56
|
+
bundle: { domainId: 'notes', schemaMode: 'canonical-preview' },
|
|
49
57
|
})
|
|
50
58
|
expect(decoded && 'futureEntryField' in decoded).toBe(false)
|
|
51
59
|
expect(decoded && 'futureBundleField' in decoded.bundle).toBe(false)
|
|
@@ -60,11 +68,14 @@ function canonicalEntry(): Record<string, unknown> {
|
|
|
60
68
|
format: 'astrale.dsl',
|
|
61
69
|
version: 'v1',
|
|
62
70
|
domain: 'notes.example.dev',
|
|
63
|
-
types: {},
|
|
64
|
-
interfaces: {},
|
|
65
71
|
classes: {},
|
|
66
|
-
|
|
72
|
+
importsByKey: {},
|
|
73
|
+
importedClassesByKey: {},
|
|
67
74
|
functions: {},
|
|
75
|
+
views: {},
|
|
76
|
+
policies: {},
|
|
77
|
+
dependencies: [],
|
|
78
|
+
core: {},
|
|
68
79
|
}
|
|
69
80
|
bundle.schemaRoot = {
|
|
70
81
|
format: 'astrale.dsl',
|
package/studio/server/cache.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { buildAnatomy } from './introspect/anatomy'
|
|
|
16
16
|
import { buildBundle } from './introspect/bundle'
|
|
17
17
|
import { isCanonicalDomainSchemaV1 } from './introspect/canonical-schema'
|
|
18
18
|
import { buildCore } from './introspect/core'
|
|
19
|
-
import {
|
|
19
|
+
import { decodeSchemaIR } from './introspect/schema-ir-json'
|
|
20
20
|
import { asBoolean, asFiniteNumber, asJsonRecord, asString, asStringArray } from './json'
|
|
21
21
|
import { hashAnatomyFiles } from './state/baseline'
|
|
22
22
|
import { readJson, writeJson } from './state/store'
|
|
@@ -26,7 +26,7 @@ const anatomies = new Map<string, Promise<DomainAnatomy>>()
|
|
|
26
26
|
const cores = new Map<string, StudioCore>()
|
|
27
27
|
|
|
28
28
|
const BUNDLE_CACHE_FILE = '.cache/schema-bundle.json'
|
|
29
|
-
const BUNDLE_CACHE_VERSION =
|
|
29
|
+
const BUNDLE_CACHE_VERSION = 5
|
|
30
30
|
const LOCKFILES = ['bun.lock', 'pnpm-lock.yaml', 'package-lock.json', 'yarn.lock']
|
|
31
31
|
const TOOL_INPUTS = [
|
|
32
32
|
'cache.ts',
|
|
@@ -55,10 +55,13 @@ interface BundleCacheEntry {
|
|
|
55
55
|
|
|
56
56
|
function isCrossDomainImport(value: unknown): boolean {
|
|
57
57
|
const record = asJsonRecord(value)
|
|
58
|
+
const ref = asJsonRecord(record?.ref)
|
|
58
59
|
return (
|
|
59
60
|
typeof record?.name === 'string' &&
|
|
60
61
|
typeof record.origin === 'string' &&
|
|
61
|
-
|
|
62
|
+
ref?.kind === 'class' &&
|
|
63
|
+
typeof ref.origin === 'string' &&
|
|
64
|
+
typeof ref.name === 'string'
|
|
62
65
|
)
|
|
63
66
|
}
|
|
64
67
|
|
|
@@ -66,7 +69,8 @@ function isHandlerLink(value: unknown): boolean {
|
|
|
66
69
|
const record = asJsonRecord(value)
|
|
67
70
|
return (
|
|
68
71
|
typeof record?.owner === 'string' &&
|
|
69
|
-
['class', '
|
|
72
|
+
['class', 'function'].includes(String(record.ownerKind)) &&
|
|
73
|
+
['action', 'workflow'].includes(String(record.kind)) &&
|
|
70
74
|
typeof record.method === 'string' &&
|
|
71
75
|
typeof record.static === 'boolean' &&
|
|
72
76
|
typeof record.implemented === 'boolean'
|
|
@@ -125,9 +129,9 @@ function decodeBundle(value: unknown): StudioSchemaBundle | undefined {
|
|
|
125
129
|
if (!record) return undefined
|
|
126
130
|
const domainId = asString(record.domainId)
|
|
127
131
|
const renderFingerprint = asString(record.renderFingerprint)
|
|
128
|
-
const schemaMode = (
|
|
129
|
-
|
|
130
|
-
)
|
|
132
|
+
const schemaMode = (['canonical-admitted', 'canonical-preview', 'unavailable'] as const).find(
|
|
133
|
+
(candidate) => candidate === record.schemaMode,
|
|
134
|
+
)
|
|
131
135
|
const extractedBy = record.extractedBy
|
|
132
136
|
const depsInstalled = asBoolean(record.depsInstalled)
|
|
133
137
|
const ir = record.ir === null ? null : decodeSchemaIR(record.ir)
|
|
@@ -153,11 +157,6 @@ function decodeBundle(value: unknown): StudioSchemaBundle | undefined {
|
|
|
153
157
|
) {
|
|
154
158
|
return undefined
|
|
155
159
|
}
|
|
156
|
-
const importedInterfaces =
|
|
157
|
-
record.importedInterfaces === undefined
|
|
158
|
-
? undefined
|
|
159
|
-
: decodeIrInterfaceRecord(record.importedInterfaces)
|
|
160
|
-
if (record.importedInterfaces !== undefined && importedInterfaces === undefined) return undefined
|
|
161
160
|
const errorRecord = record.error === null ? null : asJsonRecord(record.error)
|
|
162
161
|
const errorMessage = asString(errorRecord?.message)
|
|
163
162
|
if (record.error !== undefined && record.error !== null && errorMessage === undefined) {
|
|
@@ -173,7 +172,6 @@ function decodeBundle(value: unknown): StudioSchemaBundle | undefined {
|
|
|
173
172
|
ir,
|
|
174
173
|
...(record.schemaRoot === undefined ? {} : { schemaRoot: record.schemaRoot }),
|
|
175
174
|
overlay,
|
|
176
|
-
...(importedInterfaces === undefined ? {} : { importedInterfaces }),
|
|
177
175
|
...(record.error === undefined
|
|
178
176
|
? {}
|
|
179
177
|
: record.error === null
|
|
@@ -300,7 +298,6 @@ export function invalidate(id: string, what: 'schema' | 'anatomy' | 'all'): void
|
|
|
300
298
|
const domain = getDomain(id)
|
|
301
299
|
if (domain) invalidateClientPackage(domain.root)
|
|
302
300
|
}
|
|
303
|
-
// Core is derived from the canonical
|
|
304
|
-
// both of which belong to the anatomy invalidation set.
|
|
301
|
+
// Core is derived from the canonical Schema and belongs to the anatomy set.
|
|
305
302
|
if (what !== 'schema') cores.delete(id)
|
|
306
303
|
}
|