Expand description
The contract of a harness in process (INT-9, docs/PLUGINS.md §4.5 and §4.6): what the core and the plugin of a
harness say to each other. The core launches the harness itself, from the description the plugin gives
(engine/launch), after it checked it (the fence of private projects, read-only, the token of Escouade’s server
never among the arguments, the files written in the agent’s own folder only). What the harness says comes to the
plugin in batches of raw lines (agent/frames), which it translates into normalized items and effects (Item)
that the core applies to the agent. What the plugin has to write to the harness comes back in its answers
(writes), and the core writes it on the harness’s input. The PTY of a terminal view never goes through the
plugin: only its launch (terminal/launch) and its hooks (terminal/hook), both ways.
Every type tolerates what it does not know: a field added later is left aside, an item of an unknown op is
Item::Unknown, which the core ignores.
Modules§
- method
- The methods of the contract, all called by the core.
Structs§
- AcpDecl
- How an ACP agent is driven (ACP v1: JSON-RPC 2.0, one message a line on its input and output).
- Agent
Ref - Answer
Permission - Answer
Question - Asked
- The answer of a call whose end is the harness’s to tell (
agent/interrupt,agent/setModel,agent/control…):writesgo to its input, andItem::Answerunderaskbrings what it said. An answer withoutaskis over as it is. - Attach
- An agent given to the plugin: what it cannot know by itself, given again after each restart and each change.
- Caps
Decl - What it can do; what is left out, it cannot.
- Close
- Compact
- Compacted
EngineProcess::compact’s answer: it is over; false, it runs as a turn the harness ends itself.- Control
- Diff
- A write a permission would make: its file, before (None for a file added) and after.
- EnvVar
- A variable of a launch.
- File
ToWrite - A file the core writes before the launch, in the agent’s own folder.
- Frames
- A batch of what the harness wrote: each line as it read it, never read again by the core.
- Gone
method::PROGRAM_GONE: how it ended, and what it said last on its error output.- Grant
- Escouade’s MCP server given to the agent. The plugin may put the token in a variable or a file of the agent’s own, never among the arguments: the core refuses such a launch.
- Harness
Decl - A harness as a manifest declares it (
contributes.harnesses[]): all the core needs without starting the plugin (the welcome screen, the menus, the accounts, the memory). - Hook
- One of its hooks, and what the core has to answer it: the hook goes both ways (what Escouade adds for the model, a call it refuses).
- Hook
Answer - What a hook made: items for the agent, and the hook’s answer as its harness reads it (None: nothing).
- Hook
Reply - What the core answers a hook, which the plugin puts in its harness’s form.
- Install
Decl - Its installers.
- Interrupt
- What
agent/interruptis told (a plugin may read it as anAgentRef). - Items
- What a batch made. The answer to any call that answers
Writesmay be this instead: its items applied, in their order (a message that starts a program again:Item::Relaunch, then itsItem::Write). - Launch
- The description of a launch (
engine/launch,terminal/launch): never its program, which the core found itself (locate), and runs in its Job object, under WSL when need be. - Launch
Params - What
engine/launchis told. - Locate
- Memory
Decl - Mode
Decl - A mode of Escouade a harness takes (
default,plan,acceptEdits,bypassPermissions), and what it means there, as the menu says it. Written as its id alone, or{ "id", "meaning" }. - Model
Decl - Model
Turn - What a model cost in the turn that ends (
Item::Result). - OneShot
Launch - How the core runs it: the arguments, the variables, and what goes on its input.
- OneShot
Output - OneShot
Params - What
engine/oneShotis told: one question, no session, no settings of the user’s, no MCP server. - OneShot
Text - Open
- What
agent/openis told: the agent’s session, on the shared process of itsagent/attach. - Opened
- What
agent/openfound. - Pushed
method::ITEMS.- Remote
Link method::REMOTE: its session linked (nameon the vendor’s site, kept when it ends ifkeep, joining the sessionreattach), or unlinked.- Send
Message - SetValue
- Shared
Launch - How a process shared by agents starts and is shared. It runs in a folder of its own, none of the agents’: a worktree removed would find it held. It lives from its first agent to its last, in the core’s Job object.
- Shared
Ref - The shared process an agent is on: enough for a plugin that started again to find it.
- Task
- One of its background tasks.
- Terminal
Params - What
terminal/launchis told: the agent’s interface in a terminal, its hooks pointed at Escouade. - Tested
Decl - Turn
Usage - The tokens and cost of a turn.
- Usage
- The quota its process read (
usage::parse_windowsreads its windows); null when none. - Usage
Asked - The answer of
agent/readUsagewhen the quota is to be asked of the harness:writesgo to its input, andItem::Usagebrings what it said. - Writes
- What the plugin writes to the harness, line by line.
Enums§
- Item
- A normalized item or an effect, which the core applies to the agent: the same as the conversation’s (
user,text,thinking,tool,question,permission,turn,notice) and the effects (Effectsofagent.rs). - StartAt
- Where a conversation starts from.
- Text
- A text in the languages of the app: one for all, or by language (
{ "fr": "…", "en": "…" }, English when the language is missing).
Constants§
- BATCH_
BYTES - How many bytes of lines a batch of
agent/framescarries at most. A batch is what was read while the last one was with the plugin: none waits for more lines, a lone line goes at once.
Functions§
- hunks_
of - The hunks of a unified diff, as Claude Code’s
structuredPatchhas them.