@astrale-os/cli 1.0.0-beta.1 → 1.0.0-beta.11

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 (329) hide show
  1. package/README.md +23 -12
  2. package/dist/astrale.js +48048 -56798
  3. package/dist/public/connect-core.js +2011 -30765
  4. package/dist/public/keys/index.js +884 -29483
  5. package/dist/public/paths/index.js +13101 -41459
  6. package/dist/types/admin/binding.d.ts +19 -0
  7. package/dist/types/admin/instance/client.d.ts +22 -0
  8. package/dist/types/admin/instance/index.d.ts +2 -0
  9. package/dist/types/admin/instance/model.d.ts +5 -12
  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 +26 -168
  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/meta.d.ts +2 -2
  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 +91 -0
  38. package/dist/types/lib/validation.d.ts +4 -1
  39. package/package.json +16 -19
  40. package/src/__tests__/fixtures/publication.ts +20 -0
  41. package/src/admin/__tests__/binding.test.ts +31 -0
  42. package/src/admin/__tests__/fixture.ts +101 -0
  43. package/src/admin/binding.ts +98 -0
  44. package/src/admin/catalog/.spec/api.d.ts +2 -2
  45. package/src/admin/catalog/__tests__/client.test.ts +20 -49
  46. package/src/admin/catalog/client.ts +36 -32
  47. package/src/admin/catalog/model.ts +3 -4
  48. package/src/admin/graph/.spec/api.d.ts +4 -10
  49. package/src/admin/graph/nodes.ts +1 -1
  50. package/src/admin/instance/.spec/api.d.ts +2 -2
  51. package/src/admin/instance/__tests__/client.test.ts +39 -164
  52. package/src/admin/instance/client.ts +35 -124
  53. package/src/admin/instance/index.ts +1 -2
  54. package/src/admin/instance/model.ts +11 -20
  55. package/src/commands/__tests__/admin-instance.test.ts +11 -8
  56. package/src/commands/__tests__/auth-login.test.ts +54 -1
  57. package/src/commands/__tests__/call-describe.test.ts +46 -33
  58. package/src/commands/__tests__/call.test.ts +5 -1
  59. package/src/commands/__tests__/domain-install-operation.test.ts +12 -7
  60. package/src/commands/__tests__/domain-install-owned.test.ts +6 -2
  61. package/src/commands/__tests__/domain-list.test.ts +63 -4
  62. package/src/commands/__tests__/install-identity-override.test.ts +19 -19
  63. package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
  64. package/src/commands/__tests__/instance-status.test.ts +139 -0
  65. package/src/commands/__tests__/read-commands.test.ts +35 -10
  66. package/src/commands/__tests__/studio-descriptor.test.ts +22 -0
  67. package/src/commands/__tests__/update.test.ts +48 -19
  68. package/src/commands/call-describe.ts +60 -68
  69. package/src/commands/call.ts +43 -56
  70. package/src/commands/domain/install.ts +13 -17
  71. package/src/commands/domain/list.ts +18 -13
  72. package/src/commands/domain/publish.ts +14 -11
  73. package/src/commands/domain/uninstall.ts +2 -2
  74. package/src/commands/get.ts +14 -15
  75. package/src/commands/identity/__tests__/register.test.ts +3 -3
  76. package/src/commands/identity/register.ts +5 -4
  77. package/src/commands/instance/create.ts +8 -16
  78. package/src/commands/instance/delete.ts +12 -9
  79. package/src/commands/instance/list.ts +2 -2
  80. package/src/commands/instance/status.ts +66 -20
  81. package/src/commands/instance/use.ts +16 -12
  82. package/src/commands/introspect.ts +9 -16
  83. package/src/commands/logs.ts +24 -25
  84. package/src/commands/mutate.ts +6 -5
  85. package/src/commands/query.ts +27 -30
  86. package/src/commands/studio.ts +20 -0
  87. package/src/commands/token.ts +8 -7
  88. package/src/commands/update.ts +38 -14
  89. package/src/commands/view.ts +7 -6
  90. package/src/connection/.spec/api.d.ts +7 -8
  91. package/src/connection/.spec/architecture.md +5 -4
  92. package/src/connection/.spec/flows/session.ts +2 -2
  93. package/src/connection/.spec/laws/connection.ts +6 -2
  94. package/src/connection/.spec/layout.ts +1 -0
  95. package/src/connection/__tests__/credential.test.ts +20 -1
  96. package/src/connection/__tests__/errors.test.ts +43 -32
  97. package/src/connection/__tests__/exchange.test.ts +36 -6
  98. package/src/connection/__tests__/failure-fixtures.ts +39 -0
  99. package/src/connection/__tests__/failure-safety.test.ts +75 -0
  100. package/src/connection/__tests__/self.test.ts +31 -11
  101. package/src/connection/__tests__/session.test.ts +3 -3
  102. package/src/connection/__tests__/target.test.ts +1 -0
  103. package/src/connection/auth.ts +13 -0
  104. package/src/connection/call.ts +1 -1
  105. package/src/connection/credential.ts +2 -2
  106. package/src/connection/errors.ts +1 -355
  107. package/src/connection/exchange.ts +52 -27
  108. package/src/connection/failure/classify.ts +110 -0
  109. package/src/connection/failure/index.ts +18 -0
  110. package/src/connection/failure/model.ts +28 -0
  111. package/src/connection/failure/render.ts +116 -0
  112. package/src/connection/reasons.ts +16 -0
  113. package/src/connection/self.ts +39 -21
  114. package/src/connection/session.ts +19 -8
  115. package/src/errors.ts +3 -2
  116. package/src/graph/.spec/api.d.ts +12 -5
  117. package/src/graph/.spec/layout.ts +9 -1
  118. package/src/graph/__tests__/mutation.test.ts +2 -2
  119. package/src/graph/__tests__/query.test.ts +25 -6
  120. package/src/graph/class.ts +30 -0
  121. package/src/graph/index.ts +1 -0
  122. package/src/graph/query.ts +21 -32
  123. package/src/identity/.spec/api.d.ts +2 -2
  124. package/src/identity/__tests__/registration.test.ts +1 -1
  125. package/src/identity/registration.ts +3 -3
  126. package/src/keys/__tests__/keys.test.ts +4 -0
  127. package/src/keys/credential.ts +1 -0
  128. package/src/lib/__tests__/admin-target.test.ts +12 -0
  129. package/src/lib/__tests__/command-dx.test.ts +1 -1
  130. package/src/lib/__tests__/domain-publication.test.ts +138 -0
  131. package/src/lib/__tests__/idp-session.test.ts +22 -0
  132. package/src/lib/__tests__/idp.test.ts +36 -4
  133. package/src/lib/__tests__/instance-candidates.test.ts +1 -3
  134. package/src/lib/__tests__/instance-target.test.ts +7 -39
  135. package/src/lib/__tests__/instance.test.ts +6 -0
  136. package/src/lib/__tests__/log-errors.test.ts +64 -0
  137. package/src/lib/__tests__/studio-server-deps.test.ts +53 -16
  138. package/src/lib/__tests__/update.test.ts +113 -8
  139. package/src/lib/__tests__/view-open-intent.test.ts +0 -2
  140. package/src/lib/__tests__/view-server.test.ts +18 -3
  141. package/src/lib/__tests__/view-session.test.ts +1 -1
  142. package/src/lib/admin-instance.ts +14 -8
  143. package/src/lib/admin-target.ts +21 -2
  144. package/src/lib/command-dx.ts +9 -9
  145. package/src/lib/domain-publication.ts +104 -0
  146. package/src/lib/failure-debug.ts +26 -0
  147. package/src/lib/idp.ts +39 -4
  148. package/src/lib/instance-candidates.ts +2 -2
  149. package/src/lib/instance-target.ts +3 -14
  150. package/src/lib/instance.ts +22 -12
  151. package/src/lib/log.ts +16 -9
  152. package/src/lib/login-flow.ts +13 -3
  153. package/src/lib/meta.ts +2 -2
  154. package/src/lib/provision-instance.ts +34 -57
  155. package/src/lib/update.ts +124 -30
  156. package/src/lib/validation.ts +2 -2
  157. package/src/lib/view/resolve.ts +1 -1
  158. package/src/lib/view/server.ts +17 -3
  159. package/src/program/__tests__/program.test.ts +20 -4
  160. package/src/program/build.ts +2 -2
  161. package/src/setup/__tests__/instance-step.test.ts +27 -10
  162. package/src/setup/steps/instance.ts +22 -15
  163. package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
  164. package/studio/client/dist/assets/index-7YHdeCxp.js +81 -0
  165. package/studio/client/dist/assets/index-C0FAnwNw.css +2 -0
  166. package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
  167. package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +1 -0
  168. package/studio/client/dist/assets/schema-studio-CABpTfvH.js +8 -0
  169. package/studio/client/dist/index.html +3 -2
  170. package/studio/package.json +10 -14
  171. package/studio/server/agent/ask.test.ts +1 -1
  172. package/studio/server/agent/bridge/grant.test.ts +1 -1
  173. package/studio/server/agent/bridge/routes.test.ts +1 -1
  174. package/studio/server/agent/bridge/stdio.ts +8 -1
  175. package/studio/server/agent/conversation.test.ts +10 -5
  176. package/studio/server/agent/conversation.ts +56 -8
  177. package/studio/server/agent/harness/claude/adapter.test.ts +15 -5
  178. package/studio/server/agent/harness/codex/loadout.ts +18 -21
  179. package/studio/server/agent/harness/gateway/config.ts +20 -18
  180. package/studio/server/agent/harness/selection.ts +9 -1
  181. package/studio/server/agent/prompts/anchors.test.ts +32 -36
  182. package/studio/server/agent/prompts/anchors.ts +20 -49
  183. package/studio/server/agent/prompts/system.test.ts +3 -2
  184. package/studio/server/agent/prompts/system.ts +6 -5
  185. package/studio/server/agent/prompts/turn.ts +13 -4
  186. package/studio/server/agent/routes.test.ts +1 -1
  187. package/studio/server/agent/run/completion.ts +2 -2
  188. package/studio/server/agent/run/coordinator.test.ts +1 -1
  189. package/studio/server/agent/run/preparation.ts +6 -5
  190. package/studio/server/agent/run/transcript.test.ts +35 -1
  191. package/studio/server/agent/run/transcript.ts +169 -3
  192. package/studio/server/agent/run/usage.test.ts +24 -0
  193. package/studio/server/agent/run/usage.ts +26 -1
  194. package/studio/server/api/canvas.ts +43 -0
  195. package/studio/server/api/comments.ts +85 -0
  196. package/studio/server/api/context.ts +61 -0
  197. package/studio/server/api/deployment.ts +39 -0
  198. package/studio/server/api/documents.ts +55 -0
  199. package/studio/server/api/domain.ts +59 -0
  200. package/studio/server/api/http.ts +45 -0
  201. package/studio/server/api/project.ts +57 -0
  202. package/studio/server/api/schema.ts +12 -0
  203. package/studio/server/api/views.ts +57 -0
  204. package/studio/server/api/workspace.ts +60 -0
  205. package/studio/server/api-agent-loadout.test.ts +1 -1
  206. package/studio/server/api.test.ts +147 -0
  207. package/studio/server/api.ts +20 -422
  208. package/studio/server/cache.test.ts +122 -0
  209. package/studio/server/cache.ts +162 -11
  210. package/studio/server/cli-consumers.test.ts +494 -0
  211. package/studio/server/cli.test.ts +88 -0
  212. package/studio/server/cli.ts +240 -0
  213. package/studio/server/client-package.ts +25 -1
  214. package/studio/server/domain.test.ts +50 -40
  215. package/studio/server/domain.ts +83 -52
  216. package/studio/server/environment/dotenv-preview.test.ts +39 -0
  217. package/studio/server/environment/dotenv-preview.ts +27 -0
  218. package/studio/server/environment/files.test.ts +53 -0
  219. package/studio/server/{state/env.ts → environment/files.ts} +7 -48
  220. package/studio/server/{state → handoff}/copy.ts +21 -6
  221. package/studio/server/handoff/service.test.ts +22 -0
  222. package/studio/server/{state/handoff.ts → handoff/service.ts} +21 -14
  223. package/studio/server/index.ts +1 -1
  224. package/studio/server/instances/active.ts +72 -0
  225. package/studio/server/instances/deploy-record.test.ts +31 -0
  226. package/studio/server/instances/deploy-record.ts +37 -0
  227. package/studio/server/instances/deploy.ts +56 -0
  228. package/studio/server/{state/instance.test.ts → instances/probe.test.ts} +25 -21
  229. package/studio/server/instances/probe.ts +67 -0
  230. package/studio/server/instances/status.test.ts +12 -0
  231. package/studio/server/instances/status.ts +49 -0
  232. package/studio/server/introspect/anatomy/client-tree.ts +57 -0
  233. package/studio/server/introspect/anatomy/env-fields.ts +66 -0
  234. package/studio/server/introspect/anatomy/schema-definition.ts +53 -0
  235. package/studio/server/introspect/anatomy/source.ts +181 -0
  236. package/studio/server/introspect/anatomy/views/routes.ts +114 -0
  237. package/studio/server/introspect/anatomy/views.ts +53 -0
  238. package/studio/server/introspect/anatomy-extras.test.ts +106 -35
  239. package/studio/server/introspect/anatomy-extras.ts +7 -726
  240. package/studio/server/introspect/anatomy.test.ts +22 -14
  241. package/studio/server/introspect/anatomy.ts +52 -28
  242. package/studio/server/introspect/bundle.ts +15 -9
  243. package/studio/server/introspect/canonical-schema.test.ts +93 -309
  244. package/studio/server/introspect/canonical-schema.ts +257 -425
  245. package/studio/server/introspect/config-preview.test.ts +32 -0
  246. package/studio/server/introspect/config-preview.ts +119 -0
  247. package/studio/server/introspect/core-extractor.ts +18 -127
  248. package/studio/server/introspect/core.ts +1 -2
  249. package/studio/server/introspect/diff.test.ts +18 -18
  250. package/studio/server/introspect/diff.ts +44 -90
  251. package/studio/server/introspect/extractor.ts +23 -116
  252. package/studio/server/introspect/hash.ts +5 -2
  253. package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
  254. package/studio/server/introspect/overlay-tsmorph.ts +7 -1305
  255. package/studio/server/introspect/overlay.test.ts +26 -54
  256. package/studio/server/introspect/overlay.ts +10 -37
  257. package/studio/server/introspect/revision.test.ts +54 -0
  258. package/studio/server/introspect/revision.ts +49 -0
  259. package/studio/server/introspect/runtime.test.ts +83 -143
  260. package/studio/server/introspect/runtime.ts +40 -11
  261. package/studio/server/introspect/schema-ir-json.test.ts +70 -0
  262. package/studio/server/introspect/schema-ir-json.ts +151 -0
  263. package/studio/server/introspect/schema-refs.test.ts +43 -88
  264. package/studio/server/introspect/schema-refs.ts +14 -49
  265. package/studio/server/introspect/source-overlay/annotations.ts +14 -0
  266. package/studio/server/introspect/source-overlay/handlers.ts +161 -0
  267. package/studio/server/introspect/source-overlay/kernel-calls.ts +46 -0
  268. package/studio/server/introspect/source-overlay/project.ts +248 -0
  269. package/studio/server/introspect/source-overlay/spans.ts +330 -0
  270. package/studio/server/json.ts +46 -0
  271. package/studio/server/lifecycle.ts +5 -1
  272. package/studio/server/sse.test.ts +26 -0
  273. package/studio/server/sse.ts +4 -1
  274. package/studio/server/state/baseline.test.ts +223 -7
  275. package/studio/server/state/baseline.ts +148 -34
  276. package/studio/server/state/comments.test.ts +66 -1
  277. package/studio/server/state/comments.ts +173 -10
  278. package/studio/server/state/context.ts +34 -2
  279. package/studio/server/state/documents.ts +42 -1
  280. package/studio/server/state/integrations.ts +27 -1
  281. package/studio/server/state/layout.test.ts +34 -0
  282. package/studio/server/state/layout.ts +44 -17
  283. package/studio/server/state/settings.ts +29 -22
  284. package/studio/server/state/store.test.ts +122 -0
  285. package/studio/server/state/store.ts +66 -17
  286. package/studio/server/state/visibility.ts +22 -11
  287. package/studio/server/views/model.test.ts +57 -0
  288. package/studio/server/views/model.ts +66 -0
  289. package/studio/server/views/runtime.ts +40 -0
  290. package/studio/server/views/selection-repository.test.ts +31 -0
  291. package/studio/server/views/selection-repository.ts +60 -0
  292. package/studio/server/views/session.test.ts +73 -0
  293. package/studio/server/views/session.ts +166 -0
  294. package/studio/server/views/target.test.ts +78 -0
  295. package/studio/server/views/target.ts +222 -0
  296. package/studio/server/watch.test.ts +11 -11
  297. package/studio/server/watch.ts +9 -5
  298. package/studio/server/workspace/catalog.test.ts +17 -0
  299. package/studio/server/workspace/catalog.ts +43 -0
  300. package/studio/server/{state → workspace}/create.test.ts +1 -1
  301. package/studio/server/{state → workspace}/create.ts +1 -1
  302. package/studio/server/{state → workspace}/git.ts +1 -1
  303. package/studio/server/workspace/updates.ts +83 -0
  304. package/studio/server/workspace-state.ts +1 -1
  305. package/studio/server/workspace-watch.ts +2 -2
  306. package/studio/shared/contracts/README.md +16 -0
  307. package/studio/shared/contracts/agent.ts +270 -0
  308. package/studio/shared/contracts/runtime.ts +50 -0
  309. package/studio/shared/contracts/schema.ts +393 -0
  310. package/studio/shared/contracts/surface.test.ts +317 -0
  311. package/studio/shared/contracts/workspace.ts +265 -0
  312. package/studio/shared/layout.test.ts +116 -0
  313. package/studio/shared/schema/identity.test.ts +34 -0
  314. package/studio/shared/schema/identity.ts +68 -0
  315. package/studio/shared/types.ts +11 -1099
  316. package/studio/tsconfig.json +1 -1
  317. package/viewer/dist/main.js +40 -61
  318. package/.check-workspace.cjs +0 -40
  319. package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
  320. package/studio/client/dist/assets/elk-api-D2xgMJvi.js +0 -1
  321. package/studio/client/dist/assets/index-BMdnsIJA.css +0 -1
  322. package/studio/client/dist/assets/index-ChOr3yP0.css +0 -1
  323. package/studio/client/dist/assets/index-D-vRV8w7.js +0 -8
  324. package/studio/client/dist/assets/index-LGSWRrk8.js +0 -81
  325. package/studio/server/state/catalog.ts +0 -117
  326. package/studio/server/state/instance.ts +0 -280
  327. package/studio/server/state/updates.ts +0 -63
  328. package/studio/server/state/views.test.ts +0 -286
  329. package/studio/server/state/views.ts +0 -535
