Repository navigation
Description
Context
The fly lexicon models Sprites as imperative Op activities (#762): spriteCreate / spriteExec / spriteCheckpoint / spriteRestore / spriteDestroy. Sprites also expose a full filesystem API that chant does not wrap. Today an Op that needs to stage an input file into a Sprite or read a result out has to shell it through spriteExec + cat / tee, which is brittle (quoting, binary data, exit handling).
Sprites filesystem endpoints (from the API docs):
| Op | Method | Path | Key params |
|---|---|---|---|
| read | GET | /v1/sprites/{name}/fs/read |
path, workingDir |
| write | PUT | /v1/sprites/{name}/fs/write |
path, workingDir, mode, mkdir |
| list | GET | /v1/sprites/{name}/fs/list |
path, workingDir |
| delete | DELETE | /v1/sprites/{name}/fs/delete |
path, recursive, asRoot |
| rename | POST | /v1/sprites/{name}/fs/rename |
source, dest, asRoot |
| copy | POST | /v1/sprites/{name}/fs/copy |
source, dest, recursive, preserveAttrs, asRoot |
| chmod | POST | /v1/sprites/{name}/fs/chmod |
path, mode, recursive, asRoot |
| chown | POST | /v1/sprites/{name}/fs/chown |
path, uid, gid, recursive, asRoot |
| watch | WSS | /v1/sprites/{name}/fs/watch |
paths[], recursive |
Read/write use raw file bytes in the body.
Proposal
Add filesystem Op activities alongside the existing sprite activities, same category (imperative runtime-orchestration primitives, no desired state):
spriteWriteFile({ id, path, content, mode?, mkdir? })spriteReadFile({ id, path })→ bytes/stringspriteListDir({ id, path })spriteRemove({ id, path, recursive? })- (rename/copy/chmod/chown as needed;
watchdeferred — WSS, no obvious Op use yet)
Same conventions as the current activities: injectable HTTP client, endpoint resolution via SPRITES_BASE_URL then the real base, Authorization: Bearer when a token is set. Pure helpers for URL building kept unit-testable. Emulator parity in createSpritesFake() so CI exercises them offline.
Driver
#847 (Managed Agents worker) uses the Filesystem API to stage the runner env-contract file and to inspect/retrieve session outputs. These activities are the clean way to express that instead of spriteExec + shell redirection.
Acceptance criteria
spriteWriteFile/spriteReadFile/spriteListDir/spriteRemoveimplemented as fly Op activities against the real fs endpoints.createSpritesFake()implements the same endpoints; unit + integration tests pass offline.- Round-trip test: write bytes, read them back, list the dir, remove, confirm gone — against the fake.
- Exported from
@intentius/chant-lexicon-flyop-activities barrel; documented in the Sprites Op skill. - Stays in the fly lexicon (one lexicon per product).
Activity
lex00 commentedon Jul 13, 2026
Demo plan — no new example
Do not add a dedicated example for these activities. Fold them into the existing
examples/sprites-agent-task.The current
Runphase doesecho hello > /work/outputthencatviaspriteExec. Replace that with the filesystem activities:spriteWriteFileto stage an input file,spriteExecto process it,spriteReadFileto collect the result. Same demo, sharper primitives, still runs green offline againstcreateSpritesFake().So the AC's round-trip test stays, and the example update is the showcase — no separate tutorial.
feat(fly): Sprite filesystem Op activities (read/write/list/remove) (#…
feat(fly): Managed Agents worker Op on Sprites + keep-alive Tasks (#847)
feat(fly): Managed Agents worker Op on Sprites + keep-alive Tasks (#847)
feat(fly): Managed Agents worker Op on Sprites + keep-alive Tasks (#847…
lifecycle: emit --json for the --live diff path (#852) (#857)
fly: pin spritzer 0.4.0 + extend the Sprites contract for fs/policy/s…
release: chant 0.18.8 (#861)
docs: Managed Agents worker tutorial + sidebar (#864)
docs: Managed Agents worker tutorial + sidebar (#864) (#865)
docs: Disposable Build Sandbox tutorial + spritzer 0.4.1 (fixes agent…