@theaileverage/marionette 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/CONTRIBUTING.md +46 -2
- package/README.md +60 -232
- package/RELEASING.md +13 -11
- package/THIRD_PARTY_NOTICES.md +192 -0
- package/VERIFICATION.md +24 -0
- package/dist/cli.js +44528 -12214
- package/dist/herdr-protocol.d.ts +2 -2
- package/dist/herdr-sdk.d.ts +8 -7
- package/dist/herdr-sdk.js +12 -6
- package/dist/herdr-streams.d.ts +3 -3
- package/dist/herdr-streams.js +7 -3
- package/dist/herdr-transport.d.ts +6 -2
- package/dist/herdr-transport.js +2 -2
- package/dist/mcp.js +24855 -2702
- package/documentation/effect-compatibility.md +56 -0
- package/documentation/effect-runtime.md +73 -0
- package/package.json +38 -22
- package/public/assets/{index-CCfdv-uF.js → index-DhL3znDT.js} +12 -12
- package/public/index.html +1 -1
- package/skills/marionette/SKILL.md +5 -1
- package/skills/marionette/references/herdr-sdk.md +2 -2
- package/vendor/herdr-0.9.0/README.md +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0 — 2026-09-08
|
|
4
|
+
|
|
5
|
+
- Add interactive setup with editable defaults, required-tool preflight, explicit installation options, and recovery for missing Herdr workspaces without losing project identity or history.
|
|
6
|
+
- Open terminal leads in dedicated Herdr tabs, reuse verified sessions, and restart exited leads only after confirming an idle shell. Give each project a readable MCP registration and migrate owned legacy entries.
|
|
7
|
+
- Add instance-wide update and upgrade commands that migrate saved project bindings and MCP registrations together, preserve worker terminals and lead leases, and restore the previous runtime and database if startup fails.
|
|
8
|
+
- Add previewable project removal and instance uninstallation with active-work, terminal-identity, shared-resource, and retained-worktree checks. Preserve project source files and restore only workspace trust settings owned by Marionette.
|
|
9
|
+
- Manage native workspace trust for Codex, Claude Code, and AGY, including managed worktrees, while preserving agent tool-approval and sandbox settings.
|
|
10
|
+
- Consolidate lead, worker, strategy, delegation, and follow-up instructions into editable Mustache templates embedded in the distributed executables. Preserve literal task data, scoped ownership, revision fencing, and independent verification.
|
|
11
|
+
- Expand regression coverage to 189 tests, including runtime rollback, setup recovery, MCP migration, terminal reuse, trust restoration, and prompt rendering.
|
|
12
|
+
|
|
13
|
+
## 0.3.0 — 2026-09-08
|
|
14
|
+
|
|
15
|
+
- **Runtime change:** the CLI and supervisor now require Bun 1.3.14+. `npx` remains supported when Bun is on PATH. Development, tests, and CI use Bun with a frozen lockfile.
|
|
16
|
+
- Compose application workflows and resource lifetimes with Effect v4, including typed errors, scoped polling, graceful shutdown, and cancellable subprocesses and sockets.
|
|
17
|
+
- Use Bun's SQLite driver while preserving the version-2 database format, synchronous transactions, lease fencing, and recovery behavior.
|
|
18
|
+
- Enforce Effect diagnostics and anti-slop lint rules, install the project Effect skill, and expand verification to 127 tests plus isolated package checks.
|
|
19
|
+
|
|
20
|
+
Upgrade by stopping the existing supervisor, starting this version against the same state directory, and rerunning setup. Existing worker runtime paths and SQLite state are preserved.
|
|
21
|
+
|
|
3
22
|
## 0.2.2 — 2026-09-08
|
|
4
23
|
|
|
5
24
|
- Ship a Marionette agent skill with setup, task coordination, recovery, and SDK guidance.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,7 +1,51 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use Bun 1.3.14 or newer and install dependencies with `bun install --frozen-lockfile`. Run `bun run check`, `bun run test`, `bun run build` and `bun run format:check` before opening a pull request. Describe the concrete behavior change and its validation. Keep tests deterministic; the standard suite must not start paid agent sessions or depend on a developer's Herdr configuration.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Edit the lead prompt in [`src/templates/lead.mustache`](src/templates/lead.mustache).
|
|
6
|
+
It is a plain-text Mustache template shared by setup, lead launch, and MCP
|
|
7
|
+
instructions. The optional `session` section receives `leadName`, `projectName`,
|
|
8
|
+
`projectId`, and `leasePath`; triple braces preserve their literal text without
|
|
9
|
+
HTML escaping. Keep session-specific details inside that section. Run
|
|
10
|
+
`bun test tests/prompts.test.ts tests/lead-terminal.test.ts` to check rendering
|
|
11
|
+
and terminal compatibility. Source commands load template edits on their next
|
|
12
|
+
start; run `bun run build` to embed them in the distributed CLI and MCP bundles.
|
|
13
|
+
|
|
14
|
+
Worker wording lives beside it: `worker.mustache` contains the assignment,
|
|
15
|
+
scope, inspection, worktree, and reporting instructions; `worker-delegation.mustache`
|
|
16
|
+
and `worker-strategy.mustache` are conditional partials; `worker-followup.mustache`
|
|
17
|
+
handles child results, lead answers, and replacement objectives. Task data and
|
|
18
|
+
shell-quoted CLI commands are prepared in `src/prompts.ts` and `src/supervisor.ts`.
|
|
19
|
+
Use triple braces for literal text and the prepared `*Json` fields inside JSON
|
|
20
|
+
examples. Templates and partials are embedded during the same build. Run
|
|
21
|
+
`bun test tests/prompts.test.ts tests/orchestration.test.ts` after worker edits.
|
|
22
|
+
|
|
23
|
+
The project pins Bun, Effect v4, and TypeScript 7. Commit `bun.lock`; do not generate an npm lockfile. `bun install --frozen-lockfile` runs the `prepare` script to
|
|
24
|
+
patch the local TypeScript and Oxlint binaries with `@effect/tsgo`. If dependencies
|
|
25
|
+
were installed with lifecycle scripts disabled, run `bun run prepare` before
|
|
26
|
+
checking code. `bun run check` includes Effect compiler diagnostics and Oxlint;
|
|
27
|
+
`bun run effect:diagnostics` prints the Effect diagnostics separately. Run
|
|
28
|
+
`bun run tooling:check` to verify that valid Effect code passes and deliberate
|
|
29
|
+
floating Effects and unsafe casts fail. CI performs this check after installation.
|
|
30
|
+
`bun run runtime:check` exercises failed startup and concurrent shutdown through
|
|
31
|
+
the real server boundary; it requires permission to bind loopback sockets.
|
|
32
|
+
|
|
33
|
+
Read the [Effect skill](.agents/skills/effect/SKILL.md) and its relevant references
|
|
34
|
+
before changing application workflows. The skill is from
|
|
35
|
+
[kitlangton/skills](https://github.com/kitlangton/skills/tree/main/skills/effect).
|
|
36
|
+
Use the installed `effect` package source to verify APIs for the pinned release.
|
|
37
|
+
The [runtime guide](documentation/effect-runtime.md) explains resource ownership,
|
|
38
|
+
transport boundaries, and the durable-state invariants the migration preserves.
|
|
39
|
+
For VS Code or Cursor, install the TypeScript 7 extension and select the workspace
|
|
40
|
+
TypeScript version; `.vscode/settings.json` configures the native language server.
|
|
41
|
+
|
|
42
|
+
The [vendored anti-slop rules](tools/oxlint/anti-slop/UPSTREAM.md) enforce evidence
|
|
43
|
+
for casts, parsed boundaries, and Effect service imports. All generic rules and
|
|
44
|
+
the Effect rule group are errors. Fix the underlying contract instead of disabling
|
|
45
|
+
rules. Generated Herdr protocol types, vendor code, built output, agent assets and
|
|
46
|
+
local runtime state are excluded from lint. Keep `oxlint` and `@oxlint/plugins`
|
|
47
|
+
at the same exact version and within `@effect/tsgo`'s supported versions.
|
|
48
|
+
|
|
49
|
+
Keep generated bundles, local agent configuration, `.env` files, `.marionette` state, `.runtime` fixtures and credentials out of commits. The reviewed `.agents/skills/effect` guidance is tracked; other local agent configuration remains ignored. Live validation scripts are opt-in and use explicitly named isolated sessions. Never point them at someone else's active session.
|
|
6
50
|
|
|
7
51
|
Changes enter `main` through pull requests. Release preparation and publication follow [RELEASING.md](RELEASING.md). Marionette is licensed under [MIT](LICENSE); bundled third-party licenses are preserved in `THIRD_PARTY_NOTICES.md`.
|
package/README.md
CHANGED
|
@@ -3,291 +3,119 @@
|
|
|
3
3
|
[](https://github.com/theaileverage/marionette/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@theaileverage/marionette)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Coordinate Codex, Claude Code, and AGY workers through one lead conversation. Workers run in Herdr; a persistent local supervisor shares task state across MCP, CLI, and a dashboard.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
- **Delegate work:** assign owned paths, dependencies, and acceptance checks; use a shared directory or isolated Git worktrees.
|
|
9
|
+
- **Verify outcomes:** require current evidence and independent checks before marking work complete.
|
|
10
|
+
- **Keep context:** preserve decisions, worker state, and an inbox across lead handovers and supervisor restarts.
|
|
11
|
+
- **Stay in control:** agents retain their normal permission policies; ambiguous deliveries require reconciliation before retrying.
|
|
11
12
|
|
|
12
13
|
## Quick start
|
|
13
14
|
|
|
14
|
-
Requires **
|
|
15
|
+
Requires **macOS or Linux** and **Bun 1.3.14+**. Setup checks Git, Herdr, and the selected lead CLI before creating project state. It reports other agent CLIs as optional workers.
|
|
15
16
|
|
|
16
17
|
From your project directory:
|
|
17
18
|
|
|
18
19
|
```sh
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
The guided setup lets you choose **Codex desktop, Codex CLI, Claude Code, or AGY** as lead and give it any display name. It starts the supervisor, creates or reuses a named Herdr session and project workspace, registers AGY trust for the project, and adds Marionette MCP to the selected agent through its native CLI. No model subscriptions or agent CLIs are installed by Marionette.
|
|
23
|
-
|
|
24
|
-
For a terminal lead, run:
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npx @theaileverage/marionette lead
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
For Codex desktop, refresh MCP in Settings, then give the lead the prompt file printed by setup. The prompt includes the project and private lease file path. The desktop conversation must read that local file to obtain its lease. `lead --print` prints the bootstrap instructions for any selected lead without launching an interactive agent.
|
|
31
|
-
|
|
32
|
-
Open the private dashboard URL printed by:
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
npx @theaileverage/marionette dashboard
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
To install the shorter `marionette` command globally, use `npm install -g @theaileverage/marionette`.
|
|
39
|
-
|
|
40
|
-
## Agent skill and Herdr SDK
|
|
41
|
-
|
|
42
|
-
The distributable agent skill lives at [skills/marionette/SKILL.md](skills/marionette/SKILL.md). Copy the `skills/marionette` folder into your agent's skill directory (for example `~/.codex/skills/marionette`) to enable discovery. It covers lead leases, assignments, outcome completion, worker reports, recovery, and programmatic terminal control.
|
|
43
|
-
|
|
44
|
-
The dependency-free ESM SDK targets Herdr 0.9.0/protocol 22. It exports typed access to all 102 schema methods, persistent event subscriptions, graphics streams, and short helpers for common operations:
|
|
45
|
-
|
|
46
|
-
```js
|
|
47
|
-
import { HerdrClient } from '@theaileverage/marionette/herdr-sdk';
|
|
48
|
-
|
|
49
|
-
const herdr = HerdrClient.fromEnv(); // Requires a real Herdr-managed environment.
|
|
50
|
-
const { panes } = await herdr.pane.list(process.env.HERDR_WORKSPACE_ID);
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Services can pass an explicitly selected absolute socket path to `new HerdrClient(socketPath)`. Use `herdr.api["pane.resize"]({ pane_id, direction: "right", amount: 0.1 })` for the full wire API. See [the SDK guide](skills/marionette/references/herdr-sdk.md) for typed requests, subscriptions, binary/file frames, cancellation, and coverage limits. Use Marionette task APIs for managed workers; direct SDK calls do not create task records or enforce leases.
|
|
54
|
-
|
|
55
|
-
## Setup for agents and scripts
|
|
56
|
-
|
|
57
|
-
The wizard and non-interactive setup use the same implementation. `--yes` accepts defaults; `--json` returns a JSON result and never prompts. Errors return `{ "ok": false, "error": "..." }` with a nonzero exit status when `--json` is used. Unknown options and config keys are rejected.
|
|
58
|
-
|
|
59
|
-
```sh
|
|
60
|
-
npx @theaileverage/marionette setup --yes --json \
|
|
61
|
-
--project /absolute/project --lead claude --lead-name Ada
|
|
62
|
-
|
|
63
|
-
npx @theaileverage/marionette setup --config setup.json --json
|
|
64
|
-
npx @theaileverage/marionette setup --config setup.json --dry-run
|
|
65
|
-
npx @theaileverage/marionette setup --schema
|
|
20
|
+
bunx --bun @theaileverage/marionette setup
|
|
66
21
|
```
|
|
67
22
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
```json
|
|
71
|
-
{
|
|
72
|
-
"project": "/absolute/project",
|
|
73
|
-
"name": "My project",
|
|
74
|
-
"lead": "claude",
|
|
75
|
-
"leadName": "Ada",
|
|
76
|
-
"trustAgy": true,
|
|
77
|
-
"mcp": "install"
|
|
78
|
-
}
|
|
79
|
-
```
|
|
23
|
+
You can also use `npx @theaileverage/marionette setup`. Bun must still be installed and on PATH; `npx` downloads the package but does not install Bun.
|
|
80
24
|
|
|
81
|
-
|
|
25
|
+
The interactive setup uses editable defaults and arrow-key choices. It offers to install missing required tools, then starts the supervisor, connects a named Herdr session and project workspace, and configures MCP for Codex desktop, Codex CLI, Claude Code, or AGY.
|
|
82
26
|
|
|
83
|
-
Setup
|
|
27
|
+
Setup installs Herdr through Homebrew when available, or its [official installer](https://herdr.dev/docs/install/); Git through existing Homebrew; Codex through npm when available; and Claude Code through its official installer. AGY and Git without Homebrew require manual installation. Agent sign-in remains a separate step. Setup does not install every optional worker or change existing agent integrations.
|
|
84
28
|
|
|
85
|
-
|
|
29
|
+
The project defaults to your current directory. To select Menderly from another directory, for example, pass `setup --project /path/to/menderly`.
|
|
86
30
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Default state lives in `$XDG_DATA_HOME/marionette` or `~/.local/share/marionette`. The project gets a private `.marionette/project.json` binding and a local ignore file. Commands inside that project discover its state directory, including from subdirectories. `--home` or `MARIONETTE_HOME` overrides discovery. Existing project-local `.marionette/config.json` installations remain discoverable.
|
|
90
|
-
|
|
91
|
-
The executable bundles and dashboard are copied into a versioned runtime below the state directory. Background supervisors, worker report commands, and MCP registrations use those durable paths and survive npm cache deletion. The npm package has no runtime npm dependencies or install hooks. New installations select a free loopback port starting at 4380; an explicit occupied port fails. Existing instance ports are preserved.
|
|
31
|
+
For a terminal lead:
|
|
92
32
|
|
|
93
33
|
```sh
|
|
94
|
-
|
|
95
|
-
npx @theaileverage/marionette stop
|
|
96
|
-
npx @theaileverage/marionette start
|
|
34
|
+
bunx --bun @theaileverage/marionette lead
|
|
97
35
|
```
|
|
98
36
|
|
|
99
|
-
|
|
37
|
+
The terminal lead opens in a dedicated tab in the project’s Herdr session. Repeating `lead` focuses the existing lead without resending its prompt. If the lead has exited and its tab contains a verified idle shell, `lead` starts it again in that tab. If a process is still present or its state is uncertain, `lead` opens the tab for inspection without sending a launch command. Detach with `Ctrl-B q`; the lead and workers keep running.
|
|
100
38
|
|
|
101
|
-
|
|
39
|
+
Setup names each project’s MCP entry `mnett-<project>-<lead>`, such as `mnett-menderly-mendy`. Names use lowercase words and hyphens, with a numeric suffix when needed to avoid collisions. `--mcp install` installs the entry and migrates owned older names; `--mcp print` prints a command with shell quoting only where needed.
|
|
102
40
|
|
|
103
|
-
|
|
41
|
+
For Codex desktop, refresh MCP in Settings and give your conversation the prompt file printed by setup.
|
|
104
42
|
|
|
105
43
|
```sh
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
npm test
|
|
109
|
-
npm run build
|
|
110
|
-
node dist/cli.js setup
|
|
44
|
+
bunx --bun @theaileverage/marionette dashboard # Print the private dashboard URL
|
|
45
|
+
bunx --bun @theaileverage/marionette doctor # Diagnose connections
|
|
111
46
|
```
|
|
112
47
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
## Connect Herdr explicitly
|
|
48
|
+
For scripted setup, use `setup --yes --json`. Add `--install-tools` to explicitly allow installation of missing required tools; `--yes` alone only accepts configuration defaults. `--dry-run` prints the plan without installations or writes; `setup --help` and `setup --schema` describe the available options. Install globally with `bun add --global @theaileverage/marionette` for the shorter `marionette` command.
|
|
116
49
|
|
|
117
|
-
|
|
50
|
+
If an older cached package fails on `node:sqlite`, run `bunx --bun @theaileverage/marionette@latest setup`. Marionette 0.3.0 and later use Bun’s SQLite runtime.
|
|
118
51
|
|
|
119
|
-
|
|
52
|
+
Setup's `trustWorkspaces` option registers native workspace trust for Codex, Claude Code, and AGY as each lead or worker starts, including managed worktrees. Use `--no-trust-workspaces` to keep native trust prompts, or `--trust-workspaces` to enable it explicitly. Tool approvals and sandbox settings remain controlled by each agent. Legacy AGY-only settings remain compatible and do not silently authorize trust for other agents.
|
|
120
53
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
```json
|
|
124
|
-
{
|
|
125
|
-
"name": "My project",
|
|
126
|
-
"root": "/absolute/project",
|
|
127
|
-
"session": "project-work",
|
|
128
|
-
"socketPath": "/Users/you/.config/herdr/sessions/project-work/herdr.sock",
|
|
129
|
-
"workspaceId": "w1",
|
|
130
|
-
"maxConcurrency": 3
|
|
131
|
-
}
|
|
132
|
-
```
|
|
54
|
+
## Update and removal
|
|
133
55
|
|
|
134
56
|
```sh
|
|
135
|
-
|
|
136
|
-
|
|
57
|
+
marionette update --check # Compare installed and published versions
|
|
58
|
+
marionette update # Upgrade this instance and detected global CLI packages
|
|
59
|
+
marionette upgrade # Alias for update
|
|
60
|
+
marionette update --from /path/to/built/marionette # Use a local build
|
|
137
61
|
```
|
|
138
62
|
|
|
139
|
-
|
|
63
|
+
An instance can serve several projects. Updating moves all its saved project bindings and owned MCP registrations together, restarts the supervisor, and preserves worker terminals, assignments, and lead leases. A failed restart restores the previous runtime and database. Recovery files are retained only if rollback needs attention. Refresh or restart agent MCP clients afterward. `--runtime-only` leaves the global CLI package unchanged; `--home DIR` selects another instance. Global package-manager failures are reported separately from the runtime migration and can be retried.
|
|
140
64
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
Print a ready-to-copy configuration with absolute executable and state paths:
|
|
144
|
-
|
|
145
|
-
```sh
|
|
146
|
-
node dist/cli.js mcp-config
|
|
147
|
-
```
|
|
65
|
+
Setup detects a different saved or running runtime and offers the same migration. For scripts, use `setup --yes --upgrade`; without `--upgrade`, setup reports the required update command before changing project state.
|
|
148
66
|
|
|
149
|
-
|
|
67
|
+
`setup --upgrade` also refreshes a changed local build with the same version number. If a saved Herdr workspace no longer exists, setup finds or creates its replacement and reconnects the existing project while preserving its ID, lead lease, and history. Active tasks and unresolved operations must be resolved first. An explicitly supplied `--workspace` must exist.
|
|
150
68
|
|
|
151
69
|
```sh
|
|
152
|
-
|
|
70
|
+
marionette remove --dry-run # Preview removal of the current project
|
|
71
|
+
marionette remove # Confirm removal interactively
|
|
72
|
+
marionette remove --project /path/to/project --yes
|
|
73
|
+
marionette uninstall --dry-run --global
|
|
74
|
+
marionette uninstall --global # Remove this instance and detected Bun/npm global CLI installs
|
|
153
75
|
```
|
|
154
76
|
|
|
155
|
-
|
|
77
|
+
Project removal deletes its binding, leases, stored project history, and archives, and restores workspace trust settings that Marionette added. Its MCP registrations are removed while other projects’ entries remain. Legacy shared MCP registrations remain until the final project is removed or all dependent projects have their own entries. Uninstallation deletes the selected instance's state, logs, runtimes, and recovery files. Project source files and Git branches are preserved; collect or relocate managed worktrees before removal. Shared instance logs and any failed-upgrade recovery files remain after individual project removal.
|
|
156
78
|
|
|
157
|
-
|
|
79
|
+
Removal previews active tasks, pending operations, and terminal ownership before making changes. Exit lead/worker agents first, or explicitly use `--stop-agents` to close verified project agents. Use `--keep-herdr` to retain terminal resources, including offline sessions. Herdr itself and the coding-agent applications remain installed. Noninteractive removal requires `--yes`; `--json` provides structured output. `--project-id ID` can remove an orphaned project whose source directory no longer exists.
|
|
158
80
|
|
|
159
|
-
|
|
81
|
+
## How it runs
|
|
160
82
|
|
|
161
|
-
|
|
83
|
+
The supervisor keeps working when you close the lead or dashboard. `stop` drains operations and preserves Herdr workers; `start` resumes the supervisor. Task completion preserves branches and worktrees until explicit delivery and cleanup.
|
|
162
84
|
|
|
163
|
-
|
|
85
|
+
State defaults to `~/.local/share/marionette` (or `$XDG_DATA_HOME/marionette`), with a project-local binding. Keep dashboard links and lease files private.
|
|
164
86
|
|
|
165
|
-
|
|
87
|
+
Herdr leads can resume from meaningful worker events. **Idle Codex desktop conversations resume on your next message**; the dashboard and durable inbox retain updates meanwhile.
|
|
166
88
|
|
|
167
|
-
|
|
89
|
+
## Agent skill and SDK
|
|
168
90
|
|
|
169
|
-
|
|
91
|
+
Copy [skills/marionette](skills/marionette/SKILL.md) into your agent's skill directory for coordination and recovery guidance.
|
|
170
92
|
|
|
171
|
-
The
|
|
93
|
+
The dependency-free Herdr SDK provides typed requests, event subscriptions, and graphics streams:
|
|
172
94
|
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
- Omit `execution`, or use `{ "mode": "shared" }`, to keep the existing behavior: run in `cwd` or the registered root. This also works for non-Git projects.
|
|
178
|
-
- Use `{ "mode": "worktree" }` for Marionette to create a new branch and full Git checkout before launching the worker. `baseRef` is optional; the default is the source checkout's committed `HEAD` when preparation begins. Marionette resolves it to a commit once and persists it before creation. It never copies uncommitted or untracked source files.
|
|
179
|
-
- `cwd` still identifies the source working directory. For a monorepo subdirectory, Marionette uses the corresponding directory in the new checkout. Ownership and file checks must be relative paths and are validated again after relocation. A source directory missing from the selected revision fails preparation.
|
|
180
|
-
- Each managed task gets branch `marionette/<task-id>` and a checkout under `<instance-state-directory>/worktrees/<project-id>/<task-id>`. `task.worktree` exposes its state, path, branch, pinned base commit, source directory, and repository identity. `task.cwd` becomes the actual worker directory. The dashboard shows the execution choice and these details.
|
|
181
|
-
- Independent worktrees can edit the same repository files concurrently. Ownership remains a filesystem-path contract; it does not predict merge conflicts or protect shared external resources. Dependencies wait for completion but do not merge another task's changes into a worktree. Select an appropriate committed base when one task needs another's result.
|
|
182
|
-
- Worktree creation requires an existing Git repository and a valid commit. Failure starts no worker and never falls back silently to the shared checkout. Git hooks are disabled for supervisor worktree operations; dependency installation, submodule initialization, and other project setup remain explicit task instructions.
|
|
183
|
-
|
|
184
|
-
After verification, the lead recommends a next step and asks the user to choose unless already authorized: review locally, merge, or push the task branch and open a PR through the user's Git hosting workflow. Marionette retains the branch and worktree on completion, failure, and cancellation. It does not automatically commit, publish, or merge; the separate delivery/archive/cleanup lifecycle governs later removal. Ordinary Git and PR tools can operate in `task.cwd`. Retries reuse the same worktree and preserve worker commits and uncommitted changes.
|
|
185
|
-
|
|
186
|
-
For existing worktrees created outside Marionette, supply an in-root `cwd` in shared mode or register an external worktree as a separate project. Separate projects cannot have cross-project task dependencies.
|
|
187
|
-
|
|
188
|
-
CLI example after obtaining a project ID and fresh briefing:
|
|
189
|
-
|
|
190
|
-
```sh
|
|
191
|
-
node dist/cli.js briefing PROJECT_ID
|
|
192
|
-
node dist/cli.js call lead.acquire --json '{"projectId":"PROJECT_ID","owner":"desktop-lead","expectedEpoch":0,"reason":"Begin project work"}' --save-lease /private/tmp/marionette-lead.json
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
Save the following as `assignment.json`, replacing the project ID and paths with your task:
|
|
196
|
-
|
|
197
|
-
```json
|
|
198
|
-
{
|
|
199
|
-
"assignment": {
|
|
200
|
-
"projectId": "PROJECT_ID",
|
|
201
|
-
"key": "settings-screen-v1",
|
|
202
|
-
"title": "Build the settings screen",
|
|
203
|
-
"workstream": "Product",
|
|
204
|
-
"kind": "codex",
|
|
205
|
-
"prompt": "Build the settings screen and its behavior tests. You own only src/settings and tests/settings. Preserve other work.",
|
|
206
|
-
"ownership": ["src/settings", "tests/settings"],
|
|
207
|
-
"dependencies": [],
|
|
208
|
-
"checks": [
|
|
209
|
-
{ "type": "file", "path": "src/settings/index.tsx", "contains": "Settings" },
|
|
210
|
-
{
|
|
211
|
-
"type": "command",
|
|
212
|
-
"command": "npm",
|
|
213
|
-
"args": ["test", "--", "tests/settings"],
|
|
214
|
-
"timeoutMs": 30000
|
|
215
|
-
}
|
|
216
|
-
],
|
|
217
|
-
"maxAttempts": 2
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
```sh
|
|
223
|
-
node dist/cli.js call task.submit --file assignment.json --lease /private/tmp/marionette-lead.json
|
|
224
|
-
node dist/cli.js call task.get --json '{"taskId":"TASK_ID"}'
|
|
225
|
-
node dist/cli.js inbox PROJECT_ID --consumer desktop-lead
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
Submission persists and returns without waiting for startup. Reuse the **same idempotency key and identical input** after a lost response. Reusing a key for different intent is rejected. Redirects and controls also require their own keys.
|
|
229
|
-
|
|
230
|
-
```sh
|
|
231
|
-
node dist/cli.js call task.control --lease /private/tmp/marionette-lead.json --json '{"taskId":"TASK_ID","key":"answer-currency-v1","type":"reply","text":"Use INR."}'
|
|
232
|
-
node dist/cli.js call decision.record --lease /private/tmp/marionette-lead.json --json '{"text":"Use INR throughout billing.","rationale":"Confirmed with the operator."}'
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
`redirect` replaces the objective and invalidates old reports. The MCP/CLI accepts replacement `checks`; dashboard redirects retain the displayed checks. `pause` interrupts and waits for the agent to settle. `reply` resumes a paused assignment or answers a blocked worker. `cancel` stops the task without closing its tab. Native permission dialogs require inspecting the actual output and resolving the specific prompt in Herdr or sending explicit keys through the dashboard. Marionette does not auto-approve permissions. If interruption does not settle within 30 seconds, the control fails visibly so the lead can resolve the native screen.
|
|
236
|
-
|
|
237
|
-
Workers receive an attempt-scoped report credential through their new pane environment. The supplied instructions explain `worker-report --file REPORT.json`, including revision, summary, artifact paths, and evidence. Credentials are not included in briefings. Workers must request normal sandbox approval if their report command needs permission to reach the local supervisor.
|
|
238
|
-
|
|
239
|
-
## Delivery and cleanup
|
|
240
|
-
|
|
241
|
-
Version 0.2.1 separates terminal release from delivery and Git cleanup. After integrated outcome completion, the supervisor can save worker diagnostics and close an eligible settled worker pane automatically. Failed/cancelled work needs explicit inspection; blocked, paused, waiting and uncertain workers stay intact.
|
|
242
|
-
|
|
243
|
-
Task completion preserves branches and worktrees. Use the task drawer's **Delivery and cleanup** panel or `cleanup.preview`, `cleanup.release`, `cleanup.deliver`, `cleanup.archive`, and `cleanup.collect` through CLI/MCP. Record merged, published or explicitly abandoned work, preserve evidence and committed history, then collect only the exact eligible checkout. A published PR branch stays available for later review and merge. Archives preserve completion evidence after the worktree is removed.
|
|
244
|
-
|
|
245
|
-
Automatic worktree collection is disabled by default. `cleanup.configure` can authorize a retention delay and optional merged-branch deletion. Dirty/untracked/ignored files, active consumers, changed resource identities and ambiguous operations prevent removal. Project Herdr sessions and workspaces remain. See [the full cleanup contract](ORCHESTRATION.md#delivery-archival-and-cleanup-in-021) for safeguards, recovery, and API inputs.
|
|
246
|
-
|
|
247
|
-
## Handover
|
|
248
|
-
|
|
249
|
-
`lead_handover` transfers control atomically and returns the receiving lead's lease and a current briefing. The previous owner/token/epoch immediately stops authorizing writes; existing workers continue.
|
|
95
|
+
```js
|
|
96
|
+
import { HerdrClient } from '@theaileverage/marionette/herdr-sdk';
|
|
250
97
|
|
|
251
|
-
|
|
252
|
-
|
|
98
|
+
const herdr = HerdrClient.fromEnv(); // Inside a Herdr-managed environment
|
|
99
|
+
const { panes } = await herdr.pane.list(process.env.HERDR_WORKSPACE_ID);
|
|
253
100
|
```
|
|
254
101
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
## Completion and notifications
|
|
258
|
-
|
|
259
|
-
Completion requires a current-revision worker receipt, a settled worker identity, and independent checks. File checks verify regular-file presence, optional content/hash, and a changed digest from dispatch unless `allowUnchanged: true`. Command checks run without a shell, with bounded time/output and process-group termination on timeout. Reported artifacts must belong to the assignment. A worker saying “done,” a green terminal status, or its own claimed test result does not independently pass verification.
|
|
260
|
-
|
|
261
|
-
**An MCP server does not automatically wake an idle Codex desktop conversation.** Marionette uses a durable per-consumer inbox and a dashboard that polls every two seconds. While the dashboard is open, new completion/failure/question events produce visible alerts. Optional browser/OS notifications require **Desktop alerts** permission and an open dashboard. Browser closure does not lose the events; opening the inbox later retrieves unacknowledged events. MCP clients read on subsequent turns. No background conversation injection or desktop automation is installed.
|
|
262
|
-
|
|
263
|
-
The inbox displays up to 200 unacknowledged events per page. Marking them read advances only that dashboard's cursor; repeated acknowledgement exposes the next page. New-event alert polling is independent of this backlog. Other consumers retain their own cursors.
|
|
102
|
+
See the [SDK guide](skills/marionette/references/herdr-sdk.md). Use Marionette task APIs to manage workers; direct SDK calls do not create assignments.
|
|
264
103
|
|
|
265
|
-
##
|
|
266
|
-
|
|
267
|
-
- Restarting the supervisor reattaches using the saved workspace, terminal, agent name/kind, and native session identity. It does not repeat a prompt because a socket disconnected.
|
|
268
|
-
- A crash during pane creation, prompt delivery, or control delivery produces an `uncertain` task. Inspect the original pane and use `task_reconcile` with `delivered` or `not-delivered` and actual evidence. Do not guess. No automatic replay occurs.
|
|
269
|
-
- If creation lost its acknowledgement, no task prompt was attempted. `not-delivered` reconciliation checks for an absent tab or one matching untouched shell. An occupied or ambiguous tab is refused. For interrupted splits, the saved pre-creation membership identifies a possible new shell; moved, occupied, or ambiguous additions are refused. Original terminals are retained. If the identity cannot be established, resolve the named pane/session through Herdr before retrying.
|
|
270
|
-
- A crash during startup blocks for inspection and continuation of the existing pane. Restart during verification reruns checks. Design checks to be safe to repeat; Marionette cannot make arbitrary commands transactional.
|
|
271
|
-
- Retries require a failed/cancelled task and a settled previous worker, and consume the assignment's maximum of one to three attempts. They are explicit, never automatic for ambiguous work.
|
|
272
|
-
- Managed worktree creation persists `planned → creating → ready` before worker launch. Restart reuses a matching registered checkout. A creation interrupted before `ready` is reused only if clean at the pinned base; missing, incomplete, or mismatched checkouts fail preparation for inspection without reset, pruning, or destructive recreation. Once ready, retries preserve edits. An interrupted creation that cannot be validated requires manual inspection and repair or a new assignment.
|
|
273
|
-
- Ownership is a scheduling and reporting contract, **not an OS filesystem sandbox**. Agents retain their normal CLI permissions. Use isolated worktrees and each agent's permission controls where stronger isolation is required. Verification commands are trusted lead-selected local code.
|
|
274
|
-
- Marionette is a single-user local product. It does not provide remote multi-user authentication, deployment, billing, automatic Git merges, or session cleanup. Preserve existing Herdr sessions and use explicit project connections.
|
|
275
|
-
|
|
276
|
-
Private instance data is under `.marionette/`: configuration/token, SQLite WAL state, supervisor PID lock, and log. Stop the supervisor before making a consistent file backup of this directory. Keep the entire directory private. The repository ignores it, dependencies, build outputs, and `.runtime/` test artifacts. Do not remove state to resolve a connection problem.
|
|
277
|
-
|
|
278
|
-
## Development and verification
|
|
104
|
+
## Development
|
|
279
105
|
|
|
280
106
|
```sh
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
107
|
+
bun install --frozen-lockfile
|
|
108
|
+
bun run check
|
|
109
|
+
bun run test
|
|
110
|
+
bun run build
|
|
285
111
|
```
|
|
286
112
|
|
|
287
|
-
The
|
|
288
|
-
|
|
289
|
-
See [VERIFICATION.md](VERIFICATION.md) for the real three-agent acceptance evidence, browser results, and tested versions. [DESIGN.md](DESIGN.md) describes persistence, state transitions, and trust boundaries. `scripts/live-validation.mjs` inspects the opt-in live fixture retained on this machine; `start` intentionally refuses to duplicate an existing exercise. Its real results and private leases remain in `.runtime/`.
|
|
113
|
+
The source uses Effect v4, TypeScript diagnostics from `@effect/tsgo`, and anti-slop lint rules. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, checks, and the Effect skill.
|
|
290
114
|
|
|
291
|
-
##
|
|
115
|
+
## Documentation
|
|
292
116
|
|
|
293
|
-
|
|
117
|
+
- [Orchestration](ORCHESTRATION.md) — outcomes, models, task trees, handovers, and cleanup
|
|
118
|
+
- [Agent guide](skills/marionette/SKILL.md) — setup, assignments, controls, and recovery
|
|
119
|
+
- [Design](DESIGN.md) — persistence and trust boundaries
|
|
120
|
+
- [Verification](VERIFICATION.md) — tested behavior and operating limits
|
|
121
|
+
- [Changelog](CHANGELOG.md) · [Releases](RELEASING.md) · [MIT license](LICENSE)
|
package/RELEASING.md
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
# Releasing Marionette
|
|
2
2
|
|
|
3
|
-
The public repository is [theaileverage/marionette](https://github.com/theaileverage/marionette). Source changes go through pull requests into `main`. GitHub Actions runs formatting, metadata validation, type checks, tests, a production build and an installed-package smoke test on Linux and macOS with
|
|
3
|
+
The public repository is [theaileverage/marionette](https://github.com/theaileverage/marionette). Source changes go through pull requests into `main`. GitHub Actions runs formatting, metadata validation, type checks, tests, a production build and an installed-package smoke test on Linux and macOS with the pinned Bun runtime. These checks use protocol fixtures, not paid agent sessions.
|
|
4
4
|
|
|
5
5
|
## Prepare a version
|
|
6
6
|
|
|
7
7
|
From a clean checkout, create a branch and run:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
git switch -c release/0.
|
|
11
|
-
|
|
10
|
+
git switch -c release/0.3.0
|
|
11
|
+
bun run release:prepare 0.3.0
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
The helper updates `package.json`, `
|
|
14
|
+
The helper updates `package.json`, `src/version.ts` and a dated changelog section. The dependency-only `bun.lock` does not need a version bump. Replace the placeholder with concrete release notes. Do not change the setup protocol number unless the protocol changes. Update verification evidence when behavior changes, then run:
|
|
15
15
|
|
|
16
16
|
```sh
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
bun run format
|
|
18
|
+
bun run release:check
|
|
19
|
+
bun pm pack --destination /private/tmp
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
Commit the release preparation and open a pull request. `Required CI` must pass before merging. A tag must point at a commit contained in `main`; it must exactly match the package,
|
|
22
|
+
Commit the release preparation and open a pull request. `Required CI` must pass before merging. A tag must point at a commit contained in `main`; it must exactly match the package, runtime version and changelog. Stable versions go to npm `latest`; prereleases such as `0.3.0-beta.1` go to `next`.
|
|
23
23
|
|
|
24
24
|
## Publish the merged version
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
27
|
git switch main
|
|
28
28
|
git pull --ff-only
|
|
29
|
-
git tag -a v0.
|
|
30
|
-
git push origin v0.
|
|
29
|
+
git tag -a v0.3.0 -m 'Release 0.3.0'
|
|
30
|
+
git push origin v0.3.0
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
Node and npm remain isolated to the npm OIDC publishing step; application builds, tests, and package smoke checks run on Bun.
|
|
34
|
+
|
|
33
35
|
The `Release` workflow rebuilds and verifies the package, publishes the tested tarball using npm OIDC, compares the registry integrity, then creates a GitHub release with the tarball and `SHA256SUMS`. It uses pinned official actions, read-only checkout credentials, a dedicated `npm` environment, and an explicitly scoped OIDC permission. No npm token is stored in GitHub.
|
|
34
36
|
|
|
35
37
|
If a run fails after npm publication, rerun the failed job. Existing package integrity must match before the workflow continues; it never overwrites an npm version or a differing GitHub asset. You can also dispatch on the existing tag:
|
|
36
38
|
|
|
37
39
|
```sh
|
|
38
|
-
gh workflow run release.yml --ref v0.
|
|
40
|
+
gh workflow run release.yml --ref v0.3.0 -f tag=v0.3.0
|
|
39
41
|
```
|
|
40
42
|
|
|
41
43
|
Do not move or delete published tags. Fix a bad release with a new version. Registry publication is irreversible in the usual release workflow; removing a GitHub release does not remove its npm package.
|