@@ -47,114 +47,47 @@ export declare const OidcMetadataSchema: z.ZodObject<{
47
47
  jwks_uri: z.ZodString;
48
48
  device_authorization_endpoint: z.ZodOptional<z.ZodString>;
49
49
  revocation_endpoint: z.ZodOptional<z.ZodString>;
50
- scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
51
- grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
52
- response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
53
- code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
55
- issuer: z.ZodString;
56
- authorization_endpoint: z.ZodOptional<z.ZodString>;
57
- token_endpoint: z.ZodString;
58
- jwks_uri: z.ZodString;
59
- device_authorization_endpoint: z.ZodOptional<z.ZodString>;
60
- revocation_endpoint: z.ZodOptional<z.ZodString>;
61
- scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
62
- grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
- response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
- code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
65
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
66
- issuer: z.ZodString;
67
- authorization_endpoint: z.ZodOptional<z.ZodString>;
68
- token_endpoint: z.ZodString;
69
- jwks_uri: z.ZodString;
70
- device_authorization_endpoint: z.ZodOptional<z.ZodString>;
71
- revocation_endpoint: z.ZodOptional<z.ZodString>;
72
- scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
73
- grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
- response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
- code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
76
- }, z.ZodTypeAny, "passthrough">>;
50
+ scopes_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
51
+ grant_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
+ response_types_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
+ code_challenge_methods_supported: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ }, z.core.$loose>;
77
55
  export type OidcMetadata = z.infer<typeof OidcMetadataSchema>;
