@astrale-os/cli 1.0.0-beta.0 → 1.0.0-beta.2
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 +7 -11
- package/dist/astrale.js +3769 -3549
- package/dist/public/connect-core.js +396 -392
- package/dist/public/keys/index.js +371 -378
- package/dist/public/paths/index.js +371 -378
- package/dist/types/lib/idp.d.ts +6 -0
- package/dist/types/lib/meta.d.ts +2 -2
- package/package.json +6 -4
- package/src/admin/binding.ts +168 -0
- package/src/admin/catalog/__tests__/client.test.ts +2 -2
- package/src/admin/catalog/client.ts +4 -9
- package/src/admin/instance/__tests__/client.test.ts +5 -3
- package/src/admin/instance/client.ts +9 -27
- package/src/commands/__tests__/auth-login.test.ts +54 -1
- package/src/commands/__tests__/call.test.ts +5 -1
- package/src/commands/__tests__/domain-install-operation.test.ts +23 -7
- package/src/commands/__tests__/domain-install-owned.test.ts +5 -1
- package/src/commands/__tests__/domain-list.test.ts +83 -4
- package/src/commands/__tests__/install-identity-override.test.ts +30 -19
- package/src/commands/__tests__/studio-descriptor.test.ts +22 -0
- package/src/commands/__tests__/update.test.ts +73 -0
- package/src/commands/domain/install.ts +11 -15
- package/src/commands/domain/list.ts +17 -12
- package/src/commands/studio.ts +20 -0
- package/src/commands/update.ts +39 -13
- package/src/connection/__tests__/errors.test.ts +16 -12
- package/src/connection/__tests__/exchange.test.ts +6 -5
- package/src/connection/exchange.ts +5 -4
- package/src/lib/__tests__/domain-publication.test.ts +144 -0
- package/src/lib/__tests__/idp-session.test.ts +22 -0
- package/src/lib/__tests__/idp.test.ts +2 -0
- package/src/lib/__tests__/instance.test.ts +6 -0
- package/src/lib/__tests__/studio-server-deps.test.ts +53 -16
- package/src/lib/__tests__/update.test.ts +12 -0
- package/src/lib/domain-publication.ts +102 -0
- package/src/lib/idp.ts +5 -1
- package/src/lib/instance.ts +6 -1
- package/src/lib/login-flow.ts +13 -3
- package/src/lib/meta.ts +2 -2
- package/src/lib/update.ts +4 -4
- package/src/program/__tests__/program.test.ts +1 -1
- package/studio/client/dist/assets/{elk-api-D2xgMJvi.js → elk-api-lwhFo7vB.js} +1 -1
- package/studio/client/dist/assets/index-B-c-smo9.js +8 -0
- package/studio/client/dist/assets/index-BckHuAWk.js +81 -0
- package/studio/client/dist/assets/index-C4aNQ6dz.css +1 -0
- package/studio/client/dist/index.html +2 -2
- package/studio/package.json +3 -1
- package/studio/server/agent/bridge/stdio.ts +8 -1
- package/studio/server/agent/conversation.test.ts +10 -5
- package/studio/server/agent/conversation.ts +56 -8
- package/studio/server/agent/harness/codex/loadout.ts +18 -21
- package/studio/server/agent/harness/gateway/config.ts +20 -18
- package/studio/server/agent/harness/selection.ts +9 -1
- package/studio/server/agent/prompts/system.ts +3 -2
- package/studio/server/agent/prompts/turn.ts +13 -4
- package/studio/server/agent/run/completion.ts +2 -2
- package/studio/server/agent/run/preparation.ts +6 -5
- package/studio/server/agent/run/transcript.test.ts +35 -1
- package/studio/server/agent/run/transcript.ts +169 -3
- package/studio/server/agent/run/usage.test.ts +24 -0
- package/studio/server/agent/run/usage.ts +26 -1
- package/studio/server/api/canvas.ts +44 -0
- package/studio/server/api/comments.ts +85 -0
- package/studio/server/api/context.ts +61 -0
- package/studio/server/api/deployment.ts +39 -0
- package/studio/server/api/documents.ts +55 -0
- package/studio/server/api/domain.ts +59 -0
- package/studio/server/api/http.ts +45 -0
- package/studio/server/api/project.ts +57 -0
- package/studio/server/api/schema.ts +12 -0
- package/studio/server/api/views.ts +57 -0
- package/studio/server/api/workspace.ts +60 -0
- package/studio/server/api.test.ts +147 -0
- package/studio/server/api.ts +20 -422
- package/studio/server/cache.test.ts +111 -0
- package/studio/server/cache.ts +163 -9
- package/studio/server/cli-consumers.test.ts +494 -0
- package/studio/server/cli.test.ts +88 -0
- package/studio/server/cli.ts +240 -0
- package/studio/server/client-package.ts +25 -1
- package/studio/server/domain.test.ts +30 -2
- package/studio/server/domain.ts +14 -2
- package/studio/server/environment/dotenv-preview.test.ts +39 -0
- package/studio/server/environment/dotenv-preview.ts +27 -0
- package/studio/server/environment/files.test.ts +53 -0
- package/studio/server/{state/env.ts → environment/files.ts} +7 -48
- package/studio/server/{state → handoff}/copy.ts +21 -6
- package/studio/server/handoff/service.test.ts +22 -0
- package/studio/server/{state/handoff.ts → handoff/service.ts} +21 -14
- package/studio/server/instances/active.ts +72 -0
- package/studio/server/instances/deploy-record.test.ts +31 -0
- package/studio/server/instances/deploy-record.ts +37 -0
- package/studio/server/instances/deploy.ts +56 -0
- package/studio/server/{state/instance.test.ts → instances/probe.test.ts} +25 -21
- package/studio/server/instances/probe.ts +67 -0
- package/studio/server/instances/status.test.ts +12 -0
- package/studio/server/instances/status.ts +49 -0
- package/studio/server/introspect/anatomy/client-tree.ts +57 -0
- package/studio/server/introspect/anatomy/env-fields.ts +66 -0
- package/studio/server/introspect/anatomy/schema-definition.ts +53 -0
- package/studio/server/introspect/anatomy/source.ts +181 -0
- package/studio/server/introspect/anatomy/views/legacy.ts +232 -0
- package/studio/server/introspect/anatomy/views/routes.ts +105 -0
- package/studio/server/introspect/anatomy/views.ts +58 -0
- package/studio/server/introspect/anatomy-extras.test.ts +91 -4
- package/studio/server/introspect/anatomy-extras.ts +7 -726
- package/studio/server/introspect/anatomy.ts +46 -19
- package/studio/server/introspect/bundle.ts +15 -6
- package/studio/server/introspect/canonical-schema.test.ts +79 -0
- package/studio/server/introspect/canonical-schema.ts +80 -18
- package/studio/server/introspect/config-preview.test.ts +32 -0
- package/studio/server/introspect/config-preview.ts +119 -0
- package/studio/server/introspect/diff.test.ts +7 -11
- package/studio/server/introspect/diff.ts +28 -37
- package/studio/server/introspect/extractor.ts +8 -6
- package/studio/server/introspect/hash.ts +5 -2
- package/studio/server/introspect/overlay-tsmorph.ts +7 -1305
- package/studio/server/introspect/revision.test.ts +54 -0
- package/studio/server/introspect/revision.ts +49 -0
- package/studio/server/introspect/runtime.test.ts +63 -5
- package/studio/server/introspect/runtime.ts +49 -3
- package/studio/server/introspect/schema-ir-json.ts +181 -0
- package/studio/server/introspect/source-overlay/annotations.ts +14 -0
- package/studio/server/introspect/source-overlay/handlers.ts +681 -0
- package/studio/server/introspect/source-overlay/kernel-calls.ts +49 -0
- package/studio/server/introspect/source-overlay/project.ts +248 -0
- package/studio/server/introspect/source-overlay/spans.ts +360 -0
- package/studio/server/json.ts +46 -0
- package/studio/server/lifecycle.ts +5 -1
- package/studio/server/sse.test.ts +26 -0
- package/studio/server/sse.ts +4 -1
- package/studio/server/state/baseline.test.ts +212 -1
- package/studio/server/state/baseline.ts +145 -29
- package/studio/server/state/comments.test.ts +66 -1
- package/studio/server/state/comments.ts +173 -10
- package/studio/server/state/context.ts +34 -2
- package/studio/server/state/documents.ts +42 -1
- package/studio/server/state/integrations.ts +27 -1
- package/studio/server/state/layout.test.ts +34 -0
- package/studio/server/state/layout.ts +44 -17
- package/studio/server/state/settings.ts +29 -22
- package/studio/server/state/store.test.ts +122 -0
- package/studio/server/state/store.ts +66 -17
- package/studio/server/state/visibility.ts +22 -7
- package/studio/server/views/model.test.ts +57 -0
- package/studio/server/views/model.ts +66 -0
- package/studio/server/views/runtime.ts +40 -0
- package/studio/server/views/selection-repository.test.ts +31 -0
- package/studio/server/views/selection-repository.ts +60 -0
- package/studio/server/views/session.test.ts +73 -0
- package/studio/server/views/session.ts +166 -0
- package/studio/server/{state/views.test.ts → views/target.test.ts} +8 -159
- package/studio/server/views/target.ts +248 -0
- package/studio/server/watch.ts +1 -1
- package/studio/server/workspace/catalog.test.ts +17 -0
- package/studio/server/workspace/catalog.ts +43 -0
- package/studio/server/{state → workspace}/create.test.ts +1 -1
- package/studio/server/{state → workspace}/create.ts +1 -1
- package/studio/server/{state → workspace}/git.ts +1 -1
- package/studio/server/workspace/updates.ts +83 -0
- package/studio/server/workspace-state.ts +1 -1
- package/studio/shared/contracts/README.md +16 -0
- package/studio/shared/contracts/agent.ts +270 -0
- package/studio/shared/contracts/runtime.ts +50 -0
- package/studio/shared/contracts/schema.ts +462 -0
- package/studio/shared/contracts/surface.test.ts +319 -0
- package/studio/shared/contracts/workspace.ts +274 -0
- package/studio/shared/layout.test.ts +116 -0
- package/studio/shared/schema/identity.test.ts +58 -0
- package/studio/shared/schema/identity.ts +82 -0
- package/studio/shared/types.ts +11 -1099
- package/studio/tsconfig.json +1 -1
- package/viewer/dist/main.js +35 -35
- package/studio/client/dist/assets/index-BMdnsIJA.css +0 -1
- package/studio/client/dist/assets/index-D-vRV8w7.js +0 -8
- package/studio/client/dist/assets/index-LGSWRrk8.js +0 -81
- package/studio/server/state/catalog.ts +0 -117
- package/studio/server/state/instance.ts +0 -280
- package/studio/server/state/updates.ts +0 -63
- package/studio/server/state/views.ts +0 -535
|
@@ -90,7 +90,7 @@ export const views = { services, service }
|
|
|
90
90
|
])
|
|
91
91
|
})
|
|
92
92
|
|
|
93
|
-
test('joins
|
|
93
|
+
test('joins canonical Bundle Views with reactFrontend route metadata', () => {
|
|
94
94
|
const root = mkdtempSync(join(tmpdir(), 'studio-current-react-view-'))
|
|
95
95
|
roots.push(root)
|
|
96
96
|
mkdirSync(join(root, 'schema', 'application'), { recursive: true })
|
|
@@ -127,7 +127,22 @@ export const frontend = reactFrontend({ schema, routes, entrypoint: 'issue' })
|
|
|
127
127
|
)
|
|
128
128
|
|
|
129
129
|
expect(findSchemaDefinition(root)).toMatchObject({ origin: 'current.example.dev' })
|
|
130
|
-
expect(
|
|
130
|
+
expect(
|
|
131
|
+
buildViews(root, 'schema', {
|
|
132
|
+
issue: {
|
|
133
|
+
name: 'issue',
|
|
134
|
+
auth: 'optional',
|
|
135
|
+
description: 'Inspect an issue.',
|
|
136
|
+
target: {
|
|
137
|
+
kind: 'definition',
|
|
138
|
+
definitions: [
|
|
139
|
+
{ origin: 'issues.example.dev', kind: 'class', name: 'Issue' },
|
|
140
|
+
{ origin: 'accounts.example.dev', kind: 'interface', name: 'Group' },
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
}),
|
|
145
|
+
).toEqual([
|
|
131
146
|
{
|
|
132
147
|
slug: 'issue',
|
|
133
148
|
kind: 'spa',
|
|
@@ -141,7 +156,7 @@ export const frontend = reactFrontend({ schema, routes, entrypoint: 'issue' })
|
|
|
141
156
|
])
|
|
142
157
|
})
|
|
143
158
|
|
|
144
|
-
test('discovers generated frontend routes
|
|
159
|
+
test('discovers generated frontend routes without deriving canonical View defaults', () => {
|
|
145
160
|
const root = mkdtempSync(join(tmpdir(), 'studio-current-generated-view-'))
|
|
146
161
|
roots.push(root)
|
|
147
162
|
mkdirSync(join(root, 'schema'), { recursive: true })
|
|
@@ -165,7 +180,15 @@ export const frontend = frontendArtifact({
|
|
|
165
180
|
`,
|
|
166
181
|
)
|
|
167
182
|
|
|
168
|
-
expect(
|
|
183
|
+
expect(
|
|
184
|
+
buildViews(root, 'schema', {
|
|
185
|
+
summary: {
|
|
186
|
+
name: 'summary',
|
|
187
|
+
auth: 'required',
|
|
188
|
+
target: { kind: 'domain' },
|
|
189
|
+
},
|
|
190
|
+
}),
|
|
191
|
+
).toEqual([
|
|
169
192
|
{
|
|
170
193
|
slug: 'summary',
|
|
171
194
|
kind: 'inline-html',
|
|
@@ -177,6 +200,70 @@ export const frontend = frontendArtifact({
|
|
|
177
200
|
])
|
|
178
201
|
})
|
|
179
202
|
|
|
203
|
+
test('canonical Bundle views reject static schema and route-only identities', () => {
|
|
204
|
+
const root = mkdtempSync(join(tmpdir(), 'studio-canonical-view-authority-'))
|
|
205
|
+
roots.push(root)
|
|
206
|
+
mkdirSync(join(root, 'schema'), { recursive: true })
|
|
207
|
+
writeFileSync(
|
|
208
|
+
join(root, 'schema', 'index.ts'),
|
|
209
|
+
`export const schema = defineSchema('static.invalid', {
|
|
210
|
+
views: {
|
|
211
|
+
account: view({ target: WrongTarget, auth: 'public', description: 'Static guess.' }),
|
|
212
|
+
sourceOnly: view({ target: WrongTarget, auth: 'public', description: 'Static guess.' }),
|
|
213
|
+
invented: view({ target: 'domain', auth: 'public' }),
|
|
214
|
+
},
|
|
215
|
+
})`,
|
|
216
|
+
)
|
|
217
|
+
writeFileSync(
|
|
218
|
+
join(root, 'implementation.ts'),
|
|
219
|
+
`export const frontend = frontendArtifact({
|
|
220
|
+
source: externalFrontend({ href: 'https://shell.example.dev' }),
|
|
221
|
+
routes: {
|
|
222
|
+
account: frontendRoute({ href: 'https://shell.example.dev/account' }),
|
|
223
|
+
routeOnly: frontendRoute({ href: 'https://shell.example.dev/route-only' }),
|
|
224
|
+
},
|
|
225
|
+
})`,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
expect(
|
|
229
|
+
buildViews(root, 'schema', {
|
|
230
|
+
account: {
|
|
231
|
+
name: 'account',
|
|
232
|
+
auth: 'required',
|
|
233
|
+
description: 'Admitted account view.',
|
|
234
|
+
target: {
|
|
235
|
+
kind: 'definition',
|
|
236
|
+
definitions: [{ origin: 'accounts.example.dev', kind: 'class', name: 'Account' }],
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
sourceOnly: {
|
|
240
|
+
name: 'sourceOnly',
|
|
241
|
+
auth: 'optional',
|
|
242
|
+
description: 'Admitted source-only view.',
|
|
243
|
+
target: { kind: 'domain' },
|
|
244
|
+
},
|
|
245
|
+
}),
|
|
246
|
+
).toEqual([
|
|
247
|
+
{
|
|
248
|
+
slug: 'account',
|
|
249
|
+
kind: 'spa',
|
|
250
|
+
auth: 'required',
|
|
251
|
+
description: 'Admitted account view.',
|
|
252
|
+
viewFor: 'Account',
|
|
253
|
+
url: 'https://shell.example.dev/account',
|
|
254
|
+
file: 'implementation.ts',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
slug: 'sourceOnly',
|
|
258
|
+
kind: 'unknown',
|
|
259
|
+
auth: 'optional',
|
|
260
|
+
description: 'Admitted source-only view.',
|
|
261
|
+
file: 'schema/index.ts',
|
|
262
|
+
},
|
|
263
|
+
])
|
|
264
|
+
expect(buildViews(root, 'schema', {})).toEqual([])
|
|
265
|
+
})
|
|
266
|
+
|
|
180
267
|
test('uses current ui modules as the client anatomy when no legacy client package is selected', () => {
|
|
181
268
|
const root = mkdtempSync(join(tmpdir(), 'studio-current-ui-tree-'))
|
|
182
269
|
roots.push(root)
|