@intentius/chant-lexicon-fly 0.90.0 → 0.93.0

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 (94) hide show
  1. package/README.md +27 -0
  2. package/dist/components/capability-plugin.d.ts +1 -0
  3. package/dist/components/capability-plugin.d.ts.map +1 -1
  4. package/dist/components/fly-release.d.ts +195 -0
  5. package/dist/components/fly-release.d.ts.map +1 -0
  6. package/dist/components/index.d.ts +2 -0
  7. package/dist/components/index.d.ts.map +1 -1
  8. package/dist/composites/catalog.d.ts.map +1 -1
  9. package/dist/composites/fly-site.d.ts +86 -0
  10. package/dist/composites/fly-site.d.ts.map +1 -0
  11. package/dist/describe-resources.d.ts +11 -0
  12. package/dist/describe-resources.d.ts.map +1 -1
  13. package/dist/index.d.ts +5 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/integrity.json +4 -4
  16. package/dist/manifest.json +1 -1
  17. package/dist/op/activities/fly-apply.d.ts +8 -22
  18. package/dist/op/activities/fly-apply.d.ts.map +1 -1
  19. package/dist/op/activities/fly-release-step.d.ts +24 -0
  20. package/dist/op/activities/fly-release-step.d.ts.map +1 -0
  21. package/dist/op/activities/fly-rollback-step.d.ts +25 -0
  22. package/dist/op/activities/fly-rollback-step.d.ts.map +1 -0
  23. package/dist/op/activities/index.d.ts +8 -0
  24. package/dist/op/activities/index.d.ts.map +1 -1
  25. package/dist/op/activities/machine-release.d.ts +192 -0
  26. package/dist/op/activities/machine-release.d.ts.map +1 -0
  27. package/dist/op/activities/machines-contract.d.ts +8 -0
  28. package/dist/op/activities/machines-contract.d.ts.map +1 -1
  29. package/dist/op/activities/machines-fake.d.ts +55 -0
  30. package/dist/op/activities/machines-fake.d.ts.map +1 -0
  31. package/dist/op/activities/machines-local-cli.d.ts +20 -0
  32. package/dist/op/activities/machines-local-cli.d.ts.map +1 -0
  33. package/dist/op/activities/machines-local.d.ts +107 -0
  34. package/dist/op/activities/machines-local.d.ts.map +1 -0
  35. package/dist/op/activities/sprite-fs.d.ts +12 -3
  36. package/dist/op/activities/sprite-fs.d.ts.map +1 -1
  37. package/dist/op/activities/sprite-service-converge.d.ts +107 -0
  38. package/dist/op/activities/sprite-service-converge.d.ts.map +1 -0
  39. package/dist/op/activities/sprites-fake.d.ts +18 -1
  40. package/dist/op/activities/sprites-fake.d.ts.map +1 -1
  41. package/dist/op/activities/sprites.d.ts +29 -9
  42. package/dist/op/activities/sprites.d.ts.map +1 -1
  43. package/dist/op/activity-contracts.d.ts +62 -0
  44. package/dist/op/activity-contracts.d.ts.map +1 -0
  45. package/dist/op/builders.d.ts +45 -0
  46. package/dist/op/builders.d.ts.map +1 -1
  47. package/dist/release-metadata.d.ts +48 -0
  48. package/dist/release-metadata.d.ts.map +1 -0
  49. package/dist/release-store.d.ts +36 -0
  50. package/dist/release-store.d.ts.map +1 -0
  51. package/dist/skills/chant-fly-ops.md +100 -0
  52. package/dist/skills/chant-fly-sprites.md +2 -1
  53. package/package.json +11 -4
  54. package/src/components/capability-plugin.ts +11 -3
  55. package/src/components/fly-release.test.ts +378 -0
  56. package/src/components/fly-release.ts +458 -0
  57. package/src/components/index.ts +16 -0
  58. package/src/composites/catalog.test.ts +2 -1
  59. package/src/composites/catalog.ts +98 -0
  60. package/src/composites/fly-site.test.ts +66 -0
  61. package/src/composites/fly-site.ts +140 -0
  62. package/src/describe-resources.test.ts +18 -3
  63. package/src/describe-resources.ts +69 -5
  64. package/src/index.ts +20 -0
  65. package/src/op/activities/fly-apply.ts +15 -3
  66. package/src/op/activities/fly-release-step.ts +32 -0
  67. package/src/op/activities/fly-rollback-step.ts +33 -0
  68. package/src/op/activities/index.ts +48 -0
  69. package/src/op/activities/machine-release.integration.test.ts +113 -0
  70. package/src/op/activities/machine-release.test.ts +138 -0
  71. package/src/op/activities/machine-release.ts +429 -0
  72. package/src/op/activities/machines-contract.docker.integration.test.ts +10 -1
  73. package/src/op/activities/machines-contract.test.ts +11 -1
  74. package/src/op/activities/machines-contract.ts +17 -0
  75. package/src/op/activities/machines-fake.ts +167 -0
  76. package/src/op/activities/machines-local-cli.ts +73 -0
  77. package/src/op/activities/machines-local.test.ts +225 -0
  78. package/src/op/activities/machines-local.ts +437 -0
  79. package/src/op/activities/sprite-exec-options.docker.integration.test.ts +70 -0
  80. package/src/op/activities/sprite-fs.test.ts +55 -0
  81. package/src/op/activities/sprite-fs.ts +14 -5
  82. package/src/op/activities/sprite-service-converge.test.ts +268 -0
  83. package/src/op/activities/sprite-service-converge.ts +268 -0
  84. package/src/op/activities/sprites-fake.ts +51 -8
  85. package/src/op/activities/sprites.integration.test.ts +30 -0
  86. package/src/op/activities/sprites.test.ts +20 -0
  87. package/src/op/activities/sprites.ts +50 -10
  88. package/src/op/activity-contracts.test.ts +71 -0
  89. package/src/op/activity-contracts.ts +67 -0
  90. package/src/op/builders.ts +57 -0
  91. package/src/release-metadata.ts +72 -0
  92. package/src/release-store.ts +70 -0
  93. package/src/skills/chant-fly-ops.md +100 -0
  94. package/src/skills/chant-fly-sprites.md +2 -1