78
56
  export declare const IdpClientConfigSchema: z.ZodObject<{
79
57
  client_id: z.ZodOptional<z.ZodString>;
80
58
  client_secret_env: z.ZodOptional<z.ZodString>;
81
- redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
59
+ redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
60
  scope: z.ZodOptional<z.ZodString>;
83
61
  public: z.ZodOptional<z.ZodBoolean>;
84
- token_response: z.ZodOptional<z.ZodEnum<["oauth", "workos-authkit"]>>;
85
- token_request_format: z.ZodOptional<z.ZodEnum<["form", "json"]>>;
86
- workos_application_id: z.ZodOptional<z.ZodString>;
87
- workos_application_type: z.ZodOptional<z.ZodEnum<["oauth", "m2m"]>>;
88
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
89
- client_id: z.ZodOptional<z.ZodString>;
90
- client_secret_env: z.ZodOptional<z.ZodString>;
91
- redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
92
- scope: z.ZodOptional<z.ZodString>;
93
- public: z.ZodOptional<z.ZodBoolean>;
94
- token_response: z.ZodOptional<z.ZodEnum<["oauth", "workos-authkit"]>>;
95
- token_request_format: z.ZodOptional<z.ZodEnum<["form", "json"]>>;
96
- workos_application_id: z.ZodOptional<z.ZodString>;
97
- workos_application_type: z.ZodOptional<z.ZodEnum<["oauth", "m2m"]>>;
98
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
99
- client_id: z.ZodOptional<z.ZodString>;
100
- client_secret_env: z.ZodOptional<z.ZodString>;
101
- redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
102
- scope: z.ZodOptional<z.ZodString>;
103
- public: z.ZodOptional<z.ZodBoolean>;
104
- token_response: z.ZodOptional<z.ZodEnum<["oauth", "workos-authkit"]>>;
105
- token_request_format: z.ZodOptional<z.ZodEnum<["form", "json"]>>;
62
+ token_response: z.ZodOptional<z.ZodEnum<{
63
+ oauth: "oauth";
64
+ "workos-authkit": "workos-authkit";
65
+ }>>;
66
+ token_request_format: z.ZodOptional<z.ZodEnum<{
67
+ form: "form";
68
+ json: "json";
69
+ }>>;
106
70
  workos_application_id: z.ZodOptional<z.ZodString>;
107
- workos_application_type: z.ZodOptional<z.ZodEnum<["oauth", "m2m"]>>;
108
- }, z.ZodTypeAny, "passthrough">>;
71
+ workos_application_type: z.ZodOptional<z.ZodEnum<{
72
+ m2m: "m2m";
73
+ oauth: "oauth";
74
+ }>>;
75
+ }, z.core.$loose>;
109
76
  export type IdpClientConfig = z.infer<typeof IdpClientConfigSchema>;
