@astrale-domains/services 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +2 -36
  2. package/dist/scaffold/template/README.md +2 -2
  3. package/dist/scaffold/template/src/index.js +2 -2
  4. package/dist/schema/index.d.ts +2 -2
  5. package/dist/schema/index.js +1 -1
  6. package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +6 -68
  7. package/dist/schema/modules/deployment/classes/deployment.d.ts +6 -72
  8. package/dist/schema/modules/deployment/classes/deployment.js +5 -9
  9. package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +5 -5
  10. package/dist/schema/modules/deployment/index.d.ts +2 -2
  11. package/dist/schema/modules/deployment/index.js +1 -1
  12. package/dist/schema/modules/deployment/types/index.d.ts +0 -4
  13. package/dist/schema/modules/deployment/types/index.js +0 -2
  14. package/dist/schema/modules/service/classes/cloudflare-service.d.ts +1 -17
  15. package/dist/schema/modules/service/classes/cloudflare-service.js +0 -2
  16. package/dist/schema/modules/service/classes/service.d.ts +1 -10
  17. package/dist/schema/modules/service/classes/service.js +2 -7
  18. package/dist/schema/modules/service/functions/index.d.ts +0 -1
  19. package/dist/schema/modules/service/functions/index.js +0 -1
  20. package/dist/schema/modules/service/functions/promote-service.d.ts +2 -2
  21. package/dist/schema/modules/service/functions/set-service-secret.d.ts +2 -2
  22. package/dist/schema/modules/service/functions/transfer-service.d.ts +2 -2
  23. package/dist/schema/modules/service/index.d.ts +1 -1
  24. package/dist/schema/modules/service/index.js +1 -1
  25. package/dist/schema/schema.d.ts +16 -161
  26. package/package.json +3 -1
  27. package/dist/schema/modules/deployment/types/legacy-deployment.d.ts +0 -65
  28. package/dist/schema/modules/deployment/types/legacy-deployment.js +0 -79
  29. package/dist/schema/modules/deployment/types/legacy-migration.d.ts +0 -17
  30. package/dist/schema/modules/deployment/types/legacy-migration.js +0 -17
  31. package/dist/schema/modules/service/functions/migrate-legacy-deployments.d.ts +0 -17
  32. package/dist/schema/modules/service/functions/migrate-legacy-deployments.js +0 -15
package/README.md CHANGED
@@ -52,8 +52,8 @@ caller in three groups also reaches the Services of each.
52
52
  Service of the group, deletion included.
53
53
  - `OwnDeployment` gives a deployment to the owner of its Service.
54
54
 
55
- Every Method but `migrate` is `authenticated`: a deployer's identities on the Admin instance hold
56
- no `can_use` on Services' Functions, which an `authorized` Method requires of every non-Root caller.
55
+ Every Method is `authenticated`: a deployer's identities on the Admin instance hold no `can_use`
56
+ on Services' Functions, which an `authorized` Method requires of every non-Root caller.
57
57
  Each handler asks the Kernel `Identity.can` for the caller on its own session before it reads
58
58
  anything: a caller who does not own the Service finds none (`SERVICE_NOT_FOUND`,
59
59
  `DEPLOYMENT_NOT_FOUND`), and a deploy of another owner's Service is refused
@@ -81,7 +81,6 @@ Call them on the Admin instance (`astrale call ... --admin`). Their wire contrac
81
81
  | `setSchedule`, `schedules` | `CloudflareService` | Replaces or reads the Service's UTC cron set; each cron fires on the current deployment. |
82
82
  | `logs` | `CloudflareService` | Recent logs of the current deployment, or of one deployment named by `label`. |
83
83
  | `delete` | `CloudflareService` | Stops routing the Service, retires every deployment of it, then deletes it and frees its name. |
