@intentius/chant-lexicon-fly 0.88.0 → 0.90.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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +3 -3
- package/dist/manifest.json +1 -1
- package/dist/op/activities/emulator-images.d.ts +13 -0
- package/dist/op/activities/emulator-images.d.ts.map +1 -1
- package/dist/op/activities/index.d.ts +4 -2
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/sprite-services.d.ts +158 -0
- package/dist/op/activities/sprite-services.d.ts.map +1 -0
- package/dist/op/activities/sprites-contract.d.ts +17 -1
- package/dist/op/activities/sprites-contract.d.ts.map +1 -1
- package/dist/op/activities/sprites-emulator.d.ts +12 -0
- package/dist/op/activities/sprites-emulator.d.ts.map +1 -1
- package/dist/op/activities/sprites-fake.d.ts +4 -0
- package/dist/op/activities/sprites-fake.d.ts.map +1 -1
- package/dist/op/activities/sprites.d.ts +53 -0
- package/dist/op/activities/sprites.d.ts.map +1 -1
- package/dist/op/builders.d.ts +20 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/skills/chant-fly-sprites.md +4 -2
- package/package.json +2 -2
- package/src/index.ts +9 -0
- package/src/op/activities/emulator-images.ts +14 -0
- package/src/op/activities/index.ts +34 -0
- package/src/op/activities/sprite-config.test.ts +19 -0
- package/src/op/activities/sprite-services.docker.integration.test.ts +87 -0
- package/src/op/activities/sprite-services.test.ts +263 -0
- package/src/op/activities/sprite-services.ts +311 -0
- package/src/op/activities/sprites-contract.test.ts +15 -4
- package/src/op/activities/sprites-contract.ts +24 -6
- package/src/op/activities/sprites-emulator.ts +52 -1
- package/src/op/activities/sprites-fake.ts +57 -8
- package/src/op/activities/sprites.test.ts +102 -0
- package/src/op/activities/sprites.ts +108 -7
- package/src/op/builders.ts +28 -1
- package/src/skills/chant-fly-sprites.md +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export { flyDeploy, flapsUp, flapsDown, flyApplyStep, LOCAL_FLAPS_ENDPOINT } fro
|
|
|
7
7
|
export type { FlyDeployOpts, FlyApplyStepOpts, FlapsStepOpts } from "./composites/fly-deploy.js";
|
|
8
8
|
export { FlyOtelCollector } from "./composites/fly-otel-collector.js";
|
|
9
9
|
export type { FlyOtelCollectorProps } from "./composites/fly-otel-collector.js";
|
|
10
|
-
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown, } from "./op/builders.js";
|
|
10
|
+
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteDelete, spriteUrl, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteServiceCreate, spriteServiceGet, spriteServiceList, spriteServiceStart, spriteServiceStop, spriteServiceDelete, spriteServiceLogs, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown, } from "./op/builders.js";
|
|
11
11
|
export * from "./generated/index.js";
|
|
12
12
|
//# 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;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,M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,MAAM,iCAAiC,CAAC;AAY7E,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,aAAa,EACb,YAAY,EACZ,SAAS,EACT,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,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": "9d1303128ead427cbada93213e921f1fa07ced266bc373ab7b79da0abccb708e",
|
|
5
5
|
"meta.json": "273f2a523b66f08ca91642dba2592c44765ab59ddf7329998884a0b08c6c3f24",
|
|
6
6
|
"types/index.d.ts": "63ec7f2eaa8dddd3abb273748c646c4870d99616db53fc04b53edd0588ccf260",
|
|
7
7
|
"rules/guest-sizing.ts": "bc749d218df8f3cc3d8fbe388205ae96e6b204ae0d6d77e8bf82cb936cc53ff6",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"skills/chant-fly.md": "04277509e0abd81869047e66c58a10f4c8eaaa60a56be28bfcbfbe1cce20ad7c",
|
|
14
14
|
"skills/chant-fly-patterns.md": "9452bf83c9e499b36a01a305a4ef28965725426436df115fd7f21e3a773f98da",
|
|
15
15
|
"skills/chant-fly-ops.md": "b8eef6504e203133e6a35c83aabb08404eec95060705395515a0046d42269cf1",
|
|
16
|
-
"skills/chant-fly-sprites.md": "
|
|
16
|
+
"skills/chant-fly-sprites.md": "21584784e504b88a91cf9806aa9ebab51dbe733b1f8196d4a3af39d1e9a2c602"
|
|
17
17
|
},
|
|
18
|
-
"composite": "
|
|
18
|
+
"composite": "8cf24438f7ceff583b48adb36c3e9a89301c86a0bb941585d970cb97e17ae9b9"
|
|
19
19
|
}
|
package/dist/manifest.json
CHANGED
|
@@ -17,4 +17,17 @@
|
|
|
17
17
|
export declare const MUDFLAPS_IMAGE = "ghcr.io/intentius/mudflaps:0.4.1";
|
|
18
18
|
/** Pinned spritzer (Fly Sprites emulator) image. */
|
|
19
19
|
export declare const SPRITZER_IMAGE = "ghcr.io/intentius/spritzer:0.4.1";
|
|
20
|
+
/**
|
|
21
|
+
* Pinned spritzer image for container exec mode (`SPRITZER_EXEC=container`,
|
|
22
|
+
* #2711 / INTENTIUS/spritzer#22) — the Services CRUD activities
|
|
23
|
+
* (`./sprite-services.ts`) and `spriteUrl` only exist in this mode (real
|
|
24
|
+
* processes, a real sprite URL); the default `SPRITZER_IMAGE` above stays on
|
|
25
|
+
* the interpreter-mode pin everything else is tested against. 0.6.0 is the
|
|
26
|
+
* first release with container mode at all, so this can't move to a shared
|
|
27
|
+
* pin until interpreter mode also needs 0.6.1 for something else (#808 bump
|
|
28
|
+
* policy). 0.6.1 fixes `POST /policy/network` to answer 204 with no body, as
|
|
29
|
+
* the real Sprites API and every official SDK expect (#2719,
|
|
30
|
+
* INTENTIUS/spritzer#26/#27) — a fidelity fix the activities exercise.
|
|
31
|
+
*/
|
|
32
|
+
export declare const SPRITZER_CONTAINER_IMAGE = "ghcr.io/intentius/spritzer:0.6.1";
|
|
20
33
|
//# sourceMappingURL=emulator-images.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emulator-images.d.ts","sourceRoot":"","sources":["../../../src/op/activities/emulator-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,cAAc,qCAAqC,CAAC;AAEjE,oDAAoD;AACpD,eAAO,MAAM,cAAc,qCAAqC,CAAC"}
|
|
1
|
+
{"version":3,"file":"emulator-images.d.ts","sourceRoot":"","sources":["../../../src/op/activities/emulator-images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,cAAc,qCAAqC,CAAC;AAEjE,oDAAoD;AACpD,eAAO,MAAM,cAAc,qCAAqC,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wBAAwB,qCAAqC,CAAC"}
|
|
@@ -9,8 +9,10 @@ export { flyApply, toApplyResult, flyDelete, applyApp, applyMachine, destroyMach
|
|
|
9
9
|
export type { FlyApplyArgs, FlyPlan, FlapsRequest, FlapsMachine, FlyHttp, WaitOpts, ApplyCtx } from "./fly-apply.js";
|
|
10
10
|
export { flapsUp, flapsDown, flapsRunCommand, flapsRmCommand, flapsExistsCommand, flapsHealthUrl, flapsEndpoint, } from "./flaps.js";
|
|
11
11
|
export type { FlapsUpArgs, FlapsDownArgs } from "./flaps.js";
|
|
12
|
-
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, resolveSpritesEndpoint, defaultSpritesHttp, spriteCreateBody, parseCreateResponse, accumulateExecFrames, parseCheckpointNdjson, pickCheckpointByComment, splitCommand, spriteExecWsUrl, DEFAULT_SPRITES_BASE_URL, } from "./sprites.js";
|
|
13
|
-
export type { SpritesHttp, SpriteCreateArgs, SpriteCreateResult, SpriteExecArgs, SpriteExecResult, SpriteCheckpointArgs, SpriteCheckpointResult, SpriteRestoreArgs, ListCheckpointsArgs, Checkpoint, SpriteDestroyArgs, } from "./sprites.js";
|
|
12
|
+
export { spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteDelete, spriteUrl, resolveSpritesEndpoint, resolveSpritesToken, defaultSpritesHttp, spriteCreateBody, parseCreateResponse, accumulateExecFrames, parseCheckpointNdjson, pickCheckpointByComment, splitCommand, spriteExecWsUrl, DEFAULT_SPRITES_BASE_URL, } from "./sprites.js";
|
|
13
|
+
export type { SpritesHttp, SpriteCreateArgs, SpriteCreateResult, SpriteExecArgs, SpriteExecResult, SpriteCheckpointArgs, SpriteCheckpointResult, SpriteRestoreArgs, ListCheckpointsArgs, Checkpoint, SpriteDestroyArgs, SpriteDeleteArgs, SpriteUrlArgs, SpriteUrlResult, } from "./sprites.js";
|
|
14
|
+
export { spriteServiceCreate, spriteServiceGet, spriteServiceList, spriteServiceStart, spriteServiceStop, spriteServiceDelete, spriteServiceLogs, spriteServiceCreateBody, parseServiceLogNdjson, } from "./sprite-services.js";
|
|
15
|
+
export type { SpriteService, SpriteServiceState, SpriteServiceCreateArgs, SpriteServiceGetArgs, SpriteServiceListArgs, SpriteServiceStartArgs, SpriteServiceStopArgs, SpriteServiceDeleteArgs, SpriteServiceLogsArgs, SpriteServiceLogsResult, } from "./sprite-services.js";
|
|
14
16
|
export { spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteFsUrl, defaultSpritesRawHttp, } from "./sprite-fs.js";
|
|
15
17
|
export type { SpritesRawHttp, SpriteWriteFileArgs, SpriteReadFileArgs, SpriteReadFileResult, SpriteListDirArgs, SpriteDirEntry, SpriteRemoveArgs, } from "./sprite-fs.js";
|
|
16
18
|
export { spriteApplyNetworkPolicy, spriteApplyServices, validateNetworkRules, networkRulesEqual, validateServices, serviceConfigEqual, } from "./sprite-config.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIlH,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAQ1D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,wBAAwB,GACzB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/op/activities/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,QAAQ,EACR,aAAa,EACb,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,SAAS,EACT,YAAY,EACZ,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,aAAa,CAAC;A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tB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAMrB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,EACX,4BAA4B,EAC5B,8BAA8B,EAC9B,WAAW,EACX,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAMxB,OAAO,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sprite Services activities (#2711) — imperative create/get/list/start/stop/
|
|
3
|
+
* delete/logs over a Sprite's background services, the surface a box's door,
|
|
4
|
+
* hud and chud run as long-lived services through (`sprite-env services`
|
|
5
|
+
* inside the sprite, `/v1/sprites/{id}/services/...` outside). Shared by the
|
|
6
|
+
* Sprites API, wisp (arugula-salad/wisp) and spritzer 0.6.0's container mode
|
|
7
|
+
* (INTENTIUS/spritzer#22).
|
|
8
|
+
*
|
|
9
|
+
* This is the imperative twin of `sprite-config.ts`'s `spriteApplyServices` —
|
|
10
|
+
* that one reconciles a whole desired service *set* (additive create-or-update,
|
|
11
|
+
* optionally started, no delete). These activities are the single-service
|
|
12
|
+
* primitives underneath it: create-and-start one service and watch it come
|
|
13
|
+
* up, inspect or list what's running, stop/start one by name, delete it, and
|
|
14
|
+
* read its log tail. An Op that provisions a box one service at a time (or
|
|
15
|
+
* needs delete, which `spriteApplyServices` doesn't expose) uses these
|
|
16
|
+
* directly; `spriteApplyServices` stays the batch-reconcile convenience on
|
|
17
|
+
* top of the same wire shapes.
|
|
18
|
+
*
|
|
19
|
+
* `spriteServiceCreate` is a `PUT` that both defines the service and starts
|
|
20
|
+
* it, streaming NDJSON progress (`started`, `stdout`, `stderr`, `exit`,
|
|
21
|
+
* `complete`) for a bounded `?duration` window (default 500ms — enough to
|
|
22
|
+
* surface an immediate failure, e.g. a missing binary, without holding the
|
|
23
|
+
* step open for spritzer's own 5s default). The stream is read to completion
|
|
24
|
+
* either way; the definitive result comes from a follow-up `GET` of the
|
|
25
|
+
* service (`spriteServiceGet`'s own logic), which throws if its `state.status`
|
|
26
|
+
* is `"failed"`. `spriteServiceStart` follows the same create-then-GET shape
|
|
27
|
+
* (`PUT` already started it; `start` is for a stopped service).
|
|
28
|
+
*/
|
|
29
|
+
import { type SpritesHttp } from "./sprites.js";
|
|
30
|
+
/** A service's live half. */
|
|
31
|
+
export interface SpriteServiceState {
|
|
32
|
+
name: string;
|
|
33
|
+
/** `stopped` | `running` | `stopping` | `failed`. */
|
|
34
|
+
status: string;
|
|
35
|
+
pid?: number;
|
|
36
|
+
started_at?: string;
|
|
37
|
+
error?: string;
|
|
38
|
+
restart_count?: number;
|
|
39
|
+
}
|
|
40
|
+
/** The `GET`/`PUT` response shape: the definition with its state beside it. */
|
|
41
|
+
export interface SpriteService {
|
|
42
|
+
name: string;
|
|
43
|
+
cmd: string;
|
|
44
|
+
args?: string[];
|
|
45
|
+
env?: Record<string, string>;
|
|
46
|
+
dir?: string;
|
|
47
|
+
/** Names of services that must be running first. */
|
|
48
|
+
needs?: string[];
|
|
49
|
+
/** Route the sprite's public URL to this port. Only one service may set it. */
|
|
50
|
+
http_port?: number;
|
|
51
|
+
state: SpriteServiceState;
|
|
52
|
+
}
|
|
53
|
+
export interface SpriteServiceCreateArgs {
|
|
54
|
+
/** Target sprite id. */
|
|
55
|
+
id: string;
|
|
56
|
+
/** Service name — the key every later call addresses it by. */
|
|
57
|
+
name: string;
|
|
58
|
+
cmd: string;
|
|
59
|
+
args?: string[];
|
|
60
|
+
env?: Record<string, string>;
|
|
61
|
+
dir?: string;
|
|
62
|
+
needs?: string[];
|
|
63
|
+
http_port?: number;
|
|
64
|
+
/**
|
|
65
|
+
* How long spritzer keeps streaming NDJSON after the start action
|
|
66
|
+
* succeeds, ms (`?duration`). Default: `500`. A crash past this window is
|
|
67
|
+
* caught by a later `spriteServiceGet`/`spriteUrl`, not this call.
|
|
68
|
+
*/
|
|
69
|
+
durationMs?: number;
|
|
70
|
+
endpoint?: string;
|
|
71
|
+
token?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface SpriteServiceGetArgs {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
endpoint?: string;
|
|
77
|
+
token?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface SpriteServiceListArgs {
|
|
80
|
+
id: string;
|
|
81
|
+
endpoint?: string;
|
|
82
|
+
token?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SpriteServiceStartArgs {
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
/** Same as `spriteServiceCreate`'s `durationMs`. Default: `500`. */
|
|
88
|
+
durationMs?: number;
|
|
89
|
+
endpoint?: string;
|
|
90
|
+
token?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface SpriteServiceStopArgs {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
/** Grace period before SIGKILL, ms (`?timeout`). Default: spritzer's own (10s). */
|
|
96
|
+
timeoutMs?: number;
|
|
97
|
+
endpoint?: string;
|
|
98
|
+
token?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SpriteServiceDeleteArgs {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
endpoint?: string;
|
|
104
|
+
token?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface SpriteServiceLogsArgs {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
/** Tail length. Default: spritzer's own (100). */
|
|
110
|
+
lines?: number;
|
|
111
|
+
endpoint?: string;
|
|
112
|
+
token?: string;
|
|
113
|
+
}
|
|
114
|
+
export interface SpriteServiceLogsResult {
|
|
115
|
+
/** The tail, one entry per log line, oldest first. */
|
|
116
|
+
lines: string[];
|
|
117
|
+
}
|
|
118
|
+
/** Build the `PUT` create-or-update body. Pure. */
|
|
119
|
+
export declare function spriteServiceCreateBody(args: SpriteServiceCreateArgs): Record<string, unknown>;
|
|
120
|
+
/**
|
|
121
|
+
* Parse a service log NDJSON body (`{type, data, timestamp, ...}` per line,
|
|
122
|
+
* terminated by a `complete` event) into a plain line tail — the `data` text
|
|
123
|
+
* of every non-`complete` event, in stream order. Pure.
|
|
124
|
+
*/
|
|
125
|
+
export declare function parseServiceLogNdjson(text: string): string[];
|
|
126
|
+
/**
|
|
127
|
+
* Create (or replace) and start a service. `PUT /v1/sprites/{id}/services/{name}`,
|
|
128
|
+
* streamed as NDJSON for `?duration` (mapped from `durationMs`). The stream is
|
|
129
|
+
* read to completion, then a `GET` fetches the definitive state; a `"failed"`
|
|
130
|
+
* status throws with the agent's own error text.
|
|
131
|
+
*/
|
|
132
|
+
export declare function spriteServiceCreate(args: SpriteServiceCreateArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteService>;
|
|
133
|
+
/** Get one service. `GET /v1/sprites/{id}/services/{name}`. */
|
|
134
|
+
export declare function spriteServiceGet(args: SpriteServiceGetArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteService>;
|
|
135
|
+
/** List every service on the sprite. `GET /v1/sprites/{id}/services`. */
|
|
136
|
+
export declare function spriteServiceList(args: SpriteServiceListArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteService[]>;
|
|
137
|
+
/**
|
|
138
|
+
* Start a stopped service. `POST /v1/sprites/{id}/services/{name}/start`,
|
|
139
|
+
* streamed as NDJSON for `?duration`, then a `GET` for the definitive state
|
|
140
|
+
* (same shape as `spriteServiceCreate`).
|
|
141
|
+
*/
|
|
142
|
+
export declare function spriteServiceStart(args: SpriteServiceStartArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteService>;
|
|
143
|
+
/**
|
|
144
|
+
* Stop a running service (SIGTERM, then SIGKILL after the grace period).
|
|
145
|
+
* `POST /v1/sprites/{id}/services/{name}/stop`.
|
|
146
|
+
*/
|
|
147
|
+
export declare function spriteServiceStop(args: SpriteServiceStopArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteService>;
|
|
148
|
+
/**
|
|
149
|
+
* Delete a service, stopping it first (idempotent; a 404 means it is already
|
|
150
|
+
* gone). `DELETE /v1/sprites/{id}/services/{name}`.
|
|
151
|
+
*/
|
|
152
|
+
export declare function spriteServiceDelete(args: SpriteServiceDeleteArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<Record<string, never>>;
|
|
153
|
+
/**
|
|
154
|
+
* Read a service's log tail. `GET /v1/sprites/{id}/services/{name}/logs`,
|
|
155
|
+
* parsed from NDJSON to a plain line array (`parseServiceLogNdjson`).
|
|
156
|
+
*/
|
|
157
|
+
export declare function spriteServiceLogs(args: SpriteServiceLogsArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteServiceLogsResult>;
|
|
158
|
+
//# sourceMappingURL=sprite-services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sprite-services.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprite-services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAA8C,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAmBzF,6BAA6B;AAC7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.ts (`{id}`, `{cp}`);
|
|
20
20
|
* the coverage check normalizes param names before comparing, since spritzer
|
|
21
21
|
* spells the checkpoint id `{cid}`.
|
|
22
|
+
*
|
|
23
|
+
* #2711 adds the imperative Services activities (`./sprite-services.ts`).
|
|
24
|
+
* Several of them share a physical endpoint with `spriteApplyServices`'s own
|
|
25
|
+
* calls (one `PUT`/one `GET .../services`/one `.../start` — the reconcile
|
|
26
|
+
* activity and the single-service primitives are two callers of the same
|
|
27
|
+
* REST surface), so one row lists every activity that calls it, comma
|
|
28
|
+
* separated, rather than one row per activity — `contractKeys()` stays one
|
|
29
|
+
* key per physical endpoint. `spriteServiceDelete` and `spriteServiceLogs`
|
|
30
|
+
* are deliberately absent: spritzer's interpreter mode (the coverage test's
|
|
31
|
+
* oracle) doesn't implement them, only its container-mode agent does, which
|
|
32
|
+
* has no per-verb entry in `/_spritzer/health` (real.go reports the whole
|
|
33
|
+
* `/v1/sprites/{id}/services/...` proxy as one wildcard line — nothing to
|
|
34
|
+
* normalize-compare against a specific verb). They're exercised instead by
|
|
35
|
+
* `sprite-services.docker.integration.test.ts` against real container-mode
|
|
36
|
+
* spritzer. `spriteUrl` is absent for the same reason, plus its target
|
|
37
|
+
* (`/s/{name}/...`) isn't under `/v1/sprites` at all.
|
|
22
38
|
*/
|
|
23
39
|
/** One endpoint the fly sprite activities call. */
|
|
24
40
|
export interface SpritesEndpoint {
|
|
@@ -26,7 +42,7 @@ export interface SpritesEndpoint {
|
|
|
26
42
|
method: "GET" | "POST" | "PUT" | "DELETE" | "WS";
|
|
27
43
|
/** Path template under the Sprites base, e.g. `/v1/sprites/{id}/checkpoint`. */
|
|
28
44
|
path: string;
|
|
29
|
-
/** The fly activity that
|
|
45
|
+
/** The fly activity/activities that call it (comma-separated when more than one shares the endpoint). */
|
|
30
46
|
activity: string;
|
|
31
47
|
}
|
|
32
48
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites-contract.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites-contract.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sprites-contract.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,mDAAmD;AACnD,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC;IACjD,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,yGAAyG;IACzG,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,eAAe,EA0B7C,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAItE;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,IAAI,GAAG,CAAC,MAAM,CAAC,CAE1C"}
|
|
@@ -30,4 +30,16 @@ export declare const spritesUp: (args?: SpritesUpArgs, signal?: AbortSignal) =>
|
|
|
30
30
|
}>;
|
|
31
31
|
/** Stop and remove the local spritzer container (no-op if already gone). */
|
|
32
32
|
export declare const spritesDown: (args?: SpritesDownArgs, signal?: AbortSignal) => Promise<void>;
|
|
33
|
+
/** Container exec mode spritzer, pinned to {@link SPRITZER_CONTAINER_IMAGE} (0.6.0, the first release with this mode). */
|
|
34
|
+
export declare const SPRITZER_CONTAINER_SPEC: EmulatorSpec;
|
|
35
|
+
export declare const spritesContainerRunCommand: (args?: SpritesUpArgs) => string;
|
|
36
|
+
export declare const spritesContainerExistsCommand: (name: string) => string;
|
|
37
|
+
export declare const spritesContainerRmCommand: (name: string) => string;
|
|
38
|
+
export declare const spritesContainerHealthUrl: (port: number) => string;
|
|
39
|
+
/** Boot a local spritzer in container exec mode (Docker runtime) and return its endpoint. */
|
|
40
|
+
export declare const spritesContainerUp: (args?: SpritesUpArgs, signal?: AbortSignal) => Promise<{
|
|
41
|
+
endpoint: string;
|
|
42
|
+
}>;
|
|
43
|
+
/** Stop and remove the local container-exec-mode spritzer (no-op if already gone). Sprite containers it made are the caller's to clean up (see the integration test). */
|
|
44
|
+
export declare const spritesContainerDown: (args?: SpritesDownArgs, signal?: AbortSignal) => Promise<void>;
|
|
33
45
|
//# sourceMappingURL=sprites-emulator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites-emulator.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites-emulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGpG,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAMD,eAAO,MAAM,aAAa,EAAE,YAM3B,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,EAAE,kBAG/B,CAAC;AAIF,eAAO,MAAM,oBAAoB,0BAAyB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,0BAAqB,CAAC;AACnD,eAAO,MAAM,gBAAgB,0BAAqB,CAAC;AACnD,sGAAsG;AACtG,eAAO,MAAM,eAAe,0BAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,GAAI,OAAM,aAAkB,KAAG,MAAmC,CAAC;AAEjG,0FAA0F;A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E,QAAQ,EAAE,MAAM,CAAA;CAAE,CAC5E,CAAC;AAE5B,4EAA4E;AAC5E,eAAO,MAAM,WAAW,GAAI,OAAM,eAAoB,EAAE,SAAS,WAAW,KAAG,OAAO,CAAC,IAAI,CAC9D,CAAC;AAc9B,0HAA0H;AAC1H,eAAO,MAAM,uBAAuB,EAAE,YAqBrC,CAAC;AAIF,eAAO,MAAM,0BAA0B,GAAI,OAAM,aAAkB,KAAG,MAA4C,CAAC;AACnH,eAAO,MAAM,6BAA6B,0BAAkC,CAAC;AAC7E,eAAO,MAAM,yBAAyB,0BAA8B,CAAC;AACrE,eAAO,MAAM,yBAAyB,0BAA8B,CAAC;AAErE,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,GAAI,OAAM,aAAkB,EAAE,SAAS,WAAW,KAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAC5E,CAAC;AAErC,yKAAyK;AACzK,eAAO,MAAM,oBAAoB,GAAI,OAAM,eAAoB,EAAE,SAAS,WAAW,KAAG,OAAO,CAAC,IAAI,CAC9D,CAAC"}
|
|
@@ -39,7 +39,11 @@ interface StoredService {
|
|
|
39
39
|
pid: number;
|
|
40
40
|
status: string;
|
|
41
41
|
started_at?: string;
|
|
42
|
+
error?: string;
|
|
42
43
|
};
|
|
44
|
+
/** Synthetic log lines (#2711) — the fake runs no real process, so `logs` is a
|
|
45
|
+
* scripted trail of lifecycle events, enough to exercise `spriteServiceLogs`. */
|
|
46
|
+
logs: string[];
|
|
43
47
|
}
|
|
44
48
|
interface SpriteState {
|
|
45
49
|
id: string;
|
|
@@ -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,gBAAg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,MAAM,GAAG,UAAU,CA6CrE;AA4CD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgBjI;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CA6WpF"}
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
* S3: endpoint override via `SPRITES_BASE_URL` (an explicit `endpoint` arg wins,
|
|
21
21
|
* then the env, then the real Sprites base), so the same Op targets real Sprites
|
|
22
22
|
* or the in-process fake with no code change.
|
|
23
|
+
*
|
|
24
|
+
* #2711: the studio and wisp's own docs call these `SPRITES_API_URL` and
|
|
25
|
+
* `SPRITE_TOKEN` rather than `SPRITES_BASE_URL`/`SPRITES_API_TOKEN`. Both
|
|
26
|
+
* pairs are accepted — `resolveSpritesEndpoint`/`resolveSpritesToken` read the
|
|
27
|
+
* alias when the original name is unset, with the original always winning
|
|
28
|
+
* when both are present, so an existing deployment is never surprised by the
|
|
29
|
+
* alias taking over.
|
|
23
30
|
*/
|
|
24
31
|
export declare const DEFAULT_SPRITES_BASE_URL = "https://api.sprites.dev";
|
|
25
32
|
/**
|
|
@@ -31,6 +38,12 @@ export declare const DEFAULT_SPRITES_BASE_URL = "https://api.sprites.dev";
|
|
|
31
38
|
export declare function resolveSpritesEndpoint(args?: {
|
|
32
39
|
endpoint?: string;
|
|
33
40
|
}, env?: NodeJS.ProcessEnv): string;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the bearer token (#2711): an explicit `token` arg wins, then
|
|
43
|
+
* `SPRITES_API_TOKEN`, then its alias `SPRITE_TOKEN`. Pure — mirrors
|
|
44
|
+
* `resolveSpritesEndpoint`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveSpritesToken(token?: string | undefined, env?: NodeJS.ProcessEnv): string | undefined;
|
|
34
47
|
export declare const STREAM_STDIN = 0;
|
|
35
48
|
export declare const STREAM_STDOUT = 1;
|
|
36
49
|
export declare const STREAM_STDERR = 2;
|
|
@@ -192,4 +205,44 @@ export declare function listCheckpoints(args: ListCheckpointsArgs, signal?: Abor
|
|
|
192
205
|
export declare function spriteRestore(args: SpriteRestoreArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<Record<string, never>>;
|
|
193
206
|
/** Destroy the sprite (idempotent; a 404 means it is already gone). `DELETE /v1/sprites/{id}`. */
|
|
194
207
|
export declare function spriteDestroy(args: SpriteDestroyArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<Record<string, never>>;
|
|
208
|
+
/**
|
|
209
|
+
* Delete the sprite (#2711) — the same idempotent `DELETE /v1/sprites/{id}` as
|
|
210
|
+
* `spriteDestroy`, under the name spritzer, wisp and the other lexicons'
|
|
211
|
+
* delete activities (`awsDelete`, `gcpDelete`, `azDelete`) use. A literal
|
|
212
|
+
* alias, not a reimplementation, so the two names can never drift: an Op
|
|
213
|
+
* authored against either resolves to the same call. `spriteDestroy` stays —
|
|
214
|
+
* it is the name every existing Op, example and the `op-verb-class` registry
|
|
215
|
+
* already depend on.
|
|
216
|
+
*/
|
|
217
|
+
export declare const spriteDelete: typeof spriteDestroy;
|
|
218
|
+
export type SpriteDeleteArgs = SpriteDestroyArgs;
|
|
219
|
+
export interface SpriteUrlArgs {
|
|
220
|
+
/** Target sprite id. */
|
|
221
|
+
id: string;
|
|
222
|
+
/**
|
|
223
|
+
* Wait until this path on the sprite's URL answers, instead of returning
|
|
224
|
+
* the URL immediately. Unset (default): no wait, just resolve the URL.
|
|
225
|
+
*/
|
|
226
|
+
path?: string;
|
|
227
|
+
/** Expected status while waiting. Default: any 2xx. */
|
|
228
|
+
status?: number;
|
|
229
|
+
/** Max time to wait for `path` to answer, ms. Default: `10000`. */
|
|
230
|
+
timeoutMs?: number;
|
|
231
|
+
/** Delay between polls, ms. Default: `500`. */
|
|
232
|
+
intervalMs?: number;
|
|
233
|
+
endpoint?: string;
|
|
234
|
+
token?: string;
|
|
235
|
+
}
|
|
236
|
+
export interface SpriteUrlResult {
|
|
237
|
+
url: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Resolve the sprite's URL (#2711) — `spriteCreate` returns it too, but
|
|
241
|
+
* nothing until now exposed it on its own (for a later phase that only has
|
|
242
|
+
* the sprite `id`) or waited on it. `GET /v1/sprites/{id}` for the URL; with
|
|
243
|
+
* `path` set, polls `GET {url}{path}` until `status` (default any 2xx) or
|
|
244
|
+
* `timeoutMs` runs out — the box's door/hud/chud services take a moment to
|
|
245
|
+
* bind their `http_port` after `spriteServiceStart`.
|
|
246
|
+
*/
|
|
247
|
+
export declare function spriteUrl(args: SpriteUrlArgs, signal?: AbortSignal, http?: SpritesHttp): Promise<SpriteUrlResult>;
|
|
195
248
|
//# sourceMappingURL=sprites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sprites.d.ts","sourceRoot":"","sources":["../../../src/op/activities/sprites.ts"],"names":[],"mappings":"AAAA
|
|
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,G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C,GACjD,OAAO,CAAC,UAAU,EAAE,CAAC,CAMvB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,iBAAiB,EACvB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,WAA4C,GACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAmBhC;AAED,kGAAkG;AAClG,wBAAsB,aAAa,CACjC,IAAI,EAAE,iBAAiB,EACvB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,WAA4C,GACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAQhC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,sBAAgB,CAAC;AAC1C,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;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"}
|
package/dist/op/builders.d.ts
CHANGED
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
*/
|
|
28
28
|
import { type NamedActivityStep, type WithStepRefs } from "@intentius/chant/op";
|
|
29
29
|
import type { ActivityStep } from "@intentius/chant/op";
|
|
30
|
-
import type { SpriteCreateArgs, SpriteExecArgs, SpriteCheckpointArgs, SpriteRestoreArgs, ListCheckpointsArgs, SpriteDestroyArgs } from "./activities/sprites.js";
|
|
30
|
+
import type { SpriteCreateArgs, SpriteExecArgs, SpriteCheckpointArgs, SpriteRestoreArgs, ListCheckpointsArgs, SpriteDestroyArgs, SpriteUrlArgs } from "./activities/sprites.js";
|
|
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
|
+
import type { SpriteServiceCreateArgs, SpriteServiceGetArgs, SpriteServiceListArgs, SpriteServiceStartArgs, SpriteServiceStopArgs, SpriteServiceDeleteArgs, SpriteServiceLogsArgs } from "./activities/sprite-services.js";
|
|
33
34
|
import type { SpriteTaskCreateArgs, SpriteTaskRefreshArgs, SpriteTaskReleaseArgs } from "./activities/sprite-tasks.js";
|
|
34
35
|
import type { SpritesUpArgs, SpritesDownArgs } from "./activities/sprites-emulator.js";
|
|
35
36
|
type StepOpts = {
|
|
@@ -47,6 +48,10 @@ export declare const spriteRestore: (args: WithStepRefs<SpriteRestoreArgs> & Ste
|
|
|
47
48
|
export declare const listCheckpoints: (args: WithStepRefs<ListCheckpointsArgs> & StepOpts) => NamedActivityStep;
|
|
48
49
|
/** Destroy a sprite — the fully typed twin of core's `spriteDestroy`. Defaults to the `fastIdempotent` profile. */
|
|
49
50
|
export declare const spriteDestroy: (args: WithStepRefs<SpriteDestroyArgs> & StepOpts) => NamedActivityStep;
|
|
51
|
+
/** Delete a sprite (#2711; alias of `spriteDestroy`). Defaults to the `fastIdempotent` profile. */
|
|
52
|
+
export declare const spriteDelete: (args: WithStepRefs<SpriteDestroyArgs> & StepOpts) => NamedActivityStep;
|
|
53
|
+
/** Resolve a sprite's URL, optionally waiting until a path on it answers (#2711). Defaults to the `fastIdempotent` profile. */
|
|
54
|
+
export declare const spriteUrl: (args: WithStepRefs<SpriteUrlArgs> & StepOpts) => NamedActivityStep;
|
|
50
55
|
/** Write a file into a sprite — the fully typed twin of core's `spriteWriteFile`. Defaults to the `fastIdempotent` profile. */
|
|
51
56
|
export declare const spriteWriteFile: (args: WithStepRefs<SpriteWriteFileArgs> & StepOpts) => NamedActivityStep;
|
|
52
57
|
/** Read a file from a sprite — the fully typed twin of core's `spriteReadFile`. Defaults to the `fastIdempotent` profile. */
|
|
@@ -59,6 +64,20 @@ export declare const spriteRemove: (args: WithStepRefs<SpriteRemoveArgs> & StepO
|
|
|
59
64
|
export declare const spriteApplyNetworkPolicy: (args: WithStepRefs<SpriteApplyNetworkPolicyArgs> & StepOpts) => NamedActivityStep;
|
|
60
65
|
/** Reconcile a sprite's background services — the fully typed twin of core's `spriteApplyServices`. Defaults to the `fastIdempotent` profile. */
|
|
61
66
|
export declare const spriteApplyServices: (args: WithStepRefs<SpriteApplyServicesArgs> & StepOpts) => NamedActivityStep;
|
|
67
|
+
/** Create-and-start one background service (#2711) — the single-service primitive underneath `spriteApplyServices`. Defaults to the `longInfra` profile (the create+start NDJSON round trip). */
|
|
68
|
+
export declare const spriteServiceCreate: (args: WithStepRefs<SpriteServiceCreateArgs> & StepOpts) => NamedActivityStep;
|
|
69
|
+
/** Get one background service's definition and live state (#2711). Defaults to the `fastIdempotent` profile. */
|
|
70
|
+
export declare const spriteServiceGet: (args: WithStepRefs<SpriteServiceGetArgs> & StepOpts) => NamedActivityStep;
|
|
71
|
+
/** List a sprite's background services (#2711). Defaults to the `fastIdempotent` profile. */
|
|
72
|
+
export declare const spriteServiceList: (args: WithStepRefs<SpriteServiceListArgs> & StepOpts) => NamedActivityStep;
|
|
73
|
+
/** Start a stopped background service (#2711). Defaults to the `longInfra` profile (the NDJSON round trip). */
|
|
74
|
+
export declare const spriteServiceStart: (args: WithStepRefs<SpriteServiceStartArgs> & StepOpts) => NamedActivityStep;
|
|
75
|
+
/** Stop a running background service (#2711). Defaults to the `fastIdempotent` profile. */
|
|
76
|
+
export declare const spriteServiceStop: (args: WithStepRefs<SpriteServiceStopArgs> & StepOpts) => NamedActivityStep;
|
|
77
|
+
/** Delete a background service, idempotent (#2711). Defaults to the `fastIdempotent` profile. */
|
|
78
|
+
export declare const spriteServiceDelete: (args: WithStepRefs<SpriteServiceDeleteArgs> & StepOpts) => NamedActivityStep;
|
|
79
|
+
/** Read a background service's log tail (#2711). Defaults to the `fastIdempotent` profile. */
|
|
80
|
+
export declare const spriteServiceLogs: (args: WithStepRefs<SpriteServiceLogsArgs> & StepOpts) => NamedActivityStep;
|
|
62
81
|
/** Create a keep-alive task — the fully typed twin of core's `spriteTaskCreate`. Defaults to the `fastIdempotent` profile. */
|
|
63
82
|
export declare const spriteTaskCreate: (args: WithStepRefs<SpriteTaskCreateArgs> & StepOpts) => NamedActivityStep;
|
|
64
83
|
/** Refresh a keep-alive task's expiry — the fully typed twin of core's `spriteTaskRefresh`. Defaults to the `fastIdempotent` profile. */
|
|
@@ -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,EAAE,MAAM,sBAAsB,CAAC;
|
|
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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AG,iBACnB,CAAC;AAC5D,6IAA6I;AAC7I,eAAO,MAAM,WAAW,GAAI,OAAM,YAAY,CAAC,eAAe,CAAC,GAAG,QAAa,KAAG,iBACd,CAAC"}
|
|
@@ -78,7 +78,7 @@ When the `Run` phase's command exits non-zero, `spriteExec` throws, the phase fa
|
|
|
78
78
|
|
|
79
79
|
## Targeting the emulator or real Sprites
|
|
80
80
|
|
|
81
|
-
The activities resolve their endpoint in this order: an explicit `endpoint` arg, then `SPRITES_BASE_URL`, then the real Sprites base. The same Op targets an emulator or real Sprites with no code change. The default `fetch` client adds `Authorization: Bearer
|
|
81
|
+
The activities resolve their endpoint in this order: an explicit `endpoint` arg, then `SPRITES_BASE_URL`, then its alias `SPRITES_API_URL` (the name the studio and wisp's own docs use), then the real Sprites base. The same Op targets an emulator or real Sprites with no code change. The default `fetch` client adds `Authorization: Bearer <token>` when a token is set — `SPRITES_API_TOKEN`, or its alias `SPRITE_TOKEN` — the emulator ignores it. Either alias is read only when the original name is unset, so an existing deployment using `SPRITES_BASE_URL`/`SPRITES_API_TOKEN` is unaffected.
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
# Point at a self-hosted or in-process emulator.
|
|
@@ -105,9 +105,11 @@ The same lexicon ships more Sprite primitives, all imported from `@intentius/cha
|
|
|
105
105
|
|--------|-----------|-----|
|
|
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
|
+
| 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
|
+
| 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) |
|
|
108
110
|
| 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 |
|
|
109
111
|
|
|
110
|
-
These are still runtime-orchestration primitives, not declarable resources — a Sprite has no desired-state create body to reconcile.
|
|
112
|
+
These are still runtime-orchestration primitives, not declarable resources — a Sprite has no desired-state create body to reconcile. Services created directly with `spriteServiceCreate` are what a box's `spritzer` preset provisions door/hud/chud on (arugula-salad/studio#27) — the same wire surface as `sprite-env services` inside the sprite, spritzer 0.6.0's container mode, and wisp.
|
|
111
113
|
|
|
112
114
|
## Where it fits
|
|
113
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-fly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"typescript": "^5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"@intentius/chant": "^0.
|
|
66
|
+
"@intentius/chant": "^0.90.0",
|
|
67
67
|
"typescript": "^5.9.3"
|
|
68
68
|
},
|
|
69
69
|
"description": "Fly.io Machines lexicon for chant — declarative IaC in TypeScript",
|
package/src/index.ts
CHANGED
|
@@ -43,12 +43,21 @@ export {
|
|
|
43
43
|
spriteRestore,
|
|
44
44
|
listCheckpoints,
|
|
45
45
|
spriteDestroy,
|
|
46
|
+
spriteDelete,
|
|
47
|
+
spriteUrl,
|
|
46
48
|
spriteWriteFile,
|
|
47
49
|
spriteReadFile,
|
|
48
50
|
spriteListDir,
|
|
49
51
|
spriteRemove,
|
|
50
52
|
spriteApplyNetworkPolicy,
|
|
51
53
|
spriteApplyServices,
|
|
54
|
+
spriteServiceCreate,
|
|
55
|
+
spriteServiceGet,
|
|
56
|
+
spriteServiceList,
|
|
57
|
+
spriteServiceStart,
|
|
58
|
+
spriteServiceStop,
|
|
59
|
+
spriteServiceDelete,
|
|
60
|
+
spriteServiceLogs,
|
|
52
61
|
spriteTaskCreate,
|
|
53
62
|
spriteTaskRefresh,
|
|
54
63
|
spriteTaskRelease,
|
|
@@ -19,3 +19,17 @@ export const MUDFLAPS_IMAGE = "ghcr.io/intentius/mudflaps:0.4.1";
|
|
|
19
19
|
|
|
20
20
|
/** Pinned spritzer (Fly Sprites emulator) image. */
|
|
21
21
|
export const SPRITZER_IMAGE = "ghcr.io/intentius/spritzer:0.4.1";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Pinned spritzer image for container exec mode (`SPRITZER_EXEC=container`,
|
|
25
|
+
* #2711 / INTENTIUS/spritzer#22) — the Services CRUD activities
|
|
26
|
+
* (`./sprite-services.ts`) and `spriteUrl` only exist in this mode (real
|
|
27
|
+
* processes, a real sprite URL); the default `SPRITZER_IMAGE` above stays on
|
|
28
|
+
* the interpreter-mode pin everything else is tested against. 0.6.0 is the
|
|
29
|
+
* first release with container mode at all, so this can't move to a shared
|
|
30
|
+
* pin until interpreter mode also needs 0.6.1 for something else (#808 bump
|
|
31
|
+
* policy). 0.6.1 fixes `POST /policy/network` to answer 204 with no body, as
|
|
32
|
+
* the real Sprites API and every official SDK expect (#2719,
|
|
33
|
+
* INTENTIUS/spritzer#26/#27) — a fidelity fix the activities exercise.
|
|
34
|
+
*/
|
|
35
|
+
export const SPRITZER_CONTAINER_IMAGE = "ghcr.io/intentius/spritzer:0.6.1";
|