English
Make a step that does it
You write a step with a Do it button: the game asks the player what it needs, shows what will run, runs it once they agree, and checks on its own that it worked. "I did it" stays only on what the player alone can do.
Before you begin 15 minutes
- A quest pack that passes
alta lint: the quickstart makes one,my-pack. - Read The game does it, the player agrees if the words input, executor or proof are new.
Ask for what the step needs
inputsis the form of the plan card. Each input has anid, akind(text, choice, email, path, number, boolean, secret) and a label in each language.saveskeeps the answer, so a later step can prefill it withfrom.The game checks every value twice, in the page and on the player's own server, with the same rules as
alta lint.my-pack/do-it.jsonjson[ { "id": "name", "kind": "text", "max": 40, "label": { "en": "Its name", "fr": "Son nom" }, "saves": "answers.do-it.name" } ]examples/quest-pack/do-it.fragment.json#/quests/0/steps/0/inputs
Hand it to an executor
run.donames an executor of the closed list: each one is a fixed command the game knows, never a command written in your file.run.argsgives its arguments: a literal,{ "input": "<id>" }for a value of the form, or{ "answer": "answers.<key>" }for an answer already given.The player sees the plan card (what runs, what it changes, how to undo it) and says yes. Nothing runs before that.
my-pack/do-it.jsonjson{ "do": "setup.daemon-name", "args": { "name": { "input": "name" } } }examples/quest-pack/do-it.fragment.json#/quests/0/steps/0/run
Prove it with a check
The step is done when its
checkpasses, never when the run ends. A check only reads the machine: here, that the main agent has a name. Pick one in the check types.my-pack/do-it.jsonjson{ "id": "name", "kind": "action", "title": { "en": "Give your helper a name", "fr": "Donne un nom à ton assistant" }, "inputs": [ { "id": "name", "kind": "text", "max": 40, "label": { "en": "Its name", "fr": "Son nom" }, "saves": "answers.do-it.name" } ], "run": { "do": "setup.daemon-name", "args": { "name": { "input": "name" } } }, "check": { "type": "identity" } }Ask for a secret, safely
A token, a key or a one-time code is a
secretinput: a password field, sent once to the player's own machine, then straight to the program. It has nodefault,from,savesorpattern, and it only feeds an argument the executor declares secret, such astokenofchannel.connect. Never write a key in your file:alta lintrefuses it.my-pack/do-it.jsonjson{ "id": "connect", "kind": "action", "title": { "en": "Connect Telegram", "fr": "Branche Telegram" }, "inputs": [ { "id": "token", "kind": "secret", "label": { "en": "The bot's token", "fr": "Le jeton du bot" }, "hint": { "en": "Pasted once, sent to your machine only, never kept by the game.", "fr": "Collé une fois, envoyé à ta machine seulement, jamais gardé par le jeu." } } ], "run": { "do": "channel.connect", "args": { "channel": "telegram", "token": { "input": "token" } } }, "check": { "type": "channel", "id": "telegram" } }Leave the player only what is theirs
Some steps need the player: speaking, approving a system window, another device, another site. Such a step is
manualand says why, withhuman. The game still helps: arunthat changes nothing opens the right pane, and acheckproves the result, so "I did it" disappears. With no proof of its own,provenBynames the step whose proof covers it.my-pack/do-it.jsonjson{ "id": "microphone", "kind": "manual", "human": "approve", "os": ["macos"], "title": { "en": "Allow the microphone", "fr": "Autorise le micro" }, "run": { "do": "mac.open-pane", "args": { "pane": "microphone" } }, "check": { "type": "permission", "name": "microphone" } }examples/quest-pack/do-it.fragment.json#/quests/1/steps/0
my-pack/do-it.jsonjson{ "id": "bot", "kind": "manual", "human": "external", "title": { "en": "Create a bot with BotFather", "fr": "Crée un bot avec BotFather" }, "hint": { "en": "In Telegram, write /newbot to @BotFather. It answers with a token.", "fr": "Dans Telegram, écris /newbot à @BotFather. Il répond avec un jeton." }, "provenBy": "connect" }Put it in your pack and check it
Save the complete example as
my-pack/do-it.json, next toquests.json, and check the folder. Every file of the folder is checked.my-pack/do-it.jsonjson{ "schema": "alta.quests/0.3", "branch": "core", "quests": [ { "id": "do-it-chat", "uid": "core.do-it.chat", "act": 2, "giver": "operator", "title": { "en": "Talk from your phone", "fr": "Parle-lui depuis ton téléphone" }, "summary": { "en": "The game names your helper, connects Telegram and approves the pairing. You only do what is yours.", "fr": "Le jeu nomme ton assistant, branche Telegram et accepte l'appairage. Tu ne fais que ce qui est à toi." }, "reward": { "xp": 60 }, "steps": [ { "id": "name", "kind": "action", "title": { "en": "Give your helper a name", "fr": "Donne un nom à ton assistant" }, "inputs": [ { "id": "name", "kind": "text", "max": 40, "label": { "en": "Its name", "fr": "Son nom" }, "saves": "answers.do-it.name" } ], "run": { "do": "setup.daemon-name", "args": { "name": { "input": "name" } } }, "check": { "type": "identity" } }, { "id": "bot", "kind": "manual", "human": "external", "title": { "en": "Create a bot with BotFather", "fr": "Crée un bot avec BotFather" }, "hint": { "en": "In Telegram, write /newbot to @BotFather. It answers with a token.", "fr": "Dans Telegram, écris /newbot à @BotFather. Il répond avec un jeton." }, "provenBy": "connect" }, { "id": "connect", "kind": "action", "title": { "en": "Connect Telegram", "fr": "Branche Telegram" }, "inputs": [ { "id": "token", "kind": "secret", "label": { "en": "The bot's token", "fr": "Le jeton du bot" }, "hint": { "en": "Pasted once, sent to your machine only, never kept by the game.", "fr": "Collé une fois, envoyé à ta machine seulement, jamais gardé par le jeu." } } ], "run": { "do": "channel.connect", "args": { "channel": "telegram", "token": { "input": "token" } } }, "check": { "type": "channel", "id": "telegram" } }, { "id": "pair", "kind": "action", "title": { "en": "Approve your phone", "fr": "Accepte ton téléphone" }, "inputs": [ { "id": "code", "kind": "text", "max": 16, "pattern": "^[A-Za-z0-9-]{1,16}$", "label": { "en": "The code the bot sent you", "fr": "Le code que le bot t'a envoyé" } } ], "run": { "do": "channel.pair-approve", "args": { "channel": "telegram", "code": { "input": "code" } } }, "check": { "type": "channel", "id": "telegram", "state": "paired" } }, { "id": "hello", "kind": "manual", "human": "device", "title": { "en": "Say hello from your phone", "fr": "Dis bonjour depuis ton téléphone" }, "provenBy": "pair" } ] }, { "id": "do-it-voice", "uid": "core.do-it.voice", "act": 2, "giver": "daemon", "title": { "en": "Let it hear you", "fr": "Laisse-le t'entendre" }, "summary": { "en": "The microphone is yours to allow; the language is set by the game.", "fr": "Le micro, c'est à toi de l'autoriser ; la langue, le jeu la règle." }, "requires": ["core.do-it.chat"], "reward": { "xp": 40 }, "steps": [ { "id": "microphone", "kind": "manual", "human": "approve", "os": ["macos"], "title": { "en": "Allow the microphone", "fr": "Autorise le micro" }, "run": { "do": "mac.open-pane", "args": { "pane": "microphone" } }, "check": { "type": "permission", "name": "microphone" } }, { "id": "language", "kind": "action", "title": { "en": "Choose the language it listens for", "fr": "Choisis la langue qu'il écoute" }, "inputs": [ { "id": "locale", "kind": "choice", "label": { "en": "Language", "fr": "Langue" }, "default": "en-US", "choices": [ { "id": "en-US", "label": { "en": "English", "fr": "Anglais" } }, { "id": "fr-FR", "label": { "en": "French", "fr": "Français" } } ] } ], "run": { "do": "openclaw.config-set", "args": { "path": "talk.speechLocale", "value": { "input": "locale" } } }, "check": { "type": "config", "path": "talk.speechLocale" } } ] } ] }examples/quest-pack/do-it.fragment.json
Terminalshalta lint my-packOutputtextok my-pack/do-it.json (quests) ok my-pack/quests.json (quests) 2 checked, 0 errors, 0 warningsRead what alta lint says
Add
"saves": "answers.do-it.token"to the secret input and check again. Under the rule,step.input-secret,alta lintsays which case it is (detail), where (in), and what this file can write instead (hint).Terminalshalta lint my-packOutputtextFAIL my-pack/do-it.json (quests) error: quests[0].steps[2].inputs[0]: A secret stays between the player and their machine: never prefilled, kept, shown or written in a file, and it only feeds an argument the executor declares secret. [step.input-secret] in: quest core.do-it.chat, step connect detail: input token: a secret has no saves (it is never prefilled, kept or shown) hint: remove "saves" from this input: the player types a secret each time, and the program keeps it in its own store fix: Remove default, from, saves and pattern from a secret input, bind it to the executor's secret argument, and never write a key or a token in the file. docs: https://docs.os.altasystem.ai/reference/errors#step-input-secret ok my-pack/quests.json (quests) 2 checked, 1 error, 0 warnings
Try it
alta dev my-packOpen the address it prints, then the quest Talk from your phone: each step that does it shows Do it. In the demo, the card shows what would run; nothing runs on your machine.
Demo: nothing is written on your machine.
Pitfalls
| Do | Avoid |
|---|---|
| One executor per step, and a check that proves its result | A step that is done when the run ends |
human on every manual step, with a helper and a proof when there is one | "I did it" on something the machine could do |
A secret input for every key, token or code | A key in run.args, or a secret saved for later |
os on a step whose executor runs on one system | A macOS-only helper offered on Linux |
An executor runs only if the owner started the game with its capability (for example --allow-setup), and some do not run in a hosted world: the card then says why, in words.
Go further
- The game does it, the player agrees: why steps are written this way.
- Executors and check types: every action and every proof.
- Errors: every rule of
alta lint.