84
- | `migrate` | `CloudflareService` (static, Root) | Once, after this revision is installed: rewrites the Services and deployments stored before Services hosted any Worker (see [Migration](#migration-to-the-agnostic-model)). |
85
84
  | `retire` | `CloudflareDeployment` | Withdraws one deployment for good. The current deployment is never retired alone. |
86
85
 
87
86
  ## Deploying
@@ -221,39 +220,6 @@ build (esbuild) and deploy scripts. `npm run deploy -- <environment>` builds it,
221
220
  explains promotion and rollback, secrets, crons, logs and deletion. The scaffold lives in
222
221
  [`tooling/scaffold`](tooling/scaffold); `pnpm package` copies it to `dist/scaffold`.
223
222
 
224
- ## Migration to the agnostic model
225
-
226
- The Kernel installs no Schema revision that existing data does not satisfy
227
- (`DATA_MIGRATION_REQUIRED`), and the SDK has no install-time migration: a Service stored before
228
- Services hosted any Worker names its project `origin`, and its deployments store the Domain's
229
- `FrozenConfigurationV1` and `DeploymentRecordV1`. The transition is expand, migrate, contract:
230
-
231
- 1. **Expand** — this revision admits both forms. Every reader reads a legacy node as the Worker
232
- deployment it is (`convertLegacyDeployment`): its build digest is its record's; its
233
- configuration binds what the runtime that uploaded it bound (the compatibility date and flags,
234
- the author's variables, `ASTRALE_SETTINGS` encoded from the frozen settings as that runtime
235
- encoded it, the secret names, `record: true`, `signingIdentity: true`, `router` as it was); its
236
- record is the RFC 8785 JSON its activation published, with the Astrale record media type. Its
237
- label stays: a stored label is never derived again. Every writer writes the agnostic form only.
238
- 2. **Migrate** — the Kernel's Root calls `CloudflareService.migrate` once. Each legacy Service and
239
- deployment is rewritten by its own fenced Mutation (`origin` becomes `project`; a deployment
240
- stores its reading), nothing is written at Cloudflare, and a rerun rewrites nothing more. It
241
- answers how many it rewrote and names any deployment it could not read (`unconverted`, empty
242
- when everything converted).
243
- 3. **Contract** — the next revision drops the legacy shapes and `migrate`; the Kernel installs it
244
- only once no legacy value remains.
245
-
246
- Call it as the Admin Kernel's Root, with a short-lived root credential file (`--creds`) removed
247
- once the call answers:
248
-
249
- ```sh
250
- astrale call "/:services.astrale.ai:class.CloudflareService:migrate" --admin --json \
251
- --creds "$ROOT_CREDENTIAL_FILE"
252
- ```
253
-
254
- It answers `{ "services": <n>, "deployments": <n>, "unconverted": [] }`; a second call answers
255
- zeros.
256
-
257
223
  ## Admin-hosted runtime
258
224
 
259
225
  Services are hosted for the Admin instance's Kernel alone: its graph is the registry of Service
@@ -48,7 +48,7 @@ astrale call "$SERVICE.method.schedules" --admin --json
48
48
  astrale call "$SERVICE.method.logs" --admin -d '{"tail":50}' --json
49
49
  astrale call "$SERVICE.method.setSecret" --admin -d @secret.json --json # { "name", "value" }
50
50
  astrale call "$SERVICE.method.secrets" --admin --json # names only
51
- astrale call "$SERVICE.method.delete" --admin --json
51
+ astrale call "$SERVICE.method.delete" --admin --json # again after retryAfterMs (~65 s)
52
52
  astrale call /:services.astrale.ai:class.CloudflareService:list \
53
53
  project=<project> environment=production --admin --json
54
54
  ```
@@ -63,7 +63,7 @@ astrale call /:services.astrale.ai:class.CloudflareService:list \
63
63
  binds the values it carries.
64
64
  - **Crons**: five-field UTC expressions. Each due cron is posted by the Services dispatcher to the
65
65
  deployment the Service serves, as `POST https://cron.internal/__scheduled` with `x-astrale-cron`
66
- (the expression) and `x-astrale-scheduled-time` (the minute it fired for, in epoch ms), within a
66
+ (the expression) and `x-astrale-scheduled-time` (the dispatcher's scheduled time in epoch ms, not rounded to the minute), within a
67
67
  10 s deadline. The public never reaches `/__scheduled`, in any spelling, and a run is at most once
68
68
  per minute but not exactly once: make the job safe to repeat.
69
69
  - **Logs**: `logs` reads the recent logs of the current deployment, or of one by `label`.
@@ -7,8 +7,8 @@ export default {
7
7
  /**
8
8
  * Admin's Services serves this Worker at its deployment URL and at its Service's URL. A cron of
9
9
  * the Service reaches it as `POST /__scheduled` from the Services dispatcher alone, with the cron
10
- * in `x-astrale-cron` and the minute it fired for (epoch ms) in `x-astrale-scheduled-time`: the
11
- * dispatcher refuses that path to the public, in every spelling.
10
+ * in `x-astrale-cron` and the dispatcher's scheduled time (epoch ms, not rounded to the minute) in
11
+ * `x-astrale-scheduled-time`: the dispatcher refuses that path to the public, in every spelling.
12
12
  */
13
13
  async fetch(request, env) {
14
14
  const path = new URL(request.url).pathname
@@ -2,5 +2,5 @@ export { schema } from './schema.js';
2
2
  export type { ServicesDomain, ServicesSchema } from './schema.js';
3
3
  export { ActAs, CloudflareService, OwnService, Service, TraverseOwnedService, serviceLifecycle, service_owned_by, } from './modules/service/index.js';
4
4
  export type { ServiceLifecycle, ServiceLifecycleEvent } from './modules/service/index.js';
5
- export { CloudflareDeployment, Deployment, OwnDeployment, TraverseOwnedServiceDeployment, current_deployment, deployment_of, deploymentHosting, deploymentLifecycle, deploymentRejection, deploymentRequest, deploymentResponse, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, legacyDeploymentRecord, legacyFrozenConfiguration, retireDeploymentOutput, workerConfiguration, workerRecord, } from './modules/deployment/index.js';
6
- export type { DeploymentHosting, DeploymentLifecycle, DeploymentLifecycleEvent, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, LegacyDeploymentRecord, LegacyFrozenConfiguration, MigrateLegacyResult, RetireDeploymentResult, WorkerConfiguration, WorkerRecordWire, } from './modules/deployment/index.js';
5
+ export { CloudflareDeployment, Deployment, OwnDeployment, TraverseOwnedServiceDeployment, current_deployment, deployment_of, deploymentHosting, deploymentLifecycle, deploymentRejection, deploymentRequest, deploymentResponse, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, retireDeploymentOutput, workerConfiguration, workerRecord, } from './modules/deployment/index.js';
6
+ export type { DeploymentHosting, DeploymentLifecycle, DeploymentLifecycleEvent, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, RetireDeploymentResult, WorkerConfiguration, WorkerRecordWire, } from './modules/deployment/index.js';
@@ -1,3 +1,3 @@
1
1
  export { schema } from './schema.js';
2
2
  export { ActAs, CloudflareService, OwnService, Service, TraverseOwnedService, serviceLifecycle, service_owned_by, } from './modules/service/index.js';
3
- export { CloudflareDeployment, Deployment, OwnDeployment, TraverseOwnedServiceDeployment, current_deployment, deployment_of, deploymentHosting, deploymentLifecycle, deploymentRejection, deploymentRequest, deploymentResponse, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, legacyDeploymentRecord, legacyFrozenConfiguration, retireDeploymentOutput, workerConfiguration, workerRecord, } from './modules/deployment/index.js';
3
+ export { CloudflareDeployment, Deployment, OwnDeployment, TraverseOwnedServiceDeployment, current_deployment, deployment_of, deploymentHosting, deploymentLifecycle, deploymentRejection, deploymentRequest, deploymentResponse, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, retireDeploymentOutput, workerConfiguration, workerRecord, } from './modules/deployment/index.js';
@@ -29,10 +29,8 @@ export declare const CloudflareDeployment: import("@astrale-os/sdk/schema").Auth
29
29
  required?: boolean;
30
30
  description?: string;
31
31
  }>;
32
- buildDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
33
- readonly required: false;
34
- }>;
35
- configuration: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
32
+ buildDigest: import("zod").ZodString;
33
+ configuration: import("zod").ZodObject<{
36
34
  format: import("zod").ZodLiteral<"astrale.worker.configuration">;
37
35
  version: import("zod").ZodLiteral<1>;
38
36
  compatibilityDate: import("zod").ZodString;
@@ -42,72 +40,12 @@ export declare const CloudflareDeployment: import("@astrale-os/sdk/schema").Auth
42
40
  record: import("zod").ZodBoolean;
43
41
  signingIdentity: import("zod").ZodBoolean;
44
42
  router: import("zod").ZodBoolean;
45
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
46
- format: import("zod").ZodLiteral<"astrale.deployment.configuration">;
47
- version: import("zod").ZodLiteral<1>;
48
- vars: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
49
- settings: import("zod").ZodObject<{
50
- maximumRequestBytes: import("zod").ZodNumber;
51
- invocationTimeoutMs: import("zod").ZodNumber;
52
- tokenExchange: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
53
- maximumLifetimeSeconds: import("zod").ZodNumber;
54
- }, import("zod/v4/core").$strict>]>;
55
- durableOptions: import("zod").ZodOptional<import("zod").ZodObject<{
56
- retentionMs: import("zod").ZodOptional<import("zod").ZodNumber>;
57
- retry: import("zod").ZodOptional<import("zod").ZodObject<{
58
- initialIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
59
- maxAttempts: import("zod").ZodOptional<import("zod").ZodNumber>;
60
- maxIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
61
- }, import("zod/v4/core").$strict>>;
62
- stepTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
63
- }, import("zod/v4/core").$strict>>;
64
- }, import("zod/v4/core").$strict>;
65
- runtime: import("zod").ZodObject<{
66
- compatibilityDate: import("zod").ZodString;
67
- compatibilityFlags: import("zod").ZodArray<import("zod").ZodString>;
68
- }, import("zod/v4/core").$strict>;
69
- bindings: import("zod").ZodObject<{
70
- services: import("zod").ZodArray<import("zod").ZodObject<{
71
- name: import("zod").ZodString;
72
- service: import("zod").ZodString;
73
- }, import("zod/v4/core").$strict>>;
74
- dispatchNamespaces: import("zod").ZodArray<import("zod").ZodObject<{
75
- name: import("zod").ZodString;
76
- namespace: import("zod").ZodString;
77
- }, import("zod/v4/core").$strict>>;
78
- secrets: import("zod").ZodArray<import("zod").ZodString>;
79
- }, import("zod/v4/core").$strict>;
80
- router: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
81
- service: import("zod").ZodString;
82
- hostSuffix: import("zod").ZodString;
83
- minLabels: import("zod").ZodNumber;
84
- }, import("zod/v4/core").$strict>]>;
85
- }, import("zod/v4/core").$strict>]>;
86
- configurationDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
87
- readonly required: false;
88
- }>;
89
- record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
43
+ }, import("zod/v4/core").$strict>;
44
+ configurationDigest: import("zod").ZodString;
45
+ record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodObject<{
90
46
  contentType: import("zod").ZodString;
91
47
  contentBase64: import("zod").ZodString;
92
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
93
- format: import("zod").ZodLiteral<"astrale.deployment-record">;
94
- version: import("zod").ZodLiteral<1>;
95
- origin: import("zod").ZodString;
96
- environment: import("zod").ZodString;
97
- releaseDigest: import("zod").ZodString;
98
- buildDigest: import("zod").ZodString;
99
- schemaRevision: import("zod").ZodString;
100
- configuration: import("zod").ZodString;
101
- providerScript: import("zod").ZodString;
102
- commit: import("zod").ZodNullable<import("zod").ZodObject<{
103
- sha: import("zod").ZodString;
104
- dirty: import("zod").ZodBoolean;
105
- base: import("zod").ZodOptional<import("zod").ZodObject<{
106
- version: import("zod").ZodString;
107
- distance: import("zod").ZodNumber;
108
- }, import("zod/v4/core").$strict>>;
109
- }, import("zod/v4/core").$strict>>;
110
- }, import("zod/v4/core").$strict>]>, {
48
+ }, import("zod/v4/core").$strict>, {
111
49
  readonly required: false;
112
50
  }>;