110
77
  export declare const IdpIndexEntrySchema: z.ZodObject<{
111
78
  issuer: z.ZodString;
112
79
  builtIn: z.ZodOptional<z.ZodBoolean>;
113
80
  createdAt: z.ZodString;
114
81
  updatedAt: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- issuer: string;
117
- builtIn?: boolean | undefined;
118
- createdAt: string;
119
- updatedAt: string;
120
- }, {
121
- issuer: string;
122
- builtIn?: boolean | undefined;
123
- createdAt: string;
124
- updatedAt: string;
125
- }>;
82
+ }, z.core.$strip>;
126
83
  export declare const IdpStoreSchema: z.ZodObject<{
127
84
  idps: z.ZodRecord<z.ZodString, z.ZodObject<{
128
85
  issuer: z.ZodString;
129
86
  builtIn: z.ZodOptional<z.ZodBoolean>;
130
87
  createdAt: z.ZodString;
131
88
  updatedAt: z.ZodString;
132
- }, "strip", z.ZodTypeAny, {
133
- issuer: string;
134
- builtIn?: boolean | undefined;
135
- createdAt: string;
136
- updatedAt: string;
137
- }, {
138
- issuer: string;
139
- builtIn?: boolean | undefined;
140
- createdAt: string;
141
- updatedAt: string;
142
- }>>;
143
- }, "strip", z.ZodTypeAny, {
144
- idps: Record<string, {
145
- issuer: string;
146
- builtIn?: boolean | undefined;
147
- createdAt: string;
148
- updatedAt: string;
149
- }>;
150
- }, {
151
- idps: Record<string, {
152
- issuer: string;
153
- builtIn?: boolean | undefined;
154
- createdAt: string;
155
- updatedAt: string;
156
- }>;
157
- }>;
89
+ }, z.core.$strip>>;
90
+ }, z.core.$strip>;
158
91
  export type IdpStore = z.infer<typeof IdpStoreSchema>;
159
92
  export type IdpIndexEntry = z.infer<typeof IdpIndexEntrySchema>;
