@intentius/chant-lexicon-fly 0.46.0 → 0.50.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.
- package/dist/components/capability-plugin.d.ts +6 -0
- package/dist/components/capability-plugin.d.ts.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/run-agent.d.ts +92 -0
- package/dist/components/run-agent.d.ts.map +1 -0
- package/dist/composites/fly-deploy.d.ts +4 -4
- package/dist/composites/fly-deploy.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/dist/op/builders.d.ts +73 -0
- package/dist/op/builders.d.ts.map +1 -0
- package/package.json +7 -2
- package/src/components/capability-plugin.test.ts +30 -0
- package/src/components/capability-plugin.ts +36 -0
- package/src/components/index.ts +14 -0
- package/src/components/run-agent-conformance.test.ts +352 -0
- package/src/components/run-agent.test.ts +302 -0
- package/src/components/run-agent.ts +139 -0
- package/src/composites/fly-deploy.ts +4 -4
- package/src/index.ts +16 -5
- package/src/op/builders.test.ts +73 -0
- package/src/op/builders.ts +102 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type CapabilityPlugin } from "@intentius/chant/components/capability-plugin";
|
|
2
|
+
export declare const FLY_VERB_FAMILIES: {
|
|
3
|
+
readonly agentExecution: readonly ["run-agent"];
|
|
4
|
+
};
|
|
5
|
+
export declare const flyCapabilityPlugin: CapabilityPlugin;
|
|
6
|
+
//# sourceMappingURL=capability-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability-plugin.d.ts","sourceRoot":"","sources":["../../src/components/capability-plugin.ts"],"names":[],"mappings":"AAeA,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAGzG,eAAO,MAAM,iBAAiB;;CAEpB,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAE,gBAajC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fly lexicon's component/release surface: the `run-agent` capability,
|
|
3
|
+
* its real `SpriteActivities` adapter, and the `flyCapabilityPlugin` core
|
|
4
|
+
* loads when a project declares `lexicons: ["fly"]` (#1942). Component
|
|
5
|
+
* authors reach these from `@intentius/chant-lexicon-fly/components`, the way
|
|
6
|
+
* AWS and helm verbs come from their lexicons' `/components` entries.
|
|
7
|
+
*/
|
|
8
|
+
export { flyCapabilityPlugin, FLY_VERB_FAMILIES } from "./capability-plugin.js";
|
|
9
|
+
export { flyRunAgentCapability, createFlyRunAgentCapability, createFlySpriteActivities, parseSpriteExecFailure, } from "./run-agent.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `run-agent`'s fly-lexicon adapter (#1942, epic #1564 phase 2) — the real
|
|
3
|
+
* `SpriteActivities` implementation
|
|
4
|
+
* (`@intentius/chant/components/verbs/run-agent`) over this lexicon's own
|
|
5
|
+
* sprite lifecycle activities (`../op/activities/sprites.ts` +
|
|
6
|
+
* `../op/activities/sprite-fs.ts`), and the `run-agent` capability built over
|
|
7
|
+
* it. Registered through this lexicon's own `CapabilityPlugin`
|
|
8
|
+
* (`./capability-plugin.ts`) the same way aws contributes `cfn-deploy` and
|
|
9
|
+
* helm contributes `helm-upgrade` (docs/components/cloud-boundary) — core's
|
|
10
|
+
* `createRunAgentCapability` (the sequencing logic: create-or-reuse,
|
|
11
|
+
* checkpoint, stage, exec, collect, destroy/leave-alive, restore-by-comment)
|
|
12
|
+
* stays cloud-agnostic in `@intentius/chant`, structurally independent of
|
|
13
|
+
* this package; this module is the one piece with the hard dependency on the
|
|
14
|
+
* real sprite wire protocol.
|
|
15
|
+
*
|
|
16
|
+
* **The exec-throw finding (pre-merge review of #1946, recorded on #1942).**
|
|
17
|
+
* The real `spriteExec` (`../op/activities/sprites.ts`) throws on any
|
|
18
|
+
* non-zero exit — by design, so a *scripted Op phase*
|
|
19
|
+
* (`examples/sprites-agent-task/ops/guarded-task.op.ts`) fails and triggers
|
|
20
|
+
* its `onFailure` compensation. But `run-agent`'s `RunAgentOutput.turn.status`
|
|
21
|
+
* includes `"failed"` as a first-class, non-throwing result — an ordinary
|
|
22
|
+
* failed agent turn (the model's diff didn't compile, its tests failed,
|
|
23
|
+
* whatever the exit code means) is not an infrastructure failure and should
|
|
24
|
+
* not by itself unwind the saga (checkpoint restore is for "the sprite
|
|
25
|
+
* backend broke," not "the agent's output wasn't good"). Resolved here as
|
|
26
|
+
* **option (a)** from the review comment: `exec()` below wraps the real
|
|
27
|
+
* `spriteExec` in a try/catch and reclassifies a thrown non-zero-exit error
|
|
28
|
+
* back into a resolved `{ stdout, stderr, exitCode }`
|
|
29
|
+
* (`parseSpriteExecFailure`), so `SpriteActivities.exec` always resolves for
|
|
30
|
+
* an ordinary command outcome — exactly the contract core's `run()`
|
|
31
|
+
* (`packages/core/src/components/verbs/run-agent.ts`) assumes and relies on
|
|
32
|
+
* (it deliberately has *no* try/catch of its own around `sprites.exec`). A
|
|
33
|
+
* genuine transport/infra failure — the WebSocket erroring, connection
|
|
34
|
+
* refused, an aborted signal — does not match the reclassification pattern
|
|
35
|
+
* and still rejects, so core's saga-unwind path is preserved for *real*
|
|
36
|
+
* failures.
|
|
37
|
+
*
|
|
38
|
+
* Option (b) — accept that ordinary failures throw, and drop `"failed"` from
|
|
39
|
+
* `turn.status`'s reachable states — was rejected: it would make every
|
|
40
|
+
* failed agent turn indistinguishable from a genuine sprite outage, forcing
|
|
41
|
+
* a checkpoint-restore rollback for what is often just an unsuccessful
|
|
42
|
+
* attempt, which is not what "the environment is the transaction" is meant
|
|
43
|
+
* to protect against, and it would leave `RunAgentOutput.turn.status:
|
|
44
|
+
* "failed"` a dead, unreachable branch of a type #1941 deliberately shipped
|
|
45
|
+
* as reachable.
|
|
46
|
+
*
|
|
47
|
+
* **Fidelity note.** The real `spriteExec`'s thrown message carries only
|
|
48
|
+
* `stderr || stdout` combined (see its own doc comment in `sprites.ts`), not
|
|
49
|
+
* both streams separately — the reclassified result therefore folds that
|
|
50
|
+
* combined text into `stderr` and leaves `stdout` empty on the failure path.
|
|
51
|
+
* This is a known, documented loss versus a real non-throwing exec; recovering
|
|
52
|
+
* full stream fidelity would mean reimplementing the WebSocket exec framing
|
|
53
|
+
* here rather than reusing `spriteExec`, which is out of this issue's scope
|
|
54
|
+
* (core's module doc calls adapting the existing activities "a thin wrapper,
|
|
55
|
+
* not a rewrite").
|
|
56
|
+
*/
|
|
57
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
58
|
+
import { type RunAgentInput, type RunAgentOutput, type SpriteActivities } from "@intentius/chant/components/verbs/run-agent";
|
|
59
|
+
/**
|
|
60
|
+
* Parse the exit code + combined output text out of the real `spriteExec`'s
|
|
61
|
+
* thrown message shape: `sprite <id> exec "<cmd>" exited <code>: <text>`
|
|
62
|
+
* (see `../op/activities/sprites.ts`'s `spriteExec`). Returns `undefined` for
|
|
63
|
+
* any other error shape — a genuine transport/infra failure the caller
|
|
64
|
+
* should let propagate. Exported for direct unit testing of the
|
|
65
|
+
* reclassification the module doc above describes as option (a).
|
|
66
|
+
*
|
|
67
|
+
* The leading `[\s\S]*` is greedy on purpose: `spriteExec`'s message echoes
|
|
68
|
+
* the raw `cmd` verbatim before the real ` exited <code>: ` marker
|
|
69
|
+
* (`exec "<cmd>" exited ...`), so a crafted command whose text itself
|
|
70
|
+
* contains that exact substring must not be mistaken for the marker. A
|
|
71
|
+
* greedy prefix backtracks from the end of the string, so it always anchors
|
|
72
|
+
* to the *last* occurrence — the genuine marker `spriteExec` appended — never
|
|
73
|
+
* a leftmost false match inside the echoed `cmd`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function parseSpriteExecFailure(err: unknown): {
|
|
76
|
+
exitCode: number;
|
|
77
|
+
output: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* The real `SpriteActivities` implementation: a thin wrapper over this
|
|
81
|
+
* lexicon's own sprite lifecycle + filesystem activities, matching
|
|
82
|
+
* `@intentius/chant/components/verbs/run-agent`'s injectable seam exactly
|
|
83
|
+
* (see that module's doc comment — "adapting them is a thin wrapper, not a
|
|
84
|
+
* rewrite"). `exec()` is the one method that is not a bare pass-through — see
|
|
85
|
+
* this module's doc comment for why.
|
|
86
|
+
*/
|
|
87
|
+
export declare function createFlySpriteActivities(): SpriteActivities;
|
|
88
|
+
/** Build the `run-agent` capability over the real fly sprite backend. */
|
|
89
|
+
export declare function createFlyRunAgentCapability(): Capability<RunAgentInput, RunAgentOutput>;
|
|
90
|
+
/** Default `run-agent` capability, backed by the real `SpriteActivities` adapter above — what `flyCapabilityPlugin` (./capability-plugin.ts) registers. */
|
|
91
|
+
export declare const flyRunAgentCapability: Capability<RunAgentInput, RunAgentOutput>;
|
|
92
|
+
//# sourceMappingURL=run-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-agent.d.ts","sourceRoot":"","sources":["../../src/components/run-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACtB,MAAM,6CAA6C,CAAC;AAIrD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAOrG;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,IAAI,gBAAgB,CA8B5D;AAED,yEAAyE;AACzE,wBAAgB,2BAA2B,IAAI,UAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAEvF;AAED,2JAA2J;AAC3J,eAAO,MAAM,qBAAqB,EAAE,UAAU,CAAC,aAAa,EAAE,cAAc,CAAiC,CAAC"}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* `FLY_API_TOKEN`).
|
|
24
24
|
*/
|
|
25
25
|
import type { OpResource } from "@intentius/chant/op";
|
|
26
|
-
import type { ActivityStep } from "@intentius/chant/op";
|
|
26
|
+
import type { ActivityStep, NamedActivityStep } from "@intentius/chant/op";
|
|
27
27
|
/** The local mudflaps endpoint the deploy Op targets by default. */
|
|
28
28
|
export declare const LOCAL_FLAPS_ENDPOINT = "http://localhost:4280";
|
|
29
29
|
/** Options accepted by the mudflaps lifecycle step builders. */
|
|
@@ -47,9 +47,9 @@ export interface FlapsStepOpts {
|
|
|
47
47
|
* `flapsUp` activity (#740). Defaults to the `longInfra` profile (the image may
|
|
48
48
|
* pull); override via `opts.profile`.
|
|
49
49
|
*/
|
|
50
|
-
export declare const flapsUp: (opts?: FlapsStepOpts) =>
|
|
50
|
+
export declare const flapsUp: (opts?: FlapsStepOpts) => NamedActivityStep;
|
|
51
51
|
/** Stop and remove the local mudflaps container. Resolves to the `flapsDown` activity. Defaults to the `fastIdempotent` profile (override via `opts.profile`). */
|
|
52
|
-
export declare const flapsDown: (opts?: FlapsStepOpts) =>
|
|
52
|
+
export declare const flapsDown: (opts?: FlapsStepOpts) => NamedActivityStep;
|
|
53
53
|
/** Options for the flaps apply step (mirror `FlyApplyArgs`, minus `planPath`). */
|
|
54
54
|
export interface FlyApplyStepOpts {
|
|
55
55
|
/** flaps endpoint override (D3). Default: `FLY_FLAPS_BASE_URL` env, else real Fly. */
|
|
@@ -69,7 +69,7 @@ export interface FlyApplyStepOpts {
|
|
|
69
69
|
* App + Machine, wait each machine to `started`, prune owned-only when asked.
|
|
70
70
|
* Defaults to the `longInfra` profile (override via `opts.profile`).
|
|
71
71
|
*/
|
|
72
|
-
export declare const flyApplyStep: (planPath: string, opts?: FlyApplyStepOpts) =>
|
|
72
|
+
export declare const flyApplyStep: (planPath: string, opts?: FlyApplyStepOpts) => NamedActivityStep;
|
|
73
73
|
/** Options for {@link flyDeploy}. */
|
|
74
74
|
export interface FlyDeployOpts {
|
|
75
75
|
/** Op name (the `chant run <name>` target). Default: `fly`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fly-deploy.d.ts","sourceRoot":"","sources":["../../src/composites/fly-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"fly-deploy.d.ts","sourceRoot":"","sources":["../../src/composites/fly-deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE3E,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+FAA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;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,GAAE,aAAkB,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAyCnF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { flyPlugin } from "./plugin.js";
|
|
2
|
+
export { flyCapabilityPlugin, FLY_VERB_FAMILIES } from "./components/capability-plugin.js";
|
|
2
3
|
export { flySerializer } from "./serializer.js";
|
|
3
4
|
export { Fly, Region, OrgSlug, AppName, PseudoParameter } from "./pseudo.js";
|
|
4
5
|
export { FLY_METADATA_OWNERSHIP_KEYS } from "./ownership.js";
|
|
5
6
|
export { flyDeploy, flapsUp, flapsDown, flyApplyStep, LOCAL_FLAPS_ENDPOINT } from "./composites/fly-deploy.js";
|
|
6
7
|
export type { FlyDeployOpts, FlyApplyStepOpts, FlapsStepOpts } from "./composites/fly-deploy.js";
|
|
7
|
-
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown, } from "
|
|
8
|
+
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown, } from "./op/builders.js";
|
|
8
9
|
export * from "./generated/index.js";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKrC,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGxF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAK1D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC5G,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAY9F,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,WAAW,GACZ,MAAM,eAAe,CAAC;AAKvB,cAAc,mBAAmB,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "b0f8ad61d227846aa9e9b009f914ad9de0fcead8b25762b428fbdd4925e7de02",
|
|
5
5
|
"meta.json": "e46e65ba7544fafc6dbb3fd48b841904b5ae6f7cb4d517a940ed68b01626c097",
|
|
6
6
|
"types/index.d.ts": "a76090adb6eda33a2c07a074183299a59e953b48dd3f2020d7ef11278d59341e",
|
|
7
7
|
"rules/guest-sizing.ts": "bc749d218df8f3cc3d8fbe388205ae96e6b204ae0d6d77e8bf82cb936cc53ff6",
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
"skills/chant-fly-ops.md": "b8eef6504e203133e6a35c83aabb08404eec95060705395515a0046d42269cf1",
|
|
16
16
|
"skills/chant-fly-sprites.md": "89ba52db63a71a17eab483d99233a4ae67f5d34920445010e750f81c95200b4e"
|
|
17
17
|
},
|
|
18
|
-
"composite": "
|
|
18
|
+
"composite": "df763245c52d1694a647ca5974652d679f8ba0e130735c48305180e98657881e"
|
|
19
19
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed step-builder wrappers for this lexicon's sprite activities (chant
|
|
3
|
+
* #1288 Stage 2 — "regenerate the step builders as fully typed wrappers").
|
|
4
|
+
* Core's own sprite builders (`spriteCreate`, `spriteExec`, ...) already
|
|
5
|
+
* carry an inline object-literal type in `packages/core/src/op/builders.ts`
|
|
6
|
+
* — but that inline type is a hand-restated MIRROR of this lexicon's own
|
|
7
|
+
* `Sprite*Args` interfaces (`./activities/sprites.ts`,
|
|
8
|
+
* `./activities/sprite-fs.ts`, `./activities/sprite-tasks.ts`,
|
|
9
|
+
* `./activities/sprite-config.ts`, `./activities/sprites-emulator.ts`),
|
|
10
|
+
* exactly the duplication Stage 2 exists to eliminate. `opts`'s type in
|
|
11
|
+
* every wrapper below IS the activity's own `*Args` interface (via
|
|
12
|
+
* `WithStepRefs`) — never restated — so it stays in sync with the
|
|
13
|
+
* implementation by construction.
|
|
14
|
+
*
|
|
15
|
+
* There's no cross-package layering problem here (unlike `kubectlApply`/
|
|
16
|
+
* `helmInstall`): this package already owns both the activities and (per
|
|
17
|
+
* `./composites/fly-deploy.ts`'s existing `flapsUp`/`flapsDown`/
|
|
18
|
+
* `flyApplyStep` precedent, #744) the step-builder layer. So — matching how
|
|
19
|
+
* `lexicons/temporal/src/op/builders.ts` handles ITS OWN activities — this
|
|
20
|
+
* module REPLACES (not adds alongside) the sprite builders this package's
|
|
21
|
+
* `src/index.ts` used to re-export from `@intentius/chant/op`: same names,
|
|
22
|
+
* same import path (`@intentius/chant-lexicon-fly`), so an existing
|
|
23
|
+
* `import { spriteCreate } from "@intentius/chant-lexicon-fly"` call site
|
|
24
|
+
* gains authoring-time types and `StepOutputRef`/`.out` support with no
|
|
25
|
+
* change. `core`'s own originals are untouched, for anyone still importing
|
|
26
|
+
* `@intentius/chant/op` directly.
|
|
27
|
+
*/
|
|
28
|
+
import { type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
|
|
29
|
+
import type { ActivityStep } from "@intentius/chant/op";
|
|
30
|
+
import type { SpriteCreateArgs, SpriteExecArgs, SpriteCheckpointArgs, SpriteRestoreArgs, ListCheckpointsArgs, SpriteDestroyArgs } from "./activities/sprites.js";
|
|
31
|
+
import type { SpriteWriteFileArgs, SpriteReadFileArgs, SpriteListDirArgs, SpriteRemoveArgs } from "./activities/sprite-fs.js";
|
|
32
|
+
import type { SpriteApplyNetworkPolicyArgs, SpriteApplyServicesArgs } from "./activities/sprite-config.js";
|
|
33
|
+
import type { SpriteTaskCreateArgs, SpriteTaskRefreshArgs, SpriteTaskReleaseArgs } from "./activities/sprite-tasks.js";
|
|
34
|
+
import type { SpritesUpArgs, SpritesDownArgs } from "./activities/sprites-emulator.js";
|
|
35
|
+
type StepOpts = {
|
|
36
|
+
profile?: ActivityStep["profile"];
|
|
37
|
+
};
|
|
38
|
+
/** Create a sprite — the fully typed twin of core's `spriteCreate`. Defaults to the `longInfra` profile. */
|
|
39
|
+
export declare const spriteCreate: (args: WithStepRefs<SpriteCreateArgs> & StepOpts) => NamedActivityStep;
|
|
40
|
+
/** Run a command in a sprite — the fully typed twin of core's `spriteExec`. Defaults to the `longInfra` profile. */
|
|
41
|
+
export declare const spriteExec: (args: WithStepRefs<SpriteExecArgs> & StepOpts) => NamedActivityStep;
|
|
42
|
+
/** Checkpoint a sprite — the fully typed twin of core's `spriteCheckpoint`. Defaults to the `longInfra` profile. */
|
|
43
|
+
export declare const spriteCheckpoint: (args: WithStepRefs<SpriteCheckpointArgs> & StepOpts) => NamedActivityStep;
|
|
44
|
+
/** Restore a sprite — the fully typed twin of core's `spriteRestore`. Defaults to the `longInfra` profile. */
|
|
45
|
+
export declare const spriteRestore: (args: WithStepRefs<SpriteRestoreArgs> & StepOpts) => NamedActivityStep;
|
|
46
|
+
/** List a sprite's checkpoints — the fully typed twin of core's `listCheckpoints`. Defaults to the `fastIdempotent` profile. */
|
|
47
|
+
export declare const listCheckpoints: (args: WithStepRefs<ListCheckpointsArgs> & StepOpts) => NamedActivityStep;
|
|
48
|
+
/** Destroy a sprite — the fully typed twin of core's `spriteDestroy`. Defaults to the `fastIdempotent` profile. */
|
|
49
|
+
export declare const spriteDestroy: (args: WithStepRefs<SpriteDestroyArgs> & StepOpts) => NamedActivityStep;
|
|
50
|
+
/** Write a file into a sprite — the fully typed twin of core's `spriteWriteFile`. Defaults to the `fastIdempotent` profile. */
|
|
51
|
+
export declare const spriteWriteFile: (args: WithStepRefs<SpriteWriteFileArgs> & StepOpts) => NamedActivityStep;
|
|
52
|
+
/** Read a file from a sprite — the fully typed twin of core's `spriteReadFile`. Defaults to the `fastIdempotent` profile. */
|
|
53
|
+
export declare const spriteReadFile: (args: WithStepRefs<SpriteReadFileArgs> & StepOpts) => NamedActivityStep;
|
|
54
|
+
/** List a directory in a sprite — the fully typed twin of core's `spriteListDir`. Defaults to the `fastIdempotent` profile. */
|
|
55
|
+
export declare const spriteListDir: (args: WithStepRefs<SpriteListDirArgs> & StepOpts) => NamedActivityStep;
|
|
56
|
+
/** Remove a path in a sprite — the fully typed twin of core's `spriteRemove`. Defaults to the `fastIdempotent` profile. */
|
|
57
|
+
export declare const spriteRemove: (args: WithStepRefs<SpriteRemoveArgs> & StepOpts) => NamedActivityStep;
|
|
58
|
+
/** Reconcile a sprite's outbound network policy — the fully typed twin of core's `spriteApplyNetworkPolicy`. Defaults to the `fastIdempotent` profile. */
|
|
59
|
+
export declare const spriteApplyNetworkPolicy: (args: WithStepRefs<SpriteApplyNetworkPolicyArgs> & StepOpts) => NamedActivityStep;
|
|
60
|
+
/** Reconcile a sprite's background services — the fully typed twin of core's `spriteApplyServices`. Defaults to the `fastIdempotent` profile. */
|
|
61
|
+
export declare const spriteApplyServices: (args: WithStepRefs<SpriteApplyServicesArgs> & StepOpts) => NamedActivityStep;
|
|
62
|
+
/** Create a keep-alive task — the fully typed twin of core's `spriteTaskCreate`. Defaults to the `fastIdempotent` profile. */
|
|
63
|
+
export declare const spriteTaskCreate: (args: WithStepRefs<SpriteTaskCreateArgs> & StepOpts) => NamedActivityStep;
|
|
64
|
+
/** Refresh a keep-alive task's expiry — the fully typed twin of core's `spriteTaskRefresh`. Defaults to the `fastIdempotent` profile. */
|
|
65
|
+
export declare const spriteTaskRefresh: (args: WithStepRefs<SpriteTaskRefreshArgs> & StepOpts) => NamedActivityStep;
|
|
66
|
+
/** Release a keep-alive task — the fully typed twin of core's `spriteTaskRelease`. Defaults to the `fastIdempotent` profile. */
|
|
67
|
+
export declare const spriteTaskRelease: (args: WithStepRefs<SpriteTaskReleaseArgs> & StepOpts) => NamedActivityStep;
|
|
68
|
+
/** Boot a local spritzer (Fly Sprites API emulator) — the fully typed twin of core's `spritesUp`. Defaults to the `longInfra` profile. */
|
|
69
|
+
export declare const spritesUp: (args?: WithStepRefs<SpritesUpArgs> & StepOpts) => NamedActivityStep;
|
|
70
|
+
/** Stop and remove the local spritzer container — the fully typed twin of core's `spritesDown`. Defaults to the `fastIdempotent` profile. */
|
|
71
|
+
export declare const spritesDown: (args?: WithStepRefs<SpritesDownArgs> & StepOpts) => NamedActivityStep;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=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AA+H;AAC/H,eAAO,MAAM,eAAe,0DAnBoB,iBAmBmD,CAAC;AACpG,6HAA6H;AAC7H,eAAO,MAAM,cAAc,yDArBqB,iBAqBgD,CAAC;AACjG,+HAA+H;AAC/H,eAAO,MAAM,aAAa,wDAvBsB,iBAuB6C,CAAC;AAC9F,2HAA2H;AAC3H,eAAO,MAAM,YAAY,uDAzBuB,iBAyB0C,CAAC;AAC3F,0JAA0J;AAC1J,eAAO,MAAM,wBAAwB,mEA3BW,iBA2B8E,CAAC;AAC/H,iJAAiJ;AACjJ,eAAO,MAAM,mBAAmB,8DA7BgB,iBA6B+D,CAAC;AAChH,8HAA8H;AAC9H,eAAO,MAAM,gBAAgB,2DA/BmB,iBA+BsD,CAAC;AACvG,yIAAyI;AACzI,eAAO,MAAM,iBAAiB,4DAjCkB,iBAiCyD,CAAC;AAC1G,gIAAgI;AAChI,eAAO,MAAM,iBAAiB,4DAnCkB,iBAmCyD,CAAC;AAE1G,0IAA0I;AAC1I,eAAO,MAAM,SAAS,GAAI,OAAM,YAAY,CAAC,aAAa,CAAC,GAAG,QAAa,KAAG,iBACnB,CAAC;AAC5D,6IAA6I;AAC7I,eAAO,MAAM,WAAW,GAAI,OAAM,YAAY,CAAC,eAAe,CAAC,GAAG,QAAa,KAAG,iBACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-fly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/",
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
"types": "./dist/detect.d.ts",
|
|
26
26
|
"default": "./src/detect.ts"
|
|
27
27
|
},
|
|
28
|
+
"./components": {
|
|
29
|
+
"development": "./src/components/index.ts",
|
|
30
|
+
"types": "./dist/components/index.d.ts",
|
|
31
|
+
"default": "./src/components/index.ts"
|
|
32
|
+
},
|
|
28
33
|
"./op/activities": {
|
|
29
34
|
"development": "./src/op/activities/index.ts",
|
|
30
35
|
"types": "./dist/op/activities/index.d.ts",
|
|
@@ -57,7 +62,7 @@
|
|
|
57
62
|
"typescript": "^5.9.3"
|
|
58
63
|
},
|
|
59
64
|
"peerDependencies": {
|
|
60
|
-
"@intentius/chant": "^0.
|
|
65
|
+
"@intentius/chant": "^0.50.0",
|
|
61
66
|
"typescript": "^5.9.3"
|
|
62
67
|
},
|
|
63
68
|
"description": "Fly.io Machines lexicon for chant — declarative IaC in TypeScript",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { flyCapabilityPlugin, FLY_VERB_FAMILIES } from "./capability-plugin";
|
|
3
|
+
import { isCapabilityPlugin } from "@intentius/chant/components/capability-plugin";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
5
|
+
|
|
6
|
+
describe("flyCapabilityPlugin", () => {
|
|
7
|
+
test("satisfies the CapabilityPlugin contract", () => {
|
|
8
|
+
expect(isCapabilityPlugin(flyCapabilityPlugin)).toBe(true);
|
|
9
|
+
expect(flyCapabilityPlugin.capabilities().map((c) => c.kind)).toContain("run-agent");
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
test("the plugin's version is the lexicon package's own, not a literal (#1505)", () => {
|
|
13
|
+
const { version } = JSON.parse(
|
|
14
|
+
readFileSync(new URL("../../package.json", import.meta.url), "utf-8"),
|
|
15
|
+
) as { version: string };
|
|
16
|
+
expect(flyCapabilityPlugin.version).toBe(version);
|
|
17
|
+
expect(flyCapabilityPlugin.version).not.toBe("1.0.0");
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("declares run-agent under its own FLY_VERB_FAMILIES, not core's starter set", () => {
|
|
21
|
+
expect(FLY_VERB_FAMILIES.agentExecution).toEqual(["run-agent"]);
|
|
22
|
+
expect(flyCapabilityPlugin.families?.()).toEqual(FLY_VERB_FAMILIES);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("the registered capability declares rollbackPolicy \"native\" with a real rollback", () => {
|
|
26
|
+
const runAgent = flyCapabilityPlugin.capabilities().find((c) => c.kind === "run-agent");
|
|
27
|
+
expect(runAgent?.rollbackPolicy).toBe("native");
|
|
28
|
+
expect(typeof runAgent?.rollback).toBe("function");
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `flyCapabilityPlugin` — the fly lexicon's capability plugin (#1942, epic
|
|
3
|
+
* #1564 phase 2).
|
|
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
|
|
7
|
+
* the same way aws contributes `cfn-deploy` and helm contributes
|
|
8
|
+
* `helm-upgrade` (docs/components/cloud-boundary) — a project declaring
|
|
9
|
+
* `lexicons: ["fly"]` gets `run-agent` registered automatically when it runs
|
|
10
|
+
* components. Deliberately *not* part of core's always-on starter set
|
|
11
|
+
* (`packages/core/src/components/starter-plugin.ts`) — `run-agent` opts a
|
|
12
|
+
* project in via this lexicon the same way every other cloud-shaped leaf
|
|
13
|
+
* does, rather than shipping to every project by default.
|
|
14
|
+
*/
|
|
15
|
+
import type { Capability } from "@intentius/chant/components/capability";
|
|
16
|
+
import { ownPackageVersion, type CapabilityPlugin } from "@intentius/chant/components/capability-plugin";
|
|
17
|
+
import { flyRunAgentCapability } from "./run-agent";
|
|
18
|
+
|
|
19
|
+
export const FLY_VERB_FAMILIES = {
|
|
20
|
+
agentExecution: ["run-agent"],
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export const flyCapabilityPlugin: CapabilityPlugin = {
|
|
24
|
+
name: "fly",
|
|
25
|
+
// The lexicon package's own version (mirrors aws/helm's #1505 fix — a
|
|
26
|
+
// getter so the package.json read happens on first access, not at import time).
|
|
27
|
+
get version(): string {
|
|
28
|
+
return ownPackageVersion(import.meta.url);
|
|
29
|
+
},
|
|
30
|
+
capabilities(): Array<Capability<never, unknown>> {
|
|
31
|
+
return [flyRunAgentCapability as Capability<never, unknown>];
|
|
32
|
+
},
|
|
33
|
+
families(): Record<string, readonly string[]> {
|
|
34
|
+
return FLY_VERB_FAMILIES;
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The fly lexicon's component/release surface: the `run-agent` capability,
|
|
3
|
+
* its real `SpriteActivities` adapter, and the `flyCapabilityPlugin` core
|
|
4
|
+
* loads when a project declares `lexicons: ["fly"]` (#1942). Component
|
|
5
|
+
* authors reach these from `@intentius/chant-lexicon-fly/components`, the way
|
|
6
|
+
* AWS and helm verbs come from their lexicons' `/components` entries.
|
|
7
|
+
*/
|
|
8
|
+
export { flyCapabilityPlugin, FLY_VERB_FAMILIES } from "./capability-plugin";
|
|
9
|
+
export {
|
|
10
|
+
flyRunAgentCapability,
|
|
11
|
+
createFlyRunAgentCapability,
|
|
12
|
+
createFlySpriteActivities,
|
|
13
|
+
parseSpriteExecFailure,
|
|
14
|
+
} from "./run-agent";
|