113
51
  secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodArray<import("zod").ZodObject<{
@@ -4,10 +4,6 @@ import { z } from 'zod';
4
4
  * script at its own URL. It never changes code; a new release is a new deployment of the
5
5
  * same Service. Only its secrets rotate in place, under the names its configuration declares.
6
6
  * Services knows nothing of what the Worker serves: the record it publishes is opaque bytes.
7
- *
8
- * LEGACY: a deployment created before Services hosted any Worker still stores the Domain's frozen
9
- * configuration and record, and no build or configuration digest, until `CloudflareService.migrate`
10
- * rewrites it; the next Schema revision admits the Worker form only.
11
7
  */
12
8
  export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
13
9
  readonly abstract: true;
@@ -39,11 +35,9 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
39
35
  description?: string;
40
36
  }>;
41
37
  /** The build digest of the uploaded Worker, bound as `ASTRALE_BUILD_DIGEST`. */
42
- buildDigest: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
43
- readonly required: false;
44
- }>;
38
+ buildDigest: z.ZodString;
45
39
  /** The configuration frozen into this deployment. */
46
- configuration: z.ZodUnion<readonly [z.ZodObject<{
40
+ configuration: z.ZodObject<{
47
41
  format: z.ZodLiteral<"astrale.worker.configuration">;
48
42
  version: z.ZodLiteral<1>;
49
43
  compatibilityDate: z.ZodString;
@@ -53,74 +47,14 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
53
47
  record: z.ZodBoolean;
54
48
  signingIdentity: z.ZodBoolean;
55
49
  router: z.ZodBoolean;
56
- }, z.core.$strict>, z.ZodObject<{
57
- format: z.ZodLiteral<"astrale.deployment.configuration">;
58
- version: z.ZodLiteral<1>;
59
- vars: z.ZodRecord<z.ZodString, z.ZodString>;
60
- settings: z.ZodObject<{
61
- maximumRequestBytes: z.ZodNumber;
62
- invocationTimeoutMs: z.ZodNumber;
63
- tokenExchange: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
64
- maximumLifetimeSeconds: z.ZodNumber;
65
- }, z.core.$strict>]>;
66
- durableOptions: z.ZodOptional<z.ZodObject<{
67
- retentionMs: z.ZodOptional<z.ZodNumber>;
68
- retry: z.ZodOptional<z.ZodObject<{
69
- initialIntervalMs: z.ZodOptional<z.ZodNumber>;
70
- maxAttempts: z.ZodOptional<z.ZodNumber>;
71
- maxIntervalMs: z.ZodOptional<z.ZodNumber>;
72
- }, z.core.$strict>>;
73
- stepTimeoutMs: z.ZodOptional<z.ZodNumber>;
74
- }, z.core.$strict>>;
75
- }, z.core.$strict>;
76
- runtime: z.ZodObject<{
77
- compatibilityDate: z.ZodString;
78
- compatibilityFlags: z.ZodArray<z.ZodString>;
79
- }, z.core.$strict>;
80
- bindings: z.ZodObject<{
81
- services: z.ZodArray<z.ZodObject<{
82
- name: z.ZodString;
83
- service: z.ZodString;
84
- }, z.core.$strict>>;
85
- dispatchNamespaces: z.ZodArray<z.ZodObject<{
86
- name: z.ZodString;
87
- namespace: z.ZodString;
88
- }, z.core.$strict>>;
89
- secrets: z.ZodArray<z.ZodString>;
90
- }, z.core.$strict>;
91
- router: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
92
- service: z.ZodString;
93
- hostSuffix: z.ZodString;
94
- minLabels: z.ZodNumber;
95
- }, z.core.$strict>]>;
96
- }, z.core.$strict>]>;
50
+ }, z.core.$strict>;
97
51
  /** The digest of `configuration` (`workerConfigurationDigest`). */
98
- configurationDigest: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
99
- readonly required: false;
100
- }>;
52
+ configurationDigest: z.ZodString;
101
53
  /** The record the deployment publishes, when its configuration asks for one. */
