@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.
Files changed (282) hide show
  1. package/README.md +16 -1
  2. package/dist/astrale.js +51105 -58057
  3. package/dist/public/connect-core.js +2085 -30702
  4. package/dist/public/keys/index.js +884 -29476
  5. package/dist/public/paths/index.js +13101 -41452
  6. package/dist/types/admin/contract.d.ts +26 -0
  7. package/dist/types/admin/instance/client.d.ts +20 -0
  8. package/dist/types/admin/instance/index.d.ts +2 -0
  9. package/dist/types/admin/instance/model.d.ts +6 -10
  10. package/dist/types/connection/auth.d.ts +3 -0
  11. package/dist/types/connection/call.d.ts +3 -0
  12. package/dist/types/connection/command.d.ts +27 -0
  13. package/dist/types/connection/credential.d.ts +14 -0
  14. package/dist/types/connection/errors.d.ts +1 -0
  15. package/dist/types/connection/exchange.d.ts +9 -0
  16. package/dist/types/connection/failure/classify.d.ts +2 -0
  17. package/dist/types/connection/failure/index.d.ts +5 -0
  18. package/dist/types/connection/failure/model.d.ts +25 -0
  19. package/dist/types/connection/failure/render.d.ts +3 -0
  20. package/dist/types/connection/index.d.ts +8 -0
  21. package/dist/types/connection/reasons.d.ts +37 -0
  22. package/dist/types/connection/self.d.ts +37 -0
  23. package/dist/types/connection/session.d.ts +31 -0
  24. package/dist/types/connection/target.d.ts +38 -0
  25. package/dist/types/errors.d.ts +1 -1
  26. package/dist/types/lib/admin-instance.d.ts +17 -0
  27. package/dist/types/lib/admin-target.d.ts +11 -36
  28. package/dist/types/lib/config.d.ts +7 -59
  29. package/dist/types/lib/failure-debug.d.ts +1 -0
  30. package/dist/types/lib/idp.d.ts +25 -173
  31. package/dist/types/lib/instance-target.d.ts +1 -1
  32. package/dist/types/lib/instance.d.ts +30 -88
  33. package/dist/types/lib/log.d.ts +5 -3
  34. package/dist/types/lib/output.d.ts +1 -1
  35. package/dist/types/lib/proc.d.ts +43 -0
  36. package/dist/types/lib/self.d.ts +9 -0
  37. package/dist/types/lib/update.d.ts +109 -0
  38. package/dist/types/lib/validation.d.ts +4 -1
  39. package/package.json +15 -20
  40. package/src/__tests__/fixtures/publication.ts +20 -0
  41. package/src/admin/.spec/architecture.md +12 -5
  42. package/src/admin/__tests__/fixture.ts +25 -0
  43. package/src/admin/catalog/.spec/api.d.ts +1 -3
  44. package/src/admin/catalog/.spec/architecture.md +5 -4
  45. package/src/admin/catalog/__tests__/client.test.ts +143 -69
  46. package/src/admin/catalog/client.ts +40 -54
  47. package/src/admin/catalog/model.ts +3 -4
  48. package/src/admin/contract.ts +46 -0
  49. package/src/admin/graph/.spec/api.d.ts +4 -10
  50. package/src/admin/graph/nodes.ts +1 -1
  51. package/src/admin/instance/.spec/api.d.ts +5 -9
  52. package/src/admin/instance/.spec/architecture.md +7 -7
  53. package/src/admin/instance/__tests__/client.test.ts +157 -175
  54. package/src/admin/instance/client.ts +39 -128
  55. package/src/admin/instance/index.ts +1 -2
  56. package/src/admin/instance/model.ts +12 -18
  57. package/src/commands/__tests__/admin-instance.test.ts +11 -8
  58. package/src/commands/__tests__/call-describe.test.ts +46 -33
  59. package/src/commands/__tests__/call.test.ts +34 -0
  60. package/src/commands/__tests__/domain-install-operation.test.ts +7 -22
  61. package/src/commands/__tests__/domain-install-owned.test.ts +1 -1
  62. package/src/commands/__tests__/domain-list.test.ts +5 -25
  63. package/src/commands/__tests__/install-direct.test.ts +115 -8
  64. package/src/commands/__tests__/install-identity-override.test.ts +3 -14
  65. package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
  66. package/src/commands/__tests__/instance-status.test.ts +139 -0
  67. package/src/commands/__tests__/introspect-parse.test.ts +80 -1
  68. package/src/commands/__tests__/logs.test.ts +250 -2
  69. package/src/commands/__tests__/read-commands.test.ts +62 -10
  70. package/src/commands/__tests__/token-ttl.test.ts +49 -4
  71. package/src/commands/__tests__/update.test.ts +25 -3
  72. package/src/commands/__tests__/view.test.ts +49 -0
  73. package/src/commands/call-describe.ts +60 -68
  74. package/src/commands/call.ts +71 -59
  75. package/src/commands/domain/install.ts +54 -35
  76. package/src/commands/domain/list.ts +1 -1
  77. package/src/commands/domain/publish.ts +14 -11
  78. package/src/commands/domain/uninstall.ts +2 -2
  79. package/src/commands/get.ts +14 -15
  80. package/src/commands/identity/__tests__/register.test.ts +3 -3
  81. package/src/commands/identity/register.ts +5 -4
  82. package/src/commands/instance/create.ts +8 -16
  83. package/src/commands/instance/delete.ts +12 -9
  84. package/src/commands/instance/list.ts +2 -2
  85. package/src/commands/instance/status.ts +66 -20
  86. package/src/commands/instance/use.ts +16 -12
  87. package/src/commands/introspect.ts +48 -35
  88. package/src/commands/logs.ts +123 -33
  89. package/src/commands/mutate.ts +6 -5
  90. package/src/commands/query.ts +35 -32
  91. package/src/commands/token.ts +42 -27
  92. package/src/commands/ui/__tests__/commands.test.ts +152 -0
  93. package/src/commands/ui/add.ts +51 -0
  94. package/src/commands/ui/doctor.ts +13 -0
  95. package/src/commands/ui/init.ts +38 -0
  96. package/src/commands/ui/list.ts +26 -0
  97. package/src/commands/ui/preset-apply.ts +19 -0
  98. package/src/commands/ui/preset-list.ts +12 -0
  99. package/src/commands/ui/shared.ts +25 -0
  100. package/src/commands/update.ts +31 -11
  101. package/src/commands/view.ts +82 -37
  102. package/src/connection/.spec/api.d.ts +7 -8
  103. package/src/connection/.spec/architecture.md +5 -4
  104. package/src/connection/.spec/flows/session.ts +2 -2
  105. package/src/connection/.spec/laws/connection.ts +6 -2
  106. package/src/connection/.spec/layout.ts +1 -0
  107. package/src/connection/__tests__/credential.test.ts +20 -1
  108. package/src/connection/__tests__/errors.test.ts +27 -20
  109. package/src/connection/__tests__/exchange.test.ts +30 -1
  110. package/src/connection/__tests__/failure-fixtures.ts +39 -0
  111. package/src/connection/__tests__/failure-safety.test.ts +75 -0
  112. package/src/connection/__tests__/self.test.ts +31 -11
  113. package/src/connection/__tests__/session.test.ts +3 -3
  114. package/src/connection/__tests__/target.test.ts +1 -0
  115. package/src/connection/auth.ts +13 -0
  116. package/src/connection/call.ts +1 -1
  117. package/src/connection/credential.ts +2 -2
  118. package/src/connection/errors.ts +1 -355
  119. package/src/connection/exchange.ts +47 -23
  120. package/src/connection/failure/classify.ts +110 -0
  121. package/src/connection/failure/index.ts +18 -0
  122. package/src/connection/failure/model.ts +28 -0
  123. package/src/connection/failure/render.ts +116 -0
  124. package/src/connection/reasons.ts +16 -0
  125. package/src/connection/self.ts +39 -21
  126. package/src/connection/session.ts +19 -8
  127. package/src/errors.ts +3 -2
  128. package/src/graph/.spec/api.d.ts +12 -5
  129. package/src/graph/.spec/layout.ts +9 -1
  130. package/src/graph/__tests__/mutation.test.ts +2 -2
  131. package/src/graph/__tests__/query.test.ts +25 -6
  132. package/src/graph/class.ts +30 -0
  133. package/src/graph/index.ts +1 -0
  134. package/src/graph/query.ts +21 -32
  135. package/src/identity/.spec/api.d.ts +2 -2
  136. package/src/identity/__tests__/registration.test.ts +1 -1
  137. package/src/identity/registration.ts +3 -3
  138. package/src/keys/__tests__/keys.test.ts +4 -0
  139. package/src/keys/credential.ts +1 -0
  140. package/src/lib/__tests__/admin-target.test.ts +12 -0
  141. package/src/lib/__tests__/binary.test.ts +16 -1
  142. package/src/lib/__tests__/command-dx.test.ts +1 -1
  143. package/src/lib/__tests__/domain-publication.test.ts +10 -16
  144. package/src/lib/__tests__/idp.test.ts +34 -4
  145. package/src/lib/__tests__/instance-candidates.test.ts +1 -3
  146. package/src/lib/__tests__/instance-target.test.ts +7 -39
  147. package/src/lib/__tests__/log-errors.test.ts +64 -0
  148. package/src/lib/__tests__/studio-server-deps.test.ts +1 -1
  149. package/src/lib/__tests__/update.test.ts +264 -11
  150. package/src/lib/__tests__/view-assets.test.ts +14 -0
  151. package/src/lib/__tests__/view-external-open-intent.test.ts +150 -0
  152. package/src/lib/__tests__/view-external-open-origins.test.ts +27 -0
  153. package/src/lib/__tests__/view-open-intent.test.ts +0 -2
  154. package/src/lib/__tests__/view-server.test.ts +26 -3
  155. package/src/lib/__tests__/view-session.test.ts +2 -1
  156. package/src/lib/admin-instance.ts +14 -8
  157. package/src/lib/admin-target.ts +21 -2
  158. package/src/lib/binary.ts +22 -5
  159. package/src/lib/command-dx.ts +9 -9
  160. package/src/lib/domain-publication.ts +9 -7
  161. package/src/lib/failure-debug.ts +26 -0
  162. package/src/lib/idp.ts +34 -3
  163. package/src/lib/instance-candidates.ts +2 -2
  164. package/src/lib/instance-target.ts +3 -14
  165. package/src/lib/instance.ts +16 -11
  166. package/src/lib/log.ts +16 -9
  167. package/src/lib/output.ts +1 -1
  168. package/src/lib/proc.ts +7 -2
  169. package/src/lib/provision-instance.ts +34 -57
  170. package/src/lib/update.ts +298 -45
  171. package/src/lib/validation.ts +2 -2
  172. package/src/lib/view/assets.ts +11 -2
  173. package/src/lib/view/external-open-intent.ts +41 -0
  174. package/src/lib/view/external-open-origins.ts +37 -0
  175. package/src/lib/view/host-capabilities.ts +17 -0
  176. package/src/lib/view/resolve.ts +1 -1
  177. package/src/lib/view/server.ts +18 -3
  178. package/src/lib/view/session.ts +2 -0
  179. package/src/program/.spec/api.d.ts +1 -0
  180. package/src/program/__tests__/program.test.ts +163 -6
  181. package/src/program/argv.ts +14 -0
  182. package/src/program/build.ts +26 -4
  183. package/src/program/command.ts +1 -0
  184. package/src/program/index.ts +1 -0
  185. package/src/program/registry.ts +2 -1
  186. package/src/setup/__tests__/instance-step.test.ts +27 -10
  187. package/src/setup/steps/instance.ts +22 -15
  188. package/src/telemetry/__tests__/recorder.test.ts +1 -0
  189. package/src/telemetry/recorder.ts +9 -1
  190. package/src/ui/.spec/api.d.ts +14 -0
  191. package/src/ui/.spec/architecture.md +10 -0
  192. package/src/ui/.spec/laws.ts +36 -0
  193. package/src/ui/.spec/layout.ts +16 -0
  194. package/src/ui/__tests__/ui.test.ts +981 -0
  195. package/src/ui/index.ts +13 -0
  196. package/src/ui/lock.ts +87 -0
  197. package/src/ui/model.ts +83 -0
  198. package/src/ui/operations.ts +710 -0
  199. package/src/ui/project.ts +219 -0
  200. package/src/ui/release.ts +321 -0
  201. package/src/ui/runner.ts +18 -0
  202. package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
  203. package/studio/client/dist/assets/index-7YHdeCxp.js +81 -0
  204. package/studio/client/dist/assets/index-C0FAnwNw.css +2 -0
  205. package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
  206. package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +1 -0
  207. package/studio/client/dist/assets/schema-studio-CABpTfvH.js +8 -0
  208. package/studio/client/dist/index.html +3 -2
  209. package/studio/package.json +7 -13
  210. package/studio/server/agent/ask.test.ts +1 -1
  211. package/studio/server/agent/bridge/grant.test.ts +1 -1
  212. package/studio/server/agent/bridge/routes.test.ts +1 -1
  213. package/studio/server/agent/harness/claude/adapter.test.ts +15 -5
  214. package/studio/server/agent/harness/gateway/token.test.ts +1 -1
  215. package/studio/server/agent/harness/gateway/token.ts +3 -3
  216. package/studio/server/agent/prompts/anchors.test.ts +32 -36
  217. package/studio/server/agent/prompts/anchors.ts +20 -49
  218. package/studio/server/agent/prompts/system.test.ts +3 -2
  219. package/studio/server/agent/prompts/system.ts +3 -3
  220. package/studio/server/agent/routes.test.ts +1 -1
  221. package/studio/server/agent/run/coordinator.test.ts +1 -1
  222. package/studio/server/api/canvas.ts +0 -1
  223. package/studio/server/api-agent-loadout.test.ts +1 -1
  224. package/studio/server/api.test.ts +1 -1
  225. package/studio/server/cache.test.ts +23 -12
  226. package/studio/server/cache.ts +12 -15
  227. package/studio/server/domain.test.ts +50 -68
  228. package/studio/server/domain.ts +82 -63
  229. package/studio/server/handoff/copy.ts +1 -1
  230. package/studio/server/index.ts +1 -1
  231. package/studio/server/instances/probe.test.ts +1 -1
  232. package/studio/server/introspect/anatomy/views/routes.ts +46 -37
  233. package/studio/server/introspect/anatomy/views.ts +9 -14
  234. package/studio/server/introspect/anatomy-extras.test.ts +26 -42
  235. package/studio/server/introspect/anatomy.test.ts +22 -14
  236. package/studio/server/introspect/anatomy.ts +6 -9
  237. package/studio/server/introspect/bundle.ts +0 -3
  238. package/studio/server/introspect/canonical-schema.test.ts +94 -389
  239. package/studio/server/introspect/canonical-schema.ts +227 -457
  240. package/studio/server/introspect/core-extractor.ts +18 -127
  241. package/studio/server/introspect/core.ts +1 -2
  242. package/studio/server/introspect/diff.test.ts +11 -7
  243. package/studio/server/introspect/diff.ts +18 -55
  244. package/studio/server/introspect/extractor.ts +22 -117
  245. package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
  246. package/studio/server/introspect/overlay.test.ts +26 -54
  247. package/studio/server/introspect/overlay.ts +10 -37
  248. package/studio/server/introspect/revision.test.ts +1 -1
  249. package/studio/server/introspect/revision.ts +1 -1
  250. package/studio/server/introspect/runtime.test.ts +65 -183
  251. package/studio/server/introspect/runtime.ts +8 -25
  252. package/studio/server/introspect/schema-ir-json.test.ts +70 -0
  253. package/studio/server/introspect/schema-ir-json.ts +38 -68
  254. package/studio/server/introspect/schema-refs.test.ts +43 -88
  255. package/studio/server/introspect/schema-refs.ts +14 -49
  256. package/studio/server/introspect/source-overlay/handlers.ts +116 -636
  257. package/studio/server/introspect/source-overlay/kernel-calls.ts +0 -3
  258. package/studio/server/introspect/source-overlay/spans.ts +15 -45
  259. package/studio/server/state/baseline.test.ts +14 -9
  260. package/studio/server/state/baseline.ts +3 -5
  261. package/studio/server/state/visibility.ts +1 -5
  262. package/studio/server/views/model.ts +3 -3
  263. package/studio/server/views/target.test.ts +17 -74
  264. package/studio/server/views/target.ts +24 -50
  265. package/studio/server/watch.test.ts +11 -11
  266. package/studio/server/watch.ts +8 -4
  267. package/studio/server/workspace-watch.ts +2 -2
  268. package/studio/shared/contracts/schema.ts +38 -107
  269. package/studio/shared/contracts/surface.test.ts +13 -15
  270. package/studio/shared/contracts/workspace.ts +2 -11
  271. package/studio/shared/schema/identity.test.ts +20 -44
  272. package/studio/shared/schema/identity.ts +9 -23
  273. package/viewer/dist/main.js +30 -51
  274. package/.check-workspace.cjs +0 -40
  275. package/src/admin/binding.ts +0 -168
  276. package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
  277. package/studio/client/dist/assets/elk-api-lwhFo7vB.js +0 -1
  278. package/studio/client/dist/assets/index-B-c-smo9.js +0 -8
  279. package/studio/client/dist/assets/index-BckHuAWk.js +0 -81
  280. package/studio/client/dist/assets/index-C4aNQ6dz.css +0 -1
  281. package/studio/client/dist/assets/index-ChOr3yP0.css +0 -1
  282. 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-BckHuAWk.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-C4aNQ6dz.css">
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>
@@ -21,7 +21,8 @@
21
21
  "typecheck": "tsgo --noEmit"
