English
A paid business agent, end to end
You follow a complete paid chart, the video editor: the player drops rushes in a folder and gets a cut teaser back. The chart adds an agent, turns on an automation that watches the folder, proves each part by reading the machine, and its first quest ends on a file the machine can see. Every part is a field of the standard, so your own agent can be written the same way.
Before you begin 25 minutes
- Package a quest pack: the card,
supportandbranchwork the same way. - The repository cloned (see Install the CLI): the example is in
examples/chart-agent/video-editor/.
Say where it works
This agent works on recent Macs with Apple chips and on Linux. In a hosted world it is
limited: the note says what changes, in words the player reads before agreeing.video-editor/chart.jsonjson{ "platforms": [ { "os": "macos", "arch": ["arm64"], "min": "14" }, { "os": "linux", "arch": ["x64", "arm64"] } ], "hosted": "limited", "notes": { "linux": { "en": "In a hosted world, rushes are uploaded to the world first.", "fr": "Dans un monde hébergé, les rushes sont d'abord envoyés dans le monde." } } }Declare the agent and its automation
agentsdeclares the agent itself: its name, the files of its folder (agents/editor/), its model and the tools it may and may not use.automationsdeclares what wakes it up: here, every 15 minutes, a message from a file of the chart. Nothing is created yet; these are declarations the parts use.video-editor/chart.jsonjson[ { "id": "editor", "name": { "en": "Editor", "fr": "Monteur" }, "role": "operator", "files": ["SOUL.md", "AGENTS.md"], "model": "need:mind", "permissions": { "tools": { "allow": ["read", "write", "message"], "deny": ["browser", "secrets", "exec"] } }, "wake": ["video-editor-watch"] } ]examples/chart-agent/video-editor/chart.json#/agents
video-editor/chart.jsonjson[ { "key": "video-editor-watch", "title": { "en": "Watch the rushes", "fr": "Surveiller les rushes" }, "agent": "editor", "schedule": { "every": "15m" }, "message": "automations/video-editor-watch.message.md", "spends": "model" } ]Parts, undo, proof
partslists the steps of the plan, each an executor from the closed list, run after the player agrees: create the agent, then turn on the automation. Each part says how it is undone (archivekeeps the agent's folder; nothing is deleted) and the read-only checks that prove it holds.proofssays when the chart is installed, ready and still alive.video-editor/chart.jsonjson[ { "id": "agent", "do": "agent.create", "args": { "agent": "editor" }, "undo": "archive", "proof": [{ "type": "agent", "id": "editor" }] }, { "id": "watch", "do": "automation.enable", "args": { "key": "video-editor-watch" }, "requires": ["agent"], "undo": "auto", "proof": [ { "type": "automation", "key": "video-editor-watch", "enabled": true } ] } ]examples/chart-agent/video-editor/chart.json#/parts
video-editor/chart.jsonjson{ "installed": [{ "type": "agent", "id": "editor" }], "ready": [ { "type": "automation", "key": "video-editor-watch", "enabled": true } ], "alive": [ { "id": "watching", "check": { "type": "automation", "key": "video-editor-watch", "ranWithinHours": 2 }, "every": "1h" } ] }End the first quest on a real result
The first quest adds to the game's main branch. The player drops a clip (a
filecheck on the folder), sends an agent to cut a teaser, then watches it: afilecheck on the teaser ends the quest. Folders differ between macOS and Linux, so each proof is written twice, one step per system withos.video-editor/chart.jsonjson{ "id": "cut", "kind": "mission", "title": { "en": "Send the editor to cut a teaser", "fr": "Envoie le monteur faire un teaser" }, "mission": { "agent": "operator", "brief": { "en": "Cut a 30-second teaser from the clips in my rushes folder. Keep the best moments.", "fr": "Monte un teaser de 30 secondes à partir des clips de mon dossier de rushes. Garde les meilleurs moments." }, "target": "module:video-editor" } }examples/chart-agent/video-editor/chart.json#/branch/quests/0/steps/2
video-editor/chart.jsonjson{ "id": "result-mac", "kind": "check", "title": { "en": "Watch your teaser", "fr": "Regarde ton teaser" }, "check": { "type": "file", "path": "~/Movies/Alta/out/teaser.mp4" }, "os": ["macos"] }examples/chart-agent/video-editor/chart.json#/branch/quests/0/steps/3
Make it appear
spawnputs a new thing on the map, andsceneplays when the chart arrives: the camera goes to the edge, the editor appears, the operator speaks. Each universe names the new thing with its own words.video-editor/chart.jsonjson{ "title": { "en": "A video editor joins", "fr": "Un monteur vidéo arrive" }, "recap": [ { "en": "The video editor is installed and watches your rushes folder.", "fr": "Le monteur vidéo est installé et surveille ton dossier de rushes." }, { "en": "Next: your first cut.", "fr": "Ensuite : ton premier montage." } ], "shots": [ { "kind": "pan", "dur": 2, "to": "edge" }, { "kind": "reveal", "dur": 3, "entity": "module:video-editor" }, { "kind": "line", "dur": 3, "who": "operator", "text": { "en": "Send me your rushes.", "fr": "Envoie-moi tes rushes." } } ] }Check it
Run the check from the repository folder. It checks the folder's files, the parts against the closed list, the proofs and the quests against the game.
Terminalshalta lint examples/chart-agent/video-editorOutputtextok examples/chart-agent/video-editor (chart) 1 checked, 0 errors, 0 warnings
Try it
alta dev examples/chart-agent/video-editorOpen the address it prints, then the quest Your first cut in the journal. In the demo, nothing is installed on your machine.
Demo: nothing is written on your machine.
Pitfalls
| Do | Avoid |
|---|---|
| A first quest that ends on a result the machine sees | A first quest that ends on "I did it" |
| One step per system when a path differs | A proof that only holds on one system, offered on both |
| A proof for every part that writes | A part without proof: refused |
The price as free or paid | An amount in the chart: the catalog holds it |
Known limits, said plainly: an agent added by a chart cannot take a mission itself yet; the mission goes to one of the game's agents (here, the operator). A check cannot be written per system yet, hence the two steps.
Go further
- Agent Chart: every field, the parts and the proofs.
- Badges: where a chart comes from, and what the player is shown.
- Errors: each rule of
alta lintfor a chart.