102
- record: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodUnion<readonly [z.ZodObject<{
54
+ record: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodObject<{
103
55
  contentType: z.ZodString;
104
56
  contentBase64: z.ZodString;
105
- }, z.core.$strict>, z.ZodObject<{
106
- format: z.ZodLiteral<"astrale.deployment-record">;
107
- version: z.ZodLiteral<1>;
108
- origin: z.ZodString;
109
- environment: z.ZodString;
110
- releaseDigest: z.ZodString;
111
- buildDigest: z.ZodString;
112
- schemaRevision: z.ZodString;
113
- configuration: z.ZodString;
114
- providerScript: z.ZodString;
115
- commit: z.ZodNullable<z.ZodObject<{
116
- sha: z.ZodString;
117
- dirty: z.ZodBoolean;
118
- base: z.ZodOptional<z.ZodObject<{
119
- version: z.ZodString;
120
- distance: z.ZodNumber;
121
- }, z.core.$strict>>;
122
- }, z.core.$strict>>;
123
- }, z.core.$strict>]>, {
57
+ }, z.core.$strict>, {
124
58
  readonly required: false;
125
59
  }>;
126
60
  /** The keyed digest of each secret bound to this deployment, never a value. */
@@ -2,17 +2,13 @@ import { classIcon, fullMatch, K, nodeClass, property, schema as valueSchema, st
2
2
  import { Rocket } from '@astrale-os/sdk/schema/icons';
3
3
  import { z } from 'zod';
4
4
  import { deploymentLifecycle } from '../states/index.js';
5
- import { deploymentSecretDigests, legacyDeploymentRecord, legacyFrozenConfiguration, workerConfiguration, workerRecord, } from '../types/index.js';
5
+ import { deploymentSecretDigests, workerConfiguration, workerRecord } from '../types/index.js';
6
6
  const digest = z.string().check(fullMatch('sha256:[0-9a-f]{64}'));
7
7
  /**
8
8
  * One immutable deployment of one Service: one Worker build with its configuration, served by one
9
9
  * script at its own URL. It never changes code; a new release is a new deployment of the
10
10
  * same Service. Only its secrets rotate in place, under the names its configuration declares.
11
11
  * Services knows nothing of what the Worker serves: the record it publishes is opaque bytes.
12
- *
13
- * LEGACY: a deployment created before Services hosted any Worker still stores the Domain's frozen
14
- * configuration and record, and no build or configuration digest, until `CloudflareService.migrate`
15
- * rewrites it; the next Schema revision admits the Worker form only.
16
12
  */
17
13
  export const Deployment = nodeClass({
18
14
  abstract: true,
@@ -25,13 +21,13 @@ export const Deployment = nodeClass({
25
21
  url: z.string().min(1).max(2_048),
26
22
  state: stateProperty(deploymentLifecycle),
27
23
  /** The build digest of the uploaded Worker, bound as `ASTRALE_BUILD_DIGEST`. */
28
- buildDigest: property(digest, { required: false }),
24
+ buildDigest: digest,
29
25
  /** The configuration frozen into this deployment. */
30
- configuration: z.union([workerConfiguration, legacyFrozenConfiguration]),
26
+ configuration: workerConfiguration,
31
27
  /** The digest of `configuration` (`workerConfigurationDigest`). */
32
- configurationDigest: property(digest, { required: false }),
28
+ configurationDigest: digest,
33
29
  /** The record the deployment publishes, when its configuration asks for one. */
34
- record: property(z.union([workerRecord, legacyDeploymentRecord]), { required: false }),
30
+ record: property(workerRecord, { required: false }),
35
31
  /** The keyed digest of each secret bound to this deployment, never a value. */
36
32
  secretDigests: property(deploymentSecretDigests, { required: false }),
37
33
  /**
@@ -11,14 +11,14 @@
11
11
  export declare const retireDeployment: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
12
12
  readonly mode: 'value';
13
13
  readonly value: {
14
- kind: "rejected";
15
- reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
16
- message: string;
17
- retryAfter?: string | undefined;
18
- } | {
19
14
  kind: "retired";
20
15
  } | {
21
16
  kind: "retiring";
22
17
  retryAfterMs: number;
18
+ } | {
19
+ kind: "rejected";
20
+ reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
21
+ message: string;
22
+ retryAfter?: string | undefined;
23
23
  };
24
24
  }, "authenticated", false, false, undefined>>;
@@ -1,5 +1,5 @@
1
- export { deploymentHosting, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, legacyDeploymentRecord, legacyFrozenConfiguration, listDeploymentsInput, listDeploymentsOutput, migrateLegacyInput, migrateLegacyOutput, retireDeploymentInput, retireDeploymentOutput, workerConfiguration, workerRecord, } from './types/index.js';
2
- export type { DeploymentHosting, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, LegacyDeploymentRecord, LegacyFrozenConfiguration, MigrateLegacyResult, RetireDeploymentResult, WorkerConfiguration, WorkerRecordWire, } from './types/index.js';
1
+ export { deploymentHosting, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, listDeploymentsInput, listDeploymentsOutput, retireDeploymentInput, retireDeploymentOutput, workerConfiguration, workerRecord, } from './types/index.js';
2
+ export type { DeploymentHosting, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, RetireDeploymentResult, WorkerConfiguration, WorkerRecordWire, } from './types/index.js';
3
3
  export { CloudflareDeployment, Deployment, current_deployment, deployment_of, } from './classes/index.js';
4
4
  export { deploymentHostingUnavailable, deploymentNotFound } from './errors/index.js';
5
5
  export { retireDeployment } from './functions/index.js';
@@ -1,6 +1,6 @@
1
1
  // Types first: the service module's Methods read them while this module's classes, which refer
2
2
  // to the Service class, are still evaluating.
3
- export { deploymentHosting, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, legacyDeploymentRecord, legacyFrozenConfiguration, listDeploymentsInput, listDeploymentsOutput, migrateLegacyInput, migrateLegacyOutput, retireDeploymentInput, retireDeploymentOutput, workerConfiguration, workerRecord, } from './types/index.js';
3
+ export { deploymentHosting, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, listDeploymentsInput, listDeploymentsOutput, retireDeploymentInput, retireDeploymentOutput, workerConfiguration, workerRecord, } from './types/index.js';
4
4
  export { CloudflareDeployment, Deployment, current_deployment, deployment_of, } from './classes/index.js';
5
5
  export { deploymentHostingUnavailable, deploymentNotFound } from './errors/index.js';
6
6
  export { retireDeployment } from './functions/index.js';
@@ -12,10 +12,6 @@ export { deploymentSecretDigest, deploymentSecretDigests } from './deployment-se
12
12
  export type { DeploymentSecretDigest } from './deployment-secret-digest.js';
13
13
  export { deploymentSummary } from './deployment-summary.js';
14
14
  export type { DeploymentSummary } from './deployment-summary.js';
15
- export { legacyDeploymentRecord, legacyFrozenConfiguration } from './legacy-deployment.js';
16
- export type { LegacyDeploymentRecord, LegacyFrozenConfiguration } from './legacy-deployment.js';
17
- export { migrateLegacyInput, migrateLegacyOutput } from './legacy-migration.js';
18
- export type { MigrateLegacyResult } from './legacy-migration.js';
19
15
  export { workerConfiguration } from './worker-configuration.js';
20
16
  export type { WorkerConfiguration } from './worker-configuration.js';
21
17
  export { workerRecord } from './worker-record.js';
@@ -5,7 +5,5 @@ export { retireDeploymentInput, retireDeploymentOutput } from './deployment-reti
5
5
  export { deploymentSecretRejection } from './deployment-secret.js';
6
6
  export { deploymentSecretDigest, deploymentSecretDigests } from './deployment-secret-digest.js';
7
7
  export { deploymentSummary } from './deployment-summary.js';
8
- export { legacyDeploymentRecord, legacyFrozenConfiguration } from './legacy-deployment.js';
9
- export { migrateLegacyInput, migrateLegacyOutput } from './legacy-migration.js';
10
8
  export { workerConfiguration } from './worker-configuration.js';
11
9
  export { workerRecord } from './worker-record.js';
@@ -11,12 +11,7 @@ export declare const CloudflareService: import("@astrale-os/sdk/schema").Authore
11
11
  readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
12
12
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
13
13
  readonly properties: {
14
- project: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
15
- readonly required: false;
16
- }>;
17
- origin: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
18
- readonly required: false;
19
- }>;
14
+ project: import("zod").ZodString;
20
15
  environment: import("zod").ZodString;
21
16
  fingerprint: import("zod").ZodString;
22
17
  url: import("zod").ZodString;
@@ -240,17 +235,6 @@ export declare const CloudflareService: import("@astrale-os/sdk/schema").Authore
240
235
  retryAfterMs: number;
241
236
  };
242
237
  }, "authenticated", false, false, undefined>>;
243
- migrate: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
244
- readonly mode: 'value';
245
- readonly value: {
246
- services: number;
247
- deployments: number;
248
- unconverted: {
249
- id: string;
250
- reason: string;
251
- }[];
252
- };
253
- }, "authorized", true, false, undefined>>;
254
238
  };
255
239
  readonly policies: {
256
240
  read: () => import("@astrale-os/sdk/schema").Policy;
@@ -7,7 +7,6 @@ import { listServiceDeployments } from '../functions/list-service-deployments.js
7
7
  import { listServiceLogs } from '../functions/list-service-logs.js';
8
8
  import { listServiceSchedules } from '../functions/list-service-schedules.js';
9
9
  import { listServiceSecretNames } from '../functions/list-service-secret-names.js';
10
- import { migrateLegacyDeployments } from '../functions/migrate-legacy-deployments.js';
11
10
  import { promoteService } from '../functions/promote-service.js';
12
11
  import { replaceServiceSchedules } from '../functions/replace-service-schedules.js';
13
12
  import { setServiceSecret } from '../functions/set-service-secret.js';
@@ -34,7 +33,6 @@ export const CloudflareService = nodeClass({
34
33
  schedules: listServiceSchedules,
35
34
  logs: listServiceLogs,
36
35
  delete: deleteService,
37
- migrate: migrateLegacyDeployments,
38
36
  },
39
37
  policies: { read: () => OwnService },
40
38
  });
@@ -5,9 +5,6 @@ import { z } from 'zod';
5
5
  * immutable Deployment of it, and its URL serves the one it currently points at. Its `name` is the
6
6
  * SDK's `serviceName(project, environment)`: the DNS label of the Service and the prefix of each
7
7
  * deployment's label, unique among Services, and free again once the Service is deleted.
8
- *
9
- * LEGACY: a Service created before Services hosted any Worker names its project `origin` until
10
- * `CloudflareService.migrate` renames it; the next Schema revision requires `project`.
11
8
  */
12
9
  export declare const Service: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
13
10
  readonly abstract: true;
@@ -16,13 +13,7 @@ export declare const Service: import("@astrale-os/sdk/schema").AuthoredNodeClass
16
13
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
17
14
  readonly properties: {
18
15
  /** Any project name; a Domain deployer names its Domain's origin. */
19
- project: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
20
- readonly required: false;
21
- }>;
22
- /** LEGACY: the project of a Service created before Services hosted any Worker. */
23
- origin: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
24
- readonly required: false;
25
- }>;
16
+ project: z.ZodString;
26
17
  environment: z.ZodString;
27
18
  /** `serviceName(project, environment)`, 16 characters; it alone identifies the Service. */
28
19
  fingerprint: z.ZodString;
@@ -1,4 +1,4 @@
1
- import { classIcon, fullMatch, K, nodeClass, property, stateProperty } from '@astrale-os/sdk/schema';
1
+ import { classIcon, fullMatch, K, nodeClass, stateProperty } from '@astrale-os/sdk/schema';
2
2
  import { Server } from '@astrale-os/sdk/schema/icons';
3
3
  import { z } from 'zod';
4
4
  import { serviceLifecycle } from '../states/index.js';
@@ -8,9 +8,6 @@ import { serviceLifecycle } from '../states/index.js';
8
8
  * immutable Deployment of it, and its URL serves the one it currently points at. Its `name` is the
9
9
  * SDK's `serviceName(project, environment)`: the DNS label of the Service and the prefix of each
10
10
  * deployment's label, unique among Services, and free again once the Service is deleted.
11
- *
12
- * LEGACY: a Service created before Services hosted any Worker names its project `origin` until
13
- * `CloudflareService.migrate` renames it; the next Schema revision requires `project`.
14
11
  */
15
12
  export const Service = nodeClass({
16
13
  abstract: true,
@@ -19,9 +16,7 @@ export const Service = nodeClass({
19
16
  extends: [K.classes.Named, K.classes.Timestamped],
20
17
  properties: {
21
18
  /** Any project name; a Domain deployer names its Domain's origin. */
22
- project: property(z.string().min(1).max(253), { required: false }),
23
- /** LEGACY: the project of a Service created before Services hosted any Worker. */
24
- origin: property(z.string().min(1).max(253), { required: false }),
19
+ project: z.string().min(1).max(253),
25
20
  environment: z.string().min(1).max(63),
26
21
  /** `serviceName(project, environment)`, 16 characters; it alone identifies the Service. */
27
22
  fingerprint: z.string().check(fullMatch('[a-z2-7]{16}')),
@@ -5,7 +5,6 @@ export { listServiceDeployments } from './list-service-deployments.js';
5
5
  export { listServiceLogs } from './list-service-logs.js';
6
6
  export { listServiceSchedules } from './list-service-schedules.js';
7
7
  export { listServiceSecretNames } from './list-service-secret-names.js';
8
- export { migrateLegacyDeployments } from './migrate-legacy-deployments.js';
9
8
  export { promoteService } from './promote-service.js';
10
9
  export { replaceServiceSchedules } from './replace-service-schedules.js';
11
10
  export { setServiceSecret } from './set-service-secret.js';
@@ -5,7 +5,6 @@ export { listServiceDeployments } from './list-service-deployments.js';
5
5
  export { listServiceLogs } from './list-service-logs.js';
6
6
  export { listServiceSchedules } from './list-service-schedules.js';
7
7
  export { listServiceSecretNames } from './list-service-secret-names.js';
8
- export { migrateLegacyDeployments } from './migrate-legacy-deployments.js';
9
8
  export { promoteService } from './promote-service.js';
10
9
  export { replaceServiceSchedules } from './replace-service-schedules.js';
11
10
  export { setServiceSecret } from './set-service-secret.js';
@@ -4,11 +4,11 @@ export declare const promoteService: import("@astrale-os/sdk/schema").Method<imp
4
4
  }, {
5
5
  readonly mode: 'value';
6
6
  readonly value: {
7
- current: string;
8
- } | {
9
7
  kind: "rejected";
10
8
  reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
11
9
  message: string;
12
10
  retryAfter?: string | undefined;
11
+ } | {
12
+ current: string;
13
13
  };
14
14
  }, "authenticated", false, false, undefined>>;
@@ -4,11 +4,11 @@ export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<i
4
4
  }, {
5
5
  readonly mode: 'value';
6
6
  readonly value: {
7
- name: string;
8
- } | {
9
7
  kind: "rejected";
10
8
  reason: "secret-undeclared" | "service-unavailable";
11
9
  message: string;
12
10
  retryAfter?: string | undefined;
11
+ } | {
12
+ name: string;
13
13
  };
14
14
  }, "authenticated", false, false, undefined>>;
@@ -4,11 +4,11 @@ export declare const transferService: import("@astrale-os/sdk/schema").Method<im
4
4
  }, {
5
5
  readonly mode: 'value';
6
6
  readonly value: {
7
+ owner: string;
8
+ } | {
7
9
  kind: "rejected";
8
10
  reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
9
11
  message: string;
10
12
  retryAfter?: string | undefined;
11
- } | {
12
- owner: string;
13
13
  };
14
14
  }, "authenticated", false, false, undefined>>;
@@ -1,5 +1,5 @@
1
1
  export { CloudflareService, Service, service_owned_by } from './classes/index.js';
2
- export { deleteService, deployService, describeHosting, listServiceDeployments, listServiceLogs, listServiceSchedules, listServiceSecretNames, migrateLegacyDeployments, promoteService, replaceServiceSchedules, setServiceSecret, transferService, } from './functions/index.js';
2
+ export { deleteService, deployService, describeHosting, listServiceDeployments, listServiceLogs, listServiceSchedules, listServiceSecretNames, promoteService, replaceServiceSchedules, setServiceSecret, transferService, } from './functions/index.js';
3
3
  export { serviceNotFound } from './errors/index.js';
4
4
  export { ActAs, OwnService, TraverseOwnedService } from './policies/index.js';
5
5
  export { serviceLifecycle } from './states/index.js';
@@ -1,5 +1,5 @@
1
1
  export { CloudflareService, Service, service_owned_by } from './classes/index.js';
2
- export { deleteService, deployService, describeHosting, listServiceDeployments, listServiceLogs, listServiceSchedules, listServiceSecretNames, migrateLegacyDeployments, promoteService, replaceServiceSchedules, setServiceSecret, transferService, } from './functions/index.js';
2
+ export { deleteService, deployService, describeHosting, listServiceDeployments, listServiceLogs, listServiceSchedules, listServiceSecretNames, promoteService, replaceServiceSchedules, setServiceSecret, transferService, } from './functions/index.js';
3
3
  export { serviceNotFound } from './errors/index.js';
4
4
  export { ActAs, OwnService, TraverseOwnedService } from './policies/index.js';
5
5
  export { serviceLifecycle } from './states/index.js';
@@ -8,12 +8,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
8
8
  readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
9
9
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
10
10
  readonly properties: {
11
- project: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
12
- readonly required: false;
13
- }>;
14
- origin: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
15
- readonly required: false;
16
- }>;
11
+ project: import("zod").ZodString;
17
12
  environment: import("zod").ZodString;
18
13
  fingerprint: import("zod").ZodString;
19
14
  url: import("zod").ZodString;
@@ -37,12 +32,7 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
37
32
  readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
38
33
  readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
39
34
  readonly properties: {
40
- project: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
41
- readonly required: false;
42
- }>;
43
- origin: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
44
- readonly required: false;
45
- }>;
35
+ project: import("zod").ZodString;
46
36
  environment: import("zod").ZodString;
47
37
  fingerprint: import("zod").ZodString;
48
38
  url: import("zod").ZodString;
@@ -190,12 +180,12 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
190
180
  }, {
191
181
  readonly mode: 'value';
192
182
  readonly value: {
193
- current: string;
194
- } | {
195
183
  kind: "rejected";
196
184
  reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
197
185
  message: string;
198
186
  retryAfter?: string | undefined;
187
+ } | {
188
+ current: string;
199
189
  };
200
190
  }, "authenticated", false, false, undefined>>;
201
191
  transfer: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -266,17 +256,6 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
266
256
  retryAfterMs: number;
267
257
  };
268
258
  }, "authenticated", false, false, undefined>>;
269
- migrate: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
270
- readonly mode: 'value';
271
- readonly value: {
272
- services: number;
273
- deployments: number;
274
- unconverted: {
275
- id: string;
276
- reason: string;
277
- }[];
278
- };
279
- }, "authorized", true, false, undefined>>;
280
259
  };
