standard-plugin-sdk 0.1.2

Write Standard Code plugins in Rust: wasm components against standard:plugin@2.0.0
Documentation
# Handlers

A handler is a job Standard Code does that one plugin may take over. The
person chooses who does each job in the store's **Handlers** page; Standard
Code does it until they choose a plugin, and again when that plugin is
uninstalled or loses its grant. Installing a plugin that can take a job
asks whether it should.

| Handler | Grant | What the plugin decides |
| --- | --- | --- |
| New Pane | `panes.create` | Where a pane a person creates starts, its environment and its title |

Only one plugin does a job at a time, so two plugins never fight over it.

## New Pane

A daemon or companion plugin claims New Pane with the grant
`panes.create` (its reason is the sentence the Handlers page shows beside
the plugin: say what your plugin does to a new pane). Place the daemon
`fleet`: the daemon of the machine that creates the pane is the one asked.

Before that daemon creates a pane a person asked for, it calls your
companion with the method `standard.pane.create` and this JSON:

```json
{ "pane_id": "…", "project_id": "…", "project_root": "/Users/me/code/website",
  "title": "Claude", "program": "claude" }
```

`program` is the agent the person chose (`claude`, `codex`), or null for a
shell. Answer within 20 seconds with a plan, every field optional, or
`null` to create the pane as Standard Code would:

```json
{ "cwd": "/Users/me/code/website/.orchard/worktrees/fix-login",
  "env": { "ORCHARD_SLUG": "fix-login" }, "title": "fix-login" }
```

- `cwd` must be an existing directory inside `project_root`.
- `env` holds at most 64 variables with shell names.
- `title` is one short line.

The pane still runs what the person chose (a shell or their agent), in your
folder. Anything else — no answer in time, an error, a folder outside the
project — and the pane opens as Standard Code would open it, so a slow or
broken handler never blocks a pane. Panes that plugins or agents create are
never planned.

Do the work the plan needs (create the worktree, write a journal) before
you answer, and keep it idempotent: the daemon may give up waiting while
you finish, and the person may create another pane at once.