160
93
  export declare const IdpSessionSchema: z.ZodObject<{
@@ -162,6 +95,7 @@ export declare const IdpSessionSchema: z.ZodObject<{
162
95
  idp: z.ZodString;
163
96
  issuer: z.ZodString;
164
97
  subject: z.ZodString;
98
+ clientId: z.ZodOptional<z.ZodString>;
165
99
  audience: z.ZodOptional<z.ZodString>;
166
100
  organizationId: z.ZodOptional<z.ZodString>;
167
101
  access_token: z.ZodString;
@@ -171,89 +105,12 @@ export declare const IdpSessionSchema: z.ZodObject<{
171
105
  scope: z.ZodOptional<z.ZodString>;
172
106
  expires_at: z.ZodOptional<z.ZodString>;
173
107
  claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
174
- /**
175
- * Access tokens by audience. WorkOS mints one `aud` per token, so a
176
- * session juggling several instances would otherwise burn a (single-use)
177
- * refresh-token rotation on every instance flip. The top-level
178
- * `access_token`/`expires_at` stay the most recently minted token for
179
- * back-compat with older CLI builds.
180
- */
181
- tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
182
- access_token: z.ZodString;
183
- expires_at: z.ZodOptional<z.ZodString>;
184
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
185
- access_token: z.ZodString;
186
- expires_at: z.ZodOptional<z.ZodString>;
187
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
188
- access_token: z.ZodString;
189
- expires_at: z.ZodOptional<z.ZodString>;
190
- }, z.ZodTypeAny, "passthrough">>>>;
191
- updatedAt: z.ZodString;
192
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
193
- identity: z.ZodString;
194
- idp: z.ZodString;
195
- issuer: z.ZodString;
196
- subject: z.ZodString;
197
- audience: z.ZodOptional<z.ZodString>;
198
- organizationId: z.ZodOptional<z.ZodString>;
199
- access_token: z.ZodString;
200
- id_token: z.ZodOptional<z.ZodString>;
201
- refresh_token: z.ZodOptional<z.ZodString>;
202
- token_type: z.ZodOptional<z.ZodString>;
203
- scope: z.ZodOptional<z.ZodString>;
204
- expires_at: z.ZodOptional<z.ZodString>;
205
- claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
- /**
207
- * Access tokens by audience. WorkOS mints one `aud` per token, so a
208
- * session juggling several instances would otherwise burn a (single-use)
209
- * refresh-token rotation on every instance flip. The top-level
210
- * `access_token`/`expires_at` stay the most recently minted token for
211
- * back-compat with older CLI builds.
212
- */
213
108
  tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
214
109
  access_token: z.ZodString;
215
110
  expires_at: z.ZodOptional<z.ZodString>;
216
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
217
- access_token: z.ZodString;
218
- expires_at: z.ZodOptional<z.ZodString>;
219
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
220
- access_token: z.ZodString;
221
- expires_at: z.ZodOptional<z.ZodString>;
222
- }, z.ZodTypeAny, "passthrough">>>>;
223
- updatedAt: z.ZodString;
224
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
225
- identity: z.ZodString;
226
- idp: z.ZodString;
227
- issuer: z.ZodString;
228
- subject: z.ZodString;
229
- audience: z.ZodOptional<z.ZodString>;
230
- organizationId: z.ZodOptional<z.ZodString>;
231
- access_token: z.ZodString;
232
- id_token: z.ZodOptional<z.ZodString>;
233
- refresh_token: z.ZodOptional<z.ZodString>;
234
- token_type: z.ZodOptional<z.ZodString>;
235
- scope: z.ZodOptional<z.ZodString>;
236
- expires_at: z.ZodOptional<z.ZodString>;
237
- claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
238
- /**
239
- * Access tokens by audience. WorkOS mints one `aud` per token, so a
240
- * session juggling several instances would otherwise burn a (single-use)
241
- * refresh-token rotation on every instance flip. The top-level
242
- * `access_token`/`expires_at` stay the most recently minted token for
243
- * back-compat with older CLI builds.
244
- */
245
- tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
246
- access_token: z.ZodString;
247
- expires_at: z.ZodOptional<z.ZodString>;
248
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
249
- access_token: z.ZodString;
250
- expires_at: z.ZodOptional<z.ZodString>;
251
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
252
- access_token: z.ZodString;
253
- expires_at: z.ZodOptional<z.ZodString>;
254
- }, z.ZodTypeAny, "passthrough">>>>;
111
+ }, z.core.$loose>>>;
255
112
  updatedAt: z.ZodString;
256
- }, z.ZodTypeAny, "passthrough">>;
113
+ }, z.core.$loose>;
257
114
  export type IdpSession = z.infer<typeof IdpSessionSchema>;