281
260
  readonly policies: {
282
261
  read: () => import("@astrale-os/sdk/schema").Policy;
@@ -326,10 +305,8 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
326
305
  required?: boolean;
327
306
  description?: string;
328
307
  }>;
329
- buildDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
330
- readonly required: false;
331
- }>;
332
- configuration: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
308
+ buildDigest: import("zod").ZodString;
309
+ configuration: import("zod").ZodObject<{
333
310
  format: import("zod").ZodLiteral<"astrale.worker.configuration">;
334
311
  version: import("zod").ZodLiteral<1>;
335
312
  compatibilityDate: import("zod").ZodString;
@@ -339,72 +316,12 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
339
316
  record: import("zod").ZodBoolean;
340
317
  signingIdentity: import("zod").ZodBoolean;
341
318
  router: import("zod").ZodBoolean;
342
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
343
- format: import("zod").ZodLiteral<"astrale.deployment.configuration">;
344
- version: import("zod").ZodLiteral<1>;
345
- vars: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
346
- settings: import("zod").ZodObject<{
347
- maximumRequestBytes: import("zod").ZodNumber;
348
- invocationTimeoutMs: import("zod").ZodNumber;
349
- tokenExchange: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
350
- maximumLifetimeSeconds: import("zod").ZodNumber;
351
- }, import("zod/v4/core").$strict>]>;
352
- durableOptions: import("zod").ZodOptional<import("zod").ZodObject<{
353
- retentionMs: import("zod").ZodOptional<import("zod").ZodNumber>;
354
- retry: import("zod").ZodOptional<import("zod").ZodObject<{
355
- initialIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
356
- maxAttempts: import("zod").ZodOptional<import("zod").ZodNumber>;
357
- maxIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
358
- }, import("zod/v4/core").$strict>>;
359
- stepTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
360
- }, import("zod/v4/core").$strict>>;
361
- }, import("zod/v4/core").$strict>;
362
- runtime: import("zod").ZodObject<{
363
- compatibilityDate: import("zod").ZodString;
364
- compatibilityFlags: import("zod").ZodArray<import("zod").ZodString>;
365
- }, import("zod/v4/core").$strict>;
366
- bindings: import("zod").ZodObject<{
367
- services: import("zod").ZodArray<import("zod").ZodObject<{
368
- name: import("zod").ZodString;
369
- service: import("zod").ZodString;
370
- }, import("zod/v4/core").$strict>>;
371
- dispatchNamespaces: import("zod").ZodArray<import("zod").ZodObject<{
372
- name: import("zod").ZodString;
373
- namespace: import("zod").ZodString;
374
- }, import("zod/v4/core").$strict>>;
375
- secrets: import("zod").ZodArray<import("zod").ZodString>;
376
- }, import("zod/v4/core").$strict>;
377
- router: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
378
- service: import("zod").ZodString;
379
- hostSuffix: import("zod").ZodString;
380
- minLabels: import("zod").ZodNumber;
381
- }, import("zod/v4/core").$strict>]>;
382
- }, import("zod/v4/core").$strict>]>;
383
- configurationDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
384
- readonly required: false;
385
- }>;
386
- record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
319
+ }, import("zod/v4/core").$strict>;
320
+ configurationDigest: import("zod").ZodString;
321
+ record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodObject<{
387
322
  contentType: import("zod").ZodString;
388
323
  contentBase64: import("zod").ZodString;
389
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
390
- format: import("zod").ZodLiteral<"astrale.deployment-record">;
391
- version: import("zod").ZodLiteral<1>;
392
- origin: import("zod").ZodString;
393
- environment: import("zod").ZodString;
394
- releaseDigest: import("zod").ZodString;
395
- buildDigest: import("zod").ZodString;
396
- schemaRevision: import("zod").ZodString;
397
- configuration: import("zod").ZodString;
398
- providerScript: import("zod").ZodString;
399
- commit: import("zod").ZodNullable<import("zod").ZodObject<{
400
- sha: import("zod").ZodString;
401
- dirty: import("zod").ZodBoolean;
402
- base: import("zod").ZodOptional<import("zod").ZodObject<{
403
- version: import("zod").ZodString;
404
- distance: import("zod").ZodNumber;
405
- }, import("zod/v4/core").$strict>>;
406
- }, import("zod/v4/core").$strict>>;
407
- }, import("zod/v4/core").$strict>]>, {
324
+ }, import("zod/v4/core").$strict>, {
408
325
  readonly required: false;
409
326
  }>;
