@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.
- package/README.md +23 -12
- package/dist/astrale.js +48048 -56798
- package/dist/public/connect-core.js +2011 -30765
- package/dist/public/keys/index.js +884 -29483
- package/dist/public/paths/index.js +13101 -41459
- package/dist/types/admin/binding.d.ts +19 -0
- package/dist/types/admin/instance/client.d.ts +22 -0
- package/dist/types/admin/instance/index.d.ts +2 -0
- package/dist/types/admin/instance/model.d.ts +5 -12
- package/dist/types/connection/auth.d.ts +3 -0
- package/dist/types/connection/call.d.ts +3 -0
- package/dist/types/connection/command.d.ts +27 -0
- package/dist/types/connection/credential.d.ts +14 -0
- package/dist/types/connection/errors.d.ts +1 -0
- package/dist/types/connection/exchange.d.ts +9 -0
- package/dist/types/connection/failure/classify.d.ts +2 -0
- package/dist/types/connection/failure/index.d.ts +5 -0
- package/dist/types/connection/failure/model.d.ts +25 -0
- package/dist/types/connection/failure/render.d.ts +3 -0
- package/dist/types/connection/index.d.ts +8 -0
- package/dist/types/connection/reasons.d.ts +37 -0
- package/dist/types/connection/self.d.ts +37 -0
- package/dist/types/connection/session.d.ts +31 -0
- package/dist/types/connection/target.d.ts +38 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/lib/admin-instance.d.ts +17 -0
- package/dist/types/lib/admin-target.d.ts +11 -36
- package/dist/types/lib/config.d.ts +7 -59
- package/dist/types/lib/failure-debug.d.ts +1 -0
- package/dist/types/lib/idp.d.ts +26 -168
- package/dist/types/lib/instance-target.d.ts +1 -1
- package/dist/types/lib/instance.d.ts +30 -88
- package/dist/types/lib/log.d.ts +5 -3
- package/dist/types/lib/meta.d.ts +2 -2
- package/dist/types/lib/proc.d.ts +43 -0
- package/dist/types/lib/self.d.ts +9 -0
- package/dist/types/lib/update.d.ts +91 -0
- package/dist/types/lib/validation.d.ts +4 -1
- package/package.json +16 -19
- package/src/__tests__/fixtures/publication.ts +20 -0
- package/src/admin/__tests__/binding.test.ts +31 -0
- package/src/admin/__tests__/fixture.ts +101 -0
- package/src/admin/binding.ts +98 -0
- package/src/admin/catalog/.spec/api.d.ts +2 -2
- package/src/admin/catalog/__tests__/client.test.ts +20 -49
- package/src/admin/catalog/client.ts +36 -32
- package/src/admin/catalog/model.ts +3 -4
- package/src/admin/graph/.spec/api.d.ts +4 -10
- package/src/admin/graph/nodes.ts +1 -1
- package/src/admin/instance/.spec/api.d.ts +2 -2
- package/src/admin/instance/__tests__/client.test.ts +39 -164
- package/src/admin/instance/client.ts +35 -124
- package/src/admin/instance/index.ts +1 -2
- package/src/admin/instance/model.ts +11 -20
- package/src/commands/__tests__/admin-instance.test.ts +11 -8
- package/src/commands/__tests__/auth-login.test.ts +54 -1
- package/src/commands/__tests__/call-describe.test.ts +46 -33
- package/src/commands/__tests__/call.test.ts +5 -1
- package/src/commands/__tests__/domain-install-operation.test.ts +12 -7
- package/src/commands/__tests__/domain-install-owned.test.ts +6 -2
- package/src/commands/__tests__/domain-list.test.ts +63 -4
- package/src/commands/__tests__/install-identity-override.test.ts +19 -19
- package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
- package/src/commands/__tests__/instance-status.test.ts +139 -0
- package/src/commands/__tests__/read-commands.test.ts +35 -10
- package/src/commands/__tests__/studio-descriptor.test.ts +22 -0
- package/src/commands/__tests__/update.test.ts +48 -19
- package/src/commands/call-describe.ts +60 -68
- package/src/commands/call.ts +43 -56
- package/src/commands/domain/install.ts +13 -17
- package/src/commands/domain/list.ts +18 -13
- package/src/commands/domain/publish.ts +14 -11
- package/src/commands/domain/uninstall.ts +2 -2
- package/src/commands/get.ts +14 -15
- package/src/commands/identity/__tests__/register.test.ts +3 -3
- package/src/commands/identity/register.ts +5 -4
- package/src/commands/instance/create.ts +8 -16
- package/src/commands/instance/delete.ts +12 -9
- package/src/commands/instance/list.ts +2 -2
- package/src/commands/instance/status.ts +66 -20
- package/src/commands/instance/use.ts +16 -12
- package/src/commands/introspect.ts +9 -16
- package/src/commands/logs.ts +24 -25
- package/src/commands/mutate.ts +6 -5
- package/src/commands/query.ts +27 -30
- package/src/commands/studio.ts +20 -0
- package/src/commands/token.ts +8 -7
- package/src/commands/update.ts +38 -14
- package/src/commands/view.ts +7 -6
- package/src/connection/.spec/api.d.ts +7 -8
- package/src/connection/.spec/architecture.md +5 -4
- package/src/connection/.spec/flows/session.ts +2 -2
- package/src/connection/.spec/laws/connection.ts +6 -2
- package/src/connection/.spec/layout.ts +1 -0
- package/src/connection/__tests__/credential.test.ts +20 -1
- package/src/connection/__tests__/errors.test.ts +43 -32
- package/src/connection/__tests__/exchange.test.ts +36 -6
- package/src/connection/__tests__/failure-fixtures.ts +39 -0
- package/src/connection/__tests__/failure-safety.test.ts +75 -0
- package/src/connection/__tests__/self.test.ts +31 -11
- package/src/connection/__tests__/session.test.ts +3 -3
- package/src/connection/__tests__/target.test.ts +1 -0
- package/src/connection/auth.ts +13 -0
- package/src/connection/call.ts +1 -1
- package/src/connection/credential.ts +2 -2
- package/src/connection/errors.ts +1 -355
- package/src/connection/exchange.ts +52 -27
- package/src/connection/failure/classify.ts +110 -0
- package/src/connection/failure/index.ts +18 -0
- package/src/connection/failure/model.ts +28 -0
- package/src/connection/failure/render.ts +116 -0
- package/src/connection/reasons.ts +16 -0
- package/src/connection/self.ts +39 -21
- package/src/connection/session.ts +19 -8
- package/src/errors.ts +3 -2
- package/src/graph/.spec/api.d.ts +12 -5
- package/src/graph/.spec/layout.ts +9 -1
- package/src/graph/__tests__/mutation.test.ts +2 -2
- package/src/graph/__tests__/query.test.ts +25 -6
- package/src/graph/class.ts +30 -0
- package/src/graph/index.ts +1 -0
- package/src/graph/query.ts +21 -32
- package/src/identity/.spec/api.d.ts +2 -2
- package/src/identity/__tests__/registration.test.ts +1 -1
- package/src/identity/registration.ts +3 -3
- package/src/keys/__tests__/keys.test.ts +4 -0
- package/src/keys/credential.ts +1 -0
- package/src/lib/__tests__/admin-target.test.ts +12 -0
- package/src/lib/__tests__/command-dx.test.ts +1 -1
- package/src/lib/__tests__/domain-publication.test.ts +138 -0
- package/src/lib/__tests__/idp-session.test.ts +22 -0
- package/src/lib/__tests__/idp.test.ts +36 -4
- package/src/lib/__tests__/instance-candidates.test.ts +1 -3
- package/src/lib/__tests__/instance-target.test.ts +7 -39
- package/src/lib/__tests__/instance.test.ts +6 -0
- package/src/lib/__tests__/log-errors.test.ts +64 -0
- package/src/lib/__tests__/studio-server-deps.test.ts +53 -16
- package/src/lib/__tests__/update.test.ts +113 -8
- package/src/lib/__tests__/view-open-intent.test.ts +0 -2
- package/src/lib/__tests__/view-server.test.ts +18 -3
- package/src/lib/__tests__/view-session.test.ts +1 -1
- package/src/lib/admin-instance.ts +14 -8
- package/src/lib/admin-target.ts +21 -2
- package/src/lib/command-dx.ts +9 -9
- package/src/lib/domain-publication.ts +104 -0
- package/src/lib/failure-debug.ts +26 -0
- package/src/lib/idp.ts +39 -4
- package/src/lib/instance-candidates.ts +2 -2
- package/src/lib/instance-target.ts +3 -14
- package/src/lib/instance.ts +22 -12
- package/src/lib/log.ts +16 -9
- package/src/lib/login-flow.ts +13 -3
- package/src/lib/meta.ts +2 -2
- package/src/lib/provision-instance.ts +34 -57
- package/src/lib/update.ts +124 -30
- package/src/lib/validation.ts +2 -2
- package/src/lib/view/resolve.ts +1 -1
- package/src/lib/view/server.ts +17 -3
- package/src/program/__tests__/program.test.ts +20 -4
- package/src/program/build.ts +2 -2
- package/src/setup/__tests__/instance-step.test.ts +27 -10
- package/src/setup/steps/instance.ts +22 -15
- package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
- package/studio/client/dist/assets/index-7YHdeCxp.js +81 -0
- package/studio/client/dist/assets/index-C0FAnwNw.css +2 -0
- package/studio/client/dist/assets/rolldown-runtime-Dd_uD5pT.js +1 -0
- package/studio/client/dist/assets/schema-studio-BilUNb6Z.css +1 -0
- package/studio/client/dist/assets/schema-studio-CABpTfvH.js +8 -0
- package/studio/client/dist/index.html +3 -2
- package/studio/package.json +10 -14
- package/studio/server/agent/ask.test.ts +1 -1
- package/studio/server/agent/bridge/grant.test.ts +1 -1
- package/studio/server/agent/bridge/routes.test.ts +1 -1
- package/studio/server/agent/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/claude/adapter.test.ts +15 -5
- 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/anchors.test.ts +32 -36
- package/studio/server/agent/prompts/anchors.ts +20 -49
- package/studio/server/agent/prompts/system.test.ts +3 -2
- package/studio/server/agent/prompts/system.ts +6 -5
- package/studio/server/agent/prompts/turn.ts +13 -4
- package/studio/server/agent/routes.test.ts +1 -1
- package/studio/server/agent/run/completion.ts +2 -2
- package/studio/server/agent/run/coordinator.test.ts +1 -1
- 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 +43 -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-agent-loadout.test.ts +1 -1
- package/studio/server/api.test.ts +147 -0
- package/studio/server/api.ts +20 -422
- package/studio/server/cache.test.ts +122 -0
- package/studio/server/cache.ts +162 -11
- 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 +50 -40
- package/studio/server/domain.ts +83 -52
- 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/index.ts +1 -1
- 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/routes.ts +114 -0
- package/studio/server/introspect/anatomy/views.ts +53 -0
- package/studio/server/introspect/anatomy-extras.test.ts +106 -35
- package/studio/server/introspect/anatomy-extras.ts +7 -726
- package/studio/server/introspect/anatomy.test.ts +22 -14
- package/studio/server/introspect/anatomy.ts +52 -28
- package/studio/server/introspect/bundle.ts +15 -9
- package/studio/server/introspect/canonical-schema.test.ts +93 -309
- package/studio/server/introspect/canonical-schema.ts +257 -425
- package/studio/server/introspect/config-preview.test.ts +32 -0
- package/studio/server/introspect/config-preview.ts +119 -0
- package/studio/server/introspect/core-extractor.ts +18 -127
- package/studio/server/introspect/core.ts +1 -2
- package/studio/server/introspect/diff.test.ts +18 -18
- package/studio/server/introspect/diff.ts +44 -90
- package/studio/server/introspect/extractor.ts +23 -116
- package/studio/server/introspect/hash.ts +5 -2
- package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
- package/studio/server/introspect/overlay-tsmorph.ts +7 -1305
- package/studio/server/introspect/overlay.test.ts +26 -54
- package/studio/server/introspect/overlay.ts +10 -37
- package/studio/server/introspect/revision.test.ts +54 -0
- package/studio/server/introspect/revision.ts +49 -0
- package/studio/server/introspect/runtime.test.ts +83 -143
- package/studio/server/introspect/runtime.ts +40 -11
- package/studio/server/introspect/schema-ir-json.test.ts +70 -0
- package/studio/server/introspect/schema-ir-json.ts +151 -0
- package/studio/server/introspect/schema-refs.test.ts +43 -88
- package/studio/server/introspect/schema-refs.ts +14 -49
- package/studio/server/introspect/source-overlay/annotations.ts +14 -0
- package/studio/server/introspect/source-overlay/handlers.ts +161 -0
- package/studio/server/introspect/source-overlay/kernel-calls.ts +46 -0
- package/studio/server/introspect/source-overlay/project.ts +248 -0
- package/studio/server/introspect/source-overlay/spans.ts +330 -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 +223 -7
- package/studio/server/state/baseline.ts +148 -34
- 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 -11
- 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/views/target.test.ts +78 -0
- package/studio/server/views/target.ts +222 -0
- package/studio/server/watch.test.ts +11 -11
- package/studio/server/watch.ts +9 -5
- 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/server/workspace-watch.ts +2 -2
- 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 +393 -0
- package/studio/shared/contracts/surface.test.ts +317 -0
- package/studio/shared/contracts/workspace.ts +265 -0
- package/studio/shared/layout.test.ts +116 -0
- package/studio/shared/schema/identity.test.ts +34 -0
- package/studio/shared/schema/identity.ts +68 -0
- package/studio/shared/types.ts +11 -1099
- package/studio/tsconfig.json +1 -1
- package/viewer/dist/main.js +40 -61
- package/.check-workspace.cjs +0 -40
- package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
- package/studio/client/dist/assets/elk-api-D2xgMJvi.js +0 -1
- package/studio/client/dist/assets/index-BMdnsIJA.css +0 -1
- package/studio/client/dist/assets/index-ChOr3yP0.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.test.ts +0 -286
- package/studio/server/state/views.ts +0 -535
package/dist/types/lib/idp.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
},
|
|
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
|
|
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<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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<
|
|
108
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
133
|
-
|
|
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
|
-
},
|
|
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.
|
|
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<
|
|
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<
|
|
14
|
-
|
|
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
|
-
},
|
|
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<
|
|
53
|
-
|
|
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
|
-
},
|
|
58
|
-
|
|
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(
|
|
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
|
|
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;
|
package/dist/types/lib/log.d.ts
CHANGED
|
@@ -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
|
|
14
|
-
|
|
15
|
-
|
|
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
|
/**
|
package/dist/types/lib/meta.d.ts
CHANGED
|
@@ -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
|
|
10
|
-
* outside this
|
|
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<
|
|
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.
|
|
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": "^
|
|
61
|
+
"zod": "^4.4.3"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
|
-
"@astrale-os/
|
|
66
|
-
"@astrale-os/
|
|
67
|
-
"@astrale-os/
|
|
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": "
|
|
71
|
-
"@commitlint/config-conventional": "
|
|
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": "
|
|
77
|
-
"msgpackr": "^
|
|
78
|
-
"oxfmt": "0.
|
|
79
|
-
"oxlint": "
|
|
80
|
-
"typescript": "
|
|
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-
|
|
105
|
-
"typecheck": "
|
|
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
|
}
|