258
115
  export type TokenResponse = {
259
116
  access_token?: string;
@@ -316,6 +173,7 @@ export declare function fetchOidcMetadata(issuer: string): Promise<OidcMetadata>
316
173
  export declare function workosAuthKitMetadata(apiHost?: string, clientId?: string): OidcMetadata;
317
174
  export declare function builtinIdpConfig(name: string, clientIdOverride?: string, env?: NodeJS.ProcessEnv): IdpConfig | null;
318
175
  export declare function workosClientIdFromEnv(env?: NodeJS.ProcessEnv): string | undefined;
176
+ export declare function legacyBuiltinWorkosReplacement(existing: IdpConfig, clientIdOverride?: string, env?: NodeJS.ProcessEnv): IdpConfig | undefined;
319
177
  export declare function postForm(url: string, params: URLSearchParams): Promise<TokenResponse>;
320
178
  export declare function postJson(url: string, bodyInput: Record<string, string>): Promise<TokenResponse>;
321
179
  export declare function tokenExpiresAt(token: TokenResponse): string | undefined;
@@ -1,5 +1,5 @@
1
- import type { InstanceInfo } from '../admin/instance/model';
2
1
  import type { AstraleConfig } from './config';
2
+ import { type InstanceInfo } from '../admin/instance/model';
3
3
  import { type AdminTargetCommandOpts, type ResolvedAdminTarget } from './admin-target';
4
4
  import { type InstanceStore } from './instance';
5
5
  export type InstanceTargetRequest = {
@@ -1,7 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import type { AstraleConfig } from './config';
3
3
  import { type RegistryMode } from './validation';
4
- export declare const InstanceKindSchema: z.ZodEnum<["bookmark"]>;
4
+ export declare const InstanceKindSchema: z.ZodEnum<{
5
+ bookmark: "bookmark";
6
+ }>;
5
7
  export type InstanceKind = z.infer<typeof InstanceKindSchema>;
6
8
  export declare const InstanceEntrySchema: z.ZodObject<{
7
9
  url: z.ZodOptional<z.ZodString>;
@@ -10,36 +12,17 @@ export declare const InstanceEntrySchema: z.ZodObject<{
10
12
  createdAt: z.ZodOptional<z.ZodString>;
11
13
  slug: z.ZodOptional<z.ZodString>;
12
14
  name: z.ZodOptional<z.ZodString>;
13
- kind: z.ZodOptional<z.ZodEnum<["bookmark"]>>;
14
- mode: z.ZodOptional<z.ZodEnum<["local", "remote"]>>;
15
+ kind: z.ZodOptional<z.ZodEnum<{
16
+ bookmark: "bookmark";
17
+ }>>;
18
+ mode: z.ZodOptional<z.ZodEnum<{
19
+ local: "local";
20
+ remote: "remote";
21
+ }>>;
15
22
  defaultIdentity: z.ZodOptional<z.ZodString>;
16
23
  caFile: z.ZodOptional<z.ZodString>;
17
24
  organizationId: z.ZodOptional<z.ZodString>;
18
- }, "strip", z.ZodTypeAny, {
19
- url?: string | undefined;
20
- issuer?: string | undefined;
21
- domainIssuer?: string | undefined;
22
- createdAt?: string | undefined;
23
- slug?: string | undefined;
24
- name?: string | undefined;
25
- kind?: "bookmark" | undefined;
26
- mode?: "local" | "remote" | undefined;
27
- defaultIdentity?: string | undefined;
28
- caFile?: string | undefined;
29
- organizationId?: string | undefined;
30
- }, {
31
- url?: string | undefined;
32
- issuer?: string | undefined;
33
- domainIssuer?: string | undefined;
34
- createdAt?: string | undefined;
35
- slug?: string | undefined;
36
- name?: string | undefined;
37
- kind?: "bookmark" | undefined;
38
- mode?: "local" | "remote" | undefined;
39
- defaultIdentity?: string | undefined;
40
- caFile?: string | undefined;
41
- organizationId?: string | undefined;
42
- }>;
25
+ }, z.core.$strip>;
43
26
  export declare const InstanceStoreSchema: z.ZodObject<{
44
27
  active: z.ZodString;
45
28
  instances: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -49,67 +32,18 @@ export declare const InstanceStoreSchema: z.ZodObject<{
49
32
  createdAt: z.ZodOptional<z.ZodString>;
50
33
  slug: z.ZodOptional<z.ZodString>;
51
34
  name: z.ZodOptional<z.ZodString>;
52
- kind: z.ZodOptional<z.ZodEnum<["bookmark"]>>;
53
- mode: z.ZodOptional<z.ZodEnum<["local", "remote"]>>;
35
+ kind: z.ZodOptional<z.ZodEnum<{
36
+ bookmark: "bookmark";
37
+ }>>;
38
+ mode: z.ZodOptional<z.ZodEnum<{
39
+ local: "local";
40
+ remote: "remote";
41
+ }>>;
54
42
  defaultIdentity: z.ZodOptional<z.ZodString>;
55
43
  caFile: z.ZodOptional<z.ZodString>;
56
44
  organizationId: z.ZodOptional<z.ZodString>;
57
- }, "strip", z.ZodTypeAny, {
58
- url?: string | undefined;
59
- issuer?: string | undefined;
60
- domainIssuer?: string | undefined;
61
- createdAt?: string | undefined;
62
- slug?: string | undefined;
63
- name?: string | undefined;
64
- kind?: "bookmark" | undefined;
65
- mode?: "local" | "remote" | undefined;
66
- defaultIdentity?: string | undefined;
67
- caFile?: string | undefined;
68
- organizationId?: string | undefined;
69
- }, {
70
- url?: string | undefined;
71
- issuer?: string | undefined;
72
- domainIssuer?: string | undefined;
73
- createdAt?: string | undefined;
74
- slug?: string | undefined;
75
- name?: string | undefined;
76
- kind?: "bookmark" | undefined;
77
- mode?: "local" | "remote" | undefined;
78
- defaultIdentity?: string | undefined;
79
- caFile?: string | undefined;
80
- organizationId?: string | undefined;
81
- }>>;
82
- }, "strip", z.ZodTypeAny, {
83
- active: string;
84
- instances: Record<string, {
85
- url?: string | undefined;
86
- issuer?: string | undefined;
87
- domainIssuer?: string | undefined;
88
- createdAt?: string | undefined;
89
- slug?: string | undefined;
90
- name?: string | undefined;
91
- kind?: "bookmark" | undefined;
92
- mode?: "local" | "remote" | undefined;
93
- defaultIdentity?: string | undefined;
94
- caFile?: string | undefined;
95
- organizationId?: string | undefined;
96
- }>;
97
- }, {
98
- active: string;
99
- instances: Record<string, {
100
- url?: string | undefined;
101
- issuer?: string | undefined;
102
- domainIssuer?: string | undefined;
103
- createdAt?: string | undefined;
104
- slug?: string | undefined;
105
- name?: string | undefined;
106
- kind?: "bookmark" | undefined;
107
- mode?: "local" | "remote" | undefined;
108
- defaultIdentity?: string | undefined;
109
- caFile?: string | undefined;
110
- organizationId?: string | undefined;
111
- }>;
112
- }>;
45
+ }, z.core.$strip>>;
46
+ }, z.core.$strip>;
113
47
  export type InstanceEntry = z.infer<typeof InstanceEntrySchema>;
114
48
  export type InstanceStore = z.infer<typeof InstanceStoreSchema>;
115
49
  export type AddInstanceOpts = {
@@ -172,7 +106,13 @@ export declare function upsertInstance(key: string, opts?: AddInstanceOpts): Pro
172
106
  * normalized kernel URL). Reports the previous URL when an existing
173
107
  * bookmark was repointed to a different kernel so callers can warn.
174
108
  */