@@ -73,14 +73,31 @@ interface ExecResult {
73
73
  stdout: string;
74
74
  stderr: string;
75
75
  exitCode: number;
76
+ /**
77
+ * Fake-only timing hook (#2765): how long `runExec` should hold the frames
78
+ * before sending them, set by the `sleep` form below. Lets a test prove
79
+ * `spriteExec`'s `timeoutMs` fires without a slow real exec.
80
+ */
81
+ delayMs?: number;
76
82
  }
77
83
  /**
78
84
  * Run one command against a sprite's `fs`. Not a real shell: it recognizes a
79
85
  * small set of forms so a test (and the example `guarded-task` Op) can write a
80
86
  * key, then overwrite/fail it, and prove restore rewinds. Segments split on
81
87
  * `;` run in order; the exit code is the last segment's (shell `;` semantics).
88
+ *
89
+ * `opts.env`/`opts.dir` (#2765) are the `env`/`dir` exec options after they
90
+ * cross the wire (`env` as `KEY=VALUE` strings, mirroring what the query
91
+ * params carry) — `env` and `pwd` below echo them back so a test can prove
92
+ * they reached the command. Real spritzer only wires `env`/`dir` through in
93
+ * container exec mode (real processes); its interpreter mode — what
94
+ * `fakeExec` otherwise mirrors — has no notion of either, so this pair of
95
+ * forms is fake-only, proven separately from the container-mode docker test.
82
96
  */
83
- export declare function fakeExec(sprite: SpriteState, cmd: string): ExecResult;
97
+ export declare function fakeExec(sprite: SpriteState, cmd: string, opts?: {
98
+ env?: string[];
99
+ dir?: string;
100
+ }): ExecResult;
84
101
  /**
85
102
  * Immediate children of `dir` in a flat `path → contents` map: a key
86
103
  * `${dir}/name` is a file; `${dir}/name/...` contributes the dir `name` once.
@@ -1 +1 @@
1
- {"version":3,"file":"sprites-fake.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites-fake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,KAAK,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpE,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC5B;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,C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AAE,MAAM,CAAC;IAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAwXpF"}
@@ -64,10 +64,17 @@ export declare function accumulateExecFrames(frames: Iterable<Uint8Array>): Spri
64
64
  */
65
65
  export declare function splitCommand(cmd: string): string[];
66
66
  /**
67
- * Build the `wss://.../exec?cmd=...&path=...&stdin=false&cc=true` URL for a
68
- * command (http→ws, https→wss). Pure.
67
+ * Build the `wss://.../exec?cmd=...&path=...&stdin=false&cc=true[&dir=...][&env=K=V]*`
68
+ * URL for a command (http→ws, https→wss). `dir` and `env` (#2765) are sent the
69
+ * way wisp's and spritzer's real exec API take them: `dir` is a single query
70
+ * param, and each `env` entry is its own repeated `env=KEY=VALUE` param — see
71
+ * wisp's `optsFromValues` (`Dir: q.Get("dir")`, `Env: q["env"]`) and spritzer's
72
+ * container-mode wrapping (`--dir`/`--env` per `real.go`). Pure.
69
73
  */
70
- export declare function spriteExecWsUrl(base: string, id: string, cmd: string): string;
74
+ export declare function spriteExecWsUrl(base: string, id: string, cmd: string, opts?: {
75
+ env?: Record<string, string>;
76
+ dir?: string;
77
+ }): string;
71
78
  /**
72
79
  * Parse a checkpoint create NDJSON body (line-delimited JSON progress events)
73
80
  * and capture the created version id. Real Sprites tags each event with a
@@ -107,8 +114,16 @@ export interface SpriteExecArgs {
107
114
  id: string;
108
115
  /** Command to run inside the sprite (tokenized into argv, quotes respected). */
109
116
  cmd: string;
110
- /** Per-exec timeout in ms. */
117
+ /**
118
+ * Per-exec timeout in ms (#2765). When it elapses before the command exits,
119
+ * the exec WebSocket is aborted and the activity throws a timeout error —
120
+ * previously declared and never enforced.
121
+ */
111
122
  timeoutMs?: number;
123
+ /** Extra environment variables for the command, on top of the sprite's own (#2765). */
124
+ env?: Record<string, string>;
125
+ /** Working directory to run the command in (#2765). */
126
+ dir?: string;
112
127
  endpoint?: string;
113
128
  token?: string;
114
129
  }