22
22
  },
23
23
  "dependencies": {
24
- "@astrale-os/shell": "file:../vendor/astrale-os-shell-0.3.8-beta.2.tgz",
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": "^0.475.0",
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
- "@vitejs/plugin-react": "^5.0.0",
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": "^5.7.3",
62
- "vite": "^7.0.0"
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, 'domain.ts'), 'export default {}\n')
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
- domainFile: join(root, 'domain.ts'),
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
- domainFile: join(root, 'domain.ts'),
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
- await waitFor(() => existsSync(pidLog))
327
- const pids = JSON.parse(readFileSync(pidLog, 'utf8')) as { parent: number; child: number }
328
- expect(processExists(pids.parent)).toBe(true)
329
- expect(processExists(pids.child)).toBe(true)
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(pids.parent) && !processExists(pids.child))
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', '3600', '--raw', '-i', 'prod'],
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 = 3600
16
- const REFRESH_SKEW_MS = 5 * 60_000
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:interface.Named' as const
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
- types: {},
14
- interfaces: {},
15
- classes: {},
16
- imports: {},
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: 'interface', name: 'Named' },
27
+ ref: { origin: 'directory.example.dev', kind: 'class', name: 'Named' },
23
28
  },
24
29
  },
25
- importedInterfacesByKey: {
30
+ importedClassesByKey: {
26
31
  [importedKey]: {
27
- type: 'interface',
32
+ type: 'node',
28
33
  name: 'Named',
29
34
  origin: 'directory.example.dev',
30
- ref: { origin: 'directory.example.dev', kind: 'interface', name: 'Named' },
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('canonical anchor descriptions', () => {
56
- test('describes standalone Functions with exact input, output mode, and auth', () => {
57
- expect(describeAnchor('function.inspect', ir, undefined)).toContain(
58
- 'inspect(cursor:string?)→stream<int> [static,authenticated]',
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('resolves an imported interface member by its qualified identity', () => {
63
- expect(
64
- describeAnchor(
65
- 'interface.directory.example.dev:interface.Named.property.label',
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
- IrDefinitionKey,
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 params = Object.entries(m.params ?? {})
37
- .map(
38
- ([p, s]) =>
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?.mode === 'stream'
41
+ m.output.mode === 'stream'
44
42
  ? `stream<${propType(m.output.item)}>`
45
- : m.output?.mode === 'binary'
43
+ : m.output.mode === 'binary'
46
44
  ? 'binary'
47
- : propType(m.output?.mode === 'value' ? m.output.schema : m.returns)
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 interfaceByToken(ir: SchemaIR, token: string): IrInterface | undefined {
57
- const exact = /^(.+):interface\.([A-Za-z_$][\w$]*)$/.exec(token)
58
- if (!exact) return ir.interfaces?.[token]
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.interfaces?.[name]
61
- return ir.importedInterfacesByKey?.[`${origin}:interface.${name}` as IrDefinitionKey]
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\.([^.]+)\.(property|method)\.(.+)$/)
78
+ const member = ref.match(/^class\.(.+)\.(property|method)\.([^.]+)$/)
81
79
  if (member && ir) {
82
80
  const [, cls, kind, name] = member
83
- const c = ir.classes?.[cls]
81
+ const c = classByToken(ir, cls)
84
82
  if (c && kind === 'property' && c.properties?.[name])
85
- return `**${cls}.${name}** : ${propType(c.properties[name], c.required ? !c.required.includes(name) : undefined)}${loc ? ` (${loc})` : ''}${doc}`
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 `**${cls}.${name}** — ${methodSig(name, c.methods[name])}${loc ? ` (${loc})` : ''}${doc}`
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.classes?.[cm[1]]
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('implementation.ts')
8
+ expect(prompt).toContain('modular Actions and Workflows')
9
9
  expect(prompt).toContain('pre-Kernel-V2 APIs or layouts')
10
- expect(prompt).toContain('domain.ts/runtime only when this is already a legacy project')
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 compose schema, handlers, and frontend metadata in implementation.ts;',
32
- ' wire new modules explicitly through their layer facades and that entry. Preserve',
33
- ' domain.ts/runtime only when this is already a legacy project (no folder magic).',
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, 'domain.ts'), 'export default {}\n')
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, 'domain.ts'), 'export default {}\n')
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, 'domain.ts'), 'export default {}\n')
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, 'domain.ts'), 'export default {}\n')
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: 4,
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: 'legacy',
13
+ schemaMode: 'canonical-preview',
14
14
  extractedBy: 'runtime-bun',
15
15
  depsInstalled: true,
16
16
  ir: {
17
- version: 'legacy',
17
+ format: 'astrale.dsl',
18
+ version: 'v1',
18
19
  domain: 'notes.example.dev',
19
- types: {},
20
- interfaces: {},
21
20
  classes: {},
22
- imports: {},
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
- importedInterfaces: {},
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: 4,
54
+ version: 5,
47
55
  key: 'cache-key',
48
- bundle: { domainId: 'notes', schemaMode: 'legacy' },
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
- imports: {},
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',
@@ -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 { decodeIrInterfaceRecord, decodeSchemaIR } from './introspect/schema-ir-json'
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 = 4
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
- (record.definition === 'class' || record.definition === 'interface')
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', 'interface', 'function'].includes(String(record.ownerKind)) &&
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
- ['canonical-admitted', 'canonical-preview', 'legacy', 'unavailable'] as const
130
- ).find((candidate) => candidate === record.schemaMode)
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 schema (or the legacy composition entry),
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
  }