@astrale-os/cli 1.0.0-beta.2 → 1.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/astrale.js +51105 -58057
- package/dist/public/connect-core.js +2085 -30702
- package/dist/public/keys/index.js +884 -29476
- package/dist/public/paths/index.js +13101 -41452
- package/dist/types/admin/contract.d.ts +26 -0
- package/dist/types/admin/instance/client.d.ts +20 -0
- package/dist/types/admin/instance/index.d.ts +2 -0
- package/dist/types/admin/instance/model.d.ts +6 -10
- package/dist/types/connection/auth.d.ts +3 -0
- package/dist/types/connection/call.d.ts +3 -0
- package/dist/types/connection/command.d.ts +27 -0
- package/dist/types/connection/credential.d.ts +14 -0
- package/dist/types/connection/errors.d.ts +1 -0
- package/dist/types/connection/exchange.d.ts +9 -0
- package/dist/types/connection/failure/classify.d.ts +2 -0
- package/dist/types/connection/failure/index.d.ts +5 -0
- package/dist/types/connection/failure/model.d.ts +25 -0
- package/dist/types/connection/failure/render.d.ts +3 -0
- package/dist/types/connection/index.d.ts +8 -0
- package/dist/types/connection/reasons.d.ts +37 -0
- package/dist/types/connection/self.d.ts +37 -0
- package/dist/types/connection/session.d.ts +31 -0
- package/dist/types/connection/target.d.ts +38 -0
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/lib/admin-instance.d.ts +17 -0
- package/dist/types/lib/admin-target.d.ts +11 -36
- package/dist/types/lib/config.d.ts +7 -59
- package/dist/types/lib/failure-debug.d.ts +1 -0
- package/dist/types/lib/idp.d.ts +25 -173
- package/dist/types/lib/instance-target.d.ts +1 -1
- package/dist/types/lib/instance.d.ts +30 -88
- package/dist/types/lib/log.d.ts +5 -3
- package/dist/types/lib/output.d.ts +1 -1
- package/dist/types/lib/proc.d.ts +43 -0
- package/dist/types/lib/self.d.ts +9 -0
- package/dist/types/lib/update.d.ts +109 -0
- package/dist/types/lib/validation.d.ts +4 -1
- package/package.json +15 -20
- package/src/__tests__/fixtures/publication.ts +20 -0
- package/src/admin/.spec/architecture.md +12 -5
- package/src/admin/__tests__/fixture.ts +25 -0
- package/src/admin/catalog/.spec/api.d.ts +1 -3
- package/src/admin/catalog/.spec/architecture.md +5 -4
- package/src/admin/catalog/__tests__/client.test.ts +143 -69
- package/src/admin/catalog/client.ts +40 -54
- package/src/admin/catalog/model.ts +3 -4
- package/src/admin/contract.ts +46 -0
- package/src/admin/graph/.spec/api.d.ts +4 -10
- package/src/admin/graph/nodes.ts +1 -1
- package/src/admin/instance/.spec/api.d.ts +5 -9
- package/src/admin/instance/.spec/architecture.md +7 -7
- package/src/admin/instance/__tests__/client.test.ts +157 -175
- package/src/admin/instance/client.ts +39 -128
- package/src/admin/instance/index.ts +1 -2
- package/src/admin/instance/model.ts +12 -18
- package/src/commands/__tests__/admin-instance.test.ts +11 -8
- package/src/commands/__tests__/call-describe.test.ts +46 -33
- package/src/commands/__tests__/call.test.ts +34 -0
- package/src/commands/__tests__/domain-install-operation.test.ts +7 -22
- package/src/commands/__tests__/domain-install-owned.test.ts +1 -1
- package/src/commands/__tests__/domain-list.test.ts +5 -25
- package/src/commands/__tests__/install-direct.test.ts +115 -8
- package/src/commands/__tests__/install-identity-override.test.ts +3 -14
- package/src/commands/__tests__/instance-list-rows.test.ts +1 -1
- package/src/commands/__tests__/instance-status.test.ts +139 -0
- package/src/commands/__tests__/introspect-parse.test.ts +80 -1
- package/src/commands/__tests__/logs.test.ts +250 -2
- package/src/commands/__tests__/read-commands.test.ts +62 -10
- package/src/commands/__tests__/token-ttl.test.ts +49 -4
- package/src/commands/__tests__/update.test.ts +25 -3
- package/src/commands/__tests__/view.test.ts +49 -0
- package/src/commands/call-describe.ts +60 -68
- package/src/commands/call.ts +71 -59
- package/src/commands/domain/install.ts +54 -35
- package/src/commands/domain/list.ts +1 -1
- package/src/commands/domain/publish.ts +14 -11
- package/src/commands/domain/uninstall.ts +2 -2
- package/src/commands/get.ts +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 +48 -35
- package/src/commands/logs.ts +123 -33
- package/src/commands/mutate.ts +6 -5
- package/src/commands/query.ts +35 -32
- package/src/commands/token.ts +42 -27
- package/src/commands/ui/__tests__/commands.test.ts +152 -0
- package/src/commands/ui/add.ts +51 -0
- package/src/commands/ui/doctor.ts +13 -0
- package/src/commands/ui/init.ts +38 -0
- package/src/commands/ui/list.ts +26 -0
- package/src/commands/ui/preset-apply.ts +19 -0
- package/src/commands/ui/preset-list.ts +12 -0
- package/src/commands/ui/shared.ts +25 -0
- package/src/commands/update.ts +31 -11
- package/src/commands/view.ts +82 -37
- 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 +27 -20
- package/src/connection/__tests__/exchange.test.ts +30 -1
- 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 +47 -23
- 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__/binary.test.ts +16 -1
- package/src/lib/__tests__/command-dx.test.ts +1 -1
- package/src/lib/__tests__/domain-publication.test.ts +10 -16
- package/src/lib/__tests__/idp.test.ts +34 -4
- package/src/lib/__tests__/instance-candidates.test.ts +1 -3
- package/src/lib/__tests__/instance-target.test.ts +7 -39
- package/src/lib/__tests__/log-errors.test.ts +64 -0
- package/src/lib/__tests__/studio-server-deps.test.ts +1 -1
- package/src/lib/__tests__/update.test.ts +264 -11
- package/src/lib/__tests__/view-assets.test.ts +14 -0
- package/src/lib/__tests__/view-external-open-intent.test.ts +150 -0
- package/src/lib/__tests__/view-external-open-origins.test.ts +27 -0
- package/src/lib/__tests__/view-open-intent.test.ts +0 -2
- package/src/lib/__tests__/view-server.test.ts +26 -3
- package/src/lib/__tests__/view-session.test.ts +2 -1
- package/src/lib/admin-instance.ts +14 -8
- package/src/lib/admin-target.ts +21 -2
- package/src/lib/binary.ts +22 -5
- package/src/lib/command-dx.ts +9 -9
- package/src/lib/domain-publication.ts +9 -7
- package/src/lib/failure-debug.ts +26 -0
- package/src/lib/idp.ts +34 -3
- package/src/lib/instance-candidates.ts +2 -2
- package/src/lib/instance-target.ts +3 -14
- package/src/lib/instance.ts +16 -11
- package/src/lib/log.ts +16 -9
- package/src/lib/output.ts +1 -1
- package/src/lib/proc.ts +7 -2
- package/src/lib/provision-instance.ts +34 -57
- package/src/lib/update.ts +298 -45
- package/src/lib/validation.ts +2 -2
- package/src/lib/view/assets.ts +11 -2
- package/src/lib/view/external-open-intent.ts +41 -0
- package/src/lib/view/external-open-origins.ts +37 -0
- package/src/lib/view/host-capabilities.ts +17 -0
- package/src/lib/view/resolve.ts +1 -1
- package/src/lib/view/server.ts +18 -3
- package/src/lib/view/session.ts +2 -0
- package/src/program/.spec/api.d.ts +1 -0
- package/src/program/__tests__/program.test.ts +163 -6
- package/src/program/argv.ts +14 -0
- package/src/program/build.ts +26 -4
- package/src/program/command.ts +1 -0
- package/src/program/index.ts +1 -0
- package/src/program/registry.ts +2 -1
- package/src/setup/__tests__/instance-step.test.ts +27 -10
- package/src/setup/steps/instance.ts +22 -15
- package/src/telemetry/__tests__/recorder.test.ts +1 -0
- package/src/telemetry/recorder.ts +9 -1
- package/src/ui/.spec/api.d.ts +14 -0
- package/src/ui/.spec/architecture.md +10 -0
- package/src/ui/.spec/laws.ts +36 -0
- package/src/ui/.spec/layout.ts +16 -0
- package/src/ui/__tests__/ui.test.ts +981 -0
- package/src/ui/index.ts +13 -0
- package/src/ui/lock.ts +87 -0
- package/src/ui/model.ts +83 -0
- package/src/ui/operations.ts +710 -0
- package/src/ui/project.ts +219 -0
- package/src/ui/release.ts +321 -0
- package/src/ui/runner.ts +18 -0
- package/studio/client/dist/assets/elk-api-DjmKsHXc.js +1 -0
- package/studio/client/dist/assets/index-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 +7 -13
- package/studio/server/agent/ask.test.ts +1 -1
- package/studio/server/agent/bridge/grant.test.ts +1 -1
- package/studio/server/agent/bridge/routes.test.ts +1 -1
- package/studio/server/agent/harness/claude/adapter.test.ts +15 -5
- package/studio/server/agent/harness/gateway/token.test.ts +1 -1
- package/studio/server/agent/harness/gateway/token.ts +3 -3
- package/studio/server/agent/prompts/anchors.test.ts +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 +3 -3
- package/studio/server/agent/routes.test.ts +1 -1
- package/studio/server/agent/run/coordinator.test.ts +1 -1
- package/studio/server/api/canvas.ts +0 -1
- package/studio/server/api-agent-loadout.test.ts +1 -1
- package/studio/server/api.test.ts +1 -1
- package/studio/server/cache.test.ts +23 -12
- package/studio/server/cache.ts +12 -15
- package/studio/server/domain.test.ts +50 -68
- package/studio/server/domain.ts +82 -63
- package/studio/server/handoff/copy.ts +1 -1
- package/studio/server/index.ts +1 -1
- package/studio/server/instances/probe.test.ts +1 -1
- package/studio/server/introspect/anatomy/views/routes.ts +46 -37
- package/studio/server/introspect/anatomy/views.ts +9 -14
- package/studio/server/introspect/anatomy-extras.test.ts +26 -42
- package/studio/server/introspect/anatomy.test.ts +22 -14
- package/studio/server/introspect/anatomy.ts +6 -9
- package/studio/server/introspect/bundle.ts +0 -3
- package/studio/server/introspect/canonical-schema.test.ts +94 -389
- package/studio/server/introspect/canonical-schema.ts +227 -457
- package/studio/server/introspect/core-extractor.ts +18 -127
- package/studio/server/introspect/core.ts +1 -2
- package/studio/server/introspect/diff.test.ts +11 -7
- package/studio/server/introspect/diff.ts +18 -55
- package/studio/server/introspect/extractor.ts +22 -117
- package/studio/server/introspect/overlay-tsmorph.test.ts +119 -240
- package/studio/server/introspect/overlay.test.ts +26 -54
- package/studio/server/introspect/overlay.ts +10 -37
- package/studio/server/introspect/revision.test.ts +1 -1
- package/studio/server/introspect/revision.ts +1 -1
- package/studio/server/introspect/runtime.test.ts +65 -183
- package/studio/server/introspect/runtime.ts +8 -25
- package/studio/server/introspect/schema-ir-json.test.ts +70 -0
- package/studio/server/introspect/schema-ir-json.ts +38 -68
- package/studio/server/introspect/schema-refs.test.ts +43 -88
- package/studio/server/introspect/schema-refs.ts +14 -49
- package/studio/server/introspect/source-overlay/handlers.ts +116 -636
- package/studio/server/introspect/source-overlay/kernel-calls.ts +0 -3
- package/studio/server/introspect/source-overlay/spans.ts +15 -45
- package/studio/server/state/baseline.test.ts +14 -9
- package/studio/server/state/baseline.ts +3 -5
- package/studio/server/state/visibility.ts +1 -5
- package/studio/server/views/model.ts +3 -3
- package/studio/server/views/target.test.ts +17 -74
- package/studio/server/views/target.ts +24 -50
- package/studio/server/watch.test.ts +11 -11
- package/studio/server/watch.ts +8 -4
- package/studio/server/workspace-watch.ts +2 -2
- package/studio/shared/contracts/schema.ts +38 -107
- package/studio/shared/contracts/surface.test.ts +13 -15
- package/studio/shared/contracts/workspace.ts +2 -11
- package/studio/shared/schema/identity.test.ts +20 -44
- package/studio/shared/schema/identity.ts +9 -23
- package/viewer/dist/main.js +30 -51
- package/.check-workspace.cjs +0 -40
- package/src/admin/binding.ts +0 -168
- package/src/commands/__tests__/instance-create-hosts.test.ts +0 -29
- package/studio/client/dist/assets/elk-api-lwhFo7vB.js +0 -1
- package/studio/client/dist/assets/index-B-c-smo9.js +0 -8
- package/studio/client/dist/assets/index-BckHuAWk.js +0 -81
- package/studio/client/dist/assets/index-C4aNQ6dz.css +0 -1
- package/studio/client/dist/assets/index-ChOr3yP0.css +0 -1
- package/studio/server/introspect/anatomy/views/legacy.ts +0 -232
package/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
|
|
82
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
83
|
-
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">>;
|
|
59
|
+
redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
60
|
scope: z.ZodOptional<z.ZodString>;
|
|
103
61
|
public: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
-
token_response: z.ZodOptional<z.ZodEnum<
|
|
105
|
-
|
|
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,75 +95,6 @@ export declare const IdpSessionSchema: z.ZodObject<{
|
|
|
162
95
|
idp: z.ZodString;
|
|
163
96
|
issuer: z.ZodString;
|
|
164
97
|
subject: z.ZodString;
|
|
165
|
-
/** OAuth client that issued this session's refresh token. */
|
|
166
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
167
|
-
audience: z.ZodOptional<z.ZodString>;
|
|
168
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
169
|
-
access_token: z.ZodString;
|
|
170
|
-
id_token: z.ZodOptional<z.ZodString>;
|
|
171
|
-
refresh_token: z.ZodOptional<z.ZodString>;
|
|
172
|
-
token_type: z.ZodOptional<z.ZodString>;
|
|
173
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
174
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
175
|
-
claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
176
|
-
/**
|
|
177
|
-
* Access tokens by audience. WorkOS mints one `aud` per token, so a
|
|
178
|
-
* session juggling several instances would otherwise burn a (single-use)
|
|
179
|
-
* refresh-token rotation on every instance flip. The top-level
|
|
180
|
-
* `access_token`/`expires_at` stay the most recently minted token for
|
|
181
|
-
* back-compat with older CLI builds.
|
|
182
|
-
*/
|
|
183
|
-
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
184
|
-
access_token: z.ZodString;
|
|
185
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
186
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
187
|
-
access_token: z.ZodString;
|
|
188
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
189
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
190
|
-
access_token: z.ZodString;
|
|
191
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.ZodTypeAny, "passthrough">>>>;
|
|
193
|
-
updatedAt: z.ZodString;
|
|
194
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
195
|
-
identity: z.ZodString;
|
|
196
|
-
idp: z.ZodString;
|
|
197
|
-
issuer: z.ZodString;
|
|
198
|
-
subject: z.ZodString;
|
|
199
|
-
/** OAuth client that issued this session's refresh token. */
|
|
200
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
201
|
-
audience: z.ZodOptional<z.ZodString>;
|
|
202
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
203
|
-
access_token: z.ZodString;
|
|
204
|
-
id_token: z.ZodOptional<z.ZodString>;
|
|
205
|
-
refresh_token: z.ZodOptional<z.ZodString>;
|
|
206
|
-
token_type: z.ZodOptional<z.ZodString>;
|
|
207
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
208
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
209
|
-
claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
210
|
-
/**
|
|
211
|
-
* Access tokens by audience. WorkOS mints one `aud` per token, so a
|
|
212
|
-
* session juggling several instances would otherwise burn a (single-use)
|
|
213
|
-
* refresh-token rotation on every instance flip. The top-level
|
|
214
|
-
* `access_token`/`expires_at` stay the most recently minted token for
|
|
215
|
-
* back-compat with older CLI builds.
|
|
216
|
-
*/
|
|
217
|
-
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
218
|
-
access_token: z.ZodString;
|
|
219
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
220
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
221
|
-
access_token: z.ZodString;
|
|
222
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
223
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
224
|
-
access_token: z.ZodString;
|
|
225
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
226
|
-
}, z.ZodTypeAny, "passthrough">>>>;
|
|
227
|
-
updatedAt: z.ZodString;
|
|
228
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
229
|
-
identity: z.ZodString;
|
|
230
|
-
idp: z.ZodString;
|
|
231
|
-
issuer: z.ZodString;
|
|
232
|
-
subject: z.ZodString;
|
|
233
|
-
/** OAuth client that issued this session's refresh token. */
|
|
234
98
|
clientId: z.ZodOptional<z.ZodString>;
|
|
235
99
|
audience: z.ZodOptional<z.ZodString>;
|
|
236
100
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -241,25 +105,12 @@ export declare const IdpSessionSchema: z.ZodObject<{
|
|
|
241
105
|
scope: z.ZodOptional<z.ZodString>;
|
|
242
106
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
243
107
|
claims: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
244
|
-
/**
|
|
245
|
-
* Access tokens by audience. WorkOS mints one `aud` per token, so a
|
|
246
|
-
* session juggling several instances would otherwise burn a (single-use)
|
|
247
|
-
* refresh-token rotation on every instance flip. The top-level
|
|
248
|
-
* `access_token`/`expires_at` stay the most recently minted token for
|
|
249
|
-
* back-compat with older CLI builds.
|
|
250
|
-
*/
|
|
251
108
|
tokens: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
252
109
|
access_token: z.ZodString;
|
|
253
110
|
expires_at: z.ZodOptional<z.ZodString>;
|
|
254
|
-
},
|
|
255
|
-
access_token: z.ZodString;
|
|
256
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
257
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
258
|
-
access_token: z.ZodString;
|
|
259
|
-
expires_at: z.ZodOptional<z.ZodString>;
|
|
260
|
-
}, z.ZodTypeAny, "passthrough">>>>;
|
|
111
|
+
}, z.core.$loose>>>;
|
|
261
112
|
updatedAt: z.ZodString;
|
|
262
|
-
}, z.
|
|
113
|
+
}, z.core.$loose>;
|
|
263
114
|
export type IdpSession = z.infer<typeof IdpSessionSchema>;
|
|
264
115
|
export type TokenResponse = {
|
|
265
116
|
access_token?: string;
|
|
@@ -322,6 +173,7 @@ export declare function fetchOidcMetadata(issuer: string): Promise<OidcMetadata>
|
|
|
322
173
|
export declare function workosAuthKitMetadata(apiHost?: string, clientId?: string): OidcMetadata;
|
|
323
174
|
export declare function builtinIdpConfig(name: string, clientIdOverride?: string, env?: NodeJS.ProcessEnv): IdpConfig | null;
|
|
324
175
|
export declare function workosClientIdFromEnv(env?: NodeJS.ProcessEnv): string | undefined;
|
|
176
|
+
export declare function legacyBuiltinWorkosReplacement(existing: IdpConfig, clientIdOverride?: string, env?: NodeJS.ProcessEnv): IdpConfig | undefined;
|
|
325
177
|
export declare function postForm(url: string, params: URLSearchParams): Promise<TokenResponse>;
|
|
326
178
|
export declare function postJson(url: string, bodyInput: Record<string, string>): Promise<TokenResponse>;
|
|
327
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
|
/**
|
|
@@ -11,7 +11,7 @@ export type MachineOpts = RawOutputOpts & {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const RAW_OUTPUT_OPTIONS: readonly [{
|
|
13
13
|
readonly flags: '--json';
|
|
14
|
-
readonly description: '
|
|
14
|
+
readonly description: 'JSON; streaming commands emit one JSON value per line';
|
|
15
15
|
}, {
|
|
16
16
|
readonly flags: '--raw';
|
|
17
17
|
readonly description: 'Unwrapped: bare scalar / raw bytes / JSON for objects';
|
|
@@ -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,109 @@
|
|
|
1
|
+
import { chmod, copyFile, mkdir, rename, rm } from 'node:fs/promises';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AstraleError } from '../errors';
|
|
4
|
+
export declare const DEFAULT_UPDATE_CHANNEL = "beta";
|
|
5
|
+
export declare const InstallMetadataSchema: z.ZodObject<{
|
|
6
|
+
method: z.ZodLiteral<"script">;
|
|
7
|
+
channel: z.ZodDefault<z.ZodString>;
|
|
8
|
+
version: z.ZodOptional<z.ZodString>;
|
|
9
|
+
repo: z.ZodDefault<z.ZodString>;
|
|
10
|
+
bin: z.ZodString;
|
|
11
|
+
installedAt: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type InstallMetadata = z.infer<typeof InstallMetadataSchema>;
|
|
14
|
+
export declare const UpdateManifestSchema: z.ZodObject<{
|
|
15
|
+
version: z.ZodString;
|
|
16
|
+
binaryVersion: z.ZodOptional<z.ZodString>;
|
|
17
|
+
channel: z.ZodString;
|
|
18
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
19
|
+
assets: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
23
|
+
name: string;
|
|
24
|
+
}, string>>]>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type UpdateManifest = z.infer<typeof UpdateManifestSchema>;
|
|
27
|
+
export type Platform = {
|
|
28
|
+
os: 'darwin' | 'linux';
|
|
29
|
+
arch: 'arm64' | 'x64';
|
|
30
|
+
};
|
|
31
|
+
export type UpdateRequest = {
|
|
32
|
+
check?: boolean;
|
|
33
|
+
channel?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
currentVersion: string;
|
|
36
|
+
platform?: Platform;
|
|
37
|
+
installPath?: string;
|
|
38
|
+
execution?: UpdateExecution;
|
|
39
|
+
};
|
|
40
|
+
export type UpdateExecution = {
|
|
41
|
+
kind: 'standalone';
|
|
42
|
+
executable: string;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'package-managed';
|
|
45
|
+
executable: string;
|
|
46
|
+
};
|
|
47
|
+
declare const admittedScriptInstall: unique symbol;
|
|
48
|
+
export type AdmittedScriptInstall = Readonly<{
|
|
49
|
+
metadata: InstallMetadata;
|
|
50
|
+
executable: string;
|
|
51
|
+
[admittedScriptInstall]: true;
|
|
52
|
+
}>;
|
|
53
|
+
export type UpdateResult = {
|
|
54
|
+
status: 'managed';
|
|
55
|
+
currentVersion: string;
|
|
56
|
+
executable: string;
|
|
57
|
+
} | {
|
|
58
|
+
status: 'up-to-date';
|
|
59
|
+
currentVersion: string;
|
|
60
|
+
latestVersion: string;
|
|
61
|
+
channel: string;
|
|
62
|
+
} | {
|
|
63
|
+
status: 'available';
|
|
64
|
+
currentVersion: string;
|
|
65
|
+
latestVersion: string;
|
|
66
|
+
channel: string;
|
|
67
|
+
} | {
|
|
68
|
+
status: 'updated';
|
|
69
|
+
previousVersion: string;
|
|
70
|
+
currentVersion: string;
|
|
71
|
+
channel: string;
|
|
72
|
+
bin: string;
|
|
73
|
+
};
|
|
74
|
+
export declare function detectPlatform(): Platform;
|
|
75
|
+
export declare function platformKey(platform: Platform): string;
|
|
76
|
+
export declare function classifyUpdateExecution(input: {
|
|
77
|
+
bunVersion?: string;
|
|
78
|
+
executable: string;
|
|
79
|
+
entry?: string;
|
|
80
|
+
}): UpdateExecution;
|
|
81
|
+
export declare function detectUpdateExecution(): UpdateExecution;
|
|
82
|
+
export declare function packageManagedUpdateError(executable: string): AstraleError;
|
|
83
|
+
export declare function readInstallMetadata(path?: string): Promise<InstallMetadata>;
|
|
84
|
+
export declare function admitScriptInstall(meta: InstallMetadata, execution: Extract<UpdateExecution, {
|
|
85
|
+
kind: 'standalone';
|
|
86
|
+
}>): Promise<AdmittedScriptInstall>;
|
|
87
|
+
export declare function writeInstallMetadata(meta: InstallMetadata, path?: string, filesystem?: Pick<CohortFilesystem, 'mkdir' | 'rename' | 'rm'> & Pick<typeof import('node:fs/promises'), 'writeFile'>): Promise<void>;
|
|
88
|
+
export declare function releaseBase(meta: InstallMetadata, req: Pick<UpdateRequest, 'channel' | 'version'>): string;
|
|
89
|
+
export declare function fetchManifest(base: string): Promise<UpdateManifest>;
|
|
90
|
+
export declare function shouldUpdate(currentVersion: string, manifestVersion: string): boolean;
|
|
91
|
+
interface CohortFilesystem {
|
|
92
|
+
readonly chmod: typeof chmod;
|
|
93
|
+
readonly copyFile: typeof copyFile;
|
|
94
|
+
readonly mkdir: typeof mkdir;
|
|
95
|
+
readonly rename: typeof rename;
|
|
96
|
+
readonly rm: typeof rm;
|
|
97
|
+
}
|
|
98
|
+
export interface StandaloneCohortReplacement {
|
|
99
|
+
readonly finalize: () => Promise<void>;
|
|
100
|
+
readonly rollback: () => Promise<void>;
|
|
101
|
+
}
|
|
102
|
+
/** Replace the standalone executable and its Viewer as one rollback-safe cohort. */
|
|
103
|
+
export declare function replaceStandaloneCohort(installedBinary: string, nextBinary: string, nextViewerDist: string, filesystem?: Partial<CohortFilesystem>): Promise<StandaloneCohortReplacement>;
|
|
104
|
+
interface UpdateDependencies {
|
|
105
|
+
readonly replaceStandaloneCohort: typeof replaceStandaloneCohort;
|
|
106
|
+
readonly writeInstallMetadata: typeof writeInstallMetadata;
|
|
107
|
+
}
|
|
108
|
+
export declare function updateAstrale(req: UpdateRequest, dependencies?: Partial<UpdateDependencies>): Promise<UpdateResult>;
|
|
109
|
+
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>;
|