410
327
  secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodArray<import("zod").ZodObject<{
@@ -473,10 +390,8 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
473
390
  required?: boolean;
474
391
  description?: string;
475
392
  }>;
476
- buildDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
477
- readonly required: false;
478
- }>;
479
- configuration: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
393
+ buildDigest: import("zod").ZodString;
394
+ configuration: import("zod").ZodObject<{
480
395
  format: import("zod").ZodLiteral<"astrale.worker.configuration">;
481
396
  version: import("zod").ZodLiteral<1>;
482
397
  compatibilityDate: import("zod").ZodString;
@@ -486,72 +401,12 @@ export declare const schema: import("@astrale-os/sdk/schema").AuthoredSchema<"se
486
401
  record: import("zod").ZodBoolean;
487
402
  signingIdentity: import("zod").ZodBoolean;
488
403
  router: import("zod").ZodBoolean;
489
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
490
- format: import("zod").ZodLiteral<"astrale.deployment.configuration">;
491
- version: import("zod").ZodLiteral<1>;
492
- vars: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
493
- settings: import("zod").ZodObject<{
494
- maximumRequestBytes: import("zod").ZodNumber;
495
- invocationTimeoutMs: import("zod").ZodNumber;
496
- tokenExchange: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
497
- maximumLifetimeSeconds: import("zod").ZodNumber;
498
- }, import("zod/v4/core").$strict>]>;
499
- durableOptions: import("zod").ZodOptional<import("zod").ZodObject<{
500
- retentionMs: import("zod").ZodOptional<import("zod").ZodNumber>;
501
- retry: import("zod").ZodOptional<import("zod").ZodObject<{
502
- initialIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
503
- maxAttempts: import("zod").ZodOptional<import("zod").ZodNumber>;
504
- maxIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
505
- }, import("zod/v4/core").$strict>>;
506
- stepTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
507
- }, import("zod/v4/core").$strict>>;
508
- }, import("zod/v4/core").$strict>;
509
- runtime: import("zod").ZodObject<{
510
- compatibilityDate: import("zod").ZodString;
511
- compatibilityFlags: import("zod").ZodArray<import("zod").ZodString>;
512
- }, import("zod/v4/core").$strict>;
513
- bindings: import("zod").ZodObject<{
514
- services: import("zod").ZodArray<import("zod").ZodObject<{
515
- name: import("zod").ZodString;
516
- service: import("zod").ZodString;
517
- }, import("zod/v4/core").$strict>>;
518
- dispatchNamespaces: import("zod").ZodArray<import("zod").ZodObject<{
519
- name: import("zod").ZodString;
520
- namespace: import("zod").ZodString;
521
- }, import("zod/v4/core").$strict>>;
522
- secrets: import("zod").ZodArray<import("zod").ZodString>;
523
- }, import("zod/v4/core").$strict>;
524
- router: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
525
- service: import("zod").ZodString;
526
- hostSuffix: import("zod").ZodString;
527
- minLabels: import("zod").ZodNumber;
528
- }, import("zod/v4/core").$strict>]>;
529
- }, import("zod/v4/core").$strict>]>;
530
- configurationDigest: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
531
- readonly required: false;
532
- }>;
533
- record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
404
+ }, import("zod/v4/core").$strict>;
405
+ configurationDigest: import("zod").ZodString;
406
+ record: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodObject<{
534
407
  contentType: import("zod").ZodString;
535
408
  contentBase64: import("zod").ZodString;
536
- }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
537
- format: import("zod").ZodLiteral<"astrale.deployment-record">;
538
- version: import("zod").ZodLiteral<1>;
539
- origin: import("zod").ZodString;
540
- environment: import("zod").ZodString;
541
- releaseDigest: import("zod").ZodString;
542
- buildDigest: import("zod").ZodString;
543
- schemaRevision: import("zod").ZodString;
544
- configuration: import("zod").ZodString;
545
- providerScript: import("zod").ZodString;
546
- commit: import("zod").ZodNullable<import("zod").ZodObject<{
547
- sha: import("zod").ZodString;
548
- dirty: import("zod").ZodBoolean;
549
- base: import("zod").ZodOptional<import("zod").ZodObject<{
550
- version: import("zod").ZodString;
551
- distance: import("zod").ZodNumber;
552
- }, import("zod/v4/core").$strict>>;
553
- }, import("zod/v4/core").$strict>>;
554
- }, import("zod/v4/core").$strict>]>, {
409
+ }, import("zod/v4/core").$strict>, {
555
410
  readonly required: false;
556
411
  }>;