@@ -176,11 +191,16 @@ export declare function defaultSpritesHttp(token?: string, fetchImpl?: typeof fe
176
191
  export declare function spriteCreate(args: SpriteCreateArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteCreateResult>;
177
192
  /**
178
193
  * Run a command in the sprite over the control WebSocket (non-PTY stream
179
- * framing, per superfly/sprites-go). Connects to `wss://.../exec`, sends a
180
- * single `[4]` (stdin EOF), accumulates stdout/stderr frames, and reads the
181
- * exit code from the `[3]` frame. A non-zero exit is a failed activity (it
182
- * throws) so a risky step fails its phase and triggers `onFailure`
183
- * compensation (S5).
194
+ * framing, per superfly/sprites-go). Connects to `wss://.../exec` (`dir`/`env`
195
+ * riding on the URL — #2765), sends a single `[4]` (stdin EOF), accumulates
196
+ * stdout/stderr frames, and reads the exit code from the `[3]` frame. A
197
+ * non-zero exit is a failed activity (it throws) so a risky step fails its
198
+ * phase and triggers `onFailure` compensation (S5).
199
+ *
200
+ * `timeoutMs` (#2765) bounds the whole exec: a timer set at connect time
201
+ * terminates the WebSocket and rejects with a timeout error once it elapses
202
+ * without the command finishing. Previously declared on `SpriteExecArgs` and
203
+ * never read.
184
204
  */
185
205
  export declare function spriteExec(args: SpriteExecArgs, signal?: AbortSignal): Promise<SpriteExecResult>;
186
206
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AASH,eAAO,MAAM,wBAAwB,4BAA4B,CAAC;AAIlE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,EAChC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,GAAE,MAAM,GAAG,SAAqB,EACrC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,SAAS,CAEpB;AAwBD,eAAO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AC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,aAAa,EACnB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,WAA4C,GACjD,OAAO,CAAC,eAAe,CAAC,CAgC1B"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Activity contracts for this lexicon's `op/activities` (chant #2101, #2843).
3
+ *
4
+ * Resolved by convention at `@intentius/chant-lexicon-fly/op/activity-contracts`:
5
+ * `loadActivityContracts` (`packages/core/src/op/activity-contract-registry.ts`)
6
+ * merges what it finds here into the map core's OPS012 and OPS013 validate
7
+ * every Op step against.
8
+ *
9
+ * Only the activities a step's output is referenced from are covered.
10
+ * `spriteServicesObserve` is the observer of a `ConvergeOp({ observe })`
11
+ * (#2778), whose Converge step reads the observer's whole output, so OPS013
12
+ * needs its return schema; without one, every project declaring such a
13
+ * ConvergeOp failed `chant build` and `chant lint`. `spriteServiceRestart` is
14
+ * the step of the Op such a ConvergeOp's rule runs, and its result is what a
15
+ * later step would read. The other Sprites activities have no contract yet,
16
+ * which OPS012 skips rather than flags.
17
+ *
18
+ * Each `args` schema mirrors the `*Args` interface in
19
+ * `./activities/sprite-service-converge.ts` and each `returns` schema the
20
+ * `*Result`. Authored with `z.strictObject(...)`, so a misspelled key fails
21
+ * the build instead of vanishing.
22
+ */
23
+ export declare const spriteServicesObserveContract: import("@intentius/chant/op").ActivityContract<{
24
+ services?: {
25
+ name: string;
26
+ health?: string | undefined;
27
+ optional?: boolean | undefined;
28
+ }[] | undefined;
29
+ servicesFile?: string | undefined;
30
+ probes?: number | undefined;
31
+ probeIntervalMs?: number | undefined;
32
+ id?: string | undefined;
33
+ spriteEnv?: string | undefined;
34
+ endpoint?: string | undefined;
35
+ token?: string | undefined;
36
+ }, {
37
+ resources: {
38
+ name: string;
39
+ status: "unknown" | "drifted" | "in-sync";
40
+ detail: string;
41
+ }[];
42
+ skipped: string[];
43
+ }>;
44
+ export declare const spriteServiceRestartContract: import("@intentius/chant/op").ActivityContract<{
45
+ name?: string | undefined;
46
+ health?: string | undefined;
47
+ services?: {
48
+ name: string;
49
+ health?: string | undefined;
50
+ optional?: boolean | undefined;
51
+ }[] | undefined;
52
+ servicesFile?: string | undefined;
53
+ waitMs?: number | undefined;
54
+ id?: string | undefined;
55
+ spriteEnv?: string | undefined;
56
+ endpoint?: string | undefined;
57
+ token?: string | undefined;
58
+ }, {
59
+ name: string;
60
+ healthy: boolean | null;
61
+ }>;
62
+ //# sourceMappingURL=activity-contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAmBH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;EAazC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;EAWxC,CAAC"}
@@ -31,8 +31,12 @@ import type { SpriteCreateArgs, SpriteExecArgs, SpriteCheckpointArgs, SpriteRest
31
31
  import type { SpriteWriteFileArgs, SpriteReadFileArgs, SpriteListDirArgs, SpriteRemoveArgs } from "./activities/sprite-fs.js";
32
32
  import type { SpriteApplyNetworkPolicyArgs, SpriteApplyServicesArgs } from "./activities/sprite-config.js";
33
33
  import type { SpriteServiceCreateArgs, SpriteServiceGetArgs, SpriteServiceListArgs, SpriteServiceStartArgs, SpriteServiceStopArgs, SpriteServiceDeleteArgs, SpriteServiceLogsArgs } from "./activities/sprite-services.js";
34
+ import type { SpriteServicesObserveArgs, SpriteServiceRestartArgs } from "./activities/sprite-service-converge.js";
34
35
  import type { SpriteTaskCreateArgs, SpriteTaskRefreshArgs, SpriteTaskReleaseArgs } from "./activities/sprite-tasks.js";
35
36
  import type { SpritesUpArgs, SpritesDownArgs } from "./activities/sprites-emulator.js";
37
+ import type { FlyMachineReleaseArgs, FlyMachineExecArgs, FlyMachineStateArgs, FlyMachineVerifyArgs, FlyMachineRestoreArgs } from "./activities/machine-release.js";
38
+ import type { FlyReleaseArgs } from "./activities/fly-release-step.js";
39
+ import type { FlyRollbackArgs } from "./activities/fly-rollback-step.js";
36
40
  type StepOpts = {
37
41
  profile?: ActivityStep["profile"];
38
42
  };
@@ -78,6 +82,19 @@ export declare const spriteServiceStop: (args: WithStepRefs<SpriteServiceStopArg
78
82
  export declare const spriteServiceDelete: (args: WithStepRefs<SpriteServiceDeleteArgs> & StepOpts) => NamedActivityStep;
79
83
  /** Read a background service's log tail (#2711). Defaults to the `fastIdempotent` profile. */
80
84
  export declare const spriteServiceLogs: (args: WithStepRefs<SpriteServiceLogsArgs> & StepOpts) => NamedActivityStep;
85
+ /**
86
+ * Observe a box's declared services for a ConvergeOp (#2778): one verdict per
87
+ * service, `in-sync`, `drifted` or `unknown`, from the supervisor's list and
88
+ * each service's health URL. Pass it as `ConvergeOp({ observe })`. Defaults
89
+ * to the `fastIdempotent` profile.
90
+ */
91
+ export declare const spriteServicesObserve: (args: WithStepRefs<SpriteServicesObserveArgs> & StepOpts) => NamedActivityStep;
92
+ /**
93
+ * Restart one service through its supervisor and wait for its health URL
94
+ * (#2778). Without `name`, the service is the one a ConvergeOp rule
95
+ * dispatched the run for. Defaults to the `longInfra` profile.
96
+ */
97
+ export declare const spriteServiceRestart: (args: WithStepRefs<SpriteServiceRestartArgs> & StepOpts) => NamedActivityStep;
81
98
  /** Create a keep-alive task — the fully typed twin of core's `spriteTaskCreate`. Defaults to the `fastIdempotent` profile. */
82
99
  export declare const spriteTaskCreate: (args: WithStepRefs<SpriteTaskCreateArgs> & StepOpts) => NamedActivityStep;
83
100
  /** Refresh a keep-alive task's expiry — the fully typed twin of core's `spriteTaskRefresh`. Defaults to the `fastIdempotent` profile. */
@@ -88,5 +105,33 @@ export declare const spriteTaskRelease: (args: WithStepRefs<SpriteTaskReleaseArg
88
105
  export declare const spritesUp: (args?: WithStepRefs<SpritesUpArgs> & StepOpts) => NamedActivityStep;
89
106
  /** Stop and remove the local spritzer container — the fully typed twin of core's `spritesDown`. Defaults to the `fastIdempotent` profile. */
90
107
  export declare const spritesDown: (args?: WithStepRefs<SpritesDownArgs> & StepOpts) => NamedActivityStep;
108
+ /** Apply the plan with the Machine serving a release (its digest in the Machine's metadata). Defaults to the `longInfra` profile. */
109
+ export declare const flyMachineRelease: (args: WithStepRefs<FlyMachineReleaseArgs> & StepOpts) => NamedActivityStep;
110
+ /** Run a command inside a Machine (a migration). Defaults to the `atMostOnce` profile: chant cannot know the command is safe to repeat. */
111
+ export declare const flyMachineExec: (args: WithStepRefs<FlyMachineExecArgs> & StepOpts) => NamedActivityStep;
112
+ /** Restart a Machine under a lease and wait for it to be started. Defaults to the `longInfra` profile. */
113
+ export declare const flyMachineRestart: (args: WithStepRefs<FlyMachineStateArgs> & StepOpts) => NamedActivityStep;
114
+ /** Stop a Machine under a lease. Defaults to the `longInfra` profile. */
115
+ export declare const flyMachineStop: (args: WithStepRefs<FlyMachineStateArgs> & StepOpts) => NamedActivityStep;
116
+ /** Check a Machine is started with a release, and its health endpoint answers. Defaults to the `longInfra` profile. */
117
+ export declare const flyMachineVerify: (args: WithStepRefs<FlyMachineVerifyArgs> & StepOpts) => NamedActivityStep;
118
+ /** Put a recorded Machine config back (restore, rollback). Defaults to the `longInfra` profile. */
119
+ export declare const flyMachineRestore: (args: WithStepRefs<FlyMachineRestoreArgs> & StepOpts) => NamedActivityStep;
120
+ /**
121
+ * Ship a release to a Fly Machine from an Op (#2782): the `fly-release`
122
+ * capability's steps (upload and start, each migration once per environment,
123
+ * verify, restore on failure), for the environment `environment` names. With `source`
124
+ * it puts an approved source tree on the Machine. Defaults to the `longInfra`
125
+ * profile.
126
+ */
127
+ export declare const flyRelease: (args: WithStepRefs<FlyReleaseArgs> & StepOpts) => NamedActivityStep;
128
+ /**
129
+ * Put an earlier release back on a Fly Machine from an Op (#2800): the
130
+ * `fly-rollback` capability's restore of the Machine config recorded for `to`
131
+ * in `environment`, then its verify. With `source` the archive is checked
132
+ * against its digest, and the recorded config against the archive's tree,
133
+ * before the Machine changes. Defaults to the `longInfra` profile.
134
+ */
135
+ export declare const flyRollback: (args: WithStepRefs<FlyRollbackArgs> & StepOpts) => NamedActivityStep;
91
136
  export {};
92
137
  //# sourceMappingURL=builders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAY,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAoB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/L,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3H,OAAO,KAAK,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACxG,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACpH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEpF,KAAK,QAAQ,GAAG;IAAE,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CA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AAW,GAAI,OAAM,YAAY,CAAC,eAAe,CAAC,GAAG,QAAa,KAAG,iBACd,CAAC;AAOrE,qIAAqI;AACrI,eAAO,MAAM,iBAAiB,4DAjFkB,iBAiFoD,CAAC;AACrG,2IAA2I;AAC3I,eAAO,MAAM,cAAc,yDAnFqB,iBAmF4C,CAAC;AAC7F,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB,0DArFkB,iBAqFkD,CAAC;AACnG,yEAAyE;AACzE,eAAO,MAAM,cAAc,0DAvFqB,iBAuF4C,CAAC;AAC7F,uHAAuH;AACvH,eAAO,MAAM,gBAAgB,2DAzFmB,iBAyFiD,CAAC;AAClG,mGAAmG;AACnG,eAAO,MAAM,iBAAiB,4DA3FkB,iBA2FoD,CAAC;AACrG;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,qDAnGyB,iBAmG+B,CAAC;AAChF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,sDA3GwB,iBA2GkC,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The release a Fly Machine serves, as its metadata records it (#2736, ws-056).
3
+ *
4
+ * Pure: the keys, a reader, and a writer over a Machine config. The Machines
5
+ * activities (./op/activities/machine-release.ts) stamp these on a release,
6
+ * `describeResources` (./describe-resources.ts) reads them back, and
7
+ * `chant components status --live` compares the digest with the release
8
+ * ledger.
9
+ */
10
+ /**
11
+ * The Machine metadata keys that say which release it serves. Fly metadata is
12
+ * a string map, so each field is its own key.
13
+ *
14
+ * - `digest`: the release's digest, the release ledger's join key.
15
+ * - `gitSha`: the commit the release was built from.
16
+ * - `release`: an optional human label (a tag, a release id).
17
+ * - `previousDigest`: the release this one replaced when it first shipped, so
18
+ * a rollback knows where to go back to with no history of its own.
19
+ */
20
+ export declare const RELEASE_METADATA_KEYS: {
21
+ readonly digest: "chant-release-digest";
22
+ readonly gitSha: "chant-release-git-sha";
23
+ readonly release: "chant-release";
24
+ readonly previousDigest: "chant-release-previous-digest";
25
+ };
26
+ /** A release, as a Machine's metadata records it. */
27
+ export interface MachineRelease {
28
+ /** The release's digest (`sha256:...`): what the release ledger records. */
29
+ digest: string;
30
+ /** The commit it was built from. */
31
+ gitSha?: string;
32
+ /** A human label for it. */
33
+ release?: string;
34
+ /** The digest of the release it replaced, when there was one. */
35
+ previousDigest?: string;
36
+ }
37
+ export type MachineConfig = Record<string, unknown> & {
38
+ metadata?: Record<string, string>;
39
+ env?: Record<string, string>;
40
+ };
41
+ /** The release a Machine's metadata names, or undefined when it names none. Pure. */
42
+ export declare function readMachineRelease(metadata: Record<string, string> | null | undefined): MachineRelease | undefined;
43
+ /**
44
+ * A Machine config serving `release`: a copy of `config` with the release's
45
+ * metadata keys set (and any it does not carry removed). Pure.
46
+ */
47
+ export declare function withReleaseMetadata(config: MachineConfig | undefined, release: MachineRelease): MachineConfig;
48
+ //# sourceMappingURL=release-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-metadata.d.ts","sourceRoot":"","sources":["../src/release-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAC;AAE1H,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAYlH;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,CAU7G"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Where a Fly release's Machine config is kept, so a rollback can put it back
3
+ * (#2736, ws-056).
4
+ *
5
+ * The Machine's metadata says which release it serves and which one it
6
+ * replaced; the config that earlier release applied is kept on the
7
+ * `chant/lifecycle` branch beside the release ledger, one file per release at
8
+ * `<env>/fly/<app>/<machine>/<digest>.json`. It is written through core's
9
+ * ledger plumbing, so a workspace member's copy lands under its own prefix,
10
+ * and every checkout that fetches the branch can roll back.
11
+ *
12
+ * Not exported from the package entry point: it spawns git, which stays off
13
+ * the build path. The `fly-release` and `fly-rollback` capabilities import it.
14
+ */
15
+ /** Which Machine and release a config belongs to. */
16
+ export interface MachineConfigRef {
17
+ app: string;
18
+ machine: string;
19
+ digest: string;
20
+ }
21
+ /** A store of the Machine config each release applied. */
22
+ export interface MachineConfigStore {
23
+ read(ref: MachineConfigRef): Promise<Record<string, unknown> | undefined>;
24
+ write(ref: MachineConfigRef, config: Record<string, unknown>): Promise<void>;
25
+ }
26
+ /** The file a release's Machine config is kept in, under the environment's ledger directory. */
27
+ export declare function machineConfigFile(ref: MachineConfigRef): string;
28
+ /** The lifecycle-branch store for `environment`. */
29
+ export declare function lifecycleMachineConfigStore(environment: string, opts?: {
30
+ cwd?: string;
31
+ }): MachineConfigStore;
32
+ /** An in-memory store, for tests and for a caller with nowhere to keep configs. */
33
+ export declare function memoryMachineConfigStore(): MachineConfigStore & {
34
+ entries: Map<string, Record<string, unknown>>;
35
+ };
36
+ //# sourceMappingURL=release-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-store.d.ts","sourceRoot":"","sources":["../src/release-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1E,KAAK,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AAID,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAE/D;AAED,oDAAoD;AACpD,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,kBAAkB,CAgB5G;AAED,mFAAmF;AACnF,wBAAgB,wBAAwB,IAAI,kBAAkB,GAAG;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAYjH"}
@@ -53,3 +53,103 @@ Each prune logs the resource and endpoint it removed, so a prune run is auditabl
53
53
  ## Re-applying is safe
54
54
 
55
55
  A re-apply of an unchanged stack is a no-op per resource: machines whose config is structurally equal to live are skipped, volumes and certificates that already exist are skipped, and an IP of an already-present family is skipped. Only apply-only secrets are always re-set, because flaps exposes no value to diff against.
56
+
57
+ ## Releases on a Machine
58
+
59
+ A component can deploy to Fly with this lexicon alone. It declares an `App` and the `Machine` that serves, builds them with `chant build --lexicon fly -o dist/fly.json`, and deploys with the `fly-release` step. Here a `Publish` phase (`publish-image`, elided) pushes the image, and the release serves it by digest:
60
+
61
+ ```ts
62
+ import { phase, type Component } from "@intentius/chant/components";
63
+
64
+ export const web: Component = {
65
+ name: "web",
66
+ deploy: [
67
+ phase("Publish", [/* publish-image */]),
68
+ phase("Release", [
69
+ {
70
+ kind: "fly-release",
71
+ plan: "dist/fly.json",
72
+ digest: "@Publish.digest",
73
+ image: "@Publish.uri",
74
+ migrations: [{ name: "001_init.sql", command: "node migrate.js 001_init.sql" }],
75
+ verify: { url: "https://web.example.com", healthPath: "/health" },
76
+ },
77
+ ]),
78
+ ],
79
+ };
80
+ ```
81
+
82
+ The step updates the Machine in place with the release in its `config.metadata`: `chant-release-digest`, `chant-release-git-sha` (the commit, `git rev-parse HEAD` unless given), and `chant-release-previous-digest` (the release it replaced). Each migration then runs inside the Machine through the Machines API's exec, once per environment: its receipt is kept on `chant/lifecycle` at `<env>/receipts/`, and a migration fires again only when its `sha` (or command) changes. After a migration fires, the Machine restarts, and the step checks that it is started with this release and, given a `url`, that its health endpoint answers with this commit or digest. If anything fails after the Machine changed, the step puts back the config the Machine served before (on a first release, it stops the Machine) and fails.
83
+
84
+ The step's output carries `uri` and `digest`, so `chant run --components web --env prod` records the release in the ledger. `chant components status prod --live` reads the Machine's metadata back and compares its digest with the ledger's: the row is `reconciled` when they agree and `drifted` when the Machine serves something the ledger does not name. The component joins the Machine by name: name the component after the Machine entity, or list it in `liveNames`.
85
+
86
+ Each release's Machine config is kept on `chant/lifecycle` at `<env>/fly/<app>/<machine>/<digest>.json`. `fly-rollback` puts back the config of the release the serving one replaced (or the digest given as `to`), checks it, and outputs that digest so the ledger records it again. `fly-release`'s own saga compensation does the same.
87
+
88
+ The steps are also Op activities, for an Op that composes them itself: `flyMachineRelease`, `flyMachineExec`, `flyMachineRestart`, `flyMachineStop`, `flyMachineVerify` and `flyMachineRestore`. Wrap a migration's `flyMachineExec` in `effect()` so it fires once.
89
+
90
+ ### A source tree instead of an image
91
+
92
+ An app with no image of its own ships as its files on the declared runtime image. Give `fly-release` a `source` in place of `image`: an archive made by core's `sourceArchive` step (`git archive` of one directory of a commit, the same bytes for the same commit), the sha256 it must have, the directory it holds, where the files go (default `/srv/app`) and the command that starts the app there. The archive is read only once its bytes hash to that digest, before the Machine changes, so the Machine never gets a tree nobody approved. The files go into the Machine's config, up to 1 MiB base64. A larger app needs an image.
93
+
94
+ An Op runs the same steps with the `flyRelease` activity, which takes the environment it ships to as `environment` (`env` stays the Machine's env vars). A release Op gates on the plan core's `releasePlan` writes and records the release with `releaseRecord`:
95
+
96
+ ```ts
97
+ import { Op, phase, gate, build, sourceArchive, releasePlan, releaseRecord } from "@intentius/chant/op";
98
+ import { flyRelease } from "@intentius/chant-lexicon-fly";
99
+
100
+ const archive = sourceArchive("../app", { id: "archive" });
101
+ const plan = releasePlan({ id: "plan", component: "app", env: "fly", gitSha: archive.out.commit, content: { artifact: { digest: archive.out.digest } } });
102
+
103
+ export default Op({
104
+ name: "release",
105
+ overview: "Ship the app member to Fly once its plan is approved",
106
+ phases: [
107
+ phase("Build", [archive, build(".", { script: "build:fly" })]),
108
+ phase("Plan", [plan]),
109
+ phase("Gate", [gate("ship", { plan: plan.out.digest })]),
110
+ phase("Ship", [
111
+ flyRelease({
112
+ environment: "fly",
113
+ plan: "dist/fly.json",
114
+ digest: plan.out.digest,
115
+ gitSha: archive.out.commit,
116
+ source: { archive: archive.out.archive, digest: archive.out.digest, dir: archive.out.dir, start: "node server.js" },
117
+ }),
118
+ ]),
119
+ phase("Record", [releaseRecord({ plan: plan.out.file, digest: plan.out.digest, approval: { op: "release", gate: "ship" } })]),
120
+ ],
121
+ });
122
+ ```
123
+
124
+ The Machine's metadata names the plan's digest, and so does the ledger record, so `chant components status fly --live` reconciles them. Running the Op again for the same commit plans the same digest, leaves the Machine as it is, and records nothing twice.
125
+
126
+ ### Rolling a source release back
127
+
128
+ A rollback Op takes the site back to the release it served before the latest one. Core's `releaseRollbackPlan` reads the release ledger, reads the earlier release's plan back, archives the same directory of the same commit again, and refuses unless the archive hashes to the digest that plan recorded. The gate binds to the rollback plan's digest. `flyRollback` puts back the Machine config `flyRelease` recorded for that release. It checks the archive against its digest before any flaps call, and checks that the recorded config carries exactly that tree. `releaseRollbackRecord` appends the restored release with `restores`, the actor and the approver:
129
+
130
+ ```ts
131
+ import { Op, phase, gate, build, releaseRollbackPlan, releaseRollbackRecord } from "@intentius/chant/op";
132
+ import { flyRollback } from "@intentius/chant-lexicon-fly";
133
+
134
+ const plan = releaseRollbackPlan({ id: "plan", component: "app", env: "fly" });
135
+
136
+ export default Op({
137
+ name: "rollback",
138
+ overview: "Put the previous release back on Fly once the rollback plan is approved",
139
+ phases: [
140
+ phase("Plan", [plan, build(".", { script: "build:fly" })]),
141
+ phase("Gate", [gate("rollback", { plan: plan.out.digest })]),
142
+ phase("Roll back", [
143
+ flyRollback({
144
+ environment: "fly",
145
+ plan: "dist/fly.json",
146
+ to: plan.out.to,
147
+ source: { archive: plan.out.archive, digest: plan.out.archiveDigest, dir: plan.out.dir },
148
+ }),
149
+ ]),
150
+ phase("Record", [releaseRollbackRecord({ plan: plan.out.file, digest: plan.out.digest, approval: { op: "rollback", gate: "rollback" } })]),
151
+ ],
152
+ });
153
+ ```
154
+
155
+ A rollback's own ledger record is not counted as a release, so running the Op again plans the same rollback, leaves the Machine as it is and records nothing. `to: "sha256:..."` on `releaseRollbackPlan` picks another release. Migrations are not undone.
@@ -17,7 +17,7 @@ Each activity is a direct REST call over an injectable HTTP client, imported fro
17
17
  | Activity | What it does |
18
18
  |----------|--------------|
19
19
  | `spriteCreate` | Create a sandbox. The caller-chosen `name` becomes the sprite `id` that every later activity keys on |
20
- | `spriteExec` | Run a command inside the sprite. A non-zero exit throws, so the phase fails and any `onFailure` compensation runs |
20
+ | `spriteExec` | Run a command inside the sprite, with optional `env`, `dir` and `timeoutMs` (#2765). A non-zero exit or a `timeoutMs` overrun throws, so the phase fails and any `onFailure` compensation runs |
21
21
  | `spriteCheckpoint` | Snapshot the sprite under a caller-chosen `label` |
22
22
  | `spriteRestore` | Rewind the sprite to a labeled checkpoint |
23
23
  | `spriteDestroy` | Destroy the sprite (idempotent; an already-gone sprite is a no-op) |
@@ -106,6 +106,7 @@ The same lexicon ships more Sprite primitives, all imported from `@intentius/cha
106
106
  | Filesystem (#848) | `spriteWriteFile` / `spriteReadFile` / `spriteListDir` / `spriteRemove` | stage an input file and read a result out without shelling `spriteExec` + `cat` |
107
107
  | Config reconcile (#849) | `spriteApplyNetworkPolicy` / `spriteApplyServices` | reconcile a Sprite's egress allowlist and background services against typed config (validated before any HTTP; a whole-object replace for policy, create-or-update by name for services) |
108
108
  | Services (#2711) | `spriteServiceCreate` / `spriteServiceGet` / `spriteServiceList` / `spriteServiceStart` / `spriteServiceStop` / `spriteServiceDelete` / `spriteServiceLogs` | the single-service primitives underneath `spriteApplyServices` — create-and-start one long-lived service (a box's door, hud or chud), inspect or list what's running, stop/start or delete one by name, read its log tail |
109
+ | Converge (#2778) | `spriteServicesObserve` / `spriteServiceRestart` | keep a box's declared services running with a `ConvergeOp`: the observer step gives one verdict per service (`in-sync`, `drifted`, `unknown`) from the supervisor and each health URL, and the restart is the step of the Op a rule dispatches for the drifted service. Inside the sprite they call `sprite-env services`; with a sprite `id` they use the API |
109
110
  | Sprite URL / delete (#2711) | `spriteUrl` / `spriteDelete` | resolve a Sprite's URL, optionally waiting until a path on it answers; delete the Sprite (`spriteDelete` is `spriteDestroy` under the name spritzer/wisp and the other lexicons' delete activities use — same call, either name) |
110
111
  | Keep-alive (#847) | `spriteTaskCreate` / `spriteTaskRefresh` / `spriteTaskRelease` | hold a Sprite active for a session so it will not pause; a session past the 1-hour task cap refreshes on an interval |
111
112
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-fly",
3
- "version": "0.90.0",
3
+ "version": "0.93.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/",
@@ -35,6 +35,11 @@
35
35
  "types": "./dist/op/activities/index.d.ts",
36
36
  "default": "./src/op/activities/index.ts"
37
37
  },
38
+ "./op/activity-contracts": {
39
+ "development": "./src/op/activity-contracts.ts",
40
+ "types": "./dist/op/activity-contracts.d.ts",
41
+ "default": "./src/op/activity-contracts.ts"
42
+ },
38
43
  "./lint/post-synth": {
39
44
  "development": "./src/lint/post-synth/index.ts",
40
45
  "types": "./dist/lint/post-synth/index.d.ts",
@@ -60,11 +65,13 @@
60
65
  "@intentius/chant": "*",
61
66
  "@types/ws": "^8.5.12",
62
67
  "tsc-alias": "^1.8.17",
63
- "typescript": "^5.9.3"
68
+ "typescript": "^5.9.3",
69
+ "zod": "^4.3.6"
64
70
  },
65
71
  "peerDependencies": {
66
- "@intentius/chant": "^0.90.0",
67
- "typescript": "^5.9.3"
72
+ "@intentius/chant": "^0.93.0",
73
+ "typescript": "^5.9.3",
74
+ "zod": "^4.3.6"
68
75
  },
69
76
  "description": "Fly.io Machines lexicon for chant — declarative IaC in TypeScript",
70
77
  "license": "Apache-2.0",
@@ -2,8 +2,9 @@
2
2
  * `flyCapabilityPlugin` — the fly lexicon's capability plugin (#1942, epic
3
3
  * #1564 phase 2).
4
4
  *
5
- * One leaf so far: `run-agent`, the sprite-lifecycle-backed agent-turn verb
6
- * (`./run-agent.ts`). Contributed through core's `CapabilityPlugin` contract
5
+ * Leaves: `run-agent`, the sprite-lifecycle-backed agent-turn verb
6
+ * (`./run-agent.ts`), and `fly-release` / `fly-rollback`, a release served by
7
+ * a Fly Machine (`./fly-release.ts`, #2736). Contributed through core's `CapabilityPlugin` contract
7
8
  * the same way aws contributes `cfn-deploy` and helm contributes
8
9
  * `helm-upgrade` (docs/components/cloud-boundary) — a project declaring
9
10
  * `lexicons: ["fly"]` gets `run-agent` registered automatically when it runs
@@ -15,9 +16,12 @@
15
16
  import type { Capability } from "@intentius/chant/components/capability";
16
17
  import { ownPackageVersion, type CapabilityPlugin } from "@intentius/chant/components/capability-plugin";
17
18
  import { flyRunAgentCapability } from "./run-agent";
19
+ import { flyReleaseCapability, flyRollbackCapability } from "./fly-release";
18
20
 
19
21
  export const FLY_VERB_FAMILIES = {
20
22
  agentExecution: ["run-agent"],
23
+ // A release served by a Fly Machine, and going back to an earlier one (#2736).
24
+ apply: ["fly-release", "fly-rollback"],
21
25
  } as const;
22
26
 
23
27
  export const flyCapabilityPlugin: CapabilityPlugin = {
@@ -28,7 +32,11 @@ export const flyCapabilityPlugin: CapabilityPlugin = {
28
32
  return ownPackageVersion(import.meta.url);
29
33
  },
30
34
  capabilities(): Array<Capability<never, unknown>> {
31
- return [flyRunAgentCapability as Capability<never, unknown>];
35
+ return [
36
+ flyRunAgentCapability as Capability<never, unknown>,
37
+ flyReleaseCapability as Capability<never, unknown>,
38
+ flyRollbackCapability as Capability<never, unknown>,
39
+ ];
32
40
  },
33
41
  families(): Record<string, readonly string[]> {
34
42
  return FLY_VERB_FAMILIES;