175
- export declare function upsertManagedBookmark(key: string, slug: string, rawUrl: string, organizationId?: string): Promise<{
109
+ export declare function upsertManagedBookmark(input: Readonly<{
110
+ key: string;
111
+ slug: string;
112
+ url: string;
113
+ organizationId?: string;
114
+ defaultIdentity?: string;
115
+ }>): Promise<{
176
116
  entry: InstanceEntry;
177
117
  repointedFrom?: string;
178
118
  }>;
@@ -182,7 +122,9 @@ export declare function clearActive(identifier: string): Promise<void>;
182
122
  export declare function getActive(config?: AstraleConfig): Promise<InstanceEntry & {
183
123
  name: string;
184
124
  }>;
185
- export declare function resolveInstance(identifier: string, config?: AstraleConfig): Promise<ResolvedInstance>;
125
+ export declare function resolveInstance(identifier: string, config?: AstraleConfig, opts?: {
126
+ persist?: boolean;
127
+ }): Promise<ResolvedInstance>;
186
128
  export declare function resolveKernelUrl(opts: {
187
129
  url?: string;
188
130
  instance?: string;
@@ -10,9 +10,11 @@ export declare const log: {
10
10
  };
11
11
  /** Report an error with hint (when present) and exit. `--json` / `--ci` / a
12
12
  * non-TTY stdout always get one structured JSON line on stderr. */
13
- export declare function fatal(e: unknown, opts?: MachineOpts): never;
14
- /** Admit expected invalid input and exit through {@link fatal}. */
15
- export declare function failClosed(error: unknown, opts?: MachineOpts): never;
13
+ export declare function fatal(e: unknown, opts?: MachineOpts & {
14
+ readonly debug?: boolean;
15
+ }): never;
16
+ /** Project only a caller-authored admission failure into the CLI input family. */
17
+ export declare function failInput(error: unknown, opts?: MachineOpts): never;
16
18
  /** Shortcut for stub commands that aren't wired in v1 (§15). */
17
19
  export declare function fatalNotImplemented(feature: string, hint?: string): never;
18
20
  /**
@@ -6,8 +6,8 @@
6
6
  * `jwks_uri`) and JWKS at `/.well-known/jwks.json`. These helpers probe
7
7
  * both to verify the issuer is alive and publishes at least one key.
8
8
  *
9
- * Domain workers may expose `/meta` for deployment drift detection; that is
10
- * outside this connect-only CLI surface.
9
+ * Domain deployment readiness uses the canonical Domain Publication; that is
10
+ * outside this issuer-connectivity helper.
11
11
  */
12
12
  type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
13
13
  export type DiscoveryDocument = {
@@ -0,0 +1,43 @@
1
+ import { type ChildProcess, type StdioOptions } from 'node:child_process';
2
+ export type RunResult = {
3
+ /** Exit code, or -1 when the process was killed by a signal. */
4
+ code: number;
5
+ stdout: string;
6
+ stderr: string;
7
+ };
8
+ /**
9
+ * Spawn a child process and capture stdout/stderr as UTF-8 text.
10
+ *
11
+ * Uses `node:child_process` rather than `Bun.spawn` so the exact same code runs
12
+ * under both the Bun-compiled standalone binary (Linux/macOS) and the Node/npm
13
+ * build (Windows and any Node user). The promise rejects only when the process
14
+ * fails to spawn (e.g. ENOENT); a non-zero exit resolves with that `code` so
15
+ * callers can branch on it.
16
+ */
17
+ export declare function run(file: string, args?: string[], opts?: {
18
+ cwd?: string;
19
+ }): Promise<RunResult>;
20
+ /**
21
+ * Spawn a child process with inherited stdio so its output streams live to the
22
+ * user's terminal. Used for hand-held installs (npm / npx) where progress
23
+ * matters and the output is for the human, not for parsing. Resolves with the
24
+ * exit code; rejects only when the process fails to spawn (e.g. ENOENT).
25
+ */
26
+ export declare function runInherit(file: string, args?: string[], opts?: {
27
+ cwd?: string;
28
+ }): Promise<number>;
29
+ /**
30
+ * Spawn a LONG-LIVED child and return the handle immediately so the caller can
31
+ * supervise it (wait for exit, forward signals, tear down siblings). Unlike
32
+ * run()/runInherit() — which resolve only once the child closes — this is for
33
+ * servers the command keeps attached to (e.g. `astrale studio`'s Bun server and
34
+ * Vite dev process). Same node:child_process basis (cross-runtime) and bare
35
+ * PATH-name lookup convention. Default stdio streams stdout/stderr live but
36
+ * ignores stdin, so two supervised children never contend for the TTY.
37
+ */
38
+ export declare function spawnHandle(file: string, args?: string[], opts?: {
39
+ cwd?: string;
40
+ env?: NodeJS.ProcessEnv;
41
+ stdio?: StdioOptions;
42
+ detached?: boolean;
43
+ }): ChildProcess;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Lexical `@self` helpers. Effective-principal resolution is deliberately not
3
+ * local: connection/self.ts asks the authenticated target Kernel through
4
+ * Identity.whoami before replacing any reference.
5
+ */
6
+ /** Cheap pre-check before invoking authenticated principal resolution. */
7
+ export declare function containsSelfRef(input: string): boolean;
8
+ /** Replace every admitted `@self` token with one authenticated NodeId. */
9
+ export declare function expandSelfReferences(input: string, selfId: string): string;
@@ -0,0 +1,91 @@
1
+ import { z } from 'zod';
2
+ import { AstraleError } from '../errors';
3
+ export declare const DEFAULT_UPDATE_CHANNEL = "beta";
4
+ export declare const InstallMetadataSchema: z.ZodObject<{
5
+ method: z.ZodLiteral<"script">;
6
+ channel: z.ZodDefault<z.ZodString>;
7
+ version: z.ZodOptional<z.ZodString>;
8
+ repo: z.ZodDefault<z.ZodString>;
9
+ bin: z.ZodString;
10
+ installedAt: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ export type InstallMetadata = z.infer<typeof InstallMetadataSchema>;
13
+ export declare const UpdateManifestSchema: z.ZodObject<{
14
+ version: z.ZodString;
15
+ binaryVersion: z.ZodOptional<z.ZodString>;
16
+ channel: z.ZodString;
17
+ repo: z.ZodOptional<z.ZodString>;
18
+ assets: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
19
+ name: z.ZodString;
20
+ sha256: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
22
+ name: string;
23
+ }, string>>]>>;
24
+ }, z.core.$strip>;
25
+ export type UpdateManifest = z.infer<typeof UpdateManifestSchema>;
26
+ export type Platform = {
27
+ os: 'darwin' | 'linux';
28
+ arch: 'arm64' | 'x64';
29
+ };
30
+ export type UpdateRequest = {
31
+ check?: boolean;
32
+ channel?: string;
33
+ version?: string;
34
+ currentVersion: string;
35
+ platform?: Platform;
36
+ installPath?: string;
37
+ execution?: UpdateExecution;
38
+ };
39
+ export type UpdateExecution = {
40
+ kind: 'standalone';
41
+ executable: string;
42
+ } | {
43
+ kind: 'package-managed';
44
+ executable: string;
45
+ };
46
+ declare const admittedScriptInstall: unique symbol;
47
+ export type AdmittedScriptInstall = Readonly<{
48
+ metadata: InstallMetadata;
49
+ executable: string;
50
+ [admittedScriptInstall]: true;
51
+ }>;
52
+ export type UpdateResult = {
53
+ status: 'managed';
54
+ currentVersion: string;
55
+ executable: string;
56
+ } | {
57
+ status: 'up-to-date';
58
+ currentVersion: string;
59
+ latestVersion: string;
60
+ channel: string;
61
+ } | {
62
+ status: 'available';
63
+ currentVersion: string;
64
+ latestVersion: string;
65
+ channel: string;
66
+ } | {
67
+ status: 'updated';
68
+ previousVersion: string;
69
+ currentVersion: string;
70
+ channel: string;
71
+ bin: string;
72
+ };
73
+ export declare function detectPlatform(): Platform;
74
+ export declare function platformKey(platform: Platform): string;
75
+ export declare function classifyUpdateExecution(input: {
76
+ bunVersion?: string;
77
+ executable: string;
78
+ entry?: string;
79
+ }): UpdateExecution;
80
+ export declare function detectUpdateExecution(): UpdateExecution;
81
+ export declare function packageManagedUpdateError(executable: string): AstraleError;
82
+ export declare function readInstallMetadata(path?: string): Promise<InstallMetadata>;
83
+ export declare function admitScriptInstall(meta: InstallMetadata, execution: Extract<UpdateExecution, {
84
+ kind: 'standalone';
85
+ }>): Promise<AdmittedScriptInstall>;
86
+ export declare function writeInstallMetadata(meta: InstallMetadata, path?: string): Promise<void>;
87
+ export declare function releaseBase(meta: InstallMetadata, req: Pick<UpdateRequest, 'channel' | 'version'>): string;
88
+ export declare function fetchManifest(base: string): Promise<UpdateManifest>;
89
+ export declare function shouldUpdate(currentVersion: string, manifestVersion: string): boolean;
90
+ export declare function updateAstrale(req: UpdateRequest): Promise<UpdateResult>;
91
+ export {};
@@ -7,5 +7,8 @@ export declare function validateUrl(url: string): void;
7
7
  /** Non-throwing predicate form of `validateUrl`. */
8
8
  export declare function isHttpUrl(url: string): boolean;
9
9
  /** `local` = only this machine. `remote` = mirrored via astrale cloud (§2.7). */
10
- export declare const RegistryModeSchema: z.ZodEnum<["local", "remote"]>;
10
+ export declare const RegistryModeSchema: z.ZodEnum<{
11
+ local: "local";
12
+ remote: "remote";
13
+ }>;
11
14
  export type RegistryMode = z.infer<typeof RegistryModeSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/cli",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "Astrale CLI — connect to existing Astrale kernels",
5
5
  "keywords": [
6
6
  "astrale",
@@ -19,7 +19,6 @@
19
19
  "dist",
20
20
  "src",
21
21
  "tsconfig.json",
22
- ".check-workspace.cjs",
23
22
  "studio/server",
24
23
  "studio/shared",
25
24
  "studio/client/dist",
@@ -59,25 +58,23 @@
59
58
  "ora": "^9.0.0",
60
59
  "ts-morph": "^25.0.1",
61
60
  "yaml": "^2.8.2",
62
- "zod": "^3.25.0"
61
+ "zod": "^4.4.3"
63
62
  },
64
63
  "devDependencies": {
65
- "@astrale-os/kernel-client": ">=0.6.0-beta.3 <1.0.0",
66
- "@astrale-os/ox": ">=0.1.0 <1.0.0",
67
- "@astrale-os/sdk": ">=0.5.0-beta.3 <1.0.0",
68
- "@astrale-os/shell": ">=0.3.8-beta.2 <1.0.0",
64
+ "@astrale-os/ox": ">=0.1.3 <1.0.0",
65
+ "@astrale-os/sdk": "0.5.0-beta.38",
66
+ "@astrale-os/shell": "0.4.2-beta.3",
69
67
  "@astrale/commitlint-config": "npm:@jsr/astrale__commitlint-config@~2.0.1",
70
- "@commitlint/cli": "~20.3.1",
71
- "@commitlint/config-conventional": "~20.3.1",
68
+ "@commitlint/cli": "21.2.2",
69
+ "@commitlint/config-conventional": "21.2.2",
72
70
  "@types/bun": "^1.1.16",
73
71
  "@types/node": "^22.0.0",
74
- "@typescript/native-preview": "latest",
75
72
  "husky": "~9.1.7",
76
- "lint-staged": "~16.2.7",
77
- "msgpackr": "^1.12.1",
78
- "oxfmt": "0.52.0",
79
- "oxlint": "latest",
80
- "typescript": "~6.0.1-rc"
73
+ "lint-staged": "17.3.0",
74
+ "msgpackr": "^2.0.5",
75
+ "oxfmt": "0.63.0",
76
+ "oxlint": "1.78.0",
77
+ "typescript": "7.0.2"
81
78
  },
82
79
  "lint-staged": {
83
80
  "*.{js,cjs,mjs,ts,tsx}": [
@@ -99,15 +96,15 @@
99
96
  "node": ">=22"
100
97
  },
101
98
  "scripts": {
102
- "preinstall": "node .check-workspace.cjs",
103
99
  "build": "bun scripts/build.ts",
104
- "package:check": "pnpm run typecheck && pnpm run test && pnpm run build && node scripts/verify-public-exports.mjs && node scripts/verify-private-ports-boundary.mjs",
105
- "typecheck": "tsgo --noEmit && tsgo --noEmit -p tsconfig.tests.json && tsgo --noEmit -p viewer && tsgo --noEmit -p studio",
100
+ "package:check": "pnpm run typecheck && pnpm run test && pnpm run build && node scripts/verify-public-exports.mjs && node scripts/verify-public-dependency-boundary.mjs",
101
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json && tsc --noEmit -p viewer && pnpm --dir studio run typecheck",
106
102
  "lint": "oxlint .",
107
103
  "lint:fix": "oxlint --fix .",
108
104
  "format": "pnpm exec oxfmt --write .",
109
105
  "format:check": "pnpm exec oxfmt --check .",
110
- "test": "bun test src && node --test scripts/*.test.mjs",
106
+ "test": "node scripts/qualification/source-boundary.mjs --target && bun test src studio/client/src studio/server studio/shared && node --test scripts/*.test.mjs",
107
+ "test:studio": "pnpm --dir studio test",
111
108
  "test:watch": "bun test --watch src"
112
109
  }
113
110
  }