@astrale-os/cli 1.0.0-beta.3 → 1.0.0-beta.31
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 +84 -6
- package/dist/astrale.js +57586 -60753
- package/dist/public/connect-core.js +2158 -30706
- package/dist/public/keys/index.js +1016 -29541
- package/dist/public/paths/index.js +370 -28654
- 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 +13 -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/dist/types/state/exchange-credentials.d.ts +6 -2
- package/dist/types/state/files.d.ts +2 -0
- package/dist/types/state/index.d.ts +3 -2
- package/dist/types/state/paths.d.ts +2 -0
- package/dist/types/state/session-routes.d.ts +10 -0
- package/package.json +16 -19
- 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 +47 -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 +30 -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 +6 -17
- 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 +119 -11
- 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 +50 -2
- package/src/commands/auth/logout.ts +2 -1
- package/src/commands/browser.ts +29 -0
- package/src/commands/call-describe.ts +60 -68
- package/src/commands/call.ts +71 -59
- package/src/commands/domain/install.ts +73 -46
- 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 +15 -16
- package/src/commands/identity/__tests__/register.test.ts +3 -3
- package/src/commands/identity/register.ts +8 -8
- 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 +53 -41
- package/src/commands/logs.ts +123 -36
- package/src/commands/mutate.ts +6 -5
- package/src/commands/query.ts +39 -36
- package/src/commands/session/analyze.ts +26 -4
- 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 +21 -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 +90 -48
- package/src/commands/view.ts +82 -37
- package/src/connection/.spec/api.d.ts +7 -8
- package/src/connection/.spec/architecture.md +14 -5
- 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__/auth.test.ts +1 -0
- package/src/connection/__tests__/credential.test.ts +21 -1
- package/src/connection/__tests__/errors.test.ts +27 -20
- package/src/connection/__tests__/exchange.test.ts +64 -11
- 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 +8 -4
- package/src/connection/__tests__/target.test.ts +2 -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 +110 -61
- 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 +27 -9
- package/src/errors.ts +3 -2
- package/src/graph/.spec/api.d.ts +13 -6
- package/src/graph/.spec/laws/documents.ts +7 -7
- package/src/graph/.spec/layout.ts +9 -1
- package/src/graph/__tests__/mutation.test.ts +2 -2
- package/src/graph/__tests__/query.test.ts +35 -9
- package/src/graph/class.ts +30 -0
- package/src/graph/index.ts +1 -0
- package/src/graph/query.ts +27 -40
- package/src/identity/.spec/api.d.ts +2 -2
- package/src/identity/__tests__/fixtures/registry-journey.ts +13 -1
- package/src/identity/__tests__/registration.test.ts +1 -1
- package/src/identity/__tests__/registry.test.ts +4 -0
- package/src/identity/registration.ts +3 -3
- package/src/identity/registry.ts +2 -0
- 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__/browser-retention.test.ts +212 -0
- package/src/lib/__tests__/command-dx.test.ts +1 -1
- package/src/lib/__tests__/config.test.ts +27 -0
- 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__/skills.test.ts +834 -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 +25 -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/browser-retention.ts +210 -0
- package/src/lib/command-dx.ts +9 -9
- package/src/lib/config.ts +12 -1
- 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/skills/lock.ts +117 -0
- package/src/lib/skills/sync.ts +878 -0
- package/src/lib/skills.ts +1 -52
- 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 +201 -7
- 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/setup/steps/skills.ts +40 -38
- package/src/state/.spec/api.d.ts +21 -2
- package/src/state/.spec/architecture.md +18 -4
- package/src/state/.spec/layout.ts +1 -0
- package/src/state/__tests__/exchange-credentials.test.ts +88 -42
- package/src/state/__tests__/files.test.ts +24 -1
- package/src/state/__tests__/fixtures/session-route-process.ts +93 -0
- package/src/state/__tests__/paths.test.ts +1 -0
- package/src/state/__tests__/session-routes.test.ts +138 -0
- package/src/state/exchange-credentials.ts +22 -9
- package/src/state/files.ts +41 -0
- package/src/state/index.ts +3 -1
- package/src/state/paths.ts +3 -0
- package/src/state/session-routes.ts +34 -0
- package/src/telemetry/__tests__/analyze-log.test.ts +38 -0
- package/src/telemetry/__tests__/recorder.test.ts +1 -0
- package/src/telemetry/__tests__/retention.test.ts +267 -0
- package/src/telemetry/__tests__/settings.test.ts +102 -0
- package/src/telemetry/__tests__/store-scan.test.ts +128 -0
- package/src/telemetry/__tests__/trigger.test.ts +33 -4
- package/src/telemetry/analyze.ts +24 -2
- package/src/telemetry/recorder.ts +15 -4
- package/src/telemetry/retention.ts +176 -0
- package/src/telemetry/session.ts +18 -12
- package/src/telemetry/settings.ts +64 -11
- package/src/telemetry/store.ts +92 -9
- package/src/telemetry/trigger.ts +16 -28
- package/src/ui/.spec/api.d.ts +14 -0
- package/src/ui/.spec/architecture.md +14 -0
- package/src/ui/.spec/laws.ts +50 -0
- package/src/ui/.spec/layout.ts +16 -0
- package/src/ui/__tests__/ui.test.ts +1742 -0
- package/src/ui/index.ts +13 -0
- package/src/ui/lock.ts +89 -0
- package/src/ui/model.ts +83 -0
- package/src/ui/operations.ts +1044 -0
- package/src/ui/project.ts +333 -0
- package/src/ui/release.ts +398 -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-BFVFs_8x.js +81 -0
- package/studio/client/dist/assets/index-DuB9iUdu.css +2 -0
- package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/studio/client/dist/assets/schema-studio--a0kX3QU.css +1 -0
- package/studio/client/dist/assets/schema-studio-DH6oEWME.js +8 -0
- package/studio/client/dist/index.html +4 -3
- package/studio/package.json +8 -14
- 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 +41 -32
- package/studio/server/agent/prompts/anchors.ts +23 -51
- package/studio/server/agent/prompts/system.test.ts +4 -4
- package/studio/server/agent/prompts/system.ts +5 -5
- package/studio/server/agent/routes.test.ts +1 -1
- package/studio/server/agent/run/coordinator.test.ts +1 -1
- package/studio/server/agent/run/preparation.ts +1 -1
- package/studio/server/api/canvas.ts +0 -1
- package/studio/server/api/context.ts +1 -1
- package/studio/server/api/deployment.ts +1 -1
- package/studio/server/api/views.ts +2 -2
- package/studio/server/api/workspace.ts +1 -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 +24 -18
- package/studio/server/cache.ts +10 -54
- package/studio/server/cli-consumers.test.ts +32 -4
- package/studio/server/cli.test.ts +2 -2
- package/studio/server/domain.test.ts +50 -68
- package/studio/server/domain.ts +82 -63
- package/studio/server/handoff/copy.ts +2 -2
- 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 +10 -16
- package/studio/server/introspect/anatomy-extras.test.ts +29 -56
- 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 +155 -424
- package/studio/server/introspect/canonical-schema.ts +248 -601
- package/studio/server/introspect/core.ts +14 -22
- package/studio/server/introspect/diff.test.ts +21 -9
- package/studio/server/introspect/diff.ts +19 -64
- package/studio/server/introspect/extractor.ts +23 -122
- package/studio/server/introspect/overlay-tsmorph.test.ts +116 -241
- package/studio/server/introspect/overlay-tsmorph.ts +0 -1
- package/studio/server/introspect/overlay.ts +3 -51
- package/studio/server/introspect/revision.test.ts +24 -28
- package/studio/server/introspect/revision.ts +11 -22
- package/studio/server/introspect/runtime.test.ts +77 -195
- package/studio/server/introspect/runtime.ts +5 -67
- package/studio/server/introspect/schema-ir-json.test.ts +81 -0
- package/studio/server/introspect/schema-ir-json.ts +39 -69
- 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/lifecycle.ts +4 -1
- package/studio/server/state/baseline.test.ts +14 -9
- package/studio/server/state/baseline.ts +3 -5
- package/studio/server/state/documents.test.ts +69 -0
- package/studio/server/state/documents.ts +57 -10
- package/studio/server/state/visibility.ts +1 -5
- package/studio/server/views/model.ts +3 -3
- package/studio/server/views/target.test.ts +18 -76
- package/studio/server/views/target.ts +25 -51
- package/studio/server/watch.test.ts +11 -11
- package/studio/server/watch.ts +8 -4
- package/studio/server/workspace/updates.ts +23 -1
- package/studio/server/workspace-watch.ts +2 -2
- package/studio/shared/contracts/runtime.ts +4 -0
- package/studio/shared/contracts/schema.ts +44 -131
- package/studio/shared/contracts/surface.test.ts +15 -17
- package/studio/shared/contracts/workspace.ts +5 -11
- package/studio/shared/schema/identity.test.ts +20 -44
- package/studio/shared/schema/identity.ts +9 -24
- package/studio/tsconfig.json +2 -1
- package/tsconfig.json +1 -1
- package/viewer/dist/index.html +21 -0
- package/viewer/dist/main.js +41 -62
- 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
- package/studio/server/introspect/core-extractor.ts +0 -139
- package/studio/server/introspect/overlay.test.ts +0 -72
- package/studio/server/introspect/source-overlay/annotations.ts +0 -14
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en"
|
|
2
|
+
<html lang="en">
|
|
3
3
|
<head>
|
|
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-BFVFs_8x.js"></script>
|
|
8
|
+
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DuB9iUdu.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.54",
|
|
25
|
+
"@astrale-os/shell": "0.4.2-beta.6",
|
|
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
|
-
"
|
|
59
|
+
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
60
|
+
"@vitejs/plugin-react": "^6.0.5",
|
|
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: {},
|
|
@@ -38,37 +43,41 @@ const ir: SchemaIR = {
|
|
|
38
43
|
name: 'inspect',
|
|
39
44
|
input: {
|
|
40
45
|
type: 'object',
|
|
41
|
-
properties: {
|
|
46
|
+
properties: {
|
|
47
|
+
cursor: {
|
|
48
|
+
$ref: 'https://schemas.astrale.ai/graph/1/node-path',
|
|
49
|
+
'x-astrale-path': {
|
|
50
|
+
target: 'node',
|
|
51
|
+
cardinality: 'one',
|
|
52
|
+
accepts: [{ origin: 'example.dev', kind: 'class', name: 'Item' }],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
42
56
|
required: [],
|
|
43
57
|
},
|
|
44
|
-
params: { cursor: { type: 'string' } },
|
|
45
|
-
requiredParams: [],
|
|
46
58
|
output: { mode: 'stream', item: { type: 'integer' } },
|
|
47
|
-
returns: { type: 'integer' },
|
|
48
|
-
static: true,
|
|
49
|
-
inheritance: 'default',
|
|
50
59
|
auth: 'authenticated',
|
|
51
60
|
},
|
|
52
61
|
},
|
|
62
|
+
views: {},
|
|
63
|
+
policies: {},
|
|
64
|
+
dependencies: [],
|
|
65
|
+
core: {},
|
|
53
66
|
}
|
|
54
67
|
|
|
55
|
-
describe('
|
|
56
|
-
test('describes
|
|
57
|
-
expect(describeAnchor('
|
|
58
|
-
'
|
|
68
|
+
describe('anchor descriptions', () => {
|
|
69
|
+
test('describes local and exact imported Class properties', () => {
|
|
70
|
+
expect(describeAnchor('class.Item.property.count', ir, undefined)).toContain(
|
|
71
|
+
'**Item.count** : int',
|
|
72
|
+
)
|
|
73
|
+
expect(describeAnchor(`class.${importedKey}.property.label`, ir, undefined)).toContain(
|
|
74
|
+
'**Named.label** : string?',
|
|
59
75
|
)
|
|
60
76
|
})
|
|
61
77
|
|
|
62
|
-
test('
|
|
63
|
-
|
|
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')
|
|
78
|
+
test('describes standalone Functions with output mode and authentication', () => {
|
|
79
|
+
const description = describeAnchor('function.inspect', ir, undefined)
|
|
80
|
+
expect(description).toContain('inspect(cursor:→node?)')
|
|
81
|
+
expect(description).toContain('stream<int> [authenticated]')
|
|
73
82
|
})
|
|
74
83
|
})
|
|
@@ -5,15 +5,17 @@
|
|
|
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,
|
|
14
14
|
SchemaOverlay,
|
|
15
15
|
} from '../../../shared/types'
|
|
16
16
|
|
|
17
|
+
import { isNodePathSchema } from '../../../shared/types'
|
|
18
|
+
|
|
17
19
|
/** Terse JSON-Schema type label (mirrors the client's format.tsx describe/typeLabel). */
|
|
18
20
|
function propType(s: JsonSchema | undefined, optionalOverride?: boolean): string {
|
|
19
21
|
if (!s) return 'any'
|
|
@@ -22,8 +24,7 @@ function propType(s: JsonSchema | undefined, optionalOverride?: boolean): string
|
|
|
22
24
|
const base = Array.isArray(t) ? t.find((x) => x !== 'null') : t
|
|
23
25
|
let label: string
|
|
24
26
|
if (s.enum) label = `enum(${s.enum.map(String).join('|')})`
|
|
25
|
-
else if (s
|
|
26
|
-
else if (s.$dataRef) label = '→data'
|
|
27
|
+
else if (isNodePathSchema(s)) label = '→node'
|
|
27
28
|
else if (base === 'array') label = `${propType(s.items)}[]`
|
|
28
29
|
else if (base === 'object') label = `{${Object.keys(s.properties ?? {}).join(',')}}`
|
|
29
30
|
else if (base === 'integer') label = 'int'
|
|
@@ -33,32 +34,30 @@ function propType(s: JsonSchema | undefined, optionalOverride?: boolean): string
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
function methodSig(name: string, m: IrMethod | IrFunction): string {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`${p}:${propType(s, m.requiredParams ? !m.requiredParams.includes(p) : undefined)}`,
|
|
40
|
-
)
|
|
37
|
+
const required = new Set(m.input.required ?? [])
|
|
38
|
+
const params = Object.entries(m.input.properties ?? {})
|
|
39
|
+
.map(([p, s]) => `${p}:${propType(s, !required.has(p))}`)
|
|
41
40
|
.join(', ')
|
|
42
41
|
const output =
|
|
43
|
-
m.output
|
|
42
|
+
m.output.mode === 'stream'
|
|
44
43
|
? `stream<${propType(m.output.item)}>`
|
|
45
|
-
: m.output
|
|
44
|
+
: m.output.mode === 'binary'
|
|
46
45
|
? 'binary'
|
|
47
|
-
: propType(m.output
|
|
46
|
+
: propType(m.output.schema)
|
|
48
47
|
const tags = [
|
|
49
|
-
m.static ? 'static' : '',
|
|
50
|
-
m.inheritance === 'abstract' ? 'abstract' : '',
|
|
48
|
+
'static' in m && m.static ? 'static' : '',
|
|
49
|
+
'inheritance' in m && m.inheritance === 'abstract' ? 'abstract' : '',
|
|
51
50
|
m.auth ?? '',
|
|
52
51
|
].filter(Boolean)
|
|
53
52
|
return `${name}(${params})→${output}${tags.length ? ` [${tags.join(',')}]` : ''}`
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
function
|
|
57
|
-
const exact = /^(.+):
|
|
58
|
-
if (!exact) return ir.
|
|
55
|
+
function classByToken(ir: SchemaIR, token: string): IrClass | undefined {
|
|
56
|
+
const exact = /^(.+):class\.([A-Za-z_$][\w$]*)$/.exec(token)
|
|
57
|
+
if (!exact) return ir.classes[token]
|
|
59
58
|
const [, origin, name] = exact
|
|
60
|
-
if (origin === ir.domain) return ir.
|
|
61
|
-
return ir.
|
|
59
|
+
if (origin === ir.domain) return ir.classes[name]
|
|
60
|
+
return ir.importedClassesByKey[`${origin}:class.${name}` as IrClassKey]
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
/**
|
|
@@ -77,20 +76,20 @@ export function describeAnchor(
|
|
|
77
76
|
const doc = span?.doc ? ` — ${span.doc.replace(/\s+/g, ' ').trim().slice(0, 160)}` : ''
|
|
78
77
|
|
|
79
78
|
// class.X.property.y / class.X.method.m
|
|
80
|
-
const member = ref.match(/^class\.(
|
|
79
|
+
const member = ref.match(/^class\.(.+)\.(property|method)\.([^.]+)$/)
|
|
81
80
|
if (member && ir) {
|
|
82
81
|
const [, cls, kind, name] = member
|
|
83
|
-
const c = ir
|
|
82
|
+
const c = classByToken(ir, cls)
|
|
84
83
|
if (c && kind === 'property' && c.properties?.[name])
|
|
85
|
-
return `**${
|
|
84
|
+
return `**${c.name}.${name}** : ${propType(c.properties[name], c.required ? !c.required.includes(name) : undefined)}${loc ? ` (${loc})` : ''}${doc}`
|
|
86
85
|
if (c && kind === 'method' && c.methods?.[name])
|
|
87
|
-
return `**${
|
|
86
|
+
return `**${c.name}.${name}** — ${methodSig(name, c.methods[name])}${loc ? ` (${loc})` : ''}${doc}`
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
// class.X / edge.X (edges live in ir.classes too)
|
|
91
90
|
const cm = ref.match(/^(?:class|edge)\.(.+)$/)
|
|
92
91
|
if (cm && ir) {
|
|
93
|
-
const c = ir
|
|
92
|
+
const c = classByToken(ir, cm[1])
|
|
94
93
|
if (c) {
|
|
95
94
|
const L = [`**${c.name}** (${c.type})${loc ? ` (${loc})` : ''}${doc}`]
|
|
96
95
|
const props = Object.entries(c.properties ?? {})
|
|
@@ -121,33 +120,6 @@ export function describeAnchor(
|
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
|
|
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
123
|
// Standalone canonical Function.
|
|
152
124
|
const fm = ref.match(/^function\.([A-Za-z_$][\w$]*)$/)
|
|
153
125
|
if (fm && ir) {
|
|
@@ -2,11 +2,11 @@ import { expect, test } from 'bun:test'
|
|
|
2
2
|
|
|
3
3
|
import { buildSystemPrompt } from './system'
|
|
4
4
|
|
|
5
|
-
test('embedded agents receive the current SDK
|
|
5
|
+
test('embedded agents receive the current SDK and frontend skill contracts', () => {
|
|
6
6
|
const prompt = buildSystemPrompt({ bridge: false })
|
|
7
7
|
|
|
8
|
-
expect(prompt).toContain('
|
|
9
|
-
expect(prompt).toContain('
|
|
10
|
-
expect(prompt).toContain('
|
|
8
|
+
expect(prompt).toContain('modular Actions and Workflows')
|
|
9
|
+
expect(prompt).toContain('astrale-frontend-design')
|
|
10
|
+
expect(prompt).toContain('Runtime/Application entries')
|
|
11
11
|
expect(prompt).not.toContain('schema/ runtime/ views/')
|
|
12
12
|
})
|
|
@@ -25,12 +25,12 @@ export function buildSystemPrompt(options: { bridge: boolean }): string {
|
|
|
25
25
|
'Operating rules (when a thread genuinely calls for a code change):',
|
|
26
26
|
'- Read the skills under `.agents/skills/` FIRST and follow them: **astrale-domain**',
|
|
27
27
|
' (schema modeling, handlers, views, deploy/install) before editing schema/handlers,',
|
|
28
|
-
'
|
|
29
|
-
' the
|
|
28
|
+
' **astrale-frontend-design** before editing a Domain UI, and **astrale-cli** when you',
|
|
29
|
+
' run the `astrale` CLI. Treat those current skills and the project itself as authoritative.',
|
|
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.',
|
|
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)
|
|
@@ -94,7 +94,7 @@ export async function prepareRun(
|
|
|
94
94
|
bareResume && !firstTurn
|
|
95
95
|
? buildResumePrompt()
|
|
96
96
|
: buildTurnPrompt({
|
|
97
|
-
origin: bundle?.
|
|
97
|
+
origin: bundle?.ir?.domain ?? handle.origin ?? domainId,
|
|
98
98
|
root,
|
|
99
99
|
renderFingerprint,
|
|
100
100
|
schemaRevision: bundle?.schemaRevision,
|
|
@@ -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
|
}
|
|
@@ -43,7 +43,7 @@ export async function handleContextRoute(context: DomainRouteContext): Promise<R
|
|
|
43
43
|
const storedContext = readContext(root)
|
|
44
44
|
const openComments = readComments(root).comments.filter((comment) => comment.status === 'open')
|
|
45
45
|
const markdown = buildCopyMarkdown({
|
|
46
|
-
origin: bundle?.
|
|
46
|
+
origin: bundle?.ir?.domain ?? handle.origin ?? id,
|
|
47
47
|
root,
|
|
48
48
|
renderFingerprint: bundle?.renderFingerprint ?? '',
|
|
49
49
|
schemaRevision: bundle?.schemaRevision,
|
|
@@ -24,7 +24,7 @@ export async function handleViewRoute(context: DomainRouteContext): Promise<Resp
|
|
|
24
24
|
const view = anatomy?.views.find((candidate) => candidate.slug === slug)
|
|
25
25
|
if (!view) return notFound()
|
|
26
26
|
const bundle = await getBundle(id)
|
|
27
|
-
const origin = bundle?.
|
|
27
|
+
const origin = bundle?.ir?.domain || anatomy?.overview.origin
|
|
28
28
|
if (!origin) return badRequest('domain origin is unavailable')
|
|
29
29
|
return json(
|
|
30
30
|
await getViewRuntime(root, origin, view, bundle, readSettings(root).viewProbeTimeoutMs),
|
|
@@ -39,7 +39,7 @@ export async function handleViewRoute(context: DomainRouteContext): Promise<Resp
|
|
|
39
39
|
const view = anatomy?.views.find((candidate) => candidate.slug === slug)
|
|
40
40
|
if (!view) return notFound()
|
|
41
41
|
const bundle = await getBundle(id)
|
|
42
|
-
const origin = bundle?.
|
|
42
|
+
const origin = bundle?.ir?.domain || anatomy?.overview.origin
|
|
43
43
|
if (!origin) return badRequest('domain origin is unavailable')
|
|
44
44
|
return json(
|
|
45
45
|
await launchViewSession(
|
|
@@ -18,7 +18,7 @@ export async function handleWorkspaceRoute(
|
|
|
18
18
|
const bundle = await getBundle(handle.id)
|
|
19
19
|
return {
|
|
20
20
|
id: handle.id,
|
|
21
|
-
origin: bundle?.
|
|
21
|
+
origin: bundle?.ir?.domain || handle.origin || handle.id,
|
|
22
22
|
path: handle.root,
|
|
23
23
|
schemaDir: handle.schemaDirName,
|
|
24
24
|
depsInstalled: depsInstalled(handle.root),
|
|
@@ -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,34 +4,37 @@ import { decodeBundleCacheEntry } from './cache'
|
|
|
4
4
|
|
|
5
5
|
function entry(): Record<string, unknown> {
|
|
6
6
|
return {
|
|
7
|
-
version:
|
|
7
|
+
version: 6,
|
|
8
8
|
key: 'cache-key',
|
|
9
|
-
futureEntryField: { version:
|
|
9
|
+
futureEntryField: { version: 6 },
|
|
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
|
-
origin: 'notes.example.dev',
|
|
27
|
-
requires: [],
|
|
28
|
-
crossDomainImports: [],
|
|
29
|
-
mixins: [],
|
|
30
30
|
handlerLinks: [],
|
|
31
31
|
sourceSpans: {},
|
|
32
|
-
annotations: [],
|
|
33
32
|
},
|
|
34
|
-
|
|
33
|
+
schemaRoot: {
|
|
34
|
+
format: 'astrale.dsl',
|
|
35
|
+
version: 'v1',
|
|
36
|
+
origin: 'notes.example.dev',
|
|
37
|
+
},
|
|
35
38
|
error: null,
|
|
36
39
|
extractedAt: '2026-08-20T00:00:00.000Z',
|
|
37
40
|
futureBundleField: true,
|
|
@@ -43,9 +46,9 @@ test('bundle cache admits known structure while ignoring future fields', () => {
|
|
|
43
46
|
const decoded = decodeBundleCacheEntry(entry())
|
|
44
47
|
|
|
45
48
|
expect(decoded).toMatchObject({
|
|
46
|
-
version:
|
|
49
|
+
version: 6,
|
|
47
50
|
key: 'cache-key',
|
|
48
|
-
bundle: { domainId: 'notes', schemaMode: '
|
|
51
|
+
bundle: { domainId: 'notes', schemaMode: 'canonical-preview' },
|
|
49
52
|
})
|
|
50
53
|
expect(decoded && 'futureEntryField' in decoded).toBe(false)
|
|
51
54
|
expect(decoded && 'futureBundleField' in decoded.bundle).toBe(false)
|
|
@@ -60,11 +63,14 @@ function canonicalEntry(): Record<string, unknown> {
|
|
|
60
63
|
format: 'astrale.dsl',
|
|
61
64
|
version: 'v1',
|
|
62
65
|
domain: 'notes.example.dev',
|
|
63
|
-
types: {},
|
|
64
|
-
interfaces: {},
|
|
65
66
|
classes: {},
|
|
66
|
-
|
|
67
|
+
importsByKey: {},
|
|
68
|
+
importedClassesByKey: {},
|
|
67
69
|
functions: {},
|
|
70
|
+
views: {},
|
|
71
|
+
policies: {},
|
|
72
|
+
dependencies: [],
|
|
73
|
+
core: {},
|
|
68
74
|
}
|
|
69
75
|
bundle.schemaRoot = {
|
|
70
76
|
format: 'astrale.dsl',
|