557
412
  secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodArray<import("zod").ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/services",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/astrale-os/domains.git",
@@ -84,7 +84,9 @@
84
84
  "provider:doctor": "bun providers/cloudflare/operator/maintenance/doctor.ts",
85
85
  "provider:platform-bootstrap": "bun providers/cloudflare/operator/platform-namespace/bootstrap.ts",
86
86
  "provider:platform-retire": "bun scripts/platform-namespace/retire.ts",
87
+ "provider:platform-record-metadata": "bun providers/cloudflare/operator/platform-namespace/record-metadata.ts",
87
88
  "provider:platform-secret": "bun providers/cloudflare/operator/platform-namespace/secret.ts",
89
+ "provider:record-metadata": "bun providers/cloudflare/operator/maintenance/record-metadata.ts",
88
90
  "typecheck": "tsc --noEmit && tsc --project providers/cloudflare/legacy/tsconfig.json",
89
91
  "test": "vitest run --config vitest.config.ts && pnpm run accessibility:check",
90
92
  "accessibility:check": "oxlint ui views frontend/src --jsx-a11y-plugin --react-plugin --deny-warnings",
@@ -1,65 +0,0 @@
1
- import { z } from 'zod';
2
- /** The `FrozenConfigurationV1` a legacy deployment stores. */
3
- export declare const legacyFrozenConfiguration: z.ZodObject<{
4
- format: z.ZodLiteral<"astrale.deployment.configuration">;
5
- version: z.ZodLiteral<1>;
6
- vars: z.ZodRecord<z.ZodString, z.ZodString>;
7
- settings: z.ZodObject<{
8
- maximumRequestBytes: z.ZodNumber;
9
- invocationTimeoutMs: z.ZodNumber;
10
- tokenExchange: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
11
- maximumLifetimeSeconds: z.ZodNumber;
12
- }, z.core.$strict>]>;
13
- durableOptions: z.ZodOptional<z.ZodObject<{
14
- retentionMs: z.ZodOptional<z.ZodNumber>;
15
- retry: z.ZodOptional<z.ZodObject<{
16
- initialIntervalMs: z.ZodOptional<z.ZodNumber>;
17
- maxAttempts: z.ZodOptional<z.ZodNumber>;
18
- maxIntervalMs: z.ZodOptional<z.ZodNumber>;
19
- }, z.core.$strict>>;
20
- stepTimeoutMs: z.ZodOptional<z.ZodNumber>;
21
- }, z.core.$strict>>;
22
- }, z.core.$strict>;
23
- runtime: z.ZodObject<{
24
- compatibilityDate: z.ZodString;
25
- compatibilityFlags: z.ZodArray<z.ZodString>;
26
- }, z.core.$strict>;
27
- bindings: z.ZodObject<{
28
- services: z.ZodArray<z.ZodObject<{
29
- name: z.ZodString;
30
- service: z.ZodString;
31
- }, z.core.$strict>>;
32
- dispatchNamespaces: z.ZodArray<z.ZodObject<{
33
- name: z.ZodString;
34
- namespace: z.ZodString;
35
- }, z.core.$strict>>;
36
- secrets: z.ZodArray<z.ZodString>;
37
- }, z.core.$strict>;
38
- router: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
39
- service: z.ZodString;
40
- hostSuffix: z.ZodString;
41
- minLabels: z.ZodNumber;
42
- }, z.core.$strict>]>;
43
- }, z.core.$strict>;
44
- /** The `DeploymentRecordV1` a legacy deployment stores, as its deployer declared it. */
45
- export declare const legacyDeploymentRecord: z.ZodObject<{
46
- format: z.ZodLiteral<"astrale.deployment-record">;
47
- version: z.ZodLiteral<1>;
48
- origin: z.ZodString;
49
- environment: z.ZodString;
50
- releaseDigest: z.ZodString;
51
- buildDigest: z.ZodString;
52
- schemaRevision: z.ZodString;
53
- configuration: z.ZodString;
54
- providerScript: z.ZodString;
55
- commit: z.ZodNullable<z.ZodObject<{
56
- sha: z.ZodString;
57
- dirty: z.ZodBoolean;
58
- base: z.ZodOptional<z.ZodObject<{
59
- version: z.ZodString;
60
- distance: z.ZodNumber;
61
- }, z.core.$strict>>;
62
- }, z.core.$strict>>;
63
- }, z.core.$strict>;
64
- export type LegacyFrozenConfiguration = z.output<typeof legacyFrozenConfiguration>;
65
- export type LegacyDeploymentRecord = z.output<typeof legacyDeploymentRecord>;
@@ -1,79 +0,0 @@
1
- import { fullMatch } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- /*
4
- * LEGACY — what a deployment created before Services hosted any Worker stores: the Domain's
5
- * `FrozenConfigurationV1` in `configuration` and its `DeploymentRecordV1` in `record`. Nothing
6
- * writes them any more: `CloudflareService.migrate` rewrites each one as a Worker deployment, and
7
- * the next Schema revision drops these shapes.
8
- */
9
- const name = z.string().min(1).max(128);
10
- const positive = z.number().int().min(1);
11
- const digest = z.string().check(fullMatch('sha256:[0-9a-f]{64}'));
12
- /** The `FrozenConfigurationV1` a legacy deployment stores. */
13
- export const legacyFrozenConfiguration = z.strictObject({
14
- format: z.literal('astrale.deployment.configuration'),
15
- version: z.literal(1),
16
- vars: z.record(name, z.string().max(64 * 1024)),
17
- settings: z.strictObject({
18
- maximumRequestBytes: z.number().int().min(1),
19
- invocationTimeoutMs: z.number().int().min(1),
20
- tokenExchange: z.union([
21
- z.literal(false),
22
- z.strictObject({ maximumLifetimeSeconds: z.number().int().min(1) }),
23
- ]),
24
- durableOptions: z
25
- .strictObject({
26
- retentionMs: positive.optional(),
27
- retry: z
28
- .strictObject({
29
- initialIntervalMs: positive.optional(),
30
- maxAttempts: positive.optional(),
31
- maxIntervalMs: positive.optional(),
32
- })
33
- .optional(),
34
- stepTimeoutMs: positive.optional(),
35
- })
36
- .optional(),
37
- }),
38
- runtime: z.strictObject({
39
- compatibilityDate: z.string().min(1).max(32),
40
- compatibilityFlags: z.array(name).max(64),
41
- }),
42
- bindings: z.strictObject({
43
- services: z.array(z.strictObject({ name, service: name })).max(32),
44
- dispatchNamespaces: z.array(z.strictObject({ name, namespace: name })).max(32),
45
- secrets: z.array(name).max(64),
46
- }),
47
- router: z.union([
48
- z.literal(false),
49
- z.strictObject({
50
- service: name,
51
- hostSuffix: z.string().max(253),
52
- minLabels: z.number().int().min(0).max(127),
53
- }),
54
- ]),
55
- });
56
- /** The `DeploymentRecordV1` a legacy deployment stores, as its deployer declared it. */
57
- export const legacyDeploymentRecord = z.strictObject({
58
- format: z.literal('astrale.deployment-record'),
59
- version: z.literal(1),
60
- origin: z.string().min(1).max(253),
61
- environment: z.string().min(1).max(63),
62
- releaseDigest: digest,
63
- buildDigest: digest,
64
- schemaRevision: digest,
65
- configuration: digest,
66
- providerScript: z.string().min(1).max(57),
67
- commit: z
68
- .strictObject({
69
- sha: z.string().check(fullMatch('[0-9a-fA-F]{40}')),
70
- dirty: z.boolean(),
71
- base: z
72
- .strictObject({
73
- version: z.string().min(1).max(256),
74
- distance: z.number().int().min(0),
75
- })
76
- .optional(),
77
- })
78
- .nullable(),
79
- });
@@ -1,17 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const migrateLegacyInput: z.ZodObject<{}, z.core.$strict>;
3
- /**
4
- * What one migration rewrote: the Services whose `origin` became their `project`, and the
5
- * deployments whose Domain configuration and record became a Worker configuration and an opaque
6
- * record. A rerun rewrites nothing more. `unconverted` names the deployments it could not rewrite,
7
- * which stay as they are for the operator to inspect.
8
- */
9
- export declare const migrateLegacyOutput: z.ZodObject<{
10
- services: z.ZodNumber;
11
- deployments: z.ZodNumber;
12
- unconverted: z.ZodArray<z.ZodObject<{
13
- id: z.ZodString;
14
- reason: z.ZodString;
15
- }, z.core.$strict>>;
16
- }, z.core.$strict>;
17
- export type MigrateLegacyResult = z.output<typeof migrateLegacyOutput>;
@@ -1,17 +0,0 @@
1
- import { z } from 'zod';
2
- /*
3
- * LEGACY — the transition of the deployments created before Services hosted any Worker. Removed
4
- * with the legacy shapes once every node is migrated.
5
- */
6
- export const migrateLegacyInput = z.strictObject({});
7
- /**
8
- * What one migration rewrote: the Services whose `origin` became their `project`, and the
9
- * deployments whose Domain configuration and record became a Worker configuration and an opaque
10
- * record. A rerun rewrites nothing more. `unconverted` names the deployments it could not rewrite,
11
- * which stay as they are for the operator to inspect.
12
- */
13
- export const migrateLegacyOutput = z.strictObject({
14
- services: z.number().int().min(0),
15
- deployments: z.number().int().min(0),
16
- unconverted: z.array(z.strictObject({ id: z.string().min(1), reason: z.string().max(500) })),
17
- });
@@ -1,17 +0,0 @@
1
- /**
2
- * LEGACY — rewrite every Service and deployment created before Services hosted any Worker in the
3
- * agnostic form, once, after this revision is installed and before the next one is. Only the
4
- * Kernel's Root calls it: an `authorized` Method without a Policy admits no other caller. Removed
5
- * with the legacy shapes.
6
- */
7
- export declare const migrateLegacyDeployments: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
8
- readonly mode: 'value';
9
- readonly value: {
10
- services: number;
11
- deployments: number;
12
- unconverted: {
13
- id: string;
14
- reason: string;
15
- }[];
16
- };
17
- }, "authorized", true, false, undefined>>;
@@ -1,15 +0,0 @@
1
- import { method } from '@astrale-os/sdk/schema';
2
- import { migrateLegacyInput, migrateLegacyOutput } from '../../deployment/index.js';
3
- /**
4
- * LEGACY — rewrite every Service and deployment created before Services hosted any Worker in the
5
- * agnostic form, once, after this revision is installed and before the next one is. Only the
6
- * Kernel's Root calls it: an `authorized` Method without a Policy admits no other caller. Removed
7
- * with the legacy shapes.
8
- */
9
- export const migrateLegacyDeployments = method({
10
- description: 'Rewrite the legacy Services and deployments in the agnostic Worker form.',
11
- auth: 'authorized',
12
- static: true,
13
- input: migrateLegacyInput,
14
- output: migrateLegacyOutput,
15
- });